/* andomation.com: Joe Andolina
   Visual system from design-reference.md (dark direction only): charcoal surfaces, Manrope headings,
   Inter body, lime reserved for controls, facet colors always paired with a label and border. No purple. */

:root {
  color-scheme: dark;
  --canvas: #141513;
  --header: #121311;
  --surface: #232422;
  --raised: #2c2e2a;
  --field: #181917;
  --text: #f4f4f4;
  --muted: #a3a5a2;
  --border: #595b58;
  --divider: #363833;
  --primary: #93f43e;
  --primary-hover: #b1ff70;
  --on-primary: #101711;
  --soft: #333338;
  --heading: "Manrope", system-ui, sans-serif;
  --body: "Inter", system-ui, sans-serif;
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--text);
  font: 400 16px/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
}
.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
h1, h2, h3 { font-family: var(--heading); margin: 0; text-wrap: balance; }
h1 { font-weight: 800; font-size: clamp(2.2rem, 5.4vw, 4rem); line-height: 1.02; letter-spacing: -0.02em; }
h2 { font-weight: 700; font-size: clamp(1.4rem, 2.8vw, 2rem); line-height: 1.15; letter-spacing: -0.01em; }
h3 { font-weight: 700; font-size: 15px; line-height: 1.3; }
p { margin: 0; max-width: 62ch; }
.muted { color: var(--muted); }
.eyebrow {
  font: 600 12px/1.4 var(--body);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.num { font-variant-numeric: tabular-nums; }

/* Show facets: text + background pairs, always shown with a label and a border, never color alone */
.tdx { --fx: #a5c9ff; --fbg: #293448; }
.tableau { --fx: #ffb39c; --fbg: #422e28; }
.cnx { --fx: #79dcd4; --fbg: #203b39; }
.df { --fx: #efbe76; --fbg: #382e20; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: 600 12px/1 var(--body);
  color: var(--fx, var(--muted));
  background: var(--fbg, var(--soft));
  border: 1px solid color-mix(in srgb, var(--fx, var(--muted)) 45%, transparent);
  border-radius: 999px;
  padding: 5px 10px;
  white-space: nowrap;
}

/* Top bar */
.topbar { background: var(--header); border-bottom: 1px solid var(--divider); }
.topbar .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 16px;
  padding-block: 14px;
  font-size: 14px;
}
.topbar strong { font: 700 15px/1.4 var(--heading); }

/* Hero */
.hero { padding-block: clamp(36px, 6vw, 72px) 28px; }
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 4fr);
  gap: clamp(24px, 4vw, 48px);
  align-items: end;
}
.hero-copy { display: grid; gap: 18px; min-width: 0; }
.hero-copy .lede { font-size: 1.08rem; color: var(--text); }
.hero figure { max-width: 400px; justify-self: end; width: 100%; }

/* Media cards */
figure { margin: 0; min-width: 0; }
.card {
  background: var(--surface);
  border: 1px solid var(--divider);
  border-radius: 10px;
  overflow: hidden;
}
figure.card img, figure.card video { display: block; width: 100%; height: auto; max-width: 100%; }
figure.card figcaption {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  padding: 10px 14px 12px;
  font-size: 13px;
  color: var(--muted);
}
.media { position: relative; }
.toggle {
  position: absolute;
  right: 10px;
  bottom: 10px;
  min-height: 36px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: var(--primary);
  color: var(--on-primary);
  font: 600 13px/1 var(--body);
  cursor: pointer;
}
.toggle:hover { background: var(--primary-hover); }
.toggle:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }

