@font-face {
  font-family: "Special Elite";
  src: url("../fonts/special-elite.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Cutive Mono";
  src: url("../fonts/cutive-mono.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;

  /* --- Tummat pohjat (liitutaulu / hiili) --- */
  --ink:        #0c0b0a;
  --ink-2:      #131210;
  --panel:      #1c1915;
  --panel-2:    #262118;

  /* --- Tuli / hehku (pääaksentit) --- */
  --ember:        #d9772f;
  --ember-bright: #f0a256;
  --flame:        #b7421f;

  /* --- Myrsky / liitutaulu (toisaksentti) --- */
  --slate:       #324744;
  --slate-light: #4a6963;

  /* --- Hiekka / takki (vaaleat osiot) --- */
  --sand:      #e7ddc9;
  --sand-deep: #d6c8ab;

  /* --- Tekstit --- */
  --cream:     #f6f0e4;
  --cream-dim: #b7ad9b;
  --ink-text:  #1e1812;
  --ink-text-dim: rgba(30, 24, 18, 0.7);

  /* --- Viivat --- */
  --line:        rgba(246, 240, 228, 0.14);
  --line-strong: rgba(246, 240, 228, 0.3);
  --line-ink:    rgba(30, 24, 18, 0.16);

  --shadow:    0 24px 60px rgba(0, 0, 0, 0.45);
  --shadow-sm: 0 10px 30px rgba(0, 0, 0, 0.25);
  --radius:    14px;
  --radius-sm: 9px;

  --font-body: "Cutive Mono", ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --font-heading: "Special Elite", Georgia, "Times New Roman", serif;
  --font-ui: "Special Elite", Georgia, "Times New Roman", serif;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--ink-2);
  color: var(--cream);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body.nav-open { overflow: hidden; }

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

a {
  color: var(--ember-bright);
  text-decoration-color: rgba(217, 119, 47, 0.5);
  text-underline-offset: 0.2em;
  transition: color 160ms ease;
}
a:hover { color: var(--cream); }

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 3px solid var(--ember-bright);
  outline-offset: 3px;
  border-radius: 4px;
}

h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--font-heading);
  line-height: 1.04;
  font-weight: 400;
  letter-spacing: 0;
}

h1 { font-size: clamp(3.2rem, 10vw, 7rem); }
h2 { font-size: clamp(2rem, 5vw, 3.6rem); }
h3 { font-size: clamp(1.3rem, 3vw, 1.85rem); }
h4 { font-size: 1.05rem; line-height: 1.3; }

p { margin: 1rem 0 0; }

/* ---------- Apuluokat ---------- */
.skip-link {
  position: fixed; top: 1rem; left: 1rem; z-index: 999;
  transform: translateY(-160%);
  padding: 0.7rem 1.1rem;
  background: var(--ember); color: #fff; font-weight: 700;
  border-radius: var(--radius-sm);
}
.skip-link:focus { transform: translateY(0); }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.container { width: min(1140px, calc(100% - 2.5rem)); margin: 0 auto; }
.narrow { width: min(820px, calc(100% - 2.5rem)); margin: 0 auto; }

.section { padding: clamp(4rem, 9vw, 8rem) 0; position: relative; }

.eyebrow {
  margin: 0 0 1rem;
  display: inline-flex; align-items: center; gap: 0.6rem;
  color: var(--ember-bright);
  font-family: var(--font-ui);
  font-size: 0.76rem; font-weight: 400;
  letter-spacing: 0.18em; text-transform: uppercase;
}
.eyebrow::before {
  content: ""; width: 28px; height: 2px;
  background: linear-gradient(90deg, var(--ember), transparent);
}

.lead {
  font-size: clamp(1.08rem, 2.1vw, 1.32rem);
  line-height: 1.6;
  color: var(--cream);
}

/* ---------- Osioiden teemat ---------- */
.section-warm {
  background:
    radial-gradient(120% 120% at 100% 0%, rgba(217, 119, 47, 0.1), transparent 45%),
    var(--sand);
  color: var(--ink-text);
}
.section-warm .lead { color: var(--ink-text); }
.section-warm .eyebrow { color: var(--flame); }
.section-warm a { color: var(--flame); }
.section-warm a:hover { color: var(--ink-text); }

