/* Layout: a floating glass nav over a dark "control plane" world. Hero = giant name + live isometric
   cluster; sections below alternate between interactive pieces (terminal, pipeline, globe) and calm reading. */
:root {
  /* Dark-only by design: one visual world, a night-time ops console */
  --bg: #05070b;
  --bg-2: #080b12;
  --panel: #0b1018;
  --panel-2: #101722;
  --glass: rgb(14 20 31 / 0.62);
  --line: rgb(148 163 184 / 0.12);
  --line-strong: rgb(148 163 184 / 0.22);
  --fg: #eef2f8;
  --muted: #8b98ac;
  --dim: #5d697b;
  --blue: #4f8cff;
  --cyan: #2dd4ef;
  --green: #34d399;
  --amber: #f5b84a;
  --violet: #a78bfa;
  --grad: linear-gradient(100deg, #4f8cff 0%, #2dd4ef 50%, #34d399 100%);

  --f-sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --t-xs: 0.8125rem;
  --t-sm: 0.9375rem;
  --t-base: 1.0625rem;
  --t-lg: 1.25rem;
  --t-xl: 1.625rem;
  --t-2xl: clamp(2.4rem, 1.5rem + 3.4vw, 4.25rem);
  --t-hero: clamp(3.4rem, 0.9rem + 9.2vw, 8.75rem);

  --wrap: 1240px;
  --gutter: 24px;
  --radius: 12px;
  --radius-lg: 20px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);

  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 96px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--f-sans);
  font-size: var(--t-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  height: env(safe-area-inset-top, 0px);
  z-index: 90;
  background: var(--bg);
}
body::after {
  /* film grain */
  content: "";
  position: fixed;
  inset: 0;
  z-index: 80;
  pointer-events: none;
  opacity: 0.05;
  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.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
h1, h2, h3, h4 { margin: 0; line-height: 1.08; text-wrap: balance; font-weight: 650; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: inherit; }
code, kbd { font-family: var(--f-mono); font-size: 0.9em; }
svg { display: block; }
img { max-width: 100%; }
button { font: inherit; color: inherit; }
::selection { background: rgb(79 140 255 / 0.4); }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; border-radius: 6px; }

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%);
  white-space: nowrap; border: 0;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
}

