@font-face {
  font-family: "Inter";
  src: url("fonts/inter-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("fonts/plus-jakarta-sans-latin-wght-normal.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

/* Colours follow the app's theme (src/constants/theme.ts). Every text colour holds 7:1 on its background. */
:root {
  color-scheme: light;
  --bg: #FAFAF9;
  --text: #1C1917;
  --muted: #57534E;
  --rule: #D6D3D1;
  --link: #115E59;
  --teal: #0D9488;
  --deep: #134E4A;
  --on-deep: #FFFFFF;
  --on-deep-muted: #CCFBF1;
  --mint: #CCFBF1;
  --on-mint: #134E4A;
  --mint-rule: rgb(19 78 74 / 0.4);
  --char: #1C1917;
  --on-char: #FAF6F1;
  --on-char-muted: #D6D3D1;
  --char-rule: #57534E;
  --amber: #FDBA74;
  --phone-edge: #1C1917;

  --text-heading: clamp(1.875rem, 3.6vw, 3rem);
  --text-body: 1.1875rem;
  --text-sm: 1rem;

  --display: "Plus Jakarta Sans", "Inter", system-ui, sans-serif;
  --gutter: clamp(1.25rem, 5vw, 4.5rem);
  --section-y: clamp(4rem, 9vw, 7.5rem);
  --max: 76rem;
  --touch: 3.5rem;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #1C1917;
    --text: #FAF6F1;
    --muted: #D6D3D1;
    --rule: #57534E;
    --link: #5EEAD4;
    --mint: #134E4A;
    --on-mint: #CCFBF1;
    --mint-rule: rgb(204 251 241 / 0.4);
    --char: #292524;
    --phone-edge: #0C0A09;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #1C1917;
  --text: #FAF6F1;
  --muted: #D6D3D1;
  --rule: #57534E;
  --link: #5EEAD4;
  --mint: #134E4A;
  --on-mint: #CCFBF1;
  --mint-rule: rgb(204 251 241 / 0.4);
  --char: #292524;
  --phone-edge: #0C0A09;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: var(--text-body);
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}

h1,
h2,
h3,
p,
ul,
ol,
figure {
  margin: 0;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

h1,
h2 {
  font-family: var(--display);
  font-weight: 800;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

h2 {
  font-size: var(--text-heading);
  line-height: 1.1;
}

h3 {
  font-family: var(--display);
  font-size: var(--text-body);
  font-weight: 800;
  line-height: 1.3;
}

a {
  color: var(--link);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.2em;
}

a:focus-visible {
  outline: 3px solid currentColor;
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: 0;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  min-height: var(--touch);
  padding: 0 1.25rem;
  background: #FFFFFF;
  color: #134E4A;
  font-weight: 700;
  transform: translateY(-130%);
}

.skip:focus {
  transform: translateY(0.5rem);
}

/* Header */

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0 0.75rem;
  padding: 0.75rem var(--gutter);
  background: var(--deep);
  color: var(--on-deep);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  min-height: var(--touch);
  font-family: var(--display);
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: inherit;
  text-decoration: none;
}

.brand img {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 22%;
}

.site-header nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0 clamp(0rem, 1.5vw, 1.25rem);
  margin-left: -0.625rem;
}

.site-header nav a {
  display: inline-flex;
  align-items: center;
  min-height: var(--touch);
  padding: 0 0.625rem;
  font-size: var(--text-sm);
  font-weight: 600;
  color: inherit;
  text-decoration: none;
}

.site-header nav a:hover,
.site-header nav a[aria-current="page"] {
  text-decoration: underline;
}

/* Hero */

.hero {
  position: relative;
  min-height: calc(100svh - 5rem);
  display: grid;
  grid-template-rows: auto 1fr;
  background: var(--deep);
  color: var(--on-deep);
  overflow: hidden;
}

.hero-copy {
  position: relative;
  z-index: 1;
  padding: clamp(1.5rem, 6vh, 4.5rem) var(--gutter) 0;
  display: grid;
  justify-items: center;
  gap: 1.5rem;
  text-align: center;
}

.hero h1 {
  max-width: 15em;
  font-size: clamp(2.5rem, min(5.6vw, 9vh), 5rem);
  line-height: 1.04;
  letter-spacing: -0.035em;
}

.hero-copy p {
  max-width: 35rem;
  color: var(--on-deep-muted);
  text-wrap: balance;
}

.button {
  display: inline-flex;
  align-items: center;
  min-height: var(--touch);
  padding: 0 1.75rem;
  border-radius: 999px;
  background: #FFFFFF;
  color: #134E4A;
  font-weight: 700;
  text-decoration: none;
  transition: transform 180ms var(--ease), background-color 180ms var(--ease);
}

.button:hover {
  background: #CCFBF1;
  transform: translateY(-2px);
}

.hero-stage {
  position: relative;
  min-height: clamp(15rem, 36vh, 26rem);
}

.hero-stage::before {
  content: "";
  position: absolute;
  top: 1.25rem;
  left: 50%;
  width: min(54rem, 165vw);
  aspect-ratio: 1;
  border: clamp(1.25rem, 3.2vw, 2.75rem) solid var(--teal);
  border-radius: 50%;
  transform: translateX(-50%);
}

.hero-stage .phone {
  position: absolute;
  top: clamp(2rem, 5vh, 3.5rem);
  left: 50%;
  width: min(21rem, 72vw);
  transform: translateX(-50%);
}

/* Phone frame */

.phone img {
  width: 100%;
  border: 0.5rem solid var(--phone-edge);
  border-radius: 2.25rem;
  box-shadow: 0 0.5rem 1rem rgb(0 0 0 / 0.12), 0 2.5rem 4rem -0.75rem rgb(0 0 0 / 0.32);
}

/* soft ground shadow: the phone hovers above the page */
.split .phone::after {
  content: "";
  position: absolute;
  z-index: -1;
  left: 12%;
  right: 12%;
  bottom: -2.25rem;
  height: 1.5rem;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgb(0 0 0 / 0.26), rgb(0 0 0 / 0));
}

/* Sections */

.section {
  padding: var(--section-y) var(--gutter);
}

.wrap {
  max-width: var(--max);
  margin: 0 auto;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(2rem, 6vw, 6rem);
  align-items: center;
}

.split.is-reversed {
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
}

.split .phone {
  justify-self: center;
  width: min(100%, 19rem);
}

.copy {
  display: grid;
  gap: 1.25rem;
}

.copy > p {
  max-width: 60ch;
  color: var(--muted);
}

.points {
  padding: 0;
  list-style: none;
  display: grid;
  gap: 1.25rem 2.5rem;
  margin-top: 1rem;
}

.points.cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.points li {
  padding-top: 1.1rem;
  border-top: 1px solid var(--rule);
  display: grid;
  gap: 0.35rem;
  align-content: start;
}

.points p {
  color: var(--muted);
}

/* When it is due */

.due {
  background: var(--char);
  color: var(--on-char);
}

.due .lede {
  max-width: 60ch;
  margin-top: 1.25rem;
  color: var(--on-char-muted);
}

.timeline {
  position: relative;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 2rem;
  margin: 3rem 0 2.5rem;
}

.timeline::before {
  content: "";
  position: absolute;
  top: 0.5rem;
  bottom: 0.5rem;
  left: 0.4375rem;
  width: 2px;
  background: var(--char-rule);
}

.timeline li {
  position: relative;
  padding-left: 2.25rem;
  display: grid;
  gap: 0.35rem;
  align-content: start;
}

.timeline h3 {
  position: relative;
}

.timeline h3::before {
  content: "";
  position: absolute;
  top: 0.25rem;
  left: -2.25rem;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: var(--amber);
}

.timeline h3 {
  color: var(--amber);
}

.timeline p,
.due .note {
  color: var(--on-char-muted);
}

.due .note {
  max-width: 60ch;
}

.due-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 19rem);
  gap: clamp(2rem, 6vw, 6rem);
  align-items: center;
}

