/* ============================================================
   Cipherverse — style.css  ·  foundation, tokens, layout, nav

   DESIGN DNA — Cipherverse
   Direction:   Console & Keyline · Build Mode
   Palette:     #000000 ground / #0E0F12 surface / #C6FF35 lime (single accent) /
                #F5F7FA soft-white / #8C93A0 gray / keyline rgba(245,247,250,.08)
   Type:        Space Grotesk (display) / Inter (body) / JetBrains Mono (code-chrome)
   Hero:        Stacked Wordmark — CIPHER / VERSE, decodes on load
   Signature:   The Decode Sequence (scramble → resolve)
   First-timers: (1) The Decode Sequence reveal.  (2) The Step-Log console —
                 the real 3-step build process (share/build/live) rendered as
                 a console readout, reused verbatim between the intro splash
                 and the hero panel instead of decorative filler text.
   ============================================================ */

:root {
  /* Palette — DNA */
  --ground:     #000000;
  --surface:    #0E0F12;   /* lifted panel */
  --surface-2:  #16181D;   /* card / raised */
  --lime:       #C6FF35;   /* the single accent — build / execute */
  --soft:       #F5F7FA;   /* text */
  --muted:      #8C93A0;   /* muted text / gray */
  --line:       rgba(245,247,250,0.08);  /* keyline / grid */
  --line-2:     rgba(245,247,250,0.16);  /* stronger keyline */
  --lime-dim:   rgba(198,255,53,0.14);

  /* Compat aliases (live-preview modal + legacy classes) */
  --bg:         var(--ground);
  --text:       var(--soft);
  --accent:     var(--lime);

  /* Type */
  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-body:    'Inter', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, 'SFMono-Regular', monospace;

  /* Fluid scale */
  --t-xs:   clamp(0.72rem, 0.9vw, 0.78rem);
  --t-sm:   clamp(0.8rem,  1vw,   0.9rem);
  --t-base: clamp(1rem,    1.2vw, 1.075rem);
  --t-lg:   clamp(1.15rem, 1.8vw, 1.4rem);
  --t-xl:   clamp(1.5rem,  3vw,   2.1rem);
  --t-2xl:  clamp(2rem,    4.5vw, 3.25rem);
  --t-3xl:  clamp(2.6rem,  6vw,   4.5rem);
  --t-hero: clamp(3.4rem,  12vw,  10rem);

  /* Spacing */
  --space-xs: 0.5rem;  --space-sm: 1rem;   --space-md: 2rem;
  --space-lg: 4rem;    --space-xl: 7rem;   --space-2xl: 11rem;

  /* Shape (sharp corner language) */
  --radius:    2px;
  --radius-lg: 4px;

  /* Motion */
  --tr:  0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --tr-slow: 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  --nav-h: 76px;   /* sticky header height — excluded from hero centering */

  /* Layout */
  --container: 1200px;
  --gutter: 1.25rem;
}

@media (min-width: 768px)  { :root { --gutter: 2.5rem; } }
@media (min-width: 1024px) { :root { --gutter: 3.5rem; } }
@media (min-width: 1440px) { :root { --gutter: 4.5rem; } }

/* ── Reset ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  background: var(--ground);
  color: var(--soft);
  font-family: var(--font-body);
  font-size: var(--t-base);
  line-height: 1.65;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, iframe, canvas, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ul { list-style: none; }
input, textarea, select { font: inherit; color: inherit; }

::selection { background: var(--lime); color: var(--ground); }

/* ── Baseline grid keyline (Build Mode texture) ─────────── */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 100% 6rem, var(--gutter) 100%;
  opacity: 0.5;
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 12%, #000 88%, transparent);
          mask-image: linear-gradient(180deg, transparent, #000 12%, #000 88%, transparent);
}

/* ── Typography ────────────────────────────────────────── */
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.04; letter-spacing: -0.02em; }
h2 { font-size: var(--t-2xl); }
h3 { font-size: var(--t-lg); letter-spacing: -0.01em; }
p { max-width: 62ch; }
strong { font-weight: 600; color: var(--soft); }
em { font-style: normal; color: var(--lime); }

.mono { font-family: var(--font-mono); font-size: var(--t-sm); letter-spacing: 0.02em; }
.eyebrow {
  font-family: var(--font-mono); font-size: var(--t-sm); font-weight: 500;
  color: var(--lime); text-transform: lowercase; letter-spacing: 0.04em;
  display: inline-flex; align-items: center; gap: 0.55rem;
}
.eyebrow::before { content: ""; width: 1.6rem; height: 1px; background: var(--lime); display: inline-block; }
.eyebrow.mute { color: var(--muted); }
.eyebrow.mute::before { background: var(--muted); }