.skip-link {
  position: fixed;
  left: 16px;
  top: -100px;
  z-index: 200;
  padding: 10px 16px;
  border-radius: var(--radius);
  background: var(--fg);
  color: var(--bg);
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { top: calc(env(safe-area-inset-top, 0px) + 12px); }

.grad-text {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- Boot intro (first visit per session) ---------- */
.boot { display: none; }
.boot-on .boot {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: grid;
  place-items: center;
  background: var(--bg);
  animation: boot-out 0.7s var(--ease-in-out) 1.55s forwards;
}
.boot-done .boot { animation: boot-out 0.4s var(--ease-in-out) forwards; }
.boot-inner { width: min(420px, 100% - 48px); display: flex; flex-direction: column; gap: 18px; }
.boot-brand { display: flex; align-items: center; gap: 12px; font: 600 1.125rem/1 var(--f-sans); letter-spacing: -0.01em; }
.boot-brand svg { width: 40px; height: 40px; }
.boot-log { font: 400 var(--t-xs)/1.8 var(--f-mono); color: var(--muted); min-height: 9em; }
.boot-log p { opacity: 0; animation: boot-line 0.2s var(--ease) forwards; animation-delay: calc(var(--i) * 0.2s + 0.1s); }
.boot-log .ok { color: var(--green); }
.boot-bar { height: 2px; border-radius: 2px; background: var(--line); overflow: hidden; }
.boot-bar i { display: block; height: 100%; background: var(--grad); transform-origin: left; transform: scaleX(0); animation: boot-bar 1.35s var(--ease-in-out) 0.1s forwards; }
@keyframes boot-line { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes boot-bar { to { transform: scaleX(1); } }
@keyframes boot-out { to { opacity: 0; visibility: hidden; transform: scale(1.02); } }

/* ---------- Cursor glow ---------- */
.cursor-glow {
  position: fixed;
  left: 0; top: 0;
  z-index: 0;
  width: 560px; height: 560px;
  margin: -280px 0 0 -280px;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle, rgb(79 140 255 / 0.10), rgb(45 212 239 / 0.04) 40%, transparent 70%);
  opacity: 0;
  transition: opacity 0.4s;
  will-change: transform;
}
.has-pointer .cursor-glow { opacity: 1; }

/* ---------- Header ---------- */
.scroll-progress {
  position: fixed;
  top: env(safe-area-inset-top, 0px);
  left: 0; right: 0;
  z-index: 101;
  height: 2px;
  background: var(--grad);
  transform-origin: left;
  transform: scaleX(var(--p, 0));
}
.site-header {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 12px);
  left: 0; right: 0;
  z-index: 100;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  pointer-events: none;
}
.nav-shell {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: calc(var(--wrap) - 2 * var(--gutter) + 24px);
  height: 58px;
  margin-inline: auto;
  padding: 0 10px 0 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(18px) saturate(1.5);
  backdrop-filter: blur(18px) saturate(1.5);
  pointer-events: auto;
  transition: border-color 0.3s, background-color 0.3s, box-shadow 0.3s;
}
.is-scrolled .nav-shell { border-color: var(--line-strong); box-shadow: 0 18px 50px -24px rgb(0 0 0 / 0.8); }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 650;
  letter-spacing: -0.02em;
  white-space: nowrap;
}
/* Logo: R and P drawn as one pipeline, from a blue commit node to a green deploy node */
.logo { flex: none; overflow: visible; }
.brand-mark { width: 34px; height: 34px; }
.logo-tile { stroke: var(--line-strong); stroke-width: 1.5; transition: stroke 0.3s; }
.logo-path, .logo-spark { fill: none; stroke-width: 5.5; stroke-linecap: round; stroke-linejoin: round; }
.logo-spark { stroke: #fff; stroke-dasharray: 0 100; opacity: 0; }
.logo-start { fill: var(--blue); stroke: #090d15; stroke-width: 2; }
.logo-end { fill: var(--green); stroke: #090d15; stroke-width: 2; transform-box: fill-box; transform-origin: center; }
.logo-end-g { transform-box: fill-box; transform-origin: center; }
.brand:hover .logo-tile { stroke: rgb(45 212 239 / 0.5); }
.motion .site-header .logo-path { stroke-dasharray: 100; animation: logo-draw 1.3s var(--ease-in-out) 0.35s backwards; }
.motion .site-header .logo-end-g { animation: logo-pop 0.5s var(--ease) 1.5s backwards; }
.boot-on .site-header .logo-path { animation-delay: 2s; }
.boot-on .site-header .logo-end-g { animation-delay: 3.15s; }
.motion .boot .logo-path { stroke-dasharray: 100; animation: logo-draw 1.1s var(--ease-in-out) 0.1s backwards; }
.motion .boot .logo-end-g { animation: logo-pop 0.45s var(--ease) 1.1s backwards; }
.motion .brand:hover .logo-spark, .motion .brand:focus-visible .logo-spark { animation: logo-run 1s var(--ease-in-out); }
.motion .brand:hover .logo-end, .motion .brand:focus-visible .logo-end { animation: logo-ping 0.5s var(--ease) 0.8s; }
@keyframes logo-draw { from { stroke-dashoffset: 100; } to { stroke-dashoffset: 0; } }
@keyframes logo-pop { 0% { transform: scale(0); } 70% { transform: scale(1.4); } 100% { transform: scale(1); } }
@keyframes logo-ping { 0% { transform: scale(1); } 50% { transform: scale(1.5); filter: drop-shadow(0 0 4px #34d399); } 100% { transform: scale(1); } }
@keyframes logo-run {
  0% { stroke-dasharray: 12 100; stroke-dashoffset: 12; opacity: 1; }
  92% { opacity: 1; }
  100% { stroke-dasharray: 12 100; stroke-dashoffset: -100; opacity: 0; }
}

.site-nav { margin-inline: auto; }
.nav-list { display: flex; gap: 2px; }
.nav-list a {
  position: relative;
  display: block;
  padding: 8px 14px;
  border-radius: 10px;
  color: var(--muted);
  font-size: var(--t-sm);
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s, background-color 0.2s;
}
.nav-list a:hover { color: var(--fg); background: rgb(255 255 255 / 0.04); }
.nav-list a[aria-current="true"] { color: var(--fg); background: rgb(255 255 255 / 0.07); }

.nav-actions { display: flex; align-items: center; gap: 6px; }
.nav-actions .nav-toggle { display: none; }

/* ---------- Buttons ---------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 48px;
  padding: 0 22px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: rgb(255 255 255 / 0.03);
  color: var(--fg);
  font: 600 var(--t-sm)/1 var(--f-sans);
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.25s, background-color 0.25s, color 0.25s, box-shadow 0.25s;
}
.btn:hover { border-color: rgb(148 163 184 / 0.45); background: rgb(255 255 255 / 0.06); }
.btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.btn-primary {
  border-color: transparent;
  background: var(--fg);
  color: var(--bg);
  box-shadow: 0 0 0 0 rgb(79 140 255 / 0);
}
.btn-primary:hover { background: #fff; border-color: transparent; box-shadow: 0 10px 40px -10px rgb(79 140 255 / 0.65); }
.btn-sm { min-height: 38px; padding: 0 14px; font-size: var(--t-xs); border-radius: 10px; }
.btn-ghost { background: transparent; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 42px; height: 42px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  color: var(--fg);
  cursor: pointer;
  text-decoration: none;
  transition: border-color 0.2s, background-color 0.2s, color 0.2s;
}
.icon-btn:hover { border-color: var(--line-strong); background: rgb(255 255 255 / 0.05); }
.icon-btn svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

[data-magnetic] { transition: transform 0.35s var(--ease), border-color 0.25s, background-color 0.25s, box-shadow 0.25s; }

.text-link {
  color: var(--cyan);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: rgb(45 212 239 / 0.35);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 4px;
  transition: text-decoration-color 0.2s, color 0.2s;
}
.text-link:hover { text-decoration-color: currentColor; }

/* ---------- Shared bits ---------- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: 100%;
  padding: 7px 14px 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgb(255 255 255 / 0.03);
  color: var(--muted);
  font-size: var(--t-xs);
  line-height: 1.4;
}
.pulse { position: relative; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.motion .pulse::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid var(--green);
  animation: ping 2.2s var(--ease) infinite;
}
@keyframes ping { 0% { transform: scale(0.5); opacity: 0.9; } 75%, 100% { transform: scale(1.8); opacity: 0; } }

.status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: max-content;
  padding: 3px 10px 3px 9px;
  border-radius: 999px;
  --c: var(--muted);
  color: var(--c);
  background: color-mix(in srgb, var(--c) 13%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 28%, transparent);
  font: 600 var(--t-xs)/1.45 var(--f-sans);
  white-space: nowrap;
}
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status[data-status="live"] { --c: var(--green); }
.status[data-status="ondemand"] { --c: var(--amber); }
.status[data-status="deployed"], .status[data-status="published"] { --c: var(--blue); }

.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags li {
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgb(255 255 255 / 0.025);
  color: #c9d2df;
  font-size: var(--t-xs);
  line-height: 1.45;
  transition: border-color 0.2s, color 0.2s;
}
.tags li:hover { border-color: var(--line-strong); color: var(--fg); }

.check-list { display: flex; flex-direction: column; gap: 10px; }
.check-list li { position: relative; padding-left: 26px; line-height: 1.55; }
.check-list li::before {
  content: "";
  position: absolute;
  left: 0; top: 0.3em;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--green) 16%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--green) 45%, transparent);
}
.check-list li::after {
  content: "";
  position: absolute;
  left: 5.5px; top: calc(0.3em + 4px);
  width: 4px; height: 7px;
  border: solid var(--green);
  border-width: 0 1.8px 1.8px 0;
  transform: rotate(45deg);
}
.dash-list li::before { background: color-mix(in srgb, var(--amber) 14%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--amber) 45%, transparent); }
.dash-list li::after { left: 5px; top: calc(0.3em + 7px); width: 6px; height: 0; border-width: 0 0 1.8px 0; border-color: var(--amber); transform: none; }
.next-list li::before { background: color-mix(in srgb, var(--blue) 16%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--blue) 50%, transparent); }
.next-list li::after { left: 5px; top: calc(0.3em + 5px); width: 5px; height: 5px; border-width: 1.8px 1.8px 0 0; border-color: var(--blue); transform: rotate(45deg); }

/* Spotlight card (cursor-following glow on hover) */
.card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgb(255 255 255 / 0.035), rgb(255 255 255 / 0.012)), var(--panel);
  isolation: isolate;
  overflow: hidden;
}
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, -20%), rgb(79 140 255 / 0.13), transparent 60%);
  opacity: 0;
  transition: opacity 0.35s;
}
.card::after {
  content: "";
  position: absolute;
  inset: -1px;
  z-index: 2;
  border-radius: inherit;
  padding: 1px;
  background: radial-gradient(300px circle at var(--mx, 50%) var(--my, -20%), rgb(45 212 239 / 0.6), transparent 60%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s;
}
.card:hover::before, .card:hover::after { opacity: 1; }

/* ---------- Reveal on scroll ---------- */
.motion.js-ready [data-reveal]:not(.is-in) { opacity: 0; transform: translateY(28px); }
.motion.js-ready [data-reveal] {
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
  transition-delay: calc(var(--d, 0) * 90ms);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding-block: calc(env(safe-area-inset-top, 0px) + 132px) clamp(56px, 7vw, 96px);
  isolation: isolate;
  overflow: hidden;
}
.hero-bg { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.hero-bg::before {
  /* perspective floor grid */
  content: "";
  position: absolute;
  left: -20%; right: -20%; bottom: -10%;
  height: 70%;
  background-image:
    linear-gradient(rgb(148 163 184 / 0.09) 1px, transparent 1px),
    linear-gradient(90deg, rgb(148 163 184 / 0.09) 1px, transparent 1px);
  background-size: 64px 64px;
  transform: perspective(700px) rotateX(62deg);
  transform-origin: bottom;
  -webkit-mask-image: linear-gradient(to top, #000 10%, transparent 75%);
  mask-image: linear-gradient(to top, #000 10%, transparent 75%);
}
.motion .hero-bg::before { animation: grid-move 6s linear infinite; }
@keyframes grid-move { to { background-position: 0 64px, 0 0; } }
.aurora { position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.55; }
.aurora-1 { width: 620px; height: 420px; left: -160px; top: -120px; background: rgb(79 140 255 / 0.55); }
.aurora-2 { width: 520px; height: 380px; right: -140px; top: 60px; background: rgb(45 212 239 / 0.35); }
.aurora-3 { width: 420px; height: 300px; left: 35%; top: 45%; background: rgb(52 211 153 / 0.18); }
.motion .aurora-1 { animation: drift-a 18s ease-in-out infinite alternate; }
.motion .aurora-2 { animation: drift-b 22s ease-in-out infinite alternate; }
.motion .aurora-3 { animation: drift-a 26s ease-in-out infinite alternate-reverse; }
@keyframes drift-a { to { transform: translate(120px, 60px) scale(1.15); } }
@keyframes drift-b { to { transform: translate(-100px, 80px) scale(0.9); } }

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 48px clamp(32px, 4vw, 64px);
  align-items: center;
}
.hero-copy { display: flex; flex-direction: column; gap: 22px; min-width: 0; }

.hero-name {
  font-size: var(--t-hero);
  font-weight: 700;
  line-height: 0.88;
  letter-spacing: -0.06em;
  margin-top: 6px;
}
.hero-name .line { display: block; overflow: hidden; padding-bottom: 0.06em; margin-bottom: -0.06em; }
.hero-name .ch { display: inline-block; }
.hero-name:not(.is-split) .line:last-child { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.motion .hero-name .ch { animation: rise 1s var(--ease) both; animation-delay: calc(var(--i) * 32ms + 0.15s); }
.boot-on .hero-name .ch { animation-delay: calc(var(--i) * 32ms + 1.75s) !important; }
.motion .hero-name:not(.is-split) { opacity: 0; animation: failsafe 0s linear 1.5s forwards; }
@keyframes failsafe { to { opacity: 1; } }
@keyframes rise { from { transform: translateY(105%) rotate(4deg); opacity: 0; } to { transform: none; opacity: 1; } }

.hero-rotator {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  line-height: 1.25;
  gap: 0 0.3em;
  font-size: clamp(1.4rem, 0.9rem + 1.9vw, 2.25rem);
  font-weight: 500;
  letter-spacing: -0.03em;
  color: var(--muted);
}
.rotator {
  position: relative;
  display: inline-grid;
  height: 1.25em;
  overflow: hidden;
  color: var(--fg);
}
.rotator span {
  grid-area: 1 / 1;
  white-space: nowrap;
  line-height: 1.25em;
  transform: translateY(110%);
  opacity: 0;
  transition: transform 0.7s var(--ease), opacity 0.7s var(--ease);
}
.rotator span.is-active { transform: none; opacity: 1; }
.rotator span.is-leaving { transform: translateY(-110%); opacity: 0; }
.rotator .caret { display: none; }

.hero-lede { max-width: 56ch; color: #b6c1d1; font-size: var(--t-lg); line-height: 1.55; }
.hero-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.hero-socials { display: flex; gap: 4px; margin-left: 4px; }

.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin: 10px 0 0;
  border-top: 1px solid var(--line);
}
.hero-stats > div { display: flex; flex-direction: column-reverse; justify-content: flex-end; padding: 18px 16px 0 0; }
.hero-stats > div + div { padding-left: 16px; border-left: 1px solid var(--line); }
.hero-stats dt { order: 2; color: var(--muted); font-size: var(--t-xs); line-height: 1.35; }
.hero-stats dd { margin: 0 0 4px; font-size: clamp(1.6rem, 1.2rem + 1.2vw, 2.25rem); font-weight: 650; letter-spacing: -0.04em; line-height: 1; font-variant-numeric: tabular-nums; }

/* Console window with the cluster canvas */
.console {
  position: relative;
  margin: 0;
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  background: linear-gradient(180deg, rgb(16 23 34 / 0.85), rgb(8 11 18 / 0.9));
  box-shadow: 0 40px 120px -40px rgb(79 140 255 / 0.35), 0 0 0 1px rgb(255 255 255 / 0.02) inset;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  overflow: hidden;
}
.motion.js-ready .console { animation: console-in 1.2s var(--ease) 0.5s both; }
.boot-on.motion.js-ready .console { animation-delay: 2.05s; }
@keyframes console-in { from { opacity: 0; transform: translateY(30px) scale(0.97); } to { opacity: 1; transform: none; } }

.win-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  font: 500 var(--t-xs)/1.3 var(--f-mono);
  color: var(--muted);
}
.win-dots { display: flex; gap: 6px; flex: none; }
.win-dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--line-strong); }
.win-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.win-title b { color: var(--fg); font-weight: 500; }

.sync-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: none;
  padding: 3px 10px;
  border-radius: 999px;
  color: var(--green);
  background: rgb(52 211 153 / 0.1);
  box-shadow: inset 0 0 0 1px rgb(52 211 153 / 0.3);
  font: 600 11.5px/1.5 var(--f-sans);
  transition: color 0.3s, background-color 0.3s, box-shadow 0.3s;
}
.sync-chip.is-syncing { color: var(--cyan); background: rgb(45 212 239 / 0.1); box-shadow: inset 0 0 0 1px rgb(45 212 239 / 0.35); }
.sync-chip i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.sync-chip.is-syncing i { animation: blink-dot 0.6s steps(2) infinite; }
@keyframes blink-dot { 50% { opacity: 0.2; } }

.cluster-stage { position: relative; aspect-ratio: 1.12 / 1; max-width: 100%; }
.cluster-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: pan-y; }
.cluster-tip {
  position: absolute;
  left: 0; top: 0;
  z-index: 3;
  max-width: 220px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: rgb(8 11 18 / 0.92);
  font-size: var(--t-xs);
  line-height: 1.45;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, calc(-100% - 14px)) scale(0.96);
  transition: opacity 0.18s, transform 0.18s var(--ease);
}
.cluster-tip.is-on { opacity: 1; transform: translate(-50%, calc(-100% - 10px)); }
.cluster-tip b { display: block; font: 600 var(--t-xs)/1.4 var(--f-mono); color: var(--fg); }
.cluster-tip span { color: var(--muted); }
.cluster-toast {
  position: absolute;
  left: 16px; top: 14px;
  z-index: 2;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgb(8 11 18 / 0.75);
  border: 1px solid var(--line);
  font: 500 11.5px/1.4 var(--f-mono);
  color: var(--cyan);
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.3s, transform 0.3s var(--ease);
  pointer-events: none;
}
.cluster-toast.is-on { opacity: 1; transform: none; }

