/* ============================================================================
   Stryx Skills — Light Mode Editorial WebGL
   Custom CSS for skills.stryxlabs.com
   Distinct from Stryx/Mneme dark cinematic — built for craft-journal feel
   ============================================================================ */

:root {
  /* PALETTE — light editorial cream + ink */
  --paper:        #f5f2ea;   /* cream background */
  --paper-soft:   #ebe7dd;   /* slightly darker for cards */
  --paper-deep:   #dfdacf;   /* deepest tone, for dividers */
  --ink:          #0e0e12;   /* deep almost-black for headlines */
  --ink-soft:     #3a3940;   /* softer ink for body */
  --ink-mute:     #6b6960;   /* muted for labels */
  --ink-faint:    #b6b2a8;   /* faintest, for borders */
  --accent:       #c44d2c;   /* warm clay / terracotta */
  --accent-soft:  #e07b5a;   /* lighter clay for hover */
  --accent-deep:  #8a3219;   /* darker clay for active */
  --gold:         #c9a253;   /* warm gold for special highlights */
  --slate:        #4a5d63;   /* cool complement for secondary */

  /* HAIRLINES & EDGES */
  --hair:         rgba(14, 14, 18, 0.06);
  --hair-strong:  rgba(14, 14, 18, 0.12);
  --hair-deep:    rgba(14, 14, 18, 0.20);

  /* TYPOGRAPHY */
  --sans:   "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --serif:  "Fraunces", Georgia, "Times New Roman", serif;
  --mono:   "JetBrains Mono", "Cascadia Mono", "SF Mono", Consolas, monospace;

  /* MOTION */
  --ease:        cubic-bezier(.16, 1, .3, 1);
  --ease-out:    cubic-bezier(.22, .61, .36, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);

  /* SPACING SCALE (4pt) */
  --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-20: 80px;
  --space-24: 96px;
}

/* ============================================================================
   RESET + BASE
   ============================================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink-soft);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  min-height: 100dvh;
}
body.is-locked { overflow: hidden; height: 100dvh; }
img, svg { display: block; max-width: 100%; }
button {
  font: inherit; cursor: pointer; border: 0; background: none;
  -webkit-tap-highlight-color: transparent;
}
a { color: inherit; text-decoration: none; }
::selection { background: var(--accent); color: var(--paper); }

/* ============================================================================
   WEBGL CANVAS — full-bleed background
   ============================================================================ */
.fx-canvas {
  position: fixed; inset: 0;
  z-index: 0;
  pointer-events: none;
}
.fx-canvas canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

/* Soft warm grain overlay for editorial paper feel */
.fx-grain {
  position: fixed; inset: 0; z-index: 1;
  pointer-events: none;
  opacity: 0.025;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.4 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* Soft vignette (subtle on light bg) */
.fx-vignette {
  position: fixed; inset: 0; z-index: 1;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 50%, rgba(14, 14, 18, 0.04) 100%);
}

/* ============================================================================
   GATE — entry door (light editorial style)
   ============================================================================ */
.gate {
  position: fixed; inset: 0; z-index: 100;
  background: var(--paper);
  display: grid; place-items: center;
  transition: opacity 900ms var(--ease), visibility 0s linear 900ms;
}
.gate.is-open {
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity 900ms var(--ease), visibility 0s linear 900ms;
}
.gate__inner {
  text-align: center;
  max-width: 520px;
  padding: var(--space-8);
}
.gate__loading {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: var(--space-12);
  position: relative;
  display: inline-block;
}
.gate__loading::after {
  content: '';
  position: absolute;
  bottom: -8px; left: 0;
  height: 1px;
  background: var(--accent);
  width: 0;
  animation: load-bar 6s ease-out forwards;
}
@keyframes load-bar {
  from { width: 0; }
  to   { width: 100%; }
}
.gate__mark {
  width: clamp(72px, 10vw, 120px);
  height: auto;
  margin: 0 auto var(--space-8);
  color: var(--accent);
}
.gate__title {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(36px, 4vw, 56px);
  letter-spacing: -0.02em;
  line-height: 1.05;
  color: var(--ink);
  margin-bottom: var(--space-3);
}
.gate__sub {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: var(--space-12);
}
.gate__btns {
  display: flex; gap: var(--space-3);
  justify-content: center;
  flex-wrap: wrap;
}
.gate__btn {
  min-height: 48px;
  padding: 0 var(--space-8);
  border: 1px solid var(--ink);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink);
  background: transparent;
  transition: all 240ms var(--ease);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.gate__btn:hover {
  background: var(--ink); color: var(--paper);
  transform: translateY(-1px);
}
.gate__btn--primary {
  background: var(--ink);
  color: var(--paper);
}
.gate__btn--primary:hover {
  background: var(--accent);
  border-color: var(--accent);
}

