/* ============================================
   Tony Lnng — AI Profile · Dark Technical Theme
   ============================================ */

:root {
  /* Color */
  --bg: #07090f;
  --bg-elev: #0c1018;
  --bg-card: #0f1420;
  --line: rgba(255,255,255,0.08);
  --line-strong: rgba(255,255,255,0.16);
  --text: #e8edf5;
  --text-mute: #9aa6bd;
  --text-dim: #6b7795;
  --accent: #5cf7d0;       /* electric mint */
  --accent-2: #7aa2ff;     /* cool blue */
  --accent-warm: #ffb27a;  /* highlight */
  --danger: #ff6b6b;

  /* Type */
  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
  --font-cjk: 'Noto Sans TC', system-ui, sans-serif;

  /* Layout */
  --max: 1200px;
  --pad-x: clamp(20px, 4vw, 64px);
  --radius: 14px;
  --radius-sm: 8px;

  /* Motion */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

::selection { background: var(--accent); color: #051a14; }

/* Subtle ambient grid background */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(800px 400px at 80% -10%, rgba(122, 162, 255, 0.10), transparent 60%),
    radial-gradient(600px 400px at -10% 110%, rgba(92, 247, 208, 0.08), transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* ===== Header ===== */
.site-header {
  position: fixed; top: 0; left: 0; right: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px var(--pad-x);
  z-index: 50;
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease), padding 0.3s var(--ease);
  border-bottom: 1px solid transparent;
}
.site-header.scrolled {
  background: rgba(7, 9, 15, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom-color: var(--line);
  padding: 12px var(--pad-x);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); flex-shrink: 0; }
.logo { width: 28px; height: 28px; color: var(--accent); }
.brand-text {
  font-family: var(--font-display);
  font-weight: 600; letter-spacing: -0.01em; font-size: 16px;
  white-space: nowrap;
}
.site-nav { display: flex; gap: 28px; }
.site-nav a {
  font-size: 14px; color: var(--text-mute); font-weight: 500;
  transition: color 0.2s var(--ease);
}
.site-nav a:hover { color: var(--accent); }

@media (max-width: 760px) {
  .site-nav { gap: 14px; }
  .site-nav a { font-size: 12px; }
  /* Trim mid-nav links on tablet to avoid crowding */
  .site-nav a[href="#orchestration"],
  .site-nav a[href="#stack"] { display: none; }
}
@media (max-width: 520px) {
  .site-header { padding: 12px 16px; }
  .site-nav { gap: 14px; }
  .site-nav a { font-size: 12px; letter-spacing: 0; }
  .brand-text { font-size: 14px; }
  /* On phones, keep only Projects + Contact alongside brand */
  .site-nav a[href="#about"] { display: none; }
}

/* ===== Hero ===== */
.hero {
  position: relative;
  min-height: 78vh;            /* Upgrade 05: tightened from 92vh */
  display: flex; align-items: center;
  padding: 92px var(--pad-x) 56px;   /* Upgrade 05b: tighter top to lift CTAs above fold */
  overflow: hidden;
}
.hero-bg { position: absolute; inset: 0; z-index: 0; }
.hero-bg img {
  width: 100%; height: 100%; object-fit: cover;
  opacity: 0.55;
  filter: saturate(1.05);
}
.hero-overlay {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 30% 50%, rgba(7,9,15,0.45) 0%, rgba(7,9,15,0.85) 60%, var(--bg) 100%),
    linear-gradient(180deg, transparent 40%, var(--bg) 100%);
}
.hero-grid {
  /* Upgrade 05: 12-col blueprint grid + horizontal rules at 1–2% white */
  position: absolute; inset: 0; z-index: 1;
  background-image:
    /* major 12-col verticals */
    repeating-linear-gradient(90deg,
      rgba(255,255,255,0.025) 0,
      rgba(255,255,255,0.025) 1px,
      transparent 1px,
      transparent calc(100% / 12)),
    /* horizontal 8px micro-rhythm */
    repeating-linear-gradient(0deg,
      rgba(255,255,255,0.012) 0,
      rgba(255,255,255,0.012) 1px,
      transparent 1px,
      transparent 64px);
  mask-image: linear-gradient(180deg, black 0%, black 75%, transparent 100%);
  -webkit-mask-image: linear-gradient(180deg, black 0%, black 75%, transparent 100%);
  opacity: 1;
  pointer-events: none;
}
.hero-grid::after {
  /* register marks at the 12-col gutters — the engineering tell */
  content: '';
  position: absolute; inset: 0;
  background-image:
    radial-gradient(circle at calc(100%/12) 28%, rgba(92,247,208,0.18) 0 1px, transparent 2px),
    radial-gradient(circle at calc(100%/12 * 11) 28%, rgba(122,162,255,0.18) 0 1px, transparent 2px);
  pointer-events: none;
}
.hero-content { position: relative; z-index: 2; max-width: 880px; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-mono);
  font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--accent);
  padding: 6px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 100px;
  background: rgba(92, 247, 208, 0.04);
  margin-bottom: 28px;
}
.dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(40px, 6vw, 76px);
  line-height: 1.02;
  letter-spacing: -0.025em;
  font-weight: 600;
  margin-bottom: 24px;
}
.accent {
  background: linear-gradient(110deg, var(--accent) 0%, var(--accent-2) 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-sub {
  font-size: clamp(16px, 1.4vw, 19px);
  color: var(--text-mute);
  max-width: 660px;
  margin-bottom: 20px;
}
.hero-sub strong { color: var(--text); font-weight: 600; }
.hero-sub em { color: var(--accent); font-style: normal; font-family: var(--font-mono); font-size: 0.92em; }

.hero-meta {
  display: flex; flex-wrap: wrap; gap: 12px;
  font-family: var(--font-mono);
  font-size: 12px; letter-spacing: 0.04em;
  color: var(--text-dim);
  margin-bottom: 22px;
}

/* ----- Hero KPI strip (Upgrade 05) ----- */
.hero-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(15, 20, 32, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  margin-bottom: 0;
  max-width: 720px;
  overflow: hidden;
}
.hero-kpis .kpi {
  padding: 14px 18px;
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 6px;
}
.hero-kpis .kpi:last-child { border-right: none; }
.hero-kpis dt {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  color: var(--text-dim);
}
.hero-kpis dd {
  display: flex; align-items: baseline; gap: 8px;
}
.kpi-num {
  font-family: var(--font-mono);
  font-size: 26px; font-weight: 500;
  color: var(--accent);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.kpi-num.kpi-text { font-size: 22px; text-transform: uppercase; letter-spacing: 0.04em; }
.kpi-plus { font-size: 0.7em; color: var(--accent); margin-left: 1px; }
.kpi-unit {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-mute);
}
@media (max-width: 720px) {
  .hero-kpis { grid-template-columns: repeat(2, 1fr); }
  .hero-kpis .kpi:nth-child(2) { border-right: none; }
  .hero-kpis .kpi:nth-child(1), .hero-kpis .kpi:nth-child(2) { border-bottom: 1px solid var(--line); }
}

.hero-ctas { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 32px; }

/* ===== Trust strip (Upgrade 02) ===== */
.trust-strip {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(12, 16, 24, 0.6);
  padding: 22px var(--pad-x);
  position: relative;
  z-index: 5;
}
.trust-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: flex; align-items: center; gap: 28px;
  flex-wrap: wrap;
  row-gap: 14px;
}
.trust-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  color: var(--accent);
  white-space: nowrap;
}
.trust-logos {
  display: flex; align-items: center; gap: 22px 28px;
  flex-wrap: wrap;
  list-style: none;
  flex: 1 1 100%;
  margin: 0; padding: 0;
}
.trust-logos li {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-mute);
  letter-spacing: 0.02em;
  transition: color 0.25s var(--ease);
}
.trust-logos li:hover { color: var(--text); }
.logo-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  font-size: 11px; font-weight: 500;
  color: var(--accent);
  background: rgba(92, 247, 208, 0.04);
}
@media (max-width: 720px) {
  .trust-inner { gap: 14px; }
  .trust-logos { gap: 14px 18px; }
  .trust-logos li { font-size: 11.5px; }
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 22px;
  font-size: 14px; font-weight: 600;
  border-radius: 100px;
  border: 1px solid var(--line-strong);
  transition: all 0.25s var(--ease);
  font-family: var(--font-body);
}
.btn-primary {
  background: var(--accent);
  color: #051a14;
  border-color: var(--accent);
}
.btn-primary:hover {
  background: #7afad9;
  transform: translateY(-1px);
  box-shadow: 0 12px 30px -10px rgba(92, 247, 208, 0.5);
}
.btn-ghost {
  background: transparent;
  color: var(--text);
}
.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.btn-lg { padding: 16px 28px; font-size: 15px; }

