/* =========================================================================
   ALPCRUN.CH — Landing page styles
   Display: Josefin Sans (matches logo) · Body: Hanken Grotesk · Code: JetBrains Mono
   Theme + accent driven by [data-theme] / [data-accent] on <html>.
   ========================================================================= */

/* ---- Base tokens: DARK (default) ---- */
:root,
:root[data-theme="dark"] {
  --bg:        oklch(0.165 0.012 250);
  --bg-2:      oklch(0.205 0.013 250);
  --bg-3:      oklch(0.235 0.014 250);
  --card:      oklch(0.215 0.013 250 / 0.7);
  --text:      oklch(0.965 0.004 250);
  --text-dim:  oklch(0.78 0.008 250);
  --text-mute: oklch(0.62 0.01 250);
  --border:    oklch(1 0 0 / 0.09);
  --border-2:  oklch(1 0 0 / 0.16);
  --grid-line: oklch(1 0 0 / 0.035);
  --ridge:     oklch(1 0 0 / 0.07);
  --shadow:    0 1px 0 oklch(1 0 0 / 0.04) inset, 0 24px 60px -28px oklch(0 0 0 / 0.7);
  color-scheme: dark;
}

/* ---- LIGHT ---- */
:root[data-theme="light"] {
  --bg:        oklch(0.985 0.004 250);
  --bg-2:      oklch(0.965 0.005 250);
  --bg-3:      oklch(0.945 0.006 250);
  --card:      oklch(1 0 0 / 0.6);
  --text:      oklch(0.22 0.012 250);
  --text-dim:  oklch(0.40 0.012 250);
  --text-mute: oklch(0.54 0.012 250);
  --border:    oklch(0.22 0.02 250 / 0.12);
  --border-2:  oklch(0.22 0.02 250 / 0.22);
  --grid-line: oklch(0.22 0.02 250 / 0.05);
  --ridge:     oklch(0.22 0.02 250 / 0.10);
  --shadow:    0 1px 0 oklch(1 0 0 / 0.6) inset, 0 24px 50px -30px oklch(0.4 0.03 250 / 0.4);
  color-scheme: light;
}

/* ---- Accents ---- */
:root[data-accent="lime"]    { --accent: oklch(0.86 0.19 130); --accent-ink: oklch(0.20 0.04 130); --glow: oklch(0.86 0.19 130 / 0.28); }
:root[data-accent="glacier"] { --accent: oklch(0.78 0.13 235); --accent-ink: oklch(0.18 0.04 250); --glow: oklch(0.78 0.13 235 / 0.30); }
:root[data-accent="red"]     { --accent: oklch(0.64 0.22 25);  --accent-ink: oklch(0.98 0.01 25);  --glow: oklch(0.64 0.22 25 / 0.32); }
:root[data-accent="mono"]    { --accent: oklch(0.96 0 0);      --accent-ink: oklch(0.18 0.01 250); --glow: oklch(0.96 0 0 / 0.18); }

/* monochrome accent must flip in light mode */
:root[data-theme="light"][data-accent="mono"] { --accent: oklch(0.24 0.012 250); --accent-ink: oklch(0.98 0 0); --glow: oklch(0.24 0.012 250 / 0.14); }
:root[data-theme="light"][data-accent="glacier"] { --accent: oklch(0.55 0.15 245); --accent-ink: oklch(0.99 0 0); }
:root[data-theme="light"][data-accent="lime"] { --accent: oklch(0.74 0.18 132); --accent-ink: oklch(0.18 0.05 130); }

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Hanken Grotesk", system-ui, sans-serif;
  font-size: 18px;
  line-height: 1.6;
  font-feature-settings: "ss01";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

::selection { background: var(--accent); color: var(--accent-ink); }

/* page-wide subtle grid texture */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(ellipse 120% 80% at 50% 0%, #000 0%, transparent 75%);
          mask-image: radial-gradient(ellipse 120% 80% at 50% 0%, #000 0%, transparent 75%);
  pointer-events: none;
  z-index: 0;
}

h1, h2, h3, .display {
  font-family: "Josefin Sans", "Hanken Grotesk", sans-serif;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.02;
  text-wrap: balance;
}

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

.wrap { max-width: 1240px; margin: 0 auto; padding: 0 32px; position: relative; z-index: 1; }
@media (max-width: 720px) { .wrap { padding: 0 22px; } }

/* ---- Eyebrow / kicker ---- */
.kicker {
  font-family: "JetBrains Mono", monospace;
  font-size: 12.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-mute);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.kicker::before {
  content: "";
  width: 7px; height: 7px;
  background: var(--accent);
  transform: rotate(45deg);
  flex: none;
}

/* ---- Buttons ---- */
.btn {
  font-family: "Hanken Grotesk", sans-serif;
  font-weight: 600;
  font-size: 16px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 13px 22px;
  border-radius: 9px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .18s cubic-bezier(.2,.7,.3,1), background .18s, border-color .18s, box-shadow .18s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 0 0 0 var(--glow);
}
.btn-primary:hover { box-shadow: 0 14px 40px -12px var(--glow); transform: translateY(-1px); }
.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border-2);
}
.btn-ghost:hover { background: var(--bg-2); border-color: var(--text-mute); }
.btn .arrow { transition: transform .2s; }
.btn:hover .arrow { transform: translateX(3px); }

