/* ============================================================
   lakecode design system — site override layer
   Source of truth: ~/Downloads/lakecode Design System (tokens + README).
   Near-monochrome warm green-black; WHITE is the accent (ink on light);
   Inter Tight display + IBM Plex Mono chrome; Pixelon wordmark;
   4px corners, hairlines, no glows. Light is the marketing default;
   dark showpiece bands opt in via data-theme="dark" + .lc-water-surface.
   Loaded after styles.css/pages.css — it remaps the legacy custom
   properties those sheets (and inline styles) consume.
   ============================================================ */

@font-face {
  font-family: "Pixelon";
  src: url("assets/fonts/Pixelon.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* ---- 1 · Tokens ------------------------------------------------ */

:root {
  /* primitives */
  --water-400: #6E7D75;
  --water-500: #515F59;
  --water-800: #27362F;
  --water-850: #1C2A24;
  --water-900: #111A15;
  --water-950: #0A120E;
  --paper: #F6F5F1;
  --ink: #0C140F;
  --white-abs: #FFFFFF;
  --signal-positive: #5F8C72;
  --signal-caution: #A88E5A;
  --signal-critical: #B06A60;
  --signal-info: #6E7D75;

  --font-grotesk: "Inter Tight", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono-ds: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --font-pixel: "Pixelon", "IBM Plex Mono", monospace;
  --tracking-display: -0.035em;
  --tracking-caps: 0.06em;
}

/* light (default) + explicit light */
:root,
[data-theme="light"] {
  --text-primary: var(--ink);
  --text-accent: var(--ink);
  --text-muted: #8C918E;

  --bg: var(--paper);
  --surface: #FCFBF8;
  --surface-card: #FCFBF8;
  --surface-hover: #EFEEE8;
  --surface-sunken: #EFEEE8;
  --surface-page: var(--paper);

  --border: #D4D7D5;
  --border-subtle: #E9EBEA;
  --border-light: #B4B9B6;
  --border-strong: #B4B9B6;
  --border-accent: var(--ink);

  --text: var(--ink);
  --text-secondary: #4E534F;
  --text-dim: #6A6F6C;

  --accent: var(--ink);
  --accent-hover: var(--water-900);
  --accent-press: #05090B;
  --accent-contrast: var(--paper);
  --accent-cyan: var(--ink);
  --accent-glow: rgba(12, 20, 15, 0.06);
  --focus-ring: #6A6F6C;

  --green: var(--signal-positive);
  --red: var(--signal-critical);

  --radius: 4px;
  --mono: var(--font-mono-ds);
  --sans: var(--font-grotesk);
  color-scheme: light;
}

/* dark — html-level or any showpiece subtree */
[data-theme="dark"] {
  --text-primary: #ECEFEC;
  --text-accent: #F2F4F1;
  --text-muted: #5C635E;

  --bg: var(--water-950);
  --surface: var(--water-850);
  --surface-card: var(--water-850);
  --surface-hover: var(--water-800);
  --surface-sunken: #060D09;
  --surface-page: var(--water-950);

  --border: rgba(222, 230, 224, 0.16);
  --border-subtle: rgba(222, 230, 224, 0.09);
  --border-light: rgba(222, 230, 224, 0.28);
  --border-strong: rgba(222, 230, 224, 0.28);
  --border-accent: rgba(255, 255, 255, 0.45);

  --text: #ECEFEC;
  --text-secondary: #9BA29D;
  --text-dim: #767D78;

  --accent: var(--white-abs);
  --accent-hover: #E8EBEB;
  --accent-press: #D2D6D6;
  --accent-contrast: var(--water-950);
  --accent-cyan: #F2F4F1;
  --accent-glow: rgba(255, 255, 255, 0.07);
  --focus-ring: rgba(255, 255, 255, 0.55);

  --green: #5F8C72;
  --red: #B06A60;
  color-scheme: dark;
}

/* ---- 2 · Base ------------------------------------------------- */

body {
  font-family: var(--font-grotesk);
  background: var(--bg);
  color: var(--text);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-grotesk);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.08;
  text-wrap: balance;
}

::selection {
  background: color-mix(in oklch, var(--accent) 25%, transparent);
  color: var(--text);
}

:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
  box-shadow: none;
}

