/* ==========================================================================
   Unktok — Artificial Life Edition
   ========================================================================== */

:root {
  --font-display: 'Fraunces', 'PP Editorial New', ui-serif, Georgia, serif;
  --font-sans: 'Space Grotesk', 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  --bg: #050505;
  --bg-elev: #0b0b0d;
  --ink: #f4f1ea;
  --ink-soft: rgba(244, 241, 234, 0.66);
  --ink-faint: rgba(244, 241, 234, 0.38);
  --hair: rgba(244, 241, 234, 0.08);
  --hair-strong: rgba(244, 241, 234, 0.16);

  --bio-cyan: #7fffe1;
  --bio-violet: #b89dff;
  --bio-amber: #f6c87a;
  --bio-rose: #ff9ec7;
  --signal-lime: #baff7b;
  --grid-cyan: rgba(127, 255, 225, 0.055);

  --ease-soft: cubic-bezier(0.32, 0.72, 0, 1);
  --ease-spring: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-glide: cubic-bezier(0.65, 0, 0.35, 1);

  --max-w: 1280px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-feature-settings: "ss01", "ss02", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  position: relative;
}

::selection {
  background: var(--bio-violet);
  color: var(--bg);
}

/* ==========================================================================
   Background ambience — mesh gradient + grain
   ========================================================================== */

.ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background:
    radial-gradient(ellipse 70% 55% at 66% 42%, rgba(127, 255, 225, 0.14), transparent 62%),
    radial-gradient(ellipse 60% 48% at 24% 56%, rgba(184, 157, 255, 0.12), transparent 64%),
    repeating-linear-gradient(0deg, transparent 0 21px, var(--grid-cyan) 21px 22px),
    repeating-linear-gradient(90deg, transparent 0 21px, rgba(186, 255, 123, 0.035) 21px 22px);
}

.ambient::before,
.ambient::after {
  content: '';
  position: absolute;
  filter: blur(26px);
  mix-blend-mode: screen;
  will-change: transform;
}

.ambient::before {
  width: 130vmax;
  height: 130vmax;
  left: -20vmax;
  top: -28vmax;
  opacity: 0.18;
  background:
    conic-gradient(from 80deg at 50% 50%,
      transparent 0deg,
      rgba(127, 255, 225, 0.36) 36deg,
      transparent 68deg,
      rgba(184, 157, 255, 0.28) 142deg,
      transparent 192deg,
      rgba(186, 255, 123, 0.26) 250deg,
      transparent 318deg);
  mask-image: radial-gradient(circle at center, black 0 38%, transparent 68%);
  animation: data-rotate 54s linear infinite;
}

.ambient::after {
  inset: 0;
  opacity: 0.18;
  filter: none;
  background:
    linear-gradient(180deg, transparent 0 49%, rgba(127, 255, 225, 0.12) 50%, transparent 51% 100%),
    repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 7px);
  transform-origin: center;
  animation: scan-field 10s linear infinite;
}

@keyframes data-rotate {
  0%   { transform: rotate(0deg) scale(1); }
  100% { transform: rotate(360deg) scale(1.04); }
}

@keyframes scan-field {
  0%   { transform: translateY(-10%); opacity: 0.12; }
  45%  { opacity: 0.20; }
  100% { transform: translateY(10%); opacity: 0.12; }
}

#life-canvas {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  width: 100%;
  height: 100%;
  opacity: 0;
  mix-blend-mode: screen;
  filter: saturate(1.18) contrast(1.08);
  transition: opacity 1.6s var(--ease-soft);
}

#life-canvas.ready { opacity: 1; }

