/* ==========================================================================
   mylink — dashboard UI
   Editorial dark theme. Tokens only; no utility soup.
   Structure: 01 fonts · 02 tokens · 03 reset · 04 primitives · 05 masthead
              06 hero · 07 publish · 08 sites · 09 specs · 10 footer
              11 overlays · 12 toasts · 13 motion · 14 responsive
   ========================================================================== */

/* 01 · fonts — self-hosted latin subsets, no external requests -------------- */
@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/barlow-condensed-400.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/barlow-condensed-500.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/barlow-condensed-600.woff2") format("woff2"); }
/* Manrope ships as a variable latin file: one file, 400–600. */
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 400 600; font-display: swap; src: url("fonts/manrope-latin.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/ibm-plex-mono-400.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/ibm-plex-mono-500.woff2") format("woff2"); }

/* 02 · tokens --------------------------------------------------------------- */
:root {
  color-scheme: dark;

  --obsidian: #070909;
  --charcoal: #111514;
  --charcoal-2: #171b19;
  --bone: #ece8de;
  --mineral: #98a69f;
  --mineral-dim: #6f7a75;
  --amber: #e2a05b;
  --amber-deep: #9b5f2f;

  --line: rgba(236, 232, 222, 0.18);
  --line-strong: rgba(236, 232, 222, 0.38);

  --font-display: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
  --font-body: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --shell: 1320px;
  --gutter: clamp(20px, 4.6vw, 64px);

  --ease: cubic-bezier(0.2, 0.6, 0.2, 1);
}

/* 03 · reset ---------------------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--obsidian);
  color: var(--bone);
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* One warm light from the top right; the only gradient in the page. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(120% 70% at 82% -14%, rgba(226, 160, 91, 0.07), transparent 62%);
}

main, .masthead, .foot { position: relative; z-index: 1; }

h1, h2, h3, p, dl, dd, figure, blockquote { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { border-radius: 0; }
code { font-family: var(--font-mono); }

[hidden] { display: none !important; }

::selection { background: var(--amber); color: var(--obsidian); }

:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
}

:where([id]) { scroll-margin-top: 96px; }

/* 04 · primitives ----------------------------------------------------------- */
.wrap {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.mono { font-family: var(--font-mono); }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -56px;
  left: 8px;
  z-index: 100;
  padding: 10px 14px;
  background: var(--bone);
  color: var(--obsidian);
  font-family: var(--font-mono);
  font-size: 12px;
  text-decoration: none;
  transition: top 0.16s var(--ease);
}
.skip-link:focus { top: 8px; }

.icon { width: 16px; height: 16px; flex: none; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 12px 17px;
  border: 1px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--bone);
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  transition: background-color 0.18s var(--ease), color 0.18s var(--ease), border-color 0.18s var(--ease), opacity 0.18s var(--ease);
}
.btn:disabled { cursor: not-allowed; }
.btn--primary:disabled { background: rgba(226, 160, 91, 0.12); border-color: rgba(226, 160, 91, 0.3); color: var(--mineral); }
.btn .icon { width: 15px; height: 15px; }

.btn--primary { background: var(--amber); border-color: var(--amber); color: var(--obsidian); }
.btn--primary:hover:not(:disabled) { background: transparent; color: var(--amber); }

.btn--outline { border-color: var(--line-strong); color: var(--bone); }
.btn--outline:hover:not(:disabled) { border-color: var(--amber); color: var(--amber); }

.btn--quiet { padding-inline: 8px; color: var(--mineral); }
.btn--quiet:hover:not(:disabled) { color: var(--bone); }

.btn--tiny { padding: 8px 10px; font-size: 10.5px; letter-spacing: 0.08em; }

