/* Five Minute Legacy — family website.
   Spring Mint palette from the app. Type: Figtree throughout — SemiBold
   (upright, never italic) for titles and headers, Regular/Medium for
   labels, buttons, stats, prices, forms and body. */

@font-face {
  font-family: 'Figtree';
  src: url('/fonts/Figtree-Regular.ttf') format('truetype');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Figtree';
  src: url('/fonts/Figtree-Medium.ttf') format('truetype');
  font-weight: 500;
  font-display: swap;
}
/* SemiBold serves 600 and 700 so existing bold rules stay light, as in the app. */
@font-face {
  font-family: 'Figtree';
  src: url('/fonts/Figtree-SemiBold.ttf') format('truetype');
  font-weight: 600 700;
  font-display: swap;
}

:root {
  --mint: #e4f5ec;      /* page */
  --paper: #ffffff;     /* sheets */
  --ink: #13201b;       /* text */
  --ink-soft: #3a4d45;
  --ink-faint: #50645b;
  --pine: #17694d;      /* actions, the timeline */
  --pine-deep: #0f4a35;
  --leaf: #93cfb5;      /* borders */
  --wash: #d3f0e3;      /* soft fills */
  --sprout: #bdefd9;    /* the question card */
  --rust: #b3441e;      /* errors */
  --radius-sheet: 22px;
  --radius-small: 12px;
  --shadow: 0 1px 0 rgba(19, 32, 27, 0.06), 0 10px 30px -18px rgba(15, 74, 53, 0.35);
  --col: 44rem;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --mint: #0f1f19;
    --paper: #16291f;
    --ink: #eef8f2;
    --ink-soft: #c5dbcf;
    --ink-faint: #a6c1b3;
    --pine: #7fdcb2;
    --pine-deep: #a9ebcc;
    --leaf: #2f5a47;
    --wash: #1d3a2d;
    --sprout: #224837;
    --rust: #ff9d7a;
    --shadow: 0 1px 0 rgba(0, 0, 0, 0.4);
    color-scheme: dark;
  }
}

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

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

body {
  margin: 0;
  background: var(--mint);
  color: var(--ink);
  font-family: 'Figtree', ui-rounded, 'Avenir Next', system-ui, sans-serif;
  font-size: 1.25rem; /* 20px */
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

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

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

h1,
h2,
h3 {
  font-weight: 700;
  line-height: 1.12;
  margin: 0;
  letter-spacing: -0.01em;
}

/* Titles and headers: Figtree SemiBold, upright. */
h1,
h2 {
  font-family: 'Figtree', ui-rounded, 'Avenir Next', system-ui, sans-serif;
  font-style: normal;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

p {
  margin: 0 0 1em;
}

.wrap {
  width: 100%;
  max-width: var(--col);
  margin: 0 auto;
  padding: 0 1.25rem;
}

.skip {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--paper);
  padding: 0.6rem 1rem;
  z-index: 10;
}
.skip:focus {
  left: 1rem;
}

/* ---------- top bar ---------- */
.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 0;
  gap: 1rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.1rem;
}
.brand svg {
  width: 34px;
  height: 34px;
  flex: none;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 56px;
  padding: 0.85rem 1.5rem;
  border-radius: 999px;
  border: 2px solid var(--pine);
  background: var(--pine);
  color: #fff;
  font: inherit;
  font-weight: 700;
  font-size: 1.15rem;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease;
}
.btn:hover {
  background: var(--pine-deep);
  border-color: var(--pine-deep);
}
.btn:active {
  transform: translateY(1px);
}
.btn[disabled] {
  opacity: 0.55;
  cursor: default;
}
.btn.ghost {
  background: transparent;
  color: var(--pine);
}
.btn.ghost:hover {
  background: var(--wash);
}
@media (prefers-color-scheme: dark) {
  .btn {
    color: #0f1f19;
  }
  .btn.ghost {
    color: var(--pine);
  }
}