/* ===== Sections ===== */
section {
  position: relative;
  padding: clamp(80px, 10vw, 140px) var(--pad-x);
  z-index: 1;
}

.section-head {
  max-width: 760px;
  margin: 0 auto 64px;
  text-align: center;
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
/* reveal disabled — content always visible */

.section-eyebrow {
  font-family: var(--font-mono);
  font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}

h2 {
  font-family: var(--font-display);
  font-size: clamp(30px, 4vw, 52px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-weight: 600;
  margin-bottom: 18px;
}

.section-sub {
  font-size: 17px;
  color: var(--text-mute);
  max-width: 620px;
  margin: 0 auto;
}

/* ===== About ===== */
.about { background: linear-gradient(180deg, transparent, rgba(122, 162, 255, 0.03), transparent); }

.about-grid {
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: clamp(40px, 6vw, 90px);
  align-items: center;
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
/* reveal disabled — content always visible */

@media (max-width: 860px) { .about-grid { grid-template-columns: 1fr; } }

/* ===== About portrait — photo × high-tech composite ===== */
.about-portrait {
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line-strong);
  background: #07101a;
  box-shadow:
    0 30px 80px -20px rgba(0,0,0,0.6),
    inset 0 0 80px rgba(92, 247, 208, 0.06);
  margin: 0;
}

.portrait-mesh {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  display: block;
  z-index: 0;
}

.portrait-photo {
  position: absolute;
  /* Anchor figure to bottom-right so head sits in upper third */
  right: -4%;
  bottom: 0;
  height: 102%;
  width: auto;
  z-index: 2;
  /* Transparent-background PNG — no blend-mode dependency, works in every browser */
  filter: contrast(1.04) saturate(0.95) drop-shadow(0 6px 18px rgba(0, 0, 0, 0.5));
  transition: transform 0.7s var(--ease);
  pointer-events: none;
  user-select: none;
}
.about-portrait:hover .portrait-photo { transform: translateY(-1.5%) scale(1.015); }

/* HUD chrome */
.portrait-hud {
  position: absolute; inset: 0;
  z-index: 3;
  pointer-events: none;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(92, 247, 208, 0.78);
}
.portrait-hud .corner {
  position: absolute;
  width: 18px; height: 18px;
  border: 1px solid rgba(92, 247, 208, 0.65);
}
.portrait-hud .corner.tl { top: 12px; left: 12px; border-right: none; border-bottom: none; }
.portrait-hud .corner.tr { top: 12px; right: 12px; border-left: none; border-bottom: none; }
.portrait-hud .corner.bl { bottom: 12px; left: 12px; border-right: none; border-top: none; }
.portrait-hud .corner.br { bottom: 12px; right: 12px; border-left: none; border-top: none; }
.portrait-hud .hud-top {
  position: absolute;
  top: 22px; left: 28px; right: 28px;
  display: flex; gap: 8px; align-items: center;
  white-space: nowrap;
}
.portrait-hud .hud-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  animation: pulse 2.4s var(--ease) infinite;
}
.portrait-hud .hud-bottom {
  position: absolute;
  bottom: 22px; left: 28px; right: 28px;
  display: flex; gap: 8px; flex-wrap: wrap;
  color: rgba(228, 233, 240, 0.55);
}
.portrait-hud .hud-sep { color: rgba(92, 247, 208, 0.45); }

/* Top-most overlay: subtle scanlines + vignette + inner teal rim */
.portrait-overlay {
  position: absolute; inset: 0;
  z-index: 4;
  pointer-events: none;
  background:
    repeating-linear-gradient(
      0deg,
      rgba(92, 247, 208, 0.04) 0px,
      rgba(92, 247, 208, 0.04) 1px,
      transparent 1px,
      transparent 3px
    ),
    radial-gradient(
      ellipse at center,
      rgba(0,0,0,0) 55%,
      rgba(0,0,0,0.55) 100%
    );
  box-shadow: inset 0 0 0 1px rgba(92, 247, 208, 0.18);
  border-radius: var(--radius);
}

.about-text h2 { margin-bottom: 24px; }

.lede {
  font-size: 19px;
  color: var(--text);
  margin-bottom: 18px;
  line-height: 1.55;
}
.about-text p { color: var(--text-mute); margin-bottom: 16px; }
.about-text strong { color: var(--text); }

.about-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-top: 36px;
  list-style: none;
  border-top: 1px solid var(--line);
  padding-top: 28px;
}
.about-stats li { display: flex; flex-direction: column; gap: 4px; }
.stat-num {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: -0.02em;
}
.stat-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
@media (max-width: 640px) {
  .about-stats { grid-template-columns: repeat(2, 1fr); }
}

