/* Dailies: film your day. Tokens from DESIGN.md.
   Name map (site token = DESIGN.md key): --paper = surface, --paper-raised = surface-raised,
   --ink = text/primary, --ink-muted = text-muted, --hairline = hairline, --accent = accent,
   --ground = dark-surface, --ground-raised = dark-surface-raised, --ground-text = dark-text,
   --ground-muted = dark-text-muted, --r-print = rounded.sm, --r-card = rounded.md,
   --s-1..--s-7 = spacing.xs..2xl with 12px added between sm and md. */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("fonts/BricolageGrotesque-Variable.woff2") format("woff2");
  font-weight: 200 800;
  font-stretch: 75% 100%;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Sans";
  src: url("fonts/InstrumentSans-Variable.woff2") format("woff2");
  font-weight: 400 700;
  font-stretch: 75% 100%;
  font-display: swap;
}

:root {
  --paper: #F1EBE0;
  --paper-raised: #E8E1D5;
  --ink: #142038;
  --ink-muted: #566178;
  --hairline: #1420381F;
  --accent: #D9782E;
  --ground: #0E121B;
  --ground-raised: #171D29;
  --ground-text: #F1EBE0;
  --ground-muted: #9AA3B5;
  --ground-hairline: #F1EBE012;

  --display: "Bricolage Grotesque", "Helvetica Neue", Arial, sans-serif;
  --body: "Instrument Sans", "Helvetica Neue", Arial, sans-serif;

  --r-print: 6px;
  --r-card: 12px;

  --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px;
  --s-5: 24px; --s-6: 32px; --s-7: 48px;

  --gutter: var(--s-5);
  --measure: 36rem;
  --page: 72rem;
}
@media (min-width: 48em) { :root { --gutter: var(--s-7); } }

*, *::before, *::after { box-sizing: border-box; }

html {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 100%;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  font-optical-sizing: auto;
}

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  isolation: isolate;
  background: var(--paper);
}

/* Grain: 35mm tooth on chrome only. It sits beneath the content layer, so
   it can never land on a photograph or the film. */
body::before,
.ground::before,
.navy::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: url("images/grain.webp") 0 0 / 256px 256px repeat;
  mix-blend-mode: overlay;
  pointer-events: none;
}
body::before { position: fixed; opacity: 0.6; }
.ground { position: relative; isolation: isolate; background: var(--ground); color: var(--ground-text); }
.navy { position: relative; isolation: isolate; background: var(--ink); color: var(--paper); }
.ground::before, .navy::before { opacity: 0.7; }

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin: 0;
  text-wrap: balance;
}
h1 { font-size: clamp(2.5rem, 2rem + 4vw, 5.5rem); }
h2 { font-size: clamp(1.5rem, 1.25rem + 1.25vw, 2.25rem); line-height: 1.1; }
h3 { font-size: 1.125rem; letter-spacing: -0.01em; line-height: 1.3; }
p { margin: 0; }
p + p { margin-top: var(--s-4); }
a { color: inherit; text-underline-offset: 0.15em; text-decoration-thickness: 1px; }

.label {
  font-family: var(--body);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.ground .label { color: var(--ground-muted); }
.muted { color: var(--ink-muted); }
.tnum { font-variant-numeric: tabular-nums; }

.wrap {
  width: 100%;
  max-width: var(--page);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Wordmark: drawn artwork tinted through its alpha channel. */
.wordmark {
  display: inline-block;
  aspect-ratio: 1000 / 304;
  background-color: currentColor;
  -webkit-mask: url("images/wordmark.png") center / contain no-repeat;
  mask: url("images/wordmark.png") center / contain no-repeat;
  vertical-align: middle;
}
.mark {
  display: inline-block;
  aspect-ratio: 307 / 297;
  background-color: currentColor;
  -webkit-mask: url("images/mark.png") center / contain no-repeat;
  mask: url("images/mark.png") center / contain no-repeat;
}

/* Header */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-5);
  padding-block: var(--s-5);
}
.top .home { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink); text-decoration: none; }
.top .wordmark { width: 108px; }
.button {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 var(--s-5);
  background: var(--ink);
  color: var(--paper);
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--r-card);
}

