/* J413-3d vaihe 1: etusivun ensiruutu, 3D-puhelin. Värit vain /style.css:n muuttujista (--p 60, --t 30, --k 10),
   ei yhtään uutta heksaa. Etusivu on aina tumma (data-theme="dark" kiinteästi, CEO 30.11.). */
/* avoid-ai-design-ignore-file: SD2 -- near-black + orange is the owner's palette O1/O2 (28.11.2026), not a default */
@font-face { font-family: "Archivo"; src: url("/fonts/archivo-wdth-fi.woff2") format("woff2"); font-weight: 100 900; font-stretch: 62% 125%; font-display: swap; }

:root { --disp: "Archivo", "Familjen Grotesk", "Helvetica Neue", Arial, sans-serif; --e3d-ease: cubic-bezier(.23, 1, .32, 1); }
html, body.e3d-body { background: var(--p); }
body.e3d-body { overflow-x: clip; }
::selection { background: var(--k); color: var(--p); }

/* the sky: one fixed canvas under everything, drawn once (tahdet.js) */
.e3d-stars { position: fixed; inset: 0 0 auto 0; width: 100%; height: 200lvh; z-index: 0; pointer-events: none; will-change: transform; }
/* the phone: one fixed transparent canvas above the ribbon and under the text (lava.js adds it) */
.e3d-gl { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 2; pointer-events: none; opacity: 0; transition: opacity .3s ease; }
html.j3d .e3d-gl { opacity: 1; }
/* on a phone the canvas lies in the page and scrolls with the text between drawn frames (lava.js moves it under the screen) */
.e3d-gl.is-doc { position: absolute; inset: 0 auto auto 0; width: 100%; will-change: transform; }

.top { position: relative; z-index: 4; background: color-mix(in srgb, var(--p) 86%, transparent); }

.e3d { position: relative; padding: 0; min-height: calc(100svh - 69px); display: grid; align-items: center; overflow: clip; }
.e3d-wrap { position: relative; z-index: 3; width: min(1280px, 100% - 80px); margin-inline: auto; display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(0, .82fr); gap: clamp(24px, 3vw, 56px); align-items: center; padding-block: clamp(24px, 4vh, 48px); }
.e3d-copy { position: relative; z-index: 3; }

/* H1: the keyword line small, the promise as the display line (Archivo wide + heavy) */
.e3d h1 { margin: 0; font-family: var(--disp); color: var(--t); }
.e3d .h1-kw { display: block; font-family: var(--font); font-size: clamp(1rem, 1.25vw, 1.15rem); font-weight: 600; letter-spacing: 0; line-height: 1.3; margin-bottom: .5em; color: color-mix(in srgb, var(--t) 84%, var(--p)); }
.e3d .h1-claim { display: block; font-size: clamp(2.6rem, min(4vw, 7svh), 4.4rem); font-weight: 800; font-stretch: 112%; line-height: .94; letter-spacing: -.028em; text-wrap: balance; max-width: 16ch; }
.e3d .lead { font-size: 1.12rem; line-height: 1.45; color: color-mix(in srgb, var(--t) 84%, var(--p)); margin: 16px 0 0; max-width: 46ch; }
.e3d .speed { background: color-mix(in srgb, var(--p) 70%, transparent); }

/* prices: Archivo numbers, even width (Y14) */
.e3d-prices { position: relative; max-width: 600px; background: color-mix(in srgb, var(--p) 62%, transparent); border-color: var(--t); color: var(--t); }
.e3d-prices b { font-family: var(--disp); font-weight: 800; font-stretch: 108%; font-variant-numeric: tabular-nums; color: var(--t); }
.e3d-prices i { color: var(--t); }
.e3d-prices span, .e3d-prices em { color: color-mix(in srgb, var(--t) 84%, var(--p)); }
/* the orange underline draws in once the phone is up (lava.js sets .e3d-on); without JS it is simply there */
.e3d-prices::after { content: ""; position: absolute; left: 0; bottom: -2px; height: 2px; width: 100%; background: var(--k); transform-origin: left; }
html.js .e3d-prices::after { transform: scaleX(var(--ul, 0)); }
.e3d-acts { margin-top: 20px; }
.e3d-prices { margin-top: 18px; padding-block: 10px 8px; }
.e3d-prices em { margin-top: 6px; padding-top: 7px; }
/* Y1 + Y9: touch size and give */
.e3d .btn { min-height: 52px; touch-action: manipulation; transition: transform .12s ease, background-color .18s ease; }
.e3d .btn:active { transform: scale(.97); }