.btn--danger {
  border-color: var(--amber-deep);
  background: rgba(155, 95, 47, 0.14);
  color: var(--bone);
}
.btn--danger:hover:not(:disabled) { border-color: var(--amber); background: rgba(155, 95, 47, 0.26); }

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px clamp(16px, 3vw, 48px);
  margin-bottom: clamp(20px, 2.4vw, 30px);
}

.section-title {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 1.9vw, 1.6rem);
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--bone);
}

.section-index {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--mineral-dim);
}

.section-count {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.06em;
  color: var(--mineral);
}

.section-note {
  max-width: 54ch;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--mineral);
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: clamp(18px, 2.4vw, 26px);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--mineral);
}
.eyebrow__rule { width: 26px; height: 1px; flex: none; background: var(--amber); }

.notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border: 1px solid var(--amber-deep);
  border-left-width: 2px;
  background: rgba(155, 95, 47, 0.12);
  color: var(--bone);
  font-size: 13.5px;
  line-height: 1.5;
}
.notice .icon { width: 15px; height: 15px; margin-top: 2px; color: var(--amber); }
.notice--inline { margin-bottom: 22px; }
.notice-wrap { padding-block: 18px; }

/* 05 · masthead ------------------------------------------------------------- */
.masthead {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid var(--line);
  background: rgba(7, 9, 9, 0.88);
  -webkit-backdrop-filter: blur(12px) saturate(130%);
  backdrop-filter: blur(12px) saturate(130%);
}

.masthead__inner {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2.4vw, 36px);
  min-height: 74px;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--bone);
}
.wordmark__mark { color: var(--amber); flex: none; }
.wordmark__text {
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.02em;
}

.masthead__who {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mineral);
}
.masthead__dot { color: var(--mineral); }
.masthead__role { color: var(--mineral); opacity: 0.78; }

.masthead__actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }

/* 06 · hero ----------------------------------------------------------------- */
.hero { padding-block: clamp(48px, 6.6vw, 100px) clamp(34px, 4.4vw, 60px); }

.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(30px, 4vw, 64px);
  align-items: end;
}

.hero__lead { min-width: 0; }

.hero__title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 5.9vw, 5.2rem);
  font-weight: 600;
  line-height: 0.94;
  letter-spacing: -0.004em;
  color: var(--bone);
  text-wrap: balance;
}

.hero__accent {
  border-bottom: 2px solid var(--amber);
  padding-bottom: 0.06em;
}

.hero__sub {
  max-width: 56ch;
  margin-top: clamp(20px, 2.4vw, 28px);
  font-size: clamp(15px, 1.15vw, 16.5px);
  line-height: 1.62;
  color: var(--mineral);
}
.hero__sub code { font-size: 0.88em; color: var(--bone); }

.hero__status {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  max-width: 62ch;
  margin-top: 22px;
  font-size: 11.5px;
  line-height: 1.6;
  letter-spacing: 0.03em;
  color: var(--amber);
}
.hero__status.is-error {
  padding: 11px 14px;
  border: 1px solid var(--amber-deep);
  border-left-width: 2px;
  background: rgba(155, 95, 47, 0.1);
  color: var(--bone);
  letter-spacing: 0.01em;
}
.hero__status .icon { width: 15px; height: 15px; margin-top: 1px; }

.boot {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 22px;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mineral);
}
.boot__dot { width: 5px; height: 5px; flex: none; background: var(--amber); animation: blink 1.5s ease-in-out infinite; }

.titleblock {
  display: grid;
  align-content: end;
  border-top: 1px solid var(--line-strong);
  min-width: 0;
}
.titleblock__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.titleblock dt {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--mineral);
}
.titleblock dd {
  font-size: 11.5px;
  letter-spacing: 0.02em;
  color: var(--bone);
  overflow-wrap: anywhere;
}

