/* Palette taken from Lisa's Cocoon Substack */
  :root {
    --bg: #f2efe6;
    --surface: #f8f6f0;
    --surface-soft: #e9e4d8;
    --ink: #4f4c42;
    --ink-strong: #363737;
    --ink-soft: #8a8475;
    --line: #ddd7c9;
    --accent: #9f6e3d;
    --accent-ink: #ffffff;
    --accent-soft: #ece1d2;
    --t-meals: #eadbc6; --t-comfort: #ecd9d2; --t-joys: #e2ddd0; --t-home: #dde2dc; --t-cards: #e6e2c9; --t-readings: #efe2c4; --t-other: #e6e0d4;
    --sans: system-ui, -apple-system, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --serif: Lora, Georgia, serif;
    --display: "Cormorant Garamond", Georgia, serif;
  }
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
      --bg: #1e1b16; --surface: #26221c; --surface-soft: #2f2a22; --ink: #e6dfd1; --ink-strong: #f2ecdf; --ink-soft: #a59d8e;
      --line: #3a342b; --accent: #c9935e; --accent-ink: #1e1b16; --accent-soft: #3a3024;
      --t-meals: #3d3226; --t-comfort: #3d2e29; --t-joys: #35322a; --t-home: #2f342e; --t-cards: #36341f; --t-readings: #3e3522; --t-other: #332e26;
    }
  }
  :root[data-theme="dark"] {
    --bg: #1e1b16; --surface: #26221c; --surface-soft: #2f2a22; --ink: #e6dfd1; --ink-strong: #f2ecdf; --ink-soft: #a59d8e;
    --line: #3a342b; --accent: #c9935e; --accent-ink: #1e1b16; --accent-soft: #3a3024;
    --t-meals: #3d3226; --t-comfort: #3d2e29; --t-joys: #35322a; --t-home: #2f342e; --t-cards: #36341f; --t-readings: #3e3522; --t-other: #332e26;
  }

  * { box-sizing: border-box; }
  [hidden] { display: none !important; }
  html { -webkit-text-size-adjust: 100%; }
  body {
    margin: 0; background: var(--bg); color: var(--ink);
    font: 16px/1.6 var(--sans); -webkit-font-smoothing: antialiased;
  }
  .wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }

  /* Masthead, echoing the Cocoon wordmark */
  .masthead { text-align: center; padding: 40px 0 28px; border-bottom: 1px solid var(--line); }
  .mark { width: 44px; height: 44px; display: block; margin: 0 auto 10px; }
  .wordmark {
    font-family: var(--display); font-weight: 500; color: var(--accent);
    font-size: clamp(44px, 11vw, 72px); line-height: 1; letter-spacing: .01em; margin: 0;
  }
  .tagline {
    margin: 14px 0 0; font-size: 12px; letter-spacing: .2em; text-transform: uppercase; color: var(--ink-soft);
  }

  .intro { max-width: 600px; margin: 0 auto; padding: 32px 0 8px; text-align: center; }
  .lede { font-family: var(--serif); font-size: 19px; line-height: 1.65; color: var(--ink); margin: 0; }
  .signoff { font-family: var(--serif); font-style: italic; color: var(--ink-soft); margin: 12px 0 0; }

  .how { display: grid; grid-template-columns: repeat(3, 1fr); margin: 32px 0 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
  .how div { padding: 18px 20px; font-size: 14px; color: var(--ink-soft); }
  .how div + div { border-left: 1px solid var(--line); }
  .how b { display: block; color: var(--ink); font-size: 15px; font-weight: 700; margin-bottom: 2px; }
  .how .n { font-family: var(--display); font-size: 26px; color: var(--accent); line-height: 1; display: block; margin-bottom: 6px; font-weight: 600; }
  @media (max-width: 640px) {
    .how { grid-template-columns: 1fr; }
    .how div + div { border-left: 0; border-top: 1px solid var(--line); }
    .how div { display: grid; grid-template-columns: 36px 1fr; column-gap: 4px; padding: 14px 4px; }
    .how .n { grid-row: span 2; margin: 0; }
  }

  .section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 40px 0 0; }
  .section-head h2 { margin: 0; font-size: 26px; font-weight: 700; color: var(--ink); letter-spacing: -.01em; }

  /* Category tabs, styled like the Substack nav */
  .chips { display: flex; gap: 22px; overflow-x: auto; margin-top: 14px; border-bottom: 1px solid var(--line); scrollbar-width: none; }
  .chips::-webkit-scrollbar { display: none; }
  .chip {
    flex: none; border: 0; background: none; color: var(--ink-soft); cursor: pointer;
    font: 500 14px var(--sans); padding: 10px 0 12px; border-bottom: 2px solid transparent; margin-bottom: -1px;
  }
  .chip[aria-pressed="true"] { color: var(--ink); border-bottom-color: var(--ink); }

  .grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); padding: 20px 0 8px; }
  .tile {
    background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
    padding: 20px; display: flex; flex-direction: column; gap: 10px; min-width: 0;
  }
  .pic {
    margin: -20px -20px 6px; aspect-ratio: 16 / 10; border-radius: 10px 10px 0 0; overflow: hidden;
    border-bottom: 1px solid var(--line); background: #fff; position: relative;
  }
  .pic img, .pic svg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
  .pic.contain img { object-fit: contain; padding: 12px; }

  /* Group gifts */
  .progress { height: 8px; border-radius: 999px; background: var(--surface-soft); overflow: hidden; }
  .progress i { display: block; height: 100%; border-radius: 999px; background: var(--accent); }
  .raised { font-size: 14px; color: var(--ink); }
  .raised span { color: var(--ink-soft); }
  .amounts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 6px 0 14px; }
  .amount {
    border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 8px;
    padding: 11px 0; font: 600 15px var(--sans); cursor: pointer;
  }
  .amount[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
  .amount:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  .label { display: block; font-size: 14px; font-weight: 600; }
  .fineprint { font-size: 13px; color: var(--ink-soft); text-align: center; margin: 10px 0 0; }
  .pic.art { color: var(--accent); }
  .pic.art svg { width: 100%; height: 100%; display: block; }
  .art-line { fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
  .art-soft { fill: currentColor; opacity: .12; }
  .art-dot { fill: currentColor; }
  .tile-top { display: flex; align-items: center; gap: 14px; }
  .bubble { width: 56px; height: 56px; border-radius: 8px; display: grid; place-items: center; font-size: 28px; flex: none; }
  .cat { font-size: 11px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft); }
  .tile h3 { margin: 2px 0 0; font-size: 19px; line-height: 1.3; font-weight: 700; color: var(--ink); }
  .why { margin: 0; font-family: var(--serif); color: var(--ink); opacity: .85; font-size: 15.5px; line-height: 1.6; flex: 1; }
  .meta { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft); }
  .sent { font-size: 13px; color: var(--accent); font-weight: 500; }
  .actions { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }

  .btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    border: 0; border-radius: 8px; padding: 12px 16px; font: 600 15px var(--sans);
    cursor: pointer; text-decoration: none; text-align: center;
  }
  .btn-primary { background: var(--accent); color: var(--accent-ink); }
  .btn-primary:hover { filter: brightness(1.06); }
  .btn-soft { background: var(--surface-soft); color: var(--ink); }
  .btn-ghost { background: none; color: var(--ink-soft); padding: 6px; font-weight: 500; font-size: 14px; text-decoration: underline; text-underline-offset: 3px; }
  .btn[disabled] { opacity: .55; cursor: default; }
  .btn:focus-visible, .chip:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

  details.taken { margin: 36px 0 0; border-top: 1px solid var(--line); padding-top: 20px; }
  details.taken summary { cursor: pointer; font-size: 17px; font-weight: 700; color: var(--ink); list-style: none; display: flex; justify-content: space-between; }
  details.taken summary::-webkit-details-marker { display: none; }
  details.taken summary::after { content: "View all"; font-size: 11px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft); align-self: center; }
  details.taken[open] summary::after { content: "Hide"; }
  .taken-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
  .taken-item { border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; font-size: 14px; color: var(--ink-soft); }

  .more { margin: 40px 0 48px; border-top: 1px solid var(--line); padding-top: 24px; display: grid; grid-template-columns: 56px 1fr; gap: 16px; align-items: start; }
  .more img { width: 48px; height: 48px; }
  .more h2 { margin: 0 0 6px; font-size: 17px; font-weight: 700; color: var(--ink); }
  .more p { margin: 0 0 6px; font-family: var(--serif); }
  .more a { color: var(--accent); }
  footer { text-align: center; color: var(--ink-soft); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; padding: 0 0 48px; }

  .status { text-align: center; color: var(--ink-soft); font-family: var(--serif); font-style: italic; padding: 40px 0; grid-column: 1 / -1; }

  dialog {
    border: 0; border-radius: 12px; padding: 0; width: min(440px, calc(100vw - 32px));
    background: var(--bg); color: var(--ink); box-shadow: 0 24px 60px rgba(0,0,0,.22);
  }
  dialog::backdrop { background: rgba(30, 27, 22, .45); }
  .dlg { padding: 28px 24px 24px; }
  .dlg h2 { margin: 0 0 6px; font-size: 22px; font-weight: 700; color: var(--ink); line-height: 1.3; }
  .dlg p { margin: 0 0 18px; font-family: var(--serif); color: var(--ink-soft); }
  .field { display: block; margin-bottom: 14px; }
  .field span { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
  .field small { color: var(--ink-soft); font-weight: 400; }
  .field input, .field textarea {
    width: 100%; border: 1px solid var(--accent); background: var(--surface); color: var(--ink);
    border-radius: 8px; padding: 12px; font: 16px var(--sans);
  }
  .field input:focus, .field textarea:focus { outline: 2px solid var(--accent-soft); }
  .field textarea { min-height: 72px; resize: vertical; }
  .dlg .actions { margin-top: 8px; }
  .after { background: var(--accent-soft); border-radius: 8px; padding: 14px 16px; margin: 0 0 16px; color: var(--ink); font-family: var(--serif); white-space: pre-line; }
  .done-mark { width: 44px; height: 44px; display: block; margin: 0 auto 12px; }
  #done h2, #done p { text-align: center; }