.grain {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0.06;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.45 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

.vignette {
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background:
    radial-gradient(120% 80% at 50% 50%, transparent 50%, rgba(0,0,0,0.55) 100%),
    linear-gradient(180deg, rgba(5,5,5,0.4) 0%, transparent 25%, transparent 75%, rgba(5,5,5,0.55) 100%);
}

/* ==========================================================================
   Header — fluid glass pill
   ========================================================================== */

header {
  position: fixed;
  top: 18px;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  justify-content: center;
  pointer-events: none;
}

nav {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 8px 10px 8px 22px;
  background: rgba(12, 12, 14, 0.55);
  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  border: 1px solid var(--hair);
  border-radius: 999px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 30px 60px -30px rgba(0, 0, 0, 0.8);
  transition: transform 0.7s var(--ease-soft), background 0.7s var(--ease-soft);
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 18px;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
}

.logo img {
  height: 28px;
  width: auto;
  filter: drop-shadow(0 0 6px rgba(127, 255, 225, 0.25));
  transition: transform 0.6s var(--ease-spring);
}

.logo:hover img { transform: rotate(-8deg) scale(1.05); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px 9px 18px;
  border-radius: 999px;
  font-size: 13px;
  letter-spacing: 0.02em;
  color: var(--ink-soft);
  text-decoration: none;
  transition: color 0.5s var(--ease-soft), background 0.5s var(--ease-soft);
}

.nav-link::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--bio-cyan);
  box-shadow: 0 0 8px var(--bio-cyan);
  opacity: 0.45;
  transition: opacity 0.5s var(--ease-soft), transform 0.5s var(--ease-soft);
}

.nav-link:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.04);
}

.nav-link:hover::before {
  opacity: 1;
  transform: scale(1.3);
}

.nav-link.contact {
  background: var(--ink);
  color: var(--bg);
  padding: 9px 6px 9px 18px;
}

.nav-link.contact::before { display: none; }

.nav-link.contact .pip {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.08);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.5s var(--ease-spring), background 0.5s var(--ease-soft);
}

.nav-link.contact:hover {
  color: var(--bg);
  background: var(--ink);
}

.nav-link.contact:hover .pip {
  transform: translate(2px, -2px) scale(1.06);
  background: rgba(0, 0, 0, 0.16);
}

.nav-link.contact .pip svg { width: 11px; height: 11px; }

/* ==========================================================================
   Main / hero
   ========================================================================== */

main {
  flex: 1;
  position: relative;
  z-index: 4;
  display: flex;
  flex-direction: column;
}

.hero {
  flex: 1;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: center;
  padding: 140px 48px 120px;
  max-width: var(--max-w);
  margin: 0 auto;
  width: 100%;
}

.hero-inner {
  display: flex;
  flex-direction: column;
  gap: 36px;
  max-width: 980px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 7px 14px 7px 12px;
  width: fit-content;
  border-radius: 999px;
  border: 1px solid var(--hair-strong);
  background: rgba(255, 255, 255, 0.02);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-soft);
  backdrop-filter: blur(8px);
  opacity: 0;
  transform: translateY(14px);
  animation: rise 1.1s var(--ease-soft) 0.2s forwards;
}

.eyebrow .pulse {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--bio-cyan);
  box-shadow: 0 0 10px var(--bio-cyan);
}

.eyebrow .pulse::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid var(--bio-cyan);
  animation: pulse 2.4s var(--ease-soft) infinite;
}

@keyframes pulse {
  0%   { transform: scale(0.6); opacity: 0.9; }
  100% { transform: scale(2.2); opacity: 0; }
}

h1 {
  font-family: var(--font-display);
  font-weight: 300;
  font-style: normal;
  font-size: clamp(3rem, 9vw, 8rem);
  line-height: 0.96;
  letter-spacing: -0.035em;
  margin: 0;
  color: var(--ink);
}

h1 .word {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
  padding: 0 0.04em 0.08em;
  margin: 0 -0.04em;
}

h1 .word > span {
  display: inline-block;
  transform: translateY(110%);
  opacity: 0;
  will-change: transform, opacity;
}

