/* ============================================================
   PhyCyber Twin — shared design system
   Single source of truth for all secondary pages.
   Mirrors the flagship landing tokens; adds the perception-
   layer palette used by the twin render video.
   ============================================================ */

:root {
  --bg-base:      #0f0f11;
  --bg-surface:   #18181b;
  --bg-elevated:  #1f1f23;
  --bg-border:    #2a2a30;

  --text-primary:   #f4f4f5;
  --text-secondary: #a1a1aa;
  --text-muted:     #71717a;

  --accent:        #f59e0b;
  --accent-hover:  #d97706;
  --accent-subtle: rgba(245,158,11,0.12);

  --cyan:    #06b6d4;
  --cyan-subtle: rgba(6,182,212,0.10);

  /* perception semantic layers — match the twin render video */
  --layer-structure: #f59e0b;
  --layer-vegetation:#4ade80;
  --layer-ground:    #06b6d4;
  --layer-pedestrian:#a855f7;
  --layer-route:     #22c55e;
  --layer-nogo:      #ef4444;

  --font-sans: 'Inter', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --space-1:4px; --space-2:8px; --space-3:12px; --space-4:16px;
  --space-6:24px; --space-8:32px; --space-12:48px; --space-16:64px; --space-24:96px;

  --container-max: 1180px;
  --container-pad: clamp(20px, 5vw, 48px);

  --radius-sm:6px; --radius-md:12px; --radius-lg:20px; --radius-full:9999px;
  --shadow-card: 0 1px 3px rgba(0,0,0,0.4), 0 4px 16px rgba(0,0,0,0.2);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: var(--accent); text-decoration: none; }
img, video { max-width: 100%; display: block; }

.container { max-width: var(--container-max); margin: 0 auto; padding: 0 var(--container-pad); }
.cyan { color: var(--cyan); }
.muted { color: var(--text-secondary); }
.dim { color: var(--text-muted); }
.mono { font-family: var(--font-mono); }

/* ─── NAV ───────────────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(15,15,17,0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--bg-border);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; gap: var(--space-6); }
.nav-logo {
  font-weight: 800; font-size: 1.125rem; color: var(--text-primary);
  letter-spacing: -0.03em; display: flex; align-items: center; gap: 8px; white-space: nowrap;
}
.nav-logo-dot { width: 8px; height: 8px; background: var(--accent); border-radius: 50%; box-shadow: 0 0 10px var(--accent); }
.nav-links { display: flex; gap: var(--space-6); align-items: center; flex-wrap: wrap; }
.nav-links a { color: var(--text-secondary); font-size: 0.875rem; transition: color 0.2s; white-space: nowrap; }
.nav-links a:hover, .nav-links a.active { color: var(--text-primary); }
.nav-cta {
  background: var(--accent); color: #000 !important;
  padding: 6px 16px; border-radius: var(--radius-full);
  font-weight: 700; font-size: 0.875rem; transition: background 0.2s;
}
.nav-cta:hover { background: var(--accent-hover) !important; }

/* ─── HERO / PAGE HEAD ──────────────────────────────── */
.page-head { padding: var(--space-24) 0 var(--space-12); position: relative; overflow: hidden; }
.page-head::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(60% 50% at 50% -10%, rgba(245,158,11,0.10), transparent 70%),
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px) 0 0 / 100% 38px,
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px) 0 0 / 38px 100%;
  -webkit-mask-image: linear-gradient(180deg, #000, transparent 80%);
          mask-image: linear-gradient(180deg, #000, transparent 80%);
}
.badge {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid rgba(245,158,11,0.3); background: var(--accent-subtle);
  color: var(--accent); border-radius: var(--radius-full);
  padding: 6px 14px; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em;
  font-family: var(--font-mono); text-transform: uppercase;
}
.badge-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: pulse 1.8s ease-in-out infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.35} }
h1, .h1 { font-size: clamp(32px, 5vw, 54px); line-height: 1.06; letter-spacing: -0.04em; margin: var(--space-4) 0; }
h1 em, .h1 em { color: var(--accent); font-style: normal; }
.lead { color: var(--text-secondary); font-size: 1.125rem; max-width: 760px; }
.page-head.center { text-align: center; }
.page-head.center .lead { margin-inline: auto; }

/* ─── SECTIONS ──────────────────────────────────────── */
.section { padding: var(--space-16) 0; border-top: 1px solid var(--bg-border); }
.section.surface { background: var(--bg-surface); }
.section-title { font-size: clamp(24px, 3vw, 32px); letter-spacing: -0.03em; margin: 0 0 var(--space-2); }
.section-sub { color: var(--text-secondary); margin: 0 0 var(--space-8); max-width: 760px; }
.eyebrow { font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--cyan); margin-bottom: var(--space-2); }

