/* ============================================================================
   Swaccho Khan — base layer
   Design tokens, reset, typography, motion primitives, utilities.
   ========================================================================== */

/* ---------------------------------------------------------------- tokens -- */
:root {
  /* Surfaces — a deep indigo-black rather than a flat grey, so the glass has
     something with hue in it to refract. */
  --ink-950: #030409;
  --ink-900: #06070e;
  --ink-850: #090b14;
  --ink-800: #0c0f1a;
  --ink-750: #111524;
  --ink-700: #161b2d;
  --ink-600: #1e2438;

  /* Type */
  --text-1: #f4f6fd;
  --text-2: #b7bfd6;
  --text-3: #7b849d;
  --text-4: #545c72;

  /* Accents */
  --violet: #7c5cff;
  --violet-soft: #a58cff;
  --cyan: #22d3ee;
  --cyan-soft: #67e8f9;
  --pink: #ff5ea8;
  --amber: #ffb547;

  --accent: var(--violet);
  --accent-2: var(--cyan);

  --grad-primary: linear-gradient(115deg, var(--cyan) 0%, var(--violet) 48%, var(--pink) 100%);
  --grad-soft: linear-gradient(115deg, rgba(34, 211, 238, 0.85), rgba(124, 92, 255, 0.85));
  --grad-text: linear-gradient(105deg, #ffffff 0%, #d7d2ff 34%, #8ee6f7 68%, #ffffff 100%);

  /* Glass */
  --glass-bg: rgba(255, 255, 255, 0.042);
  --glass-bg-strong: rgba(255, 255, 255, 0.068);
  --glass-border: rgba(255, 255, 255, 0.095);
  --glass-border-lit: rgba(255, 255, 255, 0.22);
  --glass-blur: 22px;
  --glass-shadow: 0 24px 60px -22px rgba(0, 0, 0, 0.85), 0 1px 0 0 rgba(255, 255, 255, 0.06) inset;

  /* Typography */
  --font-sans: 'Sora', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-serif: 'Instrument Serif', 'Iowan Old Style', Georgia, 'Times New Roman', serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', 'Cascadia Code', Consolas, monospace;

  /* Rhythm */
  --shell: min(1200px, 100% - 3rem);
  --shell-wide: min(1400px, 100% - 3rem);
  --radius-sm: 10px;
  --radius: 18px;
  --radius-lg: 26px;
  --radius-xl: 34px;

  --section-y: clamp(5rem, 11vh, 9rem);

  /* Motion */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --dur-fast: 180ms;
  --dur: 420ms;
  --dur-slow: 780ms;

  --nav-h: 74px;
}

/* ----------------------------------------------------------------- reset -- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 2rem);
}

body {
  min-height: 100svh;
  background-color: var(--ink-950);
  color: var(--text-2);
  font-family: var(--font-sans);
  font-size: clamp(0.975rem, 0.93rem + 0.22vw, 1.0625rem);
  line-height: 1.72;
  font-weight: 400;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img,
svg,
video,
canvas {
  display: block;
  max-width: 100%;
}

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: none;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

ul,
ol {
  list-style: none;
  padding: 0;
}

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
  border-radius: 4px;
}

::selection {
  background: rgba(124, 92, 255, 0.42);
  color: #fff;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 11px;
  height: 11px;
}
::-webkit-scrollbar-track {
  background: var(--ink-950);
}
::-webkit-scrollbar-thumb {
  background: linear-gradient(var(--violet), var(--cyan));
  border-radius: 99px;
  border: 3px solid var(--ink-950);
}
::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(var(--violet-soft), var(--cyan-soft));
}

/* ------------------------------------------------------------ typography -- */
h1,
h2,
h3,
h4,
h5 {
  color: var(--text-1);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.032em;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.6rem, 1.4rem + 5.4vw, 5.6rem);
  font-weight: 700;
  letter-spacing: -0.045em;
}

h2 {
  font-size: clamp(1.95rem, 1.3rem + 2.7vw, 3.35rem);
  letter-spacing: -0.038em;
}

h3 {
  font-size: clamp(1.25rem, 1.05rem + 0.85vw, 1.6rem);
}

h4 {
  font-size: 1.06rem;
  letter-spacing: -0.02em;
}

p {
  text-wrap: pretty;
}

strong {
  color: var(--text-1);
  font-weight: 600;
}

em {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.13em;
  letter-spacing: -0.01em;
  color: var(--text-1);
}

code,
kbd {
  font-family: var(--font-mono);
  font-size: 0.86em;
}

/* -------------------------------------------------------------- helpers -- */
.shell {
  width: var(--shell);
  margin-inline: auto;
}

.shell-wide {
  width: var(--shell-wide);
  margin-inline: auto;
}

.section {
  padding-block: var(--section-y);
  position: relative;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  font-family: var(--font-mono);
  font-size: 0.685rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-3);
}

.eyebrow::before {
  content: '';
  width: 22px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--cyan));
  flex: none;
}

.eyebrow--plain::before {
  display: none;
}

.lede {
  font-size: clamp(1.02rem, 0.96rem + 0.34vw, 1.2rem);
  line-height: 1.78;
  color: var(--text-2);
  max-width: 62ch;
}

.muted {
  color: var(--text-3);
}

.mono {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.05em;
}

.grad-text {
  background: var(--grad-text);
  background-size: 220% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shimmer 9s linear infinite;
}

