/* ==========================================================================
   ANNEAL — home page sections.
   Shell, tokens and primitives are in base.css; inner pages are in pages.css.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */

.hero {
  position: relative;
  isolation: isolate;
  min-height: min(92vh, 880px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(56px, 9vw, 108px) 0 clamp(78px, 8vw, 104px);
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

/* The canvas is given an explicit size rather than being stretched between
   offsets with `width: auto` — an auto-width canvas falls back to its
   INTRINSIC width, which the resize handler then reads back off clientWidth,
   and layout and buffer chase each other. */
#grain {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  display: block;
}

/* Two jobs: keep the ink legible over a field that has bright boundaries in
   it, and hand the bottom edge back to the page background so the hero does
   not end on a hard line. */
.hero-veil {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(
      100deg,
      var(--ground) 0%,
      color-mix(in srgb, var(--ground) 92%, transparent) 34%,
      color-mix(in srgb, var(--ground) 58%, transparent) 62%,
      color-mix(in srgb, var(--ground) 40%, transparent) 100%
    ),
    linear-gradient(
      to bottom,
      color-mix(in srgb, var(--ground) 70%, transparent) 0%,
      transparent 22%,
      transparent 62%,
      var(--ground) 100%
    );
}

.hero-inner { max-width: 860px; }
.hero-inner .pill { margin-bottom: 26px; }
.hero h1 { margin-bottom: 24px; }
.hero h1 .hot {
  color: var(--ember);
  /* The heat bloom around the word, matching the boundaries behind it. */
  text-shadow: 0 0 42px color-mix(in srgb, var(--ember) 42%, transparent);
}
.hero .lede { max-width: 60ch; }
.hero .lede b { color: var(--ink); font-weight: 600; }

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

/* The mill certificate strip. */
.cert {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin: 44px 0 0;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--ground) 72%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  overflow: hidden;
  max-width: 640px;
}
.cert > div {
  flex: 1 1 130px;
  min-width: 0;
  padding: 12px 16px;
  border-right: 1px solid var(--line);
}
.cert > div:last-child { border-right: 0; }
.cert dt {
  font-family: var(--mono);
  font-size: .62rem;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 5px;
}
.cert dd {
  margin: 0;
  font-family: var(--mono);
  font-size: .88rem;
  letter-spacing: -.02em;
  color: var(--ink);
}
.cert dd.pending { color: var(--straw); }

/* The caption belongs to the canvas and has to describe what is actually
   drawn — the grain field is visible at every width, so there is one caption. */
.hero-caption {
  position: relative;
  width: 100%;
  max-width: var(--wrap);
  margin: clamp(40px, 6vw, 72px) auto 0;
  padding: 0 26px;
  font-size: .84rem;
  line-height: 1.6;
  color: var(--faint);
  max-width: min(var(--wrap), 100%);
}
.hero-caption b { color: var(--ink-3); font-weight: 600; }
.hero-caption i { font-style: italic; color: var(--ink-3); }
@media (min-width: 901px) {
  .hero-caption { max-width: calc(var(--wrap)); padding-right: 40%; }
}

/* --------------------------------------------------------------------------
   01 — before / after
   -------------------------------------------------------------------------- */

.ba {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: clamp(16px, 2.4vw, 30px);
  align-items: stretch;
}
@media (max-width: 900px) {
  .ba { grid-template-columns: 1fr; }
  .ba-arrow { transform: rotate(90deg); justify-self: center; }
}

.ba-col {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  background: var(--card);
}
.ba-before { background: color-mix(in srgb, var(--card) 92%, var(--ground)); }
.ba-after {
  border-color: color-mix(in srgb, var(--ember) 24%, transparent);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--ember) 5%, transparent), transparent 42%),
    var(--card);
}

.ba-head { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.ba-head h3 { margin: 0; }
.ba-after .ba-head h3 { color: var(--ember); }

.ba-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.ba-col li {
  position: relative;
  padding-left: 22px;
  font-size: .95rem;
  color: var(--ink-2);
  line-height: 1.55;
}
.ba-col li b { color: var(--ink); font-weight: 600; }
.ba-col li::before {
  content: '';
  position: absolute;
  left: 0; top: .55em;
  width: 9px; height: 1px;
  background: var(--line-3);
}
.ba-after li::before { background: var(--ember); }

.ba-arrow {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  align-self: center;
}
.ba-op {
  font-family: var(--mono);
  font-size: .64rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ember);
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}
@media (max-width: 900px) { .ba-op { writing-mode: horizontal-tb; transform: rotate(-90deg); } }

.note {
  margin: 30px 0 0;
  max-width: 74ch;
  padding-left: 18px;
  border-left: 2px solid color-mix(in srgb, var(--straw) 50%, transparent);
  color: var(--ink-3);
  font-size: .95rem;
}

