/* Homepage story: the statement, the one-request scene, the whole clinic, questions and closing.
   Pinned layouts apply only with motion on a large enough screen; everywhere else the same
   content is a calm, readable column. */

/* ---------------------------------------------------------------- statement */

.ms-statement { max-width: 1232px; margin: 0 auto; padding: clamp(84px, 10vw, 150px) 48px clamp(72px, 8vw, 116px); text-align: center; }
.ms-statement-text { max-width: 1020px; margin: 0 auto; font-size: clamp(32px, 4.2vw, 62px); line-height: 1.12; letter-spacing: -.045em; font-weight: 400; color: var(--text-strong); text-wrap: balance; }
.ms-statement-text strong { font-weight: 500; color: #33472c; }
.ms-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); max-width: 1100px; margin: clamp(56px, 7vw, 96px) auto 0; border-top: 1px solid var(--line); text-align: left; }
.ms-metric { display: flex; flex-direction: column-reverse; justify-content: flex-end; gap: 12px; padding: 30px 26px 0; border-left: 1px solid var(--line); }
.ms-metric:first-child { padding-left: 0; border-left: 0; }
.ms-metric dd { margin: 0; font-size: clamp(46px, 5.3vw, 78px); line-height: .95; letter-spacing: -.065em; color: var(--text-strong); }
.ms-metric dt { max-width: 190px; font-size: 13px; line-height: 1.45; color: var(--text-muted); }

/* ---------------------------------------------------------------- one request */

/* Abstract grain art and a noise layer behind frosted glass, with the Olmi grain ring flowing
   in the middle (fluid-ring.js). Threads are quiet cream lines that dissolve into the ring. */
