/* ============================================================
   AzureMods — Design System  "Cyan Depths"
   A single source of truth for color, type, spacing and motion.
   ============================================================ */

/* ---- Design tokens ---------------------------------------- */
:root {
  /* Palette */
  --bg-0:      #060A12;   /* page base — near-black with blue undertone */
  --bg-1:      #0A1120;   /* raised surface */
  --bg-2:      #0F1B30;   /* panels / cards */
  --bg-3:      #16263F;   /* hover surface */
  --line:      #1E3350;   /* hairline borders */

  --cyan:      #22D3EE;   /* primary accent */
  --azure:     #3B82F6;   /* secondary accent */
  --ice:       #7DD3FC;   /* highlight / sheen */
  --deep:      #0EA5E9;   /* mid tone */

  --text:      #E8F0FA;   /* primary text */
  --muted:     #93A7C4;   /* secondary text */
  --faint:     #5B708F;   /* tertiary text */

  --good:      #34D399;
  --warn:      #FBBF24;
  --bad:       #F87171;

  /* Signature gradients / glows */
  --grad-accent: linear-gradient(135deg, var(--cyan) 0%, var(--azure) 100%);
  --grad-sheen:  linear-gradient(135deg, var(--ice) 0%, var(--cyan) 45%, var(--azure) 100%);
  --glow-cyan:   0 0 40px -8px rgba(34, 211, 238, 0.55);
  --glow-azure:  0 0 60px -10px rgba(59, 130, 246, 0.45);

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

  /* Radius & shadow */
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --shadow-1: 0 2px 8px rgba(0,0,0,.3);
  --shadow-2: 0 12px 40px -12px rgba(0,0,0,.6);

  /* Spacing scale */
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
  --sp-5: 24px; --sp-6: 32px; --sp-7: 48px; --sp-8: 64px;
  --sp-9: 96px;

  --container: 1200px;
  --ease: cubic-bezier(.22, 1, .36, 1);
}

/* ---- Light theme override ---------------------------------- */
[data-theme="light"] {
  --bg-0:  #EEF3FA;   /* page base — soft ice blue */
  --bg-1:  #FFFFFF;   /* raised surface */
  --bg-2:  #F5F8FD;   /* panels / cards */
  --bg-3:  #E3ECF7;   /* hover surface */
  --line:  #D2DEEE;   /* hairline borders */

  --cyan:  #0891B2;   /* accents darkened for contrast on light */
  --azure: #2563EB;
  --ice:   #0EA5E9;
  --deep:  #0369A1;

  --text:  #0C1B2E;   /* primary text */
  --muted: #47607E;   /* secondary text */
  --faint: #7089A6;   /* tertiary text */

  --grad-sheen:  linear-gradient(135deg, #0EA5E9 0%, #0891B2 45%, #2563EB 100%);
  --glow-cyan:   0 0 34px -10px rgba(8, 145, 178, 0.35);
  --glow-azure:  0 0 48px -14px rgba(37, 99, 235, 0.28);
  --shadow-1: 0 2px 8px rgba(30,64,120,.10);
  --shadow-2: 0 16px 44px -16px rgba(30,64,120,.24);
}

/* Smooth cross-fade when switching themes */
html.theme-anim,
html.theme-anim body,
html.theme-anim body * {
  transition: background-color .4s ease, border-color .4s ease, color .3s ease !important;
}

/* ---- Reset ------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  background: var(--bg-0);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Ambient aurora — the signature backdrop */
body::before {
  content: "";
  position: fixed;
  inset: -20%;
  z-index: -2;
  background:
    radial-gradient(60% 50% at 15% 0%,  rgba(34,211,238,.10) 0%, transparent 60%),
    radial-gradient(50% 45% at 100% 10%, rgba(59,130,246,.12) 0%, transparent 55%),
    radial-gradient(70% 60% at 50% 120%, rgba(14,165,233,.10) 0%, transparent 60%);
  pointer-events: none;
  animation: aurora-drift 24s ease-in-out infinite alternate;
}
@keyframes aurora-drift {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  50%  { transform: translate3d(2%, 1.5%, 0) scale(1.05); }
  100% { transform: translate3d(-1.5%, -1%, 0) scale(1.02); }
}
@media (prefers-reduced-motion: reduce) { body::before { animation: none; } }

/* Fine grid texture */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(30,51,80,.25) 1px, transparent 1px),
    linear-gradient(90deg, rgba(30,51,80,.25) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(circle at 50% 30%, #000 0%, transparent 75%);
  -webkit-mask-image: radial-gradient(circle at 50% 30%, #000 0%, transparent 75%);
  opacity: .5;
  pointer-events: none;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; background: transparent; border: none; color: inherit; }
input, textarea, select {
  font-family: inherit;
  color: var(--text);
  background-color: var(--bg-1);
  color-scheme: dark;
}
[data-theme="light"] input,
[data-theme="light"] textarea,
[data-theme="light"] select { color-scheme: light; }

/* Autofill: browsers force a white/yellow bg — override it */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
textarea:-webkit-autofill,
select:-webkit-autofill {
  -webkit-text-fill-color: var(--text);
  -webkit-box-shadow: 0 0 0 1000px var(--bg-1) inset;
  caret-color: var(--text);
  transition: background-color 9999s ease-out 0s;
}

/* Native select dropdown arrow tint */
select { cursor: pointer; }

/* ---- Typography ------------------------------------------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.display {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.6rem, 6vw, 5rem);
  letter-spacing: -0.035em;
  line-height: 0.98;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: .74rem;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--cyan);
}

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

.mono { font-family: var(--font-mono); }
.muted { color: var(--muted); }

/* ---- Layout ------------------------------------------------ */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--sp-5);
}

