/* =====================================================================
   Site layout — The Quiet Rewiring
   ===================================================================== */

/* ---------- NAV ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: color-mix(in srgb, #15171F 82%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid rgba(244,241,232,0.10);
  transition: background .3s ease, border-color .3s ease;
}
.nav.is-solid { background: color-mix(in srgb, #15171F 96%, transparent); }
.nav__inner { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; height: 62px; }
.nav__brand { font-family: var(--mono); font-size: 0.76rem; letter-spacing: 0.18em; color: #F4F1E8; white-space: nowrap; display: flex; align-items: center; gap: .5em; }
.nav__mark { color: var(--gold-2); font-size: 0.7em; }
.nav__links { display: flex; gap: 1.4rem; }
.nav__links a {
  font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: #9BA0AB; transition: color .2s; position: relative; padding: 2px 0;
}
.nav__links a:hover, .nav__links a.is-active { color: #F4F1E8; }
.nav__links a.is-active::after { content:""; position:absolute; left:0; right:0; bottom:-3px; height:1px; background: var(--gold-2); }
.nav__cta {
  font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: #15171F; background: var(--gold-2); padding: .55em 1em; border-radius: 3px; white-space: nowrap;
  transition: transform .15s ease, background .2s;
}
.nav__cta:hover { background: #E8C476; transform: translateY(-1px); }
.nav__progress { position:absolute; left:0; bottom:-1px; height:2px; width:0; background: var(--gold-2); transition: width .1s linear; }
@media (max-width: 860px) { .nav__links { display: none; } }

/* ---------- HERO ---------- */
.hero { padding-top: clamp(7rem, 16vh, 11rem); padding-bottom: clamp(3rem, 8vh, 6rem); position: relative; overflow: hidden; }
.hero::before {
  content:""; position:absolute; inset:0; z-index:0; pointer-events:none;
  background:
    radial-gradient(120% 80% at 85% -10%, rgba(217,174,88,0.10), transparent 55%),
    radial-gradient(90% 70% at 0% 110%, rgba(14,92,73,0.22), transparent 60%);
}
.hero__inner { position: relative; z-index: 1; }
.hero__title { font-size: clamp(3.4rem, 12vw, 9rem); line-height: 0.92; font-weight: 420; letter-spacing: -0.03em; margin: 0.1em 0 0.35em; }
.hero__lede { font-family: var(--serif); font-weight: 340; font-size: clamp(1.5rem, 3.4vw, 2.5rem); line-height: 1.24; letter-spacing: -0.015em; max-width: 20ch; color: #F4F1E8; margin-bottom: 1.2rem; }
.hero__dek { font-size: clamp(1.02rem, 1.6vw, 1.2rem); color: #C9C6BC; max-width: 56ch; margin-bottom: 3rem; }
.hero__strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: rgba(244,241,232,0.14); border: 1px solid rgba(244,241,232,0.14); border-radius: 5px; overflow: hidden; }
.hstat { background: #15171F; padding: 1.4rem 1.3rem; }
.hstat__n { font-family: var(--serif); font-weight: 460; font-size: clamp(1.9rem, 3.6vw, 2.9rem); line-height: 1; color: #F4F1E8; letter-spacing: -0.02em; display: block; }
.hstat__u { color: var(--gold-2); font-size: 0.55em; margin-left: 1px; }
.hstat__l { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.04em; color: #8C8F98; margin-top: 0.7rem; display: block; line-height: 1.45; text-transform: uppercase; }
.hero__scroll { display: inline-block; margin-top: 2.6rem; font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: #9BA0AB; transition: color .2s; }
.hero__scroll:hover { color: var(--gold-2); }
@media (max-width: 720px) { .hero__strip { grid-template-columns: repeat(2, 1fr); } }

/* ---------- THESIS ---------- */
.thesis__grid { grid-template-columns: 0.85fr 1.15fr; align-items: start; gap: clamp(1.5rem, 5vw, 4.5rem); }
.thesis__left h2 { font-size: clamp(2rem, 3.6vw, 3rem); }
.thesis__right p { font-size: 1.12rem; }
.thesis__note { font-family: var(--mono); font-size: 0.82rem; color: var(--ink-3); line-height: 1.6; border-top: 1px solid var(--line); padding-top: 1.1rem; margin-top: 1.6rem; }
@media (max-width: 820px) { .thesis__grid { grid-template-columns: 1fr; } }

/* ---------- CHAPTER ---------- */
.chapter__head { max-width: 30ch; margin-bottom: clamp(2rem, 5vw, 3.5rem); }
.chapter__head--wide, .chapter__head { max-width: 34ch; }
.chapter__title { font-size: clamp(1.8rem, 3.4vw, 2.9rem); letter-spacing: -0.02em; }
.chapter__body { align-items: start; gap: clamp(1.5rem, 4vw, 3.5rem); }
.prose p { font-size: 1.08rem; color: var(--ink-2); }
.prose--full { max-width: 72ch; margin: 2rem auto 0; }
.prose--full { font-size: 1.12rem; }

/* aha callout */
.aha { border-left: 3px solid var(--green); background: color-mix(in srgb, var(--green) 6%, transparent); padding: 1.2rem 1.4rem; border-radius: 0 5px 5px 0; margin-top: 1.8rem; }
.aha__tag { font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--green); display: block; margin-bottom: 0.5rem; }
.aha p { margin: 0; font-family: var(--serif); font-weight: 350; font-size: 1.18rem; line-height: 1.4; color: var(--ink); max-width: none; }

/* why it matters */
.whymatters { margin-top: clamp(2rem, 5vw, 3.2rem); padding-top: 1.4rem; border-top: 1px solid var(--line); font-size: 1.14rem; line-height: 1.5; color: var(--ink); max-width: 82ch; font-family: var(--serif); font-weight: 350; }
.whymatters span { font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--red); display: block; margin-bottom: 0.5rem; font-weight: 500; }

/* wide figure */
.figframe--wide { margin-top: 2.5rem; }

/* toggle */
.toggle { display: inline-flex; gap: 2px; background: var(--paper-3); border-radius: 999px; padding: 3px; margin-bottom: 1rem; }
.toggle__btn { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.03em; border: 0; background: transparent; color: var(--ink-3); padding: 0.5em 1em; border-radius: 999px; cursor: pointer; transition: all .18s; }
.toggle__btn.is-active { background: var(--ink); color: var(--paper); }

/* ---------- AGENDA ---------- */
.agenda__list { list-style: none; counter-reset: ag; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: rgba(244,241,232,0.12); border: 1px solid rgba(244,241,232,0.12); border-radius: 6px; overflow: hidden; }
.agenda__list li { counter-increment: ag; background: #15171F; padding: 2rem 1.9rem 2.1rem; position: relative; }
.agenda__list li::before { content: counter(ag, decimal-leading-zero); font-family: var(--mono); font-size: 0.8rem; color: var(--gold-2); letter-spacing: 0.1em; }
.agenda__list h4 { color: #F4F1E8; margin: 0.7rem 0 0.5rem; font-size: 1.28rem; }
.agenda__list p { color: #C9C6BC; margin: 0; font-size: 1rem; max-width: none; }
@media (max-width: 720px) { .agenda__list { grid-template-columns: 1fr; } }

/* ---------- METHOD ---------- */
.method p { color: var(--ink-2); font-size: 1.02rem; }
.method code { font-family: var(--mono); font-size: 0.86em; background: var(--paper-2); padding: 0.1em 0.4em; border-radius: 3px; }
.method__cta { display: inline-block; margin-top: 1.6rem; font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--green); border-bottom: 1px solid var(--green); padding-bottom: 3px; transition: opacity .2s; }
.method__cta:hover { opacity: 0.65; }

/* ---------- FOOTER ---------- */
.foot { background: #15171F; color: #8C8F98; padding: 2.4rem 0; }
.foot__inner { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.foot__mark { font-family: var(--mono); font-size: 0.76rem; letter-spacing: 0.16em; color: #F4F1E8; }
.foot__meta { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.04em; }

/* reduced motion */
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } .nav__progress { transition: none; } }

/* ---------- small-screen refinements ---------- */
@media (max-width: 560px) {
  html, body { overflow-x: hidden; }
  .nav__inner { height: 54px; gap: 0.6rem; }
  .nav__brand { font-size: 0.64rem; letter-spacing: 0.10em; }
  .nav__cta { font-size: 0.6rem; padding: 0.5em 0.7em; }
  .hstat { padding: 1.05rem 1rem; }
  .hstat__l { font-size: 0.6rem; }
  .hero__title { font-size: clamp(3rem, 15vw, 4.6rem); }
  .figframe { padding: 1.1rem 0.95rem; }
  .whymatters, .aha p { font-size: 1.05rem; }
}