.stores {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.store {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  min-height: 64px;
  min-width: 13rem;
  padding: 0.55rem 1.3rem;
  border-radius: 16px;
  background: var(--ink);
  color: var(--mint);
  text-decoration: none;
  line-height: 1.2;
}
.store .store-sub {
  font-size: 0.85rem;
  opacity: 0.85;
}
.store .store-name {
  font-weight: 700;
  font-size: 1.2rem;
}
.store.soon {
  background: transparent;
  color: var(--ink-faint);
  border: 2px dashed var(--leaf);
  cursor: default;
}

/* ---------- sheets & fields ---------- */
.sheet {
  background: var(--paper);
  border-radius: var(--radius-sheet);
  box-shadow: var(--shadow);
  padding: 1.5rem;
}
@media (min-width: 640px) {
  .sheet {
    padding: 2rem 2.25rem;
  }
}

label.field {
  display: block;
  font-weight: 700;
  margin-bottom: 0.5rem;
}
input[type='text'],
textarea {
  width: 100%;
  font: inherit;
  font-size: 1.2rem;
  color: var(--ink);
  background: var(--paper);
  border: 2px solid var(--leaf);
  border-radius: var(--radius-small);
  padding: 0.85rem 1rem;
  min-height: 56px;
}
textarea {
  min-height: 7.5rem;
  resize: vertical;
  line-height: 1.5;
}
input:focus,
textarea:focus {
  outline: none;
  border-color: var(--pine);
  box-shadow: 0 0 0 4px var(--wash);
}
.row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.row > input {
  flex: 1 1 14rem;
}

.muted {
  color: var(--ink-soft);
}
.small {
  font-size: 1rem;
}

/* ---------- toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 1.25rem;
  transform: translate(-50%, 140%);
  max-width: min(32rem, calc(100% - 2rem));
  background: var(--ink);
  color: var(--mint);
  padding: 0.9rem 1.25rem;
  border-radius: 14px;
  font-size: 1.05rem;
  z-index: 50;
  transition: transform 0.25s ease;
}
.toast.show {
  transform: translate(-50%, 0);
}
.toast[data-kind='error'] {
  background: var(--rust);
  color: #fff;
}

/* ---------- footer ---------- */
.foot {
  padding: 3rem 0 2.5rem;
  color: var(--ink-faint);
  font-size: 1rem;
}
.foot a {
  color: var(--ink-soft);
  margin-right: 1.25rem;
}

/* ---------- landing ---------- */
.hero {
  padding: 2.5rem 0 1rem;
}
.hero h1 {
  font-size: clamp(2.6rem, 8vw, 4.4rem);
  max-width: 13ch;
}
.hero .lede {
  font-size: clamp(1.25rem, 2.6vw, 1.45rem);
  color: var(--ink-soft);
  max-width: 34ch;
  margin-top: 1.25rem;
}

/* The daily question, the one memorable element on the landing page. */
.question {
  position: relative;
  margin: 2.25rem 0 2.5rem;
  background: var(--sprout);
  border-radius: 28px 28px 28px 8px;
  padding: 1.75rem 1.75rem 1.5rem;
  max-width: 34rem;
}
.question .q-when {
  font-size: 1rem;
  color: var(--pine-deep);
  font-weight: 700;
}
.question .q-text {
  font-size: clamp(1.5rem, 4vw, 2rem);
  line-height: 1.25;
  font-weight: 700;
  color: var(--pine-deep);
  margin: 0.4rem 0 1.1rem;
}
.question .q-ways {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.question .q-ways span {
  background: var(--paper);
  color: var(--pine-deep);
  border-radius: 999px;
  padding: 0.35rem 0.95rem;
  font-size: 1rem;
  font-weight: 700;
}

.steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 1.1rem;
}
.steps li {
  display: grid;
  grid-template-columns: 2.6rem 1fr;
  gap: 0.9rem;
  align-items: start;
}
.steps .n {
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 50%;
  background: var(--pine);
  color: #fff;
  font-weight: 700;
  display: grid;
  place-items: center;
}
@media (prefers-color-scheme: dark) {
  .steps .n {
    color: #0f1f19;
  }
}
.steps strong {
  display: block;
}

.section {
  margin: 2.5rem 0;
}
.section h2 {
  font-size: clamp(1.6rem, 4vw, 2.1rem);
  margin-bottom: 1rem;
}

/* ---------- family page ---------- */
.title-page {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.25rem;
  align-items: center;
  padding: 1.5rem 0 1.25rem;
}
.portrait {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--wash);
  border: 4px solid var(--paper);
  box-shadow: var(--shadow);
  display: grid;
  place-items: center;
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--pine);
}
@media (min-width: 640px) {
  .portrait {
    width: 128px;
    height: 128px;
    font-size: 3rem;
  }
}
.title-page h1 {
  font-size: clamp(2.2rem, 7vw, 3.6rem);
}
.title-page .shared {
  color: var(--ink-soft);
  margin: 0.35rem 0 0;
}
.tally {
  font-size: 1.15rem;
  color: var(--pine-deep);
  font-weight: 700;
  margin: 0.25rem 0 1.5rem;
}
.in-memory {
  background: var(--wash);
  border-radius: var(--radius-small);
  padding: 0.75rem 1rem;
  margin: 0 0 1.5rem;
  color: var(--ink-soft);
}