/* ============================================================================
   FIXED CHROME — brand top-left, sound top-right, reach right side
   ============================================================================ */
.brand-fixed {
  position: fixed;
  top: var(--space-6); left: var(--space-6);
  z-index: 50;
  display: flex; align-items: center; gap: var(--space-3);
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: 18px;
  letter-spacing: -0.01em;
  color: var(--ink);
  transition: color 240ms var(--ease);
}
.brand-fixed:hover { color: var(--accent); }
.brand-fixed .mark {
  width: 32px; height: 32px;
  color: var(--accent);
}
.brand-fixed em {
  font-style: normal;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

.sound-toggle {
  position: fixed;
  top: var(--space-6); right: var(--space-6);
  z-index: 50;
  display: flex; align-items: center; gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border: 1px solid var(--hair-strong);
  border-radius: 999px;
  background: rgba(245, 242, 234, 0.7);
  backdrop-filter: blur(12px);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-mute);
  cursor: pointer;
  transition: all 240ms var(--ease);
}
.sound-toggle:hover {
  border-color: var(--ink);
  color: var(--ink);
}
.sound-toggle .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--ink-faint);
  transition: background 240ms var(--ease);
}
.sound-toggle.is-on .dot {
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent);
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.6; transform: scale(0.85); }
}

.reach-tab {
  position: fixed;
  top: 50%; right: var(--space-6);
  transform: translateY(-50%) rotate(-90deg) translateY(-50%);
  transform-origin: right center;
  z-index: 50;
  display: flex; align-items: center; gap: var(--space-2);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--ink-mute);
  transition: color 240ms var(--ease);
}
.reach-tab:hover { color: var(--accent); }
.reach-tab .arrow { transform: rotate(90deg); display: inline-block; }

/* SCENE INDICATOR — bottom-left */
.scene-indicator {
  position: fixed;
  bottom: var(--space-6); left: var(--space-6);
  z-index: 50;
  display: flex; align-items: center; gap: var(--space-3);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.scene-indicator .num {
  font-family: var(--serif);
  font-style: italic;
  font-size: 14px;
  letter-spacing: 0;
  color: var(--ink);
}
.scene-indicator .bar {
  position: relative;
  width: 80px; height: 1px;
  background: var(--hair-strong);
  overflow: hidden;
}
.scene-indicator .bar::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--accent);
  width: calc(var(--progress, 0) * 100%);
  transition: width 600ms var(--ease);
}

.scroll-cue {
  position: fixed;
  bottom: var(--space-6); right: var(--space-6);
  z-index: 50;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--ink-mute);
  display: flex; align-items: center; gap: var(--space-2);
  transition: opacity 600ms var(--ease);
}
.scroll-cue.is-hidden { opacity: 0; pointer-events: none; }
.scroll-cue::after {
  content: '↓';
  display: inline-block;
  animation: bounce-y 2s ease-in-out infinite;
}
@keyframes bounce-y {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(4px); }
}

/* ============================================================================
   DECK + SCENES — scroll-snap container
   ============================================================================ */
.deck {
  position: relative;
  z-index: 5;
  scroll-snap-type: y mandatory;
  height: 100dvh;
  overflow-y: scroll;
  scrollbar-width: none;
}
.deck::-webkit-scrollbar { display: none; }

.scene {
  scroll-snap-align: start;
  min-height: 100dvh;
  padding: clamp(80px, 10vh, 140px) clamp(24px, 4vw, 96px);
  display: flex;
  align-items: center;
  position: relative;
}
.scene__inner {
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
}

