/* Unforgettable Things website.
   Colours and shapes follow the app's "Matryoshka" theme (lib/ui.dart):
   ink outlines, tomato / butter / teal fills, blush paper. */

@font-face {
  font-family: "Lexend";
  src: url("../fonts/lexend-regular.woff") format("woff");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Lexend";
  src: url("../fonts/lexend-semibold.woff") format("woff");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "Lexend";
  src: url("../fonts/lexend-extrabold.woff") format("woff");
  font-weight: 800;
  font-display: swap;
}

:root {
  --ink: #231A16;
  --tomato: #E8452C;
  --butter: #FFD84D;
  --teal: #1E6E6A;
  --blush: #FDEDE7;

  --bg: var(--blush);
  --fg: var(--ink);
  --muted: #5E4A42;
  --line: var(--ink);
  --card: #FFFFFF;
  --card-soft: #FFF6F2;
  --chip: #FBE3DA;
  --link: var(--teal);
  --band: var(--butter);
  --band-fg: var(--ink);

  --stroke: 2px;
  --stroke-bold: 3px;
  --radius: 22px;
  --radius-lg: 26px;
  --gutter: clamp(16px, 4vw, 40px);
  --page: 1120px;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1E1714;
    --fg: #F7EAE3;
    --muted: #CDB8AF;
    --line: #F7EAE3;
    --card: #2B211D;
    --card-soft: #261D19;
    --chip: #342924;
    --link: #6CC4BD;
    --band: #2B211D;
    --band-fg: #F7EAE3;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #1E1714;
  --fg: #F7EAE3;
  --muted: #CDB8AF;
  --line: #F7EAE3;
  --card: #2B211D;
  --card-soft: #261D19;
  --chip: #342924;
  --link: #6CC4BD;
  --band: #2B211D;
  --band-fg: #F7EAE3;
  color-scheme: dark;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: "Lexend", system-ui, sans-serif;
  font-weight: 400;
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }

a { color: var(--link); text-underline-offset: 0.18em; text-decoration-thickness: 2px; }
a:hover { text-decoration-thickness: 3px; }

:focus-visible {
  outline: 3px solid var(--tomato);
  outline-offset: 3px;
  border-radius: 8px;
}

h1, h2, h3 { margin: 0; font-weight: 800; line-height: 1.1; letter-spacing: -0.02em; text-wrap: balance; }
h2 { font-size: clamp(1.85rem, 3.6vw, 2.5rem); }
h3 { font-size: 1.25rem; letter-spacing: -0.01em; line-height: 1.25; }
p { margin: 0; }

.wrap {
  width: 100%;
  max-width: calc(var(--page) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  background: var(--ink);
  color: #fff;
  padding: 8px 14px;
  border-radius: 99px;
  z-index: 10;
}
.skip:focus { top: 12px; }

/* ------------------------------------------------------------ header */

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 20px;
  padding-bottom: 20px;
}

.brand {
  display: inline-flex;
  align-items: flex-end;
  gap: 12px;
  color: var(--fg);
  text-decoration: none;
  font-weight: 800;
  font-size: 1.125rem;
  letter-spacing: -0.01em;
  line-height: 1;
}
.brand svg { width: 44px; height: 30px; flex: none; }
.brand span { padding-bottom: 3px; }

.site-nav { display: flex; gap: 6px; }
.site-nav a {
  color: var(--fg);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9375rem;
  padding: 8px 14px;
  border-radius: 99px;
  border: var(--stroke) solid transparent;
}
.site-nav a:hover { border-color: var(--line); }
.site-nav a[aria-current="page"] { border-color: var(--line); background: var(--card); }

@media (max-width: 560px) {
  .site-nav .opt { display: none; }
  .brand span { font-size: 1rem; }
}

/* ------------------------------------------------------------ hero */

.hero .wrap {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
  padding-top: clamp(24px, 5vw, 56px);
  padding-bottom: clamp(40px, 6vw, 72px);
}

