/* Sourcely Life: one motion film is the page.
   Layout: sticky header (brand, scene navigation, languages) → film stage sized to the viewport
   (16:9 on landscape screens, 9:16 on portrait screens) → footer. Sound toggle sits in the header. */
:root {
  color-scheme: light;
  --paper: #f8f7f1;
  --ink: #1c2a22;
  --text: #3b4a40;
  --moss: #3e6a4e;
  --sage: #a8bea3;
  --pollen: #c9a45f;
  --muted: #7d8c80;
  --line: #daddd0;
  --display: "Newsreader", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --body: "Figtree", "Avenir Next", Avenir, system-ui, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --chrome: 120px; /* header + spacing, measured by motion.js */
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--body); line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 2px solid var(--pollen); outline-offset: 3px; border-radius: 3px; }
::selection { background: #dfe6c4; color: var(--ink); }
.wrap { width: min(1200px, calc(100% - 48px)); margin-inline: auto; }
.skip-link { position: absolute; left: 16px; top: -100px; background: var(--ink); color: var(--paper); padding: 12px 14px; z-index: 30; }
.skip-link:focus { top: 10px; }

/* ---------- header ---------- */
.site-header { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: var(--paper); border-bottom: 1px solid var(--line); }
.site-header .wrap { min-height: 72px; display: flex; align-items: center; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-size: 23px; font-weight: 600; letter-spacing: -1.1px; white-space: nowrap; }
.brand-mark { width: 30px; height: 34px; color: var(--moss); }
.brand-life { font-weight: 400; margin-left: 3px; }
.brand-dot { color: var(--moss); }
.navigation { display: flex; gap: 4px; margin-left: auto; font-size: 13px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.navigation::-webkit-scrollbar { display: none; }
.navigation a { padding: 8px 10px; border-radius: 99px; color: var(--text); white-space: nowrap; transition: background .2s, color .2s; }
.navigation a:hover { background: #ecefe3; }
.navigation a[aria-current="true"] { background: var(--ink); color: var(--paper); }
.languages { position: relative; z-index: 1; flex-shrink: 0; display: flex; align-items: center; gap: 2px; font-size: 12px; letter-spacing: 1px; margin-left: 8px; }
.languages a { padding: 12px 8px; min-width: 40px; text-align: center; border-radius: 6px; color: var(--muted); }
.languages a:hover { background: #ecefe3; color: var(--ink); }
.languages a[aria-current] { color: var(--ink); font-weight: 700; text-decoration: underline; text-underline-offset: 6px; }
.languages span { color: #b8beb0; }

/* ---------- film ---------- */
.film { padding-block: 16px 8px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.stage { position: relative; width: min(100%, calc((100svh - var(--chrome)) * 16 / 9)); aspect-ratio: 16 / 9; max-width: 100%;
  background: var(--paper); color: var(--ink); overflow: hidden; container-type: inline-size; }
.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.sc { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; visibility: hidden; }
.m { display: inline-block; overflow: hidden; vertical-align: bottom; padding-bottom: .08em; margin-bottom: -.08em; }
.w { display: inline-block; will-change: transform; }
.eyebrow { font-family: var(--mono); font-size: 1.15cqw; letter-spacing: .22em; text-transform: uppercase; color: var(--moss); margin: 0; }
.serif { font-family: var(--display); font-weight: 300; letter-spacing: -.025em; line-height: 1.02; margin: 0; text-wrap: balance; }
em.you { font-style: italic; font-weight: 400; color: var(--moss); }

/* intro */
#intro .tri { display: flex; flex-direction: column; align-items: center; gap: .4cqw; }
#intro .tri .serif { font-size: 7.4cqw; }
#intro .rule { width: 22cqw; height: 1px; background: var(--ink); opacity: .35; margin-top: 2cqw; transform-origin: center; }

/* wellbeing */
#wellbeing .block { position: absolute; left: 8cqw; top: 50%; transform: translateY(-50%); text-align: left; max-width: 62cqw; display: flex; flex-direction: column; gap: 1.8cqw; }
#wellbeing h1 { font-size: 7.6cqw; }
#wellbeing .mswash { padding-bottom: 1.8cqw; margin-bottom: -1.8cqw; }
#wellbeing .you-wrap { position: relative; display: inline-block; }
#wellbeing .swash { position: absolute; left: -2%; bottom: -.9cqw; width: 104%; height: 1.6cqw; overflow: visible; }
#wellbeing .swash path { fill: none; stroke: var(--pollen); stroke-width: 2.4; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; }
#wellbeing .sub { font-size: 1.75cqw; max-width: 42cqw; color: var(--text); margin: 0; }

/* formula */
.pill { position: absolute; left: 50%; top: 50%; font-family: var(--body); font-weight: 500; font-size: 2cqw; padding: 1cqw 2.2cqw; border-radius: 99px; border: 1px solid var(--ink); background: var(--paper); white-space: nowrap; }
#p1 { left: 28%; } #p2 { left: 72%; }
#p3 { background: var(--moss); border-color: var(--moss); color: var(--paper); font-family: var(--display); font-style: italic; font-weight: 400; font-size: 3.6cqw; padding: 1.2cqw 3.4cqw; }
#p3 i { font-style: normal; color: var(--pollen); margin-right: .8cqw; }
.plus { position: absolute; left: 50%; top: 50%; font-family: var(--display); font-size: 4cqw; color: var(--moss); line-height: 1; }
.ring { position: absolute; left: 50%; top: 50%; width: 34cqw; height: 34cqw; overflow: visible; }
.ring circle { fill: none; stroke: var(--sage); stroke-width: 1; stroke-dasharray: 3 7; }
#formula .cap { position: absolute; left: 0; right: 0; bottom: 7cqw; font-family: var(--display); font-style: italic; font-size: 2.2cqw; color: var(--text); margin: 0; }
#formula .cap span { font-style: normal; color: var(--pollen); }

/* whole person */
#whole-person .block { display: flex; flex-direction: column; align-items: center; gap: 2.2cqw; }
#whole-person h2 { font-size: 6.2cqw; }
#whole-person .l2 { color: var(--moss); font-style: italic; }

/* approach */
#approach .head { position: absolute; left: 8cqw; top: 9cqw; text-align: left; display: flex; flex-direction: column; gap: .8cqw; }
#approach .head .serif { font-size: 2.6cqw; }
.step { position: absolute; left: 8cqw; right: 8cqw; top: 50%; display: grid; grid-template-columns: auto 1fr; gap: 5cqw; align-items: center; text-align: left; visibility: hidden; }
.step .mnum { padding-top: .18em; margin-top: -.18em; padding-inline: .04em; padding-bottom: .12em; margin-bottom: -.12em; }
.step .num { font-family: var(--display); font-weight: 300; font-size: 17cqw; line-height: 1; color: var(--moss); letter-spacing: -.04em; font-variant-numeric: lining-nums; }
.step h3 { font-size: 5cqw; margin-bottom: 1.4cqw; }
.step p { font-size: 1.75cqw; max-width: 44cqw; margin: 0; color: var(--text); }
.track { position: absolute; left: 8cqw; right: 8cqw; bottom: 6cqw; display: grid; grid-template-columns: repeat(3, 1fr); font-family: var(--mono); font-size: 1cqw; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.track::before { content: ""; position: absolute; left: 0; right: 0; top: -1.4cqw; height: 1px; background: var(--sage); }
.track .bar { position: absolute; left: 0; right: 0; top: -1.4cqw; height: 2px; margin-top: -.5px; background: var(--moss); transform-origin: left; transform: scaleX(0); }
.track span { text-align: left; }

/* purpose */
#purpose .block { display: flex; flex-direction: column; align-items: center; gap: 1cqw; }
#purpose h2 { font-size: 8cqw; }
#purpose .star { font-family: var(--display); font-size: 4cqw; color: var(--pollen); display: inline-block; margin-bottom: 1cqw; }
#purpose .sub { font-size: 1.75cqw; color: var(--text); margin: 1.4cqw 0 0; max-width: 46cqw; }

/* brand */
#brand .block { display: flex; flex-direction: column; align-items: center; gap: 1.6cqw; }
.logo { font-family: var(--display); font-weight: 400; font-size: 9cqw; letter-spacing: -.035em; line-height: 1; margin: 0; }
.logo .ch { display: inline-block; }
.logo .dot { color: var(--moss); }
#brand .tag { font-family: var(--display); font-style: italic; font-weight: 300; font-size: 2.8cqw; color: var(--text); margin: 0; }
#brand .url { font-family: var(--mono); font-size: 1.2cqw; letter-spacing: .2em; color: var(--moss); text-transform: uppercase; }

/* ---------- speaker toggle (right of the languages) ---------- */
.sound { appearance: none; flex-shrink: 0; width: 40px; height: 40px; margin-left: 4px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: transparent; color: var(--ink); cursor: pointer; transition: background .2s, color .2s, border-color .2s; }
.sound:hover { background: #ecefe3; }
.sound svg { width: 20px; height: 20px; }
.sound .slash { display: none; }
.sound.is-muted { color: var(--muted); }
.sound.is-muted .waves { display: none; }
.sound.is-muted .slash { display: inline; }

/* a held scene: its menu pill shows a small pause mark until it is clicked again */
.navigation a.is-held::after { content: ""; display: inline-block; width: 6px; height: 8px; margin-left: 7px; vertical-align: 0;
  border-inline: 2px solid currentColor; box-sizing: border-box; opacity: .8; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); margin-top: 24px; }
.site-footer .wrap { padding-block: 32px 28px; display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.site-footer .brand { font-size: 19px; }
.site-footer .brand-mark { width: 24px; height: 28px; }
.site-footer p { margin: 6px 0 0; font-size: 11px; color: var(--muted); }
.site-footer small, .back-top { font-size: 11px; color: var(--muted); }
.back-top:hover { color: var(--ink); }
.back-top span { margin-left: 8px; }

/* ---------- portrait screens: the 9:16 cut of the film ---------- */
@media (max-aspect-ratio: 4/5) {
  .stage { aspect-ratio: 9 / 16; width: min(100%, calc((100svh - var(--chrome)) * 9 / 16)); }
  .eyebrow { font-size: 3cqw; }
  #intro .tri { gap: 1cqw; } #intro .tri .serif { font-size: 16cqw; } #intro .rule { width: 46cqw; margin-top: 4cqw; }
  #wellbeing .block { left: 8cqw; right: 8cqw; top: 42%; max-width: none; gap: 4cqw; }
  #wellbeing h1 { font-size: 15.5cqw; }
  #wellbeing .mswash { padding-bottom: 3.6cqw; margin-bottom: -3.6cqw; }
  #wellbeing .swash { bottom: -2cqw; height: 3.2cqw; }
  #wellbeing .sub { font-size: 4.4cqw; max-width: 74cqw; }
  .pill { font-size: 5.6cqw; padding: 2.6cqw 5.6cqw; }
  #p1 { left: 50%; top: 38%; } #p2 { left: 50%; top: 62%; }
  #p3 { font-size: 9.4cqw; padding: 3cqw 7.5cqw; }
  .plus { font-size: 11cqw; }
  .ring { width: 68cqw; height: 68cqw; }
  #formula .cap { bottom: 16%; font-size: 5cqw; padding-inline: 6cqw; }
  #whole-person .block { padding-inline: 7cqw; gap: 5cqw; }
  #whole-person h2 { font-size: 12.5cqw; }
  #approach .head { left: 8cqw; right: 8cqw; top: 8%; gap: 2cqw; }
  #approach .head .serif { font-size: 6.4cqw; }
  .step { left: 8cqw; right: 8cqw; top: 50%; grid-template-columns: 1fr; gap: 3cqw; align-items: start; }
  .step .num { font-size: 30cqw; }
  .step h3 { font-size: 11cqw; margin-bottom: 3cqw; }
  .step p { font-size: 4.4cqw; max-width: none; }
  .track { left: 8cqw; right: 8cqw; bottom: 8%; font-size: 2.5cqw; }
  .track::before, .track .bar { top: -3cqw; }
  #purpose .block { padding-inline: 8cqw; gap: 2.4cqw; }
  #purpose h2 { font-size: 14cqw; }
  #purpose .star { font-size: 10cqw; margin-bottom: 2cqw; }
  #purpose .sub { font-size: 4.6cqw; max-width: 78cqw; margin-top: 3cqw; }
  #brand .block { gap: 3.6cqw; }
  .logo { font-size: 16cqw; }
  #brand .tag { font-size: 6.2cqw; }
  #brand .url { font-size: 3cqw; }
}

/* ---------- small screens: header on two rows, scene navigation scrolls ---------- */
@media (max-width: 860px) {
  .wrap { width: calc(100% - 32px); }
  .site-header .wrap { flex-wrap: wrap; gap: 0 12px; min-height: 0; padding-top: 10px; }
  .brand { font-size: 21px; }
  .languages { margin-left: auto; }
  .navigation { order: 3; width: 100%; margin: 0; padding-block: 6px 8px; overflow-x: auto; scrollbar-width: none; font-size: 12px; }
  .navigation::-webkit-scrollbar { display: none; }
}

/* ---------- without JavaScript: the scenes become a readable static page ---------- */
html:not(.js) .stage { aspect-ratio: auto; width: 100%; height: auto; overflow: visible; }
html:not(.js) .stage canvas, html:not(.js) .ring, html:not(.js) .plus, html:not(.js) .sound, html:not(.js) .track { display: none; }
html:not(.js) .sc, html:not(.js) .step { position: relative; visibility: visible; inset: auto; padding-block: 40px; border-bottom: 1px solid var(--line); }
html:not(.js) #wellbeing .block, html:not(.js) #approach .head { position: static; transform: none; }
html:not(.js) .pill { position: static; display: inline-block; margin: 6px; }
html:not(.js) #formula .cap { position: static; margin-top: 16px; }
html:not(.js) .step { left: auto; right: auto; top: auto; border: 0; padding-block: 16px; }
html:not(.js) .eyebrow, html:not(.js) .step p, html:not(.js) .sub { font-size: 12px; }
html:not(.js) .serif, html:not(.js) .logo { font-size: clamp(30px, 5vw, 56px) !important; }
html:not(.js) .step .num { font-size: 48px; }

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
