/* Ezencia Fokus landing page (/fokus/), on top of the Zen layer (tokens.css + zen.css).
   The story is a pinned stage: the day scattered → mapped by topic → one calm screen.
   Steps are driven by an IntersectionObserver; the stage only moves with transform and opacity,
   and nothing is tied to the scroll position itself (iOS, PR #57). */

.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- brand tiles: every logo sits on its own light tile, untouched ---------- */
.lg { --s: 22px; display: inline-grid; place-items: center; flex: none; width: var(--s); height: var(--s); border-radius: var(--ez-r-photo);
  background: var(--ez-count); box-shadow: 0 0 0 1px var(--ez-line); }
.lg svg { width: 64%; height: 64%; display: block; }
.lg-gr { background: #B2C248; } /* Granola's own icon ground, measured from its official favicon */
.lg-gr svg { width: 72%; height: 72%; }

/* ---------- hero ---------- */
.fk-hero h1 { max-width: 15ch; }
.fk-hero .lede b { font-weight: 700; }
.fk-tools { margin-top: clamp(26px, 3vw, 38px); padding-top: 18px; border-top: 1px solid var(--ez-line); }
.fk-tools .fine { margin: 0 0 12px; }
.fk-logos { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px 18px; }
.fk-logos li { display: inline-flex; align-items: center; gap: 9px; font-weight: 500; font-size: .95rem; color: var(--ez-ink-2); }
.fk-logos .lg { --s: 30px; }
.fk-hero-wrap .hero-stones .engraved { font-size: clamp(20px, 2.4vw, 34px); }
@media (max-width: 1099px) { .fk-hero-wrap .hero-stones .engraved { font-size: 22px; } }

/* ---------- the story: a pinned stage, steps passing over it ---------- */
.fk-story { position: relative; width: min(calc(100% - 2 * var(--ez-gutter)), var(--max)); margin-left: auto; margin-right: auto; }
.fk-stage { position: sticky; top: 0; height: 100vh; height: 100svh; display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  gap: 14px; padding-top: 14px; pointer-events: none; }
.fk-steps { position: relative; z-index: 1; margin-top: -100vh; margin-top: -100svh; }
.fk-step { min-height: 98vh; min-height: 98svh; display: flex; align-items: flex-end; padding-bottom: 5svh; }
.fk-step:first-child { min-height: 100vh; min-height: 100svh; }
.fk-bed { width: 100%; padding: 22px 22px 24px; border-radius: var(--ez-r-bed-l); }
/* the story beds pass over the pinned phone, so they keep their own ground even when the canvas draws the garden */
html.gl .fk-story .fk-bed { background: var(--ez-ground); box-shadow: 0 0 0 1px var(--ez-line-strong); }
/* steps 1-3 carry their own bed and rake echo (the canvas does not draw them), so nothing stays behind when they dissolve */
.fk-bed:not([data-bed]) { position: relative; background: var(--ez-ground); box-shadow: 0 0 0 1px var(--ez-line-strong), 0 0 0 7px var(--ez-ground), 0 0 0 8px var(--ez-line); }
/* phones: a read bed dissolves once it has passed the reading zone, so it never lies over the phone for long;
   only a class changes (fokus.js), the fade is opacity and transform */
@media (max-width: 999px) {
  .fk-story .fk-bed { transition: opacity 500ms var(--ez-ease-out), transform 700ms var(--ez-ease-out); }
  .fk-story .fk-bed.read { opacity: 0; transform: translateY(-14px); }
}
.fk-bed h3 { font-family: var(--mincho); font-weight: 700; font-size: clamp(1.45rem, 2.4vw, 2.1rem); line-height: 1.12; letter-spacing: -.012em; margin: 0; max-width: 20ch; }
.fk-bed p { margin: 10px 0 0; color: var(--ez-ink-2); max-width: 40em; }
.fk-bed .fine { color: var(--ez-ink-3); }

/* the meter: tracked and saved today, always labelled as an example */
.fk-pin { position: sticky; top: 14px; height: 0; z-index: 3; display: flex; justify-content: center; align-items: flex-start; pointer-events: none; transition: opacity 600ms var(--ez-ease-out); }
.fk-story[data-s="0"] .fk-pin, .fk-story.ending .fk-pin { opacity: 0; }
.fk-pin + .fk-stage { padding-top: 104px; }
.fk-meter { position: relative; display: grid; grid-template-columns: auto auto; column-gap: 22px; align-items: end; padding: 10px 18px 12px; background: var(--ez-ground);
  border-radius: var(--ez-r-bed-s); box-shadow: 0 0 0 1px var(--ez-line-strong), 0 0 0 6px var(--ez-ground), 0 0 0 7px var(--ez-line); }
.fk-meter .m { display: grid; gap: 1px; }
.fk-meter .m span { font-size: .78rem; font-weight: 500; color: var(--ez-ink-3); }
.fk-meter .m b { font-family: var(--mincho); font-weight: 700; font-size: clamp(1.3rem, 2.2vw, 1.9rem); line-height: 1.1; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fk-meter .m-save b { color: var(--ez-accent-ink); }
.fk-meter .tag { position: absolute; top: -10px; right: 14px; padding: 1px 8px; font-size: .74rem; font-weight: 500; color: var(--ez-ink-2); background: var(--ez-ground);
  border: 1px solid var(--ez-line-strong); border-radius: var(--ez-r-action); }
.fk-meter .prog { position: absolute; left: 18px; right: 18px; bottom: 4px; display: flex; gap: 4px; }
.fk-meter .prog i { flex: 1; height: 2px; background: var(--ez-line); transform-origin: left; }
.fk-meter .prog i::after { content: ""; display: block; height: 100%; background: var(--ez-accent); transform: scaleX(0); transform-origin: left; transition: transform var(--ez-dur-base) var(--ez-ease-out); }
.fk-story[data-s="1"] .prog i:nth-child(1)::after,
.fk-story[data-s="2"] .prog i:nth-child(-n+2)::after,
.fk-story[data-s="3"] .prog i::after, .fk-story[data-s="4"] .prog i::after { transform: none; }

/* the phone action bed steps aside while the story runs, so the step beds stay readable */
html.fk-in-story .sticky.show { transform: translateY(calc(100% + 24px)); }

/* the device: one phone, cut from basalt */
.fk-device { --pw: min(232px, calc((100svh - 120px) * .58 * .485)); position: relative; width: var(--pw); container-type: inline-size; }
.phone { position: relative; aspect-ratio: 300 / 618; border-radius: 13cqw; padding: 4.5cqw;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='.35'/%3E%3C/svg%3E"), radial-gradient(120% 90% at 30% 18%, var(--ez-stone-hi), var(--ez-stone) 46%, var(--ez-stone-lo) 82%);
  background-blend-mode: soft-light, normal;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ez-stone-rim) 85%, transparent), 0 0 0 1px var(--ez-line-strong), var(--ez-shadow-action), 0 30px 60px -40px rgba(0,0,0,.55); }
