/* ==========================================================================
   That's the Site — design system v2
   "Precision dark, in glass": ambient light, frosted surfaces, one signal
   accent. No external assets: system fonts, inline SVG, zero requests.
   ========================================================================== */

:root {
  color-scheme: dark;
  --ink: #06070a;
  --ink-2: rgba(13, 16, 22, 0.72);
  --glass: rgba(255, 255, 255, 0.045);
  --glass-2: rgba(255, 255, 255, 0.07);
  --line: rgba(235, 240, 245, 0.09);
  --line-strong: rgba(235, 240, 245, 0.16);
  --text: #eef1f4;
  --muted: #9aa4b0;
  --faint: #5d6673;
  --accent: #38e1ff;
  --accent-2: #8b7cff;
  --accent-dim: rgba(56, 225, 255, 0.12);
  --warm: #f5b74c;
  --danger: #f26d6d;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --maxw: 76rem;
  --radius: 1.4rem;
  --row-pad: clamp(4.5rem, 9vw, 8.5rem);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --glass-surface:
    linear-gradient(160deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.015) 45%, rgba(56, 225, 255, 0.03));
  --glass-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    0 1.5rem 4rem rgba(0, 0, 0, 0.45);
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Ambient light field */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background:
    radial-gradient(55% 38% at 12% -4%, rgba(56, 225, 255, 0.10), transparent 60%),
    radial-gradient(45% 36% at 92% 18%, rgba(139, 124, 255, 0.09), transparent 62%),
    radial-gradient(50% 30% at 50% 108%, rgba(245, 183, 76, 0.05), transparent 60%);
}
/* Film grain */
body::after {
  content: ""; position: fixed; inset: 0; z-index: 90; pointer-events: none;
  opacity: 0.032; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

::selection { background: var(--accent); color: var(--ink); }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 0.2em; }

img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

section[id] { scroll-margin-top: 6.5rem; }

.skip-link {
  position: absolute; left: 1rem; top: -4rem;
  background: var(--accent); color: var(--ink);
  padding: 0.6rem 1rem; border-radius: 0 0 0.5rem 0.5rem;
  z-index: 200; transition: top 0.2s var(--ease); font-weight: 600;
}
.skip-link:focus { top: 0; text-decoration: none; }

/* ------------------------------- Nav ---------------------------------- */

.site-nav {
  position: fixed; inset: 0.7rem 0 auto 0; z-index: 100;
  display: flex; align-items: center; gap: 1.3rem;
  width: min(72rem, calc(100vw - 1.5rem));
  margin: 0 auto;
  padding: 0.4rem 0.6rem 0.4rem 1rem;
  background: var(--ink-2);
  backdrop-filter: blur(22px) saturate(1.4);
  -webkit-backdrop-filter: blur(22px) saturate(1.4);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: 0 0.8rem 3rem rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.brand { display: flex; align-items: center; gap: 0.6rem; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 1.15rem; height: 1.15rem; flex: none;
  border: 2px solid var(--accent); border-radius: 50%;
  position: relative;
  box-shadow: 0 0 12px rgba(56, 225, 255, 0.5);
}
.brand-mark::after {
  content: ""; position: absolute; inset: 35%;
  background: var(--accent); border-radius: 50%;
}
.brand-name {
  font-family: var(--mono);
  font-size: 0.92rem; font-weight: 700;
  letter-spacing: 0.17em; text-transform: uppercase;
  white-space: nowrap;
}
.brand-accent {
  color: var(--accent);
  text-shadow: 0 0 14px rgba(56, 225, 255, 0.45);
}

.nav-links {
  display: flex; gap: 1.3rem; margin-left: auto;
  font-size: 0.87rem;
}
.nav-links a {
  color: var(--muted); transition: color 0.2s;
  position: relative; padding: 0.2rem 0;
}
.nav-links a:hover { color: var(--text); text-decoration: none; }
.nav-links a.is-active { color: var(--accent); }
.nav-links a.is-active::after,
.nav-links a[aria-current="page"]::after {
  content: ""; position: absolute; left: 50%; bottom: -0.35rem;
  width: 0.28rem; height: 0.28rem; border-radius: 50%;
  background: var(--accent); transform: translateX(-50%);
  box-shadow: 0 0 8px var(--accent);
}
.nav-links a[aria-current="page"] { color: var(--accent); }

.nav-cta {
  flex: none;
  border-radius: 999px;
  padding: 0.42rem 1.05rem; font-size: 0.85rem; font-weight: 600;
  color: var(--ink);
  background: linear-gradient(120deg, var(--accent), #7be9ff);
  box-shadow: 0 0.4rem 1.4rem rgba(56, 225, 255, 0.28);
  transition: transform 0.2s var(--ease), box-shadow 0.2s;
}
.nav-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 0.6rem 1.8rem rgba(56, 225, 255, 0.4);
}

/* ------------------------------- Rows ---------------------------------- */

.row {
  position: relative;
  padding: var(--row-pad) clamp(1.25rem, 5vw, 3rem);
}
.row + .row::before {
  content: ""; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: min(72rem, calc(100% - 3rem)); height: 1px;
  background: linear-gradient(90deg, transparent, var(--line-strong), transparent);
}

.row-inner {
  max-width: var(--maxw); margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(2.5rem, 5.5vw, 5rem);
  align-items: center;
}
.row-flip .row-inner { grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); }
.row-flip .row-art { order: 2; }
.row-flip .row-body { order: 1; }
.row-inner-wide { display: block; max-width: var(--maxw); }