.hero h1 {
  font-size: clamp(2.75rem, 6.6vw, 5rem);
  line-height: 1;
  letter-spacing: -0.035em;
}
.hero h1 .ellipsis { letter-spacing: 0.02em; }

.hero .lede {
  margin-top: 24px;
  font-size: 1.1875rem;
  max-width: 30rem;
  color: var(--fg);
}

.hero .actions {
  margin-top: 32px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 22px;
}

.store {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 12px 22px 12px 16px;
  border: var(--stroke-bold) solid var(--ink);
  border-radius: 18px;
  background: var(--butter);
  color: var(--ink);
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  box-shadow: 4px 4px 0 var(--line);
}
.store svg { width: 26px; height: 26px; flex: none; }
.store small { display: block; font-weight: 400; font-size: 0.8125rem; }
.store strong { display: block; font-weight: 800; font-size: 1.0625rem; }
a.store:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--line); }
a.store:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--line); }

.text-link { font-weight: 600; }

@media (max-width: 860px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .hero .lede { max-width: 34rem; }
}

/* ------------------------------------------------------------ demo */

.demo { width: 100%; max-width: 600px; justify-self: end; }
@media (max-width: 860px) { .demo { justify-self: stretch; max-width: none; } }

.demo-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  margin-bottom: 14px;
}

.back {
  flex: none;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 99px;
  border: var(--stroke) solid var(--line);
  background: var(--card);
  color: var(--fg);
  cursor: pointer;
}
.back svg { width: 20px; height: 20px; }
.back[hidden] { display: none; }

.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.9375rem;
}
.crumbs li { display: flex; align-items: center; gap: 6px; }
.crumbs li + li::before {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 2px solid var(--muted);
  border-top: 2px solid var(--muted);
  transform: rotate(45deg);
  margin-right: 4px;
}
.crumbs button {
  font: inherit;
  font-weight: 600;
  color: var(--fg);
  background: var(--chip);
  border: var(--stroke) solid var(--line);
  border-radius: 99px;
  padding: 4px 12px;
  cursor: pointer;
}
.crumbs [aria-current="location"] {
  font-weight: 800;
  background: var(--card);
  padding: 4px 12px;
  border: var(--stroke) solid var(--line);
  border-radius: 99px;
}

/* The nested frame: one coloured layer peeks out above the photo for
   each close-up you've opened, like the app's NestedFrame. */
.frame {
  --step: 12px;
  --inset: 10px;
  position: relative;
  padding-top: calc(var(--layers, 0) * var(--step));
  transition: padding-top 0.35s ease;
}
.layer {
  position: absolute;
  left: calc(var(--i) * var(--inset));
  right: calc(var(--i) * var(--inset));
  top: calc((var(--layers) - var(--i)) * var(--step));
  bottom: calc(var(--i) * var(--step));
  border: var(--stroke) solid var(--ink);
  border-radius: var(--radius-lg);
}
.photo {
  position: relative;
  aspect-ratio: 4 / 3;
  border: var(--stroke-bold) solid var(--line);
  border-radius: var(--radius-lg);
  background: #F6D5C8;
}
.photo-clip {
  position: absolute;
  inset: 0;
  border-radius: calc(var(--radius-lg) - var(--stroke-bold));
  overflow: hidden;
}
.scene { position: absolute; inset: 0; }
.scene img { width: 100%; height: 100%; object-fit: cover; }

/* Pins: teal with a white dot for things, tomato with a little doll for
   close-ups. The pin's tip sits on its x/y position. */