/* =========================================================================
   NAV
   ========================================================================= */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px) saturate(1.3);
  background: color-mix(in oklch, var(--bg) 72%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color .3s, background .3s;
}
.nav[data-scrolled="true"] { border-bottom-color: var(--border); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 74px; }
.nav-logo { height: 26px; width: auto; display: block; }
:root[data-theme="dark"] .nav-logo,
:root[data-theme="dark"] .footer-logo { filter: invert(1); }
.nav-links { display: flex; align-items: center; gap: 34px; }
.nav-links a.nl {
  font-size: 15px;
  color: var(--text-dim);
  font-weight: 500;
  transition: color .18s;
  position: relative;
}
.nav-links a.nl:hover { color: var(--text); }
.nav-cta { display: flex; align-items: center; gap: 14px; }
.nav-cta .small { padding: 9px 18px; font-size: 15px; }
.nav-toggle { display: none; }
@media (max-width: 900px) {
  .nav-links { display: none; }
  .nav-cta .ghost-hide { display: none; }
}

/* =========================================================================
   HERO
   ========================================================================= */
.hero { position: relative; padding: 88px 0 40px; overflow: hidden; }
.hero-glow {
  position: absolute;
  top: -160px; left: 50%;
  width: 900px; height: 620px;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at center, var(--glow), transparent 65%);
  filter: blur(20px);
  opacity: .8;
  pointer-events: none;
  z-index: 0;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 56px;
  align-items: center;
  position: relative;
  z-index: 2;
}
.hero-copy { max-width: 620px; }
.hero h1 {
  font-size: clamp(52px, 8.2vw, 104px);
  font-weight: 700;
  margin: 22px 0 0;
  letter-spacing: -0.02em;
}
.hero h1 .accentword { color: var(--accent); }
.hero-sub {
  font-size: clamp(18px, 2.2vw, 21px);
  color: var(--text-dim);
  margin-top: 24px;
  max-width: 540px;
  line-height: 1.55;
}
.hero-sub strong { color: var(--text); font-weight: 600; }
.hero-actions { display: flex; gap: 14px; margin-top: 34px; flex-wrap: wrap; }
.hero-microcopy {
  margin-top: 18px;
  font-family: "JetBrains Mono", monospace;
  font-size: 12.5px;
  color: var(--text-mute);
  letter-spacing: 0.02em;
  display: flex; align-items: center; gap: 8px;
}
.hero-microcopy .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--glow); }

/* centered hero variant */
.hero[data-herolayout="centered"] .hero-grid { grid-template-columns: 1fr; justify-items: center; text-align: center; }
.hero[data-herolayout="centered"] .hero-copy { max-width: 820px; }
.hero[data-herolayout="centered"] .hero-sub { margin-left: auto; margin-right: auto; max-width: 620px; }
.hero[data-herolayout="centered"] .hero-actions,
.hero[data-herolayout="centered"] .hero-microcopy { justify-content: center; }
.hero[data-herolayout="centered"] .kicker { justify-content: center; }
.hero[data-herolayout="centered"] .hero-visual { width: 100%; max-width: 760px; margin-top: 18px; }

@media (max-width: 940px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .hero-visual { order: 2; }
}

/* ---- Code / terminal card ---- */
.codecard {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  overflow: hidden;
  font-family: "JetBrains Mono", monospace;
  position: relative;
}
.codecard-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: color-mix(in oklch, var(--bg-3) 60%, transparent);
}
.dot3 { width: 11px; height: 11px; border-radius: 50%; background: var(--border-2); }
.codecard-title { margin-left: 10px; font-size: 12px; color: var(--text-mute); letter-spacing: .04em; }
.codecard pre { margin: 0; padding: 18px 20px; font-size: 13px; line-height: 1.7; overflow-x: auto; }
.code-cmt { color: var(--text-mute); }
.code-kw  { color: var(--accent); }
.code-str { color: var(--text-dim); }
.code-fn  { color: var(--text); font-weight: 600; }
.code-num { color: var(--text); }
.codecard pre code { color: var(--text-dim); }

