/* ================================================================
   FLIPPAAJA.FI – STYLE SYSTEM
   Editorial, newsprint, hustle. Not crypto-bro. Not AI-slop.
   ================================================================ */

:root {
  --paper: #ede6d6;
  --paper-dark: #e2dac7;
  --paper-edge: #d6cdb6;
  --ink: #12110e;
  --ink-soft: #2a2824;
  --ink-mute: #6a665c;
  --rule: #1a1915;
  --signal: #d6391a;
  --signal-deep: #a42a10;
  --moss: #24382a;
  --gold: #a8832b;
  --paper-shadow: rgba(18,17,14,0.08);

  --ff-display: "Fraunces", "Times New Roman", serif;
  --ff-body: "Instrument Sans", "Helvetica Neue", sans-serif;
  --ff-mono: "JetBrains Mono", "Courier New", monospace;

  --ease-out: cubic-bezier(.2,.8,.2,1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--ff-body);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* paper grain overlay */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: url("data:image/svg+xml;utf8,<svg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.1 0 0 0 0 0.1 0 0 0 0 0.1 0 0 0 0.35 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  opacity: 0.12;
  mix-blend-mode: multiply;
  z-index: 1;
}

main, nav, footer, header { position: relative; z-index: 2; }

::selection { background: var(--signal); color: var(--paper); }

/* ================================================================
   TYPOGRAPHY
   ================================================================ */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--ff-display);
  font-weight: 500;
  font-variation-settings: "opsz" 144, "SOFT" 30, "WONK" 0;
  color: var(--ink);
  letter-spacing: -0.02em;
  margin: 0;
  line-height: 1.02;
}

h1 {
  font-size: clamp(2.4rem, 7vw, 6.2rem);
  font-weight: 400;
  line-height: 0.95;
  letter-spacing: -0.035em;
}

h2 {
  font-size: clamp(1.8rem, 3.6vw, 3.2rem);
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: -0.03em;
}

h3 {
  font-size: clamp(1.35rem, 2.2vw, 1.85rem);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

h4 {
  font-size: 1.15rem;
  font-weight: 500;
  letter-spacing: -0.01em;
}

p {
  margin: 0 0 1.1em 0;
  max-width: 62ch;
}

.lead {
  font-family: var(--ff-display);
  font-weight: 400;
  font-size: clamp(1.15rem, 1.8vw, 1.55rem);
  line-height: 1.35;
  color: var(--ink);
  max-width: 52ch;
  font-variation-settings: "opsz" 20, "SOFT" 50;
}

strong { font-weight: 600; }
em { font-style: italic; }

a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color .2s var(--ease-out);
}

a:hover { color: var(--signal); }

.mono {
  font-family: var(--ff-mono);
  font-size: 0.85em;
  letter-spacing: 0.01em;
}

.caps {
  font-family: var(--ff-mono);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  font-weight: 500;
}

.serif { font-family: var(--ff-display); }

.drop::first-letter {
  font-family: var(--ff-display);
  float: left;
  font-size: 5.4em;
  line-height: 0.82;
  padding: 0.08em 0.08em 0 0;
  font-weight: 400;
  color: var(--signal);
  font-variation-settings: "opsz" 144, "WONK" 1;
}

/* ================================================================
   NAVIGATION – masthead
   ================================================================ */

.masthead {
  border-bottom: 1.5px solid var(--rule);
  padding: 14px 0 12px;
  background: var(--paper);
}