/* ── Layout ────────────────────────────────────────────── */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); position: relative; z-index: 1; }
main { position: relative; z-index: 1; }
.section { padding-block: clamp(4rem, 10vw, 9rem); position: relative; }
.section--tight { padding-block: clamp(3rem, 6vw, 5rem); }
.section-head { max-width: 44ch; margin-bottom: clamp(2.5rem, 5vw, 4rem); }
.section-head--wide { max-width: none; }
.section-head h2 { margin-top: 1rem; }
.section-head .lead { color: var(--muted); margin-top: 1.25rem; font-size: var(--t-lg); }
.surface { background: var(--surface); }

/* keyline divider */
.keyline { height: 1px; background: var(--line-2); border: 0; }

/* ── Buttons ───────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 0.6rem;
  font-family: var(--font-mono); font-size: var(--t-sm); font-weight: 500;
  padding: 0.85rem 1.5rem; border-radius: var(--radius);
  transition: transform var(--tr), background var(--tr), color var(--tr), border-color var(--tr);
  will-change: transform;
}
.btn-exec { background: var(--lime); color: var(--ground); }
.btn-exec:hover { background: #d4ff5c; }
.btn-line { border: 1px solid var(--line-2); color: var(--soft); }
.btn-line:hover { border-color: var(--lime); color: var(--lime); }
.btn-ghost { color: var(--soft); border: 1px solid var(--line-2); }
.btn-ghost:hover { color: var(--ground); background: var(--lime); border-color: var(--lime); }
.btn-block { width: 100%; justify-content: center; }

/* ── Nav (Console) ─────────────────────────────────────── */
.nav-wrap {
  position: sticky; top: 0; z-index: 200;
  border-bottom: 1px solid transparent;
  transition: background var(--tr), border-color var(--tr), backdrop-filter var(--tr);
}
.nav-wrap.scrolled { background: rgba(0,0,0,0.72); backdrop-filter: blur(14px); border-bottom-color: var(--line); }
.nav { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block: 1.1rem; }
.brand { display: inline-flex; align-items: center; }
.brand-logo { height: 30px; width: auto; display: block; }
.nav-menu { display: flex; align-items: center; gap: 0.4rem; }
.nav-link {
  font-family: var(--font-mono); font-size: var(--t-sm); color: var(--muted);
  padding: 0.5rem 0.85rem; position: relative; transition: color var(--tr);
}
.nav-link::before { content: "/"; color: var(--line-2); margin-right: 0.15rem; }
.nav-link:hover, .nav-link.is-active { color: var(--soft); }
.nav-link.is-active::before { color: var(--lime); }
.nav-cta { margin-left: 0.5rem; }
.nav-toggle { display: none; width: 44px; height: 44px; flex-direction: column; justify-content: center; gap: 5px; }
.nav-toggle span { height: 2px; width: 22px; background: var(--soft); margin-inline: auto; transition: transform var(--tr), opacity var(--tr); }

/* ── Footer (The Stamp) ────────────────────────────────── */
.footer { border-top: 1px solid var(--line); padding-block: clamp(3rem, 6vw, 5rem) 2rem; margin-top: var(--space-xl); }
.footer-grid { display: grid; gap: 2.5rem; grid-template-columns: 1fr; }
.footer-logo { display: inline-block; }
.footer-logo img { height: 56px; width: auto; display: block; }
.footer-tag { color: var(--muted); font-family: var(--font-mono); font-size: var(--t-sm); margin-top: 0.5rem; }
.footer-built { color: var(--muted); margin-top: 1rem; font-size: var(--t-sm); }
.footer-col h3 { font-family: var(--font-mono); font-size: var(--t-xs); text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); margin-bottom: 1rem; }
.footer-col ul { display: grid; gap: 0.6rem; }
.footer-col a { color: var(--soft); font-size: var(--t-sm); transition: color var(--tr); }
.footer-col a:hover { color: var(--lime); }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.footer-bottom p { color: var(--muted); font-family: var(--font-mono); font-size: var(--t-xs); max-width: none; }
.footer-bottom a { color: var(--lime); }

/* ── Sticky mobile CTA bar (conversion) ────────────────── */
.mobile-cta { display: none; }

/* ── Skip link + focus ─────────────────────────────────── */
.skip-link { position: absolute; left: -999px; top: 0; z-index: 400; background: var(--lime); color: var(--ground); padding: 0.75rem 1.25rem; font-family: var(--font-mono); font-size: var(--t-sm); }
.skip-link:focus { left: 0; }
:focus-visible { outline: 2px solid var(--lime); outline-offset: 3px; }

/* ── Alerts ────────────────────────────────────────────── */
.alert { padding: 1rem 1.25rem; border-radius: var(--radius); font-family: var(--font-mono); font-size: var(--t-sm); margin-bottom: 2rem; border: 1px solid var(--line-2); }
.alert-ok  { border-color: var(--lime); color: var(--lime); background: var(--lime-dim); }
.alert-bad { border-color: #ff6b6b; color: #ff8f8f; }