.row-hero {
  min-height: 100svh;
  display: flex; flex-direction: column; justify-content: flex-start;
  padding-top: clamp(5.5rem, 13vh, 8rem);
}
.row-hero .row-inner { width: 100%; }

/* ------------------------------- Art panel ----------------------------- */

.row-art {
  margin: 0;
  aspect-ratio: 4 / 3.4;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--glass-surface);
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  position: relative;
  overflow: hidden;
  transition: transform 0.5s var(--ease), border-color 0.5s;
}
.row-art:hover {
  transform: translateY(-4px);
  border-color: var(--line-strong);
}
.row-art::before { /* blueprint grid, masked */
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 2.4rem 2.4rem;
  mask-image: radial-gradient(95% 95% at 50% 45%, black 25%, transparent 105%);
  opacity: 0.55;
}
.row-art::after { /* glass sheen */
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(115deg, rgba(255, 255, 255, 0.06) 0%, transparent 30%);
  pointer-events: none;
}
.row-art svg {
  position: absolute; inset: 0; width: 100%; height: 100%;
  animation: art-in 0.6s var(--ease);
}
@keyframes art-in {
  from { opacity: 0; transform: scale(0.97) translateY(8px); filter: blur(6px); }
  to { opacity: 1; transform: none; filter: blur(0); }
}

/* ------------------------------- Text column --------------------------- */

.kicker {
  font-family: var(--mono); font-size: 0.76rem; letter-spacing: 0.24em;
  text-transform: uppercase; color: var(--accent);
  margin: 0 0 1rem;
  display: flex; align-items: center; gap: 0.8rem;
}
.kicker::before {
  content: ""; width: 1.6rem; height: 1px;
  background: linear-gradient(90deg, var(--accent), transparent);
}

.row-title {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(1.95rem, 3.4vw, 2.75rem);
  line-height: 1.12; letter-spacing: -0.015em;
  margin: 0 0 2.2rem;
}

.row-lede { color: var(--muted); max-width: 46rem; margin: -1.2rem 0 2.5rem; }

.display {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(2.2rem, 4.4vw, 3.5rem);
  line-height: 1.06; letter-spacing: -0.02em;
  margin: 0 0 1.4rem;
}

.slide h3 {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(1.5rem, 2.4vw, 2rem);
  line-height: 1.2; margin: 0 0 1rem;
}
.slide p { color: var(--muted); margin: 0 0 1rem; max-width: 34rem; }
.slide p strong, .slide p em { color: var(--text); }
.slide p em { font-family: var(--serif); }
.slide a { text-decoration: underline; text-underline-offset: 0.2em; }

/* Slides: default (no-JS) = stacked. JS turns it into a carousel. */
.slides { position: relative; }
html.js .slides { overflow: hidden; }
html.js .slide {
  position: absolute; inset: 0 auto auto 0; width: 100%;
  opacity: 0; visibility: hidden;
  transform: translateX(1.6rem);
  transition: opacity 0.45s var(--ease), transform 0.45s var(--ease), visibility 0s linear 0.45s;
}
html.js .slide.is-active {
  position: relative;
  opacity: 1; visibility: visible; transform: none;
  transition: opacity 0.45s var(--ease), transform 0.45s var(--ease);
}
html.js .slide.is-exit-left { transform: translateX(-1.6rem); }