/* the name field (Y15): visible label, 48 px, orange caret; its value goes to the phone screen */
.e3d-name { margin-top: 18px; max-width: 470px; display: grid; grid-template-columns: auto 1fr; align-items: baseline; gap: 0 12px; }
.e3d-name .e3d-name-row { grid-column: 1 / -1; grid-row: 2; }
.e3d-name label { display: block; font-weight: 600; font-size: .95rem; color: var(--t); margin-bottom: 6px; }
.e3d-name-row { position: relative; }
.e3d-name input { width: 100%; min-height: 48px; padding: 0 14px; font: 500 1.06rem/1 var(--font); color: var(--t); background: color-mix(in srgb, var(--p) 70%, transparent);
  border: 1px solid color-mix(in srgb, var(--t) 46%, transparent); border-radius: 8px; caret-color: var(--k); }
.e3d-name input::placeholder { color: color-mix(in srgb, var(--t) 52%, var(--p)); }
.e3d-name input:focus-visible { outline: 3px solid var(--k); outline-offset: 3px; border-color: var(--t); }
.e3d-name-help { grid-row: 3; grid-column: 1 / -1; margin: 6px 0 0; font-size: .84rem; color: color-mix(in srgb, var(--t) 72%, var(--p)); }
/* a thin line from the field to the phone (desktop) */
.e3d-name-tie { position: absolute; left: 100%; top: 50%; height: 1px; width: var(--tie, 0px); background: linear-gradient(90deg, color-mix(in srgb, var(--t) 50%, transparent), transparent); pointer-events: none; }
html.j3d-odota .e3d-name { opacity: 0; }

/* the slot: the phone's place comes from this box, never from fixed coordinates */
.e3d-slot { position: relative; height: min(74svh, 720px); min-height: 420px; }
.e3d-handset { position: absolute; inset: 0; margin: auto; width: auto; height: 100%; aspect-ratio: 560 / 1212; right: auto; bottom: auto; left: 50%; translate: -50% 0;
  transform: rotate(-6deg); border-radius: 13% / 6%; padding: 2.2%; background: color-mix(in srgb, var(--t) 14%, var(--p));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--t) 22%, transparent), 6px 0 0 -2px var(--k), 0 40px 80px -30px transparent; }
.e3d-handset img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 11% / 5.2%; }
html.j3d-odota .e3d-handset, html.j3d .e3d-handset { visibility: hidden; }

/* the drag handle follows the slot; the canvas itself never takes pointer events (links under it work) */
.e3d-grab { position: absolute; left: 50%; top: 0; height: 100%; aspect-ratio: .5;  translate: -50% 0; touch-action: pan-y; cursor: grab; border-radius: 14% / 7%; display: none; }
html.j3d .e3d-grab { display: block; }
.e3d-grab:active, .e3d-grab.is-drag { cursor: grabbing; }
.e3d-grab:focus-visible { outline: 3px solid var(--t); outline-offset: 6px; }

.e3d-ctrl { position: absolute; left: 50%; bottom: 8px; translate: -50% 0; display: none; gap: 8px; align-items: center; z-index: 3; }
/* Jussi 1.12.: no visible spin buttons. Pause stays (WCAG 2.2.2): a tap on the phone, reduced motion, and this button,
   which is visible only while it has keyboard focus */
.e3d-pause:not(:focus-visible) { position: absolute; width: 1px; height: 1px; min-width: 0; min-height: 0; padding: 0; border: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
html.j3d .e3d-ctrl { display: flex; }
.e3d-arrow, .e3d-pause { min-height: 44px; min-width: 44px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--t) 34%, transparent); background: color-mix(in srgb, var(--p) 72%, transparent);
  color: var(--t); font: 600 .86rem/1 var(--font); cursor: pointer; touch-action: manipulation; transition: transform .12s ease, border-color .18s ease; display: inline-grid; place-items: center; padding: 0 14px; }