h1 .word.is-italic > span {
  font-style: italic;
  font-weight: 300;
  font-feature-settings: "ss01";
  background: linear-gradient(120deg, var(--bio-cyan), var(--bio-violet) 55%, var(--bio-rose));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

h1.revealed .word > span {
  animation: type-rise 1.1s var(--ease-spring) forwards;
}

h1.revealed .word:nth-child(1) > span { animation-delay: 0.05s; }
h1.revealed .word:nth-child(2) > span { animation-delay: 0.18s; }
h1.revealed .word:nth-child(3) > span { animation-delay: 0.31s; }
h1.revealed .word:nth-child(4) > span { animation-delay: 0.44s; }
h1.revealed .word:nth-child(5) > span { animation-delay: 0.57s; }

@keyframes type-rise {
  0%   { transform: translateY(110%); opacity: 0; }
  100% { transform: translateY(0);    opacity: 1; }
}

.hero p.lede {
  font-family: var(--font-sans);
  font-weight: 300;
  font-size: clamp(1.05rem, 1.3vw, 1.35rem);
  line-height: 1.55;
  max-width: 56ch;
  color: var(--ink-soft);
  margin: 0;
  opacity: 0;
  transform: translateY(18px);
  animation: rise 1s var(--ease-soft) 0.9s forwards;
}

@keyframes rise {
  to { opacity: 1; transform: translateY(0); }
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 8px;
  opacity: 0;
  transform: translateY(18px);
  animation: rise 1s var(--ease-soft) 1.1s forwards;
}

.btn {
  --btn-bg: rgba(255, 255, 255, 0.04);
  --btn-fg: var(--ink);
  --pip-bg: rgba(255, 255, 255, 0.08);
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 10px 10px 10px 22px;
  border-radius: 999px;
  border: 1px solid var(--hair-strong);
  background: var(--btn-bg);
  color: var(--btn-fg);
  text-decoration: none;
  font-size: 14px;
  letter-spacing: 0.005em;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition:
    transform 0.5s var(--ease-spring),
    background 0.5s var(--ease-soft),
    border-color 0.5s var(--ease-soft);
}

.btn .pip {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--pip-bg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.5s var(--ease-spring), background 0.5s var(--ease-soft);
}

.btn .pip svg {
  width: 12px;
  height: 12px;
  transition: transform 0.5s var(--ease-spring);
}

.btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.22);
}

.btn:hover .pip { transform: translate(2px, -2px) scale(1.06); }
.btn:hover .pip svg { transform: translate(1px, -1px); }
.btn:active { transform: scale(0.985); }

.btn.primary {
  --btn-bg: var(--ink);
  --btn-fg: var(--bg);
  --pip-bg: rgba(0, 0, 0, 0.08);
  border-color: transparent;
}

.btn.primary:hover {
  background: var(--ink);
  border-color: transparent;
}

.btn.primary:hover .pip { background: rgba(0, 0, 0, 0.16); }

/* Tagline strip below hero */