.pin {
  position: absolute;
  left: calc(var(--x) * 100%);
  top: calc(var(--y) * 100%);
  width: 44px;
  height: 50px;
  margin: -46px 0 0 -22px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  z-index: 2;
}
.pin svg { width: 44px; height: 50px; overflow: visible; }
.pin .label {
  position: absolute;
  top: 52px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  background: var(--ink);
  color: #fff;
  font: 600 0.8125rem/1 "Lexend", system-ui, sans-serif;
  padding: 6px 10px;
  border-radius: 99px;
  pointer-events: none;
}
.pin[data-align="end"] .label { left: auto; right: 2px; transform: none; }
.pin[data-align="start"] .label { left: 2px; transform: none; }
.pin:hover svg, .pin:focus-visible svg { transform: translateY(-3px); }
.pin svg { transition: transform 0.15s ease; }
.pin:focus-visible { outline: none; }
.pin:focus-visible .label { outline: 3px solid var(--butter); outline-offset: 2px; }

/* Item sheet, slides up inside the photo. */
.sheet {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  z-index: 3;
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 14px 14px 14px 16px;
  background: var(--card);
  color: var(--fg);
  border: var(--stroke) solid var(--line);
  border-radius: var(--radius);
}
.sheet[hidden] { display: none; }
.sheet .sheet-body { flex: 1; min-width: 0; }
.sheet h3 { font-size: 1.0625rem; }
.sheet p { font-size: 0.875rem; color: var(--muted); line-height: 1.4; margin-top: 2px; }
.sheet .close {
  flex: none;
  align-self: flex-start;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 99px;
  border: var(--stroke) solid var(--line);
  background: var(--card-soft);
  color: var(--fg);
  cursor: pointer;
}
.sheet .close svg { width: 14px; height: 14px; }

/* Date tile, as on the app's Due soon list. */
.date-tile {
  flex: none;
  width: 48px;
  border: var(--stroke) solid var(--ink);
  border-radius: 12px;
  overflow: hidden;
  text-align: center;
  background: #fff;
  color: var(--ink);
}
.date-tile .m {
  display: block;
  background: #F6D5C8;
  border-bottom: var(--stroke) solid var(--ink);
  font-size: 0.6875rem;
  font-weight: 800;
  line-height: 1;
  padding: 4px 0 3px;
}
.date-tile .d { display: block; font-weight: 800; font-size: 1.125rem; line-height: 1; padding: 4px 0 6px; }
.date-tile.soon .m { background: var(--butter); }
.date-tile.overdue .m { background: var(--tomato); }

.demo-hint {
  margin-top: 14px;
  font-size: 0.875rem;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
}
.demo-hint span { display: inline-flex; align-items: center; gap: 6px; }
.demo-hint svg { width: 16px; height: 18px; flex: none; }

/* ------------------------------------------------------------ steps */

.section { padding: clamp(56px, 8vw, 96px) 0; }
.section-head { max-width: 40rem; }
.section-head p { margin-top: 14px; color: var(--muted); }

.steps {
  list-style: none;
  margin: 40px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  border: var(--stroke-bold) solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--card);
  overflow: hidden;
}
.steps li {
  padding: 28px 28px 32px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.steps li + li { border-left: var(--stroke) solid var(--line); }
.steps .doll { height: 56px; display: flex; align-items: flex-end; margin-bottom: 8px; }
.steps .doll svg { height: 100%; width: auto; }
.steps li:nth-child(1) .doll svg { height: 60%; }
.steps li:nth-child(2) .doll svg { height: 80%; }
.steps p { color: var(--muted); }

@media (max-width: 760px) {
  .steps { grid-template-columns: 1fr; }
  .steps li + li { border-left: 0; border-top: var(--stroke) solid var(--line); }
}

/* ------------------------------------------------------------ features */

.features {
  margin-top: 40px;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(32px, 5vw, 64px);
  align-items: start;
}
.feature-list { margin: 0; display: grid; gap: 26px; }
.feature-list div { display: grid; grid-template-columns: 28px 1fr; column-gap: 14px; }
.feature-list dt { grid-column: 2; font-weight: 800; font-size: 1.125rem; line-height: 1.3; }
.feature-list dd { grid-column: 2; margin: 4px 0 0; color: var(--muted); max-width: 34rem; }
.feature-list .dot {
  grid-row: 1;
  grid-column: 1;
  width: 20px;
  height: 20px;
  margin-top: 3px;
  border: var(--stroke) solid var(--ink);
  border-radius: 99px;
}

.due {
  border: var(--stroke-bold) solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--card);
  padding: 22px 20px 12px;
}
.due h3 { font-size: 1.25rem; }
.due > p { font-size: 0.875rem; color: var(--muted); margin-top: 4px; }
.due ul { list-style: none; margin: 16px 0 0; padding: 0; }
.due li {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
}
.due li + li { border-top: var(--stroke) dashed var(--chip); }
.due li strong { display: block; font-weight: 600; line-height: 1.3; }
.due li span { display: block; font-size: 0.875rem; color: var(--muted); line-height: 1.35; }
.due .note { font-size: 0.8125rem; color: var(--muted); padding: 10px 0 6px; border-top: var(--stroke) solid var(--line); margin-top: 6px; }