/* ===== Projects ===== */
.projects {
  max-width: var(--max);
  margin: 0 auto;
}
.projects > * + * { margin-top: 0; }

.project {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.3s var(--ease), transform 0.4s var(--ease);
}
/* reveal disabled — content always visible */
.project:hover { border-color: var(--line-strong); }

.project-featured {
  grid-template-columns: 1.1fr 1fr;
  gap: 0;
  margin-bottom: 28px;
  align-items: stretch;
}
.project-featured .project-media {
  aspect-ratio: auto;
  height: 100%;
  min-height: 380px;
}
.project-featured .project-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
}
@media (max-width: 900px) {
  .project-featured { grid-template-columns: 1fr; }
  .project-featured .project-media { aspect-ratio: 16/10; min-height: 0; }
}

/* Spotlight band — elevated treatment for highlighted projects */
.spotlight-band {
  margin: 8px 0 56px;
  padding: 28px 0 40px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(80% 60% at 50% 0%, rgba(14, 165, 233, 0.06), transparent 70%),
    radial-gradient(60% 50% at 90% 100%, rgba(245, 158, 11, 0.04), transparent 70%);
}
.spotlight-eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--mono, ui-monospace, SFMono-Regular, monospace);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent, #0ea5e9);
  margin: 0 0 8px;
}
.spotlight-eyebrow::before,
.spotlight-eyebrow::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line-strong, rgba(255,255,255,0.18)), transparent);
}
.spotlight-eyebrow::before { max-width: 80px; }
.spotlight-title {
  font-size: clamp(20px, 2.2vw, 26px);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 6px;
}
.spotlight-sub {
  color: var(--text-soft, #94a3b8);
  margin: 0 0 28px;
  max-width: 720px;
}
.project-spotlight {
  position: relative;
  border: 1px solid var(--line-strong, rgba(255,255,255,0.18));
  box-shadow:
    0 0 0 1px rgba(14, 165, 233, 0.14) inset,
    0 18px 60px -28px rgba(14, 165, 233, 0.35),
    0 8px 24px -12px rgba(0, 0, 0, 0.6);
  border-radius: 14px;
  overflow: hidden;
}
.project-spotlight::before {
  content: "✦ HIGHLIGHTED";
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 3;
  font-family: var(--mono, ui-monospace, SFMono-Regular, monospace);
  font-size: 10px;
  letter-spacing: 0.18em;
  font-weight: 600;
  color: #0b1220;
  background: linear-gradient(135deg, #0ea5e9, #38bdf8);
  padding: 5px 10px;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
}
.spotlight-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.spotlight-row .project { grid-template-rows: auto 1fr; }
.spotlight-row .project-media { aspect-ratio: 4/3; }
@media (max-width: 900px) {
  .spotlight-row { grid-template-columns: 1fr; }
}

.project-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  margin-bottom: 28px;
}
.project-row .project { grid-template-rows: auto 1fr; }
@media (max-width: 900px) {
  .project-row { grid-template-columns: 1fr; }
}

.project-row-3 {
  grid-template-columns: 1fr 1fr 1fr;
}
@media (max-width: 1100px) {
  .project-row-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .project-row-3 { grid-template-columns: 1fr; }
}

.project-compact .project-body { padding: 24px; }
.project-compact .project-body h3 { font-size: 22px; }
.project-compact .project-media { aspect-ratio: 16/10; }

.project-group-label {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin: 56px 0 22px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.project-group-label:first-of-type { margin-top: 8px; }

.ai-built-badge {
  display: inline-block;
  vertical-align: middle;
  margin-left: 10px;
  padding: 3px 9px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--accent);
  background: rgba(92, 247, 208, 0.08);
  border: 1px solid rgba(92, 247, 208, 0.35);
  border-radius: 999px;
  text-transform: none;
  white-space: nowrap;
  position: relative;
  top: -2px;
  line-height: 1.2;
}
h3 .ai-built-badge { vertical-align: 4px; }

.project-media {
  position: relative;
  background: var(--bg-elev);
  aspect-ratio: 4/3;
  overflow: hidden;
}
.project-media img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.6s var(--ease), filter 0.4s var(--ease);
}
.project:hover .project-media img { transform: scale(1.04); filter: saturate(1.1); }