.masthead-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 36px;
  font-family: var(--ff-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.masthead-top .edge { color: var(--ink-mute); }

.masthead-main {
  padding: 6px 36px 10px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  border-top: 0.5px solid var(--ink-mute);
  margin-top: 10px;
  padding-top: 14px;
}

.wordmark {
  font-family: var(--ff-display);
  font-size: clamp(2.2rem, 5vw, 4rem);
  font-weight: 400;
  line-height: 0.85;
  letter-spacing: -0.035em;
  color: var(--ink);
  text-decoration: none;
  font-variation-settings: "opsz" 144, "SOFT" 20, "WONK" 1;
}

.wordmark:hover { color: var(--ink); }

.wordmark .dot { color: var(--signal); }

.masthead-tagline {
  font-family: var(--ff-display);
  font-style: italic;
  font-size: 0.95rem;
  color: var(--ink-mute);
  text-align: right;
  max-width: 30ch;
  line-height: 1.25;
}

.navbar-flip {
  border-top: 3px double var(--rule);
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
  position: sticky;
  top: 0;
  z-index: 50;
}

.navbar-flip .container-fluid {
  padding: 0 36px;
}

.nav-flip-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0;
}

.nav-flip-list li {
  border-right: 1px solid var(--ink-mute);
}
.nav-flip-list li:first-child { border-left: 1px solid var(--ink-mute); }

.nav-flip-list a {
  display: block;
  padding: 12px 18px;
  text-decoration: none;
  font-family: var(--ff-mono);
  font-size: 0.74rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
  transition: all .2s var(--ease-out);
  position: relative;
}

.nav-flip-list a:hover {
  background: var(--ink);
  color: var(--paper);
}

.nav-flip-list a.active {
  background: var(--signal);
  color: var(--paper);
}

.nav-flip-list a.active::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--signal);
}

.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--ink);
  padding: 8px 14px;
  font-family: var(--ff-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  cursor: pointer;
}

@media (max-width: 900px) {
  .nav-toggle { display: block; margin: 10px 36px; }
  .nav-flip-list { display: none; flex-direction: column; border-top: 1px solid var(--rule); }
  .nav-flip-list.open { display: flex; }
  .nav-flip-list li { border-right: none; border-bottom: 1px solid var(--ink-mute); }
  .nav-flip-list li:first-child { border-left: none; }
  .masthead-main { flex-direction: column; align-items: flex-start; }
  .masthead-tagline { text-align: left; }
}

/* ================================================================
   LAYOUT PRIMITIVES
   ================================================================ */

.shell {
  max-width: 1480px;
  margin: 0 auto;
  padding: 0 36px;
}

@media (max-width: 600px) {
  .masthead-top, .masthead-main, .navbar-flip .container-fluid, .shell {
    padding-left: 20px;
    padding-right: 20px;
  }
}

.section {
  padding: 80px 0;
  position: relative;
}

.section-divider {
  border: 0;
  border-top: 1.5px solid var(--rule);
  margin: 0 36px;
}

.rule-heavy {
  border: 0;
  border-top: 3px double var(--rule);
  margin: 36px 0;
}

.ticker-tape {
  font-family: var(--ff-mono);
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 8px 36px;
  color: var(--ink-soft);
  overflow: hidden;
  white-space: nowrap;
  background: var(--paper-dark);
}

/* ================================================================
   HERO / COVER
   ================================================================ */

.cover {
  padding: 56px 0 80px;
  position: relative;
}

.cover-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 48px;
  align-items: end;
  padding: 0 36px;
}

.cover-kicker {
  font-family: var(--ff-mono);
  font-size: 0.76rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--signal);
  margin-bottom: 18px;
  display: inline-block;
  border-bottom: 1.5px solid var(--signal);
  padding-bottom: 6px;
}

.cover-headline {
  font-size: clamp(2.8rem, 9vw, 8.2rem);
  line-height: 0.86;
  letter-spacing: -0.045em;
  margin-bottom: 32px;
  font-variation-settings: "opsz" 144, "SOFT" 10, "WONK" 0;
}

.cover-headline .ital {
  font-style: italic;
  font-variation-settings: "opsz" 144, "SOFT" 80, "WONK" 1;
  color: var(--signal);
}

.cover-sub {
  font-family: var(--ff-display);
  font-style: italic;
  font-size: clamp(1.1rem, 1.6vw, 1.4rem);
  color: var(--ink-soft);
  line-height: 1.3;
  max-width: 40ch;
}