/* Waveform of the year */
.year { padding-block: 8px 40px; }
.wave-card { padding: 16px 16px 14px; display: grid; gap: 12px; }
.wave-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; align-items: baseline; }
.wave-head span { font-size: 12px; }
.wave-legend {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.wave-legend > div { display: grid; gap: 10px; justify-items: start; align-content: start; min-width: 0; }
.wave-legend .bar { width: 100%; height: 4px; border-radius: 999px; background: var(--fx); }
.wave-legend p { font-size: 13px; color: var(--muted); }

/* Section heads and lists */
.section { padding-block: 8px 40px; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.rows { list-style: none; margin: 0; padding: 0; }
.rows li {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  gap: 4px 14px;
  align-items: center;
  padding: 12px 16px;
}
.rows li + li { border-top: 1px solid var(--divider); }
.rows .idx { color: var(--muted); font-size: 13px; }
.rows .what { display: grid; gap: 2px; min-width: 0; }
.rows .what span { font-size: 13px; color: var(--muted); }

/* Chapters */
.chapter { padding-block: clamp(36px, 5vw, 64px); border-top: 1px solid var(--divider); }
.chapter-grid {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 6fr);
  gap: clamp(24px, 4vw, 48px);
  align-items: start;
}
.chapter.portrait .chapter-grid { grid-template-columns: minmax(0, 6fr) minmax(0, 4fr); }
.chapter-copy { display: grid; gap: 16px; min-width: 0; }
.chapter-copy .track { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; }

/* Closing */
.proved { padding-block: clamp(40px, 6vw, 72px); border-top: 1px solid var(--divider); }
.proved .panel { background: var(--raised); border: 1px solid var(--border); border-radius: 10px; padding: clamp(20px, 3vw, 32px); display: grid; gap: 12px; max-width: 760px; }

footer { background: var(--header); border-top: 1px solid var(--divider); }
footer .wrap { padding-block: 24px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 24px; font-size: 14px; }
footer strong { font: 700 15px/1.4 var(--heading); }

@media (max-width: 860px) {
  .hero-grid, .chapter-grid, .chapter.portrait .chapter-grid { grid-template-columns: minmax(0, 1fr); }
  .hero figure, .chapter.portrait figure { justify-self: start; max-width: 420px; }
  .wave-legend { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 14px; }
}
@media (max-width: 520px) {
  .rows li { grid-template-columns: 28px minmax(0, 1fr); }
  .rows li .chip { grid-column: 2; justify-self: start; }
}

/* ---------- Site-wide additions ---------- */

/* Navigation */
.nav { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: var(--header); border-bottom: 1px solid var(--divider); }
.nav .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 20px;
  padding-block: 12px;
}
.nav .brand { font: 700 15px/1.4 var(--heading); color: var(--text); text-decoration: none; }
.nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 14px; }
.nav a { color: var(--muted); text-decoration: none; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); }
.nav a:focus-visible, .tile:focus-visible, .next a:focus-visible, footer a:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; border-radius: 4px; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 30; background: var(--header); }

/* Text-only chapter and two-up figures (project pages) */
.chapter.text .chapter-grid { grid-template-columns: minmax(0, 1fr); }
.pair { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 4fr); gap: 12px; align-items: start; }

/* Next project */
.next { border-top: 1px solid var(--divider); }
.next a {
  display: grid;
  gap: 6px;
  padding-block: clamp(32px, 5vw, 56px);
  color: var(--text);
  text-decoration: none;
}
.next a:hover h2 { color: var(--primary-hover); }

/* Footer links */
footer a { color: var(--text); }
footer .links { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 14px; }

/* ---------- Home ---------- */

/* Portrait hero: photo left, statement right */
.intro { padding-block: clamp(24px, 5vw, 64px) clamp(32px, 6vw, 72px); }
.intro-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(24px, 5vw, 64px);
  align-items: center;
}
.portrait-frame { border-radius: 10px; overflow: hidden; border: 1px solid var(--divider); background: var(--surface); }
.portrait-frame img { display: block; width: 100%; height: auto; max-width: 100%; }
.statement { display: grid; gap: 22px; min-width: 0; }
.statement .tags { display: flex; flex-wrap: wrap; gap: 6px 22px; }
.statement .tags span { font: 600 12px/1.4 var(--body); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.statement h1 {
  font-size: clamp(2.6rem, 7.4vw, 6rem);
  line-height: 0.95;
  letter-spacing: -0.03em;
  text-transform: uppercase;
}
.statement h1 .light { font-weight: 300; }
.statement .second { font: 600 clamp(1.05rem, 2vw, 1.3rem)/1.4 var(--heading); color: var(--text); max-width: 34ch; }
.statement .what { color: var(--muted); max-width: 52ch; }

/* Scrolling journey: a darkened image holds still while the method scrolls over it */
.journey { position: relative; }
.journey .backdrop {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
}
.journey .backdrop img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.32) saturate(0.9);
}
.journey .backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(var(--canvas), transparent 22%, transparent 78%, var(--canvas));
}
.journey .content { position: relative; z-index: 1; margin-top: -100vh; }
.journey .panel-block { min-height: 70vh; display: grid; align-content: center; gap: 18px; padding-block: clamp(48px, 8vw, 96px); }
.journey .panel-block h2 { font-size: clamp(2rem, 5vw, 3.4rem); line-height: 1.05; max-width: 16ch; }
.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(20px, 3vw, 36px);
}
/* Each step sits on its own dark glass card so the text stays readable over the bright photo. */
.steps li {
  display: grid; gap: 12px; align-content: start; min-width: 0;
  padding: clamp(16px, 2vw, 22px);
  background: rgba(20, 21, 19, 0.82);
  border: 1px solid var(--divider);
  border-radius: 12px;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.steps .ring {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 2px solid var(--fx);
  color: var(--fx);
  display: grid;
  place-items: center;
  font: 300 30px/1 var(--heading);
  font-variant-numeric: tabular-nums;
}
.steps h3 { font-size: 18px; }
.steps p { font-size: 15px; line-height: 1.55; color: var(--text); }

/* Proof numbers */
.numbers { padding-block: clamp(48px, 8vw, 96px); }
.numbers dl {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
}
.numbers dl > div { display: grid; gap: 4px; min-width: 0; }
.numbers dt { order: 2; font-size: 14px; color: var(--muted); }
.numbers dd {
  order: 1;
  margin: 0;
  font: 200 clamp(2.6rem, 6vw, 4.8rem)/1 var(--heading);
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  color: var(--fx);
}

/* Selected work: sticky intro beside a column of project tiles */
.work { border-top: 1px solid var(--divider); }
.work-grid {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: start;
  padding-block: clamp(48px, 7vw, 88px);
}
.work-intro { position: sticky; top: 88px; display: grid; gap: 16px; min-width: 0; }
.work-intro h2 { font-size: clamp(1.8rem, 3.6vw, 2.6rem); line-height: 1.08; }
.tiles { display: grid; gap: clamp(24px, 3.5vw, 40px); }
.tile {
  position: relative;
  display: block;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--divider);
  color: var(--text);
  text-decoration: none;
  aspect-ratio: 16 / 10;
  max-width: 100%;
  background: var(--surface);
}
.tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease; }
.tile::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(16, 17, 15, 0.92), rgba(16, 17, 15, 0.15) 60%); }
.tile .tile-text { position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; padding: clamp(16px, 3vw, 28px); display: grid; gap: 8px; justify-items: start; }
.tile h3 { font-size: clamp(1.2rem, 2.6vw, 1.7rem); line-height: 1.15; max-width: 22ch; }
.tile p { font-size: 14px; color: var(--muted); }
.tile:hover img { transform: scale(1.03); }