/* --------------------------- Row carousel nav -------------------------- */

.row-nav {
  display: flex; align-items: center; gap: 1.1rem;
  margin-top: 2.4rem;
}
.row-arrow {
  width: 3rem; height: 3rem; flex: none;
  border: 1px solid var(--line-strong); border-radius: 50%;
  display: grid; place-items: center;
  color: var(--muted);
  background: var(--glass);
  backdrop-filter: blur(8px);
  transition: color 0.2s, border-color 0.2s, box-shadow 0.2s, transform 0.2s var(--ease);
}
.row-arrow:hover {
  color: var(--accent); border-color: rgba(56, 225, 255, 0.5);
  box-shadow: 0 0 1.4rem rgba(56, 225, 255, 0.25);
  transform: scale(1.07);
}
.row-arrow:active { transform: scale(0.95); }
.row-arrow svg { width: 1.1rem; height: 1.1rem; }

.row-dots { display: flex; gap: 0.5rem; align-items: center; }
.row-dot {
  width: 0.45rem; height: 0.45rem; border-radius: 999px;
  background: var(--line-strong);
  transition: background 0.25s, width 0.25s var(--ease), box-shadow 0.25s;
  padding: 0;
}
.row-dot.is-active {
  background: var(--accent); width: 1.5rem;
  box-shadow: 0 0 10px rgba(56, 225, 255, 0.55);
}

.row-count {
  margin-left: auto;
  font-family: var(--mono); font-size: 0.76rem; color: var(--faint);
  letter-spacing: 0.14em;
}
.row-count b { color: var(--muted); font-weight: 500; }

/* Scroll hint */
.scroll-hint {
  position: absolute; left: 50%; bottom: 1.8rem; transform: translateX(-50%);
  font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.32em;
  text-transform: uppercase; color: var(--faint);
  display: flex; flex-direction: column; align-items: center; gap: 0.6rem;
}
.scroll-hint:hover { text-decoration: none; color: var(--muted); }
.scroll-hint span {
  width: 1px; height: 2.6rem;
  background: linear-gradient(var(--accent), transparent);
  animation: hint 2.2s var(--ease) infinite;
}
@keyframes hint { 0% { transform: scaleY(0); transform-origin: top; } 45% { transform: scaleY(1); transform-origin: top; } 55% { transform: scaleY(1); transform-origin: bottom; } 100% { transform: scaleY(0); transform-origin: bottom; } }

/* ------------------------------- Blog cards ---------------------------- */

.post-cards {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem; margin-top: 1rem;
}
.post-card {
  display: flex; flex-direction: column; gap: 0.7rem;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--glass-surface);
  box-shadow: var(--glass-shadow);
  padding: 1.6rem 1.5rem 1.4rem;
  color: var(--text);
  position: relative; overflow: hidden;
  transition: border-color 0.25s, transform 0.3s var(--ease);
  min-height: 15rem;
}
.post-card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(56, 225, 255, 0.6), transparent);
  opacity: 0; transition: opacity 0.3s;
}
.post-card:hover { text-decoration: none; border-color: var(--line-strong); transform: translateY(-4px); }
.post-card:hover::before { opacity: 1; }
.post-card-meta {
  font-family: var(--mono); font-size: 0.72rem; color: var(--faint);
  letter-spacing: 0.1em; display: flex; gap: 0.8rem; align-items: center;
}
.post-card-tag {
  color: var(--accent); border: 1px solid var(--accent-dim);
  background: var(--accent-dim); border-radius: 999px; padding: 0.1rem 0.55rem;
}
.post-card h3 {
  font-family: var(--serif); font-weight: 500; font-size: 1.26rem;
  line-height: 1.25; margin: 0;
}
.post-card p { color: var(--muted); font-size: 0.94rem; margin: 0; flex: 1; }
.post-card-cta {
  font-family: var(--mono); font-size: 0.76rem; color: var(--accent);
  letter-spacing: 0.08em;
}

.blog-actions { margin-top: 2.2rem; }

