
/* DARK COMPACT THEME — Minimal header, compact hero, full dark mode */
/* Goals:
   - Keep header slim (no content overlap)
   - Compact top section (above-the-fold content visible)
   - Strong contrast, comfortable reading
   - Sticky header with reserved offset for in-page anchors
*/

:root {
  --bg: #0a0f1a;
  --fg: #e5e7eb;
  --muted: #9aa3b2;
  --surface: #0f1726;
  --elev: #121a2b;
  --primary: #7aa2ff;
  --accent: #22d3ee;
  --border: rgba(255,255,255,.08);
  --shadow: 0 8px 28px rgba(0,0,0,.45);

  --radius: 14px;
  --space: clamp(.8rem, 1.1vw + .5rem, 1.2rem);
  --maxw: 78rem;

  --header-h: 60px;          /* compact header height */
  --hero-pad-y: 1.2rem;      /* compact hero padding */
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #0a0f1a;           /* keep dark look even in light mode as requested */
    --fg: #e5e7eb;
    --muted: #9aa3b2;
    --surface: #0f1726;
    --elev: #121a2b;
    --primary: #7aa2ff;
    --accent: #22d3ee;
    --border: rgba(255,255,255,.08);
  }
}

/* Base */
*,
*::before,
*::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: radial-gradient(900px 600px at 80% -10%, color-mix(in oklab, var(--accent) 12%, transparent), transparent),
              var(--bg);
  color: var(--fg);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}

/* Containers & sections */
.container { width: min(100% - 2rem, var(--maxw)); margin-inline: auto; }
.section { padding: calc(var(--space) * 1.6) 0; }

/* Header: slim, sticky, no overlap; reserve space with padding on main wrapper */
header {
  position: sticky; top: 0; z-index: 60;
  height: var(--header-h);
  display: flex; align-items: center;
  backdrop-filter: saturate(180%) blur(10px);
  background: color-mix(in oklab, var(--bg) 86%, transparent);
  border-bottom: 1px solid var(--border);
  transition: background .2s ease, box-shadow .2s ease;
}
header.compact-shadow { box-shadow: var(--shadow); }
.navbar { display: flex; align-items: center; justify-content: space-between; gap: .8rem; padding: 0; width: 100%; }
nav ul { list-style: none; display: flex; gap: clamp(.6rem, 2vw, 1rem); margin: 0; padding: 0; }
nav a { color: var(--fg); text-decoration: none; padding: .35rem .55rem; border-radius: 10px; opacity: .9; }
nav a:hover, nav a:focus-visible { opacity: 1; background: color-mix(in oklab, var(--elev) 70%, transparent); }

/* Ensure content is never hidden under the sticky header */
:target { scroll-margin-top: calc(var(--header-h) + 12px); }
[id] { scroll-margin-top: calc(var(--header-h) + 12px); }

/* Hero/top area: compact and content-forward */
.hero, .top, .headline, main > section:first-of-type, body > section:first-of-type {
  padding: var(--hero-pad-y) 0 !important;
}
main h1, body h1:first-child {
  font-size: clamp(2rem, 2.8vw + 1rem, 3rem);
  line-height: 1.15; letter-spacing: -0.02em;
  margin: 0.2em 0 0.35em;
}
.lead, main p:first-of-type {
  color: var(--muted); max-width: 72ch; font-size: clamp(1rem, .6vw + .9rem, 1.15rem);
  margin-top: .2rem;
}

/* Buttons */
.btn, button, input[type="submit"], .button {
  display: inline-flex; align-items: center; gap: .6rem;
  border: 1px solid color-mix(in oklab, var(--primary) 65%, var(--border));
  background: linear-gradient(180deg, color-mix(in oklab, var(--primary) 92%, transparent), color-mix(in oklab, var(--primary) 68%, transparent));
  color: white; padding: .7rem 1rem; border-radius: 12px; font-weight: 700; cursor: pointer;
  box-shadow: 0 6px 20px color-mix(in oklab, var(--primary) 22%, transparent);
  transition: transform .12s ease, box-shadow .12s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 10px 28px color-mix(in oklab, var(--primary) 32%, transparent); }
.btn--ghost { background: transparent; color: var(--primary); border-color: var(--primary); box-shadow: none; }

/* Cards */
.card {
  background: linear-gradient(180deg, color-mix(in oklab, var(--surface) 96%, transparent), color-mix(in oklab, var(--elev) 80%, transparent));
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: calc(var(--space) * 1.1); box-shadow: var(--shadow);
}
.card + .card { margin-top: var(--space); }

/* Grid */
.grid { display: grid; gap: var(--space); }
@media (min-width: 860px) { .grid.two { grid-template-columns: 1fr 1fr; } .grid.three { grid-template-columns: repeat(3, 1fr); } }

/* Typography */
h2 { font-size: clamp(1.4rem, 1.8vw + .8rem, 2rem); margin: 1em 0 .4em; line-height: 1.25; }
h3 { font-size: clamp(1.2rem, 1.2vw + .7rem, 1.5rem); margin: .9em 0 .35em; }
p { margin: 0 0 .9em; }

/* Forms */
input, textarea, select {
  width: 100%; padding: .7rem .85rem; border-radius: 12px; border: 1px solid var(--border);
  background: color-mix(in oklab, var(--surface) 96%, transparent); color: var(--fg);
}

/* Footer */
footer { border-top: 1px solid var(--border); margin-top: 1.6rem; padding: 1.6rem 0; color: var(--muted); }

/* A11y */
:focus-visible { outline: 3px solid color-mix(in oklab, var(--accent) 60%, transparent); outline-offset: 2px; }
.skip-link {
  position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden;
}
.skip-link:focus {
  position: fixed; left: 1rem; top: 1rem; z-index: 1000; width: auto; height: auto;
  padding: .5rem .75rem; background: var(--accent); color: #001017; border-radius: 10px;
}

/* Reduce motion if requested */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto; }
}