.cover-meta {
  border-left: 1px solid var(--rule);
  padding-left: 28px;
  font-family: var(--ff-mono);
  font-size: 0.82rem;
  line-height: 1.6;
}

.cover-meta dt {
  color: var(--ink-mute);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.68rem;
  margin-top: 14px;
}
.cover-meta dt:first-child { margin-top: 0; }
.cover-meta dd {
  margin: 4px 0 0;
  color: var(--ink);
}

@media (max-width: 900px) {
  .cover-grid { grid-template-columns: 1fr; gap: 30px; }
  .cover-meta { border-left: none; border-top: 1px solid var(--rule); padding-left: 0; padding-top: 20px; }
}

/* ================================================================
   STANDFIRST – first big block under hero
   ================================================================ */

.standfirst {
  padding: 60px 0;
  border-top: 1.5px solid var(--rule);
  border-bottom: 1.5px solid var(--rule);
}

.standfirst-grid {
  display: grid;
  grid-template-columns: 1fr 3fr;
  gap: 60px;
  padding: 0 36px;
  max-width: 1480px;
  margin: 0 auto;
}

.standfirst-label {
  font-family: var(--ff-mono);
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-mute);
  padding-top: 8px;
}

.standfirst-body {
  font-family: var(--ff-display);
  font-weight: 400;
  font-size: clamp(1.25rem, 2vw, 1.75rem);
  line-height: 1.32;
  font-variation-settings: "opsz" 20, "SOFT" 30;
  color: var(--ink);
}

.standfirst-body .signal { color: var(--signal); }

@media (max-width: 780px) {
  .standfirst-grid { grid-template-columns: 1fr; gap: 18px; }
}

/* ================================================================
   FEATURE INDEX – page nav cards
   ================================================================ */

.feature-index {
  padding: 80px 0;
}

.feature-index-head {
  padding: 0 36px 28px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  border-bottom: 1.5px solid var(--rule);
  margin-bottom: 0;
}

.feature-index-head h2 {
  font-size: clamp(1.8rem, 4vw, 3.2rem);
  max-width: 18ch;
}

.feature-index-head .count {
  font-family: var(--ff-mono);
  font-size: 0.82rem;
  color: var(--ink-mute);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 0;
}

.feature-card {
  grid-column: span 4;
  padding: 36px 32px 40px;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  text-decoration: none;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 280px;
  transition: background .25s var(--ease-out);
  position: relative;
}

.feature-card:hover {
  background: var(--ink);
  color: var(--paper);
}
.feature-card:hover .feature-card-num,
.feature-card:hover h3,
.feature-card:hover p,
.feature-card:hover .feature-card-more { color: var(--paper); }
.feature-card:hover .feature-card-more::after { background: var(--signal); }

.feature-card:nth-child(3n) { border-right: none; }

.feature-card-num {
  font-family: var(--ff-mono);
  font-size: 0.78rem;
  color: var(--ink-mute);
  letter-spacing: 0.15em;
  margin-bottom: 24px;
}

.feature-card h3 {
  font-size: 1.65rem;
  line-height: 1.05;
  margin-bottom: 14px;
  font-weight: 500;
}

.feature-card p {
  font-size: 0.95rem;
  color: var(--ink-soft);
  line-height: 1.4;
  margin-bottom: 18px;
}

.feature-card-more {
  font-family: var(--ff-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
}

.feature-card-more::after {
  content: "";
  display: inline-block;
  width: 28px;
  height: 1px;
  background: var(--ink);
  transition: background .2s;
}

@media (max-width: 1100px) {
  .feature-card { grid-column: span 6; }
  .feature-card:nth-child(3n) { border-right: 1px solid var(--rule); }
  .feature-card:nth-child(2n) { border-right: none; }
}

@media (max-width: 640px) {
  .feature-card { grid-column: span 12; border-right: none; }
}

/* ================================================================
   ARTICLE – article pages
   ================================================================ */

.article-head {
  padding: 60px 36px 40px;
  border-bottom: 3px double var(--rule);
  max-width: 1480px;
  margin: 0 auto;
}

.article-head .crumb {
  font-family: var(--ff-mono);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--signal);
  margin-bottom: 20px;
}