.btn {
  display: inline-block; border-radius: 999px; padding: 0.75rem 1.7rem;
  font-size: 0.95rem; transition: all 0.25s var(--ease);
}
.btn-outline {
  border: 1px solid var(--line-strong); color: var(--text);
  background: var(--glass);
}
.btn-outline:hover {
  border-color: rgba(56, 225, 255, 0.5); color: var(--accent);
  box-shadow: 0 0 1.6rem rgba(56, 225, 255, 0.18);
  text-decoration: none;
}

/* Blog list page + reader */
.page-main { max-width: 58rem; margin: 0 auto; padding: 10rem clamp(1.25rem, 4vw, 2rem) 7rem; }
.page-head { margin-bottom: 3rem; }
.page-title {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(2.2rem, 4vw, 3.1rem); line-height: 1.08; letter-spacing: -0.015em;
  margin: 0 0 1rem;
}
.page-lede { color: var(--muted); max-width: 42rem; margin: 0; }

.post-list { display: flex; flex-direction: column; }
.post-row {
  display: grid; grid-template-columns: 7.5rem 1fr auto; gap: 1.5rem;
  align-items: baseline; padding: 1.7rem 0.5rem;
  border-top: 1px solid var(--line); color: var(--text);
  border-radius: 0.5rem;
  transition: background 0.2s;
}
.post-row:last-child { border-bottom: 1px solid var(--line); }
.post-row:hover { text-decoration: none; background: rgba(255, 255, 255, 0.025); }
.post-row-date { font-family: var(--mono); font-size: 0.78rem; color: var(--faint); }
.post-row h2 { font-family: var(--serif); font-weight: 500; font-size: 1.45rem; margin: 0 0 0.4rem; line-height: 1.25; }
.post-row p { color: var(--muted); margin: 0; font-size: 0.96rem; max-width: 40rem; }
.post-row-arrow { color: var(--faint); font-size: 1.2rem; transition: color 0.2s, transform 0.2s var(--ease); }
.post-row:hover .post-row-arrow { color: var(--accent); transform: translateX(4px); }

.post-body { max-width: 42rem; }
.post-body h2 {
  font-family: var(--serif); font-weight: 500; font-size: 1.7rem;
  margin: 2.6rem 0 0.9rem; line-height: 1.25;
}
.post-body h3 { font-family: var(--serif); font-weight: 500; font-size: 1.25rem; margin: 2.2rem 0 0.7rem; }
.post-body p, .post-body li { color: #c6ccd5; }
.post-body p { margin: 0 0 1.15rem; }
.post-body ul, .post-body ol { margin: 0 0 1.15rem; padding-left: 1.4rem; }
.post-body li { margin-bottom: 0.4rem; }
.post-body blockquote {
  margin: 1.6rem 0; padding: 0.2rem 0 0.2rem 1.2rem;
  border-left: 2px solid var(--accent); color: var(--muted);
  font-family: var(--serif); font-size: 1.1rem;
}
.post-body code {
  font-family: var(--mono); font-size: 0.88em;
  background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line);
  border-radius: 0.35rem; padding: 0.1rem 0.35rem;
}
.post-body pre {
  background: rgba(255, 255, 255, 0.03); border: 1px solid var(--line);
  border-radius: 0.7rem; padding: 1.1rem 1.2rem; overflow-x: auto;
  margin: 0 0 1.3rem;
}
.post-body pre code { background: none; border: 0; padding: 0; font-size: 0.85rem; line-height: 1.6; }
.post-body a { text-decoration: underline; text-underline-offset: 0.2em; }
.post-body hr { border: 0; border-top: 1px solid var(--line); margin: 2.4rem 0; }
.post-figure {
  margin: 2rem 0;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--glass-surface);
  box-shadow: var(--glass-shadow);
  overflow: hidden;
}
.post-figure img { display: block; width: 100%; height: auto; }
.post-figure figcaption {
  padding: 0.7rem 1.1rem;
  border-top: 1px solid var(--line);
  font-family: var(--mono); font-size: 0.76rem; color: var(--faint);
  letter-spacing: 0.04em;
}
.post-meta-line {
  font-family: var(--mono); font-size: 0.8rem; color: var(--faint);
  display: flex; gap: 1rem; flex-wrap: wrap; margin: 0 0 2.5rem;
}
.post-meta-line .post-card-tag { font-size: 0.74rem; }
.back-link { font-family: var(--mono); font-size: 0.82rem; color: var(--muted); }
.back-link:hover { color: var(--accent); }

