/* Firn home page: "Frost", with "ClearScroll". One screen: the blurred logo,
   one line, one pill, and a soft spot where the frost clears. Built from
   design/frost/pages/clear-scroll.dc.html (and -phone); the values are the
   design's (see design/frost/BRAND.md). This file stands alone. The 404
   page uses it too. */

@font-face { font-family: "Gooper Deck"; font-weight: 400; font-style: normal; font-display: block;
  src: url("https://fonts.firnbrowser.com/GooperDeck-Regular.woff2") format("woff2"); }
@font-face { font-family: "Gooper Deck"; font-weight: 600; font-style: normal; font-display: block;
  src: url("https://fonts.firnbrowser.com/GooperDeck-SemiBold.woff2") format("woff2"); }

:root {
  color-scheme: light dark;
  --sky-top: #D3DBDF; --sky-low: #E9ECEA; --ink: #241F1B; --muted: #5E564E;
  --frosty: rgba(255,255,255,.5);
  --rim-hi: rgba(255,238,220,.98); --rim-lo: rgba(255,255,255,.4);
  --rim-line: rgba(255,255,255,.35); --rim-out: rgba(36,31,27,.09);
  --glass-shade: rgba(36,31,27,.17); --rim-warm: rgba(242,188,146,.4);
  /* the horizon: light mode only */
  --glow-1: rgba(242,196,160,.2); --glow-2: rgba(236,206,186,.11); --glow-0: rgba(236,206,186,0);
  --pill-rim: inset 0 -1.5px 1px -0.5px var(--rim-hi), inset 0 1px 1px -0.5px var(--rim-lo);
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --logo-w: min(104vw, 1560px);
}
@media (prefers-color-scheme: dark) {
  :root {
    --sky-top: #151A27; --sky-low: #232B3F; --ink: #E9E3DA; --muted: #B9B2AA;
    --frosty: rgba(44,53,76,.5);
    --rim-hi: rgba(233,227,218,.6); --rim-lo: rgba(233,227,218,.18);
    --rim-line: rgba(233,227,218,.16); --rim-out: rgba(0,0,0,.3);
    --glass-shade: rgba(0,0,0,.4); --rim-warm: rgba(0,0,0,0);
    --glow-1: rgba(0,0,0,0); --glow-2: rgba(0,0,0,0); --glow-0: rgba(0,0,0,0);
    --pill-rim: inset 1.5px 1.5px 1px -0.5px var(--rim-hi), inset -1px -1px 1px -0.5px var(--rim-lo);
  }
}

html { background: var(--sky-top); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; }
[hidden] { display: none !important; }

.page {
  --pad: clamp(24px, 5vw, 72px);
  /* --tb: the band behind a phone browser's bottom toolbar (0 elsewhere). The
     sky runs down behind it and the strip sits just above it. */
  --tb: 0px;
  /* --top/--bot: extra sky above and below the screen, behind iPhone Safari's
     clock and home bar. home.js sets them on iPhone and scrolls down --top,
     so the sky sits there like scrolled content. 0 everywhere else. */
  --top: 0px; --bot: 0px;
  /* How far the logo sits above centre (half the strip's height). home.js
     measures it; this is the same number for when JavaScript is off. */
  --lift: calc((var(--pad) + 80px + var(--tb)) / 2);
  --pad-box: calc(max(var(--pad), env(safe-area-inset-top)) + var(--top)) max(var(--pad), env(safe-area-inset-right))
             calc(max(var(--pad), env(safe-area-inset-bottom)) + var(--tb) + var(--bot)) max(var(--pad), env(safe-area-inset-left));
  --sky: linear-gradient(0deg, var(--glow-1) 0%, var(--glow-2) 24%, var(--glow-0) 58%),
         linear-gradient(180deg, var(--sky-top), var(--sky-low));
  position: relative; box-sizing: border-box;
  height: 100vh; height: 100svh; min-height: 600px;
  padding: var(--pad-box);
  display: flex; flex-direction: column; justify-content: flex-end;
  overflow: hidden;
  background: var(--sky); color: var(--ink);
  font-family: "Gooper Deck", Georgia, serif;
}
@supports (height: 100lvh) {
  .page { --tb: calc(100lvh - 100svh); height: calc(100lvh + var(--top) + var(--bot));
    min-height: calc(600px + var(--tb) + var(--top) + var(--bot)); }
}
html.tuck .page { --top: 64px; --bot: 64px; }
/* With JavaScript (.live) a touch moves the soft spot, not the page */
.page.live { touch-action: none; }
@media (max-height: 640px) { .page.live { touch-action: pan-y; } }