.section { padding-block: var(--sp-9); }

.section-head {
  max-width: 640px;
  margin-bottom: var(--sp-7);
}
.section-head .eyebrow { margin-bottom: var(--sp-3); }
.section-head h2 {
  font-size: clamp(1.9rem, 3.5vw, 3rem);
  margin-bottom: var(--sp-3);
}
.section-head p { color: var(--muted); font-size: 1.05rem; }

/* ---- Buttons ----------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 14px 26px;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  font-weight: 600;
  font-size: .95rem;
  letter-spacing: .01em;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease),
              background .25s var(--ease), border-color .25s var(--ease);
  will-change: transform;
}
.btn:active { transform: translateY(1px) scale(.99); }

.btn-primary {
  position: relative;
  color: #041018;
  background: var(--grad-accent);
  box-shadow: var(--glow-cyan);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--glow-cyan), var(--glow-azure);
}

.btn-ghost {
  color: var(--text);
  background: rgba(125, 211, 252, .04);
  border-color: var(--line);
  backdrop-filter: blur(8px);
}
.btn-ghost:hover {
  border-color: var(--cyan);
  background: rgba(34, 211, 238, .08);
  transform: translateY(-2px);
}

.btn-sm { padding: 9px 16px; font-size: .85rem; border-radius: var(--r-sm); }
.btn-block { width: 100%; justify-content: center; }

/* ---- Glass card ------------------------------------------- */
.card {
  position: relative;
  background: linear-gradient(180deg, rgba(15,27,48,.9), rgba(10,17,32,.9));
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  backdrop-filter: blur(10px);
  overflow: hidden;
}
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(140deg, rgba(125,211,252,.5), transparent 40%);
  -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 .3s var(--ease);
  pointer-events: none;
}
.card:hover::before { opacity: 1; }

/* ---- Utility ----------------------------------------------- */
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: var(--sp-2); } .gap-3 { gap: var(--sp-3); }
.gap-4 { gap: var(--sp-4); } .gap-5 { gap: var(--sp-5); }
.text-center { text-align: center; }
.mt-4 { margin-top: var(--sp-4); } .mt-6 { margin-top: var(--sp-6); }
.hidden { display: none !important; }

/* Focus visibility for keyboard users */
:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---- Light theme: soften ambient layers & fix dark surfaces */
[data-theme="light"] body::before {
  background:
    radial-gradient(60% 50% at 15% 0%,  rgba(8,145,178,.10) 0%, transparent 60%),
    radial-gradient(50% 45% at 100% 10%, rgba(37,99,235,.10) 0%, transparent 55%),
    radial-gradient(70% 60% at 50% 120%, rgba(14,165,233,.08) 0%, transparent 60%);
}
[data-theme="light"] body::after {
  background-image:
    linear-gradient(rgba(120,150,190,.18) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120,150,190,.18) 1px, transparent 1px);
  opacity: .4;
}
[data-theme="light"] .site-header { background: rgba(255,255,255,.78); }
[data-theme="light"] .card { background: linear-gradient(180deg, rgba(255,255,255,.95), rgba(245,248,253,.95)); }
[data-theme="light"] .btn-primary { color: #FFFFFF; }
[data-theme="light"] .brand-mark { color: #FFFFFF; }
[data-theme="light"] .mod-tag { color: var(--deep); background: rgba(255,255,255,.85); }
[data-theme="light"] .site-footer { background: rgba(245,248,253,.6); }