/* SCENE LABEL — `[ //01 ORIGIN ]` style but light editorial */
.scene__label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: clamp(20px, 2vw, 40px);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--hair-strong);
}
.scene__label .ord {
  color: var(--accent);
  font-weight: 500;
}

/* ============================================================================
   TYPOGRAPHY — DISPLAY + LEDE + BODY
   ============================================================================ */
.display {
  font-family: var(--serif);
  font-weight: 300;
  font-style: normal;
  font-size: clamp(48px, 8vw, 156px);
  line-height: 0.95;
  letter-spacing: -0.03em;
  color: var(--ink);
  text-wrap: balance;
  margin-bottom: clamp(20px, 2vw, 40px);
}
.display em {
  font-style: italic;
  color: var(--accent);
}
.display .light {
  font-weight: 200;
  color: var(--ink-soft);
}

.lede {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(20px, 1.8vw, 32px);
  line-height: 1.4;
  letter-spacing: -0.01em;
  color: var(--ink-soft);
  max-width: 60ch;
  margin-bottom: clamp(24px, 2vw, 48px);
}

.body-text {
  font-family: var(--sans);
  font-size: clamp(15px, 1.05vw, 18px);
  line-height: 1.7;
  color: var(--ink-soft);
  max-width: 65ch;
  margin-bottom: var(--space-4);
}

/* ============================================================================
   CTA BUTTONS
   ============================================================================ */
.cta-row {
  display: flex; gap: var(--space-3);
  flex-wrap: wrap;
  margin-top: clamp(24px, 2vw, 48px);
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  border: 1px solid var(--ink);
  color: var(--ink);
  background: transparent;
  transition: all 240ms var(--ease);
  cursor: pointer;
}
.btn:hover {
  transform: translateY(-1px);
  background: var(--ink);
  color: var(--paper);
}
.btn--primary {
  background: var(--ink);
  color: var(--paper);
}
.btn--primary:hover {
  background: var(--accent);
  border-color: var(--accent);
}
.btn--accent {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--paper);
}
.btn--accent:hover {
  background: var(--accent-deep);
  border-color: var(--accent-deep);
}
.btn .arrow {
  font-size: 14px;
  transition: transform 240ms var(--ease);
}
.btn:hover .arrow {
  transform: translateX(3px);
}

/* ============================================================================
   SKILL GRID — listing all 20 skills on the brand page
   ============================================================================ */
.skill-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: clamp(16px, 1.6vw, 28px);
  margin-top: clamp(40px, 4vw, 80px);
}
.skill-card {
  position: relative;
  padding: clamp(24px, 2vw, 36px);
  background: rgba(245, 242, 234, 0.5);
  backdrop-filter: blur(12px);
  border: 1px solid var(--hair-strong);
  border-radius: 16px;
  transition: all 320ms var(--ease);
  cursor: pointer;
  text-decoration: none;
  display: block;
  overflow: hidden;
}
.skill-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--gold), var(--slate));
  opacity: 0;
  transition: opacity 320ms var(--ease);
}
.skill-card:hover {
  transform: translateY(-4px);
  border-color: var(--ink);
  box-shadow: 0 20px 40px -20px rgba(14, 14, 18, 0.15);
}
.skill-card:hover::before {
  opacity: 1;
}
.skill-card__num {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: var(--space-3);
}
.skill-card__name {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(20px, 1.6vw, 28px);
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: var(--space-2);
}
.skill-card__name em {
  font-style: italic;
  color: var(--accent);
}
.skill-card__desc {
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-soft);
  margin-bottom: var(--space-4);
}
.skill-card__meta {
  display: flex; align-items: center; justify-content: space-between;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-mute);
  padding-top: var(--space-3);
  border-top: 1px solid var(--hair);
}
.skill-card__meta .arrow {
  font-size: 14px;
  transition: transform 240ms var(--ease);
}
.skill-card:hover .skill-card__meta .arrow {
  transform: translateX(4px);
  color: var(--accent);
}

/* ============================================================================
   INSTALL CARD — terminal block for one-liners
   ============================================================================ */
