/* ==========================================================================
   layout.css — masthead, hero, sections, footer
   ========================================================================== */

/* ---------- Masthead ---------- */
.masthead {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--rule);
}
.masthead__in {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  min-height: 60px;
  padding-block: var(--s-2);
}
.brand {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  font-family: var(--font-display);
  font-weight: 650;
  font-size: var(--t-base);
  letter-spacing: -0.015em;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}
.brand:hover { background: none; color: var(--ink); }
/* The masthead must never be what pushes a phone into sideways scrolling:
   the wordmark shrinks and truncates before the controls give up any room. */
.brand { min-width: 0; flex: 0 1 auto; overflow: hidden; }
.brand > span:last-child { overflow: hidden; text-overflow: ellipsis; }
.mast__tools { flex: none; }
@media (max-width: 720px) { .brand__sub { display: none; } }
@media (max-width: 420px) {
  .masthead__in { gap: var(--s-2); }
  .brand { font-size: var(--t-sm); }
}
.brand__mark {
  display: inline-grid;
  place-items: center;
  width: 28px; height: 28px;
  border-radius: var(--r-1);
  background: var(--ink);
  color: var(--ink-inv);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  flex: none;
}
.brand__sub { color: var(--ink-3); font-family: var(--font-ui); font-size: var(--t-xs); font-weight: 600; letter-spacing: 0.04em; }

.jump { display: flex; gap: 2px; margin-left: auto; }
.jump a {
  padding: 0.34rem 0.66rem;
  border-radius: var(--r-2);
  font-size: var(--t-sm);
  font-weight: 620;
  color: var(--ink-2);
  text-decoration: none;
  white-space: nowrap;
}
.jump a:hover { background: var(--sunk); color: var(--ink); }
.jump a[aria-current="true"] { background: var(--card); box-shadow: inset 0 0 0 1px var(--rule-strong); color: var(--ink); }
@media (max-width: 1080px) { .jump { display: none; } }

.mast__tools { display: flex; align-items: center; gap: var(--s-2); margin-left: auto; }
@media (min-width: 1081px) { .mast__tools { margin-left: var(--s-3); } }

.iconbtn {
  display: inline-grid;
  place-items: center;
  width: 40px; height: 40px;
  border: 1px solid var(--rule);
  border-radius: var(--r-2);
  background: var(--card);
  color: var(--ink-2);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  transition: all var(--d-2) var(--e-out);
}
.iconbtn:hover { color: var(--ink); border-color: var(--ink-3); transform: translateY(-1px); }
.iconbtn:active { transform: translateY(1px); }

/* Progress dial in the masthead */
.progchip {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  height: 40px;
  padding: 0 var(--s-3) 0 var(--s-2);
  border: 1px solid var(--rule);
  border-radius: var(--r-pill);
  background: var(--card);
  cursor: pointer;
  font-size: var(--t-xs);
  font-weight: 750;
  color: var(--ink-2);
  transition: all var(--d-2) var(--e-out);
}
.progchip:hover { border-color: var(--g3); color: var(--ink); }
.progdial { width: 26px; height: 26px; flex: none; transform: rotate(-90deg); }
.progdial circle { fill: none; stroke-width: 4; }
.progdial .track { stroke: var(--sunk); }
.progdial .val {
  stroke: var(--g3);
  stroke-linecap: round;
  stroke-dasharray: 62.83;      /* 2*pi*10 */
  stroke-dashoffset: 62.83;
  transition: stroke-dashoffset var(--d-4) var(--e-out);
}
@media (max-width: 700px) { .progchip__txt { display: none; } .progchip { padding: 0 var(--s-2); } }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: clamp(var(--s-6), 6vw, var(--s-9)) 0 var(--s-7);
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute;
  inset: -20% -10% auto -10%;
  height: 70%;
  z-index: -1;
  background:
    radial-gradient(48% 60% at 18% 20%, color-mix(in srgb, var(--g1) 20%, transparent), transparent 70%),
    radial-gradient(44% 58% at 52% 10%, color-mix(in srgb, var(--g2) 17%, transparent), transparent 70%),
    radial-gradient(52% 64% at 84% 26%, color-mix(in srgb, var(--g3) 22%, transparent), transparent 70%);
  filter: blur(8px);
  opacity: 0.85;
  pointer-events: none;
}
.hero__grid {
  display: grid;
  gap: clamp(var(--s-5), 4vw, var(--s-7));
  grid-template-columns: minmax(0, 1.18fr) minmax(0, 0.82fr);
  align-items: start;
}
@media (max-width: 940px) { .hero__grid { grid-template-columns: 1fr; } }

.hero h1 { margin-bottom: var(--s-4); }
.hero h1 .hl {
  background: linear-gradient(transparent 66%, color-mix(in srgb, var(--g1) 30%, transparent) 66%,
                              color-mix(in srgb, var(--g1) 30%, transparent) 94%, transparent 94%);
  padding-inline: 0.05em;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
.hero__claim {
  margin-top: var(--s-5);
  display: grid;
  gap: var(--s-3);
}
.claimline {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--s-3);
  align-items: start;
  padding: var(--s-3) var(--s-4);
  border: 1px solid var(--rule);
  border-left: 4px solid var(--vc, var(--rule-strong));
  border-radius: var(--r-2);
  background: var(--card);
  font-size: var(--t-sm);
  box-shadow: var(--sh-1);
}
.claimline[data-v="confirmed"] { --vc: var(--good); }
.claimline[data-v="qualified"] { --vc: var(--warn); }
.claimline[data-v="corrected"] { --vc: var(--bad); }
.claimline__stamp {
  font-size: var(--t-xs);
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--vc);
  border: 1px solid color-mix(in srgb, var(--vc) 45%, transparent);
  border-radius: var(--r-1);
  padding: 0.12rem 0.42rem;
  white-space: nowrap;
  line-height: 1.4;
}
.claimline b { display: block; margin-bottom: 0.1em; }