.section-dark {
  background:
    radial-gradient(90% 80% at 12% 0%, rgba(50, 71, 68, 0.4), transparent 55%),
    radial-gradient(100% 90% at 100% 100%, rgba(217, 119, 47, 0.18), transparent 50%),
    var(--ink);
}

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(12, 11, 10, 0.6);
  border-bottom: 1px solid transparent;
  backdrop-filter: blur(16px);
  transition: background-color 200ms ease, border-color 200ms ease;
}
.site-header.is-scrolled {
  background: rgba(12, 11, 10, 0.94);
  border-color: var(--line);
}

.header-inner {
  width: min(1200px, calc(100% - 2rem));
  min-height: 74px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}

.brand {
  display: inline-flex; align-items: center; gap: 0.7rem;
  font-family: var(--font-ui); font-weight: 400; font-size: 1.18rem;
  color: var(--cream); text-decoration: none; letter-spacing: 0.01em;
}
.brand-mark {
  width: 1.05rem; height: 1.05rem;
  background: linear-gradient(135deg, var(--ember-bright), var(--flame));
  transform: rotate(45deg);
  box-shadow: 0 0 14px rgba(217, 119, 47, 0.55);
  border-radius: 3px;
}

.site-nav { display: flex; align-items: center; gap: 0.2rem; font-size: 0.92rem; }
.site-nav a {
  padding: 0.55rem 0.8rem; color: var(--cream-dim);
  font-family: var(--font-ui);
  text-decoration: none; border-radius: var(--radius-sm); font-weight: 400;
}
.site-nav a:hover { background: rgba(246, 240, 228, 0.07); color: var(--cream); }

.nav-toggle {
  display: none; width: 46px; height: 46px; align-items: center; justify-content: center; flex-direction: column; gap: 4px;
  border: 1px solid var(--line); background: transparent; color: var(--cream);
  border-radius: var(--radius-sm); cursor: pointer;
}
.nav-toggle-line { width: 20px; height: 2px; display: block; margin: 0; background: currentColor; transition: transform 160ms ease; }

/* ---------- Hero ---------- */
.hero {
  min-height: min(820px, calc(100vh - 74px));
  display: flex; align-items: center;
  background:
    linear-gradient(90deg, rgba(12,11,10,0.97) 0%, rgba(12,11,10,0.82) 42%, rgba(12,11,10,0.45) 75%, rgba(12,11,10,0.6) 100%),
    radial-gradient(70% 90% at 88% 50%, rgba(217, 119, 47, 0.42), transparent 60%),
    radial-gradient(80% 90% at 95% 80%, rgba(183, 66, 31, 0.4), transparent 55%),
    radial-gradient(60% 80% at 8% 10%, rgba(50, 71, 68, 0.45), transparent 55%),
    url("../img/hero.webp"), url("../img/hero.jpg"),
    var(--ink);
  background-size: cover; background-position: center; background-repeat: no-repeat;
  position: relative;
  border-bottom: 1px solid var(--line);
}
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, transparent 70%, rgba(12,11,10,0.55) 100%);
}

.hero-grid {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 320px);
  gap: clamp(1.5rem, 4vw, 3rem); align-items: center; position: relative; z-index: 1;
  padding: clamp(3rem, 8vw, 5rem) 0;
}
.hero-content { max-width: 860px; min-width: 0; }

.hero h1 {
  max-width: 100%;
  font-size: clamp(3.2rem, 8vw, 6rem);
  line-height: 1.08;
  overflow: visible;
  text-wrap: balance;
  background: linear-gradient(180deg, var(--cream) 55%, var(--sand-deep));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 2px 40px rgba(0,0,0,0.4);
}

.hero-subtitle {
  margin-top: 1.3rem;
  font-family: var(--font-heading);
  font-size: clamp(1.5rem, 3.6vw, 2.4rem); line-height: 1.2;
  color: var(--ember-bright);
}
.hero-text {
  font-size: clamp(1.05rem, 2vw, 1.28rem); max-width: 56ch; color: var(--cream-dim);
}

.button-row { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 2rem; }