.article-title {
  font-size: clamp(2.4rem, 6vw, 5.2rem);
  line-height: 0.92;
  letter-spacing: -0.04em;
  max-width: 22ch;
  margin-bottom: 22px;
}

.article-title .ital {
  font-style: italic;
  color: var(--signal);
  font-variation-settings: "opsz" 144, "SOFT" 80, "WONK" 1;
}

.article-deck {
  font-family: var(--ff-display);
  font-style: italic;
  font-size: clamp(1.15rem, 1.8vw, 1.5rem);
  line-height: 1.35;
  max-width: 55ch;
  color: var(--ink-soft);
}

.article-meta-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  margin-top: 26px;
  font-family: var(--ff-mono);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-mute);
}
.article-meta-bar span strong { color: var(--ink); font-weight: 500; }

.article-body {
  padding: 60px 36px 100px;
  max-width: 1480px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 2.2fr 1fr;
  gap: 48px;
  position: relative;
}

.article-rail {
  font-family: var(--ff-mono);
  font-size: 0.76rem;
  color: var(--ink-mute);
  border-top: 1px solid var(--rule);
  padding-top: 14px;
}

.article-rail ol {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: r;
}

.article-rail li {
  counter-increment: r;
  padding: 6px 0;
  border-bottom: 1px dotted var(--ink-mute);
}
.article-rail li::before {
  content: counter(r, decimal-leading-zero) "  ";
  color: var(--signal);
}
.article-rail a {
  text-decoration: none;
  color: var(--ink);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-size: 0.72rem;
}
.article-rail a:hover { color: var(--signal); }

.article-rail .rail-label {
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-size: 0.68rem;
  color: var(--ink-mute);
  margin-bottom: 10px;
}

.prose {
  font-size: 1.08rem;
  line-height: 1.68;
  color: var(--ink);
  max-width: 68ch;
}

.prose p { margin: 0 0 1.2em; }
.prose p.drop { margin-top: 0; }

.prose h2 {
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  margin: 2.2em 0 0.6em;
  padding-top: 1.1em;
  border-top: 1.5px solid var(--rule);
  letter-spacing: -0.025em;
}
.prose h2:first-child { border-top: none; padding-top: 0; margin-top: 0; }

.prose h3 {
  font-size: 1.55rem;
  margin: 1.8em 0 0.4em;
  font-weight: 500;
}

.prose h4 {
  font-family: var(--ff-mono);
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--signal);
  margin: 1.8em 0 0.5em;
  font-weight: 500;
}

.prose ul, .prose ol {
  padding-left: 1.4em;
  margin: 0 0 1.2em;
}
.prose li { margin-bottom: 0.5em; }

.prose a {
  color: var(--signal-deep);
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
}
.prose a:hover { color: var(--ink); background: var(--signal); color: var(--paper); text-decoration: none; padding: 0 4px; }

@media (max-width: 1100px) {
  .article-body { grid-template-columns: 1fr; }
  .article-rail { order: -1; }
}

/* ================================================================
   INLINE FEATURES – case inserts, pull quotes, warnings
   ================================================================ */

.case-insert {
  margin: 2.4em 0;
  padding: 32px 32px 28px;
  background: var(--ink);
  color: var(--paper);
  position: relative;
  border: 1px solid var(--ink);
}

.case-insert::before {
  content: "CASE / DISPATCH";
  position: absolute;
  top: -10px;
  left: 24px;
  background: var(--signal);
  color: var(--paper);
  font-family: var(--ff-mono);
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  padding: 4px 10px;
}