/* dashboard: same hero, tightened so the publish zone clears the fold */
html[data-mode="dashboard"] .hero { padding-block: clamp(32px, 3.6vw, 56px) clamp(24px, 3vw, 38px); }
html[data-mode="dashboard"] .hero__title { font-size: clamp(2rem, 3.5vw, 3.25rem); }
html[data-mode="dashboard"] .hero__sub { max-width: 66ch; font-size: 15px; }
html[data-mode="dashboard"] .titleblock { align-content: start; }

/* mode switches */
html[data-mode="landing"] .auth-only { display: none; }
html[data-mode="dashboard"] .anon-only { display: none; }

/* 07 · publish -------------------------------------------------------------- */
.publish {
  padding-block: clamp(28px, 3.6vw, 52px) clamp(34px, 4.4vw, 60px);
  border-top: 1px solid var(--line-strong);
}

.dropzone {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px clamp(24px, 3vw, 40px);
  min-height: 150px;
  padding: clamp(22px, 2.8vw, 32px) clamp(22px, 2.8vw, 34px);
  border: 1px solid var(--line);
  background-color: var(--charcoal);
  background-image: linear-gradient(180deg, rgba(236, 232, 222, 0.022), transparent 62%);
  cursor: pointer;
  transition: border-color 0.2s var(--ease), background-color 0.2s var(--ease);
}

/* crop marks */
.dropzone::before,
.dropzone::after {
  content: "";
  position: absolute;
  width: 13px;
  height: 13px;
  border: 0 solid var(--amber-deep);
  transition: border-color 0.2s var(--ease);
}
.dropzone::before { top: -1px; left: -1px; border-top-width: 1px; border-left-width: 1px; }
.dropzone::after { right: -1px; bottom: -1px; border-right-width: 1px; border-bottom-width: 1px; }

.dropzone.is-busy { cursor: default; }
.dropzone:hover { border-color: var(--line-strong); background-color: var(--charcoal-2); }
.dropzone:hover::before,
.dropzone:hover::after { border-color: var(--amber); }

body.is-dragging .dropzone { border-color: var(--amber); background-color: var(--charcoal-2); }
body.is-dragging .dropzone::before,
body.is-dragging .dropzone::after { border-color: var(--amber); }

.dropzone__lead { display: flex; align-items: flex-start; gap: clamp(14px, 2vw, 22px); min-width: 0; }
.dropzone__icon { width: 28px; height: 28px; flex: none; margin-top: 3px; color: var(--amber); }
.dropzone__copy { min-width: 0; }

.dropzone__title {
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 2.3vw, 2rem);
  font-weight: 500;
  line-height: 1.06;
  color: var(--bone);
}
.dropzone__hint {
  max-width: 74ch;
  margin-top: 8px;
  font-size: 11px;
  line-height: 1.62;
  letter-spacing: 0.02em;
  color: var(--mineral);
}

.dropzone__actions { display: flex; flex-wrap: wrap; gap: 10px; }

.dropzone__drop {
  position: absolute;
  top: 12px;
  right: 14px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--amber);
  opacity: 0;
  transition: opacity 0.16s var(--ease);
}
body.is-dragging .dropzone__drop { opacity: 1; }

/* the signed-out zone is an invitation, not a control */
.dropzone--locked { cursor: default; background-color: transparent; }
.dropzone--locked:hover { background-color: var(--charcoal); }
.dropzone--locked .dropzone__icon { color: var(--mineral); }
.dropzone--locked::before,
.dropzone--locked::after { border-color: var(--line-strong); }

.dropzone__progress { flex: 1 1 100%; }
.progress { max-width: 560px; }
.progress__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 9px;
  font-size: 9.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mineral);
}
.progress__track { height: 2px; background: var(--line); overflow: hidden; }
.progress__fill {
  display: block;
  width: 0;
  height: 100%;
  background: var(--amber);
  transition: width 0.16s linear;
}

/* details strip */
.details {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(18px, 2.4vw, 28px);
  margin-top: clamp(22px, 2.6vw, 30px);
  align-items: start;
}