/* ─── CARDS / GRIDS ─────────────────────────────────── */
.grid { display: grid; gap: var(--space-4); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.card {
  background: var(--bg-surface); border: 1px solid var(--bg-border);
  border-radius: var(--radius-md); padding: var(--space-6);
}
.card h3 { margin: 0 0 var(--space-2); font-size: 1.0625rem; }
.card .muted { font-size: 0.9375rem; }
.step-num { font-family: var(--font-mono); font-size: 0.75rem; font-weight: 700; color: var(--accent); letter-spacing: 0.08em; }

/* ─── BUTTONS ───────────────────────────────────────── */
.btn-primary, .btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: var(--radius-full); padding: 12px 22px; font-weight: 700;
  font-size: 0.9375rem; cursor: pointer; transition: all 0.2s; border: 1px solid transparent;
}
.btn-primary { background: var(--accent); color: #000; }
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--text-primary); border-color: var(--bg-border); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-row { display: flex; gap: var(--space-3); flex-wrap: wrap; }

/* ─── PILLS / TAGS / LEGEND ─────────────────────────── */
.pill, .tag {
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: var(--radius-full); padding: 4px 10px; font-size: 0.75rem;
  font-family: var(--font-mono); margin: 3px 4px 3px 0;
}
.tag { border: 1px solid rgba(6,182,212,0.25); background: var(--cyan-subtle); color: var(--cyan); }
.pill { border: 1px solid var(--bg-border); background: var(--bg-elevated); color: var(--text-secondary); }
.legend { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.legend-item { display: inline-flex; align-items: center; gap: 8px; font-size: 0.8125rem; color: var(--text-secondary); font-family: var(--font-mono); }
.dot { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.dot.structure { background: var(--layer-structure); }
.dot.vegetation { background: var(--layer-vegetation); }
.dot.ground { background: var(--layer-ground); }
.dot.pedestrian { background: var(--layer-pedestrian); }
.dot.route { background: var(--layer-route); }
.dot.nogo { background: var(--layer-nogo); }

/* ─── MEDIA FRAME ───────────────────────────────────── */
.media {
  background: #000; border: 1px solid var(--bg-border);
  border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-card);
}
.media video, .media img { width: 100%; display: block; }
.media-portrait { max-width: 420px; margin: 0 auto; }

/* ─── DELIVERABLE TABLE ─────────────────────────────── */
.deliverables { display: grid; gap: var(--space-3); }
.deliverable {
  display: grid; grid-template-columns: 200px 1fr 230px; gap: var(--space-4);
  align-items: start; background: var(--bg-surface);
  border: 1px solid var(--bg-border); border-radius: var(--radius-md); padding: var(--space-4) var(--space-6);
}
.deliverable strong { display: block; font-size: 1rem; }
.file { font-family: var(--font-mono); color: var(--cyan); font-size: 0.8125rem; word-break: break-all; }
.acceptance { color: var(--text-secondary); font-size: 0.875rem; }

/* ─── DOWNLOAD LIST ─────────────────────────────────── */
.downloads { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-3); }
.download {
  display: block; background: var(--bg-elevated); border: 1px solid var(--bg-border);
  border-radius: var(--radius-md); padding: var(--space-4); color: var(--cyan);
  font-family: var(--font-mono); font-size: 0.875rem; transition: border-color 0.2s;
}
.download:hover { border-color: var(--accent); }
.download span { display: block; color: var(--text-secondary); font-size: 0.8125rem; margin-top: 4px; font-family: var(--font-sans); }

/* ─── NOTE / CALLOUT ────────────────────────────────── */
.note {
  background: linear-gradient(135deg, rgba(245,158,11,0.12), rgba(6,182,212,0.08));
  border: 1px solid rgba(245,158,11,0.25); border-radius: var(--radius-lg);
  padding: var(--space-6); margin-top: var(--space-6);
}
.note b { color: var(--accent); }
.callout { text-align: center; padding: var(--space-12) var(--space-6); }
.quote { font-size: clamp(20px, 2.5vw, 26px); line-height: 1.4; font-weight: 800; letter-spacing: -0.02em; max-width: 820px; margin: 0 auto var(--space-6); }

/* ─── FOOTER ────────────────────────────────────────── */
.footer { border-top: 1px solid var(--bg-border); padding: var(--space-12) 0; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: var(--space-6); flex-wrap: wrap; }
.footer-brand { font-weight: 800; letter-spacing: -0.02em; }
.footer-meta { color: var(--text-muted); font-size: 0.8125rem; }
.footer-links { display: flex; gap: var(--space-6); }
.footer-links a { color: var(--text-secondary); font-size: 0.875rem; }
.footer-links a:hover { color: var(--text-primary); }

/* ─── RESPONSIVE ────────────────────────────────────── */
@media (max-width: 920px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .deliverable { grid-template-columns: 1fr; gap: var(--space-2); }
}
@media (max-width: 640px) {
  .grid-2, .grid-3, .grid-4, .downloads { grid-template-columns: 1fr; }
  .nav-inner { height: auto; flex-direction: column; align-items: flex-start; padding: 14px 0; }
  .nav-links { gap: var(--space-4); }
  .hide-mobile { display: none; }
}
