/* ============================================================
   Cellucent — shared stylesheet
   Design register: scientific instrument, not consumer SaaS.
   ============================================================ */

:root {
  --ink:     #111311;
  --ink-2:   #2C302C;
  --paper:   #FAFAF8;
  --paper-2: #F2F2EE;
  --muted:   #6B6F6B;
  --rule:    #E4E4DF;
  --accent:  #C2410C;
  --accent-w:rgba(194, 65, 12, 0.10);

  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono:  "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --measure: 68ch;
  --page: 1120px;
  --prose: 720px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --nav-h: 60px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink:     #ECECE6;
    --ink-2:   #C7C9C3;
    --paper:   #0E100E;
    --paper-2: #171A17;
    --muted:   #8B8F8A;
    --rule:    #262926;
    --accent:  #F97316;
    --accent-w:rgba(249, 115, 22, 0.12);
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Page-load / page-exit fade -------------------------------- */
body { opacity: 0; transition: opacity 420ms var(--ease); }
body.ready { opacity: 1; }
body.leaving { opacity: 0; transition-duration: 200ms; }

.wrap  { max-width: var(--page);  margin: 0 auto; padding: 0 28px; }
.prose { max-width: var(--prose); margin: 0 auto; padding: 0 28px; }

/* ---------------------------------------------------------- */
/* Navigation                                                  */
/* ---------------------------------------------------------- */

.nav {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--nav-h);
  z-index: 100;
  display: flex;
  align-items: center;
  background: var(--paper);
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 300ms var(--ease), background 300ms var(--ease);
}
.nav.stuck { border-bottom-color: var(--rule); }

.nav .wrap { display: flex; align-items: center; justify-content: space-between; width: 100%; }

.brand {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 9px;
}
.brand .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 3.4s var(--ease) infinite;
}
@keyframes pulse {
  0%, 70%, 100% { transform: scale(1);   opacity: 1; }
  35%           { transform: scale(1.5); opacity: 0.45; }
}

.nav-links { display: flex; gap: 26px; align-items: center; }
.nav-links a {
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.05em;
  color: var(--muted);
  text-decoration: none;
  padding: 4px 0;
  position: relative;
  transition: color 220ms var(--ease);
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  height: 1px; width: 100%;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 320ms var(--ease);
}
.nav-links a:hover { color: var(--ink); }
.nav-links a:hover::after,
.nav-links a[aria-current="page"]::after { transform: scaleX(1); }
.nav-links a[aria-current="page"] { color: var(--ink); }

.progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 100%;
  transform: scaleX(0);
  transform-origin: left;
  background: var(--accent);
  z-index: 101;
}

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

.hero {
  position: relative;
  min-height: 92vh;
  display: flex;
  align-items: center;
  padding: calc(var(--nav-h) + 40px) 0 80px;
  overflow: hidden;
}
#field {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  z-index: 0;
  pointer-events: none;
}
/* Fade the cell out behind the headline rather than moving it out of the way. */
@media (min-width: 1001px) {
  #field {
    -webkit-mask-image: linear-gradient(90deg, transparent 10%, #000 52%);
    mask-image: linear-gradient(90deg, transparent 10%, #000 52%);
  }
}
.hero .wrap { position: relative; z-index: 1; }

.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 30px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.eyebrow::after {
  content: "";
  height: 1px;
  flex: 0 1 90px;
  background: var(--rule);
}

h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(34px, 6.2vw, 64px);
  line-height: 1.1;
  letter-spacing: -0.018em;
  margin: 0 0 32px;
  max-width: 15ch;
}
h1 em { font-style: italic; color: var(--accent); }

.lede {
  font-size: clamp(17px, 2vw, 20px);
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 56ch;
  margin: 0 0 40px;
}

/* Staggered line reveal ------------------------------------- */
.line {
  display: block;
  overflow: hidden;
  padding-bottom: 0.22em;
  margin-bottom: -0.22em;
}
.line > span {
  display: block;
  transform: translateY(135%);
  animation: rise 1000ms var(--ease) forwards;
  animation-delay: calc(var(--i, 0) * 110ms + 180ms);
}
@keyframes rise { to { transform: translateY(0); } }

.fade-up {
  opacity: 0;
  transform: translateY(14px);
  animation: fadeUp 900ms var(--ease) forwards;
  animation-delay: calc(var(--i, 0) * 110ms + 420ms);
}
@keyframes fadeUp { to { opacity: 1; transform: none; } }