/* ---- 3 · Brand beats ------------------------------------------ */

.logo {
  /* the original wordmark face — JetBrains Mono, kept for the logo only */
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-weight: 600;
  font-size: 1.1rem;
  letter-spacing: 0;
  color: var(--text);
  text-decoration: none;
}
.logo-icon { height: 17px; width: auto; margin-right: 4px; }

/* mono eyebrow — the section label signature */
.section-label {
  display: inline-block;
  font-family: var(--font-mono-ds);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--text-dim);
  background: none;
  border: none;
  border-radius: 0;
  padding: 0;
  margin-bottom: 12px;
}

/* blinking cap-height caret */
.lc-caret {
  display: inline-block;
  width: 0.14em;
  height: 0.72em;
  margin-left: 0.14em;
  vertical-align: baseline;
  background: var(--accent);
  animation: lc-blink 1.1s steps(1) infinite;
}
@keyframes lc-blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

/* deep-water showpiece ground (hero, closing band) */
.lc-water-surface {
  position: relative;
  isolation: isolate;
  background-color: var(--water-950);
  background-image:
    radial-gradient(96% 80% at 20% 4%, rgba(110, 125, 117, 0.72), rgba(10, 18, 14, 0) 46%),
    radial-gradient(70% 58% at 27% 14%, rgba(81, 95, 89, 0.66), rgba(10, 18, 14, 0) 42%),
    radial-gradient(82% 74% at 92% 122%, rgba(8, 14, 11, 0.7), rgba(10, 18, 14, 0) 44%);
  overflow: hidden;
}
.lc-water-surface::before {
  content: "";
  position: absolute;
  inset: -25%;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(48% 44% at 24% 12%, rgba(110, 125, 117, 0.34), rgba(10, 18, 14, 0) 60%);
  animation: lc-water-breathe 18s ease-in-out infinite;
}
@keyframes lc-water-breathe {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); opacity: 0.8; }
  50% { transform: translate3d(0, -3%, 0) scale(1.08); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .lc-water-surface::before, .lc-caret { animation: none; }
}

/* ---- 4 · Nav --------------------------------------------------- */

.nav {
  background: color-mix(in oklch, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-subtle);
  box-shadow: none;
}
.nav-inner { height: 64px; }
.nav-links a {
  font-family: var(--font-grotesk);
  font-weight: 500;
  font-size: 0.875rem;
  letter-spacing: -0.005em;
}

/* ---- 5 · Buttons ----------------------------------------------- */

.btn {
  font-family: var(--font-mono-ds);
  font-weight: 500;
  font-size: 0.875rem;
  letter-spacing: 0;
  border-radius: var(--radius);
  border: 1px solid transparent;
  box-shadow: none;
  transition: background-color 140ms cubic-bezier(0.2, 0, 0, 1),
              border-color 140ms cubic-bezier(0.2, 0, 0, 1),
              color 140ms cubic-bezier(0.2, 0, 0, 1),
              transform 80ms cubic-bezier(0.2, 0, 0, 1);
}
.btn:hover { transform: none; box-shadow: none; }
.btn:active { transform: translateY(0.5px); }

.btn-primary {
  background: var(--accent);
  color: var(--accent-contrast);
  border-color: var(--accent);
}
.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: var(--accent-contrast);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border-strong);
}
.btn-secondary:hover {
  background: var(--surface-sunken);
  border-color: var(--text-dim);
  color: var(--text);
}

/* ---- 6 · Surfaces & cards -------------------------------------- */