.field { min-width: 0; }
.field__label {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 5px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--mineral);
}
.field__opt { letter-spacing: 0.08em; text-transform: none; opacity: 0.72; }

.input {
  width: 100%;
  padding: 7px 0 9px;
  border: 0;
  border-bottom: 1px solid var(--line-strong);
  border-radius: 0;
  background: transparent;
  color: var(--bone);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.4;
  transition: border-color 0.18s var(--ease);
}
.input--mono { font-family: var(--font-mono); font-size: 13.5px; letter-spacing: 0.01em; }
.input::placeholder { color: var(--mineral); opacity: 0.72; }
.input:focus { outline: none; border-bottom-color: var(--amber); }
.input:focus-visible { outline: 2px solid var(--amber); outline-offset: 4px; }
.input[aria-invalid="true"] { border-bottom-color: var(--amber); }

.field__preview {
  margin-top: 8px;
  font-size: 10.5px;
  line-height: 1.5;
  letter-spacing: 0.02em;
  color: var(--mineral);
  overflow-wrap: anywhere;
}
.field__preview [data-slug-token] { color: var(--bone); }
.field__error { margin-top: 7px; font-size: 11.5px; line-height: 1.5; color: var(--amber); }

.details__submit { display: flex; align-items: center; gap: 10px; padding-top: 20px; }

/* 08 · sites ---------------------------------------------------------------- */
.sites {
  padding-block: clamp(28px, 3.6vw, 52px) clamp(40px, 5vw, 64px);
  border-top: 1px solid var(--line-strong);
}
.section-head--sites { align-items: flex-end; }

.search {
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(330px, 100%);
  padding: 5px 0;
  border-bottom: 1px solid var(--line-strong);
  transition: border-color 0.18s var(--ease);
}
.search:focus-within { border-bottom-color: var(--amber); }
.search__icon { width: 15px; height: 15px; flex: none; color: var(--mineral); }
.search__input {
  flex: 1;
  min-width: 0;
  padding: 4px 0;
  border: 0;
  background: transparent;
  color: var(--bone);
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.4;
}
.search__input::placeholder { color: var(--mineral); opacity: 0.72; }
.search__input:focus { outline: none; }
.search__input:focus-visible { outline: 2px solid var(--amber); outline-offset: 4px; }
.search__input::-webkit-search-decoration,
.search__input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.search__kbd {
  flex: none;
  padding: 3px 5px;
  border: 1px solid var(--line);
  font-size: 9.5px;
  line-height: 1;
  color: var(--mineral);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr));
  column-gap: clamp(24px, 3.6vw, 54px);
  row-gap: 0;
  border-bottom: 1px solid var(--line);
}
.grid:empty { border-bottom: 0; }

.card {
  display: flex;
  flex-direction: column;
  gap: 11px;
  min-width: 0;
  padding: clamp(18px, 2.2vw, 26px) 0 clamp(20px, 2.4vw, 28px);
  border-top: 1px solid var(--line);
}
.card.is-new { animation: card-settle 1.6s var(--ease) both; }
.card:focus-visible { outline: 2px solid var(--amber); outline-offset: 4px; }
.card { scroll-margin-top: 96px; }

.card__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.card__name {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 1.8vw, 1.6rem);
  font-weight: 500;
  line-height: 1.06;
  color: var(--bone);
  overflow-wrap: anywhere;
}
.card__time {
  flex: none;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mineral);
  white-space: nowrap;
}
.card__url {
  width: fit-content;
  max-width: 100%;
  border-bottom: 1px solid transparent;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.4;
  color: color-mix(in srgb, var(--bone) 74%, transparent);
  text-decoration: none;
  overflow-wrap: anywhere;
  transition: color 0.16s var(--ease), border-color 0.16s var(--ease);
}
.card__url:hover { color: var(--amber); border-bottom-color: var(--amber-deep); }

.card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 3px 8px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.05em;
  color: var(--mineral);
}
.card__meta .sep { color: var(--mineral-dim); }