/* ---------------------------------------------------------- */
/* Buttons & links                                             */
/* ---------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.04em;
  text-decoration: none;
  color: var(--paper);
  background: var(--ink);
  padding: 13px 20px;
  border: 1px solid var(--ink);
  transition: background 260ms var(--ease), color 260ms var(--ease), transform 260ms var(--ease);
}
.btn:hover { background: var(--accent); border-color: var(--accent); color: #fff; transform: translateY(-2px); }
.btn .arw { transition: transform 300ms var(--ease); }
.btn:hover .arw { transform: translateX(4px); }

.btn.ghost { background: transparent; color: var(--ink); border-color: var(--rule); }
.btn.ghost:hover { border-color: var(--ink); background: transparent; color: var(--ink); transform: translateY(-2px); }

a.inline {
  color: var(--accent);
  text-decoration: none;
  background-image: linear-gradient(var(--accent), var(--accent));
  background-size: 0% 1px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  transition: background-size 320ms var(--ease);
}
a.inline:hover { background-size: 100% 1px; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ---------------------------------------------------------- */
/* Sections                                                    */
/* ---------------------------------------------------------- */

section { padding: 96px 0; position: relative; }
section + section { border-top: 1px solid var(--rule); }

h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(26px, 3.4vw, 38px);
  line-height: 1.2;
  letter-spacing: -0.012em;
  margin: 0 0 28px;
  max-width: 22ch;
}

h3 {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 17px;
  line-height: 1.4;
  margin: 0 0 10px;
  letter-spacing: -0.005em;
}

.kicker {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 22px;
}

p { margin: 0 0 22px; max-width: var(--measure); color: var(--ink-2); }
p:last-child { margin-bottom: 0; }
p.big { font-size: 19px; line-height: 1.55; color: var(--ink); max-width: 58ch; }

.grid { display: grid; gap: 1px; background: var(--rule); border: 1px solid var(--rule); }
@media (min-width: 760px) { .grid.c3 { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 640px) { .grid.c2 { grid-template-columns: repeat(2, 1fr); } }

.cell {
  background: var(--paper);
  padding: 32px 28px;
  position: relative;
  transition: background 320ms var(--ease);
}
.cell:hover { background: var(--paper-2); }
.cell .num {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
  letter-spacing: 0.1em;
  display: block;
  margin-bottom: 18px;
}
.cell p { font-size: 15px; color: var(--muted); margin: 0; }

/* Two-column split ------------------------------------------ */
.split { display: grid; gap: 48px; align-items: start; }
@media (min-width: 900px) { .split { grid-template-columns: 0.85fr 1.15fr; gap: 72px; } }

/* Ordered list of statements -------------------------------- */
.stack { list-style: none; margin: 0; padding: 0; }
.stack li {
  padding: 26px 0;
  border-top: 1px solid var(--rule);
  display: grid;
  gap: 6px 28px;
  max-width: var(--measure);
}
@media (min-width: 700px) { .stack li { grid-template-columns: 92px 1fr; } }
.stack li:last-child { border-bottom: 1px solid var(--rule); }
.stack .tag {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  padding-top: 3px;
}
.stack p { margin: 0; font-size: 15.5px; }

/* Pull quote ------------------------------------------------ */
.pull {
  font-family: var(--serif);
  font-size: clamp(22px, 3vw, 30px);
  line-height: 1.32;
  letter-spacing: -0.01em;
  color: var(--ink);
  max-width: 26ch;
  margin: 0;
  padding-left: 26px;
  border-left: 2px solid var(--accent);
}

/* ---------------------------------------------------------- */
/* "Coming soon" — redacted panels                             */
/* ---------------------------------------------------------- */

.locked {
  border: 1px solid var(--rule);
  padding: 34px 30px;
  background: var(--paper);
  position: relative;
  overflow: hidden;
}
.locked::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 35%, var(--accent-w) 50%, transparent 65%);
  transform: translateX(-100%);
  animation: sweep 5.5s var(--ease) infinite;
  pointer-events: none;
}
@keyframes sweep { 0% { transform: translateX(-100%); } 55%, 100% { transform: translateX(100%); } }

.locked .label {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
}
.locked h3 { margin-bottom: 16px; }

.bars { display: grid; gap: 9px; margin-top: 4px; }
.bar {
  height: 9px;
  background: var(--rule);
  border-radius: 1px;
  transform-origin: left;
  transform: scaleX(0);
  transition: transform 900ms var(--ease);
  transition-delay: calc(var(--i, 0) * 90ms);
}
.in .bar { transform: scaleX(1); }

/* ---------------------------------------------------------- */
/* Scroll reveal                                               */
/* ---------------------------------------------------------- */

.reveal {
  opacity: 0;
  transform: translateY(20px);
  filter: blur(3px);
  transition: opacity 800ms var(--ease), transform 800ms var(--ease), filter 800ms var(--ease);
  transition-delay: calc(var(--i, 0) * 90ms);
}
.reveal.in { opacity: 1; transform: none; filter: none; }