.status {
  position: absolute; top: 14px; left: 14px;
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 5px 10px;
  border-radius: 100px;
  border: 1px solid var(--line-strong);
  backdrop-filter: blur(8px);
  background: rgba(7, 9, 15, 0.7);
}
.status-live { color: var(--accent); border-color: rgba(92, 247, 208, 0.4); }
.status-build { color: var(--accent-2); border-color: rgba(122, 162, 255, 0.4); }
.status-plan { color: var(--accent-warm); border-color: rgba(255, 178, 122, 0.4); }

.project-body { padding: clamp(24px, 3vw, 36px); }
.project-tag {
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: 0.16em;
  color: var(--text-dim);
  margin-bottom: 12px;
}
.project h3 {
  font-family: var(--font-display);
  font-size: clamp(22px, 2.4vw, 30px);
  line-height: 1.15;
  letter-spacing: -0.01em;
  font-weight: 600;
  margin-bottom: 8px;
}
.project-tagline {
  color: var(--accent);
  font-size: 15px;
  margin-bottom: 16px;
  font-weight: 500;
}
.project-body > p { color: var(--text-mute); margin-bottom: 18px; font-size: 15px; }

.project-bullets {
  list-style: none;
  margin: 0 0 22px;
  padding: 0;
  display: grid;
  gap: 10px;
}
.project-bullets li {
  position: relative;
  padding-left: 22px;
  color: var(--text-mute);
  font-size: 14.5px;
}
.project-bullets li::before {
  content: '▸';
  position: absolute; left: 4px; top: 0;
  color: var(--accent);
  font-size: 12px;
}
.project-bullets strong { color: var(--text); }

.project-stack {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.project-stack span {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 4px;
  background: rgba(255,255,255,0.04);
  color: var(--text-mute);
  border: 1px solid var(--line);
}

/* Stack-card variant for infrastructure project */
.project-media-stack {
  aspect-ratio: auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  padding: 28px;
  background:
    linear-gradient(135deg, rgba(92, 247, 208, 0.06), rgba(122, 162, 255, 0.06)),
    var(--bg-elev);
}
.stack-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(7, 9, 15, 0.5);
  backdrop-filter: blur(6px);
}
.stack-card h4 {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--accent);
}
.stack-card p {
  font-size: 13px;
  color: var(--text-mute);
  line-height: 1.5;
}

/* ===== Stack section ===== */
.stack { background: linear-gradient(180deg, transparent, rgba(7, 9, 15, 0.6), transparent); }
.stack-grid {
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 28px;
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
/* reveal disabled — content always visible */
@media (max-width: 900px) { .stack-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .stack-grid { grid-template-columns: 1fr; } }

.stack-col {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-card);
}
.stack-col h4 {
  font-family: var(--font-display);
  font-size: 14px; font-weight: 600;
  color: var(--accent);
  margin-bottom: 14px;
  letter-spacing: 0.02em;
}
.stack-col ul { list-style: none; display: grid; gap: 8px; }
.stack-col li {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-mute);
  padding-left: 14px;
  position: relative;
}
.stack-col li::before {
  content: '·';
  position: absolute; left: 0;
  color: var(--accent);
}

/* ===== Contact ===== */
.contact {
  text-align: center;
  background:
    radial-gradient(ellipse at center, rgba(92, 247, 208, 0.06), transparent 60%),
    var(--bg);
}
.contact-inner {
  max-width: 720px;
  margin: 0 auto;
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
/* reveal disabled — content always visible */
.contact h2 { margin-bottom: 18px; }
.contact p { color: var(--text-mute); font-size: 17px; margin-bottom: 32px; }

/* ===== Footer ===== */
.site-footer {
  padding: 36px var(--pad-x);
  border-top: 1px solid var(--line);
  text-align: center;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
  letter-spacing: 0.04em;
}

/* ===== CJK polish ===== */
:lang(zh), .hero-meta span:nth-child(3), .site-footer p {
  font-family: var(--font-body), var(--font-cjk);
}

/* ===== Orchestration Pillar ===== */
.orchestration {
  padding: 100px var(--pad-x) 80px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(ellipse 60% 50% at 50% 0%, rgba(92, 247, 208, 0.05), transparent 70%),
    radial-gradient(ellipse 60% 50% at 50% 100%, rgba(122, 162, 255, 0.04), transparent 70%);
}
.orch-inner {
  max-width: 1200px;
  margin: 0 auto;
}
.orch-headline {
  font-family: var(--font-display);
  font-size: clamp(32px, 4.2vw, 52px);
  line-height: 1.08;
  letter-spacing: -0.015em;
  margin: 14px 0 22px;
  max-width: 22ch;
}
.orch-headline .accent {
  color: var(--accent);
  display: block;
}
.orch-lede {
  font-size: 18px;
  line-height: 1.6;
  color: var(--text-mute);
  max-width: 70ch;
  margin-bottom: 56px;
}

.vendor-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 56px;
}
@media (max-width: 1000px) {
  .vendor-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .vendor-grid { grid-template-columns: 1fr; }
}
.vendor-card {
  position: relative;
  padding: 24px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 14px;
  transition: border-color 0.2s, transform 0.2s;
}
.vendor-card:hover {
  border-color: rgba(92, 247, 208, 0.35);
  transform: translateY(-2px);
}
.vendor-role {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 12px;
}
.vendor-card h3 {
  font-family: var(--font-display);
  font-size: 22px;
  line-height: 1.2;
  margin: 0 0 12px;
  letter-spacing: -0.01em;
}
.vendor-card p {
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--text-mute);
  margin: 0;
}
.vendor-tag {
  display: inline-block;
  padding: 2px 8px;
  margin-left: 8px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--accent-2);
  background: rgba(122, 162, 255, 0.08);
  border: 1px solid rgba(122, 162, 255, 0.32);
  border-radius: 999px;
  vertical-align: middle;
  text-transform: uppercase;
}
.vendor-card-control {
  background:
    linear-gradient(180deg, rgba(92, 247, 208, 0.06), rgba(92, 247, 208, 0)) ,
    var(--bg-elev);
  border-color: rgba(92, 247, 208, 0.4);
}
.vendor-card-control h3 { color: var(--accent); }