.install-card {
  margin-top: clamp(32px, 3vw, 56px);
  padding: clamp(20px, 2vw, 36px);
  background: var(--ink);
  border-radius: 14px;
  font-family: var(--mono);
  font-size: clamp(12px, 0.95vw, 15px);
  line-height: 1.85;
  color: rgba(245, 242, 234, 0.9);
  overflow-x: auto;
  position: relative;
}
.install-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--gold));
}
.install-card__label {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: var(--space-3);
  display: block;
}
.install-card .pr {
  color: var(--accent-soft);
  user-select: none;
  margin-right: var(--space-2);
}
.install-card .url {
  color: var(--gold);
}
.install-card .arg {
  color: var(--accent-soft);
}

/* ============================================================================
   BACK NAV — for skill detail pages
   ============================================================================ */
.back-nav {
  position: fixed;
  top: var(--space-6);
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  display: flex; align-items: center; gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: rgba(245, 242, 234, 0.85);
  backdrop-filter: blur(16px);
  border: 1px solid var(--hair-strong);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink);
  transition: all 240ms var(--ease);
}
.back-nav:hover {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.back-nav .arrow {
  display: inline-block;
  transition: transform 240ms var(--ease);
}
.back-nav:hover .arrow {
  transform: translateX(-3px);
}

/* ============================================================================
   SECTION FACTS STRIP
   ============================================================================ */
.fact-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: clamp(20px, 2vw, 40px);
  margin-top: clamp(40px, 4vw, 80px);
  padding: clamp(24px, 2vw, 40px) 0;
  border-top: 1px solid var(--hair-strong);
  border-bottom: 1px solid var(--hair-strong);
}
.fact-strip .item .n {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(36px, 4vw, 64px);
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1;
  margin-bottom: var(--space-2);
}
.fact-strip .item .l {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

/* ============================================================================
   FOOTER COPY
   ============================================================================ */
.footer-copy {
  text-align: center;
  margin-top: clamp(40px, 4vw, 80px);
  padding-top: clamp(24px, 2vw, 40px);
  border-top: 1px solid var(--hair);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--ink-mute);
}
.footer-copy a {
  color: var(--ink);
  border-bottom: 1px solid var(--accent);
  transition: color 240ms var(--ease);
}
.footer-copy a:hover { color: var(--accent); }

/* ============================================================================
   CUSTOM CURSOR
   ============================================================================ */
.cursor {
  position: fixed;
  top: 0; left: 0;
  pointer-events: none;
  z-index: 9999;
  mix-blend-mode: multiply;
}
.cursor__dot {
  position: fixed;
  top: 0; left: 0;
  width: 6px; height: 6px;
  background: var(--accent);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  will-change: transform;
  transition: opacity 0.2s ease;
}
.cursor__ring {
  position: fixed;
  top: 0; left: 0;
  width: 36px; height: 36px;
  border: 1px solid var(--ink);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  will-change: transform;
  transition: border-color 0.25s ease, background 0.25s ease, width 0.25s ease, height 0.25s ease;
}
.cursor.is-hover .cursor__ring {
  width: 56px; height: 56px;
  border-color: var(--accent);
  background: rgba(196, 77, 44, 0.08);
}
@media (hover: none), (pointer: coarse) {
  .cursor, .cursor__dot, .cursor__ring { display: none; }
  * { cursor: auto; }
}
@media (hover: hover) and (pointer: fine) {
  * { cursor: none; }
  a, button, .btn, .skill-card { cursor: none; }
}

/* ============================================================================
   ACCESSIBILITY — REDUCED MOTION
   ============================================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .gate__loading::after { width: 100%; animation: none; }
  .scroll-cue { display: none; }
}

/* ============================================================================
   MOBILE
   ============================================================================ */
@media (max-width: 720px) {
  .reach-tab { display: none; }
  .scroll-cue { display: none; }
  .scene {
    padding: var(--space-16) var(--space-4);
  }
  .display {
    font-size: clamp(40px, 12vw, 84px);
  }
  .skill-grid {
    grid-template-columns: 1fr;
  }
  .back-nav {
    top: var(--space-3);
    font-size: 10px;
    padding: var(--space-2) var(--space-3);
  }
}
