/* =================================================================
   AV-Digitaalimainos — Design Tokens & Semantic Element Styles
   Import this file at the root of any page to inherit the system.
   ================================================================= */

/* ---------- Fonts (Google Fonts CDN) ---------- */
@import url('https://fonts.googleapis.com/css2?family=Inter+Tight:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600;700;800&display=swap');

:root {
  /* ============================================================
     COLOR — Foundation
     ============================================================ */
  --ink:        #0B0B0C;
  --paper:      #F4F1EA;
  --paper-2:    #EAE5D5;   /* secondary warm surface — for alternating sections */
  --paper-pure: #FFFFFF;

  /* COLOR — Signal accents */
  --signaali:   #EFAA2B;   /* warm amber — primary CTA / the one highlight per viewport */
  --liekki:     #C8341C;   /* terra red — live indicator / urgent number / error */

  /* COLOR — Neutral scale (transparent layers on paper) */
  --ink-04:  rgba(11, 11, 12, 0.04);
  --ink-08:  rgba(11, 11, 12, 0.08);
  --ink-12:  rgba(11, 11, 12, 0.12);
  --ink-24:  rgba(11, 11, 12, 0.24);
  --ink-48:  rgba(11, 11, 12, 0.48);
  --ink-72:  rgba(11, 11, 12, 0.72);

  --paper-12: rgba(244, 241, 234, 0.12);
  --paper-24: rgba(244, 241, 234, 0.24);
  --paper-48: rgba(244, 241, 234, 0.48);
  --paper-72: rgba(244, 241, 234, 0.72);

  /* COLOR — Heat scale (terra red, transparent layers) */
  --liekki-12: rgba(200, 52, 28, 0.12);
  --liekki-24: rgba(200, 52, 28, 0.24);

  /* COLOR — Screen palette (inside imagery only, never on brand chrome) */
  --scr-magenta: #FF2B9D;
  --scr-cyan:    #2BD9FF;
  --scr-green:   #A6FF2B;
  --scr-amber:   #FFD12B;

  /* COLOR — Semantic aliases */
  --bg:           var(--paper);
  --bg-inverted:  var(--ink);
  --fg:           var(--ink);
  --fg-muted:     var(--ink-72);
  --fg-subtle:    var(--ink-48);
  --fg-inverted:  var(--paper);
  --border:       var(--ink-12);
  --border-strong: var(--ink-24);
  --accent:       var(--signaali);
  --accent-fg:    var(--ink);
  --heat:         var(--liekki);

  /* ============================================================
     TYPE
     ============================================================ */
  --font-display: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --font-text:    'Inter Tight', 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  /* TYPE — Scale */
  --fs-display-1: clamp(56px, 8vw, 112px);  /* hero H1 */
  --fs-display-2: clamp(44px, 5.5vw, 80px); /* section H1 */
  --fs-h1:        clamp(36px, 4vw, 56px);
  --fs-h2:        clamp(28px, 2.6vw, 36px);
  --fs-h3:        22px;
  --fs-h4:        18px;
  --fs-body-lg:   19px;
  --fs-body:      17px;
  --fs-body-sm:   15px;
  --fs-caption:   13px;
  --fs-eyebrow:   12px;

  /* TYPE — Weights */
  --fw-regular:  400;
  --fw-medium:   500;
  --fw-semibold: 600;
  --fw-bold:     700;
  --fw-black:    800;

  /* TYPE — Line heights */
  --lh-tight:   1.02;
  --lh-snug:    1.12;
  --lh-normal:  1.25;
  --lh-relaxed: 1.45;
  --lh-loose:   1.6;

  /* TYPE — Tracking */
  --ls-tight:   -0.04em;  /* mono headlines */
  --ls-snug:    -0.015em;
  --ls-normal:   0;
  --ls-eyebrow:  0.08em;

  /* ============================================================
     SPACE — 8px base, named scale
     ============================================================ */
  --space-1:   4px;
  --space-2:   8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  24px;
  --space-6:  32px;
  --space-7:  48px;
  --space-8:  64px;
  --space-9:  96px;
  --space-10: 128px;
  --space-11: 192px;

  /* ============================================================
     RADII — three values exist. that's all.
     ============================================================ */
  --radius-0:    0;      /* hero panels, data tables */
  --radius-1:    2px;    /* default */
  --radius-2:    6px;    /* tag chips, slightly-soft surfaces */

  /* ============================================================
     BORDERS
     ============================================================ */
  --border-w-1: 1px;
  --border-w-2: 1.5px;

  /* ============================================================
     ELEVATION — small, deliberate set.
     Cards do NOT use shadow (they use a 1px border instead).
     ============================================================ */
  --shadow-none: none;
  --shadow-btn:
    0 1px 0 rgba(11,11,12,0.10),
    0 2px 4px -1px rgba(11,11,12,0.10),
    0 6px 14px -6px rgba(11,11,12,0.18);
  --shadow-btn-hover:
    0 2px 0 rgba(11,11,12,0.12),
    0 6px 12px -2px rgba(11,11,12,0.14),
    0 14px 28px -10px rgba(11,11,12,0.22);
  --shadow-pop:
    0 1px 0 rgba(11,11,12,0.06), 0 8px 24px -8px rgba(11,11,12,0.12);

  /* ============================================================
     MOTION
     ============================================================ */
  --ease-standard: cubic-bezier(0.2, 0.7, 0.2, 1);
  --ease-out:      cubic-bezier(0.0, 0.0, 0.2, 1);
  --dur-fast:  140ms;
  --dur-base:  240ms;
  --dur-slow:  400ms;

  /* ============================================================
     LAYOUT
     ============================================================ */
  --container:        1280px;
  --container-narrow:  880px;
  --measure:           68ch;
  --nav-h:             64px;
}