.card__actions { display: flex; flex-wrap: wrap; gap: 0 14px; margin-top: auto; padding-top: 4px; }

.action {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 0;
  border: 0;
  background: none;
  color: var(--mineral);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.16s var(--ease);
}
.action .icon { width: 14px; height: 14px; }
.action:hover { color: var(--amber); }
.action:disabled { opacity: 0.45; cursor: not-allowed; }

.state {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: clamp(24px, 3vw, 34px);
  border: 1px solid var(--line);
  background: rgba(236, 232, 222, 0.014);
}
.state--quiet { background: transparent; }
.state__title { font-family: var(--font-display); font-size: 1.45rem; font-weight: 500; line-height: 1.1; color: var(--bone); }
.state__body { max-width: 62ch; font-size: 13.5px; line-height: 1.6; color: var(--mineral); }
.state__body .mono { color: var(--bone); }

/* 09 · specs (landing only) ------------------------------------------------- */
.specs {
  padding-block: clamp(28px, 3.6vw, 52px) clamp(44px, 5.4vw, 68px);
  border-top: 1px solid var(--line-strong);
}
.specs__grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(20px, 3vw, 38px); }
.spec { padding-top: 18px; border-top: 1px solid var(--line); }
.spec__index { margin-bottom: 12px; font-size: 10px; font-weight: 500; letter-spacing: 0.14em; color: var(--amber); }
.spec__title { margin-bottom: 8px; font-family: var(--font-display); font-size: clamp(1.45rem, 2vw, 1.75rem); font-weight: 500; line-height: 1.1; color: var(--bone); }
.spec__body { max-width: 46ch; font-size: 13.5px; line-height: 1.62; color: var(--mineral); }
.spec__body .mono { color: var(--bone); }

/* 10 · footer --------------------------------------------------------------- */
.foot { border-top: 1px solid var(--line); padding-block: clamp(24px, 3vw, 34px); }
.foot__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 32px; }
.foot__brand { display: flex; align-items: baseline; gap: 14px; }
.foot__wordmark { font-family: var(--font-display); font-size: 1.1rem; font-weight: 600; letter-spacing: 0.02em; color: var(--bone); }
.foot__claim { font-size: 12px; color: var(--mineral); }
.foot__api { font-size: 10px; letter-spacing: 0.06em; color: var(--mineral); }
.foot__link { color: var(--bone); text-decoration: none; border-bottom: 1px solid var(--amber-deep); padding-bottom: 1px; }
.foot__link:hover { color: var(--amber); border-bottom-color: var(--amber); }

/* 11 · overlays ------------------------------------------------------------- */
html.has-overlay,
html.has-overlay body { overflow: hidden; }

.scrim {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: clamp(14px, 4vw, 32px);
  background: rgba(4, 6, 6, 0.78);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity 0.2s var(--ease);
}
.scrim.is-open { opacity: 1; }
.scrim--drawer { place-items: stretch; justify-items: end; padding: 0; }

.dialog {
  display: flex;
  flex-direction: column;
  gap: 18px;
  width: 100%;
  max-width: 470px;
  max-height: calc(100dvh - 2 * clamp(14px, 4vw, 32px));
  overflow: auto;
  padding: clamp(22px, 3vw, 30px);
  border: 1px solid var(--line-strong);
  background: var(--charcoal);
  transform: translateY(10px);
  transition: transform 0.2s var(--ease);
}
.scrim.is-open .dialog { transform: none; }

.dialog--drawer {
  max-width: 540px;
  max-height: 100dvh;
  height: 100%;
  padding-bottom: 0;
  border-width: 0 0 0 1px;
  border-color: var(--line-strong);
  transform: translateX(18px);
}
.scrim.is-open .dialog--drawer { transform: none; }