/* ---- Ridgeline divider (mountain motif) ---- */
.ridge { display: block; width: 100%; height: auto; color: var(--ridge); position: relative; z-index: 1; }
.ridge path { stroke: currentColor; fill: none; }

/* =========================================================================
   SECTIONS — generic
   ========================================================================= */
section.band { padding: 96px 0; position: relative; z-index: 1; }
.section-head { max-width: 720px; margin-bottom: 56px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.section-head h2 { font-size: clamp(34px, 4.6vw, 54px); margin-top: 16px; }
.section-head p { color: var(--text-dim); font-size: 19px; margin-top: 18px; line-height: 1.55; }

/* ---- Built-on bar ---- */
.builton { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 30px 0; }
.builton-inner { display: flex; align-items: center; gap: 40px; flex-wrap: wrap; justify-content: center; }
.builton-label { font-family: "JetBrains Mono", monospace; font-size: 12px; letter-spacing: .18em; text-transform: uppercase; color: var(--text-mute); }
.stacklogo { display: inline-flex; align-items: center; gap: 11px; color: var(--text-dim); font-weight: 600; font-size: 17px; letter-spacing: -0.01em; transition: color .2s; }
.stacklogo:hover { color: var(--text); }
.stacklogo .glyph { width: 22px; height: 22px; flex: none; color: var(--accent); }

/* ---- Pillars ---- */
.pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
@media (max-width: 860px) { .pillars { grid-template-columns: 1fr; } }
.pillar { padding: 30px 28px; border: 1px solid var(--border); border-radius: 14px; background: var(--card); backdrop-filter: blur(8px); }
.pillar .pnum { font-family: "JetBrains Mono", monospace; font-size: 12px; color: var(--accent); letter-spacing: .1em; }
.pillar h3 { font-size: 25px; margin: 14px 0 10px; font-weight: 600; }
.pillar p { color: var(--text-dim); font-size: 16.5px; line-height: 1.55; }

/* ---- Feature grid ---- */
.fgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; }
@media (max-width: 920px) { .fgrid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .fgrid { grid-template-columns: 1fr; } }
.fcell.fcta { background: var(--bg-2); display: flex; flex-direction: column; justify-content: center; }
.fcell.fcta a { color: var(--accent); font-weight: 600; display: inline-flex; align-items: center; gap: 8px; font-size: 16px; }
.fcell.fcta a .arrow { transition: transform .2s; }
.fcell.fcta:hover a .arrow { transform: translateX(4px); }
.fcell { background: var(--bg); padding: 34px 30px; transition: background .25s; }
.fcell:hover { background: var(--bg-2); }
.ficon { width: 34px; height: 34px; color: var(--accent); margin-bottom: 20px; }
.ficon svg { width: 100%; height: 100%; }
.fcell h3 { font-size: 21px; font-weight: 600; margin-bottom: 9px; letter-spacing: -0.005em; }
.fcell p { font-size: 15.5px; color: var(--text-mute); line-height: 1.55; }

/* =========================================================================
   ARCHITECTURE
   ========================================================================= */
.arch { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; gap: 0; align-items: stretch; position: relative; }
@media (max-width: 860px) { .arch { grid-template-columns: 1fr; gap: 14px; } }
.arch-col { padding: 4px; }
.arch-tier {
  border: 1px solid var(--border-2);
  border-radius: 16px;
  background: var(--card);
  backdrop-filter: blur(8px);
  padding: 26px 24px;
  height: 100%;
  position: relative;
}
.arch-tier .tlabel { font-family: "JetBrains Mono", monospace; font-size: 11.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); }
.arch-tier h3 { font-size: 23px; margin: 10px 0 8px; }
.arch-tier > p { color: var(--text-mute); font-size: 15px; margin-bottom: 18px; }
.arch-node { display: flex; align-items: flex-start; gap: 12px; padding: 13px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-2); margin-top: 10px; }
.arch-node .nh { font-weight: 600; font-size: 15.5px; }
.arch-node .nd { font-size: 13.5px; color: var(--text-mute); line-height: 1.4; }
.arch-node .ndot { width: 8px; height: 8px; border-radius: 2px; background: var(--accent); margin-top: 7px; flex: none; }
.arch-flow { display: flex; align-items: center; justify-content: center; padding: 0 6px; }
.arch-arrow { color: var(--text-mute); font-size: 20px; line-height: 1; }
@media (max-width: 860px) { .arch-arrow { transform: rotate(90deg); } }

/* =========================================================================
   INTEGRATION
   ========================================================================= */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; gap: 36px; } }
