/* GStrain Design Tokens
   Aesthetic: Institutional-Aerospace. Dark-first with green/blue dualism.
*/

:root {
  /* ── Core palette ── */
  --gs-ink-900: #060C18;      /* deepest space */
  --gs-ink-800: #0A1628;      /* primary dark */
  --gs-ink-700: #0F2540;
  --gs-ink-600: #162E4A;
  --gs-ink-500: #1C3656;
  --gs-ink-400: #2A4A72;
  --gs-ink-300: #4A6B93;

  --gs-paper:   #F4F2EC;       /* warm off-white */
  --gs-paper-2: #E9E6DD;
  --gs-paper-3: #D8D4C8;

  --gs-graphite: #1C2430;
  --gs-warm-grey-600: #6B7280;
  --gs-warm-grey-400: #9CA3AF;
  --gs-warm-grey-200: #D1D5DB;

  /* Brand from logo */
  --gs-blue:   #1FA3E0;
  --gs-blue-2: #0C7FC4;
  --gs-blue-3: #064A7D;
  --gs-green:   #3DB87A;
  --gs-green-2: #1F8B54;
  --gs-green-3: #0E5A33;

  /* Signal accents */
  --gs-lime:   #C5F04A;
  --gs-amber:  #F5B642;

  /* Semantic */
  --bg:           var(--gs-ink-800);
  --bg-elev:      var(--gs-ink-700);
  --bg-elev-2:    var(--gs-ink-600);
  --surface:      #0D1C32;
  --fg:           #E8ECF2;
  --fg-muted:     #9AA6B8;
  --fg-dim:       #5F6E85;
  --line:         rgba(255,255,255,0.08);
  --line-strong:  rgba(255,255,255,0.18);
  --accent:       var(--gs-blue);
  --accent-2:     var(--gs-green);
  --signal:       var(--gs-lime);

  /* Type */
  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-body:    'Inter Tight', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, 'SF Mono', monospace;
}

/* ── Typography variants (switched via Tweaks) — high specificity ── */
html[data-type="grotesk"] {
  --font-display: 'Space Grotesk', system-ui, sans-serif !important;
  --font-body:    'Inter Tight', system-ui, sans-serif !important;
}
html[data-type="mono"] {
  --font-display: 'JetBrains Mono', ui-monospace, monospace !important;
  --font-body:    'Inter Tight', system-ui, sans-serif !important;
}
html[data-type="mono"] h1, html[data-type="mono"] h2, html[data-type="mono"] h3, html[data-type="mono"] h4 {
  letter-spacing: -0.06em !important;
  font-weight: 500;
}
html[data-type="serif"] {
  --font-display: 'Instrument Serif', 'Times New Roman', serif !important;
  --font-body:    'Inter Tight', system-ui, sans-serif !important;
}
html[data-type="serif"] h1, html[data-type="serif"] h2, html[data-type="serif"] h3, html[data-type="serif"] h4 {
  letter-spacing: -0.02em !important;
  font-weight: 400;
}
html[data-type="serif"] h1 em, html[data-type="serif"] h2 em {
  font-style: italic;
}
html[data-type="space-mixed"] {
  --font-display: 'Syne', system-ui, sans-serif !important;
  --font-body:    'Inter Tight', system-ui, sans-serif !important;
}
html[data-type="space-mixed"] h1, html[data-type="space-mixed"] h2 {
  letter-spacing: -0.04em !important;
  font-weight: 600;
}

:root {
  /* Rhythm */
  --r-0: 0px;
  --r-1: 2px;
  --r-2: 4px;
  --r-3: 8px;
  --r-4: 12px;
  --r-5: 16px;

  /* Easing */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}

[data-theme="light"] {
  --bg:        var(--gs-paper);
  --bg-elev:   #FFFFFF;
  --bg-elev-2: var(--gs-paper-2);
  --surface:   #FFFFFF;
  --fg:        var(--gs-ink-900);
  --fg-muted:  #445066;
  --fg-dim:    #8A94A6;
  --line:      rgba(10,22,40,0.10);
  --line-strong: rgba(10,22,40,0.22);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--fg);
  font-feature-settings: 'ss01', 'cv11';
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 { text-wrap: balance; }

/* ── Typography classes ── */
.t-display {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 0.92;
}
.t-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-muted);
  font-weight: 500;
}
.t-mono {
  font-family: var(--font-mono);
  font-feature-settings: 'tnum', 'ss01';
}
.t-number {
  font-family: var(--font-display);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.04em;
}

/* Technical readout element */
.readout {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-dim);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.readout::before {
  content: '';
  width: 6px; height: 6px;
  background: var(--accent-2);
  border-radius: 1px;
  display: inline-block;
}

/* Placeholder stripe */
.placeholder {
  background-image: repeating-linear-gradient(
    135deg,
    rgba(255,255,255,0.02) 0 6px,
    rgba(255,255,255,0.055) 6px 7px
  );
  border: 1px solid var(--line);
  color: var(--fg-dim);
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.placeholder::before, .placeholder::after {
  content: '';
  position: absolute;
  width: 12px; height: 12px;
  border: 1px solid var(--line-strong);
}
.placeholder::before { top: 8px; left: 8px; border-right: none; border-bottom: none; }
.placeholder::after { bottom: 8px; right: 8px; border-left: none; border-top: none; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px 14px 22px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.005em;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 220ms cubic-bezier(0.32, 0.72, 0, 1);
  text-decoration: none;
  white-space: nowrap;
  position: relative;
}
.btn-primary {
  background: var(--signal);
  color: var(--gs-ink-900);
  border-color: var(--signal);
}
.btn-primary:hover {
  background: #D5F66E;
  transform: translateY(-1px);
}
.btn-primary:active { transform: scale(0.98) translateY(0); }
.btn-ghost:active { transform: scale(0.98); }
.btn-ghost {
  background: transparent;
  color: var(--fg);
  border-color: var(--line-strong);
}
.btn-ghost:hover {
  border-color: var(--fg);
  background: rgba(255,255,255,0.04);
}

/* Legacy arrow span */
.btn .arrow {
  display: inline-block;
  transition: transform 220ms cubic-bezier(0.32,0.72,0,1);
}
.btn:hover .arrow { transform: translateX(4px); }

/* Button-in-Button nested icon ring (soft-skill) */
.btn-arrow-ring {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: rgba(0,0,0,0.14);
  flex-shrink: 0;
  font-size: 13px;
  line-height: 1;
  transition: transform 240ms cubic-bezier(0.32,0.72,0,1);
}
.btn-arrow-ring--ghost {
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--line-strong);
}
.btn:hover .btn-arrow-ring {
  transform: translateX(3px) translateY(-1px) scale(1.08);
}

/* Focus ring */
:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 3px;
}
a:focus-visible, button:focus-visible { border-radius: 2px; }

/* Scrollbar subtle */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover { background: var(--fg-dim); }

/* Selection */
::selection {
  background: var(--signal);
  color: var(--gs-ink-900);
}