.dialog__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.dialog__eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 9.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--mineral);
}
.dialog__eyebrow::before { content: ""; width: 18px; height: 1px; flex: none; background: var(--amber); }
.dialog__title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2.6vw, 1.85rem);
  font-weight: 500;
  line-height: 1.05;
  color: var(--bone);
  overflow-wrap: anywhere;
}
.dialog__body { font-size: 14px; line-height: 1.6; color: var(--mineral); }
.dialog__body .mono { color: var(--bone); }
.dialog__actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; padding-top: 4px; }

.close-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex: none;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--mineral);
  cursor: pointer;
  transition: color 0.16s var(--ease), border-color 0.16s var(--ease);
}
.close-btn:hover { color: var(--bone); border-color: var(--line-strong); }
.close-btn .icon { width: 15px; height: 15px; }

/* login */
.login { display: grid; gap: 16px; }
.login .field__help { font-size: 10px; line-height: 1.65; letter-spacing: 0.02em; color: var(--mineral); }

.tokenfield { display: flex; align-items: stretch; border-bottom: 1px solid var(--line-strong); }
.tokenfield:focus-within { border-bottom-color: var(--amber); }
.tokenfield .input { border-bottom: 0; padding-right: 8px; }
.tokenfield .input:focus { outline: none; }
.tokenfield .input:focus-visible { outline: 2px solid var(--amber); outline-offset: 4px; }

.reveal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  flex: none;
  border: 0;
  background: transparent;
  color: var(--mineral);
  cursor: pointer;
}
.reveal:hover { color: var(--amber); }
.reveal .icon { width: 16px; height: 16px; }

.form-error { display: flex; align-items: flex-start; gap: 8px; font-size: 12px; line-height: 1.5; color: var(--amber); }
.form-error .icon { width: 14px; height: 14px; margin-top: 2px; }

/* history drawer */
.hist { display: flex; flex: 1; flex-direction: column; min-height: 0; }
.hist__meta { font-size: 9.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--mineral); }

.versions { margin-top: 18px; border-top: 1px solid var(--line); }
.version {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px 14px;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}
.version__time {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.35;
  color: var(--bone);
}
.version__meta {
  margin-top: 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1.45;
  letter-spacing: 0.03em;
  color: var(--mineral);
  overflow-wrap: anywhere;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 6px;
  background: var(--amber);
  color: var(--obsidian);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.chip::before { content: ""; width: 4px; height: 4px; background: currentColor; }

.hist__foot { margin-top: auto; padding: 16px 0 26px; border-top: 1px solid var(--line-strong); }
.hist__note { max-width: 46ch; margin-bottom: 14px; font-size: 10px; line-height: 1.7; letter-spacing: 0.02em; color: var(--mineral); }
.hist__download {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  color: var(--bone);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  transition: color 0.16s var(--ease), border-color 0.16s var(--ease);
}
.hist__download:hover { color: var(--amber); border-bottom-color: var(--amber-deep); }
.hist__download .icon { width: 15px; height: 15px; }
.hist__loading { display: flex; align-items: center; gap: 9px; padding: 22px 0; font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--mineral); }
.hist__error { display: grid; gap: 12px; justify-items: start; padding: 4px 0 8px; font-size: 12.5px; line-height: 1.55; color: var(--amber); }

/* 12 · toasts --------------------------------------------------------------- */
@media (min-width: 1100px) {
  html.has-drawer .toasts { right: calc(min(540px, 48vw) + 20px); }
}
.toasts {
  position: fixed;
  right: var(--gutter);
  bottom: var(--gutter);
  z-index: 90;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  width: min(420px, calc(100vw - 2 * var(--gutter)));
  pointer-events: none;
}