.e3d-arrow { padding: 0; }
.e3d-arrow svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.e3d-arrow:active, .e3d-pause:active { transform: scale(.97); }
.e3d-pause[aria-pressed="true"] { border-color: var(--k); }
.e3d-arrow, .e3d-pause { transition: transform .12s ease, translate .22s cubic-bezier(.23, 1, .32, 1), border-color .18s ease; }
@media (hover: hover) and (pointer: fine) { .e3d-arrow:hover, .e3d-pause:hover { border-color: var(--t); translate: 0 -2px; } }

/* the ribbon: behind the phone, in front of the stars */
.e3d-ribbon { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; overflow: visible; }
/* J445: the hero clips the ribbon flat at its bottom edge; while the page scrolls that edge came into view as a cut-off
   piece. The last stretch fades out instead, so the band always ends softly. */
.e3d-ribbon { -webkit-mask-image: linear-gradient(to bottom, black calc(100% - 220px), transparent calc(100% - 20px)); mask-image: linear-gradient(to bottom, black calc(100% - 220px), transparent calc(100% - 20px)); }
.rb-band { fill: none; stroke: var(--t); stroke-width: 64; stroke-linecap: butt; }
.rb-line { fill: none; stroke: var(--k); stroke-width: 4; }
.rb-text { font: 700 26px/1 var(--disp); font-stretch: 112%; letter-spacing: .04em; text-transform: uppercase; fill: var(--p); dominant-baseline: central; }
html.js .rb-band, html.js .rb-line { stroke-dasharray: var(--rb-len, 4000); stroke-dashoffset: var(--rb-len, 4000); }
/* the ribbon text is dark on dark: it shows only where the band has drawn, so it needs no fade (a JS fade made it the late LCP) */

.e3d-next { position: relative; z-index: 3; padding: 56px 0 72px; border-top: 1px solid var(--rule); background: var(--p); }
.e3d-next p { color: color-mix(in srgb, var(--t) 80%, var(--p)); }
.e3d-next a { color: var(--t); text-underline-offset: .22em; text-decoration-thickness: 1px; }
.e3d-next a:hover { text-decoration-thickness: 2px; text-decoration-color: var(--k); }

/* ---- phone width: text first, the phone under it, bleeding over the bottom edge (More Nutrition idea) ---- */
@media (max-width: 900px) {
  .e3d { min-height: 0; align-items: start; }
  .e3d-wrap { width: calc(100% - 32px); grid-template-columns: 1fr; gap: 0; padding-block: 14px 0; }
  .e3d-copy { display: contents; }
  .e3d .speed { order: 1; justify-self: start; margin-bottom: 10px; }
  .e3d h1 { order: 2; }
  .e3d-prices { order: 3; }
  .e3d-acts { order: 4; }
  .e3d-name { order: 5; }
  .e3d-slot { order: 6; }
  .e3d .lead { order: 7; margin: 18px 0 32px; }
  .e3d .h1-kw { font-size: 1rem; margin-bottom: .35em; }
  .e3d .h1-claim { font-size: clamp(2.5rem, 11.6vw, 3.4rem); font-stretch: 84%; line-height: .9; letter-spacing: -.02em; }
  .e3d-prices { margin-top: 14px; }
  .e3d-acts { margin-top: 14px; }
  .e3d-acts .btn.line { display: none; }
  .e3d-acts .btn.go { width: 100%; max-width: 460px; justify-content: space-between; }
  .e3d-name { margin-top: 14px; max-width: none; }
  .e3d-name-help { display: none; }
  .e3d-name-tie { display: none; }
  .e3d-slot { height: 540px; min-height: 0; margin: 10px 0 0; }
  .e3d .speed { margin-bottom: 8px; padding-block: 5px; }
  .e3d-prices em { font-size: .8rem; }
  .e3d-ribbon .rb-band { stroke-width: 44; }
  .rb-text { font-size: 18px; }
}
/* vaihe 2 (Jussi 30.11.): the phone bigger on a phone, about 390 px of it on the first screen */
@media (max-width: 900px) {
  .e3d .speed { margin-bottom: 6px; }
  .e3d .h1-claim { font-size: clamp(2.3rem, 10.6vw, 3.2rem); }
  .e3d-prices { margin-top: 10px; padding-block: 8px 6px; }
  /* the unit moves next to the numbers; the long line (no commitment, 16 months, ad budget) stays in #hinnat and on the ribbon */
  .e3d-prices em { display: none; }
  .e3d-prices b::after { content: "/kk"; font-size: .46em; font-weight: 700; font-stretch: 100%; margin-left: 2px; letter-spacing: 0; }
  html[lang="en"] .e3d-prices:not(.al-prices) b::after { content: "/mo"; }
  .e3d-acts { margin-top: 10px; }
  .e3d-name { margin-top: 10px; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 0 10px; }
  .e3d-name label { margin: 0; grid-row: 1; grid-column: 1; font-size: .9rem; }
  .e3d-name .e3d-name-row { grid-row: 1; grid-column: 2; }
  .e3d-name input { min-height: 46px; }
  .e3d-slot { height: 560px; margin: -4px 46px 0 0; }
}
@media (max-width: 380px) { .e3d .h1-claim { font-size: 2.3rem; } }