/* --------------------------------------------------------------------------
   02 — rails
   -------------------------------------------------------------------------- */

.rails {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(16px, 2vw, 24px);
}
@media (max-width: 980px) { .rails { grid-template-columns: 1fr; } }

.rail {
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-decoration: none;
  color: inherit;
  padding: 28px 26px 26px;
  transition: border-color .2s ease, transform .2s ease, background .2s ease;
}
.rail:hover {
  border-color: var(--line-3);
  transform: translateY(-3px);
  background: color-mix(in srgb, var(--card) 80%, var(--ink) 3%);
}
.rail .stamp { align-self: flex-start; }
.rail h3 { font-size: 1.5rem; }
.rail p { font-size: .95rem; margin: 0; }

.rail-pts { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 8px; }
.rail-pts li {
  position: relative;
  padding-left: 19px;
  font-family: var(--mono);
  font-size: .74rem;
  letter-spacing: -.01em;
  color: var(--ink-3);
}
.rail-pts li::before {
  content: '';
  position: absolute;
  left: 0; top: .52em;
  width: 5px; height: 5px;
  border-radius: 1px;
  background: color-mix(in srgb, var(--ember) 70%, transparent);
}
.rail .link { margin-top: auto; padding-top: 6px; }

/* --------------------------------------------------------------------------
   03 — the route
   -------------------------------------------------------------------------- */

.route { padding: clamp(20px, 3vw, 32px); }
.route-fig svg { display: block; width: 100%; height: auto; }

.route-stages {
  list-style: none;
  margin: 24px 0 0;
  padding: 24px 0 0;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 20px;
}
@media (max-width: 1000px) { .route-stages { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px)  { .route-stages { grid-template-columns: 1fr; } }

.route-stages li { display: flex; gap: 11px; min-width: 0; }
.rs-n { color: var(--ember); font-size: .72rem; padding-top: 3px; flex: none; }
.rs-b { display: grid; gap: 3px; min-width: 0; }
.rs-b b { font-family: var(--display); font-size: 1rem; letter-spacing: -.02em; }
.rs-b i {
  font-style: normal;
  font-family: var(--mono);
  font-size: .68rem;
  letter-spacing: .04em;
  color: var(--straw);
}
.rs-b span { font-size: .85rem; color: var(--ink-3); line-height: 1.5; }

/* --------------------------------------------------------------------------
   04 — how it works
   -------------------------------------------------------------------------- */

.how {
  display: grid;
  grid-template-columns: 1.25fr .75fr;
  gap: clamp(26px, 4vw, 56px);
  align-items: start;
}
@media (max-width: 940px) { .how { grid-template-columns: 1fr; } }

.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.steps li {
  position: relative;
  padding: 26px 0 26px 62px;
  border-bottom: 1px solid var(--line);
}
.steps li:first-child { padding-top: 0; }
.steps li:last-child { border-bottom: 0; padding-bottom: 0; }
.step-n {
  position: absolute;
  left: 0; top: 26px;
  width: 40px; height: 40px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid color-mix(in srgb, var(--ember) 34%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--ember) 8%, transparent);
  color: var(--ember);
  font-size: .76rem;
}
.steps li:first-child .step-n { top: 0; }
.steps h3 { margin-bottom: 8px; }
.steps p { font-size: .95rem; margin: 0; }

.how-spec { position: sticky; top: calc(var(--nav-h) + 22px); }
.how-spec h3 { margin-bottom: 8px; }
.how-note {
  font-size: .84rem;
  color: var(--faint);
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
@media (max-width: 940px) { .how-spec { position: static; } }

/* --------------------------------------------------------------------------
   05 — security
   -------------------------------------------------------------------------- */

.checks { list-style: none; margin: 26px 0 28px; padding: 0; display: grid; gap: 15px; }
.checks li {
  position: relative;
  padding-left: 30px;
  color: var(--ink-2);
  font-size: .96rem;
  line-height: 1.55;
}
.checks li b { color: var(--ink); font-weight: 600; }
.checks li::before {
  content: '';
  position: absolute;
  left: 0; top: .34em;
  width: 16px; height: 16px;
  border-radius: 4px;
  border: 1px solid color-mix(in srgb, var(--quench) 46%, transparent);
  background:
    linear-gradient(var(--quench) 0 0) center / 8px 1.6px no-repeat;
}

.sec-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 16px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--line);
}
.sec-row .num { color: var(--straw); font-size: .84rem; }
.sec-foot {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: .85rem;
  color: var(--faint);
}

/* --------------------------------------------------------------------------
   06 — the polycrystal
   -------------------------------------------------------------------------- */

.crystal {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--card);
  overflow: hidden;
}
.crystal-fig { position: relative; aspect-ratio: 1000 / 460; }
.crystal-fig svg { display: block; width: 100%; height: 100%; }
@media (max-width: 700px) { .crystal-fig { aspect-ratio: 1000 / 620; } }