/* Lab notes and writing */
.notes { border-top: 1px solid var(--divider); padding-block: clamp(48px, 7vw, 88px); }
.notes > .wrap { display: grid; gap: 20px; }
.notes .intro-line { color: var(--muted); max-width: 60ch; }
.note-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.note { padding: 20px; display: grid; gap: 10px; align-content: start; }
.note h3 { font-size: 18px; }
.note p { font-size: 15px; color: var(--muted); }
.note .changed { color: var(--text); }
.writing .rows .what span { font-size: 13px; }

@media (prefers-reduced-motion: reduce) {
  .tile img { transition: none; }
  .tile:hover img { transform: none; }
}
@media (max-width: 860px) {
  .intro-grid, .work-grid { grid-template-columns: minmax(0, 1fr); }
  .portrait-frame { max-width: 420px; }
  .work-intro { position: static; }
  .steps, .numbers dl { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .note-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 520px) {
  .pair { grid-template-columns: minmax(0, 1fr); }
}

/* Work note and software-only projects */
.work-note { padding: 16px 18px; display: grid; gap: 8px; }
.work-note h3 { font-size: 16px; }
.work-note p { font-size: 15px; color: var(--muted); }
.stack { display: flex; flex-wrap: wrap; gap: 6px; }
.software .note .meta { font-size: 13px; color: var(--muted); }
.work-note a { color: var(--text); }

/* Portrait fade: full color at the top, easing to grayscale, then dissolving into the page at the bottom */
.portrait-frame.fade {
  position: relative;
  border: 0;
  background: none;
  border-radius: 0;
  -webkit-mask-image: linear-gradient(to bottom, #000 75%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 75%, transparent 100%);
}
.portrait-frame.fade .mono { filter: grayscale(1) contrast(1.05); }
.portrait-frame.fade .color {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  -webkit-mask-image: linear-gradient(to bottom, #000 45%, transparent 88%);
  mask-image: linear-gradient(to bottom, #000 45%, transparent 88%);
}

/* Landscape hero image (project pages) */
.hero.landscape .hero-grid { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); }
.hero.landscape figure { max-width: none; }
@media (max-width: 860px) {
  .hero.landscape .hero-grid { grid-template-columns: minmax(0, 1fr); }
  .hero.landscape figure { max-width: 100%; }
}

/* Discoverability: nav link and hero call to action */
.nav a.nav-live { color: var(--text); display: inline-flex; align-items: center; gap: 7px; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 0 rgba(147, 244, 62, 0.6); animation: live-pulse 2s infinite; flex: none; }
@keyframes live-pulse { 70% { box-shadow: 0 0 0 7px rgba(147, 244, 62, 0); } 100% { box-shadow: 0 0 0 0 rgba(147, 244, 62, 0); } }
.cta {
  display: inline-flex; align-items: center; gap: 10px; justify-self: start;
  min-height: 44px; padding: 0 20px; border-radius: 999px;
  background: var(--primary); color: var(--on-primary);
  font: 700 15px/1 var(--body); text-decoration: none;
}
.cta:hover { background: var(--primary-hover); }
.cta:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none; } }

/* Full-width image inside a closing panel (blades.html) */
.panel .panel-img { width: 100%; height: auto; border-radius: 10px; margin-top: 8px; display: block; }