.orch-pillars {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px 32px;
  border-top: 1px solid var(--line);
  padding-top: 40px;
}
@media (max-width: 720px) {
  .orch-pillars { grid-template-columns: 1fr; }
}
.orch-pillars li {
  display: flex;
  align-items: baseline;
  gap: 14px;
  font-size: 15.5px;
  line-height: 1.55;
  color: var(--text-mute);
}
.orch-pillars li strong {
  color: var(--text);
  margin-right: 6px;
}
.pillar-num {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--accent);
  flex-shrink: 0;
  min-width: 24px;
}

/* ===== Orchestration Cover Image ===== */
.orch-cover {
  margin: 0 0 56px;
  padding: 0;
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  box-shadow: 0 30px 80px -30px rgba(92, 247, 208, 0.18),
              0 10px 40px -10px rgba(0, 0, 0, 0.5);
}
.orch-cover img {
  display: block;
  width: 100%;
  height: auto;
}
.orch-cover figcaption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 18px 24px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.05em;
  color: var(--text);
  text-align: center;
  background: linear-gradient(180deg, rgba(7, 9, 15, 0) 0%, rgba(7, 9, 15, 0.85) 60%, rgba(7, 9, 15, 0.95) 100%);
  backdrop-filter: blur(2px);
}
@media (max-width: 640px) {
  .orch-cover figcaption { font-size: 11px; padding: 14px 16px; }
}

/* ============================================
   Upgrade 01 · Code-built architecture diagram
   ============================================ */
.arch-diagram {
  margin: 24px 0 36px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(180deg, #0a0f1c 0%, #070a13 100%);
  overflow: hidden;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.04) inset,
    0 30px 60px -30px rgba(0,0,0,0.6),
    0 0 60px -20px rgba(92, 247, 208, 0.10);
}
.arch-meta {
  display: flex; gap: 18px;
  flex-wrap: wrap;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,0.015);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.02em;
}
.arch-meta span:first-child { color: var(--accent); }
.arch-svg {
  width: 100%;
  height: auto;
  display: block;
  min-width: 760px;
}
.arch-svg-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.arch-svg-wrap::-webkit-scrollbar { height: 6px; }
.arch-svg-wrap::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 3px; }
@media (max-width: 760px) {
  .arch-svg { min-width: 760px; }
  .arch-svg-wrap { border-bottom: 1px solid var(--line); }
}
.arch-svg .zone-label {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.arch-svg .node-title {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  fill: #e8edf5;
}
.arch-svg .node-meta,
.arch-svg .edge-label {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px;
  fill: #6b7795;
  letter-spacing: 0.02em;
}
.arch-svg .plane-label {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10.5px;
  fill: #5cf7d0;
  letter-spacing: 0.08em;
}
.arch-svg .plane-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 17px;
  font-weight: 600;
  fill: #e8edf5;
}
.arch-svg .plane-spec {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10.5px;
  fill: #9aa6bd;
}
.arch-diagram figcaption {
  display: flex; gap: 14px; align-items: baseline;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--text-mute);
}
.cap-mono {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 0.08em;
}

/* ============================================
   Upgrade 03 · Governance artifact cards
   ============================================ */