.specimen {
  position: relative;
  z-index: 4;
  border-top: 1px solid var(--hair);
  padding: 28px 48px;
  max-width: var(--max-w);
  margin: 0 auto;
  width: 100%;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.specimen span b {
  display: block;
  color: var(--ink);
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: 18px;
  letter-spacing: -0.01em;
  text-transform: none;
  margin-top: 6px;
}

/* ==========================================================================
   Footer
   ========================================================================== */

footer {
  position: relative;
  z-index: 4;
  border-top: 1px solid var(--hair);
  padding: 20px 48px;
  max-width: var(--max-w);
  margin: 0 auto;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

footer .coord {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

footer .coord::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--bio-amber);
  box-shadow: 0 0 8px var(--bio-amber);
}

.footer-links {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
}

footer a {
  color: var(--ink-soft);
  text-decoration: none;
  border-bottom: 1px solid rgba(244, 241, 234, 0.18);
  transition: color 0.4s var(--ease-soft), border-color 0.4s var(--ease-soft);
}

footer a:hover {
  color: var(--ink);
  border-color: var(--bio-cyan);
}

/* ==========================================================================
   Legal pages
   ========================================================================== */

.legal-page main {
  display: block;
}

.legal-main {
  width: min(100%, var(--max-w));
  margin: 0 auto;
  padding: 150px 48px 80px;
}

.legal-hero {
  max-width: 900px;
  margin-bottom: 48px;
}

.legal-hero h1 {
  font-size: clamp(2.5rem, 6vw, 5.5rem);
  line-height: 1.04;
  letter-spacing: 0;
  margin: 28px 0 22px;
}

.legal-hero p {
  max-width: 64ch;
  margin: 0;
  color: var(--ink-soft);
  font-size: clamp(1rem, 1.3vw, 1.18rem);
  line-height: 1.8;
}

.legal-hero .legal-note {
  margin: -8px 0 16px;
  color: var(--bio-amber);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.6;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.legal-panel {
  border-top: 1px solid var(--hair-strong);
  border-bottom: 1px solid var(--hair);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.015));
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.legal-list {
  margin: 0;
  display: grid;
  grid-template-columns: minmax(180px, 260px) minmax(0, 1fr);
}

.legal-list dt,
.legal-list dd {
  margin: 0;
  padding: 22px 0;
  border-top: 1px solid var(--hair);
}

.legal-list dt:nth-of-type(1),
.legal-list dd:nth-of-type(1) {
  border-top: 0;
}

.legal-list dt {
  padding-left: 28px;
  padding-right: 24px;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.7;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.legal-list dd {
  padding-right: 28px;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.85;
}

.legal-list dd span {
  color: var(--ink-soft);
}

.legal-list dd a {
  color: var(--bio-cyan);
  text-decoration: none;
  border-bottom: 1px solid rgba(127, 255, 225, 0.32);
}

.legal-list dd a:hover {
  color: var(--ink);
  border-color: var(--ink);
}

/* ==========================================================================
   TikTok Creative Lab review demo
   ========================================================================== */

.app-product-hero,
.review-hero {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.app-icon-large {
  width: 112px;
  height: 112px;
  border-radius: 28px;
  border: 1px solid var(--hair-strong);
  box-shadow:
    0 28px 70px -34px rgba(127, 255, 225, 0.75),
    0 28px 70px -36px rgba(184, 157, 255, 0.7);
}

.app-product-hero .app-icon-large {
  width: 128px;
  height: 128px;
  border-radius: 32px;
}

.product-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}

.review-main {
  max-width: 1180px;
}

.review-hero {
  margin-bottom: 42px;
}

.review-hero h1 {
  font-size: clamp(2.4rem, 5vw, 5rem);
  line-height: 1.04;
  margin: 26px 0 18px;
  letter-spacing: 0;
}

.review-hero p {
  max-width: 68ch;
  margin: 0;
  color: var(--ink-soft);
  font-size: clamp(1rem, 1.3vw, 1.18rem);
  line-height: 1.75;
}

.review-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.review-panel {
  min-height: 280px;
  padding: 26px;
  border: 1px solid var(--hair-strong);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.018));
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.step-kicker {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--bio-cyan);
}

.review-panel h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 380;
  letter-spacing: 0;
}

.review-panel p {
  margin: 0 0 18px;
  color: var(--ink-soft);
  line-height: 1.75;
}

.connection-card {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 76px;
  padding: 16px;
  margin: 22px 0;
  border: 1px solid rgba(255, 158, 199, 0.28);
  background: rgba(255, 158, 199, 0.045);
}

.connection-card.connected {
  border-color: rgba(127, 255, 225, 0.32);
  background: rgba(127, 255, 225, 0.055);
}

.connection-card strong,
.connection-card span {
  display: block;
}

.connection-card strong {
  color: var(--ink);
  font-size: 15px;
  margin-bottom: 4px;
}

.connection-card span:not(.status-dot) {
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.5;
}

.status-dot {
  flex: 0 0 auto;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--bio-rose);
  box-shadow: 0 0 14px var(--bio-rose);
}

.connection-card.connected .status-dot {
  background: var(--bio-cyan);
  box-shadow: 0 0 14px var(--bio-cyan);
}

.signal-list {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 12px 18px;
  margin: 24px 0 0;
}