/* ------------------------------- Footer -------------------------------- */

.site-footer {
  position: relative;
  padding: 3.5rem clamp(1.25rem, 5vw, 3rem) 6.5rem; /* room for the composer */
}
.site-footer::before {
  content: ""; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: min(72rem, calc(100% - 3rem)); height: 1px;
  background: linear-gradient(90deg, transparent, var(--line-strong), transparent);
}
.footer-inner {
  max-width: var(--maxw); margin: 0 auto;
  display: flex; flex-wrap: wrap; gap: 2rem; align-items: flex-start;
}
.footer-brand { display: grid; gap: 0.3rem; }
.footer-brand .brand-mark { margin-bottom: 0.4rem; }
.footer-name { margin: 0; }
.footer-tag { color: var(--faint); font-size: 0.9rem; margin: 0; }
.footer-links {
  display: flex; gap: 1.4rem; margin-left: auto; font-size: 0.9rem;
  padding-top: 0.5rem;
}
.footer-links a { color: var(--muted); }
.footer-links a:hover { color: var(--text); text-decoration: none; }
.footer-note {
  width: 100%; margin: 1.5rem 0 0; padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  font-family: var(--mono); font-size: 0.74rem; color: var(--faint);
  letter-spacing: 0.06em;
}

/* --------------------- Intake composer (AI chatbox) -------------------- */

.intake {
  position: fixed; z-index: 150;
  left: 50%; bottom: 0.85rem; transform: translateX(-50%);
  width: min(46rem, calc(100vw - 1.5rem));
  display: flex; flex-direction: column; align-items: center; gap: 0.45rem;
}

.intake-composer {
  width: 100%;
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.38rem 0.42rem 0.38rem 1rem;
  background: rgba(14, 17, 23, 0.78);
  backdrop-filter: blur(26px) saturate(1.5);
  -webkit-backdrop-filter: blur(26px) saturate(1.5);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  box-shadow:
    0 1.2rem 3.5rem rgba(0, 0, 0, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition: border-color 0.3s, box-shadow 0.3s;
}
.intake-composer:focus-within {
  border-color: rgba(56, 225, 255, 0.55);
  box-shadow:
    0 1.2rem 3.5rem rgba(0, 0, 0, 0.6),
    0 0 0 4px rgba(56, 225, 255, 0.10),
    0 0 2.2rem rgba(56, 225, 255, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.intake-dot {
  width: 0.5rem; height: 0.5rem; border-radius: 50%; flex: none;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(56, 225, 255, 0.5);
  animation: pulse 2.6s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(56, 225, 255, 0.45); }
  70% { box-shadow: 0 0 0 0.6rem rgba(56, 225, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(56, 225, 255, 0); }
}

.intake-input {
  flex: 1; min-width: 0;
  background: none; border: 0; color: var(--text);
  font: inherit; font-size: 0.94rem;
  padding: 0.45rem 0;
}
.intake-input::placeholder { color: var(--faint); }
.intake-input:focus { outline: none; }

.intake-skip {
  flex: none; font-family: var(--mono); font-size: 0.74rem;
  color: var(--faint); padding: 0.4rem 0.6rem;
  transition: color 0.2s;
}
.intake-skip:hover { color: var(--muted); }

.intake-send {
  flex: none; width: 2.3rem; height: 2.3rem; border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), #7be9ff);
  color: var(--ink);
  box-shadow: 0 0.3rem 1.2rem rgba(56, 225, 255, 0.35);
  transition: transform 0.2s var(--ease), box-shadow 0.2s, opacity 0.2s;
}
.intake-send:hover { transform: scale(1.08); box-shadow: 0 0.5rem 1.6rem rgba(56, 225, 255, 0.5); }
.intake-send:disabled { opacity: 0.35; transform: none; box-shadow: none; cursor: default; }

.intake-arrow {
  color: var(--accent);
  display: grid; place-items: center;
  filter: drop-shadow(0 0 0.7rem rgba(56, 225, 255, 0.65));
  animation: intake-arrow-bounce 1.8s var(--ease) infinite;
}
/* Size lives here, not in the SVG attributes, so one rule covers all
   three pages the composer markup is duplicated into. */
.intake-arrow svg { width: 2.7rem; height: 2.7rem; }
.intake-arrow[hidden] { display: none; }
@keyframes intake-arrow-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(0.45rem); }
}

