/* paper-tide — S8 living cover
   Palette: paper #F3EDE2 · ink #23211D · rust #A85B3E (text #8E4529)
            sea #3F5F5B · pencil #6B675E
   Text on paper: ink 13.4:1 · pencil 5.1:1 · rust-text 5.3:1 (all AA)
   The living layer: five hand-drawn tide lines drifting sideways at
   different speeds behind the type. No photo in the cover — the motion is
   the image. */

@font-face {
  font-family: "Petrona";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("assets/fonts/petrona-variable-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215;
}
@font-face {
  font-family: "Schibsted Grotesk";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url("assets/fonts/schibsted-grotesk-variable-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215;
}

:root {
  --paper: #F3EDE2;
  --paper-2: #EAE2D3;
  --ink: #23211D;
  --rust: #A85B3E;
  --rust-text: #8E4529;
  --sea: #3F5F5B;
  --pencil: #6B675E;
  --display: "Petrona", Georgia, serif;
  --body: "Schibsted Grotesk", "Segoe UI", sans-serif;
  /* one centred shell for every band of content; the tide layer stays
     full-bleed because it is absolutely positioned, not padded */
  --shell: 75rem;
  --gutter: 1.5rem;
  --shell-pad: max(var(--gutter), (100% - var(--shell)) / 2);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--ink);
  background: var(--paper);
  overflow-x: hidden;
}
a { color: inherit; }
:focus-visible { outline: 2px solid var(--rust-text); outline-offset: 3px; }
img { display: block; max-width: 100%; }

.demo-banner {
  display: block;
  background: var(--ink);
  color: var(--paper);
  text-align: center;
  text-decoration: none;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.55rem 1rem;
}

/* ---- the drifting cover ---- */
.cover {
  position: relative;
  min-height: calc(100svh - 2.4rem);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 2rem;
  overflow: hidden;
  padding: 1.5rem var(--shell-pad) calc(2rem + env(safe-area-inset-bottom));
}
.tide {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(2.2rem, 7vh, 4.5rem);
}
.tide-layer {
  display: block;
  width: 200%;
  height: clamp(60px, 12vh, 130px);
  flex: none;
  stroke: var(--sea);
  will-change: transform;
}
.tide-layer path {
  fill: none;
  stroke: inherit;
  stroke-width: 2;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}
.tide-layer--1 { opacity: 0.20; animation: tide 38s linear infinite; }
.tide-layer--2 { opacity: 0.30; stroke: var(--rust); animation: tide 52s linear infinite reverse; }
.tide-layer--3 { opacity: 0.16; animation: tide 30s linear infinite; }
.tide-layer--4 { opacity: 0.26; stroke: var(--rust); animation: tide 64s linear infinite reverse; }
.tide-layer--5 { opacity: 0.14; animation: tide 46s linear infinite; }
@keyframes tide {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(-50%, 0, 0); }
}

.cover-top, .cover-inner, .cover-foot { position: relative; z-index: 1; }
.cover-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}
.wordmark { font-family: var(--display); font-weight: 600; font-size: 1.0625rem; letter-spacing: 0.01em; }
.cover-note { font-size: 0.75rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--pencil); }

.cover-inner { max-width: 42rem; }
.eyebrow {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--rust-text);
  margin-bottom: 1.25rem;
}
.cover h1 {
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(3.25rem, 16vw, 8.5rem);
  line-height: 0.9;
  letter-spacing: -0.025em;
  margin-bottom: 1.5rem;
}
.cover h1 .ital { font-style: italic; font-weight: 500; color: var(--rust-text); }
.lede {
  font-size: clamp(1.0625rem, 3.4vw, 1.25rem);
  line-height: 1.6;
  color: var(--pencil);
  max-width: 30rem;
  margin-bottom: 2rem;
}
.cover-foot { font-size: 0.8125rem; letter-spacing: 0.04em; color: var(--pencil); }

/* ---- link cta ---- */
.link-cta {
  display: inline-block;
  font-weight: 700;
  font-size: 0.9375rem;
  letter-spacing: 0.02em;
  text-decoration: none;
  color: var(--ink);
  padding-bottom: 0.3rem;
  border-bottom: 2px solid var(--rust);
  background: var(--paper);
}
.link-cta:hover { color: var(--rust-text); }
.link-cta span { display: inline-block; transition: transform 0.3s ease; }
.link-cta:hover span { transform: translateX(4px); }