.console-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  padding: 12px 16px 14px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
}
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 9px; height: 9px; border-radius: 3px; }
.lg-app { background: var(--blue); }
.lg-data { background: var(--green); }
.lg-plat { background: var(--violet); }
.lg-ext { background: transparent; box-shadow: inset 0 0 0 1.5px var(--cyan); border-radius: 50% !important; }

.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: 22px;
  display: grid;
  justify-items: center;
  gap: 8px;
  color: var(--dim);
  font: 500 11px/1 var(--f-mono);
  text-decoration: none;
  transform: translateX(-50%);
}
.scroll-cue i { width: 22px; height: 34px; border: 1.5px solid var(--line-strong); border-radius: 12px; position: relative; }
.scroll-cue i::after { content: ""; position: absolute; left: 50%; top: 7px; width: 3px; height: 7px; margin-left: -1.5px; border-radius: 2px; background: var(--muted); }
.motion .scroll-cue i::after { animation: wheel 1.8s var(--ease) infinite; }
@keyframes wheel { 0% { transform: none; opacity: 1; } 70% { transform: translateY(10px); opacity: 0; } 100% { opacity: 0; } }

/* ---------- Marquee ---------- */
.marquee {
  position: relative;
  display: grid;
  gap: 14px;
  padding-block: 28px;
  border-block: 1px solid var(--line);
  background: var(--bg-2);
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.marquee-row { display: flex; width: max-content; }
.marquee-row ul { display: flex; flex: none; gap: 14px; padding-right: 14px; }
.marquee-row li {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 9px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgb(255 255 255 / 0.02);
  color: #c8d1de;
  font-size: var(--t-sm);
  font-weight: 500;
  white-space: nowrap;
}
.marquee-row li::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--c, var(--blue)); box-shadow: 0 0 10px var(--c, var(--blue)); }
.marquee-row:nth-child(2) li { --c: var(--green); }
.motion .marquee-row { animation: marquee 48s linear infinite; }
.motion .marquee-row:nth-child(2) { animation-duration: 56s; animation-direction: reverse; }
.marquee:hover .marquee-row { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Sections ---------- */
.section { position: relative; padding-block: clamp(72px, 8vw, 116px); }
.section-head { display: flex; flex-direction: column; gap: 16px; margin-bottom: clamp(40px, 5vw, 64px); max-width: 860px; }
.kicker { display: inline-flex; align-items: center; gap: 10px; color: var(--cyan); font: 500 var(--t-sm)/1 var(--f-mono); }
.kicker::before { content: ""; width: 28px; height: 1px; background: currentColor; opacity: 0.6; }
.section-head h2 { font-size: var(--t-2xl); letter-spacing: -0.045em; }
.section-lede { color: var(--muted); font-size: var(--t-lg); line-height: 1.55; max-width: 60ch; }

/* ---------- Terminal ---------- */
.term {
  max-width: 980px;
  margin-inline: auto;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  background: #070a10;
  box-shadow: 0 50px 120px -50px rgb(45 212 239 / 0.25);
  overflow: hidden;
}
.term-body {
  height: clamp(340px, 46vh, 460px);
  padding: 18px 20px 12px;
  overflow-y: auto;
  font: 400 14px/1.7 var(--f-mono);
  color: #c7d0dc;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
  cursor: text;
}
.term-out { white-space: pre-wrap; overflow-wrap: anywhere; }
.term-out a { color: var(--cyan); }
.term-out .t-dim { color: var(--dim); }
.term-out .t-ok { color: var(--green); }
.term-out .t-acc { color: var(--blue); }
.term-out .t-warn { color: var(--amber); }
.term-out .t-b { color: var(--fg); font-weight: 600; }
.term-line { display: flex; align-items: baseline; gap: 10px; }
.prompt { flex: none; color: var(--green); }
.prompt b { color: var(--blue); font-weight: 400; }
.term-input {
  flex: 1;
  min-width: 0;
  padding: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--fg);
  font: inherit;
  caret-color: var(--cyan);
}
.term-chips {
  display: flex;
  gap: 8px;
  padding: 12px 16px 14px;
  border-top: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
}
.term-chips::-webkit-scrollbar { display: none; }
.term-chips button {
  flex: none;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgb(255 255 255 / 0.03);
  color: var(--muted);
  font: 500 12.5px/1 var(--f-mono);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.term-chips button:hover { border-color: var(--cyan); color: var(--fg); }
.term-hint { margin-top: 14px; text-align: center; color: var(--dim); font-size: var(--t-xs); }
.term-hint kbd { padding: 2px 6px; border: 1px solid var(--line-strong); border-radius: 5px; font-size: 11px; color: var(--muted); }

/* ---------- About bento ---------- */
.bento {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-areas:
    "intro intro now now"
    "intro intro loc lang"
    "focus focus edu edu";
  gap: 16px;
}
.tile { padding: clamp(22px, 2.6vw, 30px); display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.tile-label { color: var(--muted); font: 500 var(--t-xs)/1.3 var(--f-mono); }
.tile h3 { font-size: var(--t-xl); letter-spacing: -0.03em; }
.t-intro { grid-area: intro; gap: 18px; }
.t-intro p { color: #c3ccd9; }
.t-intro .intro-big { color: var(--fg); font-size: clamp(1.25rem, 1rem + 0.8vw, 1.6rem); line-height: 1.4; letter-spacing: -0.02em; font-weight: 500; }
.t-now { grid-area: now; }
.t-loc { grid-area: loc; }
.t-lang { grid-area: lang; }
.t-focus { grid-area: focus; }
.t-edu { grid-area: edu; }
.clock { font-size: clamp(2rem, 1.4rem + 1.6vw, 2.75rem); font-weight: 650; letter-spacing: -0.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.clock small { font-size: 0.45em; color: var(--muted); font-weight: 500; letter-spacing: 0; margin-left: 6px; }
.muted { color: var(--muted); }
.cefr { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; margin-top: 6px; }
.cefr i { height: 6px; border-radius: 3px; background: var(--line); }
.cefr i.on { background: var(--blue); }
.cefr i.full { background: var(--green); }
.cefr-scale { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; color: var(--dim); font: 500 10.5px/1 var(--f-mono); margin-top: 6px; }
.lang-row { display: flex; flex-direction: column; gap: 2px; }
.lang-row + .lang-row { margin-top: 10px; }
.lang-row b { font-weight: 600; }
.lang-row span { color: var(--muted); font-size: var(--t-xs); }
.focus-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.focus-chips li {
  padding: 8px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-size: var(--t-sm);
  font-weight: 500;
  transition: background-color 0.25s, border-color 0.25s;
}
.focus-chips li:hover { border-color: var(--cyan); background: rgb(45 212 239 / 0.06); }
.edu-item + .edu-item { padding-top: 12px; border-top: 1px solid var(--line); }
.edu-item b { display: block; font-weight: 600; line-height: 1.35; }
.edu-item span { color: var(--muted); font-size: var(--t-xs); }
.now-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }

/* ---------- Projects ---------- */
.feature {
  display: grid;
  gap: 32px;
  padding: clamp(24px, 3.6vw, 44px);
  border-radius: 26px;
}
.feature + .feature { margin-top: 20px; }
.feature-top {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 28px clamp(32px, 5vw, 72px);
  align-items: start;
}
.feature-copy { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.badges { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.badge-soft { color: var(--muted); font-size: var(--t-xs); font-weight: 600; }
.feature-title { font-size: clamp(2.2rem, 1.4rem + 3vw, 3.75rem); letter-spacing: -0.05em; line-height: 0.95; }
.feature-sub { color: var(--muted); font-size: var(--t-lg); line-height: 1.45; }
.feature-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.link-row { display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: var(--t-sm); }

.stat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0; }
.stat {
  display: flex;
  flex-direction: column-reverse;
  justify-content: flex-end;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgb(255 255 255 / 0.02);
}
.stat dd { margin: 0; font-size: clamp(2rem, 1.5rem + 1.4vw, 2.75rem); font-weight: 650; letter-spacing: -0.05em; line-height: 1; font-variant-numeric: tabular-nums; }
.stat dt { margin-top: 8px; color: var(--muted); font-size: var(--t-xs); line-height: 1.4; }
.stat-grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.feature-highlights { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 32px; }

/* Pipeline graph */
.pipeline {
  container-type: inline-size;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #070a10;
  overflow: hidden;
}
.pipe-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px 12px 18px;
  border-bottom: 1px solid var(--line);
}
.pipe-id { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; min-width: 0; }
.pipe-name { font: 500 var(--t-sm)/1.3 var(--f-mono); }
.pipe-ref { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 6px; background: rgb(255 255 255 / 0.05); color: var(--muted); font: 500 12px/1.3 var(--f-mono); }
.pipe-ref svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.4; }
.ci-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 11px 4px 7px;
  border-radius: 999px;
  font: 600 12px/1.3 var(--f-sans);
  --c: var(--green);
  color: var(--c);
  background: color-mix(in srgb, var(--c) 12%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 32%, transparent);
}
.ci-status[data-status="running"] { --c: var(--blue); }
.ci-status[data-status="pending"] { --c: var(--muted); }
.replay { display: none; }
.motion .replay { display: inline-flex; }

.ci-icon, .job-icon { position: relative; flex: none; width: 16px; height: 16px; border-radius: 50%; background: var(--green); }
.ci-icon::after, .job-icon::after {
  content: "";
  position: absolute;
  left: 5.5px; top: 3.5px;
  width: 4px; height: 7px;
  border: solid #04110b;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.ci-status[data-status="running"] .ci-icon,
.job[data-state="running"] .job-icon {
  background: transparent;
  border: 2px solid rgb(79 140 255 / 0.25);
  border-top-color: var(--blue);
  animation: spin 0.8s linear infinite;
}
.ci-status[data-status="pending"] .ci-icon,
.job[data-state="pending"] .job-icon,
.motion .pipeline:not(.is-running):not(.is-done) .job-icon { background: transparent; border: 2px solid var(--line-strong); animation: none; }
.ci-status[data-status="running"] .ci-icon::after,
.ci-status[data-status="pending"] .ci-icon::after,
.job[data-state="running"] .job-icon::after,
.job[data-state="pending"] .job-icon::after,
.motion .pipeline:not(.is-running):not(.is-done) .job-icon::after { display: none; }
.job[data-state="passed"] .job-icon { animation: pop 0.35s var(--ease); }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pop { 0% { transform: scale(0.4); } 70% { transform: scale(1.18); } 100% { transform: scale(1); } }

.stages-wrap { overflow-x: auto; scrollbar-width: none; }
.stages { display: flex; align-items: flex-start; min-width: max-content; padding: 24px 20px 22px; }
.stage { display: flex; flex-direction: column; gap: 12px; flex: none; }
.stage-name { height: 20px; color: var(--muted); font: 500 12.5px/20px var(--f-mono); }
.jobs { display: flex; flex-direction: column; gap: 10px; }
.job {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 38px;
  padding: 0 14px 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--panel-2);
  font: 500 12.5px/1 var(--f-mono);
  white-space: nowrap;
  transition: border-color 0.3s, background-color 0.3s, box-shadow 0.3s;
}
.job[data-state="running"] { border-color: rgb(79 140 255 / 0.65); background: rgb(79 140 255 / 0.08); box-shadow: 0 0 24px -6px rgb(79 140 255 / 0.6); }
.job[data-state="pending"], .motion .pipeline:not(.is-running):not(.is-done) .job { color: var(--muted); }
.stage-link {
  position: relative;
  flex: 1 1 36px;
  min-width: 18px;
  max-width: 90px;
  height: 2px;
  margin-top: 51px;
  background: var(--line-strong);
}
.stage-link::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--green);
  box-shadow: 0 0 10px var(--green);
  transform-origin: left center;
  transform: scaleX(var(--p, 1));
  transition: transform 0.3s var(--ease);
}
.motion .pipeline:not(.is-running):not(.is-done) .stage-link::after { transform: scaleX(0); }
.env {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 38px;
  padding: 0 14px 0 11px;
  border-radius: 10px;
  border: 1px solid rgb(52 211 153 / 0.55);
  background: rgb(52 211 153 / 0.1);
  font: 600 12.5px/1 var(--f-mono);
  text-decoration: none;
  white-space: nowrap;
  transition: border-color 0.3s, background-color 0.3s, color 0.3s, box-shadow 0.3s;
}
.env svg { width: 16px; height: 16px; fill: none; stroke: var(--green); stroke-width: 1.6; }
a.env:hover { border-color: var(--green); }
.env[data-state="pending"], .motion .pipeline:not(.is-running):not(.is-done) .env { border-style: dashed; border-color: var(--line-strong); background: transparent; color: var(--muted); }
.env[data-state="pending"] svg, .motion .pipeline:not(.is-running):not(.is-done) .env svg { stroke: var(--muted); }
.pipeline.is-done .env[data-state="live"] { animation: env-glow 1.4s var(--ease) 1; }
@keyframes env-glow { 0% { box-shadow: 0 0 0 0 rgb(52 211 153 / 0.6); } 100% { box-shadow: 0 0 0 14px rgb(52 211 153 / 0); } }