.case-insert h4 {
  color: var(--paper);
  font-family: var(--ff-display);
  font-size: 1.45rem;
  margin: 6px 0 14px;
  letter-spacing: -0.01em;
  text-transform: none;
  font-weight: 500;
}

.case-insert p { color: var(--paper-edge); font-size: 0.98rem; line-height: 1.58; margin-bottom: 0.9em; }

.case-insert strong { color: var(--paper); }

.case-insert .case-result {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--paper-edge);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.case-insert .case-result div {
  font-family: var(--ff-mono);
  font-size: 0.82rem;
}
.case-insert .case-result span {
  display: block;
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--paper-edge);
  margin-bottom: 4px;
}
.case-insert .case-result strong { font-size: 1.2rem; font-family: var(--ff-display); letter-spacing: -0.02em; }

.pullquote {
  font-family: var(--ff-display);
  font-size: clamp(1.6rem, 3vw, 2.3rem);
  line-height: 1.12;
  font-style: italic;
  color: var(--signal);
  padding: 40px 0 36px;
  margin: 2.4em 0;
  border-top: 1.5px solid var(--rule);
  border-bottom: 1.5px solid var(--rule);
  max-width: 20ch;
  font-variation-settings: "opsz" 144, "SOFT" 60, "WONK" 1;
}

.pullquote::before {
  content: "";
  display: block;
  width: 60px;
  height: 3px;
  background: var(--signal);
  margin-bottom: 24px;
}

.warn-box {
  margin: 2.2em 0;
  padding: 24px 28px;
  background: var(--paper-dark);
  border-left: 6px solid var(--signal);
  position: relative;
}

.warn-box::before {
  content: "HUOMIO";
  position: absolute;
  top: 12px;
  right: 16px;
  font-family: var(--ff-mono);
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  color: var(--signal);
}

.warn-box h4 {
  font-family: var(--ff-display);
  font-size: 1.3rem;
  margin-bottom: 10px;
  color: var(--ink);
  text-transform: none;
  letter-spacing: -0.01em;
  font-weight: 500;
}

.warn-box p:last-child { margin-bottom: 0; }

.tip-box {
  margin: 2.2em 0;
  padding: 24px 28px;
  border: 1.5px solid var(--ink);
  background: var(--paper);
  position: relative;
}

.tip-box::before {
  content: "VINKKI";
  position: absolute;
  top: -10px;
  left: 20px;
  background: var(--ink);
  color: var(--paper);
  padding: 3px 10px;
  font-family: var(--ff-mono);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
}

/* big stat block */

.stat-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  margin: 2.4em 0;
  border-top: 3px double var(--rule);
  border-bottom: 3px double var(--rule);
}

.stat-row > div {
  padding: 26px 20px;
  border-right: 1px solid var(--rule);
  text-align: left;
}
.stat-row > div:last-child { border-right: none; }

.stat-row .num {
  font-family: var(--ff-display);
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1;
  color: var(--signal);
  margin-bottom: 6px;
  font-variation-settings: "opsz" 144, "SOFT" 30;
  letter-spacing: -0.03em;
}
.stat-row .lab {
  font-family: var(--ff-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  line-height: 1.3;
}

@media (max-width: 780px) {
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .stat-row > div:nth-child(2n) { border-right: none; }
  .stat-row > div:nth-child(-n+2) { border-bottom: 1px solid var(--rule); }
  .case-insert .case-result { grid-template-columns: 1fr; gap: 10px; }
}

/* ================================================================
   TABLES – financial newspaper style
   ================================================================ */

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--ff-mono);
  font-size: 0.85rem;
  margin: 2em 0;
  border-top: 3px double var(--rule);
  border-bottom: 3px double var(--rule);
}

.data-table thead th {
  text-align: left;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  padding: 14px 10px;
  border-bottom: 1px solid var(--rule);
  font-weight: 500;
}

.data-table tbody td {
  padding: 14px 10px;
  border-bottom: 1px dotted var(--ink-mute);
  vertical-align: top;
}