.accent-text {
  background: var(--grad-primary);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.serif {
  font-family: var(--font-serif);
  font-weight: 400;
  letter-spacing: -0.015em;
}

.section-head {
  max-width: 68ch;
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
}

.section-head h2 {
  margin-top: 0.9rem;
}

.section-head p {
  margin-top: 1.1rem;
}

.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: 0.75rem;
  left: 0.75rem;
  z-index: 400;
  padding: 0.7rem 1.15rem;
  border-radius: var(--radius-sm);
  background: var(--ink-700);
  color: var(--text-1);
  border: 1px solid var(--glass-border-lit);
  transform: translateY(-160%);
  transition: transform var(--dur) var(--ease-out);
}

.skip-link:focus-visible {
  transform: translateY(0);
}

/* ------------------------------------------------------------ ambience --- */
/* Aurora field + film grain live behind everything and never intercept input. */
.ambience {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  overflow: hidden;
  background:
    radial-gradient(120% 80% at 50% -10%, rgba(124, 92, 255, 0.16), transparent 60%),
    radial-gradient(90% 60% at 100% 10%, rgba(34, 211, 238, 0.1), transparent 55%),
    var(--ink-950);
}

.ambience__blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.4;
  will-change: transform;
}

.ambience__blob--1 {
  width: 46vw;
  height: 46vw;
  top: -12vw;
  left: -8vw;
  background: radial-gradient(circle, rgba(124, 92, 255, 0.55), transparent 68%);
  animation: drift-a 26s var(--ease-in-out) infinite;
}

.ambience__blob--2 {
  width: 38vw;
  height: 38vw;
  top: 32vh;
  right: -10vw;
  background: radial-gradient(circle, rgba(34, 211, 238, 0.4), transparent 68%);
  animation: drift-b 32s var(--ease-in-out) infinite;
}

.ambience__blob--3 {
  width: 34vw;
  height: 34vw;
  bottom: -12vw;
  left: 22vw;
  background: radial-gradient(circle, rgba(255, 94, 168, 0.28), transparent 70%);
  animation: drift-c 38s var(--ease-in-out) infinite;
}

.ambience__grid {
  position: absolute;
  inset: -50%;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.028) 1px, transparent 1px);
  background-size: 62px 62px;
  mask-image: radial-gradient(ellipse 60% 50% at 50% 40%, #000 20%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 60% 50% at 50% 40%, #000 20%, transparent 78%);
  transform: perspective(600px) rotateX(58deg) translateY(-8%);
  opacity: 0.7;
}

.grain {
  position: fixed;
  inset: -200%;
  z-index: -1;
  pointer-events: none;
  opacity: 0.032;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 220 220' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain-shift 700ms steps(4) infinite;
}

/* --------------------------------------------------------------- motion -- */
@keyframes shimmer {
  to {
    background-position: 220% center;
  }
}

@keyframes drift-a {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(9vw, 7vh, 0) scale(1.16); }
}

@keyframes drift-b {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1.08); }
  50% { transform: translate3d(-11vw, -9vh, 0) scale(0.92); }
}

@keyframes drift-c {
  0%, 100% { transform: translate3d(0, 0, 0) scale(0.94); }
  50% { transform: translate3d(7vw, -8vh, 0) scale(1.2); }
}

@keyframes grain-shift {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-2%, 3%); }
  50% { transform: translate(3%, -2%); }
  75% { transform: translate(-3%, -3%); }
  100% { transform: translate(2%, 2%); }
}

@keyframes float-y {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-11px); }
}

@keyframes pulse-ring {
  0% { transform: scale(0.85); opacity: 0.85; }
  70% { transform: scale(1.9); opacity: 0; }
  100% { transform: scale(1.9); opacity: 0; }
}

@keyframes spin-slow {
  to { transform: rotate(360deg); }
}

@keyframes blink {
  0%, 45% { opacity: 1; }
  50%, 95% { opacity: 0; }
  100% { opacity: 1; }
}

@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

@keyframes scan-down {
  0% { transform: translateY(-100%); opacity: 0; }
  40% { opacity: 1; }
  100% { transform: translateY(400%); opacity: 0; }
}

@keyframes rise-in {
  from { opacity: 0; transform: translateY(26px); }
  to { opacity: 1; transform: none; }
}

/* --------------------------------------------------- scroll reveal system -- */
[data-reveal] {
  opacity: 0;
  transform: translateY(30px);
  transition:
    opacity 900ms var(--ease-out),
    transform 900ms var(--ease-out);
  transition-delay: calc(var(--i, 0) * 85ms);
  will-change: opacity, transform;
}

[data-reveal='left'] { transform: translateX(-38px); }
[data-reveal='right'] { transform: translateX(38px); }
[data-reveal='scale'] { transform: scale(0.94); }
[data-reveal='blur'] { filter: blur(9px); transform: translateY(20px); }

[data-reveal].is-visible {
  opacity: 1;
  transform: none;
  filter: none;
}

/* Character-level reveal used on the hero name. */
.split-char {
  display: inline-block;
  opacity: 0;
  transform: translateY(0.55em) rotateX(-55deg);
  transform-origin: 50% 100%;
  animation: char-in 900ms var(--ease-out) forwards;
  animation-delay: calc(var(--ci) * 34ms + 150ms);
}

@keyframes char-in {
  to {
    opacity: 1;
    transform: none;
  }
}

/* ------------------------------------------------------ reduced motion --- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  [data-reveal],
  .split-char {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
  }

  .grain,
  .ambience__blob {
    animation: none;
  }

  .cursor,
  .cursor__ring {
    display: none !important;
  }
}
