/* trytilia.com's home, laid out like tripsy.app: a phone in the middle with the app's own cards floating around
   it, then one section per part of the app. Set like decocms.com: Switzer at regular weight, a narrow column of
   17 pt text, a small line over each section to scan by. Tilia's paper, ink, hearts and flowers. */
:root {
  --page: #FDFCF8;
  --panel: #F5F2EB;
  --cream: #F4EDE1;
  --ink: #1B170A;
  --muted: rgba(27, 23, 10, 0.64);
  --line: rgba(27, 23, 10, 0.1);
  --sans: "Switzer", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --round: var(--sans);
  --app-sans: "Figtree", system-ui, sans-serif;
  --app-serif: "Instrument Serif", Georgia, serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html.lenis, html.lenis body { height: auto; }
html, body { overflow-x: clip; }
body { margin: 0; background: var(--page); color: var(--ink); font: 18px/1.6 var(--sans); -webkit-font-smoothing: antialiased; }
img { display: block; max-width: 100%; }
a { color: inherit; }
.wrap { max-width: 1160px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }

#perguntas { scroll-margin-top: 40px; }
/* The page's one call to action, closing the story */
.soon.cta { height: 64px; padding: 0 32px; font-size: 17px; border: 0; cursor: pointer; transition: transform 0.16s ease-out, opacity 0.2s ease; }
.soon.cta:active { transform: scale(0.97); }
.soon.cta:disabled { opacity: 0.6; cursor: default; }
a.soon { text-decoration: none; }
button.soon { border: 0; cursor: pointer; }
.step .cta { margin-top: 36px; }
/* The waitlist pop-up: a card centred over the page, dimmed and blurred behind; on a phone, a sheet from below */
.wl {
  width: min(480px, calc(100vw - 32px)); max-width: none; padding: 44px 40px 40px; border: 0; border-radius: 32px;
  background: var(--page); color: var(--ink); box-shadow: 0 40px 100px -20px rgba(27, 23, 10, 0.35);
  max-height: calc(100dvh - 32px); overflow-y: auto; overscroll-behavior: contain;
}
dialog.wl:not([open]) { display: none; }
.wl[open] { position: fixed; inset: 0; margin: auto; height: fit-content; z-index: 100; }
.wl::backdrop { background: rgba(27, 23, 10, 0.35); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.wl[open] { animation: wl-in 0.28s cubic-bezier(0.23, 1, 0.32, 1); }
.wl[open]::backdrop { animation: wl-fade 0.28s ease-out; }
.wl.closing { animation: wl-out 0.18s ease-in forwards; }
.wl.closing::backdrop { animation: wl-fade 0.18s ease-in reverse forwards; }
@keyframes wl-in { from { opacity: 0; transform: translateY(12px) scale(0.97); } }
@keyframes wl-out { to { opacity: 0; transform: translateY(8px) scale(0.98); } }
@keyframes wl-fade { from { opacity: 0; } }
.wl-close { position: absolute; top: 16px; right: 16px; width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--panel); cursor: pointer; display: grid; place-items: center; }
.wl-close svg { width: 18px; fill: none; stroke: var(--ink); stroke-width: 1.8; stroke-linecap: round; }
.wl-mark { width: 44px; height: 44px; display: block; margin-bottom: 20px; }
.wl h2 { font-size: 44px; line-height: 1.02; }
.wl-sub { margin: 12px 0 0; font-size: 17px; line-height: 1.5; color: var(--muted); }
.wl form { margin-top: 28px; display: grid; gap: 10px; }
.wl input[type="email"] { width: 100%; height: 64px; padding: 0 24px; border: 0; border-radius: 999px; background: #fff;
  box-shadow: 0 0 0 1px var(--line); font: 17px/1 var(--sans); color: var(--ink); outline: none; }
.wl input[type="email"]:focus { box-shadow: 0 0 0 2px var(--ink); }
.wl input::placeholder { color: var(--muted); }
.wl .hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.wl-error { margin: 0 0 0 24px; font-size: 14px; color: #B3261E; }
.wl-error:empty { margin-bottom: -10px; }
.wl .soon.cta { width: 100%; justify-content: center; margin-top: 0; }
.wl-thanks .soon.cta { margin-top: 28px; }
.wl-again { display: block; margin: 14px auto 0; border: 0; background: none; font: 15px var(--sans); color: var(--muted); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
@media (max-width: 600px) {
  .wl, .wl[open] { width: 100vw; max-height: calc(100dvh - 16px); margin: auto 0 0; padding: 36px 24px calc(28px + env(safe-area-inset-bottom)); border-radius: 28px 28px 0 0; }
  /* It rides on top of the keyboard when one is up (the script measures it), so the page underneath never moves. */
  .wl[open] { bottom: var(--keyboard, 0px); max-height: calc(100dvh - 16px - var(--keyboard, 0px)); }
  .wl[open] { animation: wl-up 0.32s cubic-bezier(0.32, 0.72, 0, 1); }
  .wl.closing { animation: wl-down 0.2s ease-in forwards; }
  @keyframes wl-up { from { transform: translateY(100%); } }
  @keyframes wl-down { to { transform: translateY(100%); } }
  .wl h2 { font-size: 38px; }
}
@media (prefers-reduced-motion: reduce) { .wl[open], .wl.closing, .wl[open]::backdrop, .wl.closing::backdrop { animation: none; } }
/* Solid paper where transparency is turned down, and on touch screens, where blurring what scrolls under the bar
   every frame costs more than it shows through 10% of see-through paper. */
@media (prefers-reduced-transparency: reduce), (hover: none) {
  /* The waitlist's backdrop only dims there: blurring it draws the whole page into one picture, and Safari lets the
     page's own pictures go to make room, so they came back blank for a moment on closing. */
  .wl::backdrop { -webkit-backdrop-filter: none; backdrop-filter: none; background: rgba(27, 23, 10, 0.45); }
}

/* Type, as deco sets it: regular weight even when big, tight leading on titles, loose on text */
h1, h2, h3 { font-weight: 400; margin: 0; text-wrap: balance; }
/* Every big title is set in Instrument Serif, like the brand; text and small headings stay in Switzer. */
h1, h2 { font-family: var(--app-serif); }
h1 { font-size: 84px; line-height: 1; letter-spacing: -0.01em; }
h2 { font-size: 72px; line-height: 1.02; letter-spacing: -0.01em; }
h3 { font-size: 22px; line-height: 1.3; font-weight: 500; letter-spacing: -0.005em; }
.sub { font-size: 19px; line-height: 1.6; color: var(--muted); max-width: 600px; margin: 18px auto 0; text-wrap: balance; }

.center { text-align: center; }
section { padding: 120px 0 0; }

/* Hero: cream from under the black bar, its lower part filled with every brand flower up to a curve that dips under
   the text and climbs both sides */
/* The first fold is exactly one screen tall, whatever the screen: the text sits a little below the bar and the
   garden fills the rest down to the bottom edge. */
.hero-band {
  position: relative; background: var(--cream); padding-top: max(120px, 25vh); overflow: hidden; height: 100vh; height: 100svh;
}
/* The title and lede sit in the upper part of the screen, under the bar; the garden fills the lower part. */
.hero { position: relative; z-index: 2; width: 100%; text-align: center; will-change: opacity, transform; }
/* The opening: a tall stretch with the first screen pinned, so scrolling parts the garden instead of moving the page */
.opening { position: relative; height: 680vh; }
.opening .hero-band { position: sticky; top: 0; }
.reveal { position: absolute; inset: 0; z-index: 0; display: grid; place-items: center; padding: 0 24px; opacity: 0; will-change: opacity, transform; }
.reveal p { margin: 0; max-width: 1040px; text-align: center; text-wrap: balance; font-family: var(--app-serif); font-size: 76px; line-height: 1.04; letter-spacing: -0.01em; }
.reveal em { font-style: normal; }
.hero h1 { font-family: var(--app-serif); font-size: 112px; line-height: 0.92; letter-spacing: -0.015em; }
.hero .sub { margin-top: 6px; font-size: 20px; line-height: 1.55; max-width: none; }
@media (min-width: 900px) { .hero .sub { white-space: nowrap; } }
.garden {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
}
/* The page colour, faded in over the cream by the script as the opening ends; under everything else in the band. */
.paper { position: absolute; inset: 0; z-index: -1; background: var(--page); opacity: 0; will-change: opacity; pointer-events: none; }
.garden canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.garden .g { position: absolute; transform-origin: 50% 420%; will-change: transform; }
.garden .g img { position: absolute; display: block; }
/* At the end of the pinned stretch the lower edge of the flowers and bits melts into the page (the script fades it in). */
.melt { position: absolute; left: 0; right: 0; bottom: 0; height: 24%; z-index: 4; pointer-events: none; opacity: 0;
  background: linear-gradient(to bottom, rgba(253, 252, 248, 0), var(--page)); }
/* The petals get a hairline of the page around them, like paper cut-outs laid on each other. */
.petal {
  --edge: var(--page); --edge-w: 0.75px;
  filter: drop-shadow(var(--edge-w) 0 0 var(--edge)) drop-shadow(calc(var(--edge-w) * -1) 0 0 var(--edge))
    drop-shadow(0 var(--edge-w) 0 var(--edge)) drop-shadow(0 calc(var(--edge-w) * -1) 0 var(--edge));
}


/* The app's own cards, floating */
.card {
  background: #FDFCF8; border-radius: 24px; padding: 16px 18px;
  box-shadow: 0 0 0 1px var(--line), 0 18px 40px -12px rgba(27, 23, 10, 0.18);
}

/* Sections rise in */
@media (prefers-reduced-motion: no-preference) {
  .rise { opacity: 0; translate: 0 28px; transition: opacity 0.8s ease, translate 0.8s cubic-bezier(0.2, 0.7, 0.2, 1); }
  .rise.in { opacity: 1; translate: 0 0; }
}

/* An iPhone around a real screen: titanium edge, black bezel, the Dynamic Island and the side buttons, all sized
   from the frame's own width so it holds at any size */
.device {
  --u: calc(var(--w, 300px) / 100); width: var(--w, 300px);
  container-type: inline-size; position: relative; padding: calc(var(--u) * 3.2); border-radius: calc(var(--u) * 17); background: #0d0d0e;
  box-shadow: inset 0 0 0 calc(var(--u) * 0.5) #34332f, 0 0 0 calc(var(--u) * 0.6) #d3d0ca, 0 0 0 calc(var(--u) * 1.1) #8e8b85,
    0 40px 90px -24px rgba(27, 23, 10, 0.35), 0 12px 30px -12px rgba(27, 23, 10, 0.18);
}
.device img { display: block; width: 100%; height: auto; border-radius: calc(var(--u) * 14); }
.device::before {
  content: ""; position: absolute; z-index: 1; left: 50%; top: calc(var(--u) * 5.6); width: calc(var(--u) * 28); height: calc(var(--u) * 8.2); margin-left: calc(var(--u) * -14);
  border-radius: 999px; background: #000;
}
.device::after {
  content: ""; position: absolute; right: calc(var(--u) * -1.7); top: calc(var(--u) * 58); width: calc(var(--u) * 0.9); height: calc(var(--u) * 22);
  border-radius: 0 calc(var(--u) * 0.5) calc(var(--u) * 0.5) 0;
  background: #a9a6a0; box-shadow: calc(var(--u) * -102.3) calc(var(--u) * -12) 0 #a9a6a0, calc(var(--u) * -102.3) calc(var(--u) * 14) 0 #a9a6a0;
}

/* The sentence, unfolded like decocms.com's loop: steps scroll on the left, a tinted panel holds on the right,
   inside the page's column, swapping to each step's screens */
.loop { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: 64px; padding-top: 80px; }
.step { min-height: 80vh; display: flex; flex-direction: column; justify-content: center; opacity: 0.3; transition: opacity 0.5s ease; }
.step.on { opacity: 1; }
.step h2 { font-size: 60px; }
.step .sub { margin: 16px 0 0; max-width: 420px; }
.step .cta { align-self: flex-start; }
.count { font-size: 15px; color: var(--muted); font-variant-numeric: tabular-nums; margin-bottom: 16px; }
.step .frame { display: none; }
.panel {
  position: sticky; top: calc(50vh - min(39vh, 360px)); height: min(78vh, 720px); overflow: hidden;
  border-radius: 32px;
  transition: background-color 0.6s ease;
}
.frame { position: absolute; inset: 0; }
.panel .frame { opacity: 0; transform: translateY(28px); transition: opacity 0.5s ease-out, transform 0.8s cubic-bezier(0.23, 1, 0.32, 1); }
.panel .frame.on { opacity: 1; transform: none; }
.panel .frame:not(.on) { pointer-events: none; }
.frame .device { --w: 320px; position: absolute; left: 50%; top: 56px; margin-left: -160px; }
.frame.two .device:nth-of-type(1) { margin-left: -290px; top: 100px; transform: rotate(-6deg); }
.frame.two .device:nth-of-type(2) { margin-left: -40px; transform: rotate(4deg); }
/* The same three flowers in every panel: a big one at the top left, a small one under it, a middle one low on the right */
.corner { position: absolute; z-index: 2; pointer-events: none; }
.corner.c1 { width: 120px; left: 28px; top: 24px; }
.corner.c2 { width: 56px; left: 44px; top: 152px; rotate: 18deg; }
.corner.c3 { width: 96px; right: 28px; bottom: 32px; rotate: -12deg; }
/* Questions, opened one at a time */
.faq { padding-top: 160px; max-width: 760px; }
.faq .cta { margin-top: 40px; }
.faq h2 { font-size: 60px; }
.qs { margin-top: 32px; border-top: 1px solid var(--line); }
.qs details { border-bottom: 1px solid var(--line); }
.qs summary {
  list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 24px;
  padding: 24px 0; font-size: 21px;
}
.qs summary::-webkit-details-marker { display: none; }
/* No grey block where a finger lands; the answer's own motion is the feedback. */
.qs summary { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.qs summary::after { content: "+"; font-size: 28px; font-weight: 300; color: var(--muted); transition: rotate 0.25s cubic-bezier(0.23, 1, 0.32, 1); }
.qs details[open] summary::after { rotate: 45deg; }
/* While one closes it is still open, so the × turns back into a + with the motion, not after it. */
.qs details[open].shut summary::after { rotate: 0deg; }
.qs p { margin: -8px 0 0; padding: 0 48px 24px 0; color: var(--muted); font-size: 18px; line-height: 1.6; }

/* Only the two of you: Tilia's sealed letter, which won't open */
/* Only where it's shown: the panel on a desktop, the step itself on a phone (a step's own copy stays hidden on a desktop). */
.panel .frame.sealed { display: grid; place-items: center; align-content: center; }
.letter { position: relative; z-index: 1; width: min(98%, 585px); cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.letter:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; border-radius: 12px; }
.letter img { display: block; width: 100%; height: auto; user-select: none; -webkit-user-drag: none; }
.letter img + img { position: absolute; inset: 0; }
.locked { position: absolute; left: 0; right: 0; bottom: 18%; text-align: center; margin: 0; font-size: 18px; color: var(--ink);
  opacity: 0; transform: translateY(6px); transition: opacity 0.3s ease-out, transform 0.4s cubic-bezier(0.23, 1, 0.32, 1); }
.locked.on { opacity: 0.85; transform: none; }

/* Her side: tall, so the page scrolls through each of its pages while the words stay put */
.step.tabs { min-height: 330vh; justify-content: flex-start; }
.step.tabs .pin { position: sticky; top: calc(50vh - 190px); }
.tab-sub { min-height: 3.2em; }
.tab-sub.swap { animation: tab-sub 0.35s ease-out; }
@keyframes tab-sub { from { opacity: 0; transform: translateY(4px); } }
@media (prefers-reduced-motion: reduce) { .tab-sub.swap { animation: none; } }
.tab-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; max-width: 440px; }
.tab-list button {
  font: 500 15px/1 var(--sans); color: var(--muted); background: var(--panel); border: 0; border-radius: 999px; padding: 10px 16px;
  cursor: pointer; transition: background-color 0.25s ease, color 0.25s ease, transform 0.16s ease-out;
}
.tab-list button.on { background: var(--ink); color: var(--page); }
.tab-list button:active { transform: scale(0.97); }
.device img[data-tab] { transition: opacity 0.35s ease; }
.device img[data-tab]:not(:first-child) {
  position: absolute; left: calc(var(--u) * 3.2); top: calc(var(--u) * 3.2); width: calc(100% - var(--u) * 6.4);
}
.device img[data-tab]:not(.on) { opacity: 0; }


/* Phone width */
@media (max-width: 900px) {
  h1 { font-size: 54px; }
  h2 { font-size: 48px; }
  .sub { font-size: 17px; }
  /* Never taller than leaves room for the bits around it on a short phone. */
  .reveal p { font-size: 46px; font-size: min(46px, 5.4svh); }
  section { padding-top: 88px; }
  .loop { grid-template-columns: 1fr; gap: 0; padding-top: 0; }
  .stage { display: none; }
  .step { min-height: 0; opacity: 1; padding-top: 88px; }
  .step.tabs { min-height: 0; }
  .step.tabs .pin { position: static; }
  .tab-list { margin-top: 20px; }
  .step .frame.sealed { display: grid; place-items: center; align-content: center; }
  .letter { width: 100%; }
  .locked { bottom: 12%; font-size: 15px; }
  .faq { padding-top: 96px; }
  .faq h2 { font-size: 48px; }
  .qs summary { font-size: 18px; padding: 20px 0; }
  .qs p { font-size: 16px; padding-right: 0; }
  .step h2 { font-size: 48px; }
  .step .frame { display: block; position: relative; height: 500px; margin: 32px -24px 0; overflow: hidden; background: var(--tint); }
  .frame .device { --w: 240px; margin-left: -120px; top: 40px; }
  .frame.two .device { --w: 200px; }
  .frame.two .device:nth-of-type(1) { margin-left: -180px; top: 64px; }
  .frame.two .device:nth-of-type(2) { margin-left: -30px; }
  .corner.c1 { width: 72px; left: 16px; top: 16px; }
  .corner.c2 { width: 34px; left: auto; right: 22px; top: 14px; }
  .corner.c3 { width: 48px; right: 12px; bottom: 12px; }
}

/* The gathering, inside the pinned first screen: bits of a couple's life spread over other apps fly in around the
   sentence, the phone rises through it and draws them in, flowers settle along its edges, the garden closes again around it. */
.gather {
  position: absolute; inset: 0; z-index: 3; pointer-events: none;
}
/* The closing line answers the opening title, set the same way */
.line-b {
  position: absolute; left: 24px; right: 24px; top: 15vh; z-index: 6; text-align: center; opacity: 0; will-change: opacity, filter;
  font-family: var(--app-serif); font-size: 96px; line-height: 1; letter-spacing: -0.01em;
}
/* The phones stand in front of the flowers holding them, a little above the garden's edge, fanned close like a hand
   of cards; their lower part turns into the page colour, so they melt into the page without the garden showing
   through. */
.box { --w: 270px; position: absolute; left: 50%; top: 52vh; width: 270px; height: 72vh; margin-left: -135px; z-index: 5; will-change: transform; }
.box::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom, transparent 24vh, var(--page) 40vh); }
.bit, .petal { position: absolute; left: 0; top: 0; will-change: transform, opacity; }
/* Until the script has placed them, the scene's pieces stay out of sight, so a reload never flashes them piled at the top. */
html:not(.drawn) .gather > *, html:not(.drawn) .box { visibility: hidden; }
.petal { z-index: 2; }
.bit { z-index: 6; font: 21px/1.35 var(--app-sans); white-space: nowrap; padding: 18px 24px; border-radius: 24px; }
.bit small { display: block; font-size: 15px; color: var(--muted); margin-bottom: 4px; }
/* The loose photo: a card like the others, with the picture beside its app and line */
.bit.photo { display: flex; align-items: center; gap: 14px; padding: 12px 24px 12px 12px; }
.bit.photo img { width: 64px; height: 64px; border-radius: 14px; object-fit: cover; flex: none; }

@media (max-width: 900px) {
  .hero h1 { font-size: 64px; }
  .hero .sub { margin-top: 6px; font-size: 17px; }
  .box { --w: 190px; width: 190px; margin-left: -95px; top: 50vh; }
  /* Halfway between the bar and the phones' tops (at half the screen), however many lines it takes. */
  .line-b { font-size: 52px; top: calc(25vh + 30px); transform: translateY(-50%); }
  .bit { font-size: 15px; padding: 12px 15px; white-space: normal; max-width: calc(50vw - 20px); }
  .bit small { font-size: 12px; }
  .bit.photo { gap: 10px; padding: 8px 15px 8px 8px; }
  .bit.photo img { width: 44px; height: 44px; border-radius: 10px; }
}
/* On phones and touch screens (the light way, as the script calls it) the petals go without their hairline: four
   shadows on each, drawn again as they move, cost more than the hairline shows on the page colour. */
@media (max-width: 899px), (hover: none) { .petal { filter: none; } }
/* The light way moves the garden at a steady beat (the script places its flowers about sixteen times a second while
   it scrolls) and they glide to each new place at an even pace, a little longer than a beat, on the graphics card:
   each glide runs into the next, so the garden moves on continuously instead of pushing and stopping. */
.steps .garden, .steps .melt, .steps .garden .g {
  transition-property: transform, opacity; transition-duration: 90ms; transition-timing-function: linear;
}
/* (The words, the phones, the bits and the flowers settling around them aren't glided: the script places them every
   frame.) */
/* And the garden's flowers sprout up as the page opens, one just after another. */
@keyframes sprout { from { transform: translateY(48px); opacity: 0; } }
.garden.sprout .g { animation: sprout 0.55s cubic-bezier(0.23, 1, 0.32, 1) var(--sprout, 0s) both; }