.pipe-log {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  height: calc(5 * 1.75em + 24px);
  padding: 12px 18px;
  border-top: 1px solid var(--line);
  overflow: hidden;
  font: 400 12.5px/1.75 var(--f-mono);
  color: var(--muted);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 45%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 45%);
}
.log-line { flex: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.log-line .lp { color: var(--blue); }
.log-line .lk { color: var(--green); }
.log-line.is-ok { color: var(--fg); }
.motion .log-line.is-new { animation: log-in 0.3s var(--ease); }
@keyframes log-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.motion .pipeline:not(.is-running):not(.is-done) .log-line { visibility: hidden; }

@container (max-width: 980px) {
  .stages-wrap { overflow: visible; }
  .stages { flex-direction: column; align-items: stretch; min-width: 0; padding: 20px 16px; }
  .stage { display: grid; grid-template-columns: 5.5rem minmax(0, 1fr); align-items: start; gap: 0 12px; }
  .stage-name { height: 38px; line-height: 38px; }
  .stage-env .env { justify-self: start; }
  .jobs { flex-direction: row; flex-wrap: wrap; gap: 8px; }
  .stage-link { flex: none; width: 2px; height: 16px; min-width: 0; max-width: none; margin: 6px 0 6px calc(5.5rem + 12px + 17px); }
  .stage-link::after { transform-origin: center top; transform: scaleY(var(--p, 1)); }
  .motion .pipeline:not(.is-running):not(.is-done) .stage-link::after { transform: scaleY(0); }
  .pipe-log { height: calc(4 * 1.75em + 24px); padding-inline: 14px; }
}

/* Flow diagram */
.flow-wrap { container-type: inline-size; }
.flow { display: flex; align-items: stretch; gap: 0; }
.flow-node {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  padding: 14px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--panel-2);
  text-align: center;
}
.flow-node b { font-weight: 600; font-size: var(--t-sm); line-height: 1.3; }
.flow-node span { color: var(--muted); font: 500 11.5px/1.35 var(--f-mono); }
.flow-node.is-key { border-color: rgb(79 140 255 / 0.6); box-shadow: 0 0 30px -10px rgb(79 140 255 / 0.6); }
.flow-node.is-ok { border-color: rgb(52 211 153 / 0.5); }
.flow-node.is-ext { border-style: dashed; background: transparent; }
.flow-link { position: relative; flex: 0 0 34px; align-self: center; height: 2px; background: var(--line-strong); }
.flow-link::after {
  content: "";
  position: absolute;
  right: -1px; top: -4px;
  border: 5px solid transparent;
  border-left: 6px solid var(--line-strong);
  border-right: 0;
}
.flow-link i {
  position: absolute;
  top: -3px; left: 0;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 10px var(--cyan);
  opacity: 0;
}
.flow-link.rev::after { right: auto; left: -1px; border-left: 0; border-right: 6px solid var(--line-strong); }
.motion .flow-link i { animation: flow-x 1.5s linear infinite; animation-delay: calc(var(--i, 0) * 0.35s); }
.motion .flow-link.rev i { animation-name: flow-x-rev; }
.flow-wrap.is-paused .flow-link i { animation-play-state: paused; }
@keyframes flow-x { 0% { left: 0; opacity: 0; } 15% { opacity: 1; } 85% { opacity: 1; } 100% { left: calc(100% - 8px); opacity: 0; } }
@keyframes flow-x-rev { 0% { left: calc(100% - 8px); opacity: 0; } 15% { opacity: 1; } 85% { opacity: 1; } 100% { left: 0; opacity: 0; } }
@keyframes flow-y { 0% { top: 0; opacity: 0; } 15% { opacity: 1; } 85% { opacity: 1; } 100% { top: calc(100% - 8px); opacity: 0; } }
@keyframes flow-y-rev { 0% { top: calc(100% - 8px); opacity: 0; } 15% { opacity: 1; } 85% { opacity: 1; } 100% { top: 0; opacity: 0; } }
.flow-caption { margin-top: 12px; color: var(--muted); font-size: var(--t-xs); }
.flow-title { margin-bottom: 12px; color: var(--muted); font: 500 var(--t-xs)/1.3 var(--f-mono); }
.flow-group + .flow-group { margin-top: 26px; }