.gov-section { margin-top: 56px; }
.gov-eyebrow { color: var(--accent-2); margin-bottom: 18px; }
.gov-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
@media (max-width: 880px) {
  .gov-grid { grid-template-columns: 1fr; }
}
.gov-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: linear-gradient(180deg, #0d1320 0%, #0a0f1a 100%);
  overflow: hidden;
  transition: border-color 0.3s var(--ease), transform 0.3s var(--ease);
}
.gov-card:hover {
  border-color: rgba(92, 247, 208, 0.3);
  transform: translateY(-2px);
}
.gov-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  align-items: start;
}
.gov-num {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent);
  background: rgba(92, 247, 208, 0.08);
  border: 1px solid rgba(92, 247, 208, 0.2);
  border-radius: 5px;
  padding: 4px 8px;
  height: fit-content;
  letter-spacing: 0.04em;
}
.gov-head h3 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text);
}
.gov-sub {
  font-size: 13px;
  color: var(--text-mute);
  line-height: 1.5;
}
.gov-tag {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--accent-2);
  background: rgba(122, 162, 255, 0.08);
  border: 1px solid rgba(122, 162, 255, 0.2);
  border-radius: 5px;
  padding: 4px 8px;
  height: fit-content;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.gov-code {
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.65;
  color: var(--text);
  padding: 14px 18px;
  margin: 0;
  background: rgba(0, 0, 0, 0.25);
  white-space: pre;
  overflow-x: auto;
  letter-spacing: 0;
  tab-size: 2;
}
.gov-code .c-key { color: #7aa2ff; }
.gov-code .c-str { color: #5cf7d0; }
.gov-code .c-num { color: #ffb27a; }
.gov-code .c-cmt { color: #4a5572; font-style: italic; }
.gov-code::-webkit-scrollbar { height: 4px; }
.gov-code::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

/* ============================================
   Upgrade 04 · Mono structural elements on cards
   ============================================ */
.project-stack span {
  font-family: var(--font-mono) !important;
  font-size: 10.5px !important;
  letter-spacing: 0 !important;
}
.status {
  font-family: var(--font-mono) !important;
  font-size: 10.5px !important;
  letter-spacing: 0.02em !important;
  font-feature-settings: 'tnum' 1;
}
.section-eyebrow,
.project-tag,
.project-group-label,
.vendor-role,
.stat-label {
  font-feature-settings: 'tnum' 1;
}

/* Hide the now-redundant orchestration cover image styles if any leak */
.orch-cover { display: none !important; }

/* ============================================
   Loom Interactive Demo
   ============================================ */
.loom-demo {
  padding: clamp(60px, 8vw, 110px) clamp(20px, 4vw, 64px);
  max-width: 1320px;
  margin: 0 auto;
}
.loom-demo-head {
  max-width: 760px;
  margin-bottom: 44px;
}
.loom-demo-head h2 {
  font-family: var(--font-display);
  font-size: clamp(32px, 4.4vw, 52px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 8px 0 18px;
  color: var(--text);
}
.loom-demo-head .accent {
  color: var(--accent);
}
.loom-demo-head .section-sub {
  color: var(--text-mute);
  font-size: clamp(15px, 1.2vw, 17px);
  line-height: 1.6;
  max-width: 680px;
}
.loom-demo-head .section-sub strong {
  color: var(--text);
  font-weight: 600;
}

.loom-stage {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Step ticker */
.loom-ticker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 18px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 12px;
  flex-wrap: wrap;
}
.loom-ticker-progress {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  flex: 1;
  min-width: 0;
}
.loom-step {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,0.02);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  transition: all 0.35s ease;
  white-space: nowrap;
}
.loom-step-num {
  color: var(--text-dim);
  font-feature-settings: 'tnum' 1;
}
.loom-step-name {
  color: var(--text-mute);
  letter-spacing: 0.02em;
}
.loom-step.active {
  border-color: var(--accent);
  background: rgba(92,247,208,0.08);
  box-shadow: 0 0 0 1px rgba(92,247,208,0.4), 0 0 24px rgba(92,247,208,0.15);
}
.loom-step.active .loom-step-num {
  color: var(--accent);
}
.loom-step.active .loom-step-name {
  color: var(--text);
}
.loom-step.done {
  border-color: rgba(92,247,208,0.3);
}
.loom-step.done .loom-step-num,
.loom-step.done .loom-step-name {
  color: var(--text-mute);
}

.loom-controls {
  display: flex;
  gap: 8px;
}
.loom-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.loom-btn:hover {
  border-color: var(--text-mute);
  background: rgba(255,255,255,0.03);
}
.loom-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.loom-btn-primary {
  border-color: var(--accent);
  color: #07090f;
  background: var(--accent);
}
.loom-btn-primary:hover {
  background: #6dffe0;
  border-color: #6dffe0;
  color: #07090f;
}
.loom-btn-icon {
  font-size: 10px;
}
.loom-btn-label {
  font-weight: 600;
}

/* Diagram + drawer grid */
.loom-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 20px;
  align-items: stretch;
}
.loom-canvas {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px;
  overflow: hidden;
}
.loom-canvas::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(92,247,208,0.04), transparent 60%);
  pointer-events: none;
}
.loom-svg {
  display: block;
  width: 100%;
  height: auto;
  position: relative;
  z-index: 1;
}

/* Nodes */
.loom-node {
  cursor: pointer;
  transition: transform 0.3s ease, filter 0.3s ease;
  transform-box: fill-box;
  transform-origin: center;
}
.loom-node:hover,
.loom-node:focus-visible {
  outline: none;
  filter: brightness(1.15) drop-shadow(0 0 8px rgba(92,247,208,0.3));
}
.loom-node:focus-visible .loom-node-ring,
.loom-node:focus-visible .loom-hub-shape {
  stroke-opacity: 1;
  stroke-width: 3;
}
.loom-node.active .loom-node-ring,
.loom-node.active .loom-hub-shape {
  stroke-opacity: 1;
  stroke-width: 3;
  filter: drop-shadow(0 0 10px currentColor);
}
.loom-node.pulse {
  animation: loom-pulse 0.9s ease-out;
}
@keyframes loom-pulse {
  0% { transform: scale(1); }
  40% { transform: scale(1.06); }
  100% { transform: scale(1); }
}
.loom-node-source {
  cursor: default;
}
.loom-node-source.active rect {
  stroke-opacity: 1;
  filter: drop-shadow(0 0 8px #5cf7d0);
}

/* Wires */
.loom-wire {
  opacity: 0.25;
  transition: opacity 0.5s ease;
}
.loom-wire.active {
  opacity: 1;
  animation: loom-wire-draw 0.9s ease-out;
}
@keyframes loom-wire-draw {
  from { stroke-dashoffset: 600; }
  to { stroke-dashoffset: 0; }
}
.loom-wire.active:not(#loom-wire-persist) {
  stroke-dasharray: 600;
  stroke-dashoffset: 0;
}

/* Chips */
.loom-chip {
  opacity: 0;
  transition: opacity 0.4s ease;
}
.loom-chip.active {
  opacity: 1;
  animation: loom-chip-in 0.4s ease-out;
}
@keyframes loom-chip-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Drawer */
.loom-drawer {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 24px 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.loom-drawer-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 0.04em;
  margin: 0;
  text-transform: lowercase;
}
.loom-drawer-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--text);
}
.loom-drawer-sub {
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-mute);
  margin: 0;
}
.loom-drawer-list {
  list-style: none;
  padding: 0;
  margin: 6px 0 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.loom-drawer-list li {
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text-mute);
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,0.015);
}
.loom-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 1px;
}
.loom-pill-blue { color: #7aa2ff; background: rgba(122,162,255,0.1); border: 1px solid rgba(122,162,255,0.3); }
.loom-pill-teal { color: #3fb8a8; background: rgba(63,184,168,0.1); border: 1px solid rgba(63,184,168,0.3); }
.loom-pill-warm { color: #ffb27a; background: rgba(255,178,122,0.1); border: 1px solid rgba(255,178,122,0.3); }
.loom-pill-mint { color: var(--accent); background: rgba(92,247,208,0.1); border: 1px solid rgba(92,247,208,0.3); }

.loom-drawer-meta {
  margin-top: auto;
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--text-mute);
  white-space: pre-wrap;
  overflow-x: auto;
  display: none;
}
.loom-drawer-meta.show {
  display: block;
}
.loom-drawer-meta .k { color: #7aa2ff; }
.loom-drawer-meta .s { color: #5cf7d0; }
.loom-drawer-meta .n { color: #ffb27a; }

/* Mobile */
@media (max-width: 900px) {
  .loom-grid {
    grid-template-columns: 1fr;
  }
  .loom-ticker {
    flex-direction: column;
    align-items: stretch;
  }
  .loom-controls {
    justify-content: flex-end;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .loom-wire,
  .loom-chip,
  .loom-node,
  .loom-step {
    transition: none !important;
    animation: none !important;
  }
}

/* ============================================
   API Playground
   ============================================ */
.playground {
  padding: clamp(60px, 8vw, 110px) clamp(20px, 4vw, 64px);
  max-width: 1320px;
  margin: 0 auto;
}
.playground-head {
  max-width: 760px;
  margin-bottom: 36px;
}
.playground-head h2 {
  font-family: var(--font-display);
  font-size: clamp(32px, 4.4vw, 52px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 8px 0 18px;
  color: var(--text);
}
.playground-head .accent { color: var(--accent); }
.playground-head .section-sub {
  color: var(--text-mute);
  font-size: clamp(15px, 1.2vw, 17px);
  line-height: 1.6;
  max-width: 720px;
}
.playground-head .section-sub strong {
  color: var(--text);
  font-weight: 600;
}

.pg-stage {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Preset chips row */
.pg-presets {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.pg-presets-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.04em;
  margin-right: 4px;
}
.pg-preset {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text-mute);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: all 0.18s ease;
}
.pg-preset:hover {
  border-color: var(--accent);
  color: var(--text);
  background: rgba(92,247,208,0.04);
  transform: translateY(-1px);
}
.pg-preset:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.pg-preset-icon {
  color: var(--accent);
  font-size: 13px;
}

/* Console */
.pg-console {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Console head bar (terminal title bar) */
.pg-console-head {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 18px;
  background: rgba(255,255,255,0.02);
  border-bottom: 1px solid var(--line);
}
.pg-console-dots {
  display: flex;
  gap: 6px;
}
.pg-console-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text-dim);
  opacity: 0.4;
}
.pg-console-dots span:nth-child(1) { background: #ff5f57; }
.pg-console-dots span:nth-child(2) { background: #febc2e; }
.pg-console-dots span:nth-child(3) { background: #28c840; }
.pg-console-title {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  font-family: var(--font-mono);
  font-size: 12px;
}
.pg-console-method {
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 2px 7px;
  border: 1px solid rgba(92,247,208,0.3);
  border-radius: 4px;
  background: rgba(92,247,208,0.06);
}
.pg-console-path {
  color: var(--text-mute);
}
.pg-console-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.pg-console-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-dim);
  transition: background 0.3s ease, box-shadow 0.3s ease;
}
.pg-console-status[data-state="running"] .pg-console-dot {
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(92,247,208,0.6);
  animation: pg-pulse 1.4s ease-out infinite;
}
.pg-console-status[data-state="done"] .pg-console-dot {
  background: var(--accent);
}
@keyframes pg-pulse {
  0% { box-shadow: 0 0 0 0 rgba(92,247,208,0.5); }
  70% { box-shadow: 0 0 0 8px rgba(92,247,208,0); }
  100% { box-shadow: 0 0 0 0 rgba(92,247,208,0); }
}
.pg-console-status[data-state="running"] .pg-console-status-label,
.pg-console-status[data-state="done"] .pg-console-status-label {
  color: var(--accent);
}

/* Stream area */
.pg-stream {
  min-height: 360px;
  max-height: 540px;
  overflow-y: auto;
  padding: 22px 22px 12px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scroll-behavior: smooth;
}
.pg-stream::-webkit-scrollbar { width: 8px; }
.pg-stream::-webkit-scrollbar-track { background: transparent; }
.pg-stream::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border-radius: 4px;
}

/* Empty state */
.pg-stream-empty {
  margin: auto;
  text-align: center;
  padding: 28px 16px;
  color: var(--text-dim);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.pg-empty-icon {
  color: var(--text-dim);
  opacity: 0.6;
  margin-bottom: 4px;
}
.pg-empty-title {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-mute);
  letter-spacing: 0.02em;
  margin: 0;
}
.pg-empty-sub {
  font-size: 13px;
  line-height: 1.5;
  max-width: 380px;
  margin: 0;
}
.pg-stream.has-content .pg-stream-empty {
  display: none;
}

/* Bubble */
.pg-bubble {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 14px;
  align-items: start;
  opacity: 0;
  transform: translateY(6px);
  animation: pg-bubble-in 0.32s ease-out forwards;
}
.pg-bubble.user {
  grid-template-columns: 1fr 90px;
}
@keyframes pg-bubble-in {
  to { opacity: 1; transform: translateY(0); }
}
.pg-bubble-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding-top: 12px;
  text-align: right;
  color: var(--text-dim);
  display: flex;
  flex-direction: column;
  gap: 3px;
  align-items: flex-end;
}
.pg-bubble.user .pg-bubble-label {
  order: 2;
  text-align: left;
  align-items: flex-start;
}
.pg-bubble-role {
  font-weight: 600;
}
.pg-bubble-time {
  font-size: 9.5px;
  color: var(--text-dim);
  opacity: 0.7;
}
.pg-bubble-body {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text);
  position: relative;
  overflow: hidden;
}
.pg-bubble.user .pg-bubble-body {
  border-color: rgba(92,247,208,0.25);
  background: rgba(92,247,208,0.04);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
}
.pg-bubble[data-agent="brain"] .pg-bubble-role { color: #7aa2ff; }
.pg-bubble[data-agent="brain"] .pg-bubble-body { border-color: rgba(122,162,255,0.25); }
.pg-bubble[data-agent="memory"] .pg-bubble-role { color: #3fb8a8; }
.pg-bubble[data-agent="memory"] .pg-bubble-body { border-color: rgba(63,184,168,0.25); }
.pg-bubble[data-agent="hands"] .pg-bubble-role { color: #ffb27a; }
.pg-bubble[data-agent="hands"] .pg-bubble-body { border-color: rgba(255,178,122,0.25); }
.pg-bubble[data-agent="orchestrator"] .pg-bubble-role { color: var(--accent); }
.pg-bubble[data-agent="orchestrator"] .pg-bubble-body { border-color: rgba(92,247,208,0.3); }
.pg-bubble[data-agent="result"] .pg-bubble-role { color: var(--accent); }
.pg-bubble[data-agent="result"] .pg-bubble-body {
  border-color: rgba(92,247,208,0.4);
  background: linear-gradient(135deg, rgba(92,247,208,0.04), rgba(122,162,255,0.04));
}

/* JSON syntax highlight */
.pg-bubble-body .k { color: #7aa2ff; }
.pg-bubble-body .s { color: var(--accent); }
.pg-bubble-body .n { color: #ffb27a; }
.pg-bubble-body .b { color: #ff7aa2; }
.pg-bubble-body .p { color: var(--text-dim); }
.pg-bubble-body .c { color: var(--text-dim); font-style: italic; }
.pg-bubble-body pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Typing indicator */
.pg-typing {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 16px;
}
.pg-typing span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.4;
  animation: pg-typing-bounce 1.2s ease-in-out infinite;
}
.pg-typing span:nth-child(2) { animation-delay: 0.15s; }
.pg-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes pg-typing-bounce {
  0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-3px); }
}

/* Form */
.pg-form {
  display: flex;
  gap: 10px;
  padding: 14px;
  border-top: 1px solid var(--line);
  background: rgba(255,255,255,0.015);
}
.pg-input-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.pg-input-wrap:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(92,247,208,0.08);
}
.pg-input-prefix {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 14px;
}
.pg-input {
  flex: 1;
  background: transparent;
  border: 0;
  outline: 0;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 13.5px;
  padding: 12px 0;
  width: 100%;
}
.pg-input::placeholder {
  color: var(--text-dim);
}
.pg-submit {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 18px;
  background: var(--accent);
  color: #07090f;
  border: 1px solid var(--accent);
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}
.pg-submit:hover:not(:disabled) {
  background: #6dffe0;
  border-color: #6dffe0;
}
.pg-submit:active:not(:disabled) { transform: scale(0.97); }
.pg-submit:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}
.pg-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.pg-submit-icon { font-size: 14px; }

/* Footer */
.pg-console-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  background: rgba(0,0,0,0.2);
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-dim);
  letter-spacing: 0.02em;
}
.pg-foot-mono {
  color: var(--accent);
  font-weight: 600;
}
.pg-foot-sep { opacity: 0.5; }

/* Mobile */
@media (max-width: 720px) {
  .pg-bubble {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .pg-bubble.user { grid-template-columns: 1fr; }
  .pg-bubble-label {
    flex-direction: row;
    text-align: left;
    align-items: center;
    gap: 8px;
    padding-top: 0;
    justify-content: flex-start;
  }
  .pg-bubble.user .pg-bubble-label { justify-content: flex-start; }
  .pg-form { flex-direction: column; }
  .pg-submit { width: 100%; justify-content: center; padding: 12px 18px; }
  .pg-stream { max-height: 460px; min-height: 280px; padding: 16px 14px 8px; }
  .pg-console-head { flex-wrap: wrap; gap: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .pg-bubble, .pg-typing span, .pg-console-status[data-state="running"] .pg-console-dot {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}