/* Thread — the conversation, opens above the composer */
.intake-thread {
  width: 100%;
  max-height: min(24rem, 52vh);
  overflow-y: auto;
  padding: 1rem 1.1rem;
  display: flex; flex-direction: column; gap: 0.55rem;
  background: rgba(12, 15, 20, 0.82);
  backdrop-filter: blur(26px) saturate(1.5);
  -webkit-backdrop-filter: blur(26px) saturate(1.5);
  border: 1px solid var(--line);
  border-radius: 1.3rem;
  box-shadow: 0 1.4rem 4rem rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent;
  animation: thread-in 0.4s var(--ease);
}
.intake-thread[hidden] { display: none; }
@keyframes thread-in {
  from { opacity: 0; transform: translateY(0.9rem) scale(0.985); }
  to { opacity: 1; transform: none; }
}

.msg {
  max-width: 88%;
  padding: 0.6rem 0.9rem;
  border-radius: 1rem;
  font-size: 0.92rem; line-height: 1.5;
  animation: msg-in 0.3s var(--ease);
  white-space: pre-line;
}
@keyframes msg-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.msg-bot {
  align-self: flex-start;
  background: var(--glass-2); border: 1px solid var(--line);
  border-bottom-left-radius: 0.3rem; color: var(--text);
}
.msg-user {
  align-self: flex-end;
  background: linear-gradient(135deg, rgba(56, 225, 255, 0.16), rgba(139, 124, 255, 0.14));
  border: 1px solid rgba(56, 225, 255, 0.32);
  border-bottom-right-radius: 0.3rem; color: var(--text);
}
.msg-note {
  align-self: center; background: none; border: 0;
  color: var(--faint); font-family: var(--mono); font-size: 0.7rem;
  text-align: center; padding: 0.15rem;
}
.msg-bot a { text-decoration: underline; }