.data-table tbody tr:last-child td { border-bottom: none; }

.data-table tbody tr:hover {
  background: var(--paper-dark);
}

.data-table .sold-y { color: var(--moss); font-weight: 600; }
.data-table .sold-n { color: var(--signal); font-weight: 600; }

/* ================================================================
   TABLES – responsive: scrollable desktop, card stack on mobile
   ================================================================ */
.table-scroll {
  margin: 2em 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Mobile: turn rows into cards, hide thead, show data-label */
@media (max-width: 720px) {
  .table-scroll {
    overflow-x: visible;
  }

  .data-table {
    display: block;
    border-top: 3px double var(--rule);
    border-bottom: 3px double var(--rule);
    font-size: 0.9rem;
  }

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

  .data-table tbody,
  .data-table tr {
    display: block;
    width: 100%;
  }

  .data-table tbody tr {
    padding: 14px 0;
    border-bottom: 1.5px solid var(--rule);
    background: transparent;
  }

  .data-table tbody tr:last-child {
    border-bottom: none;
  }

  .data-table tbody tr:hover {
    background: transparent;
  }

  .data-table tbody td {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 16px;
    padding: 8px 4px;
    border-bottom: 1px dotted var(--ink-mute);
    text-align: right;
  }

  .data-table tbody td:last-child {
    border-bottom: none;
  }

  .data-table tbody td::before {
    content: attr(data-label);
    flex-shrink: 0;
    text-align: left;
    font-family: var(--ff-mono);
    font-size: 0.65rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-mute);
    font-weight: 500;
    padding-top: 2px;
    max-width: 45%;
  }

  /* Sheets-style ostotaulukolla on 9 saraketta — kerro mobiilille että rivit kortit pinotaan tiukemmin */
  .data-table tbody td strong {
    text-align: right;
  }
}

/* Very small screens: stack vertically inside each cell */
@media (max-width: 420px) {
  .data-table tbody td {
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    gap: 4px;
  }

  .data-table tbody td::before {
    max-width: 100%;
  }
}

/* ================================================================
   TOOLS PAGE – cards & trends widget
   ================================================================ */

.tool-block {
  margin: 3em 0;
  padding: 42px 40px;
  border: 1.5px solid var(--rule);
  background: var(--paper);
  position: relative;
}

.tool-block-num {
  position: absolute;
  top: -18px;
  left: 36px;
  background: var(--paper);
  padding: 0 14px;
  font-family: var(--ff-mono);
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  color: var(--signal);
}

.tool-block h3 {
  font-size: clamp(1.5rem, 2.4vw, 2rem);
  margin-bottom: 12px;
  letter-spacing: -0.025em;
}

.tool-block .tool-link {
  display: inline-block;
  margin-top: 14px;
  padding: 11px 20px;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  font-family: var(--ff-mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border: 1px solid var(--ink);
  transition: all .2s var(--ease-out);
}
.tool-block .tool-link:hover {
  background: var(--signal);
  border-color: var(--signal);
  color: var(--paper);
  text-decoration: none;
}

.trends-widget {
  margin: 2em 0;
  border: 2px solid var(--ink);
  background: var(--paper-dark);
  position: relative;
}

.trends-widget-head {
  background: var(--ink);
  color: var(--paper);
  padding: 18px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.trends-widget-head .title {
  font-family: var(--ff-display);
  font-size: 1.2rem;
  letter-spacing: -0.01em;
}

.trends-widget-head .status {
  font-family: var(--ff-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--signal);
  display: flex;
  align-items: center;
  gap: 8px;
}
.trends-widget-head .status::before {
  content: "";
  width: 8px;
  height: 8px;
  background: var(--signal);
  border-radius: 50%;
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  0%,100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.3); }
}

.trends-widget-body {
  padding: 28px 24px;
}