/* Verified stamp */
.stamp {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  padding: 0.3rem 0.8rem 0.34rem;
  border: 1.5px solid var(--rule-strong);
  border-radius: var(--r-2);
  background: color-mix(in srgb, var(--card) 70%, transparent);
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--ink-2);
  text-transform: uppercase;
}
.stamp__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--good); flex: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--good) 24%, transparent); }

/* Generation shelf in the hero */
.shelf { display: grid; gap: var(--s-3); }
.shelfcard {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: var(--s-3);
  align-items: center;
  padding: var(--s-4);
  border: 1px solid var(--rule);
  border-left: 5px solid var(--gen);
  border-radius: var(--r-3);
  background: linear-gradient(100deg, var(--gen-soft), var(--card) 62%);
  box-shadow: var(--sh-1);
  text-align: left;
  cursor: pointer;
  width: 100%;
  font: inherit;
  color: inherit;
  transition: transform var(--d-2) var(--e-out), box-shadow var(--d-2) var(--e-out);
}
.shelfcard:hover { transform: translateX(3px); box-shadow: var(--sh-2); }
.shelfcard:active { transform: translateX(1px) scale(0.995); }
.shelfcard__glyph {
  display: inline-grid; place-items: center;
  width: 42px; height: 42px;
  border-radius: var(--r-2);
  background: var(--card);
  border: 1px solid color-mix(in srgb, var(--gen) 45%, transparent);
  color: var(--gen);
  font-size: 1.2rem;
  flex: none;
}
.shelfcard__name { font-family: var(--font-display); font-size: var(--t-md); font-weight: 650; letter-spacing: -0.015em; display: block; }
.shelfcard__meta { display: block; font-size: var(--t-xs); color: var(--ink-3); font-weight: 620;
  letter-spacing: 0.01em; line-height: 1.4; margin-top: 2px; }
.shelfcard__price { font-family: var(--font-mono); font-size: var(--t-md); font-weight: 700;
  color: var(--ink); white-space: nowrap; text-align: right; }
.shelfcard__price small { display: block; font-size: 0.58em; color: var(--ink-3); font-weight: 600;
  text-align: right; line-height: 1.35; max-width: 11ch; white-space: normal; margin-left: auto; }
.shelfcard__state {
  position: absolute; top: -9px; right: var(--s-4);
  font-size: 0.62rem; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase;
  padding: 0.1rem 0.45rem;
  border-radius: var(--r-pill);
  background: var(--card); border: 1px solid var(--gen); color: var(--gen);
}

/* ---------- Sections ---------- */
.section { padding: clamp(var(--s-6), 5.5vw, var(--s-9)) 0; position: relative; }
.section--alt { background: color-mix(in srgb, var(--paper-2) 70%, transparent); border-block: 1px solid var(--rule); }
.section__head { max-width: 74ch; margin-bottom: var(--s-5); }
.section__head p:last-child { margin-bottom: 0; }

.grid2 { display: grid; gap: var(--s-4); grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); }
.grid3 { display: grid; gap: var(--s-4); grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); }

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--rule);
  background: var(--sunk);
  padding: var(--s-7) 0 var(--s-6);
  font-size: var(--t-sm);
}
.footer__grid { display: grid; gap: var(--s-5); grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); }
.footer h3 { font-family: var(--font-ui); font-size: var(--t-sm); font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); margin-bottom: var(--s-3); }
.footer ul { list-style: none; padding: 0; }
.footer li { margin-bottom: var(--s-2); }
.footer__legal { margin-top: var(--s-6); padding-top: var(--s-4); border-top: 1px solid var(--rule); color: var(--ink-3); font-size: var(--t-xs); }

/* ---------- Source list ---------- */
.srclist { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--s-2); }
.srcitem {
  display: grid;
  grid-template-columns: 2.6rem 1fr;
  gap: var(--s-3);
  padding: var(--s-3);
  border: 1px solid var(--rule);
  border-radius: var(--r-2);
  background: var(--card);
  scroll-margin-top: 6rem;
}
.srcitem:target { border-color: var(--g3); box-shadow: 0 0 0 3px var(--g3-soft); }
/* Grid children default to min-width:auto, which refuses to shrink below a long
   unbroken URL and pushes the page sideways on a phone. */
.srcitem > * { min-width: 0; }
.srcitem__n { font-family: var(--font-mono); font-weight: 800; color: var(--ink-3); font-size: var(--t-sm); }
.srcitem__t { font-weight: 680; display: block; }
.srcitem__u {
  display: inline-block;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
  font-size: var(--t-xs);
  font-family: var(--font-mono);
}
.srcitem blockquote, .srcitem p { overflow-wrap: anywhere; }
.srcitem__m { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; margin-top: 4px; font-size: var(--t-xs); color: var(--ink-3); }
