/* Roof & Root site styles. */

@font-face { font-family: 'Inter'; src: url('fonts/inter-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('fonts/inter-500.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('fonts/inter-600.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Newsreader'; src: url('fonts/newsreader-600.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Fraunces'; src: url('fonts/fraunces-amp.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Newsreader Fallback'; src: local('Georgia'); size-adjust: 94%; ascent-override: 98%; descent-override: 26%; }
@font-face { font-family: 'Inter Fallback'; src: local('Arial'); size-adjust: 107%; ascent-override: 90%; descent-override: 22%; }

:root {
  color-scheme: light dark;
  --linen: #FBFAF8;
  --ink: #2A2A33;
  --grey: #5C5C68;
  --line: #E4E1DB;
  --blue: #0061FF;
  --blue-press: #0052D9;
  --on-blue: #FFFFFF;
  --clay: #C4703F;
  --band: #2A2A33;
  --on-band: #F4F3F0;
  --band-line: rgba(255, 255, 255, 0.16);
  --foot: #EFEDE8;
  --hair: rgba(42, 42, 51, 0.12);
  --header: rgba(251, 250, 248, 0.9);
  /* the app's own colours, for pictures of the app */
  --app-card: #FFFFFF;
  --app-text: #2A2A33;
  --app-sub: #596B82;
  --app-tint: #0061FF;
  --app-tint-soft: #E8F1FF;
  --app-fill: #EEF0F4;
  --app-success: #007A42;
  --app-success-soft: #E3F5EC;
  --app-shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 6px 18px rgba(16, 24, 40, 0.08);
  --display: 'Newsreader', 'Newsreader Fallback', Georgia, serif;
  --amp: 'Fraunces', 'Newsreader', Georgia, serif;
  --sans: 'Inter', 'Inter Fallback', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --gut: max(16px, env(safe-area-inset-left, 0px));
  --gut-r: max(16px, env(safe-area-inset-right, 0px));
}
@media (prefers-color-scheme: dark) {
  :root {
    --linen: #17161A;
    --ink: #F0F1F5;
    --grey: #A9AAB6;
    --line: #2E2D33;
    --blue: #4C8DFF;
    --blue-press: #6FA3FF;
    --on-blue: #0B1020;
    --clay: #E08A5A;
    --band: #24252C;
    --on-band: #F0F1F5;
    --foot: #131418;
    --hair: rgba(255, 255, 255, 0.14);
    --header: rgba(23, 22, 26, 0.9);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 56px; }
body { margin: 0; background: var(--linen); color: var(--ink); font: 400 17px/26px var(--sans); letter-spacing: -0.006em; -webkit-font-smoothing: antialiased; overflow-x: clip; }
img, video { max-width: 100%; display: block; }
p, h1, h2, figure, blockquote, dl, dd, ul { margin: 0; padding: 0; }
ul { list-style: none; }
a { color: var(--blue); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--blue-press); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 6px; }
[hidden] { display: none !important; }
html:not(.js) .js-only { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 8px; z-index: 30; background: var(--linen); padding: 8px 12px; border-radius: 8px; }
.i { width: 1em; height: 1em; fill: currentColor; flex: none; }

/* ---- type ---- */
h1, h2, .h2 { font-family: var(--display); font-weight: 600; letter-spacing: -0.018em; text-wrap: balance; }
h1, .big { font-size: 36px; line-height: 38px; }
h2, .h2 { font-size: 28px; line-height: 32px; }
.dateline { font-weight: 600; }
.cap, .credit { font-size: 14px; line-height: 20px; }
.clay { color: var(--clay); }
@media (max-width: 389px) { h1, .big { font-size: 34px; line-height: 36px; } }
@media (max-width: 359px) { h1, .big { font-size: 28px; line-height: 31px; } h2, .h2 { font-size: 25px; line-height: 29px; } }

/* ---- header ---- */
.top { position: sticky; top: 0; z-index: 20; height: calc(48px + env(safe-area-inset-top, 0px)); padding: env(safe-area-inset-top, 0px) var(--gut-r) 0 var(--gut); display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--header); -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px); }
.wordmark { font: 600 21px/44px var(--display); letter-spacing: -0.01em; color: var(--ink); text-decoration: none; white-space: nowrap; display: inline-block; }
.wordmark:hover { color: var(--ink); }
.amp { font-family: var(--amp); color: var(--clay); }
.top-hint { font-size: 14px; line-height: 18px; font-weight: 600; margin-right: auto; }
.top-hint:not([hidden]) ~ * { }
.pill { display: inline-flex; align-items: center; height: 34px; padding: 0 15px; border-radius: 17px; background: var(--blue); color: var(--on-blue); font: 600 15px/1 var(--sans); text-decoration: none; white-space: nowrap; position: relative; transition: background-color 150ms var(--ease); }
.pill::after { content: ""; position: absolute; inset: -5px -4px; }            /* a 44 px target */
.pill:hover { background: var(--blue-press); color: var(--on-blue); }

/* ---- sections ---- */
main > section { padding-top: 80px; }
main > section.first { padding-top: 8px; }
main > section.ink { margin-top: 80px; padding-top: 0; }
main > section.home { padding-top: 0; }
.words, .letter { padding-left: var(--gut); padding-right: var(--gut-r); }
.words > * + * { margin-top: 12px; }
.lede { margin-top: 12px; }
.cap { color: var(--grey); }
p, dd, .cap, .credit { text-wrap: pretty; }
.quiet { display: block; }

/* ---- the app itself: real screens, never redrawn. A phone on a panel, cut hard at a card
   boundary (--show is the share of the screen that shows), or a card cut from a screen. ---- */
.pics { display: flex; flex-direction: column; gap: 20px; margin-top: 28px; padding: 0 var(--gut-r) 0 var(--gut); }
.first .pics { margin-top: 24px; }
.shot { min-width: 0; }
.shot > .cap { margin-top: 8px; padding: 0; text-wrap: balance; }
.stage { --canvas: #EFEDE8; padding: 32px 0 0; border-radius: 24px; background: var(--canvas); overflow: hidden; display: flex; justify-content: center; }
.phone { position: relative; width: min(86%, 320px); padding: 10px 10px 0; border-radius: 52px 52px 0 0; background: #141518; box-shadow: inset 0 0 0 1.5px #2C2D33, 0 0 0 1px rgba(0, 0, 0, 0.55), 0 24px 48px -24px rgba(42, 32, 20, 0.35); }
.phone::before { content: ""; position: absolute; z-index: 1; left: 50%; top: 10px; margin-top: 3.2%; width: 27%; aspect-ratio: 3.4 / 1; transform: translateX(-50%); border-radius: 999px; background: #0A0A0C; }   /* the Dynamic Island: part of the phone, not of the screen */
.screen { aspect-ratio: 440 / calc(956 * var(--show, 1)); overflow: hidden; border-radius: 42px 42px 0 0; background: #F2F3F7; }
.screen img { width: 100%; height: auto; display: block; }
.tile picture { display: block; position: relative; border-radius: 24px; overflow: hidden; background: #F2F3F7; }
.tile picture::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px var(--hair); pointer-events: none; }   /* the hairline sits inside, so cards, panels and photos share one edge */
.tile img { width: 100%; height: auto; display: block; }
.chat { gap: 10px; }
.shot .frame { margin: 0; }
@media (prefers-color-scheme: dark) {
  .stage { --canvas: #24252C; }
  .phone { background: #0C0D10; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.22); }
  .screen img, .tile img { filter: brightness(0.92); }
}

/* ---- words ---- */
.get { display: flex; align-items: center; gap: 12px; margin-top: 20px !important; }
.badge { display: inline-block; line-height: 0; border-radius: 8px; flex: none; }
.badge img { height: 44px; width: auto; }
.get-note { font-size: 14px; line-height: 20px; min-width: 0; }
.get-note .hint { display: block; font-weight: 600; }
.qr { display: none; }
.rowlink { margin-top: 20px !important; padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.rowlink a { font-weight: 600; text-decoration: none; }
.keeps-list { margin-top: 16px !important; border-top: 1px solid var(--line); }
.keeps-list > div { display: grid; grid-template-columns: 76px 1fr; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.keeps-list dt { font-weight: 600; }
.keeps-list dd { margin: 0; }

/* ---- frames: inset 12, 24 px corners, 3:2 for people and Luna, 2:1 for things ---- */
.frame { position: relative; margin: 12px 12px 0; border-radius: 24px; overflow: hidden; background: var(--line); }
.frame.r32 { aspect-ratio: 3 / 2; }
.frame.r21 { aspect-ratio: 2 / 1; }
.frame img, .frame video { width: 100%; height: 100%; object-fit: cover; }
.frame::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px var(--hair); pointer-events: none; }
.credit { margin: 6px var(--gut-r) 0 var(--gut); }

/* ---- texts ---- */
.bubble { display: inline-block; font: 400 15px/20px var(--sans); padding: 7px 12px; border-radius: 18px; letter-spacing: -0.005em; }
.bubble.them { background: #FFFFFF; color: #2A2A33; }
.bubble.you { background: #2A2A33; color: #FFFFFF; }
.bubble.on-pic { position: absolute; left: 12px; bottom: 12px; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.22); text-align: left; }
.reply { display: flex; justify-content: flex-end; margin: 12px var(--gut-r) 0 var(--gut); }
@media (prefers-color-scheme: dark) { .bubble.you { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22); } }

/* ---- 7. Plain dealing ---- */
.letter blockquote h2 + p { margin-top: 12px; }
.letter blockquote p + p { margin-top: 12px; }
.letter blockquote p + details, .letter details p { margin-top: 12px; }
.letter summary { display: inline-block; color: var(--blue); cursor: pointer; list-style: none; min-height: 44px; padding: 9px 0; }
.letter summary::-webkit-details-marker { display: none; }
.letter details[open] summary { display: none; }
.signed { margin-top: 16px; font-size: 14px; line-height: 20px; color: var(--ink); }
.ink { background: var(--band); color: var(--on-band); }
.ink-in { padding: 56px var(--gut-r) 56px var(--gut); }
.ledger { margin-top: 28px; border-top: 1px solid var(--band-line); }
.ledger > div { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 13px 0 12px; border-bottom: 1px solid var(--band-line); }
.ledger dt { font: 400 17px/26px var(--sans); }
.ledger dd { font: 600 28px/32px var(--display); letter-spacing: -0.01em; font-variant-numeric: lining-nums tabular-nums; }
.ledger > div:nth-child(4) { border-bottom-color: rgba(255, 255, 255, 0.55); }
.ink a { color: #FFFFFF; text-decoration: underline; }
.fine { font-size: 14px; line-height: 20px; margin-top: 14px; }
.plan { margin-top: 20px; }
.plan b { font-weight: 600; }
.badge.on-ink { margin-top: 28px; }
.get-note.on-ink { margin-top: 8px; }

/* ---- 8. Home: the one picture that breaks the frame ---- */
main > section.home { padding-top: 0; }
.film { padding: 0 var(--gut-r) 0 var(--gut); }
.film-stage { position: relative; aspect-ratio: 1 / 1; background: #15161B; overflow: hidden; border-radius: 24px; transition: aspect-ratio 250ms var(--ease); }
.film.playing .film-stage, .film.ended .film-stage { aspect-ratio: 4 / 5; max-height: calc(100svh - 48px - 96px); margin: 0 auto; }
.film-poster img, .film-stage video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.film-stage video { object-fit: contain; background: #15161B; }
.film-play { position: absolute; right: 16px; bottom: 16px; display: inline-flex; align-items: center; gap: 10px; height: 44px; padding: 0 16px 0 14px; border-radius: 22px; background: rgba(22, 22, 26, 0.78); color: #FFFFFF; font: 600 15px/1 var(--sans); text-decoration: none; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.film-play:hover { color: #FFFFFF; background: rgba(22, 22, 26, 0.9); }
.film-play .i { width: 14px; height: 14px; }
.film-progress { position: absolute; left: 0; bottom: 0; height: 2px; width: 30%; background: #FFFFFF; animation: wait 1.2s linear infinite; }
@keyframes wait { from { transform: translateX(-100%); } to { transform: translateX(340%); } }
.film-captions { position: absolute; left: 12px; right: 12px; bottom: 14px; text-align: center; pointer-events: none; }
.film-captions span { display: inline; background: rgba(22, 22, 26, 0.82); color: #FFFFFF; font: 500 16px/24px var(--sans); padding: 3px 8px; border-radius: 6px; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.film-controls { display: flex; justify-content: center; gap: 20px; padding: 6px var(--gut-r) 0 var(--gut); }
.film-controls button, .replay { width: 44px; height: 44px; border: 0; border-radius: 50%; background: none; color: var(--ink); display: grid; place-items: center; cursor: pointer; }
.film-controls button .i, .replay .i { width: 24px; height: 24px; }
.film-controls button:hover, .replay:hover { background: var(--hair); }
#film-sound[aria-pressed="true"] .mute, #film-sound[aria-pressed="false"] .waves { display: none; }
#film-toggle .play { display: none; }
#film-toggle.paused .play { display: inline; }
#film-toggle.paused .pause { display: none; }
#film-cc[aria-pressed="false"] { opacity: 0.45; }
.home .words { margin-top: 40px; }
.home .credit { margin: 8px 0 0; color: var(--grey); }
.home .film-controls { padding-left: 0; padding-right: 0; }
main > section.home { margin-top: 80px; }
@media (max-width: 899px) { .badge.on-ink, .get-note.on-ink { display: none; } .ink-in { padding-bottom: 48px; } }
.replay { margin-left: auto; }

/* ---- plain pages: the film in words, and the page that is not there ---- */
.doc { padding: 24px var(--gut-r) 0 var(--gut); max-width: 680px; margin: 0 auto; }
.doc > * + * { margin-top: 12px; }
.doc h2 { margin-top: 40px; }
.doc .credit { margin-left: 0; margin-right: 0; }
.doc .texts { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; margin-top: 12px; }
.doc .texts.right { align-items: flex-end; }
.doc .bubble.them { box-shadow: inset 0 0 0 1px var(--hair); }
.doc .back { margin-top: 40px; }
.doc.lost { padding-top: 0; padding-left: 0; padding-right: 0; }
.doc.lost > :not(.frame) { margin-left: var(--gut); margin-right: var(--gut-r); }
.doc.lost h1 { margin-top: 28px; }
.doc.lost .get { margin-top: 20px; }
.doc.lost .frame { margin: 12px var(--gut-r) 0 var(--gut); }
.doc.lost .credit { color: var(--grey); }
.plain .foot { margin-top: 80px; }

/* ---- long pages in plain words: Support, Privacy, Terms, Health privacy, Delete account ---- */
.prose { padding-top: 40px; }
.prose > * + * { margin-top: 14px; }
.prose .meta { margin-top: 10px; color: var(--grey); font-size: 14px; line-height: 20px; }
.prose h2 { margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--line); font-size: 25px; line-height: 30px; }
.prose .meta + h2, .prose .callout + h2 { margin-top: 40px; }
.prose h3 { margin: 32px 0 0; font: 600 17px/24px var(--sans); letter-spacing: -0.006em; text-wrap: balance; }
.prose h2 + h3 { margin-top: 20px; }
.prose h3 + p { margin-top: 6px; }
.prose ul, .prose ol { padding-left: 22px; }
.prose ul { list-style: disc; }
.prose li + li { margin-top: 8px; }
.prose li::marker { color: var(--grey); }
.prose strong, .prose b { font-weight: 600; }
.prose a { overflow-wrap: anywhere; }
.prose .callout { margin-top: 24px; padding: 16px 18px; border-radius: 16px; background: var(--foot); font-size: 16px; line-height: 24px; }
.prose :target { scroll-margin-top: 72px; }


/* ---- footer ---- */
.foot { margin-top: 56px; padding: 24px var(--gut-r) calc(28px + env(safe-area-inset-bottom, 0px)) var(--gut); background: var(--foot); color: var(--grey); font-size: 14px; line-height: 22px; }
.foot a { color: inherit; }
.foot nav { display: flex; flex-wrap: wrap; gap: 0 18px; margin-top: 10px; }
.foot nav a { min-height: 44px; display: inline-flex; align-items: center; }
.foot .legal { margin-top: 6px; font-size: 13px; }

/* ---- a Mac: words beside the whole phone ---- */
@media (min-width: 900px) {
  body { font-size: 19px; line-height: 30px; }
  h1, .big { font-size: clamp(48px, 4.8vw, 68px); line-height: 1.03; }
  h2, .h2 { font-size: clamp(36px, 3.4vw, 46px); line-height: 1.08; }
  .top { padding-left: max(40px, calc((100vw - 1120px) / 2)); padding-right: max(40px, calc((100vw - 1120px) / 2)); height: 64px; }
  main > section { padding-top: 150px; }
  main > section.first { padding-top: 40px; }
  .feature { max-width: 1200px; margin: 0 auto; padding-left: 40px; padding-right: 40px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 440px); column-gap: 96px; align-items: center; }
  .feature.flip { grid-template-columns: minmax(0, 440px) minmax(0, 1fr); }
  .feature.flip .pics { order: -1; }
  .feature .words { padding: 0; max-width: 520px; }
  .feature.flip .words { justify-self: end; }
  .feature:not(.first) { align-items: start; }
  .feature:not(.first) .words { position: sticky; top: 112px; padding-top: 24px; }
  /* two sections pair a phone with cards: the words sit beside the first picture, the second sits under them */
  #emergency, #scan { row-gap: 28px; }
  #emergency .pics, #scan .pics { display: contents; }
  #emergency .words, #scan .words { position: static; padding-top: 0; }
  #emergency { grid-template-rows: 1fr auto; }
  #emergency .shot:not(.tile) { grid-column: 1; grid-row: 1 / span 2; align-self: stretch; display: flex; flex-direction: column; }
  #emergency .shot:not(.tile) .stage { flex: 1; align-items: center; }
  #emergency .words { grid-column: 2; grid-row: 1; align-self: start; padding-top: 24px; }
  #emergency .tile { grid-column: 2; grid-row: 2; align-self: end; justify-self: end; width: min(100%, 520px); }
  #emergency .tile picture { max-width: 440px; }
  /* read as a Z: the words, the label beside them, then the record it became and the upkeep */
  #scan .words { grid-column: 1; grid-row: 1; align-self: start; padding-top: 24px; }
  #scan .tile:nth-of-type(1) { grid-column: 2; grid-row: 1; align-self: start; }
  #scan .tile:nth-of-type(2) { grid-column: 1; grid-row: 2; align-self: start; max-width: 440px; }
  #scan .tile:nth-of-type(3) { grid-column: 2; grid-row: 2; align-self: start; }
  .words > * + * { margin-top: 16px; }
  .lede { margin-top: 20px; }
  .pics { margin: 0; padding: 0; gap: 24px; }
  .chat { gap: 12px; }
  .stage { padding: 32px 0; border-radius: 28px; }
  .phone { --w: clamp(232px, calc((100svh - 168px) * 0.46), 300px); width: var(--w); padding: calc(var(--w) * 0.036); border-radius: calc(var(--w) * 0.178); }
  .phone::before { top: calc(var(--w) * 0.036); }
  .screen { aspect-ratio: 440 / 956; border-radius: calc(var(--w) * 0.143); }
  .tile picture, .frame, .film-stage { border-radius: 28px; }
  .cap, .credit { font-size: 15px; line-height: 22px; }
  .get { margin-top: 32px !important; gap: 16px; }
  .badge img { height: 52px; }
  .get-note { font-size: 15px; line-height: 22px; }
  .qr { display: flex; align-items: center; gap: 14px; margin-top: 28px !important; font-size: 15px; line-height: 22px; color: var(--grey); }
  .prose h2 { font-size: 30px; line-height: 36px; }
  .prose h3 { font-size: 19px; line-height: 28px; }
  .prose .callout { font-size: 17px; line-height: 26px; }
  .qr img { width: 96px; height: 96px; border-radius: 8px; background: #fff; padding: 6px; box-shadow: 0 0 0 1px var(--hair); }
  .keeps-list > div { grid-template-columns: 96px 1fr; }

  main > section.dealing { max-width: 640px; margin: 0 auto; padding-left: 0; padding-right: 0; }
  .letter { padding: 0; }
  main > section.ink { margin-top: 150px; padding: 0; }
  .ink-in { max-width: 640px; margin: 0 auto; padding: 112px 0; }
  .ledger dt { font-size: 19px; line-height: 30px; }
  main > section.home { max-width: 1200px; margin: 150px auto 0; padding: 0 40px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 440px); column-gap: 96px; align-items: center; }
  .home .film { order: 2; padding: 0; }
  .film.playing .film-stage, .film.ended .film-stage { max-height: calc(100vh - 64px - 130px); }
  .home .words { margin-top: 0; padding: 0; }
  .foot { margin-top: 150px; padding-left: max(40px, calc((100vw - 1120px) / 2)); padding-right: max(40px, calc((100vw - 1120px) / 2)); font-size: 15px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