/* The logo, out of focus: a ready-made blurred picture (the design's blur,
   logo width x 0.0134, drawn once), so nothing blurs live. The picture has
   room for the blur around the logo: it is 1.1 x the logo's width. */
.soft, .sharp { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.soft { opacity: .85; }
.logo { display: block; width: var(--logo-w); max-width: none; height: auto;
  transform: translate(-2.5%, calc(var(--lift) * -1)); }
.soft .logo { width: calc(var(--logo-w) * 1.1);
  transform: translate(calc(var(--logo-w) * -0.025), calc(var(--lift) * -1)); }

/* The soft spot: a round window, soft to its edge, that home.js slides to the
   pointer while the sharp page inside slides the other way. Only transform
   and opacity change as it moves, so nothing is repainted. Hidden without
   JavaScript. --ci: where the soft edge starts (22%, the design's). */
.spot { position: absolute; left: 0; top: 0; width: 0; height: 0; overflow: hidden;
  pointer-events: none; opacity: 0; will-change: transform, opacity;
  -webkit-mask-image: radial-gradient(circle closest-side, #000 var(--ci, 22%), transparent 100%);
          mask-image: radial-gradient(circle closest-side, #000 var(--ci, 22%), transparent 100%); }
.sharp { inset: auto; left: 0; top: 0; will-change: transform; }
.sharp-sky { position: absolute; inset: 0; background: var(--sky); }
.sharp picture { position: relative; }

.snow { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }

/* The strip along the bottom, above the spot and the snow */
.strip { position: relative; z-index: 3; display: flex; flex-wrap: wrap; align-items: flex-end;
  justify-content: space-between; gap: 20px 48px; }
h1 { margin: 0; font-size: clamp(20px, 2vw, 26px); line-height: 1.2; font-weight: 400; text-wrap: balance; }
h1 .em { font-weight: 600; }

a { color: var(--ink); }
a:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }

nav { display: flex; flex-wrap: wrap; gap: 0 22px; margin: 4px 0 -12px; font-family: var(--sans); font-size: 14px; }
nav a { display: inline-block; padding: 12px 0; opacity: .8;
  text-decoration-thickness: 1px; text-underline-offset: 4px; }

.get-soon { text-align: right; }
.get { display: flex; flex-direction: column; gap: 10px; align-items: flex-end; text-align: right; }
.small { margin: 0; font-family: var(--sans); font-size: 14px; line-height: 1.45; opacity: .8; }
@media (max-width: 600px) {
  .page { --lift: calc((var(--pad) + 148px + var(--tb)) / 2); }
  .get { align-items: flex-start; text-align: left; }
  .get-soon { text-align: left; }
  nav { gap: 0 12px; }
}

/* The 404 page: the same screen with a shorter strip (one line, one link) */
.page.lost { --lift: calc((var(--pad) + 64px + var(--tb)) / 2); }
@media (max-width: 600px) { .page.lost { --lift: calc((var(--pad) + 57px + var(--tb)) / 2); } }

/* The one frosted pill */
.pill {
  display: inline-block; padding: 14px 24px; border-radius: 999px;
  text-decoration: none; cursor: pointer;
  font-family: var(--sans); font-size: 17px;
  background: var(--frosty); border: 1px solid var(--rim-line);
  -webkit-backdrop-filter: blur(20px) saturate(140%); backdrop-filter: blur(20px) saturate(140%);
  box-shadow: var(--pill-rim), 0 8px 28px var(--glass-shade);
}

/* ===== Up close: the scroll the logo opens (design/frost/pages/clear-scroll.dc.html) ===== */

/* The logo link: over the logo, placed by the same numbers as the logo */
.logo-link { position: absolute; z-index: 2; border-radius: 24px; -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none; -webkit-user-select: none; user-select: none;
  left: calc(50% - var(--logo-w) * 0.465); top: calc(50% - var(--lift) - var(--logo-w) * 0.17453);
  width: calc(var(--logo-w) * 0.88); height: calc(var(--logo-w) * 0.34906); }
.logo-link:focus-visible { outline: 2px solid var(--ink); outline-offset: -8px; }
.logo-link.quiet:focus-visible { outline: none; }

/* The long sky: as long as the scroll, with the horizon at its foot. Shown
   and moved by home.js only while the scroll is open. */
.longsky { position: absolute; left: 0; right: 0; top: 0; height: 100%; opacity: 0; pointer-events: none;
  background: linear-gradient(0deg, var(--glow-1) 0px, var(--glow-2) 200px, var(--glow-0) 480px),
              linear-gradient(180deg, var(--sky-top), var(--sky-low)); }

/* Without JavaScript the scroll is a plain section below the first screen */
.up { color: var(--ink); font-family: "Gooper Deck", Georgia, serif;
  background: linear-gradient(0deg, var(--glow-1) 0px, var(--glow-2) 200px, var(--glow-0) 480px), var(--sky-low); }
.up:focus { outline: none; }
.up-logo, .up-spacer { display: none; }
/* With JavaScript (home.js moves it into <main>): over the page, hidden
   until the logo opens it. It is built (and its pictures load) only once
   the visitor points, taps, or tabs (.ready). */
.page > .up { position: absolute; inset: 0; z-index: 8; display: none; visibility: hidden; background: none;
  overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; }
.page.ready > .up { display: block; }
.page.open > .up { visibility: visible; }
.page.open .longsky { will-change: transform; }
/* Touch screens (.doc, home.js): the open scroll is the page's own scroll,
   so the page grows to hold it and nothing inside scrolls on its own */
.page.doc { overflow: visible; overflow-x: clip; touch-action: pan-y; }
.page.doc > .up { bottom: auto; overflow: visible; overflow-x: clip; --bot: 0px; --tb: 0px; }
.page.linked.open.doc .longsky { animation: none; }
.page.doc .longsky { will-change: auto; }
/* Scroll-linked (home.js adds .linked where supported): the long sky follows
   the scroll's position by itself, so scrolling needs no script each frame */
@keyframes longsky { to { transform: translate3d(0, calc(-1 * var(--travel, 0px)), 0); } }
.page.linked { timeline-scope: --up; }
.page.linked > .up { scroll-timeline: --up block; }
.page.linked.open .longsky { animation: longsky linear both; animation-timeline: --up; }
.page > .up .up-logo { display: flex; position: absolute; left: 0; top: 0; width: var(--pw, 100%); height: var(--ph, 100%);
  align-items: center; justify-content: center; overflow: hidden; visibility: hidden; pointer-events: none; }
.page > .up .up-spacer { display: block; height: 72vh; }

.up-in { position: relative; box-sizing: border-box;
  padding: 40px max(72px, env(safe-area-inset-right)) calc(72px + var(--bot, 0px) + var(--tb, 0px) + env(safe-area-inset-bottom)) max(72px, env(safe-area-inset-left)); }
.up-row { position: relative; display: grid; grid-template-columns: 300px 1fr; gap: 40px; align-items: end; margin: 0 0 72px; }
.up-row p { margin: 0 0 40px; font-size: 32px; line-height: 1.14; font-weight: 400; text-wrap: balance; }
.up-row b { font-weight: 600; }
.up-rest > .up-row:nth-child(odd) { grid-template-columns: 1fr 300px; }
.up-rest > .up-row:nth-child(odd) > p { order: 2; }
.up-rest > .up-row:nth-child(odd) > img { justify-self: end; }
.up-row img { display: block; width: 100%; max-width: 1000px; height: auto; }
.up-phones { display: flex; gap: 28px; }
.up-phones div { width: 210px; padding: 4px; border-radius: 36px; background: #1B1C1F; box-shadow: 0 10px 40px rgba(0,0,0,.3); }
.up-phones img { display: block; width: 100%; height: auto; border-radius: 32px; }
.phone-only { display: none !important; }
.up-get { margin: 24px 0 0 340px; }
.up-get .get { align-items: flex-start; text-align: left; }
.up-get .small { line-height: normal; }
.up-get .get-soon { text-align: left; }
.up-foot { margin: 160px 0 0; font-family: var(--sans); font-size: 14px; }
.up-foot a { text-decoration-thickness: 1px; text-underline-offset: 4px; }
.foot-cols { display: flex; flex-wrap: wrap; gap: 24px 64px; margin: 0; }
.foot-cols h2 { margin: 0 0 6px; font-family: var(--sans); font-size: 13px; font-weight: 400; letter-spacing: .02em; opacity: .72; }
.foot-cols ul { margin: 0; padding: 0; list-style: none; }
.foot-cols a { display: inline-block; padding: 6px 0; opacity: 1; }
/* The pencil scene: still pictures (assets/footer-scene*.svg hold their own
   light and dark colours), out to both edges and down to the bottom */
.foot-scene { position: relative;
  margin: 0 calc(-1 * max(72px, env(safe-area-inset-right))) calc(-1 * (72px + var(--bot, 0px) + var(--tb, 0px) + env(safe-area-inset-bottom))) calc(-1 * max(72px, env(safe-area-inset-left)));
  padding-bottom: calc(var(--bot, 0px) + var(--tb, 0px) + env(safe-area-inset-bottom)); }
/* The cabin is the way back home (#back-home, home.js): a clear link over
   it. Sizes follow the picture as drawn: max(100%, 1440px) wide, cropped
   from the middle, anchored to the bottom */
.scene-pic { position: relative; overflow: hidden; }
.foot-scene .cabin { position: absolute; bottom: 0; margin-bottom: calc(max(100%, 1440px) * 44 / 1440); left: calc(50% + max(100%, 1440px) * 192 / 1440);
  width: calc(max(100%, 1440px) * 130 / 1440); aspect-ratio: 130 / 92; border-radius: 12px; }
.foot-scene .cabin:focus-visible { outline-offset: 0; }
.foot-scene img { display: block; width: 100%; height: 300px; object-fit: cover; object-position: 50% 100%; }
.foot-scene p { position: absolute; right: max(72px, env(safe-area-inset-right)); bottom: calc(20px + var(--bot, 0px) + var(--tb, 0px) + env(safe-area-inset-bottom));
  margin: 0; font-size: 13px; color: var(--muted);
  /* a soft halo in the sky colour so the pencil lines fade behind the letters */
  text-shadow: 0 0 2px var(--sky-low), 0 0 6px var(--sky-low), 0 0 10px var(--sky-low), 0 0 16px var(--sky-low); }

@media (max-width: 600px) {
  .up-in { padding: 0 max(24px, env(safe-area-inset-right)) calc(32px + var(--bot, 0px) + var(--tb, 0px) + env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left)); }
  .up { padding-top: 32px; }
  .page > .up { padding-top: 0; }
  .up-row, .up-rest > .up-row:nth-child(odd) { grid-template-columns: 1fr; gap: 16px; margin: 0 0 56px; }
  .up-rest > .up-row:nth-child(odd) > p { order: 0; }
  .up-rest > .up-row:nth-child(odd) > img { justify-self: start; }
  .up-row p { margin: 0; font-size: 24px; }
  .up-phones { gap: 10px; }
  .up-phones div { width: auto; flex: 1 1 0; padding: 3px; border-radius: 22px; box-shadow: 0 4px 16px rgba(0,0,0,.3); }
  .up-phones img { border-radius: 19px; }
  .wide-only { display: none !important; }
  .phone-only { display: flex !important; }
  .up-get { margin: 8px 0 0; }
  .up-foot { margin-top: 96px; }
  .foot-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 28px 24px; }
  .foot-scene { margin: 0 calc(-1 * max(24px, env(safe-area-inset-right))) calc(-1 * (32px + var(--bot, 0px) + var(--tb, 0px) + env(safe-area-inset-bottom))) calc(-1 * max(24px, env(safe-area-inset-left))); }
  .foot-scene img { height: auto; }
  .foot-scene .cabin { margin-bottom: calc(100% * 44 / 560); left: calc(100% * 172 / 560); width: calc(100% * 130 / 560); }
  .foot-scene p { right: auto; left: max(24px, env(safe-area-inset-left)); bottom: calc(14px + var(--bot, 0px) + var(--tb, 0px) + env(safe-area-inset-bottom)); }
}