@media (prefers-reduced-motion: reduce) {
    .e3d .btn, .e3d-arrow, .e3d-pause { transition: none; }
  .speed-dot { animation: none; }
}
/* Y11: every pressable gets a visible ring from the palette */
.e3d .btn:focus-visible, .e3d-arrow:focus-visible, .e3d-pause:focus-visible, .e3d-next a:focus-visible, .top a:focus-visible { outline: 3px solid var(--t); outline-offset: 3px; }

/* ================= vaihe 2: the whole page. Sections sit above the phone canvas (z 3 over 2): the phone can pass
   behind text but never over it. Sections where the phone lives keep no background of their own. ================= */
.e3d-sec { position: relative; z-index: 3; }
.qs.e3d-sec, .days.e3d-sec, .e3d-ex, .contact.e3d-sec, .promises.e3d-sec, .kokeile { background: transparent; }
.kokeile { position: relative; z-index: 3; }
.e3d-split { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: clamp(32px, 6vw, 96px); align-items: start; }
.e3d-sec-r .e3d-split { grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); }
/* the slot column stays on screen while the text passes by (Butterly), the phone with it */
.e3d-col { position: sticky; top: 76px; height: calc(100svh - 100px); max-height: 820px; min-height: 460px; }
.e3d-col .e3d-slot { height: 100%; min-height: 0; }
.e3d-col .e3d-handset { height: 80%; }
.e3d-static { height: 100%; display: grid; place-items: center; transition: opacity .3s ease; }
html.j3d .e3d-static { opacity: 0; }
.days .e3d-static .chat { grid-column: auto; grid-row: auto; }

/* 2. three answers = three tiers */
.e3d-tiers { display: flex; flex-wrap: wrap; gap: 8px; margin: -8px 0 clamp(24px, 4vw, 48px); }
.e3d-tb { min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--t) 34%, transparent); background: color-mix(in srgb, var(--p) 72%, transparent);
  color: var(--t); font: 600 .95rem/1 var(--font); cursor: pointer; touch-action: manipulation; transition: transform .12s ease, border-color .18s ease, background-color .18s ease; }
.e3d-tb span { font-family: var(--disp); font-weight: 800; font-stretch: 108%; font-variant-numeric: tabular-nums; margin-left: 4px; }
.e3d-tb[aria-pressed="true"] { border-color: var(--k); background: color-mix(in srgb, var(--k) 16%, var(--p)); }
.e3d-tb:active { transform: scale(.97); }
/* J544: the tier pill lifts 2 px on hover (separate `translate`, so the :active scale still composes) */
.e3d-tb { transition: transform .12s ease, translate .22s cubic-bezier(.23, 1, .32, 1), border-color .18s ease, background-color .18s ease, box-shadow .22s ease; }
@media (hover: hover) and (pointer: fine) { .e3d-tb:hover { border-color: var(--t); translate: 0 -2px; box-shadow: 0 10px 22px -14px var(--shadow); } }
.e3d-q { min-height: 58svh; display: grid; align-content: center; padding-left: clamp(18px, 2vw, 28px); border-left: 2px solid var(--rule); transition: border-color .3s ease; }
.e3d-q + .e3d-q { margin-top: 12px; }
.e3d-q.is-on { border-left-color: var(--k); }
.e3d-tier { margin: 18px 0 0; color: var(--t); font-size: 1.02rem; }
.e3d-tier b { font-family: var(--disp); font-weight: 800; font-stretch: 108%; letter-spacing: .01em; margin-right: 6px; }
.e3d-q .q-copy p.e3d-tier { color: var(--t); margin-top: 18px; font-size: 1.02rem; }

