/* ============================================================
   Capstones — "Build-Log Brutalism"
   Dark engineering dossier · JetBrains Mono × IBM Plex Sans
   One signal-green accent = "verified". Amber = "review caught".
   ============================================================ */

:root {
  --ink:    #0B0E14;
  --ink-2:  #10141d;
  --ink-3:  #141926;
  --card:   #131825;
  --line:   #232b3b;
  --line-2: #2e3850;
  --text:   #e7ebf4;
  --muted:  #8b94a8;
  --faint:  #5b6479;
  --signal: #45e08b;          /* verified / passed */
  --signal-dim: rgba(69,224,139,.10);
  --blue:   #6aa3ff;          /* interactive secondary */
  --amber:  #e6b34a;          /* review caught */
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --sans: "IBM Plex Sans", system-ui, sans-serif;
  --max: 1120px;
  --r: 4px;                    /* sharp, dossier corners */
  --ease: cubic-bezier(.2,.7,.2,1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

body {
  background: var(--ink);
  color: var(--text);
  font-family: var(--sans);
  font-weight: 300;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* subtle film grain over everything */
body::after {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 9999;
  opacity: .035; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

a { color: inherit; text-decoration: none; }
strong { font-weight: 600; color: #fff; }
em { font-style: normal; color: var(--text); border-bottom: 1px dotted var(--faint); }

.skip {
  position: absolute; left: -999px; top: 0; z-index: 100;
  background: var(--signal); color: #04210f; padding: .6rem 1rem; font-family: var(--mono);
}
.skip:focus { left: 1rem; top: 1rem; }

::selection { background: var(--signal); color: #04210f; }

/* ---- NAV ---- */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem clamp(1rem, 4vw, 2.5rem);
  background: color-mix(in srgb, var(--ink) 80%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav__brand { font-family: var(--mono); font-weight: 800; letter-spacing: -.02em; font-size: 1.05rem; }
.nav__prompt { color: var(--signal); }
.nav__links { display: flex; gap: clamp(.8rem, 2.5vw, 1.8rem); align-items: center; font-family: var(--mono); font-size: .82rem; }
.nav__links a { color: var(--muted); transition: color .2s var(--ease); }
.nav__links a:hover { color: var(--text); }
.nav__cta { color: var(--signal) !important; border: 1px solid var(--line-2); padding: .4rem .8rem; border-radius: var(--r); }
.nav__cta:hover { border-color: var(--signal); background: var(--signal-dim); }

/* ---- shared section heads ---- */
.section-head { max-width: var(--max); margin: 0 auto; padding: clamp(3.5rem,7vw,6rem) clamp(1rem,4vw,2.5rem) 1.5rem; }
.section-head__no { font-family: var(--mono); color: var(--signal); font-size: .8rem; letter-spacing: .25em; }
.section-head__title { font-family: var(--mono); font-weight: 800; font-size: clamp(1.8rem, 5vw, 2.9rem); letter-spacing: -.03em; margin-top: .4rem; }
.section-head__sub { color: var(--muted); margin-top: .5rem; max-width: 52ch; }

/* ---- HERO ---- */
.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--line); }
.hero__grid {
  position: absolute; inset: 0; opacity: .5;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 70% 0%, #000 0%, transparent 70%);
          mask-image: radial-gradient(ellipse 80% 70% at 70% 0%, #000 0%, transparent 70%);
}
.hero__inner { position: relative; max-width: var(--max); margin: 0 auto; padding: clamp(3.5rem,9vw,7rem) clamp(1rem,4vw,2.5rem) clamp(3rem,6vw,5rem); }
.hero__eyebrow { font-family: var(--mono); font-size: .8rem; color: var(--muted); letter-spacing: .04em; display: flex; align-items: center; gap: .55rem; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--signal); display: inline-block; }
.dot--live { box-shadow: 0 0 0 0 var(--signal); animation: pulse 2.4s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(69,224,139,.5);} 70%{ box-shadow:0 0 0 7px rgba(69,224,139,0);} 100%{box-shadow:0 0 0 0 rgba(69,224,139,0);} }
.hero__title { font-family: var(--mono); font-weight: 800; font-size: clamp(2.3rem, 7.5vw, 5rem); line-height: 1.02; letter-spacing: -.045em; margin: 1.3rem 0; }
.hl { color: var(--signal); }
.hero__lede { color: var(--muted); font-size: clamp(1rem,2.2vw,1.2rem); max-width: 60ch; }
.hero__cta { display: flex; flex-wrap: wrap; gap: .8rem; margin: 2rem 0 2.5rem; }
.btn { font-family: var(--mono); font-size: .9rem; font-weight: 500; padding: .8rem 1.4rem; border-radius: var(--r); border: 1px solid var(--line-2); cursor: pointer; transition: all .2s var(--ease); }
.btn--primary { background: var(--signal); color: #04210f; border-color: var(--signal); font-weight: 700; }
.btn--primary:hover { box-shadow: 0 8px 30px -8px rgba(69,224,139,.5); transform: translateY(-2px); }
.btn--ghost { color: var(--text); background: transparent; }
.btn--ghost:hover { border-color: var(--text); background: rgba(255,255,255,.03); }
.hero__log { font-family: var(--mono); font-size: .85rem; line-height: 1.9; color: var(--muted); background: var(--ink-2); border: 1px solid var(--line); border-left: 2px solid var(--signal); border-radius: var(--r); padding: 1.1rem 1.3rem; max-width: 33rem; overflow-x: auto; }
.lg--ok { color: var(--signal); }
.lg--blink { color: var(--signal); animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ---- METHOD / pipeline ---- */
.pipeline { max-width: var(--max); margin: 0 auto 2rem; padding: 0 clamp(1rem,4vw,2.5rem); display: grid; gap: 1px; grid-template-columns: repeat(4, 1fr); background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.pipe { background: var(--ink-2); padding: 1.4rem 1.3rem 1.6rem; position: relative; list-style: none; }
.pipe__k { font-family: var(--mono); font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); display: block; margin-bottom: .6rem; }
.pipe p { font-size: .95rem; color: var(--muted); }
.pipe--accent { background: var(--ink-3); }
.pipe--accent .pipe__k { color: var(--signal); }
.pipe::after { content: "→"; position: absolute; right: -10px; top: 50%; transform: translateY(-50%); color: var(--faint); font-family: var(--mono); z-index: 2; }
.pipe:last-child::after { content: ""; }

/* ---- PROJECT GRID ---- */
.filters { max-width: var(--max); margin: 0 auto 1.6rem; padding: 0 clamp(1rem,4vw,2.5rem); display: flex; flex-wrap: wrap; gap: .5rem; }
.chip { font-family: var(--mono); font-size: .8rem; color: var(--muted); background: var(--ink-2); border: 1px solid var(--line); padding: .45rem .9rem; border-radius: 999px; cursor: pointer; transition: all .18s var(--ease); }
.chip:hover { color: var(--text); border-color: var(--line-2); }
.chip.is-active { color: #04210f; background: var(--signal); border-color: var(--signal); font-weight: 600; }

.grid { max-width: var(--max); margin: 0 auto; padding: 0 clamp(1rem,4vw,2.5rem) 2rem; display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.1rem; }

.card {
  position: relative; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r); padding: 1.5rem 1.5rem 1.6rem; overflow: hidden;
  transition: border-color .25s var(--ease), transform .25s var(--ease), box-shadow .25s var(--ease);
}
.card::before { /* corner build-tick */
  content: ""; position: absolute; top: 0; left: 0; width: 0; height: 2px; background: var(--signal); transition: width .35s var(--ease);
}
.card:hover { border-color: var(--line-2); transform: translateY(-3px); box-shadow: 0 18px 40px -22px rgba(0,0,0,.8); }
.card:hover::before { width: 100%; }

.card__top { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.card__no { font-family: var(--mono); color: var(--faint); font-size: .8rem; }
.card__area { font-family: var(--mono); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--blue); border: 1px solid var(--line-2); padding: .2rem .55rem; border-radius: 999px; white-space: nowrap; }
.card__name { font-family: var(--mono); font-weight: 800; font-size: 1.5rem; letter-spacing: -.02em; margin: .3rem 0 .5rem; }
.card__tag { color: var(--muted); font-size: .96rem; min-height: 3.1em; }

.card__stack { display: flex; flex-wrap: wrap; gap: .35rem; margin: .9rem 0 1.1rem; }
.tech { font-family: var(--mono); font-size: .72rem; color: var(--muted); background: var(--ink); border: 1px solid var(--line); padding: .22rem .5rem; border-radius: var(--r); }

/* the memorable anchor: the review ledger */
.review { border-top: 1px dashed var(--line-2); padding-top: 1rem; font-size: .88rem; }
.review__row { display: grid; grid-template-columns: auto 1fr; gap: .6rem; align-items: start; }
.review__row + .review__row { margin-top: .5rem; }
.review__k { font-family: var(--mono); font-size: .68rem; letter-spacing: .08em; padding-top: .15rem; }
.review__k--caught { color: var(--amber); }
.review__k--fixed { color: var(--signal); }
.review__caught { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--amber); text-decoration-thickness: 1px; }
.review__fixed { color: var(--text); }

.card__foot { display: flex; align-items: center; justify-content: space-between; margin-top: 1.2rem; }
.card__tests { font-family: var(--mono); font-size: .78rem; color: var(--muted); }
.stamp { font-family: var(--mono); font-weight: 800; font-size: .72rem; letter-spacing: .14em; color: var(--signal); border: 1.5px solid var(--signal); padding: .2rem .55rem; border-radius: var(--r); transform: rotate(-3deg); }
.card--clean .stamp { color: #04210f; background: var(--signal); }

/* reveal-on-scroll — progressive enhancement: only hidden when JS is active,
   so content is never blank without/before JS. */
.reveal { transition: opacity .6s var(--ease), transform .6s var(--ease); }
.js .reveal { opacity: 0; transform: translateY(18px); }
.js .reveal.in { opacity: 1; transform: none; }

/* ---- WHY GATES ---- */
.ledger { border-top: 1px solid var(--line); background:
  radial-gradient(ellipse 60% 50% at 0% 0%, var(--signal-dim), transparent 60%); }
.ledger__body { max-width: 60rem; margin: 0 auto; padding: 0 clamp(1rem,4vw,2.5rem) clamp(3.5rem,7vw,6rem); }
.ledger__lead { font-size: clamp(1.05rem,2.4vw,1.35rem); color: var(--text); max-width: 62ch; }
.ledger__list { list-style: none; margin: 2rem 0; display: grid; gap: .9rem; }
.ledger__list li { padding-left: 1.5rem; position: relative; color: var(--muted); }
.ledger__list li::before { content: "▹"; position: absolute; left: 0; color: var(--signal); font-family: var(--mono); }
.ledger__kicker { font-family: var(--mono); font-weight: 700; font-size: clamp(1.1rem,3vw,1.7rem); letter-spacing: -.02em; color: #fff; border-left: 2px solid var(--signal); padding-left: 1.2rem; margin-top: 1rem; }

/* ---- FOOTER ---- */
.foot { border-top: 1px solid var(--line); background: var(--ink-2); }
.foot__row { max-width: var(--max); margin: 0 auto; padding: 3rem clamp(1rem,4vw,2.5rem) 1.5rem; display: flex; flex-wrap: wrap; gap: 2rem; justify-content: space-between; }
.foot__brand { font-family: var(--mono); font-weight: 800; font-size: 1.1rem; }
.foot__note { color: var(--muted); margin-top: .4rem; max-width: 40ch; }
.foot__links { display: flex; flex-direction: column; gap: .5rem; font-family: var(--mono); font-size: .85rem; }
.foot__links a { color: var(--muted); transition: color .2s var(--ease); }
.foot__links a:hover { color: var(--signal); }
.foot__meta { max-width: var(--max); margin: 0 auto; padding: 1rem clamp(1rem,4vw,2.5rem) 2.5rem; font-family: var(--mono); font-size: .75rem; color: var(--faint); border-top: 1px solid var(--line); }

/* ---- RESPONSIVE ---- */
@media (max-width: 880px) {
  .pipeline { grid-template-columns: repeat(2, 1fr); }
  .pipe:nth-child(2)::after { content: ""; }
  .grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .pipeline { grid-template-columns: 1fr; }
  .pipe::after { content: "↓"; right: 50%; top: auto; bottom: -10px; transform: translateX(50%); }
  .pipe:last-child::after { content: ""; }
  .nav__links a:not(.nav__cta) { display: none; }
}