@container (max-width: 640px) {
  .flow { flex-direction: column; align-items: center; }
  .flow-node { width: 100%; flex: none; }
  .flow-link { flex: none; width: 2px; height: 28px; }
  .flow-link::after { right: auto; left: -4px; top: auto; bottom: -1px; border: 5px solid transparent; border-top: 6px solid var(--line-strong); border-bottom: 0; }
  .flow-link.rev::after { bottom: auto; top: -1px; border-top: 0; border-bottom: 6px solid var(--line-strong); }
  .flow-link i { left: -3px; top: 0; }
  .motion .flow-link i { animation-name: flow-y; }
  .motion .flow-link.rev i { animation-name: flow-y-rev; }
}

/* Project cards grid */
.more-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px 24px; margin: clamp(56px, 7vw, 88px) 0 22px; }
.more-head h3 { font-size: var(--t-xl); letter-spacing: -0.03em; }
.more-head p { color: var(--muted); font-size: var(--t-sm); }
.proj-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.proj-card { display: flex; flex-direction: column; gap: 14px; padding: 24px; min-width: 0; transform-style: preserve-3d; transition: transform 0.4s var(--ease), border-color 0.3s; }
.proj-card:hover { border-color: var(--line-strong); }
.proj-card .glyph { width: 100%; height: 92px; margin-bottom: 4px; border-radius: 12px; background: rgb(255 255 255 / 0.02); border: 1px solid var(--line); overflow: hidden; }
.proj-card .glyph svg { width: 100%; height: 100%; }
.proj-card h4 { font-size: var(--t-lg); letter-spacing: -0.02em; line-height: 1.25; }
.proj-card p { color: var(--muted); font-size: var(--t-sm); line-height: 1.55; }
.proj-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.proj-metric { color: var(--muted); font: 500 12px/1 var(--f-mono); white-space: nowrap; }
.proj-foot { margin-top: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; padding-top: 6px; font-size: var(--t-sm); }
.proj-cta { text-decoration: none; color: inherit; }
.proj-cta:hover h4 { color: var(--cyan); }