/* =================================================================
   RESET-ISH BASELINES
   ================================================================= */
*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-text);
  font-size: var(--fs-body);
  line-height: var(--lh-relaxed);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

/* =================================================================
   SEMANTIC ELEMENT STYLES
   ================================================================= */

/* --- Headings: mono display --- */
h1, .h1 {
  font-family: var(--font-display);
  font-weight: var(--fw-bold);
  font-size: var(--fs-display-2);
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-tight);
  text-wrap: balance;
  margin: 0;
}

.display-1 {
  font-family: var(--font-display);
  font-weight: var(--fw-bold);
  font-size: var(--fs-display-1);
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-tight);
  text-wrap: balance;
  margin: 0;
}

h2, .h2 {
  font-family: var(--font-display);
  font-weight: var(--fw-bold);
  font-size: var(--fs-h1);
  line-height: var(--lh-snug);
  letter-spacing: var(--ls-tight);
  text-wrap: balance;
  margin: 0;
}

h3, .h3 {
  font-family: var(--font-display);
  font-weight: var(--fw-semibold);
  font-size: var(--fs-h2);
  line-height: var(--lh-snug);
  letter-spacing: var(--ls-snug);
  margin: 0;
}

h4, .h4 {
  font-family: var(--font-text);
  font-weight: var(--fw-semibold);
  font-size: var(--fs-h3);
  line-height: var(--lh-normal);
  letter-spacing: var(--ls-snug);
  margin: 0;
}

h5, .h5 {
  font-family: var(--font-text);
  font-weight: var(--fw-semibold);
  font-size: var(--fs-h4);
  line-height: var(--lh-normal);
  margin: 0;
}

/* --- Body --- */
p {
  font-size: var(--fs-body);
  line-height: var(--lh-relaxed);
  text-wrap: pretty;
  max-width: var(--measure);
  margin: 0;
}

.lede {
  font-family: var(--font-text);
  font-size: var(--fs-body-lg);
  line-height: var(--lh-relaxed);
  color: var(--fg-muted);
  max-width: var(--measure);
}

small, .caption {
  font-size: var(--fs-caption);
  color: var(--fg-muted);
  line-height: var(--lh-normal);
}

/* --- Eyebrow / overline --- */
.eyebrow {
  font-family: var(--font-text);
  font-size: var(--fs-eyebrow);
  font-weight: var(--fw-medium);
  text-transform: uppercase;
  letter-spacing: var(--ls-eyebrow);
  color: var(--fg-muted);
  margin: 0;
}

/* --- Mono --- */
code, kbd, samp, pre, .mono {
  font-family: var(--font-mono);
  font-size: 0.92em;
  font-feature-settings: "tnum";
}

/* --- Links --- */
a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  text-decoration-color: var(--ink-24);
  transition: text-decoration-color var(--dur-fast) var(--ease-standard);
}
a:hover { text-decoration-color: var(--ink); }

/* --- Selection --- */
::selection { background: var(--signaali); color: var(--ink); }