.signal-list dt {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.signal-list dd {
  margin: 0;
  color: var(--ink);
  line-height: 1.55;
}

.mock-media {
  aspect-ratio: 9 / 16;
  width: min(100%, 210px);
  min-height: 250px;
  display: grid;
  align-content: end;
  gap: 8px;
  padding: 18px;
  margin-bottom: 18px;
  border: 1px solid var(--hair-strong);
  background:
    radial-gradient(circle at 30% 24%, rgba(127, 255, 225, 0.35), transparent 34%),
    radial-gradient(circle at 72% 64%, rgba(184, 157, 255, 0.34), transparent 34%),
    linear-gradient(160deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.015));
}

.mock-media span {
  width: fit-content;
  padding: 5px 8px;
  border: 1px solid var(--hair-strong);
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-soft);
}

.mock-media b {
  font-family: var(--font-display);
  font-weight: 420;
  font-size: 26px;
  line-height: 1.08;
}

.caption-label {
  display: block;
  margin-bottom: 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.asset-panel textarea {
  width: 100%;
  min-height: 112px;
  resize: vertical;
  border: 1px solid var(--hair-strong);
  background: rgba(0, 0, 0, 0.28);
  color: var(--ink);
  padding: 14px;
  font: 14px/1.6 var(--font-sans);
}

.review-checklist {
  margin: 0 0 24px;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 12px;
}

.review-checklist li {
  position: relative;
  padding-left: 22px;
  color: var(--ink-soft);
  line-height: 1.7;
}

.review-checklist li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.65em;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--bio-amber);
  box-shadow: 0 0 10px var(--bio-amber);
}

.upload-result {
  min-height: 48px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--hair);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
}

.callback-main {
  min-height: 100dvh;
  display: grid;
  align-items: center;
  padding-bottom: 120px;
}

.callback-shell {
  max-width: 720px;
}

.callback-shell h1 {
  margin: 28px 0 18px;
  font-size: clamp(2.2rem, 5vw, 4.8rem);
  line-height: 1.04;
  letter-spacing: 0;
}

.callback-shell p {
  max-width: 62ch;
  margin: 0 0 24px;
  color: var(--ink-soft);
  line-height: 1.75;
}

.callback-meta {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 10px 18px;
  margin: 0 0 30px;
  padding: 18px 0;
  border-top: 1px solid var(--hair);
  border-bottom: 1px solid var(--hair);
}

.callback-meta dt {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.callback-meta dd {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 12px;
  overflow-wrap: anywhere;
}

/* ==========================================================================
   Popups — Double-Bezel
   ========================================================================== */

.popup {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(5, 5, 5, 0.6);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  opacity: 0;
  transition: opacity 0.5s var(--ease-soft);
}

.popup.visible {
  display: flex;
}

.popup.show { opacity: 1; }

.popup-shell {
  width: 100%;
  max-width: 640px;
  padding: 8px;
  border-radius: 32px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--hair-strong);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    0 60px 120px -40px rgba(0, 0, 0, 0.9);
  transform: scale(0.96) translateY(8px);
  opacity: 0;
  transition: transform 0.6s var(--ease-spring), opacity 0.5s var(--ease-soft);
}

.popup.show .popup-shell {
  transform: scale(1) translateY(0);
  opacity: 1;
}

.popup-content {
  position: relative;
  border-radius: calc(32px - 8px);
  background: linear-gradient(180deg, #0d0d10 0%, #08080a 100%);
  padding: 40px 40px 36px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.popup .label {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--bio-cyan);
  padding: 5px 10px;
  border: 1px solid rgba(127, 255, 225, 0.3);
  border-radius: 999px;
  margin-bottom: 18px;
}

.popup h2 {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 0 22px;
  color: var(--ink);
}

.popup h2 em {
  font-style: italic;
  background: linear-gradient(120deg, var(--bio-cyan), var(--bio-violet));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.popup p {
  font-size: 15px;
  line-height: 1.65;
  color: var(--ink-soft);
  margin: 0 0 14px;
}

.popup .meta {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 6px 18px;
  margin-top: 20px;
  padding-top: 22px;
  border-top: 1px solid var(--hair);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
}

.popup .meta dt { color: var(--ink-faint); text-transform: uppercase; letter-spacing: 0.18em; font-size: 10px; align-self: center; }
.popup .meta dd { margin: 0; color: var(--ink); }
.popup .meta dd a { color: var(--bio-cyan); text-decoration: none; border-bottom: 1px solid rgba(127, 255, 225, 0.3); }
.popup .meta dd a:hover { color: var(--ink); border-color: var(--ink); }

.close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--hair-strong);
  background: rgba(255, 255, 255, 0.03);
  color: var(--ink-soft);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.5s var(--ease-spring), background 0.4s var(--ease-soft), color 0.4s var(--ease-soft);
}