.button {
  display: inline-flex; min-height: 50px; align-items: center; justify-content: center;
  padding: 0.8rem 1.4rem; border: 1px solid transparent; border-radius: 50px;
  font-family: var(--font-ui);
  font-weight: 400; font-size: 0.97rem; text-decoration: none; cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}
.button:hover { transform: translateY(-2px); }

.button-primary {
  background: linear-gradient(135deg, var(--ember-bright), var(--ember));
  color: #2a1405; box-shadow: 0 10px 28px rgba(217, 119, 47, 0.35);
}
.button-primary:hover { box-shadow: 0 14px 34px rgba(217, 119, 47, 0.5); color: #2a1405; }

.button-secondary { background: var(--cream); color: var(--ink-text); }
.button-secondary:hover { background: #fff; color: var(--ink-text); }

.button-ghost { color: var(--cream); border-color: var(--line-strong); }
.button-ghost:hover { border-color: var(--ember-bright); color: var(--ember-bright); background: rgba(217,119,47,0.08); }

.section-warm .button-ghost { color: var(--ink-text); border-color: var(--line-ink); }
.section-warm .button-ghost:hover { border-color: var(--flame); color: var(--flame); background: rgba(183,66,31,0.06); }

/* ---------- Paneelit / kortit ---------- */
.hero-panel, .status-panel, .latest-panel {
  padding: clamp(1.4rem, 3vw, 2rem);
  border-radius: var(--radius);
}

.hero-panel {
  border: 1px solid var(--line);
  background: linear-gradient(160deg, rgba(28,25,21,0.85), rgba(12,11,10,0.7));
  box-shadow: var(--shadow);
  backdrop-filter: blur(6px);
}
.panel-kicker {
  margin: 0; color: var(--ember-bright); font-family: var(--font-ui); font-weight: 400;
  text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.8rem;
}
.hero-panel p:not(.panel-kicker) { color: var(--cream-dim); }

.split {
  display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: clamp(2rem, 6vw, 5rem); align-items: center;
}

.status-panel, .latest-panel {
  border: 1px solid var(--line-ink);
  background: rgba(255, 255, 255, 0.42);
}
.section-dark .latest-panel,
.section-dark .status-panel {
  border: 1px solid var(--line);
  background: rgba(28, 25, 21, 0.7);
}

.card-grid { display: grid; gap: 1.1rem; margin-top: 2.5rem; }
.card-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.card-grid.two  { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.info-card {
  padding: 1.6rem; border-radius: var(--radius);
  border: 1px solid var(--line-ink);
  background: linear-gradient(160deg, rgba(255,255,255,0.55), rgba(255,255,255,0.3));
  position: relative; overflow: hidden;
  transition: transform 200ms ease, box-shadow 200ms ease;
}
.info-card::before {
  content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 3px;
  background: linear-gradient(90deg, var(--ember), var(--flame));
  transform: scaleX(0); transform-origin: left; transition: transform 250ms ease;
}
.info-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-sm); }
.info-card:hover::before { transform: scaleX(1); }
.info-card h3 { color: var(--ink-text); font-size: 1.4rem; }
.info-card p { color: var(--ink-text-dim); margin-top: 0.6rem; }

/* ---------- Badge ---------- */
.status-badge {
  display: inline-flex; align-items: center; gap: 0.5rem;
  margin-bottom: 1rem; padding: 0.4rem 0.85rem;
  background: linear-gradient(135deg, var(--ember-bright), var(--ember));
  color: #2a1405; border-radius: 50px;
  font-family: var(--font-ui);
  font-weight: 400; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.76rem;
}
.status-badge::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%;
  background: #2a1405; animation: pulse 2s infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }

/* ---------- Kuvat ---------- */
.visual-strip { margin-top: 2.5rem; }
.visual-strip img {
  width: 100%; max-height: 460px; object-fit: cover;
  border-radius: var(--radius); border: 1px solid var(--line-ink);
  box-shadow: 0 24px 50px rgba(30, 24, 18, 0.22);
}

.podcast-panel { display: grid; gap: 1.2rem; }
.podcast-panel img {
  aspect-ratio: 1; width: 100%; object-fit: cover;
  border-radius: var(--radius); border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.visual-frame {
  overflow: hidden; border-radius: var(--radius);
  border: 1px solid var(--line-ink); box-shadow: var(--shadow-sm);
}
.visual-frame-portrait { max-width: 420px; justify-self: end; }
.visual-frame-portrait img { aspect-ratio: 9 / 13; width: 100%; object-fit: cover; object-position: center top; }

/* ---------- Linkkikortit ---------- */
.link-stack { display: grid; gap: 0.9rem; }
.large-link, .social-card {
  display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 0.9rem;
  padding: 1.3rem 1.5rem;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: rgba(28, 25, 21, 0.6); text-decoration: none; color: var(--cream);
  transition: transform 160ms ease, border-color 160ms ease, background-color 160ms ease;
}
.link-icon {
  width: 2.6rem; height: 2.6rem;
  display: inline-grid; place-items: center;
  border: 1px solid rgba(246, 240, 228, 0.22);
  border-radius: 50%;
  background: rgba(246, 240, 228, 0.08);
  color: var(--ember-bright);
  flex: 0 0 auto;
}
.link-icon svg {
  width: 1.45rem; height: 1.45rem;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.link-icon svg circle,
.link-icon svg rect,
.link-icon svg path {
  vector-effect: non-scaling-stroke;
}
.link-text {
  min-width: 0;
  display: grid;
  gap: 0.2rem;
}
.large-link .link-label, .social-card .link-label {
  font-family: var(--font-heading); font-size: 1.5rem; font-weight: 400; color: var(--cream);
}
.large-link small, .social-card small { color: var(--cream-dim); font-size: 0.88rem; }
.large-link:hover, .social-card:hover {
  transform: translateY(-3px); border-color: var(--ember);
  background: rgba(217, 119, 47, 0.12);
}
.large-link:hover .link-icon, .social-card:hover .link-icon {
  border-color: rgba(240, 162, 86, 0.65);
  background: rgba(217, 119, 47, 0.16);
  color: var(--cream);
}

/* ---------- Uusimmat show notes ---------- */
.latest-panel h3 { margin-bottom: 1.2rem; }
.compact-note { padding: 1.1rem 0; border-top: 1px solid var(--line-ink); }
.section-dark .compact-note { border-top-color: var(--line); }
.compact-note:first-of-type { padding-top: 0; border-top: 0; }
.compact-note time { color: var(--ember); font-size: 0.82rem; font-weight: 400; }
.section-warm .compact-note time { color: var(--flame); }
.compact-note h4 { margin-top: 0.3rem; }
.compact-note h4 a { color: var(--ink-text); text-decoration: none; }
.section-dark .compact-note h4 a { color: var(--cream); }
.compact-note h4 a:hover { color: var(--flame); }
.compact-note p { margin-top: 0.4rem; font-size: 0.92rem; color: var(--ink-text-dim); }
.section-dark .compact-note p { color: var(--cream-dim); }

.empty-state {
  margin: 0; padding: 1.1rem; border: 1px dashed currentColor;
  border-radius: var(--radius-sm); opacity: 0.7; font-size: 0.95rem;
}

/* ---------- Arkisto (show notes) ---------- */
.archive-hero {
  padding: clamp(4rem, 9vw, 7rem) 0 clamp(2rem, 5vw, 4rem);
  background:
    radial-gradient(80% 90% at 90% 10%, rgba(217, 119, 47, 0.25), transparent 55%),
    radial-gradient(70% 80% at 5% 0%, rgba(50, 71, 68, 0.4), transparent 55%),
    var(--ink);
  border-bottom: 1px solid var(--line);
}
.archive-hero h1 { max-width: 18ch; font-size: clamp(2.8rem, 9vw, 5.5rem); }
.archive-hero p { color: var(--cream-dim); max-width: 60ch; }

.archive-tools { display: grid; gap: 0.6rem; margin: 2.5rem auto; }
.archive-tools label { font-family: var(--font-ui); font-weight: 400; }
.search-input {
  width: 100%; min-height: 54px; padding: 0.9rem 1.2rem;
  border: 1px solid var(--line-strong); border-radius: 50px;
  background: rgba(28, 25, 21, 0.7); color: var(--cream); font: inherit;
}
.search-input::placeholder { color: var(--cream-dim); }

.archive-list { display: grid; gap: 1.2rem; }

.show-note-card {
  padding: 1.6rem 1.8rem; border-radius: var(--radius);
  border: 1px solid var(--line-ink);
  background: linear-gradient(160deg, rgba(255,255,255,0.5), rgba(255,255,255,0.32));
  transition: transform 180ms ease, box-shadow 180ms ease;
}
.show-note-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-sm); }
.show-note-card h2 { margin-top: 0.5rem; font-size: clamp(1.5rem, 4vw, 2.2rem); }
.show-note-card h2 a { color: var(--ink-text); text-decoration: none; }
.show-note-card h2 a:hover { color: var(--flame); }
.show-note-card p { color: var(--ink-text-dim); }

.note-meta { display: flex; flex-wrap: wrap; gap: 0.75rem; font-size: 0.85rem; font-weight: 400; }
.note-meta span, .note-meta time { color: var(--flame); }

.text-link { display: inline-flex; margin-top: 0.9rem; font-family: var(--font-ui); font-weight: 400; color: var(--flame); }

/* ---------- Yksittäinen show note ---------- */
.show-note-article { color: var(--ink-text); }
.show-note-article h1 { color: var(--ink-text); font-size: clamp(2.4rem, 7vw, 4.5rem); }
.show-note-section { margin-top: 2.5rem; }
.show-note-section h2 { margin-bottom: 1rem; }
.source-list { margin: 0; padding-left: 1.4rem; }
.source-list li {
  margin: 0 0 0.9rem; padding: 1.1rem; border-radius: var(--radius-sm);
  border: 1px solid var(--line-ink); background: rgba(255,255,255,0.4);
}
.source-meta { display: block; margin-top: 0.35rem; color: var(--ink-text-dim); font-size: 0.9rem; }
.correction-item {
  padding: 1.1rem; margin-bottom: 0.9rem; border-radius: var(--radius-sm);
  border: 1px solid var(--line-ink); border-left: 4px solid var(--flame); background: rgba(255,255,255,0.4);
}
.correction-item time { display: block; margin-bottom: 0.35rem; font-weight: 800; color: var(--flame); }
.back-link { display: inline-flex; margin-top: 2.5rem; font-weight: 800; }

/* ---------- Footer ---------- */
.site-footer {
  padding: 2.5rem 0; background: var(--ink);
  border-top: 1px solid var(--line); color: var(--cream-dim); font-size: 0.9rem;
}
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; }
.footer-inner p { margin: 0; }