.toast {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 12px;
  align-items: start;
  width: 100%;
  padding: 13px 12px 13px 15px;
  border: 1px solid var(--line-strong);
  border-left: 2px solid var(--amber);
  background: var(--charcoal-2);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.42);
  pointer-events: auto;
  animation: toast-in 0.22s var(--ease) both;
}
.toast--error { border-left-color: var(--amber-deep); }
.toast.is-going { opacity: 0; transform: translateY(4px); transition: opacity 0.18s var(--ease), transform 0.18s var(--ease); }
.toast__title { font-family: var(--font-mono); font-size: 9.5px; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase; color: var(--mineral); }
.toast__detail { margin-top: 5px; font-family: var(--font-mono); font-size: 11.5px; line-height: 1.5; color: var(--bone); overflow-wrap: anywhere; }
.toast__detail a { color: inherit; }
.toast__actions { display: flex; gap: 14px; margin-top: 9px; }
.toast__action {
  padding: 0;
  border: 0;
  border-bottom: 1px solid var(--amber-deep);
  background: none;
  color: var(--amber);
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
}
.toast__action:hover { border-bottom-color: var(--amber); }
.toast__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--mineral);
  cursor: pointer;
}
.toast__close:hover { color: var(--bone); }
.toast__close .icon { width: 13px; height: 13px; }

/* 13 · motion --------------------------------------------------------------- */
@keyframes blink { 50% { opacity: 0.2; } }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes card-settle {
  0% { background-color: rgba(226, 160, 91, 0.09); }
  70% { background-color: rgba(226, 160, 91, 0.03); }
  100% { background-color: transparent; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* 14 · responsive ----------------------------------------------------------- */
@media (min-width: 760px) {
  .specs__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(22px, 3vw, 38px); }
}

@media (min-width: 1000px) {
  .hero__grid { grid-template-columns: minmax(0, 1fr) minmax(218px, 268px); }
  .titleblock { width: 100%; }
}

@media (min-width: 860px) {
  .details { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; }
  .details__submit { justify-content: flex-end; }
}

@media (max-width: 999px) {
  .hero__grid { gap: 32px; }
  .titleblock { max-width: 420px; }
}

@media (max-width: 860px) {
  .details__submit { padding-top: 4px; }
}

@media (max-width: 760px) {
  .masthead__role { display: none; }
  .masthead__dot { display: none; }
  .section-head { flex-direction: column; align-items: flex-start; gap: 12px; }
  .section-head--sites { align-items: stretch; }
  .search { width: 100%; }
  .card__head { flex-direction: column; align-items: flex-start; gap: 5px; }
  .card__time { order: 2; }
  .foot__claim { display: none; }
  .dialog--drawer { max-width: none; }
}

@media (max-width: 560px) {
  .masthead__who { font-size: 9.5px; letter-spacing: 0.1em; }
  .masthead__inner { min-height: 64px; gap: 12px; }
  .hero { padding-block: 36px 30px; }
  .dropzone { flex-direction: column; align-items: flex-start; gap: 18px; padding: 20px; }
  .dropzone__actions { width: 100%; }
  .dropzone__actions .btn { flex: 1 1 auto; }
  .dropzone__title { font-size: 1.55rem; }
  .details__submit { width: 100%; }
  .details__submit .btn--primary { flex: 1; }
  .toasts { right: 0; left: 0; bottom: 0; width: auto; max-width: none; padding: 10px; }
  .toast { animation: none; }
  .scrim { padding: 0; place-items: end stretch; }
  .dialog { max-width: none; max-height: 92dvh; border-width: 1px 0 0; transform: translateY(14px); }
  .dialog--drawer { max-height: 100dvh; border-width: 0; }
  .dialog__actions .btn { flex: 1 1 auto; }
  .version { grid-template-columns: minmax(0, 1fr); }
  .version .btn { justify-self: start; }
  .foot { padding-bottom: calc(clamp(24px, 3vw, 34px) + env(safe-area-inset-bottom, 0px)); }
}

@media (prefers-reduced-motion: reduce) {
  .toast { animation: none; }
  .card.is-new { animation: none; }
}