@media (max-width: 860px) {
  .features { grid-template-columns: 1fr; }
  .due { max-width: 460px; }
}

/* ------------------------------------------------------------ privacy band */

.band {
  background: var(--band);
  color: var(--band-fg);
  border-top: var(--stroke-bold) solid var(--line);
  border-bottom: var(--stroke-bold) solid var(--line);
}
.band .wrap {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: clamp(28px, 5vw, 64px);
  padding-top: clamp(56px, 8vw, 88px);
  padding-bottom: clamp(56px, 8vw, 88px);
}
.band h2 { max-width: 12ch; }
.band .lead { margin-top: 16px; max-width: 26rem; }
.band .lead a { color: inherit; font-weight: 600; }
.promises { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; }
.promises li { display: grid; grid-template-columns: 30px 1fr; gap: 14px; align-items: start; }
.promises svg { width: 30px; height: 30px; }
.promises strong { display: block; font-weight: 800; font-size: 1.0625rem; line-height: 1.35; }
.promises span { display: block; margin-top: 2px; }

@media (max-width: 860px) { .band .wrap { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------ footer */

.site-footer { padding: 40px 0 48px; font-size: 0.9375rem; }
.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px 32px;
}
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.site-footer a { color: var(--fg); font-weight: 600; }
.site-footer p { color: var(--muted); }

/* ------------------------------------------------------------ prose pages */

.prose { padding: clamp(24px, 5vw, 56px) 0 clamp(56px, 8vw, 96px); }
.prose .wrap { max-width: calc(44rem + 2 * var(--gutter)); }
.prose h1 { font-size: clamp(2.4rem, 6vw, 3.5rem); letter-spacing: -0.03em; }
.prose .meta { margin-top: 12px; color: var(--muted); }
.prose .summary {
  margin-top: 32px;
  padding: 22px 24px;
  background: var(--card);
  border: var(--stroke-bold) solid var(--line);
  border-radius: var(--radius);
}
.prose .summary p + p { margin-top: 10px; }
.prose h2 { font-size: 1.5rem; margin-top: 48px; letter-spacing: -0.015em; }
.prose h3 { font-size: 1.125rem; margin-top: 24px; }
.prose p, .prose ul { margin-top: 12px; }
.prose ul { padding-left: 1.25em; }
.prose li + li { margin-top: 6px; }
.prose li::marker { color: var(--tomato); }
.prose table { width: 100%; border-collapse: collapse; margin-top: 16px; font-size: 0.9375rem; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 10px 12px 10px 0; border-bottom: var(--stroke) solid var(--chip); }
.prose th { font-weight: 800; border-bottom-color: var(--line); }
.prose td:first-child { font-weight: 600; width: 34%; }

/* ------------------------------------------------------------ not found */

.lost { text-align: left; padding: clamp(48px, 10vw, 120px) 0; }
.lost h1 { font-size: clamp(2.5rem, 7vw, 4.5rem); letter-spacing: -0.035em; line-height: 1; }
.lost p { margin-top: 18px; max-width: 30rem; font-size: 1.125rem; }
.lost .store { margin-top: 28px; }

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