/* Home: hero */
.hero {
  display: grid;
  gap: var(--s-6);
  padding-block: var(--s-6) var(--s-7);
}
.hero .copy { display: grid; gap: var(--s-5); align-content: start; }
.hero .wordmark { width: min(100%, 320px); }
.hero .lede {
  font-size: 1.125rem;
  max-width: var(--measure);
  color: var(--ink);
}
.hero .lede strong { font-family: var(--display); font-weight: 700; font-size: 1.375rem; letter-spacing: -0.01em; line-height: 1.25; }
.hero .lede + .lede { margin-top: 0; }
.hero > .store { display: inline-flex; justify-self: start; }

.screen {
  padding: var(--s-7) var(--gutter);
  display: grid;
  justify-items: center;
  gap: var(--s-4);
}
.phone {
  position: relative;
  width: min(100%, 300px);
  aspect-ratio: 9 / 16;
  border-radius: var(--r-card);
  overflow: hidden;
  background: var(--ink);
  outline: 1px solid var(--ground-hairline);
}
.phone > img,
.phone > video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.screen .label { text-align: center; }

@media (min-width: 48em) {
  .hero {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: auto 1fr;
    gap: 0;
    padding-block: 0;
  }
  .hero .copy { grid-column: 1; grid-row: 1; padding-block: var(--s-7) 0; padding-right: var(--s-7); }
  .hero > .store { grid-column: 1; grid-row: 2; align-self: start; padding-block: var(--s-5) var(--s-7); }
  .hero > .screen { grid-column: 2; grid-row: 1 / span 2; padding-block: var(--s-7); }
}
@media (max-width: 47.99em) {
  .hero > .screen { margin-inline: calc(-1 * var(--gutter)); }
}

/* App Store badge: Apple's artwork, shown 48px tall (Apple's minimum is 40). */
.store img { display: block; height: 48px; width: auto; }

/* The stitch line: the one accent on the page. */
.stitch { border: 0; height: 2px; margin: 0; background: var(--accent); width: 48px; }

/* How it works */
.steps { padding-block: var(--s-7); display: grid; gap: var(--s-5); }
.steps ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0;
}
.steps li {
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr);
  gap: var(--s-4);
  padding-block: var(--s-5);
  border-top: 1px solid var(--hairline);
}
.steps .shot { grid-column: 1 / -1; margin: 0; width: min(100%, 200px); }
.steps .shot img { display: block; width: 100%; height: auto; border-radius: var(--r-card); outline: 1px solid var(--hairline); }
.steps li:last-child { border-bottom: 1px solid var(--hairline); }
.steps li > span { font-variant-numeric: tabular-nums; padding-top: 0.2rem; }
.steps li div { display: grid; gap: var(--s-2); max-width: var(--measure); }
.steps li p { color: var(--ink-muted); }
.payoff { padding-block: var(--s-6) var(--s-7); border-top: 1px solid var(--hairline); }
.payoff p { font-family: var(--display); font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; font-size: clamp(1.75rem, 1.25rem + 2.5vw, 3.5rem); max-width: 34ch; }
@media (min-width: 48em) { .payoff { padding-block: calc(var(--s-7) * 2); } }
@media (min-width: 48em) {
  .steps ol { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-6); }
  .steps li { grid-template-columns: minmax(0, 1fr); gap: var(--s-4); align-content: start; border-bottom: 0; padding-block: var(--s-5) 0; }
  .steps li:last-child { border-bottom: 0; }
}

