/* "How ComfiSkin makes money" (public/how-we-make-money.html).
   The page follows the home page (comfiskin-landing/source/versions/v8/css/base.css and footer.css): the same
   tokens, the same bar, one sentence per screen with one accent phrase and one picture, section colours that
   change as you scroll, and the navy footer rail. The pictures (public/art/money) are this page's own scenes, built
   in the house 3D style by comfiskin-landing/source/versions/v8/dev/money-scenes.html.
   A change to the home page's type, colours, bar or rail needs the same change here.

   SCREEN MODES, as on the home page:
     phone   (max-aspect-ratio: 11/10) and (max-width: 599px)       sentence on top, picture below
     tablet  (max-aspect-ratio: 11/10) and (min-width: 600px)       the same, centred
             or (min-aspect-ratio: 1101/1000) and (min-height: 521px) and (max-width: 799px)
     land    (min-aspect-ratio: 1101/1000) and (max-height: 520px)  sentence beside the picture, small
     laptop  everything else                                        beside (.side, .flip) or above (.top) */

@font-face { font-family: "Geist"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("fonts/geist.woff2") format("woff2"); }

:root {
  --bg: #F4F5F7; --ink: #1D1D1F; --ink2: #6E6E73; --blue: #0A6CFF; --wash: #EEF4FF; --navy: #0B1026;
  --good: #1F9D55; --comfi: #8EC5FF;
  --fg: var(--ink); --fg2: var(--ink2); --rule: rgba(29, 29, 31, .13); --ring: var(--blue);
  --accent-word: var(--blue);
  --ease: cubic-bezier(.2, .9, .2, 1); --spring: cubic-bezier(.34, 1.56, .64, 1);
  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, sans-serif;

  --fs-sentence: clamp(36px, min(3.5vw, 6.2vh), 92px);
  --fs-hero:     clamp(46px, min(4.7vw, 8.2vh), 112px);
  --fs-small:    clamp(18px, min(1.45vw, 2.5vh), 28px);
  --fs-note:     clamp(15px, min(1.05vw, 1.8vh), 24px);

  --nav: clamp(60px, 6.8vh, 92px);
  --pad: clamp(20px, 3.4vw, 96px);
  --gap: clamp(16px, 2.4vw, 72px);
  --copy-w: clamp(380px, 41vw, 1060px);
}
@media (max-aspect-ratio: 11/10) and (max-width: 599px) { /* phone */
  :root {
    --fs-sentence: clamp(28px, 8.2vw, 34px); --fs-hero: clamp(32px, 9.2vw, 40px);
    --fs-small: clamp(16px, 4.3vw, 17px); --fs-note: 15px;
    --nav: 48px; --pad: max(clamp(18px, 5.4vw, 26px), env(safe-area-inset-left), env(safe-area-inset-right)); --gap: 10px;
  }
}
@media (max-aspect-ratio: 11/10) and (min-width: 600px), (min-aspect-ratio: 1101/1000) and (min-height: 521px) and (max-width: 799px) { /* tablet */
  :root {
    --fs-sentence: clamp(36px, 6vw, 56px); --fs-hero: clamp(42px, 7.2vw, 68px);
    --fs-small: clamp(17px, 2.3vw, 22px); --fs-note: clamp(15px, 1.8vw, 18px);
    --nav: 64px; --pad: clamp(24px, 5vw, 56px); --gap: 16px;
  }
}
@media (min-aspect-ratio: 1101/1000) and (max-height: 520px) { /* land */
  :root {
    --fs-sentence: clamp(24px, 8vh, 34px); --fs-hero: clamp(26px, 9vh, 38px);
    --fs-small: 16px; --fs-note: 14px;
    --nav: 48px; --pad: max(20px, env(safe-area-inset-left), env(safe-area-inset-right)); --gap: 14px;
    --copy-w: clamp(240px, 44vw, 420px);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; overflow-x: clip; }
html, body { margin: 0; }
body { background: var(--navy); color: var(--fg); font-family: var(--sans); font-size: 17px; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; overflow-x: clip; }
h1, h2, p, ul, figure { margin: 0; padding: 0; }
ul { list-style: none; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--blue); color: #fff; }
:focus-visible { outline: 2.5px solid var(--ring); outline-offset: 3px; border-radius: 6px; }

.skip { position: fixed; z-index: 60; left: var(--pad); top: 8px; height: 44px; display: inline-flex; align-items: center; padding: 0 18px; border-radius: 999px; background: var(--ink); color: #fff; font-weight: 600; font-size: 16px; transform: translateY(-160%); transition: transform .3s var(--ease); }
.skip:focus { transform: none; }

/* ------------------------------------------------------------ type */
.sentence { font-weight: 600; font-size: var(--fs-sentence); line-height: 1.05; letter-spacing: -.035em; text-wrap: balance; }
h1.sentence { font-size: var(--fs-hero); }
.sentence em { font-style: normal; color: var(--accent-word); }
.line { font-size: var(--fs-small); font-weight: 500; line-height: 1.4; letter-spacing: -.012em; color: var(--fg2); max-width: 42ch; text-wrap: pretty; }
.line a { color: var(--fg); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--fg) 45%, transparent); text-underline-offset: .18em; }
.note { font-size: max(14px, var(--fs-note)); font-weight: 500; line-height: 1.4; color: var(--fg2); max-width: 46ch; }
@media (hover: hover) { .line a:hover { text-decoration-color: currentColor; } }