/* Ravi's phone: an example of the Room alert, in the app's real wording */
.alert-stage {
  justify-self: center;
  width: min(100%, 19rem);
}

.lock {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  aspect-ratio: 1080 / 1920;
  padding: 1.75rem 0.875rem;
  border: 0.5rem solid #0C0A09;
  border-radius: 2.25rem;
  background: radial-gradient(circle at 30% 10%, #1F6F69, #134E4A 45%, #0C0A09);
  color: #FFFFFF;
  box-shadow: 0 0.5rem 1rem rgb(0 0 0 / 0.2), 0 2.75rem 4.5rem -0.75rem rgb(0 0 0 / 0.55), 0 0 0 1px var(--char-rule);
  overflow: hidden;
}

.lock-who {
  padding: 0.25rem 0.875rem;
  border-radius: 999px;
  background: #FFFFFF;
  color: #134E4A;
  font-size: var(--text-sm);
  font-weight: 800;
}

.clock {
  display: grid;
  font-family: var(--display);
  font-size: clamp(3rem, 7vw, 4rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.clock > span {
  grid-area: 1 / 1;
  text-align: center;
}

.k0,
.k1 {
  visibility: hidden;
}

.alerts {
  display: grid;
  gap: 0.5rem;
  width: 100%;
}

.alert {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.75rem;
  border-radius: 1rem;
  background: #FFFFFF;
  color: #1C1917;
  font-size: 0.875rem;
  line-height: 1.3;
  box-shadow: 0 0.625rem 1.25rem rgb(0 0 0 / 0.35);
}

.alert img {
  flex: none;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 22%;
}

.alert-text {
  display: grid;
  gap: 0.125rem;
  min-width: 0;
}

.alert-app {
  color: #115E59;
  font-weight: 700;
}

.alert-title {
  font-weight: 800;
  font-size: var(--text-sm);
}

/* Touches placed over the real screenshots (inside the 0.5rem phone edge) */
.tap,
.rec {
  display: none;
  position: absolute;
  aspect-ratio: 1;
  border-radius: 50%;
  pointer-events: none;
  translate: -50% -50%;
}

.split .phone {
  position: relative;
  isolation: isolate;
}

.tap {
  left: calc(0.5rem + (100% - 1rem) * 0.715);
  top: calc(0.5rem + (100% - 1rem) * 0.56);
  width: 18%;
  background: rgb(255 255 255 / 0.55);
}

.rec {
  left: calc(0.5rem + (100% - 1rem) * 0.457);
  top: calc(0.5rem + (100% - 1rem) * 0.911);
  width: 4.6%;
  border: 2px solid #C62828;
}

/* One board */

.family {
  background: var(--mint);
  color: var(--on-mint);
}

.family .copy > p,
.family .points p {
  color: inherit;
}

.family .points li {
  border-top-color: var(--mint-rule);
}

/* Privacy */

.narrow {
  max-width: 46rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0 2rem;
  margin-top: 0.5rem;
}

.action {
  display: inline-flex;
  align-items: center;
  min-height: var(--touch);
  font-weight: 700;
}

/* Closing */

.closing {
  background: var(--deep);
  color: var(--on-deep);
}

.closing p {
  margin-top: 1rem;
  color: var(--on-deep-muted);
}

.mail {
  display: inline-flex;
  align-items: center;
  min-height: var(--touch);
  margin-top: 0.75rem;
  font-family: var(--display);
  font-size: var(--text-heading);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: inherit;
  overflow-wrap: anywhere;
  text-decoration-color: #5EEAD4;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.16em;
}

/* Footer */

.site-footer {
  background: var(--char);
  color: var(--on-char-muted);
  padding: 1.5rem var(--gutter) 2rem;
  font-size: var(--text-sm);
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 2rem;
}

.site-footer a {
  display: inline-flex;
  align-items: center;
  min-height: var(--touch);
  color: var(--on-char);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.75rem;
  margin-right: auto;
}

.footer-note {
  flex-basis: 100%;
  padding-top: 0.5rem;
}

.footer-note a {
  display: inline;
  min-height: 0;
}

/* Document pages (delete account, support) */

.doc {
  max-width: 46rem;
  margin: 0 auto;
  padding: clamp(2.5rem, 6vw, 4.5rem) var(--gutter) var(--section-y);
}

.doc h1 {
  font-size: var(--text-heading);
  line-height: 1.1;
}

.doc h2 {
  font-size: var(--text-body);
  line-height: 1.3;
  letter-spacing: 0;
  margin-top: 2.25rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--rule);
}

.doc p,
.doc ul,
.doc ol {
  margin-top: 0.875rem;
}

.doc ul,
.doc ol {
  padding-left: 1.5rem;
}

.doc li + li {
  margin-top: 0.5rem;
}

.doc .action {
  margin-top: 0.25rem;
}

/* Narrow screens */

@media (max-width: 54rem) {
  .split,
  .split.is-reversed {
    grid-template-columns: minmax(0, 1fr);
  }

  .split.is-reversed .phone {
    order: 2;
  }

  .split .phone {
    width: min(72%, 18rem);
  }

  .due-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 40rem) {
  .nav-wide {
    display: none !important;
  }

  .points.cols-2 {
    grid-template-columns: minmax(0, 1fr);
  }

  .brand {
    gap: 0.5rem;
    font-size: 1.375rem;
  }

  .site-header nav {
    margin-left: -0.5rem;
  }

  .site-header nav a {
    padding: 0 0.5rem;
  }

  .brand img {
    width: 2.25rem;
    height: 2.25rem;
  }
}

/* Motion */

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }

  .hero h1,
  .hero-copy p,
  .hero-copy .button {
    animation: rise 650ms var(--ease) both;
  }

  .hero-copy p {
    animation-delay: 90ms;
  }

  .hero-copy .button {
    animation-delay: 170ms;
  }

  .hero-stage .phone {
    animation: phone-in 900ms var(--ease) 200ms both, hover 6s ease-in-out 1100ms infinite;
  }

  /* phones hover: a slow bob; the ground shadow stays put and tightens as the phone rises */
  .split .phone,
  .lock {
    animation: hover 6s ease-in-out infinite;
  }

  .split .phone::after {
    animation: hover-ground 6s ease-in-out infinite;
  }

  .split.is-reversed .phone,
  .split.is-reversed .phone::after {
    animation-delay: -3s;
  }

  /* one tap on Done after the hero phone lands; it ends hidden, like the still page */
  .tap {
    display: block;
    animation: tap 700ms var(--ease) 1500ms both;
  }

  @supports (animation-timeline: view()) {
    .rec {
      display: block;
      animation: rec-pulse linear both;
      animation-timeline: view();
      animation-range: entry 50% cover 65%;
    }
  }
}

