/* ==========================================================================
   LocVak — Base design system
   Midnight "studio" canvas, an animated aurora, a single warm signal accent.
   Tokens → background effects → animations → reset → typography → layout.
   ========================================================================== */

:root {
  /* --- Surfaces --- */
  --ink:       #080A0E;   /* deep midnight ink */
  --ink-2:     #0E1117;
  --ink-3:     #151A22;
  --ink-hi:    #20262F;

  --paper:     #F4F2EC;
  --paper-2:   #EAE8DE;
  --paper-ink: #0B0E13;

  /* --- Accent (deliberately used once per viewport) --- */
  --signal:    #FF7E1F;
  --signal-2:  #FFB15C;
  --signal-dk: #3A2410;
  --teal:      #33E3A0;
  --ruby:      #B0654A;

  /* --- Text --- */
  --t-ink:     #F4F2EC;
  --t-ink-2:   #C6CCD3;
  --muted-ink: #9AA3AD;
  --t-paper:   #0B0E13;
  --muted-paper:#5C5C54;

  /* --- UI --- */
  --line-ink:  rgba(255, 255, 255, 0.10);
  --line-paper: rgba(11, 14, 19, 0.10);
  --shadow:    0 30px 80px -24px rgba(0, 0, 0, 0.65);
  --glow:      0 0 44px -6px rgba(255, 126, 31, 0.5);
  --glass:     rgba(255, 255, 255, 0.04);

  /* --- Fonts --- */
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", "Menlo", "Consolas", monospace;

  /* --- Type scale (fifth ~1.333) --- */
  --fs-hero: clamp(2.9rem, 7vw, 6.4rem);
  --fs-h2:   clamp(2rem, 4vw, 3.2rem);
  --fs-h3:   1.42rem;
  --fs-body: 1.125rem;

  --track:   0.01em;
  --maxw:    1180px;
  --gutter:  clamp(1.25rem, 4vw, 2.5rem);
  --pad-y:   clamp(4rem, 9vw, 8.5rem);

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ================= Background effects ================= */
.aurora, .grid-bg, .cursor-glow { position: fixed; inset: 0; pointer-events: none; z-index: 0; }

.aurora {
  background:
    radial-gradient(22% 30% at 20% 18%, rgba(255, 126, 31, 0.20), transparent 60%),
    radial-gradient(26% 34% at 82% 12%, rgba(51, 227, 160, 0.10), transparent 60%),
    radial-gradient(30% 40% at 68% 82%, rgba(255, 126, 31, 0.08), transparent 62%),
    radial-gradient(24% 30% at 14% 84%, rgba(94, 120, 255, 0.08), transparent 60%);
  filter: blur(30px);
  animation: auroraDrift 22s var(--ease) infinite alternate;
}
.grid-bg {
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(80% 60% at 50% 0%, #000 0%, transparent 80%);
}
.cursor-glow {
  position: fixed; height: 620px; width: 620px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,126,31,0.10), transparent 65%);
  transform: translate(-50%, -50%); left: 0; top: 0; opacity: 0; transition: opacity 0.4s var(--ease);
  pointer-events: none; mix-blend-mode: screen;
}
body.has-cursor .cursor-glow { opacity: 1; }

.scroll-progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0%; z-index: 60;
  background: linear-gradient(90deg, var(--signal), var(--signal-2));
  box-shadow: 0 0 18px var(--signal);
}

/* ================= Animations ================= */
@keyframes auroraDrift {
  0%   { transform: translate3d(0,0,0) scale(1); }
  50%  { transform: translate3d(3%, -3%, 0) scale(1.08); }
  100% { transform: translate3d(-2%, 4%, 0) scale(1.02); }
}
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }
@keyframes blink { 50% { opacity: 0; } }
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
@keyframes dash { to { stroke-dashoffset: 0; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }
@keyframes meterFill { from { width: 0; } }
@keyframes glowPulse { 0%,100% { box-shadow: 0 0 0 rgba(255,126,31,0); } 50% { box-shadow: 0 0 26px 2px rgba(255,126,31,0.55); } }

@media (prefers-reduced-motion: reduce) {
  :root { --ease: steps(1); }
  .aurora { animation: none; }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}

/* ================= Reset ================= */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--sans);
  font-size: var(--fs-body);
  line-height: 1.6;
  color: var(--t-ink);
  background: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }
ul, ol { list-style: none; padding: 0; }
h1, h2, h3, h4 { line-height: 1.03; font-weight: 700; letter-spacing: var(--track); }
h1 { font-size: var(--fs-hero); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
p { margin-bottom: 1.1rem; }

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

/* ================= Layout helpers ================= */
.wrap { width: min(100% - 40px, var(--maxw)); margin-inline: auto; position: relative; z-index: 1; }
.section { padding-block: var(--pad-y); position: relative; }
.ink-bg   { background: var(--ink); }
.ink-2-bg { background: var(--ink-2); }
.paper-bg { background: var(--paper); color: var(--t-paper); }
.paper-2-bg { background: var(--paper-2); }
.center { text-align: center; }
.stack { display: grid; gap: clamp(1.4rem, 2.5vw, 2rem); }
.lead { font-size: clamp(1.05rem, 1.6vw, 1.3rem); color: var(--muted-ink); max-width: 60ch; }
.paper-bg .lead, .paper-2-bg .lead { color: var(--muted-paper); }
.grids { display: grid; gap: clamp(1.25rem, 2.5vw, 2rem); }
.cols-2 { grid-template-columns: repeat(2, 1fr); }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 860px) { .cols-3,.cols-4 { grid-template-columns: repeat(2,1fr); } .cols-2 { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .cols-3,.cols-4 { grid-template-columns: 1fr; } }

/* ================= Typography bits ================= */
.grad {
  background: linear-gradient(180deg, #FFFFFF 20%, #B7BCC4 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.paper-bg .grad { background: linear-gradient(180deg, #0B0E13 12%, #3a3f47 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.accent { color: var(--signal); }
.mono { font-family: var(--mono); }
.ey {
  display: inline-flex; align-items: center; gap: 0.6em;
  font-family: var(--mono); font-size: 0.78rem; font-weight: 600;
  letter-spacing: 0.14em; color: var(--signal); margin-bottom: 1.3rem;
}
.ey .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--signal); box-shadow: 0 0 12px var(--signal); animation: pulse 1.6s infinite var(--ease); }
.divider { height: 1px; background: var(--line-ink); border: 0; margin: 0; }
.paper-bg .divider, .paper-2-bg .divider { background: var(--line-paper); }

/* ================= Buttons ================= */
.btn {
  display: inline-flex; align-items: center; gap: 0.55em;
  padding: 0.85em 1.5em; border: 1px solid transparent; border-radius: 999px;
  font-weight: 600; font-size: 1rem; cursor: pointer;
  transition: transform 0.25s var(--ease), background 0.25s var(--ease), border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
  white-space: nowrap;
}
.btn svg { width: 1.05em; height: 1.05em; }
.btn--primary { background: var(--signal); color: #1a0f05; box-shadow: var(--glow); }
.btn--primary:hover { background: var(--signal-2); transform: translateY(-2px); }
.btn--ghost { background: transparent; border-color: var(--line-ink); color: var(--t-ink); }
.btn--ghost:hover { border-color: var(--signal); color: var(--signal); transform: translateY(-2px); }
.btn--paper { background: var(--ink); color: var(--t-ink); }
.btn--paper:hover { background: #1c2129; transform: translateY(-2px); }
.btn--lg { padding: 1em 1.85em; font-size: 1.06rem; }
.btn-block { width: 100%; justify-content: center; }

/* ================= Reveal on scroll ================= */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.reveal[data-delay="1"] { transition-delay: 0.08s; }
.reveal[data-delay="2"] { transition-delay: 0.16s; }
.reveal[data-delay="3"] { transition-delay: 0.24s; }
.reveal[data-delay="4"] { transition-delay: 0.32s; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }

/* ================= Nav ================= */
.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: saturate(140%) blur(14px);
  background: color-mix(in srgb, var(--ink) 82%, transparent);
  border-bottom: 1px solid var(--line-ink);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.mark { display: inline-flex; align-items: center; gap: 0.55rem; font-weight: 800; letter-spacing: -0.025em; font-size: 1.15rem; }
.mark .logomark {
  width: 26px; height: 26px; border-radius: 8px;
  background: radial-gradient(circle at 30% 25%, var(--signal-2), var(--signal) 60%, #b44d08);
  display: grid; place-items: center; color: #1a0f05; font-weight: 900; box-shadow: var(--glow);
}
.nav-links { display: flex; align-items: center; gap: 1.9rem; }
.nav-links a { color: var(--t-ink-2); font-size: 0.98rem; font-weight: 500; transition: color 0.2s var(--ease); }
.nav-links a:hover { color: var(--signal); }
.nav-cta { display: flex; align-items: center; gap: 0.6rem; }
.nav-cta .btn { padding: 0.62em 1.2em; font-size: 0.94rem; }
.hamburger { display: none; background: none; border: 0; color: var(--t-ink); padding: 0.4rem; cursor: pointer; }
.hamburger svg { width: 26px; height: 26px; }
@media (max-width: 900px) {
  .nav-links { display: none; }
  .hamburger { display: inline-flex; }
  .nav-links.open {
    display: flex; flex-direction: column; position: absolute; top: 68px; left: 0; right: 0;
    background: var(--ink-2); border-bottom: 1px solid var(--line-ink);
    padding: 1.2rem var(--gutter); gap: 1.2rem;
  }
}

/* ================= Footer ================= */
.site-footer { background: var(--ink); color: var(--t-ink-2); border-top: 1px solid var(--line-ink); position: relative; z-index: 1; }
.site-footer a { color: var(--t-ink-2); transition: color 0.2s var(--ease); }
.site-footer a:hover { color: var(--signal); }
.foot-grid { display: grid; grid-template-columns: 1.6fr repeat(4, 1fr); gap: 2rem; padding-bottom: 2.5rem; }
.foot-brand .mark { font-weight: 800; letter-spacing: -0.02em; font-size: 1.3rem; }
.foot-col h4 { font-size: 0.82rem; letter-spacing: 0.14em; color: var(--muted-ink); margin-bottom: 0.9rem; font-family: var(--mono); }
.foot-col ul { display: grid; gap: 0.6rem; }
.foot-col a { font-size: 0.95rem; }
.foot-bottom { border-top: 1px solid var(--line-ink); padding-top: 1.5rem; display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; color: var(--muted-ink); font-size: 0.88rem; }

@media (max-width: 860px) { .foot-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .foot-grid { grid-template-columns: 1fr; } }