/* ------------------------------------------------------------ the bar: the mark, "Get it free", a progress line */
.nav { position: fixed; top: 0; left: 0; right: 0; z-index: 40; height: var(--nav); padding: 0 var(--pad); display: flex; justify-content: space-between; align-items: center; gap: 16px; color: var(--fg); --fg: var(--ink); --ring: var(--blue); --bar: var(--blue); transition: color .4s; }
.nav[data-on="dark"] { --fg: #fff; --ring: #fff; --bar: var(--comfi); }
.nav[data-on="blue"] { --fg: #fff; --ring: #fff; --bar: #fff; }
/* the backing: the colour of the section under the bar, frosted (legal/money.js sets --nav-bg) */
.nav::before { content: ""; position: absolute; inset: 0; z-index: -1; background: color-mix(in srgb, var(--nav-bg, var(--bg)) 84%, transparent); -webkit-backdrop-filter: blur(18px) saturate(1.6); backdrop-filter: blur(18px) saturate(1.6); transition: background-color .45s; }
.brand { display: inline-flex; align-items: center; gap: .45em; min-height: 44px; min-width: 44px; font-weight: 700; font-size: clamp(17px, calc(var(--nav) * .28), 24px); letter-spacing: -.03em; }
.brand img { width: 1.6em; height: auto; }
.cta { display: inline-flex; align-items: center; min-height: 44px; height: calc(var(--nav) * .66); padding: 0 1.2em; border-radius: 999px; background: var(--fg); color: #fff; font-weight: 600; font-size: clamp(15px, calc(var(--nav) * .22), 19px); letter-spacing: -.01em; white-space: nowrap; transition: transform .35s var(--spring), background .4s, color .4s; }
.nav[data-on="blue"] .cta { color: var(--blue); }
.nav[data-on="dark"] .cta { color: var(--navy); }
@media (prefers-reduced-motion: no-preference) { .cta:hover { transform: translateY(-1px) scale(1.03); } }
.progress { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; pointer-events: none; }
.progress i { display: block; height: 100%; background: var(--bar); opacity: .7; transform-origin: 0 50%; transform: scaleX(var(--p, 0)); transition: background-color .4s; }

/* ------------------------------------------------------------ sections: one sentence, one short paragraph, one picture */
.s { position: relative; min-height: 100vh; min-height: 100svh; padding: calc(var(--nav) + 3vh) var(--pad) 7vh; display: grid; align-items: center; column-gap: var(--gap); background: var(--sbg, var(--bg)); color: var(--fg); }
.s.white { --sbg: #fff; }
.s.wash { --sbg: var(--wash); }
.s[data-theme="blue"] { --sbg: var(--blue); --fg: #fff; --fg2: rgba(255, 255, 255, .86); --rule: rgba(255, 255, 255, .3); --ring: #fff; --accent-word: var(--navy); }
.s[data-theme="dark"] { --sbg: var(--navy); --fg: #fff; --fg2: rgba(255, 255, 255, .78); --rule: rgba(255, 255, 255, .22); --ring: var(--comfi); --accent-word: var(--comfi); }
.copy { position: relative; z-index: 2; display: flex; flex-direction: column; gap: clamp(12px, 2vh, 30px); min-width: 0; }
.art { display: grid; place-items: center; min-width: 0; }
/* full width with the height held to the screen: the box keeps the picture's shape before it loads, so nothing jumps */
.art img { width: 100%; object-fit: contain; max-height: 64vh; max-height: 64svh; }

/* beside: the sentence column at the left edge (.flip: at the right), the picture in the rest */
.side { grid-template-columns: var(--copy-w) minmax(0, 1fr); }
.side.flip { grid-template-columns: minmax(0, 1fr) var(--copy-w); }
.side.flip .copy { order: 2; }
.side .sentence { max-width: 12.4em; }
/* above: the sentence centred across the top, the picture under it */
.top { grid-template-columns: minmax(0, 1fr); align-content: center; justify-items: center; row-gap: clamp(24px, 5vh, 72px); text-align: center; }
.top .copy { align-items: center; }
.top .sentence { max-width: 22em; }
.top .art img { max-height: 44vh; max-height: 44svh; }

/* the last screen ends on the rail, so it gives up the rail's height */
.last { min-height: calc(100vh - 170px); min-height: calc(100svh - 170px); }
.last .note { margin-top: clamp(8px, 1.6vh, 20px); }

/* ------------------------------------------------------------ the shop list: an example, in the order the app uses */
/* the list, with Comfi standing at its right and looking over at it; the caption sits under the list */
.shops { grid-template-columns: minmax(0, 1fr) auto; align-items: end; justify-items: stretch; column-gap: clamp(6px, 1.2vw, 24px); width: 100%; max-width: clamp(560px, 52vw, 980px); justify-self: center; text-align: left; color: var(--ink); }
.shops ul { grid-column: 1; grid-row: 1; padding: 6px clamp(18px, 1.8vw, 30px); border-radius: clamp(22px, 2vw, 34px); background: #fff; box-shadow: 0 40px 70px -36px rgba(20, 40, 90, .34), 0 2px 5px -1px rgba(20, 40, 90, .12), 0 0 0 .5px rgba(20, 40, 90, .08); }
.shops li { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 16px; row-gap: 2px; padding: clamp(14px, 2vh, 22px) 0; border-top: 1px solid rgba(29, 29, 31, .13); }
.shops li:first-child { border-top: 0; }
.shops b { font-size: clamp(18px, min(1.7vw, 3vh), 32px); font-weight: 600; letter-spacing: -.02em; line-height: 1.2; }
.shops span { grid-column: 1; font-size: max(14px, var(--fs-note)); font-weight: 500; line-height: 1.3; color: var(--ink2); }
.shops .pays { color: var(--blue); }
.shops strong { grid-column: 2; grid-row: 1 / span 2; padding: .18em .5em; border-radius: .5em; font-size: clamp(21px, min(2.2vw, 3.8vh), 42px); font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.shops li:first-child strong { background: var(--good); color: #fff; }
.shops figcaption { grid-column: 1; grid-row: 2; margin-top: 14px; font-size: max(14px, var(--fs-note)); font-weight: 500; color: var(--fg2); }
.shops > img { grid-column: 2; grid-row: 1; width: clamp(120px, min(13vw, 24vh), 250px); max-height: none; margin-bottom: -4px; }

/* ------------------------------------------------------------ the rail: plain navy, a hairline, one row, the copyright */
.foot { position: relative; padding: 24px max(var(--pad), env(safe-area-inset-right)) max(24px, calc(env(safe-area-inset-bottom) + 16px)) max(var(--pad), env(safe-area-inset-left)); background: var(--navy); color: #fff; --ring: #fff; }
.foot::before { content: ""; position: absolute; top: 0; left: max(var(--pad), env(safe-area-inset-left)); right: max(var(--pad), env(safe-area-inset-right)); border-top: 1px solid rgba(255, 255, 255, .14); }
.foot-row { position: relative; display: flex; align-items: center; min-height: 56px; gap: 28px; }
.foot-brand { display: inline-flex; align-items: center; gap: 9px; margin-inline-end: auto; font-size: 15px; font-weight: 600; letter-spacing: -.01em; white-space: nowrap; }
.foot-brand img { width: 22px; height: auto; }
.foot-links { display: flex; align-items: center; gap: 28px; }
.foot-links a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; font-size: 14px; font-weight: 500; color: rgba(255, 255, 255, .72); white-space: nowrap; transition: color .2s; }
.foot-up { position: relative; flex: none; display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .3); transition: box-shadow .2s, transform .35s var(--ease); }
.foot-up::after { content: ""; position: absolute; inset: -2px; }
.foot-up svg { width: 16px; height: 16px; display: block; }
.foot-more { display: flex; flex-wrap: wrap; align-items: center; column-gap: 28px; margin-top: 2px; }
.foot-more a { display: inline-flex; align-items: center; min-height: 44px; font-size: 14px; font-weight: 500; color: rgba(255, 255, 255, .6); white-space: nowrap; transition: color .2s; }
.foot-copy { margin-top: 2px; font-size: 13px; font-weight: 500; line-height: 1.3; color: rgba(255, 255, 255, .5); }
.foot a:focus-visible { color: #fff; }
@media (hover: hover) {
  .foot-links a:hover, .foot-more a:hover { color: #fff; }
  .foot-up:hover { box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .7); }
}

/* ================================================================ modes */

/* ---- phone and tablet: the sentence on top, the picture under it */
@media (max-aspect-ratio: 11/10), (min-aspect-ratio: 1101/1000) and (min-height: 521px) and (max-width: 799px) {
  .s, .last { min-height: 0; padding: clamp(44px, 8vh, 96px) var(--pad); row-gap: clamp(28px, 5vh, 56px); }
  .s:first-of-type { padding-top: calc(var(--nav) + clamp(24px, 5vh, 56px)); }
  .side, .side.flip, .top { grid-template-columns: minmax(0, 1fr); justify-items: center; text-align: center; }
  .side.flip .copy { order: 0; }
  .copy, .top .copy { align-items: center; }
  .side .sentence, .top .sentence { max-width: 13em; }
  .art img, .top .art img { max-height: 46vh; max-height: 46svh; max-width: min(100%, 560px); }
  /* no room beside the list: Comfi sits on its top edge */
  .shops { grid-template-columns: minmax(0, 1fr); max-width: 560px; }
  .shops ul { grid-row: 2; }
  .shops figcaption { grid-row: 3; }
  .shops > img { grid-column: 1; grid-row: 1; justify-self: end; width: clamp(76px, 17vw, 112px); max-width: none; margin: 0 clamp(16px, 5vw, 36px) -12px 0; position: relative; z-index: 1; }
  .foot-row { flex-direction: column; gap: 0; min-height: 0; }
  .foot-brand { margin: 0; min-height: 24px; }
  .foot-links { margin-top: 16px; gap: 32px; }
  .foot-more { justify-content: center; column-gap: 24px; margin-top: 0; }
  .foot-copy { text-align: center; }
  .foot-up { position: absolute; top: -8px; right: 0; box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .22); }
}
@media (max-aspect-ratio: 11/10) and (max-width: 599px) { /* phone only: left-aligned, as the home page's sentences are */
  .brand span { display: none; }
  .cta { height: 44px; padding: 0 1.1em; font-size: 15px; }
  .side, .side.flip, .top { justify-items: start; text-align: left; }
  .copy, .top .copy { align-items: flex-start; }
  .art { justify-self: center; width: 100%; }
  .foot-links { margin-top: 12px; }
}

/* ---- land: a phone on its side. The sentence beside the picture, nothing a full screen tall. */
@media (min-aspect-ratio: 1101/1000) and (max-height: 520px) {
  .nav { padding-top: env(safe-area-inset-top); }
  .brand { font-size: 17px; } .brand img { width: 26px; }
  .cta { height: 36px; min-height: 36px; font-size: 14.5px; padding: 0 1em; }
  .s, .last { min-height: 0; padding: calc(var(--nav) + 20px) var(--pad) 36px; }
  .top { grid-template-columns: var(--copy-w) minmax(0, 1fr); justify-items: stretch; text-align: left; }
  .top .copy { align-items: flex-start; }
  .art img, .top .art img { max-height: 70vh; }
  .shops > img { width: 84px; }
}

/* ------------------------------------------------------------ motion */
/* The first screen arrives a line at a time. Each later screen rises as it is scrolled into view, where the
   browser can tie an animation to the scroll; elsewhere it is simply there. */
@keyframes rise { from { opacity: 0; translate: 0 22px; } }
@media (prefers-reduced-motion: no-preference) {
  .s:first-of-type .copy > *, .s:first-of-type .art { animation: rise .9s var(--ease) both; }
  .s:first-of-type .copy > :nth-child(2) { animation-delay: .08s; }
  .s:first-of-type .art { animation-delay: .16s; }
  @supports (animation-timeline: view()) {
    .s:not(:first-of-type) .copy > *, .s:not(:first-of-type) .art { animation: rise linear both; animation-timeline: view(); animation-range: entry 0% cover 20%; }
  }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ------------------------------------------------------------ paper */
@media print {
  .nav, .skip, .foot-up { display: none; }
  body { background: #fff; }
  *, *::before, *::after { animation: none !important; }
  .s, .last { min-height: 0; padding: 18pt 0; break-inside: avoid; --sbg: #fff; --fg: var(--ink); --fg2: var(--ink2); --accent-word: var(--blue); grid-template-columns: minmax(0, 1fr); }
  .art img, .top .art img { max-height: 160pt; }
  .shops ul { box-shadow: none; border: 1px solid rgba(29, 29, 31, .2); }
  .foot { background: none; color: var(--ink); }
  .foot-links a, .foot-more a, .foot-copy { color: var(--ink2); }
}