/* The life timeline: a spine with periods marked along it. */
.timeline {
  position: relative;
  list-style: none;
  margin: 0;
  padding: 0 0 0 1.6rem;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 0.45rem;
  top: 0.4rem;
  bottom: 0.4rem;
  width: 3px;
  border-radius: 3px;
  background: var(--leaf);
}
.era {
  position: relative;
  font-weight: 700;
  color: var(--pine-deep);
  font-size: 1.1rem;
  margin: 1.6rem 0 0.7rem;
}
.era::before {
  content: '';
  position: absolute;
  left: -1.6rem;
  top: 0.35em;
  width: 1.05rem;
  height: 1.05rem;
  border-radius: 50%;
  background: var(--pine);
  box-shadow: 0 0 0 4px var(--mint);
}
.era:first-child {
  margin-top: 0.2rem;
}
.entry {
  margin: 0 0 0.9rem;
}
.entry a {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  align-items: center;
  background: var(--paper);
  border-radius: 18px;
  padding: 1.1rem 1.2rem;
  color: var(--ink);
  text-decoration: none;
  border: 2px solid transparent;
  transition: border-color 0.15s ease;
}
.entry a:hover {
  border-color: var(--leaf);
}
.entry h3 {
  font-size: 1.3rem;
  margin-bottom: 0.25rem;
}
.entry .when {
  color: var(--ink-faint);
  font-size: 1rem;
}
.entry .excerpt {
  color: var(--ink-soft);
  font-size: 1.05rem;
  margin: 0.35rem 0 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.entry .thumb {
  width: 76px;
  height: 76px;
  border-radius: 14px;
  object-fit: cover;
}
.voice-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.5rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--pine);
}
.voice-badge svg {
  width: 18px;
  height: 18px;
}

.more {
  margin: 0.5rem 0 0 1.6rem;
}

.ask {
  margin-top: 2.5rem;
}
.ask h2 {
  font-size: 1.6rem;
  margin-bottom: 0.4rem;
}

/* skeletons */
.skel {
  background: linear-gradient(90deg, var(--wash), var(--paper), var(--wash));
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite linear;
  border-radius: 18px;
}
@keyframes shimmer {
  to {
    background-position: -200% 0;
  }
}

/* ---------- one story ---------- */
.back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 48px;
  font-weight: 700;
  text-decoration: none;
  background: none;
  border: 0;
  color: var(--pine);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
}
.story h1 {
  font-size: clamp(2rem, 6vw, 3rem);
  margin: 0.5rem 0 0.4rem;
}
.story .when {
  color: var(--ink-faint);
  margin-bottom: 1.5rem;
}