.close:hover {
  transform: rotate(90deg);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.07);
}

.close svg { width: 12px; height: 12px; }

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 880px) {
  .hero { padding: 140px 24px 80px; }
  .hero-inner { gap: 28px; }
  nav { gap: 12px; padding: 6px 6px 6px 16px; }
  .nav-link { padding: 8px 12px; font-size: 12px; }
  .nav-link.contact { padding: 7px 6px 7px 14px; }
  .specimen { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 24px; }
  footer { flex-direction: column; gap: 10px; padding: 18px 24px; text-align: center; }
  .legal-main { padding: 132px 24px 64px; }
  .app-product-hero,
  .review-hero {
    grid-template-columns: 1fr;
  }
  .review-grid {
    grid-template-columns: 1fr;
  }
  .legal-list { grid-template-columns: 1fr; }
  .legal-list dt {
    padding: 22px 22px 6px;
    border-top: 1px solid var(--hair);
  }
  .legal-list dd {
    padding: 0 22px 22px;
    border-top: 0;
  }
  .legal-list dt:nth-of-type(1) { border-top: 0; }
  .popup-content { padding: 28px 22px; }
}

@media (max-width: 520px) {
  .specimen { grid-template-columns: 1fr; }
  .nav-link:not(.contact) span { display: none; }
  .legal-page nav { gap: 8px; padding-left: 14px; }
  .legal-page .nav-link { padding: 8px 8px; }
  .legal-page .nav-link:not(.contact) span { display: inline; }
  .panel-head,
  .signal-list,
  .callback-meta {
    grid-template-columns: 1fr;
  }
  .panel-head {
    display: grid;
  }
  .review-panel {
    padding: 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ==========================================================================
   Blog — Lab Notes
   ========================================================================== */

.blog-main {
  width: min(100%, 980px);
  margin: 0 auto;
  padding: 150px 48px 80px;
}

.blog-hero {
  margin-bottom: 56px;
}

.blog-hero h1 {
  font-size: clamp(2.5rem, 6vw, 5rem);
  line-height: 1.04;
  margin: 28px 0 18px;
}

.blog-hero .lede {
  max-width: 64ch;
  margin: 0;
  color: var(--ink-soft);
  font-size: clamp(1rem, 1.3vw, 1.15rem);
  line-height: 1.8;
}

/* Post index */

.post-index {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--hair-strong);
}

.post-index li {
  border-bottom: 1px solid var(--hair);
}

.post-index a {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 8px 28px;
  padding: 30px 8px;
  text-decoration: none;
  color: inherit;
  transition: background 0.4s var(--ease-soft);
}

.post-index a:hover {
  background: rgba(255, 255, 255, 0.025);
}

.post-index .post-date {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  padding-top: 8px;
}

.post-index .post-title {
  font-family: var(--font-display);
  font-weight: 420;
  font-size: clamp(1.35rem, 2.6vw, 1.9rem);
  line-height: 1.22;
  color: var(--ink);
}

.post-index .post-title em {
  font-style: italic;
  color: var(--bio-cyan);
}

.post-index .post-desc {
  grid-column: 2;
  margin: 0;
  max-width: 70ch;
  color: var(--ink-soft);
  font-size: 14.5px;
  line-height: 1.75;
}

/* Article */

.post-hero {
  max-width: 860px;
  margin-bottom: 28px;
}

.post-hero h1 {
  font-size: clamp(2.2rem, 5vw, 4.2rem);
  line-height: 1.06;
  margin: 28px 0 16px;
}

.post-hero .post-subtitle {
  margin: 0 0 22px;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 380;
  font-size: clamp(1.1rem, 2vw, 1.45rem);
  line-height: 1.45;
  color: var(--ink-soft);
}

.post-byline {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.post-byline a {
  color: var(--ink-soft);
  text-decoration: none;
  border-bottom: 1px solid var(--hair-strong);
}

.post-byline a:hover {
  color: var(--bio-cyan);
}

.post-body {
  border-top: 1px solid var(--hair-strong);
  padding-top: 18px;
}

.post-body section {
  margin: 0 auto;
  padding: 30px 0 10px;
}


.post-body h2 {
  max-width: 72ch;
  margin: 0 auto 18px;
  font-family: var(--font-display);
  font-weight: 430;
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  line-height: 1.2;
  letter-spacing: 0;
}

.post-body h2 em {
  font-style: italic;
  color: var(--bio-violet);
}

.post-body p {
  max-width: 72ch;
  margin: 0 auto 22px;
  color: var(--ink-soft);
  font-size: clamp(0.98rem, 1.25vw, 1.09rem);
  line-height: 1.9;
}

.post-body p strong {
  color: var(--ink);
  font-weight: 500;
}

.post-body p em {
  color: var(--ink);
}

.post-body a {
  color: var(--bio-cyan);
  text-decoration: none;
  border-bottom: 1px solid rgba(127, 255, 225, 0.35);
  transition: border-color 0.3s var(--ease-soft);
}

.post-body a:hover {
  border-color: var(--bio-cyan);
}

.post-body figure {
  margin: 34px auto;
  max-width: 880px;
}

.post-body figure img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--hair-strong);
  border-radius: 14px;
  background: var(--bg-elev);
}