.msg-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.intake-qr {
  border: 1px solid var(--line-strong); border-radius: 999px;
  padding: 0.45rem 1rem; font-size: 0.85rem; color: var(--text);
  background: var(--glass);
  transition: border-color 0.2s, color 0.2s, box-shadow 0.2s;
}
.intake-qr:hover { border-color: var(--accent); color: var(--accent); }
.intake-qr-primary {
  background: linear-gradient(135deg, var(--accent), #7be9ff);
  border-color: transparent; color: var(--ink); font-weight: 600;
}
.intake-qr-primary:hover { background: none; color: var(--accent); border-color: var(--accent); }

.intake-typing { display: inline-flex; gap: 0.28rem; padding: 0.75rem 0.9rem; }
.intake-typing i {
  width: 0.35rem; height: 0.35rem; border-radius: 50%;
  background: var(--faint); animation: blink 1.2s infinite;
}
.intake-typing i:nth-child(2) { animation-delay: 0.18s; }
.intake-typing i:nth-child(3) { animation-delay: 0.36s; }
@keyframes blink { 0%, 60%, 100% { opacity: 0.25; } 30% { opacity: 1; } }

/* --------------------------- Motion & reveals -------------------------- */

/* Hero entrance — runs once on load */
.row-hero .row-head,
.row-hero .slides,
.row-hero .row-art,
.row-hero .row-nav,
.scroll-hint {
  animation: hero-in 0.9s var(--ease) backwards;
}
.row-hero .row-head { animation-delay: 0.05s; }
.row-hero .slides { animation-delay: 0.18s; }
.row-hero .row-art { animation-delay: 0.3s; }
.row-hero .row-nav { animation-delay: 0.42s; }
.scroll-hint { animation-delay: 0.8s; }
@keyframes hero-in {
  from { opacity: 0; transform: translateY(28px); }
  to { opacity: 1; transform: none; }
}

/* Scroll reveals — JS adds .in-view when the row enters the viewport */
html.js .row .row-head,
html.js .row .row-art,
html.js .row .slides,
html.js .row .row-nav,
html.js .row-blog .row-head,
html.js .row-blog .post-cards,
html.js .row-blog .blog-actions {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}
html.js .row.in-view .row-head { opacity: 1; transform: none; }
html.js .row.in-view .row-art { opacity: 1; transform: none; transition-delay: 0.12s; }
html.js .row.in-view .slides { opacity: 1; transform: none; transition-delay: 0.2s; }
html.js .row.in-view .row-nav { opacity: 1; transform: none; transition-delay: 0.32s; }
html.js .row-blog.in-view .row-head { opacity: 1; transform: none; }
html.js .row-blog.in-view .post-cards { opacity: 1; transform: none; transition-delay: 0.15s; }
html.js .row-blog.in-view .blog-actions { opacity: 1; transform: none; transition-delay: 0.28s; }
/* Hero is visible at load — no reveal gating there */
html.js .row-hero .row-head,
html.js .row-hero .row-art,
html.js .row-hero .slides,
html.js .row-hero .row-nav {
  opacity: 1; transform: none; transition: none;
}

/* Art panel pointer tilt (JS sets --rx/--ry; fine pointers only) */
.row-art {
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: opacity 0.8s var(--ease), transform 0.18s ease-out, border-color 0.5s;
}
.row-art:hover { transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(-4px); }

/* Inline CTAs inside slides */
.inline-cta {
  display: inline-flex; align-items: center; gap: 0.5rem;
  margin-top: 0.5rem; padding: 0;
  font-family: var(--mono); font-size: 0.86rem; letter-spacing: 0.04em;
  color: var(--accent);
  transition: gap 0.25s var(--ease), text-shadow 0.25s;
}
.inline-cta span { transition: transform 0.25s var(--ease); }
.inline-cta:hover { text-shadow: 0 0 18px rgba(56, 225, 255, 0.5); }
.inline-cta:hover span { transform: translateX(5px); }

/* Composer nudge — one gentle lift when a reader reaches the end unengaged */
.intake.nudge .intake-composer { animation: nudge 1.1s var(--ease); }
@keyframes nudge {
  0%, 100% { transform: translateY(0); }
  30% {
    transform: translateY(-9px);
    border-color: rgba(56, 225, 255, 0.65);
    box-shadow: 0 1.2rem 3.5rem rgba(0, 0, 0, 0.6), 0 0 0 5px rgba(56, 225, 255, 0.12), 0 0 2.6rem rgba(56, 225, 255, 0.3);
  }
}

/* Nav link underline sweep */
.nav-links a::before {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 1px;
  background: linear-gradient(90deg, var(--accent), transparent);
  transform: scaleX(0); transform-origin: left;
  transition: transform 0.3s var(--ease);
}
.nav-links a:hover::before { transform: scaleX(1); }

/* ------------------------------- Responsive ---------------------------- */

@media (max-width: 58rem) {
  .nav-links { display: none; }
  /* nav-links carried the auto margin that pinned the CTA right; with it
     hidden the CTA would collapse against the brand — pin it explicitly */
  .nav-cta { margin-left: auto; }
  .row-inner, .row-flip .row-inner { grid-template-columns: 1fr; gap: 2.2rem; }
  .row-flip .row-art { order: 0; }
  .row-art { aspect-ratio: 16 / 10; }
  .row-hero { min-height: 0; }
  .post-cards { grid-template-columns: 1fr; }
  .post-card { min-height: 0; }
  .post-row { grid-template-columns: 1fr; gap: 0.4rem; }
  .post-row-arrow { display: none; }
  .scroll-hint { display: none; }
  .footer-links { margin-left: 0; }
  .intake { bottom: 0.75rem; width: calc(100vw - 1rem); }
  .site-footer { padding-bottom: 6rem; }
}

/* --------------------------- Reduced motion ---------------------------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ==========================================================================
   Typography layer — the standard we sell.
   One modular scale, leading/tracking tuned per role, balanced rags,
   kerning + ligatures on, tabular figures where numbers align,
   emphasis weighted for dark UI. Zero webfonts: craft, not downloads.
   ========================================================================== */

:root {
  --fs-display: clamp(2.3rem, 4.6vw, 3.6rem);
  --fs-title: clamp(2rem, 3.5vw, 2.8rem);
  --fs-h3: clamp(1.5rem, 2.4vw, 2rem);
  --fs-lede: 1.08rem;
  --lh-display: 1.06;
  --lh-title: 1.12;
  --lh-h3: 1.2;
  --track-display: -0.022em;
  --track-title: -0.018em;
  --track-h3: -0.01em;
}

body {
  font-kerning: normal;
  font-feature-settings: "kern" 1, "liga" 1, "clig" 1, "calt" 1;
  hanging-punctuation: first;
  line-height: 1.68;
}

/* Rag quality: balanced headings, tidy paragraphs, no lonely words */
p, li, blockquote { text-wrap: pretty; orphans: 2; widows: 2; }
h1, h2, h3, h4, .display, .row-title, .page-title, .slide h3 { text-wrap: balance; }

/* Emphasis discipline — dark surfaces bloom at 700, serif-italic for voice */
strong, b { font-weight: 600; }
em, i { font-family: var(--serif); }

/* Display roles */
.display {
  font-size: var(--fs-display);
  line-height: var(--lh-display);
  letter-spacing: var(--track-display);
}
.row-title {
  font-size: var(--fs-title);
  line-height: var(--lh-title);
  letter-spacing: var(--track-title);
  margin-bottom: 2.3rem;
}
.page-title { letter-spacing: -0.02em; line-height: 1.07; }
.slide h3 {
  font-size: var(--fs-h3);
  line-height: var(--lh-h3);
  letter-spacing: var(--track-h3);
}
.post-body h2 { letter-spacing: -0.012em; line-height: 1.22; }
.post-body h3 { letter-spacing: -0.008em; line-height: 1.3; }
.post-row h2 { letter-spacing: -0.01em; line-height: 1.22; }
.post-card h3 { letter-spacing: -0.008em; line-height: 1.24; }

/* Measure and lede rhythm */
.slide p { max-width: 33.5rem; }
.post-body { max-width: 40rem; }
.row-lede { font-size: var(--fs-lede); line-height: 1.6; }

/* Meta and numerals */
.kicker { font-size: 0.75rem; letter-spacing: 0.22em; }
.row-count, .post-row-date, .post-card-meta, .post-meta-line {
  font-variant-numeric: tabular-nums;
}

/* Link underlines: thin, low, quiet */
.post-body a, .slide a {
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
}

/* The reader's signature: drop cap on the first paragraph of an article */
.post-body > p:first-of-type::first-letter {
  font-family: var(--serif);
  font-size: 3.4em;
  line-height: 0.85;
  float: left;
  padding: 0.08em 0.12em 0 0;
  color: var(--accent);
}

/* Long-word safety */
p, h1, h2, h3, h4 { overflow-wrap: break-word; }

/* ==========================================================================
   Mobile parity layer — tap targets, iOS quirks, safe areas.
   ========================================================================== */

/* Carousel dots: visual dot stays small, hit area grows to touch size */
.row-dot {
  width: 1.4rem; height: 1.4rem;
  background: transparent;
  position: relative;
}
.row-dot::before {
  content: ""; position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 0.45rem; height: 0.45rem; border-radius: 999px;
  background: var(--line-strong);
  transition: background 0.25s, width 0.25s var(--ease), box-shadow 0.25s;
}
.row-dot.is-active { background: transparent; width: 1.4rem; box-shadow: none; }
.row-dot.is-active::before {
  width: 1.3rem;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(56, 225, 255, 0.55);
}

/* No gray flash on taps (mobile) */
a, button, input { -webkit-tap-highlight-color: transparent; }

/* Respect the iPhone home-indicator area under the composer */
.intake { bottom: calc(0.85rem + env(safe-area-inset-bottom, 0px)); }

@media (max-width: 58rem) {
  /* 16px minimum in inputs — smaller triggers iOS Safari's focus zoom */
  .intake-input { font-size: 16px; }
  .page-main { padding-top: 7.5rem; }
  /* the attention arrow scales up on small screens */
  .intake-arrow svg { width: 3.3rem; height: 3.3rem; }
}

@media (max-width: 26rem) {
  .site-nav { gap: 0.8rem; padding: 0.35rem 0.45rem 0.35rem 0.9rem; }
  .brand-name { font-size: 0.82rem; letter-spacing: 0.13em; }
  .nav-cta { padding: 0.38rem 0.8rem; font-size: 0.8rem; }
}