.trends-form {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.trends-form input, .trends-form select {
  font-family: var(--ff-mono);
  font-size: 0.9rem;
  padding: 10px 14px;
  border: 1.5px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  flex: 1;
  min-width: 200px;
}

.trends-form button {
  font-family: var(--ff-mono);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 10px 22px;
  background: var(--signal);
  color: var(--paper);
  border: 1.5px solid var(--signal);
  cursor: pointer;
  transition: all .2s var(--ease-out);
}
.trends-form button:hover {
  background: var(--ink);
  border-color: var(--ink);
}

.trends-result {
  font-family: var(--ff-mono);
  font-size: 0.88rem;
  padding: 18px 20px;
  background: var(--paper);
  border: 1px dashed var(--ink);
  margin-top: 12px;
  line-height: 1.5;
}

.trends-result.error {
  border-color: var(--signal);
  color: var(--signal-deep);
}

.trends-result strong { color: var(--ink); }

/* step list for guides */
.step-list {
  counter-reset: step;
  list-style: none;
  padding: 0;
  margin: 2em 0;
}

.step-list li {
  counter-increment: step;
  position: relative;
  padding: 20px 20px 20px 76px;
  border-top: 1px solid var(--rule);
  min-height: 60px;
}
.step-list li:last-child { border-bottom: 1px solid var(--rule); }

.step-list li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: 14px;
  top: 18px;
  font-family: var(--ff-display);
  font-size: 2.4rem;
  font-weight: 400;
  color: var(--signal);
  line-height: 1;
  font-variation-settings: "opsz" 144, "SOFT" 60, "WONK" 1;
  font-style: italic;
}

.step-list li strong {
  display: block;
  font-family: var(--ff-display);
  font-size: 1.15rem;
  margin-bottom: 4px;
  letter-spacing: -0.01em;
}

.step-list li p { margin: 0; font-size: 0.95rem; line-height: 1.55; }

/* ================================================================
   FOOTER
   ================================================================ */

.site-footer {
  margin-top: 80px;
  border-top: 3px double var(--rule);
  background: var(--ink);
  color: var(--paper);
  padding: 60px 0 30px;
}

.site-footer .shell {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
}

.site-footer h4 {
  font-family: var(--ff-mono);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--signal);
  margin-bottom: 16px;
  font-weight: 500;
}

.site-footer a {
  color: var(--paper-edge);
  text-decoration: none;
  display: block;
  padding: 4px 0;
  font-size: 0.95rem;
}
.site-footer a:hover { color: var(--signal); }

.site-footer .foot-brand {
  font-family: var(--ff-display);
  font-size: 3.2rem;
  line-height: 0.9;
  letter-spacing: -0.03em;
  color: var(--paper);
}

.site-footer .foot-brand .dot { color: var(--signal); }

.site-footer .foot-tag {
  font-family: var(--ff-display);
  font-style: italic;
  color: var(--paper-edge);
  font-size: 1rem;
  max-width: 40ch;
  line-height: 1.35;
  margin-top: 18px;
}