/* 3. three days: timeline left, the thread on the phone right */
.days.e3d-sec .timeline { grid-template-columns: 1fr; }

/* 5. examples */
.e3d-ex { padding-block: clamp(72px, 10vw, 140px); }
.e3d-ex .e3d-txt { align-self: center; }
.ex-k { font-weight: 700; color: var(--graphite); margin: 0 0 14px; }
.e3d-ex .show-tabs { position: static; margin: 0 0 22px; }
.ex-panel > p { font-size: var(--step-1); line-height: 1.5; color: color-mix(in srgb, var(--t) 84%, var(--p)); margin: 0 0 22px; max-width: 46ch; }
.ex-panel .js-sname { color: var(--t); font-family: var(--disp); font-weight: 800; font-stretch: 108%; font-size: 1.5em; display: block; letter-spacing: -.01em; }
.ex-panel a { color: var(--t); text-underline-offset: .22em; }
.ex-shot { display: none; border-radius: 14px; overflow: hidden; box-shadow: 0 0 0 1px var(--rule), 0 40px 80px -40px var(--shadow); transition: transform .3s var(--e3d-ease); }
.ex-shot.is-on { display: block; }
.ex-shot img { display: block; width: 100%; height: auto; }
@media (hover: hover) and (pointer: fine) { .ex-shot:hover { transform: translateY(-3px); } }
.e3d-ex .e3d-handset:not(.is-on) { display: none; }

/* 6. contact: a small phone in the links column */
.e3d-slot-sm { height: 380px; min-height: 0; margin-top: 28px; }
.e3d-slot-sm .e3d-handset { height: 92%; }
.contact.e3d-sec { padding-block: clamp(72px, 9vw, 128px); }

.e3d-sec :focus-visible, .kokeile :focus-visible { outline: 3px solid var(--t); outline-offset: 3px; }
.e3d-tb:focus-visible, .ex-tabs button:focus-visible, .ex-pause:focus-visible, .ex-shot:focus-visible { outline: 3px solid var(--t); outline-offset: 3px; }

@media (max-width: 900px) {
  .e3d-split, .e3d-sec-r .e3d-split { grid-template-columns: 1fr; gap: 0; }
  .e3d-txt { display: contents; }
  .e3d-col { position: relative; top: 0; height: 500px; min-height: 0; max-height: none; }
  .qs .head { order: 1; margin-bottom: 20px; }
  .qs .e3d-col { order: 2; }
  .e3d-tiers { order: 3; margin: 22px 0 8px; }
  .e3d-q { order: 4; min-height: 0; margin-top: 22px; padding-block: 4px; }
  .days .head { order: 1; } .days .timeline { order: 2; } .days .e3d-col { order: 3; margin-top: 24px; height: 560px; }
  .e3d-ex .ex-k { order: 1; } .e3d-ex .ex-tabs { order: 2; } .e3d-ex .e3d-col { order: 3; } .e3d-ex .ex-panel { order: 4; margin-top: 22px; }
  .e3d-slot-sm { height: 340px; }
}
@media (prefers-reduced-motion: reduce) { .e3d-tb, .e3d-q, .ex-shot, .e3d-static, .e3d-arrow, .e3d-pause { transition: none; } .e3d-tb:hover, .e3d-arrow:hover, .e3d-pause:hover { translate: none; } }
/* J519: the tab fill bar moves only while the rotation runs (osiot.js adds .is-run); otherwise the chosen tab shows a still, full bar */
.show-tabs.ex-tabs [aria-selected="true"] .bar::after { animation: none; transform: scaleX(1); }
.show-tabs.ex-tabs.is-run [aria-selected="true"] .bar::after { animation: fill 10s linear forwards; }
@media (prefers-reduced-motion: reduce) { .show-tabs.ex-tabs.is-run [aria-selected="true"] .bar::after { animation: none; } }
.kokeile .k-field input:focus-visible, .kokeile .k-field select:focus-visible, .contact .cf input:focus-visible, .contact .cf textarea:focus-visible { outline: 3px solid var(--t); outline-offset: 2px; }