/* ---------- Reveal-animaatio ---------- */
.section { opacity: 1; }
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity 600ms ease, transform 600ms ease; }
.js .reveal.is-visible { opacity: 1; transform: none; }

/* ---------- Responsiivisuus ---------- */
@media (max-width: 900px) {
  .js .nav-toggle { display: inline-flex; }
  .js .site-nav {
    position: fixed; inset: 74px 0 auto 0; display: none;
    padding: 1rem 1.25rem 1.5rem; background: rgba(12, 11, 10, 0.98);
    border-bottom: 1px solid var(--line); flex-direction: column; align-items: stretch;
  }
  .js .nav-open .site-nav { display: flex; }
  .site-nav a { min-height: 48px; display: flex; align-items: center; font-size: 1.05rem; }

  .hero-grid, .split { grid-template-columns: 1fr; }
  .visual-frame-portrait { max-width: 100%; justify-self: stretch; }
  .card-grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .header-inner { width: calc(100% - 1.5rem); }
  .section { padding: 3.5rem 0; }
  .card-grid.four, .card-grid.two { grid-template-columns: 1fr; }
  .button { width: 100%; }
  .hero { min-height: auto; }
  .footer-inner { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation: none !important;
  }
  .js .reveal { opacity: 1; transform: none; }
}

@media print {
  .site-header, .site-footer, .button-row, .link-stack, .archive-tools, .back-link, .nav-toggle { display: none !important; }
  body { background: #fff; color: #000; font-size: 12pt; }
  .section, .section-warm, .section-dark { padding: 1rem 0; background: #fff !important; color: #000 !important; }
  .container, .narrow { width: 100%; }
  a { color: #000; }
  .source-list li, .correction-item, .info-card { border: 1px solid #999; background: #fff; }
}