.foot-bottom {
  border-top: 1px solid #3a3a33;
  margin-top: 40px;
  padding-top: 18px;
  font-family: var(--ff-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-mute);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

@media (max-width: 780px) {
  .site-footer .shell { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .site-footer .shell { grid-template-columns: 1fr; }
  .site-footer .foot-brand { font-size: 2.6rem; }
}

/* ================================================================
   MOTION – page entrance
   ================================================================ */

.fade-up {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeUp .8s var(--ease-out) forwards;
}
.fade-up.d1 { animation-delay: .1s; }
.fade-up.d2 { animation-delay: .22s; }
.fade-up.d3 { animation-delay: .34s; }
.fade-up.d4 { animation-delay: .46s; }

@keyframes fadeUp {
  to { opacity: 1; transform: translateY(0); }
}

/* scroll reveal (JS) */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .8s var(--ease-out), transform .8s var(--ease-out);
}
.reveal.in {
  opacity: 1;
  transform: translateY(0);
}

/* utilities */
.text-signal { color: var(--signal); }
.text-mute { color: var(--ink-mute); }
.flex-between { display: flex; justify-content: space-between; gap: 16px; }
.muted-rule { border: 0; border-top: 1px solid var(--ink-mute); margin: 32px 0; }

/* ================================================================
   ACCESSIBILITY — skip link, focus states, touch targets
   ================================================================ */

/* Skip link: hidden until keyboard focus */
.skip-link {
  position: absolute;
  top: -100px;
  left: 0;
  z-index: 1000;
  background: var(--signal);
  color: var(--paper);
  padding: 12px 20px;
  font-family: var(--ff-mono);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  text-decoration: none;
  font-weight: 500;
  transition: top .15s var(--ease-out);
}
.skip-link:focus,
.skip-link:focus-visible {
  top: 0;
  outline: 2px solid var(--ink);
  outline-offset: 2px;
  color: var(--paper);
}

/* Keyboard focus states — visible ring for all interactive elements */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 3px;
  border-radius: 1px;
}

/* Remove default outline only when focus-visible is not matched */
a:focus:not(:focus-visible),
button:focus:not(:focus-visible) {
  outline: none;
}

/* Ensure main landmark can be targeted programmatically without visible outline */
main:focus { outline: none; }

/* Touch target sizing — WCAG 2.2 minimum 44×44 */
.nav-flip-list a {
  min-height: 44px;
  display: flex;
  align-items: center;
}
.nav-toggle {
  min-height: 44px;
  min-width: 44px;
}
.trends-form input,
.trends-form select,
.trends-form button,
.tool-block .tool-link,
.feature-card-more {
  min-height: 44px;
}

/* Smaller feature-card-more inline still gets adequate clickable padding
   because the whole card is the link. */

/* Responsive typography — very small screens */
@media (max-width: 400px) {
  html, body { font-size: 16px; }
  .cover-headline { font-size: clamp(2.2rem, 11vw, 3.2rem); }
  .article-title { font-size: clamp(2rem, 9vw, 2.8rem); }
  .ticker-tape {
    font-size: 0.68rem;
    letter-spacing: 0.1em;
    padding: 8px 20px;
  }
  .standfirst { padding: 40px 0; }
  .cover { padding: 40px 0 50px; }
}

/* Stop word-break on very small viewports for long Finnish compound words */
h1, h2, h3, .cover-headline, .article-title {
  overflow-wrap: break-word;
  word-wrap: break-word;
  hyphens: auto;
  -webkit-hyphens: auto;
}

/* Reduced motion — respect user preference */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .fade-up {
    opacity: 1;
    transform: none;
  }
  .reveal {
    opacity: 1;
    transform: none;
  }
  .trends-widget-head .status::before {
    animation: none;
  }
}

/* Screen-reader only text helper */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Image alt placeholder — ensure no images without alt cause layout break */
img {
  max-width: 100%;
  height: auto;
}

/* High contrast mode adjustments */
@media (prefers-contrast: more) {
  :root {
    --ink-mute: #3a3833;
    --rule: #000000;
  }
  a { text-decoration-thickness: 2px; }
}

/* Print stylesheet — chapters should print clean */
@media print {
  .masthead, .navbar-flip, .ticker-tape, .site-footer, .skip-link,
  .article-rail, .feature-index, .standfirst,
  .trends-widget-head .status { display: none !important; }
  body { background: white; color: black; font-size: 11pt; }
  body::before { display: none; }
  .article-body { display: block; padding: 0; max-width: 100%; }
  .prose { max-width: 100%; font-size: 11pt; line-height: 1.5; }
  .prose a { color: black; text-decoration: underline; }
  .case-insert { background: white; color: black; border: 2px solid black; }
  .case-insert h4, .case-insert p, .case-insert strong { color: black; }
  .pullquote { color: black; border-color: black; }
  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 0.85em;
    color: #555;
  }
}
