/* Titan Coders — Design Tokens, Reset, Typography */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* Backgrounds — --bg-950 matches the hero canvas so sections below it continue
     the same near-black instead of stepping up a shade. */
  --bg-950: #04050a;
  --bg-900: #05060a;
  --bg-800: #0a0c14;
  --bg-700: #10131f;
  --surface-line: rgba(255, 255, 255, 0.08);
  --surface-line-strong: rgba(255, 255, 255, 0.14);

  /* Card surfaces */
  --surface-card: linear-gradient(160deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.012));
  --surface-card-hover: linear-gradient(160deg, rgba(70, 224, 255, 0.07), rgba(124, 92, 255, 0.04));
  --surface-card-line: rgba(255, 255, 255, 0.08);
  --surface-card-line-hover: rgba(70, 224, 255, 0.4);
  --shadow-card: 0 18px 48px rgba(0, 0, 0, 0.34);
  --shadow-card-hover: 0 22px 60px rgba(46, 123, 255, 0.18);

  /* Text */
  --text-hi: #f5f7ff;
  --text-mid: #b9c0d4;
  --text-low: #8a93b0;

  /* Accent */
  --accent-violet: #7c5cff;
  --accent-purple: #a855f7;
  --accent-blue: #2e7bff;
  --accent-blue-soft: #4f7dff;
  --accent-pink: #ff6ec7;
  --accent-cyan: #46e0ff;
  --grad-core: linear-gradient(120deg, #7c5cff 0%, #2e7bff 45%, #ff6ec7 100%);
  /* Hero headline gradient — the brand's primary accent language */
  --grad-brand: linear-gradient(96deg, #46e0ff 0%, #4f7dff 42%, #a855f7 74%, #ff6ec7 100%);
  --grad-brand-v: linear-gradient(180deg, #46e0ff 0%, #4f7dff 42%, #a855f7 74%, #ff6ec7 100%);

  /* Functional */
  --ok: #35d399;
  --warn: #ffc24b;
  --err: #ff5d6c;

  /* Spacing (8px base) */
  --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: 192px;

  /* Layout */
  --container: 1440px;
  --gutter: clamp(16px, 4.5vw, 104px);
  --header-h: 80px;
  --header-h-condensed: 64px;

  /* Radii */
  --radius-xs: 10px;
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-pill: 999px;

  /* Typography */
  --font-display: "Sora", system-ui, "Segoe UI", sans-serif;
  --font-body: "Inter", system-ui, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  --fs-hero: clamp(3rem, 9vw, 9.5rem);
  --fs-page: clamp(2rem, 4.2vw, 3.35rem);
  --fs-h2: clamp(1.9rem, 3.4vw, 3.25rem);
  --fs-h3: clamp(1.35rem, 2vw, 1.75rem);
  --fs-body: clamp(1rem, 1.05vw, 1.125rem);
  --fs-label: 0.8125rem;

  /* Motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-xs: 0.2s;
  --dur-sm: 0.4s;
  --dur-md: 0.6s;
  --dur-lg: 0.9s;
  --dur-xl: 1.4s;

  /* Z-index */
  --z-base: 1;
  --z-content: 10;
  --z-nav: 100;
  --z-overlay: 200;
  --z-cursor: 300;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: auto;
}

html.lenis,
html.lenis body {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

.lenis.lenis-smooth [data-lenis-prevent] {
  overscroll-behavior: contain;
}

.lenis.lenis-stopped {
  overflow: hidden;
}

body {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.65;
  color: var(--text-mid);
  background: var(--bg-900);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  min-height: 100svh;
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

ul,
ol {
  list-style: none;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-display);
  color: var(--text-hi);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.04em;
}

h1 {
  font-size: var(--fs-hero);
  line-height: 0.95;
  font-weight: 800;
}

h2 {
  font-size: var(--fs-h2);
}

h3 {
  font-size: var(--fs-h3);
}

p {
  max-width: 70ch;
}

.label,
.mono {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-low);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  z-index: calc(var(--z-cursor) + 1);
  padding: var(--space-3) var(--space-5);
  background: var(--text-hi);
  color: var(--bg-900);
  font-weight: 600;
  border-radius: 4px;
}

.skip-link:focus {
  top: var(--space-4);
}

:focus-visible {
  outline: 2px solid var(--accent-cyan);
  outline-offset: 3px;
}

::selection {
  background: rgba(70, 224, 255, 0.28);
  color: var(--text-hi);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  /* Soft reduce: keep ambient brand motion (core / marquee).
     Hard-disable only if html[data-motion="reduce"] is set. */
}

html[data-motion="reduce"] .hero__fallback-core,
html[data-motion="reduce"] .hero__fallback::before,
html[data-motion="reduce"] .nav-overlay::before {
  animation: none !important;
}

/* Progressive enhancement — content always readable before JS */
body:not(.is-ready) .preloader {
  opacity: 1;
}