.feature-card, .metric-card, .pricing-card, .faq-item,
.docs-nav-card, .credits-explainer {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: none;
}
.feature-card:hover, .metric-card:hover, .docs-nav-card:hover {
  border-color: var(--border-accent);
  box-shadow: none;
  transform: none;
}
.pricing-card.featured { border-color: var(--border-accent); box-shadow: none; }
.pricing-badge {
  font-family: var(--font-mono-ds);
  font-size: 0.6875rem;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  background: var(--accent);
  color: var(--accent-contrast);
  border-radius: var(--radius);
}

.metric-card .metric-value {
  font-family: var(--font-grotesk);
  font-weight: 600;
  letter-spacing: var(--tracking-display);
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.metric-card .metric-label {
  font-family: var(--font-mono-ds);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: var(--text-dim);
}

/* steps — top-rule + mono index, not circled chips */
.step-num {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-dim);
  font-family: var(--font-mono-ds);
  font-weight: 500;
  box-shadow: none;
}
.step-content h3 { letter-spacing: -0.01em; }

/* ---- 7 · Hero & section type ----------------------------------- */

.hero h1 {
  font-size: clamp(2.9rem, 7vw, 5.2rem);
  line-height: 1.0;
  letter-spacing: var(--tracking-display);
  font-weight: 600;
}
.hero-sub { font-size: 1.125rem; color: var(--text-secondary); }
.page-hero h1 { letter-spacing: var(--tracking-display); font-weight: 600; }

.section-header h2, .container > h2 {
  letter-spacing: var(--tracking-display);
  font-weight: 600;
}

/* showpiece bands keep their own padding; kill legacy glows */
.hero, .cta-section { box-shadow: none; }
.cta-section h2 { letter-spacing: var(--tracking-display); }

/* ---- 8 · Terminal chrome (always deep water, both themes) ------ */

.hero-terminal, .install-cmd {
  background: var(--water-900);
  border: 1px solid rgba(222, 230, 224, 0.16);
  border-radius: var(--radius);
  box-shadow: none;
}
.terminal-bar {
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid rgba(222, 230, 224, 0.09);
}
.terminal-title { font-family: var(--font-mono-ds); color: #767D78; }
.terminal-body {
  font-family: var(--font-mono-ds);
  color: #ECEFEC;
  font-size: 0.8125rem;
}
.terminal-body .terminal-line { color: #ECEFEC; }
.terminal-body .terminal-line.dim { color: #9BA29D; }
.terminal-prompt { color: #5F8C72; }
.t-green { color: #5F8C72; }
.install-cmd code { font-family: var(--font-mono-ds); color: #ECEFEC; }

/* ---- 9 · Footer ------------------------------------------------- */

.footer {
  background: var(--bg);
  border-top: 1px solid var(--border-subtle);
  box-shadow: none;
}
.footer-col h4 {
  font-family: var(--font-mono-ds);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--text-dim);
}
.footer-bottom {
  font-family: var(--font-mono-ds);
  font-size: 0.75rem;
  color: var(--text-dim);
  border-top: 1px solid var(--border-subtle);
}

/* ---- 10 · Misc ------------------------------------------------- */

.faq-item summary { font-family: var(--font-grotesk); font-weight: 500; }
.theme-toggle {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-secondary);
  box-shadow: none;
}
.theme-toggle:hover { border-color: var(--border-strong); color: var(--text); }

code {
  font-family: var(--font-mono-ds);
  background: var(--surface-sunken);
  border: 1px solid var(--border-subtle);
  border-radius: 2px;
  padding: 0.1em 0.35em;
}
.terminal-body code, .install-cmd code { background: none; border: none; padding: 0; }

table { border-color: var(--border); }

/* ---- 11 · Theme-subtree fixes ---------------------------------- */

/* color must re-resolve where a subtree flips theme (showpiece bands) */
[data-theme="dark"], [data-theme="light"] { color: var(--text); }
h1, h2, h3, h4, h5, h6 { color: var(--text); }

/* kill the legacy indigo halo — no glows in this language
   (water surfaces keep their ::before breathe layer) */
.hero:not(.lc-water-surface)::before,
.page-hero::before {
  background: none;
}