/* ---------------------------------------------------------- */
/* Footer                                                      */
/* ---------------------------------------------------------- */

footer {
  border-top: 1px solid var(--rule);
  padding: 56px 0 64px;
}
footer .wrap {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 32px;
  flex-wrap: wrap;
}
footer .mono {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--muted);
  letter-spacing: 0.04em;
}
footer a { color: var(--muted); text-decoration: none; border-bottom: 1px solid var(--rule); transition: color 240ms var(--ease), border-color 240ms var(--ease); }
footer a:hover { color: var(--accent); border-color: var(--accent); }
.foot-nav { display: flex; gap: 22px; }

/* ---------------------------------------------------------- */
/* Page header (interior pages)                                */
/* ---------------------------------------------------------- */

.page-head {
  padding: calc(var(--nav-h) + 96px) 0 72px;
  border-bottom: 1px solid var(--rule);
}
.page-head h1 { font-size: clamp(32px, 5vw, 52px); margin-bottom: 26px; max-width: 18ch; }
.page-head .lede { margin-bottom: 0; }

/* ---------------------------------------------------------- */
/* Reduced motion                                              */
/* ---------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .reveal { opacity: 1; transform: none; filter: none; }
  .line { overflow: visible; }
  .line > span { transform: none; }
  .fade-up { opacity: 1; transform: none; }
  .bar { transform: scaleX(1); }
  body { opacity: 1; }
}

/* ============================================================
   Figures
   ============================================================ */

.fig {
  margin: 0;
  border: 1px solid var(--rule);
  background: var(--paper-2);
  overflow: hidden;
}
.fig canvas { display: block; width: 100%; height: 260px; }
.fig.tall canvas { height: 320px; }
.fig figcaption {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.05em;
  color: var(--muted);
  padding: 12px 16px;
  border-top: 1px solid var(--rule);
  background: var(--paper);
}
.fig figcaption b { color: var(--ink); font-weight: 500; }

/* Alternating figure / text rows ---------------------------- */
.figrow {
  display: grid;
  gap: 44px;
  align-items: center;
  padding: 52px 0;
  border-top: 1px solid var(--rule);
}
.figrow:first-of-type { border-top: 0; }
@media (min-width: 900px) {
  .figrow { grid-template-columns: 1.05fr 0.95fr; gap: 72px; }
  .figrow.flip .fig { order: 2; }
}
.figrow h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(21px, 2.6vw, 27px);
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin: 0 0 14px;
  max-width: 20ch;
}
.figrow p { font-size: 15.5px; max-width: 46ch; margin: 0; }
.figrow .kicker { margin-bottom: 14px; }

/* SNFG legend ----------------------------------------------- */
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  list-style: none;
  margin: 22px 0 0;
  padding: 0;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
  letter-spacing: 0.04em;
}
.legend li { display: inline-flex; align-items: center; gap: 8px; }
.legend i {
  width: 11px; height: 11px;
  display: inline-block;
  flex: none;
  border: 1px solid rgba(0, 0, 0, 0.3);
}
.legend .sq { background: #0072BC; }
.legend .ci { background: #00A651; border-radius: 50%; }
.legend .cy { background: #FFD400; border-radius: 50%; }
.legend .di { background: #A54399; transform: rotate(45deg); }
.legend .tr {
  background: #ED1C24;
  border: 0;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}
.legend .ph {
  background: var(--accent);
  border-radius: 50%;
  border: 0;
}

/* ============================================================
   Publications
   ============================================================ */

.pubs { list-style: none; margin: 34px 0 0; padding: 0; }
.pubs li {
  border-top: 1px solid var(--rule);
  padding: 26px 0;
  max-width: 78ch;
}
.pubs li:last-child { border-bottom: 1px solid var(--rule); }
.pubs .venue {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
  display: block;
  margin-bottom: 10px;
}
.pubs h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(18px, 2.2vw, 22px);
  line-height: 1.32;
  letter-spacing: -0.005em;
  margin: 0 0 10px;
  max-width: 46ch;
}
.pubs h3 a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  transition: border-color 260ms var(--ease), color 260ms var(--ease);
}
.pubs h3 a:hover { color: var(--accent); border-color: var(--accent); }
.pubs .authors { font-size: 14.5px; color: var(--muted); margin: 0 0 10px; max-width: 60ch; }
.pubs .meta {
  max-width: none;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
  letter-spacing: 0.04em;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin: 0;
}
.pubs .meta span::before { content: "· "; color: var(--rule); }
.pubs .meta span:first-child::before { content: none; }
