/* pgrac · Cursor-inspired dark cinematic system */
:root {
  /* Foundation — deep canvas */
  --canvas: #0a0a0a;
  --surface: #111111;
  --surface-2: #161616;
  --surface-3: #1c1c1c;

  /* Ink — light on dark */
  --ink: #f5f5f4;
  --ink-soft: #b3b1a6;
  --ink-muted: #7a7870;
  --ink-faint: #4a4842;

  /* Accent — PG elephant blue, brighter for dark */
  --accent: #5a9fd4;
  --accent-deep: #336791;
  --accent-soft: #7eb5e0;
  --accent-tint: rgba(90, 159, 212, 0.10);
  --accent-glow: rgba(90, 159, 212, 0.30);

  /* Hairlines on dark */
  --hairline: rgba(255, 255, 255, 0.08);
  --hairline-strong: rgba(255, 255, 255, 0.16);
  --hairline-bright: rgba(255, 255, 255, 0.24);

  /* Status */
  --status-target: #5a9fd4;
  --status-measured: #7fb069;
  --status-projected: #d4a574;

  /* Code surface */
  --code-bg: #0d0d0d;
  --code-text: #d4d2c8;
  --code-comment: #6a6860;
  --code-keyword: #c9a878;
  --code-string: #9ec38a;
  --code-var: #e0dccc;
  --code-highlight: #5a9fd4;

  /* Spacing */
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-5: 24px;
  --space-6: 32px; --space-7: 48px; --space-8: 64px; --space-9: 96px; --space-10: 128px;
  --space-11: 160px; --space-12: 200px;

  --radius-1: 3px; --radius-2: 4px; --radius-3: 8px; --radius-4: 12px;

  --font-sans: "Inter", -apple-system, "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --font-display: "Inter", -apple-system, "PingFang SC", sans-serif;

  --content-max: 980px;
  --content-wide: 1320px;
  --content-mega: 1480px;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  font-variation-settings: "opsz" 14;
  font-feature-settings: "cv11" 1, "ss03" 1, "calt" 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

a { color: var(--accent); text-decoration: none; transition: color 150ms ease; }
a:hover { color: var(--accent-soft); }
code, pre, .mono { font-family: var(--font-mono); }

/* Container */
.container { max-width: var(--content-max); margin: 0 auto; padding: 0 var(--space-6); }
.container-wide { max-width: var(--content-wide); margin: 0 auto; padding: 0 var(--space-6); }
.container-mega { max-width: var(--content-mega); margin: 0 auto; padding: 0 var(--space-6); }
@media (max-width: 1024px) { .container, .container-wide, .container-mega { padding: 0 var(--space-5); } }
@media (max-width: 480px) { .container, .container-wide, .container-mega { padding: 0 var(--space-4); } }

/* Type */
.t-mega { font-size: clamp(56px, 9vw, 128px); line-height: 0.95; letter-spacing: -0.04em; font-weight: 500; font-variation-settings: "opsz" 32; }
.t-hero { font-size: clamp(44px, 6.5vw, 88px); line-height: 1.0; letter-spacing: -0.035em; font-weight: 500; font-variation-settings: "opsz" 32; }
.t-display { font-size: clamp(32px, 4.5vw, 56px); line-height: 1.05; letter-spacing: -0.025em; font-weight: 500; font-variation-settings: "opsz" 32; }
.t-h2 { font-size: clamp(28px, 3.6vw, 44px); line-height: 1.1; letter-spacing: -0.02em; font-weight: 500; font-variation-settings: "opsz" 32; }
.t-h3 { font-size: 24px; line-height: 1.25; letter-spacing: -0.01em; font-weight: 500; }
.t-lead { font-size: clamp(18px, 1.5vw, 22px); line-height: 1.5; color: var(--ink-soft); font-weight: 400; }
.t-eyebrow { font-family: var(--font-mono); font-size: 12px; line-height: 1; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-muted); }

.text-balance { text-wrap: balance; }
.text-pretty { text-wrap: pretty; }
.text-grad { background: linear-gradient(180deg, #fff 0%, #b3b1a6 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.text-accent-grad { background: linear-gradient(135deg, #5a9fd4 0%, #c9a878 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: var(--space-2); padding: 12px 22px; border-radius: 999px; font-size: 15px; font-weight: 500; line-height: 1; transition: all 200ms ease; cursor: pointer; border: 1px solid transparent; text-decoration: none !important; }
.btn-primary { background: #fff; color: #0a0a0a; }
.btn-primary:hover { background: var(--accent-soft); color: #0a0a0a; transform: translateY(-1px); }
.btn-secondary { background: rgba(255,255,255,0.06); color: var(--ink); border-color: var(--hairline-strong); backdrop-filter: blur(8px); }
.btn-secondary:hover { background: rgba(255,255,255,0.12); border-color: var(--hairline-bright); color: var(--ink); }
.btn-ghost { background: transparent; color: var(--ink-soft); padding: 8px 0; }
.btn-ghost:hover { color: var(--ink); }
.btn-arrow { transition: transform 200ms ease; }
.btn:hover .btn-arrow { transform: translateX(3px); }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius-3); padding: var(--space-6); transition: border-color 200ms ease, transform 200ms ease, background 200ms ease; }
.card:hover { border-color: var(--hairline-strong); }
.card-glow { position: relative; }
.card-glow::before { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; background: linear-gradient(135deg, var(--accent-glow), transparent 50%); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; opacity: 0; transition: opacity 200ms ease; pointer-events: none; }
.card-glow:hover::before { opacity: 1; }

/* Eyebrow / badge */
.eyebrow { font-family: var(--font-mono); font-size: 12px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-muted); display: inline-flex; align-items: center; gap: 8px; }
.eyebrow-dot::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px var(--accent-glow); }
.eyebrow-accent { color: var(--accent); }

/* Diagram frame on dark */
.diagram-frame { background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius-3); overflow: hidden; }
.diagram-frame .diagram-body { padding: var(--space-6); display: flex; justify-content: center; align-items: center; }
.diagram-frame .diagram-caption { border-top: 1px solid var(--hairline); padding: var(--space-4) var(--space-5); display: flex; gap: var(--space-3); align-items: baseline; }

/* Hairline divider */
.divider { border: none; border-top: 1px solid var(--hairline); margin: var(--space-7) 0; }

.reveal { opacity: 1; }
.reveal-stagger > * { opacity: 1; }
/* (animations removed; reveal is opt-in via .reveal-anim class only) */

/* Glow utility */
.glow-blue { box-shadow: 0 0 80px var(--accent-glow); }

/* Grain overlay (subtle) */
.grain { position: relative; }
.grain::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0.04; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }

/* Animations */
@keyframes flow-dash { to { stroke-dashoffset: -32; } }
@keyframes pulse-soft { 0%, 100% { opacity: 0.4; } 50% { opacity: 1; } }
@keyframes orbit { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes ping { 0% { transform: scale(1); opacity: 1; } 100% { transform: scale(2.4); opacity: 0; } }

.flow-arrow { animation: flow-dash 2s linear infinite; }
.pulse-soft { animation: pulse-soft 2.4s ease-in-out infinite; }
