/*
 * Eetu Niemi — Ilmiöt
 * Editorial identity v5 · 2026-11
 * Itsenäinen, tietosuojaystävällinen toteutus. Ei ulkoisia fontteja eikä skriptejä.
 */
:root {
  color-scheme: light;
  --bg: #f7f9f8;
  --paper: #ffffff;
  --ink: #1c2d33;
  --muted: #52636b;
  --rule: #dce3e3;
  --soft: #eff4f3;
  --accent: #086b70;
  --accent-dark: #00575d;
  --accent-pale: #e5f2f0;
  --blue-soft: #edf3f7;
  --shadow: 0 9px 26px rgba(16, 44, 49, .045);
  --display: "Aptos Display", "Segoe UI Variable Display", "Segoe UI", Arial, sans-serif;
  --body: "Aptos", "Segoe UI Variable Text", "Segoe UI", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.7 var(--body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--ink); text-underline-offset: .19em; text-decoration-thickness: 1px; }
a:hover { color: var(--accent); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
img { max-width: 100%; }
.shell { width: min(1110px, calc(100% - 52px)); margin-inline: auto; }
.skip-link { position: absolute; top: -80px; left: 16px; z-index: 50; background: var(--ink); color: #fff; padding: 10px 16px; }
.skip-link:focus { top: 12px; }
.visually-hidden { position: absolute!important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* Masthead */
.site-header { background: var(--paper); border-bottom: 1px solid var(--rule); }
.header-row { min-height: 84px; display: flex; align-items: center; justify-content: space-between; gap: 26px; }
.brand { display: inline-flex; flex-direction: column; align-items: flex-start; flex: 0 0 auto; line-height: 1.0; text-decoration: none; }
.brand-small { color: var(--ink); font: 800 .84rem/1.3 var(--body); letter-spacing: .30em; text-transform: uppercase; margin-bottom: 7px; }
.brand-main { color: var(--ink); font: 800 1.92rem/1 var(--display); letter-spacing: .025em; }
.brand-dot { color: var(--accent); }
.primary-nav { display: flex; align-items: center; flex-wrap: wrap; gap: clamp(13px, 2.5vw, 31px); }
.primary-nav a { text-decoration: none; font-size: .83rem; font-weight: 670; color: var(--muted); letter-spacing: .005em; border-bottom: 2px solid transparent; padding: 15px 0 12px; }
.primary-nav a:hover, .primary-nav a[aria-current="page"] { color: var(--ink); border-color: var(--accent); }
.content-wrap { min-height: 60vh; padding-bottom: 90px; }

/* Typographic scale */
h1,h2,h3,h4 { font-family: var(--display); font-weight: 730; line-height: 1.15; letter-spacing: .018em; margin: 0; overflow-wrap: break-word; }
h1 { font-size: clamp(2.75rem, 5.35vw, 4.9rem); }
h2 { font-size: clamp(1.75rem, 3vw, 2.55rem); }
h3 { font-size: clamp(1.3rem, 2vw, 1.62rem); }
.eyebrow,.micro-label {
  color: var(--accent);
  text-transform: uppercase;
  font: 780 .76rem/1.4 var(--body);
  letter-spacing: .27em;
  margin: 0 0 15px;
}
.lead { color: var(--muted); font-size: clamp(1.08rem,1.4vw,1.24rem); line-height: 1.62; max-width: 750px; margin: 0; }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 22px; margin-bottom: 21px; }
.section-heading h2 { margin: 0; }
.section-heading .eyebrow { margin-bottom: 6px; }
.section-heading > a { font-size: .82rem; font-weight: 750; text-decoration: none; white-space: nowrap; }
.section-heading > a:hover { color: var(--accent); }
.text-link { font-size: .88rem; font-weight: 750; text-underline-offset: 5px; }
.button { display: inline-flex; align-items: center; gap: 18px; background: var(--accent); color: #fff; text-decoration: none; padding: 11px 18px; font-weight: 750; border-radius: 3px; }
.button:hover { background: var(--accent-dark); color: #fff; }
.pill { display: inline-flex; align-items: center; color: var(--accent); background: var(--accent-pale); border-radius: 3px; font: 760 .68rem/1.5 var(--body); letter-spacing: .055em; text-transform: uppercase; padding: 4px 9px; }

/* Home — intentional editorial hierarchy */
.editorial-intro { max-width: 940px; padding: 76px 0 52px; border-bottom: 1px solid var(--rule); }
.editorial-intro .eyebrow { margin-bottom: 19px; }
.editorial-intro h1 { font-size: clamp(3.0rem, 6vw, 5.3rem); letter-spacing: .028em; margin: 0 0 20px; font-weight: 750; }
.editorial-intro h1 em { color: var(--accent); font-style: normal; font-weight: inherit; }
.editorial-intro .lead { max-width: 770px; }
.latest-article { padding: 39px 0 43px; border-bottom: 1px solid var(--rule); }
.latest-article .section-heading { margin-bottom: 12px; }
.headline-article { max-width: 910px; }
.headline-copy h2 { font-size: clamp(2.1rem,4.3vw,3.65rem); letter-spacing: .03em; margin: 12px 0 15px; }
.headline-copy h2 a,.post-card h3 a,.list-card h2 a { text-decoration: none; }
.headline-copy h2 a:hover,.post-card h3 a:hover,.list-card h2 a:hover { color: var(--accent); }
.headline-copy > p { color: var(--muted); font-size: 1.06rem; line-height: 1.6; margin: 0 0 18px; max-width: 760px; }
.post-meta { color: var(--muted); font-size: .78rem; font-weight: 670; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.post-meta .pill { color: var(--accent); }
.home-section { padding-top: 52px; }
.follow-section { padding-top: 58px; }
.section-intro { max-width: 720px; font-size: 1.03rem; color: var(--muted); }
.feature-card {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--rule);
  border-top: 3px solid var(--accent);
  border-radius: 4px;
  padding: 27px 33px 29px;
  box-shadow: var(--shadow);
  text-decoration: none;
  transition: border-color .2s, transform .2s;
}
.feature-card:hover { border-color: #92bbba; transform: translateY(-2px); }
.feature-card h3 { font-size: clamp(1.55rem,2.35vw,2rem); margin: 11px 0 9px; }
.feature-card p { color: var(--muted); max-width: 770px; margin: 0; font-size: .96rem; }
.feature-arrow { font-family: var(--body); color: var(--accent); font-size: 1.75rem; align-self: center; }
.method-banner { margin-top: 60px; padding: 32px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); display: grid; grid-template-columns: 1.2fr 1fr; gap: 42px; }
.method-banner h2 { max-width: 560px; font-size: clamp(1.5rem,2.1vw,1.9rem); }
.method-banner p:last-child { color: var(--muted); margin: 0; font-size: .93rem; }
.method-banner a { font-weight: 750; }

/* Legacy hero (if used by older pages) */
.hero { display: grid; grid-template-columns: 1.6fr .8fr; align-items: center; gap: 55px; padding: 67px 0; border-bottom: 1px solid var(--rule); }
.hero h1 { margin-bottom: 21px; }
.hero h1 em { color: var(--accent); font-style: normal; }
.hero-actions { margin-top: 25px; display: flex; align-items: center; flex-wrap: wrap; gap: 20px; }
.hero-aside { background: var(--ink); padding: 30px; color: #fff; }
.hero-aside .micro-label { color: #9bcac8; }
.hero-aside p { font-size: 1.6rem; font-weight: 750; line-height: 1.2; margin: 0 0 20px; }
.hero-aside span:last-child { color: #c6d8dc; font-size: .8rem; }

/* General content, pages, article */
.page-heading { padding: 54px 0 29px; }
.page-heading h1,.case-head h1,.article-head h1 { font-size: clamp(2.6rem,5vw,4.25rem); margin-bottom: 17px; }
.prose-narrow { max-width: 770px; }
.prose-wide { max-width: 900px; }
.prose { font-size: 1.025rem; line-height: 1.77; }
.prose h2 { margin: 40px 0 15px; font-size: clamp(1.56rem,2.4vw,2.05rem); }
.prose h3 { margin: 30px 0 11px; font-size: 1.3rem; }
.prose p { margin: 0 0 19px; }
.prose li { padding-left: 3px; margin-bottom: 8px; }
.prose ul,.prose ol { padding-left: 25px; }
.prose strong { font-weight: 730; }
.prose blockquote { background: var(--accent-pale); border-left: 3px solid var(--accent); margin: 28px 0; padding: 15px 24px; }
.prose code { background: var(--soft); border-radius: 2px; padding: 2px 5px; font-size: .88em; }
.prose pre { background: var(--ink); color: white; padding: 20px; overflow-x: auto; }
.prose pre code { background: transparent; padding: 0; }
.breadcrumbs { display: flex; flex-wrap: wrap; gap: 9px; padding: 29px 0 0; font-size: .81rem; color: var(--muted); }
.breadcrumbs a { color: var(--muted); }
.article { padding-top: 22px; }
.article-head { border-bottom: 1px solid var(--rule); padding-bottom: 26px; margin-bottom: 30px; }
.article-head h1 { margin-bottom: 17px; }
.meta-row { display: flex; flex-wrap: wrap; gap: 7px 24px; color: var(--muted); font-size: .81rem; margin-top: 17px; }
.article-note { margin-top: 54px; background: var(--blue-soft); padding: 23px 26px; border-radius: 3px; font-size: .9rem; }
.article-note p { margin-bottom: 0; }
.article-related { background: var(--accent-pale); margin-top: 27px; padding: 16px 20px; }

/* Cases and document timelines */
.case-head { padding: 32px 0 29px; max-width: 870px; }
.case-head .eyebrow { margin-bottom: 14px; }
.case-nav { display: flex; flex-wrap: wrap; gap: 8px; border-bottom: 1px solid var(--rule); margin-bottom: 29px; }
.case-nav a { color: var(--muted); text-decoration: none; font-size: .86rem; font-weight: 720; padding: 10px 15px; background: var(--paper); border: 1px solid var(--rule); border-bottom: 0; }
.case-nav a:hover { color: var(--accent); }
.notice { background: var(--accent-pale); border-left: 3px solid var(--accent); font-size: .93rem; padding: 15px 19px; margin: 0 0 29px; max-width: 900px; }
.status-panel { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--rule); background: var(--paper); border-radius: 3px; margin-bottom: 34px; }
.status-panel > div { padding: 23px 25px; }
.status-panel > div + div { border-left: 1px solid var(--rule); }
.status-panel .micro-label { display: block; margin: 0 0 10px; }
.status-panel strong { font-family: var(--display); font-size: 1.15rem; line-height: 1.3; font-weight: 760; }
.status-panel p { color: var(--muted); font-size: .88rem; margin: 6px 0 0; }
.callout-links { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; margin: 34px 0; }
.callout-links a { display: grid; gap: 6px; padding: 22px 25px; border: 1px solid var(--rule); background: var(--paper); text-decoration: none; }
.callout-links a:hover { border-color: var(--accent); }
.callout-links strong { font-size: 1.4rem; font-family: var(--display); font-weight: 760; }
.callout-links span { color: var(--muted); font-size: .86rem; }
.empty-state { padding: 25px; border: 1px dashed var(--rule); background: var(--paper); }
.empty-state p { color: var(--muted); margin: 8px 0 0; }
.timeline { max-width: 850px; }
.timeline-year { font-size: 1.95rem!important; margin: 37px 0 22px!important; }
.timeline-items { list-style: none; border-left: 2px solid #a0c5c3; margin: 0 0 35px 8px!important; padding: 5px 0 2px 28px!important; }
.timeline-item { position: relative; padding: 0!important; margin: 0 0 18px!important; }
.timeline-item::before { content: ""; position: absolute; top: 18px; left: -37px; background: var(--accent); height: 11px; width: 11px; border: 3px solid var(--bg); border-radius: 50%; box-sizing: content-box; }
.timeline-card { padding: 23px 25px; background: var(--paper); border: 1px solid var(--rule); border-radius: 3px; }
.timeline-meta { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 9px; font-size: .77rem; margin-bottom: 11px; color: var(--muted); }
.timeline-meta time { color: var(--accent); font-weight: 780; }
.timeline-card h3 { font-size: 1.36rem; margin-bottom: 10px; }
.timeline-card p { margin: 0 0 11px; }
.timeline-card .attribution { background: var(--blue-soft); padding: 11px 13px; border-left: 3px solid #568a9d; font-size: .9rem; }
.timeline-card .source-refs { border-top: 1px solid var(--rule); padding-top: 11px; font-size: .82rem; }
.timeline-card .source-refs a { margin-left: 4px; }
.missing-source { color: #a13b3b; font-weight: 720; }
.reference-list { list-style: none; padding-left: 0!important; }
.reference-list li { display: flex; gap: 23px; padding: 20px 0!important; border-bottom: 1px solid var(--rule); margin: 0!important; }
.ref-id { flex: 0 0 52px; font-size: .88rem; font-weight: 800; color: var(--accent); }
.reference-list p { color: var(--muted); font-size: .88rem; margin: 6px 0 0; }
.change-log { list-style: none; padding: 0!important; }
.change-log li { display: grid; grid-template-columns: 120px minmax(0,1fr); gap: 8px 20px; padding: 14px 0!important; border-bottom: 1px solid var(--rule); }
.change-log time { font-size: .86rem; font-weight: 780; }
.change-log small { grid-column: 2; color: var(--muted); }
.muted { color: var(--muted); }

/* Listings and explanatory taxonomy */
.listing { display: grid; gap: 15px; margin: 27px 0; }
.list-card { display: block; text-decoration: none; padding: 26px 28px; background: var(--paper); border: 1px solid var(--rule); border-radius: 3px; }
.list-card:hover { border-color: #9ac5c1; }
.list-card h2 { font-size: 1.65rem; margin: 11px 0 9px; }
.list-card p { color: var(--muted); margin: 0 0 12px; }
.card-foot { font-size: .8rem; font-weight: 730; }
.post-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.post-card { padding: 23px; background: var(--paper); border: 1px solid var(--rule); border-radius: 3px; }
.post-card h3 { font-size: 1.52rem; margin: 14px 0 11px; }
.post-card p { margin: 0; color: var(--muted); font-size: .92rem; }
.list-card .post-meta { margin-bottom: 11px; }
.list-card .post-related { margin-top: 11px; font-size: .85rem; }
.principle-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 13px; margin: 25px 0 32px; }
.principle { background: var(--paper); padding: 18px 20px; border: 1px solid var(--rule); border-left: 4px solid #81969b; }
.principle.fact { border-left-color: #387664; }
.principle.attribution { border-left-color: #5d88a2; }
.principle.analysis { border-left-color: var(--accent); }
.principle.question { border-left-color: #a18d52; }
.principle p { font-size: .87rem; color: var(--muted); margin: 5px 0 0; }

/* Media, charts, explanatory figures */
.article-cover { margin: 0 0 33px; }
.article-cover img { display: block; width: 100%; height: auto; aspect-ratio: 40/21; object-fit: cover; border: 1px solid var(--rule); background: var(--soft); }
.article-cover figcaption,.editorial-figure figcaption { font-size: .8rem; color: var(--muted); line-height: 1.55; padding-top: 9px; }
.image-credit { color: var(--muted); font-size: .75rem; margin-left: .55rem; }
.image-credit::before { content: "· "; }
.article-cover figcaption .image-credit:first-child::before,.editorial-figure figcaption .image-credit:first-child::before { content: ""; }
.editorial-figure { margin: 35px 0 28px; }
.editorial-figure img { display: block; height: auto; width: 100%; border: 1px solid var(--rule); background: #fff; }
.editorial-figure > a { display: block; cursor: zoom-in; }
.editorial-figure.figure-wide { width: min(980px, calc(100vw - 52px)); max-width: none; position: relative; left: 50%; transform: translateX(-50%); }
.headline-article.has-image { display: grid; grid-template-columns: minmax(0,1.25fr) minmax(260px,1fr); gap: 28px; align-items: center; max-width: none; }
.headline-media,.post-card-media,.list-card-media { display: block; overflow: hidden; background: var(--soft); }
.headline-media img,.post-card-media img,.list-card-media img { display: block; width: 100%; height: auto; aspect-ratio: 40/21; object-fit: cover; transition: transform .2s ease; }
.headline-media:hover img,.post-card-media:hover img,.list-card-media:hover img { transform: scale(1.015); }
.post-card-media { margin: -23px -23px 19px; }
.list-card-media { margin-bottom: 17px; }
.list-card-media img { max-height: 300px; }

/* Footer */
.site-footer { background: #193239; color: #eaf3f3; padding: 41px 0 24px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 45px; }
.footer-grid strong { font: 730 1.12rem/1.3 var(--display); letter-spacing: .018em; }
.footer-grid p { color: #c7d8da; max-width: 460px; font-size: .86rem; }
.footer-links { display: flex; flex-direction: column; gap: 8px; }
.site-footer a { color: #e4eeee; font-size: .84rem; }
.site-footer a:hover { color: #a9e3dc; }
.footer-bottom { color: #b9cdd0; border-top: 1px solid rgba(255,255,255,.18); padding-top: 22px; margin-top: 27px; font-size: .77rem; }
.footer-bottom span { margin-left: 13px; }

@media (max-width: 860px) {
  .header-row { min-height: 94px; gap: 14px 24px; padding: 17px 0; flex-wrap: wrap; }
  .hero,.method-banner { grid-template-columns: 1fr; gap: 23px; }
  .hero { padding: 56px 0; }
  .headline-article.has-image { grid-template-columns: 1fr; gap: 22px; }
}
@media (max-width: 680px) {
  .shell { width: min(100% - 32px,1110px); }
  .primary-nav { width: 100%; gap: 21px; overflow-x: auto; flex-wrap: nowrap; }
  .primary-nav a { flex: 0 0 auto; padding: 8px 0; font-size: .83rem; }
  .editorial-intro { padding: 47px 0 37px; }
  .editorial-intro h1 { font-size: clamp(2.7rem,9vw,3.9rem); }
  .latest-article { padding: 33px 0; }
  .home-section,.follow-section { padding-top: 38px; }
  .headline-copy h2 { font-size: 2.4rem; }
  .post-grid,.status-panel,.callout-links,.principle-grid,.footer-grid { grid-template-columns: 1fr; }
  .status-panel > div + div { border-left: 0; border-top: 1px solid var(--rule); }
  .feature-card { padding: 23px 21px; }
  .feature-card h3 { font-size: 1.5rem; }
  .feature-arrow { font-size: 1.35rem; }
  .section-heading { align-items: flex-start; flex-direction: column; gap: 8px; }
  .method-banner { margin-top: 44px; }
  .page-heading { padding-top: 40px; }
  .case-nav a { padding: 8px 12px; font-size: .8rem; }
  .timeline-card { padding: 17px; }
  .timeline-items { padding-left: 21px!important; }
  .timeline-item::before { left: -30px; }
  .change-log li { grid-template-columns: 1fr; }
  .change-log small { grid-column: auto; }
  .reference-list li { gap: 10px; }
  .ref-id { flex-basis: 44px; }
  .editorial-figure.figure-wide { width: calc(100vw - 32px); }
  .footer-bottom span { display: block; margin: 7px 0 0; }
}
@media (max-width: 440px) {
  .editorial-intro h1 { font-size: 2.65rem; }
  .headline-copy h2 { font-size: 2.15rem; }
  .post-card { padding: 20px; }
  .post-card-media { margin: -20px -20px 17px; }
  .section-heading > a { white-space: normal; }
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #101d22;
    --paper: #192a30;
    --ink: #eff7f6;
    --muted: #b8c9ca;
    --rule: #35474b;
    --soft: #26383e;
    --accent: #73d4ce;
    --accent-dark: #51aaa6;
    --accent-pale: #1c3c3d;
    --blue-soft: #20383f;
    --shadow: none;
  }
  .site-header { background: var(--paper); }
  .brand-small { color: var(--ink); }
  .feature-card:hover,.list-card:hover { border-color: #538d8a; }
  .timeline-item::before { border-color: var(--bg); }
  .hero-aside,.site-footer { background: #0b181b; }
  .button { color: #102629; background: #83d9d4; }
  .button:hover { color: #102629; background: #a1efec; }
  .missing-source { color: #ffb0a0; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .feature-card,.headline-media img,.post-card-media img,.list-card-media img { transition: none; }
}


/* Ilmiöt v5 — artikkelien luettavuus tietokoneella ja mobiilissa */
.article.prose-narrow {
  width: 100%;
  max-width: 900px;
}
.article .prose {
  font-size: 1.125rem; /* 18 px perustasolla */
  line-height: 1.75;
}
.article .prose p {
  margin-bottom: 1.35em;
}
.article-head .lead {
  max-width: 850px;
  font-size: 1.2rem;
  line-height: 1.6;
}
@media (max-width: 680px) {
  .article .prose {
    font-size: 1.0625rem;
    line-height: 1.72;
  }
  .article-head .lead {
    font-size: 1.1rem;
  }
}

/* Ylävalikon linkit */
.site-header nav a,
.site-nav a {
  font-size: 1rem;
  line-height: 1.4;
}

/* Etusivun toimintolinkit */
.latest-article .text-link,
.home-section .section-heading > a {
  font-size: 0.9375rem;
  line-height: 1.4;
}