.screen { position: relative; height: 100%; border-radius: 10.4cqw; overflow: hidden; background: var(--ez-ground); color: var(--ez-ink); container-type: inline-size; }
.scr { position: absolute; inset: 0; padding: 13cqw 7.5cqw 7cqw; display: flex; flex-direction: column; gap: 4cqw;
  font-size: 4.6cqw; line-height: 1.35; transition: opacity 600ms var(--ez-ease-out), transform 800ms var(--ez-ease-out); }
.scr-top { display: flex; justify-content: space-between; align-items: baseline; margin: 0; font-weight: 500; font-size: 4.4cqw; color: var(--ez-ink-2); }
.scr-top em { font-style: normal; font-size: 3.6cqw; padding: .2em .6em; border: 1px solid var(--ez-line-strong); border-radius: var(--ez-r-action); color: var(--ez-ink-2); }
.scr-h { margin: 0; font-family: var(--mincho); font-weight: 700; font-size: 7.6cqw; line-height: 1.12; letter-spacing: -.01em; }
.scr .lg { --s: 7.4cqw; }
.scr .fb { display: block; height: 1.3cqw; background: var(--ez-line); border-radius: 1cqw; overflow: hidden; }
.scr .fb > i { display: block; height: 100%; background: var(--ez-ink); transform-origin: left; transition: transform 1100ms var(--ez-ease-out); }

.hours { list-style: none; margin: 1cqw 0 0; padding: 0; display: grid; gap: 4.4cqw; }
.hours li { display: grid; grid-template-columns: auto 1fr auto; align-items: center; column-gap: 3cqw; row-gap: 1.8cqw; }
.hours li > span:nth-child(2) { font-size: 4.3cqw; color: var(--ez-ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hours b { font-family: var(--mincho); font-weight: 700; font-size: 4.6cqw; font-variant-numeric: tabular-nums; }
.hours .fb { grid-column: 1 / -1; }
.hours .fb > i { transform: scaleX(var(--v)); }
.hours li:nth-child(2) .fb > i { transition-delay: 80ms; } .hours li:nth-child(3) .fb > i { transition-delay: 160ms; }
.hours li:nth-child(4) .fb > i { transition-delay: 240ms; } .hours li:nth-child(5) .fb > i { transition-delay: 320ms; }

.total { margin: auto 0 0; display: flex; justify-content: space-between; align-items: baseline; padding-top: 3.4cqw; border-top: 1px solid var(--ez-line); font-size: 3.8cqw; color: var(--ez-ink-2); }
.total b { font-family: var(--mincho); font-weight: 700; font-size: 6cqw; color: var(--ez-ink); font-variant-numeric: tabular-nums; }
.map { display: grid; grid-template-columns: 1fr 1fr; gap: 3.4cqw; margin-top: 1cqw; }
.topic { display: grid; gap: 1.6cqw; align-content: start; padding: 4.4cqw 4cqw; border-radius: 6cqw; background: var(--ez-ground-sunk); transition: opacity 600ms var(--ez-ease-out), transform 800ms var(--ez-ease-out); }
.topic b { font-family: var(--mincho); font-weight: 700; font-size: 5.6cqw; line-height: 1.1; }
.topic small { font-size: 3.5cqw; color: var(--ez-ink-2); line-height: 1.3; }
.topic .lgs { display: flex; gap: 1.6cqw; }
.topic.t4 { grid-column: 1 / -1; }
.t2 { transition-delay: 90ms; } .t3 { transition-delay: 180ms; } .t4 { transition-delay: 270ms; }

.north { margin: 0; display: grid; gap: .5cqw; }
.north small, .one small, .won small { font-size: 3.5cqw; font-weight: 500; color: var(--ez-ink-3); }
.north span { font-family: var(--mincho); font-size: 5.6cqw; line-height: 1.22; }
.one { display: grid; gap: 1.2cqw; padding: 4.6cqw 5cqw; background: var(--ez-ink); color: var(--ez-on-ink); border-radius: var(--ez-r-photo); }
.one small { color: color-mix(in srgb, var(--ez-on-ink) 70%, transparent); }
.one b { font-family: var(--mincho); font-weight: 700; font-size: 5.6cqw; line-height: 1.18; }
.one span { font-size: 3.6cqw; color: color-mix(in srgb, var(--ez-on-ink) 78%, transparent); }
.works { margin: 1cqw 0 0; font-size: 3.5cqw; font-weight: 500; color: var(--ez-ink-3); }
.flows { list-style: none; margin: -2cqw 0 0; padding: 0; display: grid; gap: 2.8cqw; }
.flows li { display: flex; gap: 3cqw; align-items: center; font-size: 3.8cqw; line-height: 1.3; color: var(--ez-ink-2); }
.flows .lg { --s: 6.4cqw; }
.kern { margin: auto 0 0; display: flex; gap: 3cqw; align-items: center; padding-top: 3.4cqw; border-top: 1px solid var(--ez-line); font-size: 3.8cqw; line-height: 1.3; color: var(--ez-ink-2); }
.kern b { color: var(--ez-ink); font-weight: 700; }
.kz { flex: none; display: grid; place-items: center; width: 8cqw; height: 8cqw; border-radius: 50%; background: var(--ez-ink); color: var(--ez-on-ink); }
.kz svg { width: 62%; height: 62%; }
.won { margin-top: 1cqw; display: grid; gap: 2cqw; }
.won p { margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 2cqw; }
.won small { flex-basis: 100%; }
.won b { font-family: var(--mincho); font-weight: 700; font-size: 7cqw; color: var(--ez-accent-ink); font-variant-numeric: tabular-nums; }
.won span { font-size: 3.6cqw; color: var(--ez-ink-2); }
.won .fb > i { background: var(--ez-accent); transform: scaleX(.81); transition-delay: 200ms; }

/* the scattered day around the phone */
.chip { position: absolute; display: inline-flex; align-items: center; gap: 7px; padding: 6px 10px 6px 7px; white-space: nowrap;
  font-size: .78rem; font-weight: 500; color: var(--ez-ink); background: var(--ez-ground); border-radius: var(--ez-r-action);
  box-shadow: 0 0 0 1px var(--ez-line-strong), 0 8px 18px -12px rgba(0,0,0,.45);
  transform: translate(0, 0) rotate(var(--r)); transition: transform 900ms var(--ez-ease-out), opacity 600ms var(--ez-ease-out); }
.chip .lg { --s: 20px; }
.c1 { --r: -5deg; left: -30%; top: -7%; --dx: 62cqw; --dy: 30cqw; }
.c2 { --r: 4deg; right: -40%; top: -6%; --dx: -60cqw; --dy: 18cqw; }
.c3 { --r: -3deg; left: -34%; top: 77%; --dx: 58cqw; --dy: -6cqw; }
.c4 { --r: 6deg; right: -36%; top: 70%; --dx: -56cqw; --dy: -22cqw; }
.c5 { --r: -4deg; left: -40%; top: 58%; --dx: 46cqw; --dy: -46cqw; }

/* ---------- states (only with JS; without it the finished screen simply stands) ---------- */
.fk-story .scr-1, .fk-story .scr-2 { opacity: 0; transform: translateY(4cqw); }
.fk-story .chip { opacity: 0; }
.fk-story[data-s="0"] .scr-1, .fk-story[data-s="1"] .scr-1 { opacity: 1; transform: none; }
.fk-story[data-s="0"] .scr-3, .fk-story[data-s="1"] .scr-3, .fk-story[data-s="2"] .scr-3 { opacity: 0; transform: translateY(4cqw); }
.fk-story[data-s="0"] .hours .fb > i { transform: scaleX(0); }
.fk-story[data-s="1"] .chip { opacity: 1; }
.fk-story[data-s="2"] .scr-1 { opacity: 0; transform: translateY(-4cqw); }
.fk-story[data-s="2"] .scr-2 { opacity: 1; transform: none; }
.fk-story[data-s="2"] .chip { opacity: 0; transform: translate(var(--dx), var(--dy)) rotate(0deg) scale(.55); }
.fk-story[data-s="3"] .chip, .fk-story[data-s="4"] .chip { transform: translate(var(--dx), var(--dy)) scale(.4); }
.fk-story[data-s="0"] .topic, .fk-story[data-s="1"] .topic { opacity: 0; transform: translateY(5cqw) scale(.96); }
.fk-story[data-s="3"] .scr-2, .fk-story[data-s="4"] .scr-2 { opacity: 0; transform: translateY(-4cqw); }
.fk-story[data-s="0"] .won .fb > i, .fk-story[data-s="1"] .won .fb > i, .fk-story[data-s="2"] .won .fb > i { transform: scaleX(0); }

/* phones: at the last step the phone steps back so the meter and the answer share the screen */
@media (max-width: 999px) {
  .fk-device { transition: opacity 600ms var(--ez-ease-out), transform 800ms var(--ez-ease-out); }
  .fk-story[data-s="4"] .fk-device { opacity: 0; transform: translateY(-8%); }
}
.fk-mine { font-family: var(--mincho); font-weight: 700; font-size: var(--ez-fs-lede) !important; color: var(--ez-ink) !important; }
.fk-mine small { display: block; font-family: var(--ez-font-body); font-weight: 400; font-size: var(--ez-fs-small); color: var(--ez-ink-3); }

/* step 4: the value of the hour */
.rates { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.rates button { min-height: 44px; min-width: 64px; padding: 0 14px; font: 500 1rem/1 var(--ez-font-body); font-variant-numeric: tabular-nums; color: var(--ez-ink-2);
  background: none; border: 1px solid var(--ez-line-strong); border-radius: var(--ez-r-action); cursor: pointer; transition: background var(--ez-dur-fast), color var(--ez-dur-fast); }
.rates button:hover { color: var(--ez-ink); border-color: var(--ez-ink); }
.rates button[aria-pressed="true"] { background: var(--ez-ink); color: var(--ez-on-ink); border-color: var(--ez-ink); }
.rates button:focus-visible { outline: 2px solid var(--ez-focus-ring); outline-offset: 3px; }
.worth { margin: 18px 0 0 !important; color: var(--ez-ink) !important; font-size: var(--ez-fs-lede); line-height: 1.5; }
.worth b { font-family: var(--mincho); font-weight: 700; font-size: 1.35em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fk-value .fine { margin-top: 14px; }
/* the answer, engraved: the visitor's day value on a real garden stone above the value bed, like the hero's "1 h" */
.fk-step-4 { flex-direction: column; justify-content: flex-end; align-items: stretch; }
.fk-ans { position: relative; height: clamp(150px, 20vh, 190px); pointer-events: none; }
.fk-ans .stone { left: 50%; top: 50%; width: clamp(128px, 12vw, 160px); translate: -50% -50%; }
.fk-ans .engraved { display: grid; justify-items: center; }
.fk-ans .engraved b { font-family: var(--mincho); font-weight: 400; font-size: clamp(1.45rem, 2vw, 1.8rem); line-height: 1; }
.fk-ans .engraved small { font-family: var(--ez-font-body); font-weight: 500; font-size: .78rem; margin-top: 4px; }
@media (min-width: 1000px) { .fk-step-4 { justify-content: center; } }

/* the calm screen develops station by station, like a print in the tray */
.scr-3 > * { transition: opacity 700ms var(--ez-ease-out), transform 900ms var(--ez-ease-out); }
.scr-3 > :nth-child(2) { transition-delay: 120ms; } .scr-3 > :nth-child(3) { transition-delay: 260ms; }
.scr-3 > :nth-child(4), .scr-3 > :nth-child(5) { transition-delay: 420ms; } .scr-3 > :nth-child(6) { transition-delay: 580ms; }
.scr-3 > :nth-child(7) { transition-delay: 740ms; }
.fk-story[data-s="0"] .scr-3 > *, .fk-story[data-s="1"] .scr-3 > *, .fk-story[data-s="2"] .scr-3 > * { opacity: 0; transform: translateY(3cqw); transition-delay: 0ms; }

/* ---------- the quiet sections ---------- */
.fk-who h2, .fk-keep h2, .fk-start h2 { font-family: var(--mincho); font-weight: 700; font-size: var(--ez-fs-h2); line-height: 1.08; letter-spacing: -.02em; margin: 0; max-width: 20ch; }
.fk-who h2 .soft, .fk-start h2 .soft { display: block; font-weight: 400; color: var(--ez-ink-2); }
.fk-rows { list-style: none; margin: clamp(22px, 3vw, 36px) 0 0; padding: 0; display: grid; }
.fk-rows li { display: grid; gap: 4px; padding: 16px 0; border-top: 1px solid var(--ez-line); }
.fk-rows li:last-child { border-bottom: 1px solid var(--ez-line); }
.fk-rows b { font-family: var(--mincho); font-weight: 700; font-size: clamp(1.2rem, 1.7vw, 1.45rem); line-height: 1.2; }
.fk-rows span { color: var(--ez-ink-2); max-width: 46ch; }
.fk-ticks li { grid-template-columns: 22px 1fr; align-items: baseline; gap: 12px; }
.fk-ticks li::before { content: ""; width: 14px; height: 8px; border-left: 2px solid var(--ez-ink-3); border-bottom: 2px solid var(--ez-ink-3); transform: translateY(-3px) rotate(-45deg); }
.fk-ticks span { color: var(--ez-ink); font-size: var(--ez-fs-lede); }
.fk-path { counter-reset: p; }
.fk-path li { counter-increment: p; grid-template-columns: 2.2rem 1fr; column-gap: 12px; }
.fk-path li::before { content: counter(p); grid-row: 1 / span 2; font-family: var(--mincho); font-size: 1.6rem; line-height: 1.1; color: var(--ez-ink-3); font-variant-numeric: tabular-nums; }
.fk-keep .fine, .fk-start .fine { margin-top: 18px; }

/* ---------- wider screens ---------- */
@media (min-width: 700px) {
  .fk-device { --pw: min(270px, calc((100svh - 120px) * .485)); }
  .chip { font-size: .85rem; padding: 7px 12px 7px 8px; }
  .chip .lg { --s: 22px; }
  .fk-rows li { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); column-gap: 32px; align-items: baseline; }
  .fk-ticks li { grid-template-columns: 22px 1fr; }
  .fk-path li { grid-template-columns: 2.2rem minmax(0, 2fr) minmax(0, 3fr); }
  .fk-path li::before { grid-row: auto; }
}
@media (min-width: 1000px) {
  .fk-story { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); column-gap: clamp(32px, 4vw, 64px);
    margin-top: max(12px, calc(var(--sec-gap) - 110px)); } /* the phone's top edge shows below the hero as the invitation to scroll */
  .fk-stage { grid-column: 2; grid-row: 1; align-self: start; justify-content: center; gap: 22px; padding-top: 0; }
  .fk-pin { grid-column: 2; grid-row: 1; align-self: start; top: 22px; }
  .fk-pin + .fk-stage { padding-top: 112px; justify-content: flex-start; }
  .fk-steps { grid-column: 1; grid-row: 1; margin-top: 0; }
  .fk-step, .fk-step:first-child { min-height: 100vh; align-items: center; padding-bottom: 0; }
  .fk-bed { padding: clamp(28px, 3vw, 44px); }
  .fk-device { --pw: min(300px, calc((100vh - 200px) * .485)); }
  .chip .lg { --s: 24px; }
  .c1 { left: -58%; } .c2 { right: -62%; } .c3 { left: -66%; } .c4 { right: -56%; } .c5 { left: -40%; }
  .c1 { --dx: 82cqw; } .c2 { --dx: -84cqw; } .c3 { --dx: 84cqw; } .c4 { --dx: -78cqw; } .c5 { --dx: 64cqw; }
}

@media (prefers-reduced-motion: reduce) {
  .scr, .scr-3 > *, .topic, .chip, .fk-story .fk-bed, .fk-device, .fk-pin, .scr .fb > i, .fk-meter .prog i::after { transition: none !important; }
}