.listen {
  background: var(--pine);
  color: #fff;
  border-radius: var(--radius-sheet);
  padding: 1.25rem 1.25rem 1rem;
  margin: 0 0 1.75rem;
}
@media (prefers-color-scheme: dark) {
  .listen {
    color: #0f1f19;
  }
}
.listen h2 {
  font-size: 1.35rem;
  margin-bottom: 0.75rem;
}
.listen audio {
  width: 100%;
  height: 54px;
}
.listen .clip + .clip {
  margin-top: 0.9rem;
}
.listen .clip-label {
  font-size: 1rem;
  opacity: 0.9;
  margin-bottom: 0.3rem;
}

.narrative {
  font-size: 1.3rem;
  line-height: 1.7;
  max-width: 36em;
}
.narrative p {
  margin: 0 0 1.1em;
}
.own-words {
  border-left: 5px solid var(--leaf);
  padding: 0.25rem 0 0.25rem 1.1rem;
  margin: 2rem 0;
  color: var(--ink-soft);
}
.own-words h2 {
  font-size: 1.25rem;
  color: var(--ink);
  margin-bottom: 0.5rem;
}
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1.5rem 0;
}
.tags span {
  background: var(--wash);
  color: var(--pine-deep);
  border-radius: 999px;
  padding: 0.3rem 0.9rem;
  font-size: 1rem;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr));
  gap: 0.6rem;
  margin: 1.75rem 0;
}
.gallery button {
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
  border-radius: 14px;
  overflow: hidden;
  aspect-ratio: 1;
}
.gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.story video {
  width: 100%;
  border-radius: 16px;
  margin: 1rem 0;
  background: #000;
}

.lightbox {
  border: 0;
  padding: 0;
  background: transparent;
  max-width: 96vw;
  max-height: 92vh;
}
.lightbox::backdrop {
  background: rgba(10, 20, 16, 0.86);
}
.lightbox img {
  max-width: 96vw;
  max-height: 80vh;
  border-radius: 12px;
  margin: 0 auto;
}
.lightbox p {
  color: #fff;
  text-align: center;
  margin: 0.6rem 0;
}
.lightbox .close {
  display: block;
  margin: 0.5rem auto 0;
}

.love {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 56px;
  padding: 0.7rem 1.4rem;
  border-radius: 999px;
  border: 2px solid var(--leaf);
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.love svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: var(--rust);
  stroke-width: 2.2;
  transition: transform 0.2s ease;
}
.love[aria-pressed='true'] {
  border-color: var(--rust);
}
.love[aria-pressed='true'] svg {
  fill: var(--rust);
  transform: scale(1.12);
}

.comments {
  margin-top: 2rem;
}
.comments h2 {
  font-size: 1.4rem;
  margin-bottom: 0.9rem;
}
.comment {
  background: var(--paper);
  border-radius: 16px;
  padding: 0.9rem 1.1rem;
  margin-bottom: 0.7rem;
}
.comment .who {
  font-weight: 700;
}
.comment .on {
  color: var(--ink-faint);
  font-size: 0.95rem;
  margin-left: 0.4rem;
}
.comment p {
  margin: 0.25rem 0 0;
}

/* ---------- gift ---------- */
.gift-hero h1 {
  font-size: clamp(2.3rem, 7vw, 3.7rem);
  max-width: 16ch;
  margin-top: 1.5rem;
}
.note {
  position: relative;
  background: var(--paper);
  border-radius: 6px 26px 26px 26px;
  padding: 1.5rem 1.6rem;
  margin: 1.75rem 0;
  box-shadow: var(--shadow);
  font-size: 1.3rem;
  line-height: 1.55;
  max-width: 34rem;
}
.note .from {
  font-size: 1.05rem;
  color: var(--ink-faint);
  margin-top: 0.75rem;
}
.code-box {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  background: var(--wash);
  border-radius: var(--radius-small);
  padding: 1rem 1.25rem;
  margin: 1rem 0;
}
.code-box .code {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--pine-deep);
}