/* Story mode: Ravi's phone stays in view while the three steps scroll past */
@media (min-width: 54.0625rem) and (prefers-reduced-motion: no-preference) {
  @supports (timeline-scope: --a) and (animation-timeline: --a) {
    .due {
      timeline-scope: --t1, --t2, --t3;
    }

    .due-grid {
      align-items: stretch;
    }

    .lock {
      position: sticky;
      top: max(1.5rem, calc(50svh - 17rem));
    }

    .timeline li {
      min-height: 38svh;
      align-content: center;
    }

    .t1 { view-timeline-name: --t1; }
    .t2 { view-timeline-name: --t2; }
    .t3 { view-timeline-name: --t3; }

    .k0,
    .k1 {
      visibility: visible;
    }

    .k0 {
      animation: clock-first linear both;
      animation-timeline: --t2;
    }

    /* fades in on step 2 (opacity), goes clear on step 3 (color), so the two never fight */
    .k1 {
      animation: clock-in linear both, clock-clear linear both;
      animation-timeline: --t2, --t3;
    }

    .k2 {
      animation: clock-in linear both;
      animation-timeline: --t3;
    }

    .a1 {
      animation: alert-in linear both;
      animation-timeline: --t2;
    }

    .a2 {
      animation: alert-in linear both;
      animation-timeline: --t3;
    }
  }
}