/* The good part happened just before the photo */
.moments { padding-block: var(--s-7); display: grid; gap: var(--s-5); }
.moments h2 { max-width: 22ch; }
.moments ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-6); }
.moments li { display: grid; gap: var(--s-3); }
.moments p { color: var(--ink-muted); }
.frames { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s-2); }
.frames img { display: block; width: 100%; height: auto; border-radius: var(--r-print); }
.frames img:nth-child(1) { opacity: 0.45; }
.frames img:nth-child(2) { opacity: 0.65; }
.frames img:nth-child(3) { opacity: 0.85; }
@media (min-width: 48em) {
  .moments ul { gap: var(--s-5); }
  .moments li { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: var(--s-6); align-items: center; }
  .moments li p { order: -1; font-size: 1.125rem; }
}

/* Days: event-sized containers, shown as the app's cards */
.days { padding-block: var(--s-7); display: grid; gap: var(--s-5); }
.days .lede { color: var(--ink-muted); max-width: var(--measure); }
.days ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-4); }
.card { background: var(--paper-raised); border: 1px solid var(--hairline); border-radius: var(--r-card); padding: var(--s-3); display: grid; gap: var(--s-2); align-content: start; }
.card img { display: block; width: 100%; height: auto; border-radius: var(--r-print); }
.card h3 { font-weight: 700; line-height: 1.25; min-height: 2.5em; }
.card .meta { font-size: 0.8125rem; color: var(--ink-muted); }
@media (min-width: 48em) {
  .days ul { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s-5); }
}

/* Closing: the end card, as a band */
.closing .wrap { display: grid; justify-items: start; gap: var(--s-5); padding-block: var(--s-7); }
.closing .wordmark { width: min(100%, 360px); }
.closing p { font-family: var(--display); font-weight: 700; letter-spacing: -0.02em; font-size: clamp(1.5rem, 1.25rem + 1.5vw, 2.5rem); line-height: 1.1; }
.closing .store { display: inline-flex; }
@media (min-width: 48em) {
  .closing .wrap { padding-block: calc(var(--s-7) * 2); }
}

/* Text pages: support, privacy */
.page { padding-block: var(--s-6) var(--s-7); display: grid; gap: var(--s-6); }
.page > header, .page > section { max-width: var(--measure); }
.page header { display: grid; gap: var(--s-4); }
.page section { display: grid; gap: var(--s-3); }
.page h2 { font-size: 1.5rem; }
.page .lede { font-size: 1.125rem; }
.page dl { margin: 0; display: grid; gap: 0; }
.page dl > div { padding-block: var(--s-4); border-top: 1px solid var(--hairline); display: grid; gap: var(--s-1); }
.page dl > div:last-child { border-bottom: 1px solid var(--hairline); }
.page dt { font-weight: 600; }
.page dd { margin: 0; }
.page ul { margin: 0; padding-left: 1.25rem; display: grid; gap: var(--s-2); }
.page ul li::marker { color: var(--ink-muted); }
.page .quiet { color: var(--ink-muted); font-size: 0.875rem; }

/* Footer */
footer.bottom {
  margin-top: auto;
  border-top: 1px solid var(--hairline);
  padding-block: var(--s-6) var(--s-7);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4) var(--s-6);
  color: var(--ink-muted);
  font-size: 0.875rem;
}
footer.bottom nav { display: flex; gap: var(--s-5); }
footer.bottom a { text-decoration: none; font-weight: 600; color: var(--ink); min-height: 44px; display: inline-flex; align-items: center; }
footer.bottom a[aria-current="page"] { color: var(--ink-muted); }
footer.bottom .mark { width: 22px; color: var(--ink); }
footer.bottom .brand { display: inline-flex; align-items: center; gap: var(--s-3); }

/* Reduced motion: hold the poster instead of the loop. */
@media (prefers-reduced-motion: reduce) {
  .phone > video { display: none; }
}

:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.ground :focus-visible, .navy :focus-visible { outline-color: var(--paper); }
::selection { background: var(--ink); color: var(--paper); }
.ground ::selection, .navy ::selection { background: var(--paper); color: var(--ink); }