/* ---- sections ---- */
main section {
  padding: clamp(4rem, 12vh, 7rem) var(--shell-pad);
}
.section-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--rust-text);
  margin-bottom: 0.9rem;
}
.section-title {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.875rem, 5.5vw, 3rem);
  line-height: 1.12;
  letter-spacing: -0.015em;
  margin-bottom: 1.75rem;
  max-width: 20ch;
}

/* ---- split ---- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: center; }
.split-text p { color: var(--pencil); }
.split-text p + p { margin-top: 1rem; }
.split-img { margin: 0; }
.split-img picture { display: block; aspect-ratio: 3 / 2; overflow: hidden; border-radius: 2px; }
.split-img img { width: 100%; height: 100%; object-fit: cover; }
.split-img figcaption {
  margin-top: 0.7rem;
  font-family: var(--display);
  font-style: italic;
  font-size: 0.9375rem;
  color: var(--pencil);
}

/* ---- steps ---- */
.steps { list-style: none; display: grid; grid-template-columns: repeat(2, 1fr); gap: 2.5rem 3rem; }
.steps li { border-top: 1px solid rgba(35, 33, 29, 0.18); padding-top: 1rem; }
.step-n {
  font-family: var(--body);
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  color: var(--rust-text);
}
.steps h3 { font-family: var(--display); font-weight: 500; font-size: 1.375rem; margin: 0.4rem 0 0.5rem; }
.steps p { color: var(--pencil); font-size: 0.9375rem; }

/* ---- gallery ---- */
.kuvat { background: var(--paper-2); }
.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.25rem; margin-bottom: 2rem; max-width: 46rem; }
.gallery figure { margin: 0; }
.gallery picture { display: block; aspect-ratio: 1 / 1; overflow: hidden; border-radius: 2px; }
.gallery img { width: 100%; height: 100%; object-fit: cover; }
.gallery figcaption { margin-top: 0.6rem; font-family: var(--display); font-style: italic; color: var(--pencil); font-size: 0.9375rem; }
.photo-note {
  max-width: 42rem;
  font-size: 0.9375rem;
  color: var(--pencil);
  border-left: 2px solid var(--rust);
  padding: 0.9rem 1.25rem;
  background: var(--paper);
}
.photo-note strong { color: var(--ink); }

/* ---- yhteys ---- */
.yhteys-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; margin-bottom: 2.5rem; }
.yhteys-grid dt {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--rust-text);
  margin-bottom: 0.5rem;
}
.yhteys-grid dd { font-size: 0.9375rem; }
.muted { color: var(--pencil); font-size: 0.875rem; }

/* ---- footer ---- */
.footer {
  border-top: 1px solid rgba(35, 33, 29, 0.15);
  text-align: center;
  padding: 2.5rem 1.5rem calc(2.5rem + env(safe-area-inset-bottom));
  color: var(--pencil);
  font-size: 0.875rem;
}
.footer a { color: var(--ink); text-decoration-color: var(--rust); text-underline-offset: 3px; }
.footer .small { margin-top: 0.35rem; font-size: 0.8125rem; }

/* ---- entrance ---- */
@media (prefers-reduced-motion: no-preference) {
  .cover-inner > * { animation: rise 1s cubic-bezier(0.2, 0.7, 0.3, 1) both; }
  .cover-inner > :nth-child(2) { animation-delay: 0.08s; }
  .cover-inner > :nth-child(3) { animation-delay: 0.16s; }
  .cover-inner > :nth-child(4) { animation-delay: 0.24s; }
  @keyframes rise { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---- responsive ---- */
@media (max-width: 860px) {
  .split { grid-template-columns: 1fr; gap: 2rem; }
  .steps { grid-template-columns: 1fr; gap: 2rem; }
  .yhteys-grid { grid-template-columns: 1fr; gap: 1.5rem; }
}
@media (max-width: 560px) {
  :root { --gutter: 1.25rem; }
  .gallery { grid-template-columns: minmax(0, 1fr); max-width: 24rem; }
  .link-cta { display: block; text-align: center; }
}

/* --- Tekoälyilmoitus (EU AI Act 50 art.) — webpages/kit/ai-disclosure/ --- */
.ai-note {
  margin: 1.5rem auto 0;
  max-width: 62ch;
  padding: 0 1rem 2rem;
  font-size: 0.75rem;
  line-height: 1.55;
}
.ai-note strong { font-weight: 600; }