.crystal-chips { position: absolute; inset: 0; pointer-events: none; }
.xchip {
  position: absolute;
  transform: translate(-50%, -50%);
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: color-mix(in srgb, var(--ground) 88%, transparent);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  font-family: var(--mono);
  font-size: .69rem;
  letter-spacing: -.01em;
  color: var(--ink-2);
  white-space: nowrap;
  animation: chip-in .6s both;
  animation-delay: var(--d, 0ms);
}
@keyframes chip-in {
  from { opacity: 0; transform: translate(-50%, -42%); }
  to   { opacity: 1; transform: translate(-50%, -50%); }
}
@media (prefers-reduced-motion: reduce) {
  .xchip { animation: none; }
}
.xchip-standard { border-color: color-mix(in srgb, var(--temper) 40%, transparent); color: var(--temper); }
.xchip-venue    { border-color: color-mix(in srgb, var(--ember) 38%, transparent);  color: var(--ember); }
.xchip-oracle   { border-color: color-mix(in srgb, var(--straw) 38%, transparent);  color: var(--straw); }
.xchip-custody,
.xchip-chain    { border-color: color-mix(in srgb, var(--quench) 38%, transparent); color: var(--quench); }

@media (max-width: 560px) { .xchip { font-size: .62rem; padding: 4px 8px; } }

.crystal-cap {
  margin: 20px auto 0;
  max-width: 78ch;
  text-align: center;
  font-size: .88rem;
  color: var(--faint);
}
.crystal-cap b { color: var(--ink-3); font-weight: 600; }
.crystal-cap .num { color: var(--ink-2); }

/* --------------------------------------------------------------------------
   07 — bento
   -------------------------------------------------------------------------- */

.bento {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(14px, 1.6vw, 20px);
}
.bento-cell {
  display: flex;
  flex-direction: column;
  gap: 11px;
  text-decoration: none;
  color: inherit;
  transition: border-color .2s ease, transform .2s ease;
}
.bento-cell:hover { border-color: var(--line-3); transform: translateY(-2px); }
.bento-cell .stamp { align-self: flex-start; }
.bento-cell h3 { font-size: 1.1rem; }
.bento-cell p { font-size: .89rem; margin: 0; color: var(--ink-3); }

.b-lg { grid-column: span 2; grid-row: span 2; }
.b-lg h3 { font-size: 1.45rem; }
.b-lg p { font-size: .96rem; color: var(--ink-2); }

@media (max-width: 980px) {
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .b-lg { grid-column: span 2; grid-row: auto; }
}
@media (max-width: 620px) {
  .bento { grid-template-columns: 1fr; }
  .b-lg { grid-column: span 1; }
}

.bento-chart { margin-top: auto; padding-top: 16px; }
.bento-chart svg { display: block; width: 100%; height: 92px; }
.chart-cap {
  display: block;
  margin-top: 10px;
  font-family: var(--mono);
  font-size: .64rem;
  line-height: 1.5;
  letter-spacing: .02em;
  color: var(--faint);
}

/* --------------------------------------------------------------------------
   08 — FAQ
   -------------------------------------------------------------------------- */

.faq {
  border-top: 1px solid var(--line);
  max-width: 900px;
}
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 0;
  cursor: pointer;
  list-style: none;
  font-family: var(--display);
  font-size: 1.06rem;
  font-weight: 600;
  letter-spacing: -.018em;
  color: var(--ink);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: '';
  flex: none;
  width: 13px; height: 13px;
  background:
    linear-gradient(var(--ink-3) 0 0) center / 13px 1.5px no-repeat,
    linear-gradient(var(--ink-3) 0 0) center / 1.5px 13px no-repeat;
  transition: transform .22s ease;
}
.faq details[open] summary { color: var(--ember); }
.faq details[open] summary::after {
  transform: rotate(90deg);
  background: linear-gradient(var(--ember) 0 0) center / 13px 1.5px no-repeat;
}
.faq details p {
  margin: 0;
  padding: 0 0 22px;
  max-width: 76ch;
  color: var(--ink-2);
  font-size: .96rem;
}
.faq-more { margin-top: 26px; }

/* --------------------------------------------------------------------------
   CTA band
   -------------------------------------------------------------------------- */

.cta-band {
  position: relative;
  padding: clamp(64px, 9vw, 116px) 0;
  text-align: center;
  border-top: 1px solid var(--line);
  background:
    radial-gradient(80% 130% at 50% 0%, color-mix(in srgb, var(--ember) 11%, transparent), transparent 66%),
    var(--ground-2);
}
.cta-band h2 { max-width: 20ch; margin: 0 auto 18px; }
.cta-band .lede { margin: 0 auto; }
.cta-band .hero-actions { justify-content: center; }