/* Glyph animations */
.g-stroke { fill: none; stroke: var(--line-strong); stroke-width: 1.5; }
.g-blue { fill: var(--blue); }
.g-cyan { fill: var(--cyan); }
.g-green { fill: var(--green); }
.g-ring { fill: none; stroke: var(--cyan); stroke-width: 1.5; transform-box: fill-box; transform-origin: center; }
.motion .g-ring { animation: g-ring 2.4s var(--ease) infinite; }
.motion .g-ring.r2 { animation-delay: 0.8s; }
.motion .g-ring.r3 { animation-delay: 1.6s; }
@keyframes g-ring { from { transform: scale(0.2); opacity: 0.9; } to { transform: scale(1); opacity: 0; } }
.g-stage { fill: var(--panel-2); stroke: var(--line-strong); stroke-width: 1.5; }
.motion .g-stage { animation: g-stage 3.6s steps(1) infinite; }
.motion .g-stage.s2 { animation-delay: 0.6s; }
.motion .g-stage.s3 { animation-delay: 1.2s; }
.motion .g-stage.s4 { animation-delay: 1.8s; }
@keyframes g-stage { 0% { fill: var(--panel-2); stroke: var(--line-strong); } 15%, 85% { fill: var(--green); stroke: var(--green); } }
.g-layer { transform-box: fill-box; }
.motion .g-layer { animation: g-layer 3.2s var(--ease) infinite; }
.motion .g-layer.l2 { animation-delay: 0.25s; }
.motion .g-layer.l3 { animation-delay: 0.5s; }
@keyframes g-layer { 0% { transform: translateY(-26px); opacity: 0; } 18%, 80% { transform: none; opacity: 1; } 100% { transform: none; opacity: 0; } }
.g-wave { fill: none; stroke: var(--green); stroke-width: 2; stroke-linecap: round; }
.motion .g-wave { animation: g-wave 1.8s ease-out infinite; }
.motion .g-wave.w2 { animation-delay: 0.3s; }
.motion .g-wave.w3 { animation-delay: 0.6s; }
@keyframes g-wave { 0% { opacity: 0; } 30% { opacity: 1; } 100% { opacity: 0; } }
.g-pkt { transform-box: fill-box; }
.motion .g-pkt { animation: g-pkt 2.4s linear infinite; animation-delay: calc(var(--i) * -0.4s); }
.motion .g-pkt.drop { animation-name: g-pkt-drop; }
@keyframes g-pkt { from { transform: translateX(0); } to { transform: translateX(300px); } }
@keyframes g-pkt-drop { 0% { transform: translateX(0); opacity: 1; } 48% { transform: translateX(150px); opacity: 1; } 60% { transform: translate(150px, 26px); opacity: 0; } 100% { transform: translate(150px, 26px); opacity: 0; } }

/* Project dialog */
.proj-dialog {
  width: min(760px, 100% - 32px);
  max-height: min(86vh, 900px);
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  background: var(--panel);
  color: var(--fg);
  box-shadow: 0 60px 160px -40px rgb(0 0 0 / 0.9);
}
.proj-dialog::backdrop { background: rgb(2 4 8 / 0.7); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.proj-dialog[open] { animation: dlg-in 0.45s var(--ease); }
.proj-dialog[open]::backdrop { animation: fade-in 0.35s ease; }
@keyframes dlg-in { from { opacity: 0; transform: translateY(24px) scale(0.97); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } }
.dlg-inner { display: flex; flex-direction: column; gap: 18px; padding: clamp(24px, 4vw, 36px); }
.dlg-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.dlg-head h3 { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.25rem); letter-spacing: -0.04em; margin-top: 10px; }
.dlg-close { flex: none; }
.dlg-inner .note { color: var(--muted); font-size: var(--t-sm); }