.post-body figure.core-thesis-figure picture {
  display: block;
  width: 100%;
}

.post-body figure.core-thesis-figure img {
  max-width: 100%;
}

.post-body figcaption {
  margin-top: 12px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.7;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
}

.post-footer-note {
  max-width: 72ch;
  margin: 44px auto 0;
  padding-top: 22px;
  border-top: 1px solid var(--hair);
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.8;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
}

.post-footer-note a {
  color: var(--ink-soft);
  border-bottom: 1px solid var(--hair-strong);
  text-decoration: none;
}

.post-footer-note a:hover {
  color: var(--bio-cyan);
}

@media (max-width: 720px) {
  .blog-main {
    padding: 130px 24px 64px;
  }

  .post-index a {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .post-index .post-desc {
    grid-column: 1;
  }

  .post-body figure.core-thesis-figure {
    width: calc(100% + 48px);
    max-width: none;
    margin-left: -24px;
    margin-right: -24px;
  }

  .post-body figure.core-thesis-figure figcaption {
    padding-left: 24px;
    padding-right: 24px;
    box-sizing: border-box;
  }
}

/* Wide schematics: scroll rather than shrink to illegibility on narrow screens */
@media (max-width: 720px) {
  .post-body figure.wide {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }

  .post-body figure.wide img {
    width: 860px;
    max-width: none;
  }

  .post-body figure.wide figcaption::after {
    content: " (scroll to see the whole diagram)";
    color: rgba(244, 241, 234, 0.24);
  }
}

@media (max-width: 520px) {
  body.blog-page header {
    left: 12px;
    right: 12px;
  }

  body.blog-page nav {
    width: 100%;
    justify-content: space-between;
    gap: 4px;
    padding: 6px 6px 6px 12px;
  }

  body.blog-page .logo img {
    height: 24px;
  }

  body.blog-page .nav-links {
    gap: 0;
  }

  body.blog-page .nav-links .nav-link:first-child {
    display: none;
  }

  body.blog-page .nav-link {
    padding: 8px 7px;
    font-size: 10px;
  }

  body.blog-page .nav-link.contact {
    padding: 7px 5px 7px 10px;
  }
}

/* Calmer ambience for long-form reading on blog pages */
body.blog-page #life-canvas {
  opacity: 0.3;
}