.notice {
  text-align: left;
  padding: 3rem 0;
}
.notice h1 {
  font-size: clamp(2rem, 6vw, 2.8rem);
  margin-bottom: 1rem;
  max-width: 18ch;
}

.faq details {
  background: var(--paper);
  border-radius: 16px;
  padding: 1rem 1.2rem;
  margin-bottom: 0.7rem;
}
.faq summary {
  font-weight: 700;
  cursor: pointer;
  min-height: 2rem;
}
.faq details p {
  margin: 0.6rem 0 0;
  color: var(--ink-soft);
}

.price-soon {
  display: inline-block;
  background: var(--sprout);
  color: var(--pine-deep);
  font-weight: 700;
  border-radius: 999px;
  padding: 0.35rem 1rem;
  font-size: 1rem;
}

[hidden] {
  display: none !important;
}

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

/* ---------- wishlist (family page and /w/) ---------- */
#wish-slot:not(:empty) {
  margin-top: 2rem;
}
.wishlist h2,
.wishlist h1 {
  margin-bottom: 0.4rem;
}
.wishlist h3 {
  font-size: 1.3rem;
  margin: 1.8rem 0 0.4rem;
}
.wishlist.standalone {
  margin-top: 1.5rem;
}
.wishes {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
}
.wishlist.standalone .wishes {
  background: var(--paper);
  border-radius: var(--radius-sheet);
  box-shadow: var(--shadow);
  padding: 0.25rem 1.25rem;
}
.wish {
  padding: 1.2rem 0;
  border-top: 1px solid var(--wash);
}
.wish:first-child {
  border-top: 0;
}
.wish-head {
  display: flex;
  gap: 0.8rem;
  align-items: flex-start;
}
.wish-head > svg {
  width: 26px;
  height: 26px;
  flex: none;
  color: var(--pine);
  margin-top: 0.15rem;
}
.wish h4 {
  margin: 0;
  font-size: 1.3rem;
  line-height: 1.3;
  font-weight: 700;
}
.wish.done h4 {
  color: var(--ink-faint);
  text-decoration: line-through;
}
.wish-badge {
  display: inline-block;
  margin-top: 0.4rem;
  padding: 0.15rem 0.7rem;
  border-radius: 999px;
  background: var(--pine);
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
}
@media (prefers-color-scheme: dark) {
  .wish-badge {
    color: #0f1f19;
  }
}
.wish-meta {
  margin: 0.4rem 0 0;
  font-weight: 600;
  color: var(--ink-soft);
}
.wish-desc {
  margin: 0.35rem 0 0;
  color: var(--ink-soft);
}
.wish-actions {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin: 0.9rem 0 0 calc(26px + 0.8rem);
}
.wish-actions > .btn {
  width: 100%;
}
@media (min-width: 640px) {
  .wish-actions > .btn {
    width: auto;
    align-self: flex-start;
  }
}
.wish-status {
  margin: 0;
  font-weight: 700;
  font-size: 1.15rem;
}
.wish-status.taken {
  color: var(--ink-soft);
  background: var(--mint);
  border-radius: var(--radius-small);
  padding: 0.75rem 1rem;
}
.wish-mine {
  background: var(--wash);
  border-radius: var(--radius-small);
  padding: 0.9rem 1rem;
}
.claim-actions {
  margin-top: 0.75rem;
}
.claim-form {
  background: var(--mint);
  border-radius: var(--radius-small);
  padding: 1rem;
}
.claim-form .muted {
  margin: 0 0 0.6rem;
}
.reveal-box {
  margin: 0.8rem 0 0.4rem;
}
.reveal-box p {
  margin: 0 0 0.5rem;
}