/* ---------- Stack ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: 600 var(--t-xs)/1 var(--f-sans);
  cursor: pointer;
  transition: background-color 0.25s, border-color 0.25s, color 0.25s;
}
.chip-btn:hover { color: var(--fg); border-color: rgb(148 163 184 / 0.45); }
.chip-btn[aria-pressed="true"] { background: var(--fg); border-color: var(--fg); color: var(--bg); }
.stack-groups { columns: 3 320px; column-gap: 16px; }
.group { break-inside: avoid; margin-bottom: 16px; padding: 22px; }
.group[hidden] { display: none; }
.group-head { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; padding-bottom: 12px; }
.group-head::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, rgb(45 212 239 / 0.55), rgb(79 140 255 / 0.25) 55%, transparent);
  transform-origin: left center;
}
.group h3 { font-size: var(--t-base); font-weight: 600; letter-spacing: -0.01em; }
.group-count { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font: 500 12px/1 var(--f-mono); font-variant-numeric: tabular-nums; }
.group-count::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); }

/* Stack: tags come up one by one, like pods being scheduled */
.motion.js-ready .group:not(.is-deployed) .tags li { opacity: 0; }
.motion.js-ready .group:not(.is-deployed) .group-head::after { transform: scaleX(0); }
.motion.js-ready .group:not(.is-deployed) .group-count::before { background: var(--dim); box-shadow: none; }
.motion .group.is-deployed .tags li { animation: tag-in 0.55s var(--ease) backwards; animation-delay: calc(var(--gd, 0ms) + var(--t, 0) * 32ms); }
.motion .group.is-deployed .group-head::after { animation: line-in 1.1s var(--ease) backwards; animation-delay: var(--gd, 0ms); }
.motion .group.is-deployed .group-count::before { animation: led-boot 1.1s linear backwards; animation-delay: var(--gd, 0ms); }
@keyframes tag-in { from { opacity: 0; transform: translateY(10px) scale(0.86); filter: blur(3px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes line-in { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes led-boot {
  0%, 18%, 38%, 58% { background: var(--amber); box-shadow: 0 0 8px var(--amber); }
  9%, 28%, 48%, 68% { background: transparent; box-shadow: none; }
  80%, 100% { background: var(--green); box-shadow: 0 0 8px var(--green); }
}

.stack-meta { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 24px; margin-bottom: 26px; color: var(--muted); font-size: var(--t-sm); }
.stack-meta b { color: var(--fg); font-weight: 600; font-variant-numeric: tabular-nums; }
.stack-hint { min-height: 1.5em; color: var(--dim); font: 500 12.5px/1.5 var(--f-mono); transition: color 0.2s; }
.stack-hint.is-active { color: var(--cyan); }
.stack-wrap { position: relative; }
.stack-links { position: absolute; inset: 0; z-index: 4; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.sl-line { fill: none; stroke: var(--cyan); stroke-width: 1.6; stroke-linecap: round; transition: stroke-dashoffset 0.6s var(--ease); }
.sl-glow { fill: none; stroke: rgb(45 212 239 / 0.25); stroke-width: 7; stroke-linecap: round; transition: stroke-dashoffset 0.6s var(--ease); }
.sl-end { fill: var(--bg); stroke: var(--cyan); stroke-width: 1.6; }
.sl-packet { fill: #fff; filter: drop-shadow(0 0 5px var(--cyan)); }
.stack-groups .tags li { cursor: default; transition: border-color 0.2s, color 0.2s, opacity 0.25s, background-color 0.2s, box-shadow 0.2s, transform 0.25s var(--ease); }
.stack-groups .tags li.has-twin { position: relative; padding-right: 18px; }
.stack-groups .tags li.has-twin::after { content: ""; position: absolute; right: 7px; top: 50%; width: 4px; height: 4px; margin-top: -2px; border-radius: 50%; background: var(--cyan); opacity: 0.75; }
.stack-groups.has-match .tags li:not(.is-match) { opacity: 0.28; }
.stack-groups .tags li.is-match { border-color: rgb(45 212 239 / 0.75); color: var(--fg); background: rgb(45 212 239 / 0.1); box-shadow: 0 0 18px -6px var(--cyan); transform: translateY(-2px); }
.stack-groups.has-match .group:has(.is-match) { border-color: rgb(45 212 239 / 0.35); }
::view-transition-group(*) { animation-duration: 0.4s; animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1); }

/* ---------- Timeline ---------- */
.timeline { position: relative; --date-col: 9rem; --rail-x: calc(var(--date-col) + 1.75rem); }
.tl-rail { position: absolute; top: 12px; bottom: 12px; left: var(--rail-x); width: 2px; margin-left: -1px; background: var(--line); border-radius: 2px; overflow: hidden; }
.tl-fill { position: absolute; inset: 0; background: linear-gradient(180deg, var(--cyan), var(--blue) 60%, var(--green)); transform-origin: top; transform: scaleY(var(--p, 1)); }
.tl-list { display: flex; flex-direction: column; gap: 14px; }
.tl-item { display: grid; grid-template-columns: var(--date-col) minmax(0, 1fr); column-gap: 3.5rem; align-items: start; }
.tl-date { padding-top: 22px; color: var(--muted); font: 500 var(--t-sm)/1.3 var(--f-mono); text-align: right; font-variant-numeric: tabular-nums; }
.tl-card { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 18px; padding: 20px 22px; max-width: 760px; }
.tl-card::marker { content: none; }
.tl-node {
  position: absolute;
  top: 24px;
  left: calc(-1.75rem - 8px);
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--cyan);
  box-shadow: 0 0 0 5px var(--bg);
  transition: background-color 0.3s, border-color 0.3s, box-shadow 0.3s;
}
.tl-item:not(.is-pending) .tl-node { background: var(--cyan); box-shadow: 0 0 0 5px var(--bg), 0 0 18px var(--cyan); }
.tl-item.is-pending .tl-node { border-color: var(--line-strong); }
.tl-badge {
  grid-row: span 3;
  display: grid;
  place-items: center;
  width: 46px; height: 46px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: rgb(255 255 255 / 0.03);
  font: 700 11px/1 var(--f-mono);
  color: var(--fg);
  letter-spacing: -0.02em;
}
.tl-degree .tl-badge { background: rgb(79 140 255 / 0.12); border-color: rgb(79 140 255 / 0.45); color: var(--blue); }
.tl-kind { color: var(--muted); font: 500 12px/1.4 var(--f-mono); }
.tl-card h3 { font-size: var(--t-lg); letter-spacing: -0.02em; line-height: 1.3; }
.tl-meta { color: var(--muted); font-size: var(--t-sm); }
.tl-card .text-link { grid-column: 2; width: max-content; margin-top: 4px; font-size: var(--t-sm); }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: 40px clamp(32px, 5vw, 80px); align-items: center; }
.contact-copy { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.contact-title { font-size: clamp(2.6rem, 1.4rem + 4.4vw, 5.25rem); letter-spacing: -0.055em; line-height: 0.95; }
.contact-copy > p { color: var(--muted); font-size: var(--t-lg); max-width: 50ch; }
.email-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.email { font-size: clamp(1.2rem, 0.8rem + 1.6vw, 1.85rem); font-weight: 600; letter-spacing: -0.03em; text-decoration: none; overflow-wrap: anywhere; }
.email:hover { color: var(--cyan); }
.copy-btn.is-done { border-color: var(--green); color: var(--green); }
.contact-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; }
.contact-links li { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 14px 2px; border-bottom: 1px solid var(--line); min-width: 0; }
.contact-links span { color: var(--muted); font-size: var(--t-xs); flex: none; }
.contact-links a { font-weight: 600; text-decoration: none; overflow-wrap: anywhere; text-align: right; transition: color 0.2s; }
.contact-links a:hover { color: var(--cyan); }

.globe-fig { margin: 0; }
.globe-wrap { position: relative; width: 100%; max-width: 520px; margin-inline: auto; aspect-ratio: 1; }
.globe-wrap canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: grab; touch-action: pan-y; }
.globe-wrap canvas:active { cursor: grabbing; }
.globe-wrap::before { content: ""; position: absolute; inset: 12%; border-radius: 50%; background: radial-gradient(circle, rgb(79 140 255 / 0.22), transparent 65%); filter: blur(30px); }
.globe-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 18px; margin-top: 12px; color: var(--muted); font-size: var(--t-xs); }
.globe-legend span { display: inline-flex; align-items: center; gap: 7px; }
.globe-legend i { width: 8px; height: 8px; border-radius: 50%; }

/* ---------- Footer ---------- */
.site-footer { position: relative; overflow: hidden; border-top: 1px solid var(--line); padding-top: 40px; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 32px; color: var(--muted); font-size: var(--t-xs); }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.footer-links a { text-decoration: none; }
.footer-links a:hover { color: var(--fg); }
.footer-word {
  margin-top: 28px;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  font-size: clamp(2.5rem, 0.5rem + 10.5vw, 12rem);
  font-weight: 700;
  letter-spacing: -0.065em;
  line-height: 0.78;
  text-align: center;
  white-space: nowrap;
  background: linear-gradient(180deg, rgb(148 163 184 / 0.22), rgb(148 163 184 / 0.02) 85%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  user-select: none;
}

.to-top {
  position: fixed;
  right: max(18px, env(safe-area-inset-right, 0px));
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  z-index: 70;
  display: grid;
  place-items: center;
  width: 48px; height: 48px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--glass);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  color: var(--fg);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity 0.3s, transform 0.3s var(--ease), visibility 0s linear 0.3s;
}
.to-top.is-on { opacity: 1; visibility: visible; transform: none; transition: opacity 0.3s, transform 0.3s var(--ease); }
.to-top svg.arrow { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.to-top svg.ring { position: absolute; inset: -1px; width: calc(100% + 2px); height: calc(100% + 2px); transform: rotate(-90deg); }
.to-top .ring circle { fill: none; stroke: var(--cyan); stroke-width: 2; stroke-dasharray: 150.8; stroke-dashoffset: calc(150.8 * (1 - var(--p, 0))); }

/* ---------- Case study layout ---------- */
.cs-hero { position: relative; padding-block: calc(env(safe-area-inset-top, 0px) + 128px) clamp(48px, 6vw, 80px); isolation: isolate; overflow: hidden; }
.cs-hero .wrap { display: flex; flex-direction: column; gap: 22px; }
.back-link { display: inline-flex; align-items: center; gap: 8px; width: max-content; color: var(--muted); font: 500 var(--t-sm)/1 var(--f-mono); text-decoration: none; transition: color 0.2s, gap 0.25s var(--ease); }
.back-link:hover { color: var(--fg); gap: 12px; }
.back-link svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cs-title { font-size: clamp(2.8rem, 1.2rem + 6vw, 6.25rem); letter-spacing: -0.06em; line-height: 0.92; max-width: 14ch; }
.cs-sub { color: #b6c1d1; font-size: clamp(1.15rem, 1rem + 0.5vw, 1.375rem); line-height: 1.55; max-width: 62ch; }
.cs-note { display: flex; gap: 10px; align-items: flex-start; max-width: 70ch; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: rgb(255 255 255 / 0.02); color: var(--muted); font-size: var(--t-sm); }
.cs-note svg { flex: none; width: 18px; height: 18px; margin-top: 2px; fill: none; stroke: var(--cyan); stroke-width: 1.8; stroke-linecap: round; }
.cs-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.cs-tags li { padding: 6px 12px; border: 1px solid var(--line-strong); border-radius: 999px; font: 500 12.5px/1 var(--f-mono); color: #c9d2df; }

.cs-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 56px; align-items: start; }
.toc { position: sticky; top: 100px; padding-top: 6px; }
.toc p { margin-bottom: 14px; color: var(--dim); font: 500 12px/1 var(--f-mono); }
.toc-track { position: relative; }
.toc ol { display: flex; flex-direction: column; gap: 2px; padding-left: 16px; border-left: 1px solid var(--line); }
.toc a { display: block; padding: 7px 0; color: var(--muted); font-size: var(--t-sm); text-decoration: none; transition: color 0.2s; }
.toc a:hover { color: var(--fg); }
.toc a[aria-current="true"] { color: var(--fg); }
.toc-ind { position: absolute; left: -1px; top: 0; width: 2px; height: 34px; background: var(--grad); border-radius: 2px; transform: translateY(var(--y, 0)); transition: transform 0.4s var(--ease), height 0.4s var(--ease); }

.cs-body { min-width: 0; display: flex; flex-direction: column; gap: clamp(72px, 9vw, 112px); padding-bottom: 40px; }
.cs-section { display: flex; flex-direction: column; gap: 22px; scroll-margin-top: 100px; }
.cs-section > h2 { font-size: clamp(1.9rem, 1.3rem + 2.2vw, 3rem); letter-spacing: -0.045em; }
.cs-section > p.lead { color: #b6c1d1; font-size: var(--t-lg); line-height: 1.6; max-width: 66ch; }
.cs-section > p { max-width: 70ch; color: #c3ccd9; }

.summary-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; margin: 0; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.summary-grid > div { padding: 18px 20px; border-bottom: 1px solid var(--line); background: rgb(255 255 255 / 0.015); }
.summary-grid > div:nth-child(odd) { border-right: 1px solid var(--line); }
.summary-grid > div:nth-last-child(-n + 2) { border-bottom: 0; }
.summary-grid > div:last-child:nth-child(odd) { grid-column: span 2; border-right: 0; }
.summary-grid dt { color: var(--muted); font: 500 12px/1.3 var(--f-mono); margin-bottom: 6px; }
.summary-grid dd { margin: 0; font-weight: 500; line-height: 1.5; }

.cards-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.cards-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.info-card { padding: 22px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.info-card h3 { font-size: var(--t-lg); letter-spacing: -0.02em; line-height: 1.25; }
.info-card p { color: var(--muted); font-size: var(--t-sm); line-height: 1.6; }
.info-card .ic {
  display: grid;
  place-items: center;
  width: 40px; height: 40px;
  margin-bottom: 4px;
  border-radius: 11px;
  border: 1px solid var(--line-strong);
  background: rgb(79 140 255 / 0.08);
  color: var(--blue);
}
.info-card .ic svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.callout { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px; padding: 22px; border-radius: 18px; border: 1px solid rgb(52 211 153 / 0.35); background: linear-gradient(135deg, rgb(52 211 153 / 0.08), transparent 60%); }
.callout .ic { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: rgb(52 211 153 / 0.14); color: var(--green); }
.callout .ic svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.callout h3 { font-size: var(--t-lg); letter-spacing: -0.02em; margin-bottom: 4px; }
.callout p { color: #c3ccd9; font-size: var(--t-sm); }

.ver-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.ver-card { padding: 20px; }
.ver-card h3 { font-size: var(--t-base); margin-bottom: 12px; }
.ver-list { display: flex; flex-direction: column; }
.ver-list li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: var(--t-sm); }
.ver-list li:last-child { border-bottom: 0; }
.ver-list span:last-child { color: var(--cyan); font: 500 12.5px/1.6 var(--f-mono); white-space: nowrap; }

.decision { padding: 0; }
.decision summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px;
  cursor: pointer;
  list-style: none;
  font-weight: 600;
  font-size: var(--t-lg);
  letter-spacing: -0.02em;
}
.decision summary::-webkit-details-marker { display: none; }
.decision summary::after { content: ""; flex: none; width: 10px; height: 10px; border: solid var(--muted); border-width: 0 2px 2px 0; transform: translateY(-3px) rotate(45deg); transition: transform 0.3s var(--ease); }
.decision[open] summary::after { transform: translateY(2px) rotate(-135deg); }
.decision .d-body { padding: 0 22px 22px; color: #c3ccd9; font-size: var(--t-sm); line-height: 1.65; max-width: 72ch; }
.decision .d-body b { color: var(--fg); }
.decisions { display: flex; flex-direction: column; gap: 12px; }

.roadmap { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.roadmap .info-card h3 { display: flex; align-items: center; gap: 10px; }

/* Cost toggle demo */
.cost-demo { padding: clamp(20px, 3vw, 28px); display: flex; flex-direction: column; gap: 20px; }
.cost-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; }
.cost-top h3 { font-size: var(--t-lg); letter-spacing: -0.02em; }
.cost-top p { color: var(--muted); font-size: var(--t-sm); }
.switch { display: inline-flex; padding: 4px; border: 1px solid var(--line-strong); border-radius: 12px; background: rgb(255 255 255 / 0.03); }
.switch button { min-height: 38px; padding: 0 16px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-weight: 600; font-size: var(--t-sm); cursor: pointer; transition: background-color 0.3s, color 0.3s; }
.switch button[aria-pressed="true"] { background: var(--fg); color: var(--bg); }
.res-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.res {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--panel-2);
  transition: border-color 0.4s, background-color 0.4s, opacity 0.4s;
}
.res b { font-size: var(--t-sm); font-weight: 600; }
.res .res-state { display: inline-flex; align-items: center; gap: 6px; font: 500 12px/1.3 var(--f-mono); color: var(--green); transition: color 0.4s; }
.res .res-state::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.res[data-state="stopped"] { opacity: 0.6; border-style: dashed; background: transparent; }
.res[data-state="stopped"] .res-state { color: var(--dim); }
.res[data-state="busy"] .res-state { color: var(--amber); }
.res[data-state="busy"] .res-state::before { animation: blink-dot 0.6s steps(2) infinite; }
.res.is-compute { border-color: rgb(79 140 255 / 0.5); }
.res.is-compute[data-state="stopped"] { border-color: var(--line-strong); }
.cost-log { font: 400 12.5px/1.75 var(--f-mono); color: var(--muted); min-height: 3.5em; }
.cost-log .lk { color: var(--green); }
.cost-log .lp { color: var(--blue); }

.cs-next { padding-block: clamp(64px, 8vw, 110px); border-top: 1px solid var(--line); }
.next-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.next-card { display: flex; flex-direction: column; gap: 10px; padding: 28px; text-decoration: none; min-width: 0; }
.next-card span { color: var(--muted); font: 500 12.5px/1 var(--f-mono); }
.next-card b { font-size: var(--t-xl); letter-spacing: -0.03em; line-height: 1.15; }
.next-card p { color: var(--muted); font-size: var(--t-sm); }
.next-card .arrow-go { display: inline-flex; align-items: center; gap: 8px; margin-top: 8px; color: var(--cyan); font-weight: 600; font-size: var(--t-sm); transition: gap 0.25s var(--ease); }
.next-card:hover .arrow-go { gap: 14px; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); }
  .console { max-width: 640px; width: 100%; justify-self: center; }
  .feature-top { grid-template-columns: minmax(0, 1fr); }
  .proj-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cs-layout { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .toc { display: none; }
  .ver-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .scroll-cue { display: none; }
}

@media (max-width: 900px) {
  :root { --gutter: 20px; }
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-areas: "intro intro" "now now" "loc lang" "focus focus" "edu edu"; }
  .contact-grid { grid-template-columns: minmax(0, 1fr); }
  .globe-wrap { max-width: 420px; }
  .cards-3 { grid-template-columns: minmax(0, 1fr); }
  .res-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .feature-highlights { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 860px) {
  .site-nav {
    position: absolute;
    top: calc(100% + 8px);
    left: 0; right: 0;
    margin: 0;
    padding: 8px;
    border: 1px solid var(--line-strong);
    border-radius: 18px;
    background: rgb(10 14 22 / 0.96);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
    visibility: hidden;
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
    transform-origin: top center;
    transition: opacity 0.2s, transform 0.3s var(--ease), visibility 0s linear 0.3s;
  }
  .nav-open .site-nav { visibility: visible; opacity: 1; transform: none; transition: opacity 0.2s, transform 0.3s var(--ease); }
  .nav-list { flex-direction: column; }
  .nav-list a { padding: 14px 14px; font-size: var(--t-base); }
  .nav-shell { justify-content: space-between; }
  .nav-actions .nav-toggle { display: inline-grid; }
  .nav-resume { display: none; }
  .nav-toggle path { transition: transform 0.3s var(--ease); transform-origin: 12px 12px; }
  .nav-open .nav-toggle .l1 { transform: translateY(4px) rotate(45deg); }
  .nav-open .nav-toggle .l2 { transform: translateY(-4px) rotate(-45deg); }
}

@media (max-width: 720px) {
  .hero { padding-top: calc(env(safe-area-inset-top, 0px) + 112px); }
  .hero-lede { font-size: var(--t-base); }
  .cluster-stage { aspect-ratio: 1.3 / 1; }
  .hero-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-stats > div:nth-child(3) { padding-left: 0; border-left: 0; }
  .hero-stats > div:nth-child(n + 3) { border-top: 1px solid var(--line); margin-top: 18px; }
  .proj-grid { grid-template-columns: minmax(0, 1fr); }
  .stat-grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bento { grid-template-columns: minmax(0, 1fr); grid-template-areas: "intro" "now" "loc" "lang" "focus" "edu"; }
  .timeline { --rail-x: 8px; }
  .tl-item { grid-template-columns: minmax(0, 1fr); padding-left: 30px; row-gap: 8px; }
  .tl-date { padding-top: 0; text-align: left; font-size: var(--t-xs); }
  .tl-node { left: -30px; top: -26px; }
  .tl-card { grid-template-columns: minmax(0, 1fr); padding: 18px; }
  .tl-badge { grid-row: auto; width: 40px; height: 40px; }
  .tl-card .text-link { grid-column: 1; }
  .contact-links { grid-template-columns: minmax(0, 1fr); }
  .term-body { font-size: 13px; padding-inline: 14px; }
  .summary-grid { grid-template-columns: minmax(0, 1fr); }
  .summary-grid > div { border-right: 0 !important; border-bottom: 1px solid var(--line) !important; }
  .summary-grid > div:last-child { border-bottom: 0 !important; grid-column: auto; }
  .cards-2, .roadmap, .next-grid, .ver-grid { grid-template-columns: minmax(0, 1fr); }
  .callout { grid-template-columns: minmax(0, 1fr); }
  .cursor-glow { display: none; }
}

@media (max-width: 420px) {
  :root { --gutter: 16px; }
  .hero-cta .btn { flex: 1 1 auto; }
  .hero-socials { width: 100%; justify-content: center; margin-left: 0; }
  .res-grid { grid-template-columns: minmax(0, 1fr); }
  .win-title { font-size: 11px; }
}

/* ---------- 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; }
}
