/* =============================================================
   CavemanSoft Shared Design System
   Load Google Fonts via <link> in each page's <head>.
   ============================================================= */

:root {
  --bg: #131313;
  --panel: #262626;
  --panel-deep: #121212;
  --panel-top: #201f1f;
  --text: #e5e2e1;
  --muted: #e2bfb9;
  --line: #a98985;
  --line-soft: #5a413d;
  --red: #820202;
  --red-bright: #b3120d;
  --red-soft: #ff8675;
  --yellow: #ffff00;
  --shadow: #000000;
  --max: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Hanken Grotesk", sans-serif;
  line-height: 1.5;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

/* ── Shell ───────────────────────────────────────────────── */

.shell {
  width: min(calc(100% - 32px), var(--max));
  margin: 0 auto;
}

/* ── Topbar ──────────────────────────────────────────────── */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(19, 19, 19, 0.96);
  border-bottom: 1px solid var(--line-soft);
  backdrop-filter: blur(8px);
}

.topbar-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 24px;
  min-height: 72px;
}

.topbar-inner .brand {
  justify-self: start;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-mark {
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  flex: 0 0 36px;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  padding: 4px;
  border: 2px solid var(--line);
  background: #1a1a1a;
  box-shadow: 3px 3px 0 var(--shadow);
}

.brand span {
  color: var(--red-soft);
  font-size: 1.25rem;
  text-transform: uppercase;
}

/* ── Nav ─────────────────────────────────────────────────── */

.nav {
  display: flex;
  align-items: center;
  gap: 24px;
  justify-self: center;
  color: var(--muted);
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.96rem;
}

.nav-cta {
  justify-self: end;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.nav-cta.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.nav a:hover,
.nav a:focus-visible {
  color: var(--text);
}

/* ── Buttons ─────────────────────────────────────────────── */

.button,
.button-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 18px;
  border: 2px solid var(--line);
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  transition: transform 120ms ease, background 120ms ease, box-shadow 120ms ease;
  box-shadow: 4px 4px 0 var(--shadow);
}

.button {
  background: var(--red);
  color: #fff;
}

.button:hover,
.button:focus-visible,
.button-secondary:hover,
.button-secondary:focus-visible {
  transform: translate(-1px, -1px);
}

.button:active,
.button-secondary:active {
  transform: translate(2px, 2px);
  box-shadow: 0 0 0 var(--shadow);
}

.button-secondary {
  background: #1a1a1a;
  color: var(--text);
}

.button.nav-cta {
  transition: opacity 0.3s ease, transform 120ms ease, background 120ms ease, box-shadow 120ms ease;
}

/* ── Layout ──────────────────────────────────────────────── */

main {
  padding: 36px 0 72px;
}

section {
  margin-top: 88px;
}

section[id] {
  scroll-margin-top: 96px;
}

/* ── Hero ────────────────────────────────────────────────── */

.eyebrow {
  display: inline-block;
  margin-bottom: 20px;
  padding: 6px 10px;
  border: 2px solid var(--line);
  background: var(--yellow);
  color: #000;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.67rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  box-shadow: 3px 3px 0 var(--shadow);
  transform: rotate(-2deg);
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
}

h1 {
  font-size: clamp(2.6rem, 5vw, 4.8rem);
  line-height: 1.02;
  letter-spacing: -0.04em;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 420px);
  gap: 32px;
  align-items: center;
  min-height: 72vh;
}

.hero-copy {
  max-width: 620px;
  margin-top: 24px;
  padding-left: 16px;
  border-left: 4px solid var(--red);
  color: var(--muted);
  font-size: 1.08rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 28px;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 24px;
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.76rem;
  text-transform: uppercase;
}

.hero-panel {
  width: 100%;
  max-width: 420px;
  justify-self: center;
  border: 2px solid var(--line);
  background: linear-gradient(180deg, #1c1b1b, #101010);
  box-shadow: 6px 6px 0 var(--shadow);
  overflow: hidden;
}

.hero-panel img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.hero-panel footer {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  border-top: 2px solid var(--line-soft);
}

.metric {
  padding: 14px 16px;
  border-right: 2px solid var(--line-soft);
}

.metric:last-child {
  border-right: 0;
}

.metric-label {
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.66rem;
  text-transform: uppercase;
}

.metric-value {
  margin-top: 6px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
}

/* ── Section titles ──────────────────────────────────────── */

.section-title {
  display: inline-block;
  margin-bottom: 24px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--line-soft);
  color: #f5b8ae;
  font-size: clamp(1.6rem, 3vw, 2rem);
}

.section-lead {
  max-width: 760px;
  margin: 0 0 28px;
  color: var(--muted);
  font-size: 1.02rem;
}

/* ── Grids ───────────────────────────────────────────────── */

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

/* ── Cards ───────────────────────────────────────────────── */

.card {
  background: var(--panel);
  border: 2px solid var(--line);
  box-shadow: 5px 5px 0 var(--shadow);
  padding: 18px;
}

.card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 2px solid var(--line);
  background: #1a1a1a;
  font-family: "JetBrains Mono", monospace;
  color: var(--yellow);
  box-shadow: inset -2px -2px 0 #3a3a3a, inset 2px 2px 0 #000;
}

.card h3 {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 2px solid var(--line-soft);
  font-size: 1.3rem;
}

.card p {
  margin: 10px 0 0;
  color: var(--muted);
}

/* ── Footer ──────────────────────────────────────────────── */

footer.site-footer {
  margin-top: 40px;
  border-top: 1px solid var(--line-soft);
  padding: 24px 0 32px;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  color: var(--muted);
  font-size: 0.95rem;
}

.copyright {
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
}

/* ── Responsive ──────────────────────────────────────────── */

@media (max-width: 980px) {
  .hero,
  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }

  .nav {
    display: none;
  }
}

@media (max-width: 720px) {
  .shell {
    width: min(calc(100% - 24px), var(--max));
  }

  main {
    padding-top: 20px;
  }

  section {
    margin-top: 72px;
  }

  .topbar-inner {
    min-height: 64px;
  }

  .hero-actions,
  .hero-meta,
  .footer-links {
    gap: 12px;
  }

  .button,
  .button-secondary {
    width: 100%;
  }

  .hero-panel footer {
    grid-template-columns: 1fr;
  }

  .metric {
    border-right: 0;
    border-bottom: 2px solid var(--line-soft);
  }

  .metric:last-child {
    border-bottom: 0;
  }
}