/* --- Horizontal rule --- */
hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 0;
}

/* --- Tabular numerals utility --- */
.tnum { font-variant-numeric: tabular-nums; }

/* =================================================================
   COMPONENT STYLES (used by both preview cards and the UI kit)
   ================================================================= */

/* --- Container --- */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--space-5);
}
.container-narrow { max-width: var(--container-narrow); }

/* --- Buttons --- */
/* --- Buttons — elevated, three flavours --- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  white-space: nowrap;
  font-family: var(--font-text);
  font-size: var(--fs-body-sm);
  font-weight: var(--fw-semibold);
  letter-spacing: -0.005em;
  padding: 13px 20px;
  border-radius: var(--radius-2);
  border: 1px solid transparent;
  background: transparent;
  color: var(--fg);
  text-decoration: none;
  cursor: pointer;
  box-shadow: var(--shadow-btn);
  transition:
    background var(--dur-fast) var(--ease-standard),
    color      var(--dur-fast) var(--ease-standard),
    border-color var(--dur-fast) var(--ease-standard),
    box-shadow var(--dur-base) var(--ease-standard),
    transform  var(--dur-fast) var(--ease-standard);
}
/* Top-edge inner highlight to read "raised" */
.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.18);
}
.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-btn-hover);
}
.btn:active {
  transform: translateY(1px);
  box-shadow:
    0 1px 0 rgba(11,11,12,0.08),
    0 0 0 1px rgba(11,11,12,0.04);
}

.btn-primary {
  background: linear-gradient(180deg, #F4B73D 0%, #EFAA2B 55%, #E29A1C 100%);
  color: var(--ink);
  border-color: rgba(11,11,12,0.22);
}
.btn-primary:hover {
  background: linear-gradient(180deg, #F8C24F 0%, #F4B339 55%, #E8A220 100%);
}

.btn-secondary {
  background: linear-gradient(180deg, #1c1c20 0%, #0B0B0C 100%);
  color: var(--paper);
  border-color: #000;
}
.btn-secondary::before {
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.10);
}
.btn-secondary:hover {
  background: linear-gradient(180deg, #2a2a2f 0%, #161618 100%);
}

.btn-ghost {
  background: var(--paper);
  color: var(--ink);
  border-color: var(--ink-24);
}
.btn-ghost::before {
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.5);
}
.btn-ghost:hover {
  border-color: var(--ink);
  background: #FAF7F0;
}

.btn-lg {
  font-size: var(--fs-body);
  padding: 16px 22px;
}

/* --- Tag / chip --- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: var(--fw-medium);
  letter-spacing: 0.02em;
  padding: 4px 10px;
  border-radius: var(--radius-2);
  border: 1px solid var(--border-strong);
  color: var(--fg-muted);
  background: transparent;
  text-transform: uppercase;
}
.tag-dot::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 999px;
  background: var(--signaali);
}
.tag-live::before { background: var(--liekki); }

/* --- Card (paper-on-paper rectangle) --- */
.card {
  border: 1px solid var(--border);
  border-radius: var(--radius-1);
  background: var(--paper);
  padding: var(--space-5);
}

/* --- Stat block --- */
.stat {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.stat-value {
  font-family: var(--font-mono);
  font-size: clamp(40px, 5vw, 72px);
  font-weight: var(--fw-bold);
  line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.stat-value.heat { color: var(--liekki); }
.stat-label {
  font-family: var(--font-text);
  font-size: var(--fs-body-sm);
  color: var(--fg-muted);
  max-width: 28ch;
}

/* --- Hairline divider --- */
.hairline {
  border-top: 1px solid var(--border);
  width: 100%;
}

/* --- Form input --- */
.input {
  font-family: var(--font-text);
  font-size: var(--fs-body);
  padding: 12px 14px;
  background: var(--paper);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-1);
  color: var(--ink);
  outline: none;
  width: 100%;
  transition: border-color var(--dur-fast) var(--ease-standard);
}
.input::placeholder { color: var(--fg-subtle); }
.input:focus { border-color: var(--ink); }

.field-label {
  display: block;
  font-family: var(--font-text);
  font-size: var(--fs-eyebrow);
  font-weight: var(--fw-medium);
  text-transform: uppercase;
  letter-spacing: var(--ls-eyebrow);
  color: var(--fg-muted);
  margin-bottom: var(--space-2);
}