.chips { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 26px; }
.chip { font-family: "JetBrains Mono", monospace; font-size: 12.5px; padding: 7px 13px; border: 1px solid var(--border-2); border-radius: 7px; color: var(--text-dim); background: var(--bg-2); }
.checklist { margin-top: 24px; display: grid; gap: 12px; }
.checklist li { list-style: none; display: flex; gap: 12px; align-items: flex-start; font-size: 16.5px; color: var(--text-dim); }
.checklist .ck { color: var(--accent); flex: none; margin-top: 3px; }
.checklist strong { color: var(--text); font-weight: 600; }

/* =========================================================================
   STAT BAND (cost & efficiency)
   ========================================================================= */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
@media (max-width: 760px) { .stats { grid-template-columns: 1fr; } }
.stat { text-align: left; }
.stat .num { font-family: "Josefin Sans", sans-serif; font-weight: 700; font-size: clamp(48px, 6vw, 72px); line-height: 1; color: var(--text); letter-spacing: -0.02em; }
.stat .num .u { color: var(--accent); }
.stat .lbl { color: var(--text-dim); font-size: 16px; margin-top: 12px; max-width: 280px; }
.stat .note { font-family: "JetBrains Mono", monospace; font-size: 10.5px; color: var(--text-mute); letter-spacing: .08em; margin-top: 6px; }

/* =========================================================================
   USE CASES
   ========================================================================= */
.uc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
@media (max-width: 920px) { .uc-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .uc-grid { grid-template-columns: 1fr; } }
.uc {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px 26px;
  background: var(--card);
  backdrop-filter: blur(6px);
  transition: transform .25s cubic-bezier(.2,.7,.3,1), border-color .25s;
}
.uc:hover { transform: translateY(-4px); border-color: var(--border-2); }
.uc .uctag { font-family: "JetBrains Mono", monospace; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.uc h3 { font-size: 22px; margin: 12px 0 12px; font-weight: 600; }
.uc ul { list-style: none; display: grid; gap: 7px; }
.uc li { font-size: 14.5px; color: var(--text-mute); padding-left: 16px; position: relative; line-height: 1.45; }
.uc li::before { content: "›"; position: absolute; left: 0; color: var(--accent); }

/* ---- Services ---- */
.svc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
@media (max-width: 860px) { .svc-grid { grid-template-columns: 1fr; } }
.svc { padding: 30px 28px; border-radius: 14px; border: 1px solid var(--border); background: var(--bg-2); }
.svc .snum { font-family: "JetBrains Mono", monospace; color: var(--accent); font-size: 13px; }
.svc h3 { font-size: 22px; margin: 14px 0 10px; }
.svc p { color: var(--text-dim); font-size: 15.5px; line-height: 1.55; }

/* =========================================================================
   FINAL CTA
   ========================================================================= */
.cta {
  position: relative;
  border-radius: 24px;
  border: 1px solid var(--border-2);
  background:
    radial-gradient(ellipse 80% 130% at 50% -20%, var(--glow), transparent 60%),
    var(--bg-2);
  padding: 80px 40px;
  text-align: center;
  overflow: hidden;
}
.cta h2 { font-size: clamp(36px, 5.4vw, 64px); max-width: 16ch; margin: 0 auto; }
.cta p { color: var(--text-dim); font-size: 19px; margin: 22px auto 34px; max-width: 56ch; }
.cta-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.cta .ridge-bg { position: absolute; bottom: -2px; left: 0; width: 100%; color: var(--ridge); }

/* =========================================================================
   FOOTER
   ========================================================================= */
.footer { border-top: 1px solid var(--border); padding: 64px 0 40px; position: relative; z-index: 1; }
.footer-top { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 40px; }
@media (max-width: 820px) { .footer-top { grid-template-columns: 1fr 1fr; gap: 32px; } }
.footer-logo { height: 24px; width: auto; margin-bottom: 18px; }
.footer-brand p { color: var(--text-mute); font-size: 14.5px; max-width: 280px; }
.fcol h4 { font-family: "JetBrains Mono", monospace; font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-mute); margin-bottom: 16px; font-weight: 500; }
.fcol a { display: block; color: var(--text-dim); font-size: 15px; margin-bottom: 11px; transition: color .18s; }
.fcol a:hover { color: var(--accent); }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; margin-top: 56px; padding-top: 26px; border-top: 1px solid var(--border); flex-wrap: wrap; gap: 14px; }
.footer-bottom p { color: var(--text-mute); font-size: 13.5px; }
.footer-bottom .made { font-family: "JetBrains Mono", monospace; font-size: 12px; letter-spacing: .04em; }

/* =========================================================================
   SCROLL REVEAL
   ========================================================================= */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s cubic-bezier(.2,.7,.3,1), transform .7s cubic-bezier(.2,.7,.3,1); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }
