@font-face { font-family: Shrikhand; src: url("../fonts/Shrikhand-Regular.ttf") format("truetype"); font-display: block; }
@font-face { font-family: "Familjen Grotesk"; src: url("../fonts/FamiljenGrotesk.ttf") format("truetype"); font-weight: 400 700; font-display: swap; }

/* Colours: the app's own palettes, from the Wise and Raycast systems on styles.refero.design.
   z-index: live window 2, grip 3, skip link 9. Corners: controls are pills, surfaces are 28px. */
:root {
  --yellow: #FFEA4B; --red: #CB272F; --pink: #FFD5F0; --plum: #370305;
  --field: var(--yellow); --ink: var(--plum); --button: var(--plum); --on-button: var(--yellow);
  --display: Shrikhand, cursive;
  --text: "Familjen Grotesk", sans-serif;
  --out: cubic-bezier(.23, 1, .32, 1);
  --gutter: clamp(20px, 4.2vw, 76px);
  --top: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; margin: 0; }
html { background: var(--yellow); -webkit-tap-highlight-color: transparent; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
/* Clipped here, not on body: the thrown pile of windows reaches past both edges. */
main { display: block; overflow-x: clip; }
body { color: var(--plum); font: 600 18px/1.5 var(--text); overflow-x: clip; }
img, canvas { display: block; }
img { max-width: 100%; height: auto; }
a { color: inherit; }
a, button { touch-action: manipulation; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; line-height: 1.06; }
p, dd { text-wrap: pretty; }
:focus-visible { outline: 3px solid currentColor; outline-offset: 5px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: fixed; z-index: 9; top: 10px; left: 10px; padding: 12px 18px; border-radius: 99px; background: var(--plum); color: var(--yellow); transform: translateY(-160%); }
.skip:focus { transform: none; }

.pill { display: inline-flex; align-items: center; justify-content: center; height: 62px; padding: 0 34px; border-radius: 99px; background: var(--button); color: var(--on-button); font-size: 20px; line-height: 1; text-decoration: none; white-space: nowrap; user-select: none; -webkit-user-select: none; transition: transform 160ms var(--out); }
.pill.small { height: 44px; padding: 0 22px; font-size: 16px; }
span.pill { cursor: default; }
.pill:active { transform: scale(.95); }
@media (hover: hover) and (pointer: fine) {
  .pill:hover { transform: translateY(-3px) rotate(-1.2deg); }
  .pill:active { transform: scale(.95); }
  .plain:hover, .foot a:hover { text-decoration: underline; text-underline-offset: 5px; }
}

/* Each material's colours. Every panel carries its own words, so a pour can never hide them. */
.m-jelly  { --field: #FFEA4B; --ink: #370305; --button: #CB272F; --on-button: #FFFFFF; }
.m-water  { --field: #0097C7; --ink: #041C24; }
.m-cloth  { --field: #054D28; --ink: #E2F6D5; }
.m-metal  { --field: #454745; --ink: #E8EBE6; }
.m-sand   { --field: #FFD5F0; --ink: #370305; }
.m-fire   { --field: #FF6363; --ink: #23090A; }
.m-glass  { --field: #E8EBE6; --ink: #0E0F0C; }
.m-melt   { --field: #163300; --ink: #E2F6D5; }
.m-pixels { --field: #9FE870; --ink: #163300; }
.m-glitch { --field: #370305; --ink: #FFD5F0; }
.panel:not(.m-jelly) { --button: var(--ink); --on-button: var(--field); }

/* Without script, or with Reduce Motion, the ten simply follow one another down the page. */
.panel { position: relative; background: var(--field); color: var(--ink); overflow: hidden; }
.panel-in {
  position: relative; min-height: 100svh;
  padding: calc(var(--top) + 18px) var(--gutter) calc(env(safe-area-inset-bottom, 0px) + 22px);
  display: grid; align-items: center; column-gap: 2vw;
  grid-template-columns: minmax(0, 40fr) minmax(0, 60fr);
  grid-template-rows: auto minmax(0, 1fr) auto;
}
.bar { grid-column: 1 / -1; height: 60px; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; font: 400 30px/1 var(--display); text-decoration: none; }
.bar nav { display: flex; align-items: center; gap: 26px; white-space: nowrap; }
.plain { text-decoration: none; }
.words { position: relative; }
.say { font-size: clamp(44px, min(5.6vw, 10vh), 124px); }
.say > span { display: block; white-space: nowrap; }
.verb { font-size: 1.56em; line-height: 1.16; }
.verb i { display: inline-block; font-style: normal; }
.line { max-width: 25ch; min-height: 4.2em; margin: 18px 0 28px; font-size: clamp(18px, 1.5vw, 24px); line-height: 1.4; text-wrap: balance; }
/* Out of the flow, so the headline sits in the same place in all ten and only its colour changes in a pour. */
.grab { position: absolute; left: 0; top: 100%; margin-top: 16px; font-size: 16px; }

.slot { display: grid; place-items: center; min-width: 0; }
/* The box is the window. A film is bigger: the room the effect needs to spill into. */
.window { position: relative; width: min(84%, calc((100svh - 260px) * 1.544), 900px); aspect-ratio: 880 / 570; }
.film { position: absolute; left: -29.545%; top: -31.579%; width: 159.091%; height: 175.439%; max-width: none; pointer-events: none; }
canvas.film { opacity: 0; }
.drawn canvas.film { opacity: 1; }
.drawn .still { opacity: 0; }
.live { position: absolute; left: 0; top: 0; z-index: 2; width: 100%; height: 100%; pointer-events: none; opacity: 0; }
.hit { position: absolute; left: 0; top: 0; z-index: 3; display: none; transform-origin: 0 0; cursor: grab; touch-action: pan-y; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
/* The title bar takes every direction. The body below it still lets a thumb scroll the page. */
.hit b { position: absolute; inset: 0 0 auto; height: 22%; touch-action: none; }
.lively .live { opacity: 1; }
.lively .hit { display: block; }
.lively .still { opacity: 0; }
.hit.held { cursor: grabbing; }

.rail { grid-column: 1 / -1; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(10, auto); justify-content: space-between; gap: 4px; }
.rail a { display: flex; align-items: center; height: 44px; padding: 0 clamp(8px, 1.1vw, 20px); border-radius: 99px; font-size: clamp(14px, 1.15vw, 17px); text-decoration: none; user-select: none; -webkit-user-select: none; transition: transform 140ms var(--out); }
.rail a[aria-current] { background: var(--ink); color: var(--field); }
.rail a:active { transform: scale(.94); }
@media (hover: hover) and (pointer: fine) {
  .rail a:hover { transform: translateY(-3px); }
}

/* The pour: one stage, pinned. Each colour is taller than the screen, so its curved lip has somewhere to go. */
.pouring .stage { --lip: 14vh; position: relative; height: 100vh; height: 100lvh; overflow: hidden; overflow: clip; }
.pouring .panel { position: absolute; left: -3vw; right: -3vw; top: calc(var(--lip) * -1); bottom: 0; background: none; }
.pouring .panel::before { content: ""; position: absolute; inset: 0; background: var(--field); border-radius: 56% 44% 0 0 / 10vh 6vh 0 0; }
.pouring .panel-in { position: absolute; left: 3vw; right: 3vw; top: var(--lip); height: 100svh; min-height: 0; will-change: transform; }
.pouring .panel { will-change: transform; }
/* In the middle of the window, so it is on screen: Safari will not start a muted video it thinks nobody can see. */
.source { position: absolute; left: 50%; top: 50%; width: 8px; height: 12px; opacity: .011; pointer-events: none; }

/* After the story */
.unbroken, .yours, .price, .questions, .last { width: min(1440px, 100%); margin-inline: auto; padding-inline: var(--gutter); }
.unbroken { padding-top: clamp(96px, 15vh, 170px); padding-bottom: 80px; display: grid; gap: 34px; }
.unbroken h2, .price h2, .questions h2, .last h2 { font-size: clamp(44px, 7vw, 108px); }
.unbroken h2 span { display: block; }
.unbroken p { max-width: 34ch; margin-top: 22px; font-size: clamp(19px, 1.8vw, 26px); line-height: 1.4; }
.unbroken-words { text-align: center; display: grid; justify-items: center; }
.pile { position: relative; width: min(920px, 92%); margin: 34px auto 0; aspect-ratio: 1100 / 712; }
.pile img { position: absolute; inset: 0; width: 100%; height: 100%; will-change: transform; }
.pile img:last-child { filter: drop-shadow(0 26px 34px rgb(55 3 5 / .26)); }

.yours { padding-block: 70px; display: grid; gap: 22px; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.yours article { border-radius: 28px; overflow: hidden; padding: clamp(26px, 3.4vw, 52px); }
.yours h2 { font-size: clamp(32px, 3.7vw, 60px); text-wrap: balance; }
.yours p { max-width: 31ch; margin-top: 14px; font-size: 19px; line-height: 1.42; }
.tune { grid-row: span 2; background: var(--red); color: #fff; display: grid; align-content: space-between; gap: 34px; }
.tune img { width: min(100%, 560px); justify-self: center; }
.rules { background: var(--red); color: #fff; display: grid; gap: 26px; }
.private { background: var(--pink); display: grid; align-content: center; }

.price { padding-block: 100px 70px; }
.tiers { margin-top: 38px; display: grid; gap: 22px; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); }
.tier { border-radius: 28px; padding: clamp(26px, 3.4vw, 52px); }
.tier h3 { font-size: clamp(42px, 5.6vw, 86px); white-space: nowrap; }
.tier p { max-width: 34ch; margin-top: 14px; }
.tier .big { font-size: clamp(22px, 2.1vw, 30px); line-height: 1.25; }
.free { background: var(--pink); }
.paid { --button: var(--yellow); --on-button: var(--plum); background: var(--red); color: #fff; }
.paid .pill { margin-top: 30px; }

.questions { padding-block: 70px; }
.questions dl { margin-top: 38px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 34px 60px; }
.questions dt { font-size: 23px; line-height: 1.25; }
.questions dd { max-width: 48ch; margin-top: 8px; font-weight: 500; }

.last { padding-block: 60px 100px; display: grid; justify-items: center; gap: 26px; text-align: center; }
.last .pill { --button: var(--red); --on-button: #fff; }
.poke { width: min(440px, 78vw); padding: 0; border: 0; background: none; cursor: pointer; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.poke img { width: 100%; height: auto; transform-origin: 50% 92%; pointer-events: none; }

.foot { padding: 26px var(--gutter) calc(env(safe-area-inset-bottom, 0px) + 26px); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 14px 24px; font-size: 16px; }
.links { display: flex; gap: 22px; }
.foot a { display: inline-flex; align-items: center; min-height: 44px; }

/* Privacy and support */
.page > .bar { padding: calc(var(--top) + 18px) var(--gutter) 0; height: auto; }
.page > .bar .brand { min-height: 60px; }
.doc { width: min(780px, 100%); margin: auto; padding: 50px var(--gutter) 70px; }
.doc h1 { font-size: clamp(56px, 9vw, 104px); margin-bottom: 26px; }
.doc h2 { font-size: clamp(25px, 3vw, 34px); margin: 38px 0 10px; }
.doc p { max-width: 65ch; margin-top: 10px; font-weight: 500; overflow-wrap: anywhere; }

@media (max-width: 1080px) {
  .rail { grid-template-columns: repeat(10, minmax(0, 1fr)); }
  .rail a { justify-content: center; padding: 0 2px; }
}
@media (max-width: 820px), (max-aspect-ratio: 4/5) {
  .panel-in { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto minmax(0, 1fr) auto; padding-inline: 20px; }
  .bar { height: 52px; }
  .brand { font-size: 26px; }
  .brand img { width: 38px; height: 38px; }
  .bar .plain { display: none; }
  .pill.small { height: 44px; padding: 0 16px; font-size: 15px; }
  .brand { min-height: 44px; }
  .words { padding-top: min(2.2svh, 22px); }
  .say { font-size: min(11.2vw, 5.7svh); }
  .line { max-width: 29ch; min-height: 2.8em; margin: 8px 0 14px; font-size: min(4.6vw, 21px); }
  .words .pill { height: 50px; padding: 0 24px; font-size: 17px; }
  .words .grab { display: none; }
  .window { width: min(80vw, 520px, calc((100svh - 492px) * 1.544)); min-width: min(56vw, 250px); }
  .rail { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; }
  .rail a { height: 44px; padding: 0; font-size: 15px; }
  /* The pinned panel has a known height, so the window takes what the words and the rail leave. */
  .pouring .slot { align-self: stretch; container-type: size; }
  .pouring .window { min-width: 0; width: min(80vw, 520px, 90cqh * 1.544); }
  .yours, .tiers, .questions dl { grid-template-columns: minmax(0, 1fr); }
  .tune { grid-row: auto; }
  .unbroken { padding-top: 80px; }
}
/* The drag hint hangs below the button, where a short screen has the rail. */
@media (max-height: 720px) {
  .words .grab { display: none; }
}
/* Short and upright, like a small iPhone with Safari's bars showing: the window matters more than the second line. */
@media (max-height: 650px) and (max-aspect-ratio: 1/1) {
  .line { display: none; }
  .words .pill { margin-top: 12px; }
}
/* A phone on its side keeps two columns, even when it is narrow enough to be a phone upright. */
@media (max-height: 520px) and (orientation: landscape) {
  .panel-in {
    grid-template-columns: minmax(0, 46fr) minmax(0, 54fr); grid-template-rows: auto minmax(0, 1fr) auto;
    padding: calc(var(--top) + 8px) max(20px, env(safe-area-inset-right, 0px)) 6px max(20px, env(safe-area-inset-left, 0px));
  }
  .bar { height: 44px; }
  .brand { min-height: 44px; }
  .words { padding-top: 0; }
  .say { font-size: min(9.2vh, 5.2vw); }
  .line, .words .grab { display: none; }
  .words .pill { height: 44px; margin-top: 10px; font-size: 16px; }
  .window { width: min(80%, calc((100svh - 160px) * 1.544)); min-width: 0; }
  .pouring .slot { align-self: stretch; container-type: size; }
  .pouring .window { width: min(86cqw, 88cqh * 1.544); }
  .rail { grid-template-columns: repeat(10, minmax(0, 1fr)); }
  .rail a { height: 44px; padding: 0; font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
