/* ============================================================
   Matias Nikula — Henkilökohtainen valmennus
   Design tokens + base styles
   Dark editorial, electric-blue accent, heavy grotesk display
   ============================================================ */

:root {
  /* Surfaces */
  --bg: #0a0a0c;
  --bg-2: #0e0e12;
  --surface: #131318;
  --surface-2: #17171d;
  --surface-hi: #1d1d25;
  --border: rgba(255, 255, 255, 0.08);
  --border-hi: rgba(255, 255, 255, 0.14);

  /* Text */
  --text: #f4f5f7;
  --text-2: #b7b9c2;
  --text-3: #82848f;
  --text-faint: #585a64;

  /* Accent (electric blue) — overridable via Tweaks */
  --accent: #2f5dff;
  --accent-hi: #4a72ff;
  --accent-ink: #ffffff;
  --accent-soft: rgba(47, 93, 255, 0.14);
  --accent-glow: rgba(47, 93, 255, 0.30);

  /* Type */
  --font-display: "Hanken Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-body: "Hanken Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Layout */
  --maxw: 1120px;
  --maxw-narrow: 820px;
  --radius: 18px;
  --radius-sm: 12px;
  --radius-pill: 999px;
  --section-pad: clamp(64px, 9vw, 132px);

  /* Motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  letter-spacing: -0.005em;
  overflow-x: hidden;
}

/* Ambient blue glow layer (toggled via [data-glow]) */
.glow-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 1;
  transition: opacity 0.4s var(--ease);
  background:
    radial-gradient(60% 50% at 85% -5%, var(--accent-glow), transparent 70%),
    radial-gradient(55% 45% at 8% 8%, rgba(47, 93, 255, 0.16), transparent 70%);
}
[data-glow="off"] .glow-layer { opacity: 0; }

.page { position: relative; z-index: 1; }

/* ---- Typography helpers ---- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 0.98;
  letter-spacing: -0.025em;
  margin: 0;
  text-wrap: balance;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-3);
  margin: 0;
}
.eyebrow .dot { color: var(--accent); }

.display {
  font-size: clamp(40px, 6.6vw, 86px);
}
.h2 {
  font-size: clamp(31px, 4.6vw, 58px);
}
.h3 {
  font-size: clamp(22px, 2.4vw, 30px);
  letter-spacing: -0.02em;
}

.lead {
  font-size: clamp(18px, 1.7vw, 22px);
  color: var(--text-2);
  line-height: 1.55;
  font-weight: 400;
}

.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.accent-text { color: var(--accent); }

/* ---- Layout ---- */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding-inline: clamp(20px, 5vw, 40px);
}
.wrap-narrow { max-width: var(--maxw-narrow); }

section { position: relative; }
.section-pad { padding-block: var(--section-pad); }

.section-head {
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
}
.section-head .eyebrow { margin-bottom: 18px; }
.section-head .lead { margin-top: 20px; }
@media (max-width: 560px) { .lead { font-size: 15px; } }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.01em;
  border: none;
  border-radius: var(--radius-pill);
  padding: 17px 30px;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.18s var(--ease), background 0.2s var(--ease), box-shadow 0.25s var(--ease);
  white-space: nowrap;
}
.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 12px 34px -12px var(--accent-glow);
}
.btn-primary:hover {
  background: var(--accent-hi);
  transform: translateY(-2px);
  box-shadow: 0 18px 44px -12px var(--accent-glow);
}
.btn-ghost {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border-hi);
}
.btn-ghost:hover { background: var(--surface-hi); transform: translateY(-2px); }
.btn-lg { padding: 20px 38px; font-size: 18px; }
.btn-sub {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-3);
  margin-top: 12px;
  text-align: center;
}

/* ---- Pills / chips ---- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--accent-hi);
  background: var(--accent-soft);
  border: 1px solid rgba(74, 114, 255, 0.25);
  border-radius: var(--radius-pill);
  padding: 7px 14px;
}

/* ---- Cards ---- */
.card {
  background: linear-gradient(180deg, var(--surface) 0%, var(--bg-2) 130%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  transition: border-color 0.25s var(--ease), transform 0.25s var(--ease), background 0.25s var(--ease);
}
.card-hover:hover {
  border-color: var(--border-hi);
  transform: translateY(-4px);
}

/* ---- Image / media placeholders ---- */
.placeholder {
  position: relative;
  background-color: var(--surface);
  background-image: repeating-linear-gradient(
    -45deg,
    rgba(255, 255, 255, 0.022) 0 12px,
    rgba(255, 255, 255, 0.05) 12px 24px
  );
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.placeholder .ph-label {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.05em;
  color: var(--text-3);
  text-align: center;
  padding: 10px 16px;
  border: 1px dashed var(--border-hi);
  border-radius: 8px;
  background: rgba(10, 10, 12, 0.55);
}

/* ---- Divider ---- */
.rule { height: 1px; background: var(--border); border: 0; }

/* ---- Scroll reveal ---- */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  will-change: opacity, transform;
}
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---- Utility ---- */
.center { text-align: center; }
.stack-sm > * + * { margin-top: 10px; }
.grid { display: grid; gap: 22px; }
.flex { display: flex; }
.gap-12 { gap: 12px; }

/* Selection */
::selection { background: var(--accent); color: #fff; }

/* Scrollbar (webkit) */
::-webkit-scrollbar { width: 11px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #25252e; border-radius: 8px; border: 3px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #34343f; }