@keyframes tap {
  0% {
    scale: 0;
    opacity: 1;
  }

  55% {
    scale: 1;
    opacity: 0.9;
  }

  100% {
    scale: 1.3;
    opacity: 0;
  }
}

@keyframes rec-pulse {
  0%, 20%, 40%, 60%, 80%, 100% {
    scale: 1;
    border-color: rgb(198 40 40 / 0.9);
  }

  10%, 30%, 50%, 70% {
    scale: 2.4;
    border-color: rgb(198 40 40 / 0);
  }
}

@keyframes clock-first {
  0%, 30% { opacity: 1; }
  40%, 100% { opacity: 0; }
}

@keyframes clock-in {
  0%, 30% { opacity: 0; }
  40%, 100% { opacity: 1; }
}

@keyframes clock-clear {
  0%, 30% { color: #FFFFFF; }
  40%, 100% { color: transparent; }
}

@keyframes alert-in {
  0%, 30% {
    opacity: 0;
    translate: 0 -1.5rem;
  }

  42%, 100% {
    opacity: 1;
    translate: 0 0;
  }
}


@keyframes hover {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -10px; }
}

/* cancels the parent's bob so the shadow stays on the floor */
@keyframes hover-ground {
  0%, 100% { translate: 0 0; scale: 1; opacity: 1; }
  50% { translate: 0 10px; scale: 0.86; opacity: 0.7; }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(1.25rem);
  }
}

@keyframes phone-in {
  from {
    opacity: 0;
    transform: translate(-50%, 3rem);
  }
}