.or-scene { --or-ink: #f3f5ec; --or-muted: #d3dac8; --or-thread: #f4efdc; --or-grain: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.78' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Cpath fill='%23fff' filter='url(%23n)' opacity='.8' d='M0 0h180v180H0z'/%3E%3C/svg%3E"); position: relative; isolation: isolate; margin: 12px; border-radius: 30px; background: #141a10; color: var(--or-ink); scroll-margin-top: 102px; }
.or-stage { position: relative; isolation: isolate; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "head progress" "request request" "board board" "result result"; align-content: center; gap: 22px 40px; padding: 64px clamp(24px, 4.5vw, 72px) 56px; border-radius: 30px; }
.or-backdrop { position: absolute; inset: 0; z-index: -2; overflow: hidden; border-radius: inherit; background: #1a2214; }
.or-backdrop img { position: absolute; top: -6%; left: -6%; width: 112%; height: 112%; object-fit: cover; scale: calc(1.04 + .08 * var(--p)); translate: calc(-2% * var(--p)) calc(-3% * var(--p)); }
.or-backdrop::after { content: ''; position: absolute; inset: 0; background: #0f150b9e; }
.or-stage::after { content: ''; position: absolute; inset: 0; z-index: -1; border-radius: inherit; background-image: var(--or-grain); background-size: 170px; opacity: .3; mix-blend-mode: overlay; pointer-events: none; }
.or-head { grid-area: head; display: grid; gap: 12px; }
.or-head h2 { margin: 0; font-size: clamp(34px, 3.5vw, 52px); line-height: 1.04; letter-spacing: -.055em; font-weight: 400; color: #f7f9f2; }
.or-head p { margin: 0; max-width: 470px; font-size: 16px; line-height: 1.55; color: var(--or-muted); }

/* Frosted glass: a translucent pane, a fine light edge and a soft blur of the art behind. */
.or-progress li, .or-request, .or-context li, .or-out li { border: 1px solid #ffffff2b; background: #ffffff12; box-shadow: inset 0 1px 0 #ffffff24, 0 14px 34px #0000002b; backdrop-filter: blur(18px) saturate(1.35); -webkit-backdrop-filter: blur(18px) saturate(1.35); }
.or-progress { grid-area: progress; align-self: start; display: flex; gap: 6px; margin: 4px 0 0; padding: 0; list-style: none; }
.or-progress li { display: flex; align-items: center; gap: 8px; padding: 6px 13px 6px 6px; border-radius: 999px; box-shadow: inset 0 1px 0 #ffffff1f; font: 500 11px/1 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: #ffffff8c; transition: color 400ms ease, background-color 400ms ease, border-color 400ms ease; }
.or-progress li > span { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: #ffffff14; font-size: 10px; letter-spacing: 0; }
.or-progress li.is-on { color: var(--or-ink); }
.or-scene[data-step="0"] .or-progress li:nth-child(1),
.or-scene[data-step="1"] .or-progress li:nth-child(2),
.or-scene[data-step="2"] .or-progress li:nth-child(3),
.or-scene[data-step="3"] .or-progress li:nth-child(4) { border-color: #f3f5ecd9; background: #f3f5ece6; color: #1c2517; }
.or-scene[data-step="0"] .or-progress li:nth-child(1) > span,
.or-scene[data-step="1"] .or-progress li:nth-child(2) > span,
.or-scene[data-step="2"] .or-progress li:nth-child(3) > span,
.or-scene[data-step="3"] .or-progress li:nth-child(4) > span { background: #1c2517; color: #eef3df; }

.or-request { grid-area: request; justify-self: center; display: grid; gap: 8px; width: min(640px, 100%); margin: 0; padding: 16px 22px 18px; border-radius: 22px; text-align: center; }
.or-request figcaption { display: inline-flex; justify-self: center; align-items: center; gap: 8px; font: 500 10.5px/1 var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: #dfe8c8; }
.or-request figcaption .icon { width: 14px; height: 14px; }
.or-request blockquote { margin: 0; }
.or-request p { --wp: min(1, calc(var(--p) * 5.5)); margin: 0; font-size: clamp(16px, 1.45vw, 20px); line-height: 1.45; letter-spacing: -.02em; color: #f7f9f2; text-wrap: balance; }
.motion-ready .or-request .w { opacity: clamp(.12, calc((var(--wp) * (var(--n) + 6) - var(--i)) / 6), 1); }

.or-board { grid-area: board; position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, .9fr) minmax(0, 1fr); height: clamp(270px, 38svh, 400px); }
.or-context, .or-out { position: relative; z-index: 2; display: grid; grid-template-rows: repeat(5, minmax(0, 1fr)); align-items: center; margin: 0; padding: 0; list-style: none; }
.or-context { justify-items: end; }
.or-out { justify-items: start; }
.or-context li { display: inline-flex; align-items: center; gap: 10px; padding: 6px 16px 6px 6px; border-radius: 999px; font-size: 13px; white-space: nowrap; color: var(--or-ink); }
.or-context .icon { box-sizing: content-box; width: 14px; height: 14px; padding: 7px; border-radius: 50%; background: #ffffff1c; color: #e8efd4; }
.or-out li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; width: min(100%, 360px); padding: 8px 10px 8px 8px; border-radius: 16px; }
.or-ico { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid #ffffff24; border-radius: 11px; background: #ffffff17; color: #e8efd4; }
.or-ico .icon { width: 16px; height: 16px; }
.or-txt { display: grid; gap: 2px; min-width: 0; }
.or-txt strong { font-size: 13.5px; font-weight: 500; color: #f7f9f2; }
.or-txt small { overflow: hidden; font-size: 11.5px; color: var(--or-muted); text-overflow: ellipsis; white-space: nowrap; }
.or-state em { display: inline-flex; align-items: center; padding: 4px 9px; border-radius: 999px; font: 500 10px/1.2 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; font-style: normal; }
.or-ready { background: #ffffff17; color: #e3ebd0; }
.or-finished { display: none !important; background: #f3f5ec; color: #1c2517; }
.or-scene[data-step="3"] .or-ready { display: none; }
.or-scene[data-step="3"] .or-finished { display: inline-flex !important; }

.or-core { position: relative; z-index: 1; }
.or-ring { position: absolute; top: 50%; left: 50%; width: clamp(240px, 25vw, 370px); aspect-ratio: 1; translate: -50% -50%; pointer-events: none; }
.or-ring img, .or-ring .fluid-ring-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.or-ring img { object-fit: contain; rotate: calc(var(--p) * 80deg); }
.or-ring[data-renderer='ready'] img { visibility: hidden; }
.or-wires { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; overflow: visible; pointer-events: none; -webkit-mask-image: radial-gradient(circle at 50% 50%, transparent 0 20%, #000 44%); mask-image: radial-gradient(circle at 50% 50%, transparent 0 20%, #000 44%); }
/* Bright threads draw in with dashes measured in the SVG's own units (pathLength), which is exact.
   Non-scaling strokes in this stretched box would size those dashes short, so only the quiet base
   threads use them, and a finished thread is a plain solid line that always reaches its card. */
.or-wires path { fill: none; stroke-linecap: round; }
.or-base path { stroke: #f4efdc2e; stroke-width: 1; vector-effect: non-scaling-stroke; }
.or-lit path { stroke: var(--or-thread); stroke-width: 1.6; opacity: .85; }

.or-result { grid-area: result; justify-self: center; display: flex; align-items: center; gap: 14px; max-width: 100%; padding: 9px 10px 9px 9px; border: 1px solid #ffffffb3; border-radius: 999px; background: #f3f5ece8; box-shadow: 0 18px 40px #0000003d; backdrop-filter: blur(16px); color: #1c2517; }
.or-result-check { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: #536533; color: #f5f7f0; }
.or-result-check .icon { width: 17px; height: 17px; }
.or-result p { margin: 0; font-size: 14px; }
.or-result p > span { color: #4d5c43; }
.or-undo { display: inline-flex; align-items: center; gap: 7px; padding: 8px 13px; border-radius: 999px; background: #1c2517; color: #eef3df; font-size: 12px; white-space: nowrap; }
.or-undo .icon { width: 14px; height: 14px; }

/* Step states. Anything not reached yet waits dimly in place; nothing moves the layout. */
.motion-ready .or-scene [data-from] { transition: opacity 520ms var(--ease-glide) calc(var(--i, 0) * 70ms), translate 620ms var(--ease-glide) calc(var(--i, 0) * 70ms), filter 520ms ease calc(var(--i, 0) * 70ms); }
.motion-ready .or-scene :is(.or-context, .or-out) [data-from]:not(.is-on) { opacity: .3; translate: 0 6px; filter: saturate(.5); }
.motion-ready .or-scene .or-result:not(.is-on) { opacity: 0; translate: 0 14px; }
.motion-ready .or-scene .or-lit :is(.or-wires-in, .or-wires-out) path { stroke-dasharray: 1 1; stroke-dashoffset: 1; }
.motion-ready .or-scene[data-step="1"] .or-lit .or-wires-in path { stroke-dashoffset: calc(1 - var(--sp)); }
.motion-ready .or-scene:is([data-step="2"], [data-step="3"]) .or-lit .or-wires-in path { stroke-dasharray: none; }
.motion-ready .or-scene[data-step="2"] .or-lit .or-wires-out path { stroke-dashoffset: calc(1 - var(--sp)); }
.motion-ready .or-scene[data-step="3"] .or-lit .or-wires-out path { stroke-dasharray: none; }

@media (min-width: 900px) and (min-height: 700px) {
  .motion-ready .or-scene { height: 400vh; }
  .motion-ready .or-stage { position: sticky; top: var(--pin-top); height: calc(100svh - var(--pin-top) - 12px); padding-block: clamp(28px, 4.5svh, 52px); gap: clamp(14px, 2.2svh, 24px) 40px; }
}

/* ---------------------------------------------------------------- the whole clinic */

/* What Olmi brings together, listed plainly beside the grain ring that answers the pointer. */
.wc { display: grid; grid-template-columns: minmax(300px, .82fr) minmax(0, 1.18fr); align-items: center; gap: clamp(28px, 4.4vw, 72px); }
.wc-list { position: relative; z-index: 1; display: grid; margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.wc-item { display: grid; grid-template-columns: 40px minmax(0, 1fr); align-items: start; gap: 16px; padding: 18px 0 19px; border-bottom: 1px solid var(--line); }
.wc-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--olive-50); color: var(--olive-600); }
.wc-icon .icon { width: 18px; height: 18px; }
.wc-item h3 { margin: 1px 0 5px; font-size: 16.5px; font-weight: 500; line-height: 1.3; letter-spacing: -.025em; color: var(--text-strong); }
.wc-item p { margin: 0; max-width: 400px; font-size: 14px; line-height: 1.5; color: var(--text-muted); }
.wc-art { min-width: 0; max-width: 760px; justify-self: center; }

/* ---------------------------------------------------------------- questions */

.faq { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 64px; align-items: start; }
.faq .section-heading { position: sticky; top: calc(var(--pin-top) + 36px); display: grid; grid-template-columns: 1fr; gap: 22px; margin: 0; padding: 0; }
.faq .section-heading > div { padding: 0; }
/* ---------------------------------------------------------------- closing */

.ms-closing { min-height: min(720px, 86svh); margin: 24px 12px 0; padding: 80px 24px; border-radius: 30px; color: #f7f9f2; transform-origin: 50% 100%; }
.ms-closing::after { background: #18200fa6; }
.ms-closing > img { object-position: center 60%; }
.motion-ready .ms-closing { scale: calc(.92 + .08 * var(--e)); border-radius: calc(56px - 26px * var(--e)); }
.motion-ready .ms-closing > img { scale: calc(1.14 - .14 * var(--e)); }
.ms-closing-copy { display: grid; justify-items: center; }
.ms-closing-mark { width: 52px; height: 52px; margin-bottom: 28px; fill: none; stroke: currentColor; color: #f7f9f2; }
.ms-closing h2 { color: #f8faf3; font-size: clamp(40px, 5.4vw, 78px); }
.ms-closing p { margin: 22px 0 30px; color: #e6ecdc; font-size: 17px; }
.ms-closing-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.ms-closing .button { background: #f8faf3; color: #1c2517; }
.ms-closing .button:hover { background: #ffffff; }
.ms-closing .button-secondary { background: #ffffff1f; color: #f8faf3; border-color: #ffffff59; backdrop-filter: blur(12px); }
.ms-closing .button-secondary:hover { background: #ffffff33; }

/* ---------------------------------------------------------------- smaller screens */

/* Below wide desktops the result bar sits left, clear of the corner launcher. */
@media (max-width: 1240px) {
  .or-result { justify-self: start; }
}

@media (max-width: 1080px) {
  .or-out li { width: min(100%, 320px); }
  .wc { grid-template-columns: minmax(280px, 1fr) minmax(0, 1fr); }
}

@media (max-width: 899px), (max-height: 699px) {
  .or-stage { grid-template-columns: 1fr; grid-template-areas: "head" "progress" "request" "board" "result"; }
  .or-progress { flex-wrap: wrap; }
  .or-board { grid-template-columns: 1fr; height: auto; gap: 18px; }
  .or-context { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
  .or-core { order: -1; height: 210px; }
  .or-ring { width: 210px; }
  .or-core .or-wires { display: none; }
  .or-out { display: grid; grid-template-rows: none; gap: 8px; justify-items: stretch; }
  .or-out li { width: 100%; }
  .or-result { flex-wrap: wrap; justify-content: center; border-radius: 22px; text-align: center; }
}

@media (max-width: 760px) {
  .wc { grid-template-columns: 1fr; gap: 8px; }
  .wc-art { order: -1; width: min(100%, 460px); }
  .wc-item { padding: 16px 0; }
  .ms-statement { padding-inline: 24px; text-align: left; }
  .ms-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ms-metric { padding: 24px 18px 22px; border-bottom: 1px solid var(--line); }
  .ms-metric:nth-child(odd) { padding-left: 0; border-left: 0; }
  .faq { grid-template-columns: 1fr; gap: 28px; }
  .faq .section-heading { position: static; }
  .ms-closing { min-height: 560px; padding: 56px 20px; }
}

@media (max-width: 420px) {
  .or-stage { padding: 48px 18px 36px; }
  .or-request { padding: 14px 16px; }
  .or-context li { font-size: 12px; }
  .ms-metric dd { font-size: 42px; }
}

@media (prefers-reduced-motion: reduce) {
  .or-ring img { rotate: none; }
}
