/* Wellbeing Tips: site styles.
   One stylesheet for every page. Flat CSS (no nesting) so older iPhones still get the full design.
   Light and dark follow the device. Brand palette and type are fixed by the project brief:
   Fraunces for display, Inter for reading, cream ground, clay, rose and sage. */

@layer reset, tokens, base, layout, components, pages, utilities;

/* ---------- Fonts (self-hosted: nothing is requested from anyone else) ---------- */
@font-face {
  font-family: "Fraunces";
  src: url("fonts/fraunces-roman.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Fraunces";
  src: url("fonts/fraunces-italic.woff2") format("woff2");
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("fonts/inter.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
/* Metric-matched fallback so text does not jump when Inter arrives. */
@font-face {
  font-family: "Inter Fallback";
  src: local("Arial"), local("Helvetica Neue"), local("Helvetica");
  ascent-override: 90.44%;
  descent-override: 22.52%;
  line-gap-override: 0%;
  size-adjust: 107.12%;
}

/* ---------- Reset ---------- */
@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
  body, h1, h2, h3, h4, p, figure, blockquote, dl, dd, ol, ul { margin: 0; }
  ol[class], ul[class] { list-style: none; padding: 0; }
  img, svg, picture { display: block; max-width: 100%; height: auto; }
  input, button, textarea, select { font: inherit; color: inherit; }
  button { background: none; border: 0; padding: 0; cursor: pointer; }
  a { color: inherit; }
  dialog { padding: 0; border: 0; color: inherit; max-width: none; max-height: none; }
  [hidden] { display: none !important; }
}

/* ---------- Tokens ---------- */
@layer tokens {
  :root {
    color-scheme: light;

    /* Brand (light) */
    --ground: #EDE6DA;
    --ground-warm: #F2EBDC;
    --paper: #F6F0E3;
    --paper-raised: #FAF6EE;
    --ink: #2A2520;
    --ink-soft: #4F4940;
    --ink-faint: #8F877C;
    --rule: #D6CDBC;
    --rule-soft: #E4DCCB;
    --clay: #B07A4E;
    --clay-deep: #8A5B36;
    --clay-soft: #E8C9A8;
    --rose: #C58F73;
    --sage: #8FA288;
    --sage-soft: #C5D1C0;
    --rose-soft: #EACFC0;

    --link: #6B4528;
    --focus: #8A5B36;
    --field-rule: #857C70;
    --orb-glow: var(--paper-raised);
    --invert-bg: #2A2520;
    --invert-ink: #EDE6DA;
    --invert-soft: #C9BFAF;
    --invert-rule: #4A423A;
    --invert-link: #E8C9A8;
    --header-bg: rgba(237, 230, 218, 0.9);
    --shadow-sheet: 0 1px 0 rgba(42, 37, 32, 0.03), 0 14px 34px -26px rgba(42, 37, 32, 0.32);
    --scrim: rgba(28, 24, 20, 0.42);

    /* Type */
    --serif: "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
    --sans: "Inter", "Inter Fallback", system-ui, -apple-system, "Segoe UI", sans-serif;
    --step--1: 0.875rem;                                   /* 14 */
    --step-0: clamp(1.0625rem, 1rem + 0.2vw, 1.15625rem);  /* 17 to 18.5 */
    --step-1: clamp(1.1875rem, 1.1rem + 0.4vw, 1.3125rem); /* 19 to 21 */
    --step-2: clamp(1.375rem, 1.25rem + 0.6vw, 1.5rem);    /* 22 to 24 */
    --step-3: clamp(1.75rem, 1.4rem + 1.4vw, 2.25rem);     /* 28 to 36 */
    --step-4: clamp(2.25rem, 1.6rem + 2.8vw, 3.75rem);     /* 36 to 60 */
    --step-5: clamp(2.75rem, 1.8rem + 4.6vw, 5.75rem);     /* 44 to 92 */
    --feel: clamp(2.125rem, 1.35rem + 3.9vw, 4.75rem);     /* 34 to 76 */

    /* Space and shape */
    --gutter: clamp(1.25rem, 0.8rem + 2.4vw, 3.5rem);
    --section: clamp(4rem, 3rem + 5vw, 8rem);
    --wrap: 76rem;
    --measure: 40rem;
    --radius-sheet: 1.375rem;
    --radius-panel: 1.75rem;
    --header-h: 4.25rem;

    /* Motion */
    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
    --ease-breath: cubic-bezier(0.45, 0, 0.55, 1);
  }

  /* Dark follows the device, unless a theme is chosen explicitly on the root element */
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
      --ground: #1B1714;
      --ground-warm: #211C18;
      --paper: #26201B;
      --paper-raised: #2C2520;
      --ink: #EFE8DC;
      --ink-soft: #C3B9AA;
      --ink-faint: #8F877C;
      --rule: #3B332C;
      --rule-soft: #2F2924;
      --clay: #C88E5F;
      --clay-deep: #E0A979;
      --clay-soft: #5A3F2A;
      --rose: #D9A88E;
      --sage: #A8B9A0;
      --sage-soft: #3A4536;
      --rose-soft: #4E352B;

      --link: #E0A979;
      --focus: #E0A979;
      --field-rule: #7D7366;
      --orb-glow: #EFE8DC;
      --invert-bg: #EFE8DC;
      --invert-ink: #2A2520;
      --invert-soft: #4A443A;
      --invert-rule: #CFC4B3;
      --invert-link: #7A4F2E;
      --header-bg: rgba(27, 23, 20, 0.88);
      --shadow-sheet: 0 1px 0 rgba(0, 0, 0, 0.2), 0 22px 44px -24px rgba(0, 0, 0, 0.7);
      --scrim: rgba(0, 0, 0, 0.6);
      color-scheme: dark;
    }
  }
  :root[data-theme="dark"] {
    --ground: #1B1714;
    --ground-warm: #211C18;
    --paper: #26201B;
    --paper-raised: #2C2520;
    --ink: #EFE8DC;
    --ink-soft: #C3B9AA;
    --ink-faint: #8F877C;
    --rule: #3B332C;
    --rule-soft: #2F2924;
    --clay: #C88E5F;
    --clay-deep: #E0A979;
    --clay-soft: #5A3F2A;
    --rose: #D9A88E;
    --sage: #A8B9A0;
    --sage-soft: #3A4536;
    --rose-soft: #4E352B;

    --link: #E0A979;
    --focus: #E0A979;
    --field-rule: #7D7366;
    --orb-glow: #EFE8DC;
    --invert-bg: #EFE8DC;
    --invert-ink: #2A2520;
    --invert-soft: #4A443A;
    --invert-rule: #CFC4B3;
    --invert-link: #7A4F2E;
    --header-bg: rgba(27, 23, 20, 0.88);
    --shadow-sheet: 0 1px 0 rgba(0, 0, 0, 0.2), 0 22px 44px -24px rgba(0, 0, 0, 0.7);
    --scrim: rgba(0, 0, 0, 0.6);
    color-scheme: dark;
  }
}

/* ---------- The colour of each feeling ----------
   Every feeling has its own weather: a ground, a glow, an ink to write on it, a mid tone for
   marks, a wash for the cards beneath it and a deep tone for buttons. Made in OKLCH at one
   lightness and strength so the nine sit together, then written out as plain colours. */
@layer tokens {
  :root { --f-bg: var(--paper); --f-glow: var(--paper-raised); --f-ink: var(--ink); --f-mid: var(--clay-deep); --f-wash: var(--paper-raised); --f-deep: var(--ink); interpolate-size: allow-keywords; }
  .f-worried { --f-bg: #DBD7FC; --f-glow: #F3E2FB; --f-ink: #2B244B; --f-mid: #53458A; --f-wash: #F1EFFD; --f-deep: #483C79; }
  .f-panicky { --f-bg: #F2D7B9; --f-glow: #F6ECC6; --f-ink: #412400; --f-mid: #784500; --f-wash: #F9EFE4; --f-deep: #693C00; }
  .f-overwhelmed { --f-bg: #B7E7E7; --f-glow: #CFF1F8; --f-ink: #003536; --f-mid: #006465; --f-wash: #E4F5F5; --f-deep: #005758; }
  .f-low { --f-bg: #C2E1FC; --f-glow: #E2E6FD; --f-ink: #032E4B; --f-mid: #02578B; --f-wash: #E8F3FD; --f-deep: #014B79; }
  .f-angry { --f-bg: #FCD0CC; --f-glow: #FDE3C8; --f-ink: #481B19; --f-mid: #853532; --f-wash: #FDEDEB; --f-deep: #742E2B; }
  .f-cant-sleep { --f-bg: #1A2444; --f-glow: #50417E; --f-ink: #E2EBFF; --f-mid: #AEC3F9; --f-wash: #EBF0FD; --f-deep: #29396C; }
  .f-lonely { --f-bg: #F7D0E1; --f-glow: #FCE0D8; --f-ink: #441B30; --f-mid: #7D355B; --f-wash: #FBECF3; --f-deep: #6E2E4F; }
  .f-grieving { --f-bg: #C6E6CB; --f-glow: #CDF3EC; --f-ink: #093517; --f-mid: #15632F; --f-wash: #E9F5EB; --f-deep: #115629; }
  .f-under-pressure { --f-bg: #DEE0BA; --f-glow: #DCF0D2; --f-ink: #2E2E00; --f-mid: #575700; --f-wash: #F1F2E5; --f-deep: #4C4B00; }
  .f-left-out { --f-bg: #ECD3F2; --f-glow: #FADFE9; --f-ink: #3A1F41; --f-mid: #6D3C78; --f-wash: #F7EEF9; --f-deep: #5F3368; }
  .f-not-good-enough { --f-bg: #F9D4C1; --f-glow: #F2E6D1; --f-ink: #461F08; --f-mid: #823C0F; --f-wash: #FCEEE7; --f-deep: #71330B; }
  .f-unsettled { --f-bg: #BCE8D9; --f-glow: #D0EEF2; --f-ink: #003428; --f-mid: #04624E; --f-wash: #E6F6F0; --f-deep: #035443; }
  .f-dreading-school { --f-bg: #CEDCFF; --f-glow: #EBE3FA; --f-ink: #1C294E; --f-mid: #394E8F; --f-wash: #ECF1FE; --f-deep: #31437D; }
  .f-stuck-online { --f-bg: #B8E6F1; --f-glow: #D8EAFC; --f-ink: #00323B; --f-mid: #005D6E; --f-wash: #E5F5F9; --f-deep: #02505F; }
  .f-breathe { --f-bg: #D6E2CF; --f-glow: #E9F0DC; --f-ink: #1D3320; --f-mid: #3D5F40; --f-wash: #EDF2E8; --f-deep: #2F4C33; }
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .f-worried { --f-bg: #302C48; --f-glow: #4B3558; --f-ink: #EAE8FF; --f-mid: #C3BBFB; --f-wash: #1E1D26; --f-deep: #C3BBFB; }
    :root:not([data-theme="light"]) .f-panicky { --f-bg: #402C12; --f-glow: #4B4416; --f-ink: #F9E8D6; --f-mid: #EABA83; --f-wash: #241D15; --f-deep: #EABA83; }
    :root:not([data-theme="light"]) .f-overwhelmed { --f-bg: #053838; --f-glow: #0B4A5E; --f-ink: #D5F2F1; --f-mid: #78D7D6; --f-wash: #142121; --f-deep: #78D7D6; }
    :root:not([data-theme="light"]) .f-low { --f-bg: #193348; --f-glow: #353D63; --f-ink: #DBEEFE; --f-mid: #92CBFB; --f-wash: #171F26; --f-deep: #92CBFB; }
    :root:not([data-theme="light"]) .f-angry { --f-bg: #462623; --f-glow: #5A3A1B; --f-ink: #FFE4E1; --f-mid: #F9AEA7; --f-wash: #261B1A; --f-deep: #F9AEA7; }
    :root:not([data-theme="light"]) .f-cant-sleep { --f-bg: #252F4A; --f-glow: #473A64; --f-ink: #E2EBFF; --f-mid: #ABC3FF; --f-wash: #1A1E27; --f-deep: #ABC3FF; }
    :root:not([data-theme="light"]) .f-lonely { --f-bg: #432534; --f-glow: #5C3430; --f-ink: #FCE3EE; --f-mid: #F1ACCC; --f-wash: #251B1F; --f-deep: #F1ACCC; }
    :root:not([data-theme="light"]) .f-grieving { --f-bg: #1C3723; --f-glow: #124B45; --f-ink: #DEF1E1; --f-mid: #9AD5A5; --f-wash: #18211A; --f-deep: #9AD5A5; }
    :root:not([data-theme="light"]) .f-under-pressure { --f-bg: #323212; --f-glow: #2B4A2C; --f-ink: #ECEDD7; --f-mid: #C7CA85; --f-wash: #1E1F15; --f-deep: #C7CA85; }
    :root:not([data-theme="light"]) .f-left-out { --f-bg: #3C2840; --f-glow: #5A3146; --f-ink: #F4E5F8; --f-mid: #DFB2E9; --f-wash: #221B23; --f-deep: #DFB2E9; }
    :root:not([data-theme="light"]) .f-not-good-enough { --f-bg: #452819; --f-glow: #543B11; --f-ink: #FDE6DB; --f-mid: #F5B391; --f-wash: #251C17; --f-deep: #F5B391; }
    :root:not([data-theme="light"]) .f-unsettled { --f-bg: #10392E; --f-glow: #024A4E; --f-ink: #D9F2E8; --f-mid: #84D8BD; --f-wash: #15211D; --f-deep: #84D8BD; }
    :root:not([data-theme="light"]) .f-dreading-school { --f-bg: #262F4A; --f-glow: #44385F; --f-ink: #E3EBFE; --f-mid: #ACC3FE; --f-wash: #1A1E27; --f-deep: #ACC3FE; }
    :root:not([data-theme="light"]) .f-stuck-online { --f-bg: #093740; --f-glow: #1D4360; --f-ink: #D6F1F7; --f-mid: #7BD3E9; --f-wash: #142023; --f-deep: #7BD3E9; }
    :root:not([data-theme="light"]) .f-breathe { --f-bg: #26331F; --f-glow: #324527; --f-ink: #E4EFDD; --f-mid: #A8C79F; --f-wash: #1B2118; --f-deep: #A8C79F; }
  }
  :root[data-theme="dark"] .f-worried { --f-bg: #302C48; --f-glow: #4B3558; --f-ink: #EAE8FF; --f-mid: #C3BBFB; --f-wash: #1E1D26; --f-deep: #C3BBFB; }
  :root[data-theme="dark"] .f-panicky { --f-bg: #402C12; --f-glow: #4B4416; --f-ink: #F9E8D6; --f-mid: #EABA83; --f-wash: #241D15; --f-deep: #EABA83; }
  :root[data-theme="dark"] .f-overwhelmed { --f-bg: #053838; --f-glow: #0B4A5E; --f-ink: #D5F2F1; --f-mid: #78D7D6; --f-wash: #142121; --f-deep: #78D7D6; }
  :root[data-theme="dark"] .f-low { --f-bg: #193348; --f-glow: #353D63; --f-ink: #DBEEFE; --f-mid: #92CBFB; --f-wash: #171F26; --f-deep: #92CBFB; }
  :root[data-theme="dark"] .f-angry { --f-bg: #462623; --f-glow: #5A3A1B; --f-ink: #FFE4E1; --f-mid: #F9AEA7; --f-wash: #261B1A; --f-deep: #F9AEA7; }
  :root[data-theme="dark"] .f-cant-sleep { --f-bg: #252F4A; --f-glow: #473A64; --f-ink: #E2EBFF; --f-mid: #ABC3FF; --f-wash: #1A1E27; --f-deep: #ABC3FF; }
  :root[data-theme="dark"] .f-lonely { --f-bg: #432534; --f-glow: #5C3430; --f-ink: #FCE3EE; --f-mid: #F1ACCC; --f-wash: #251B1F; --f-deep: #F1ACCC; }
  :root[data-theme="dark"] .f-grieving { --f-bg: #1C3723; --f-glow: #124B45; --f-ink: #DEF1E1; --f-mid: #9AD5A5; --f-wash: #18211A; --f-deep: #9AD5A5; }
  :root[data-theme="dark"] .f-under-pressure { --f-bg: #323212; --f-glow: #2B4A2C; --f-ink: #ECEDD7; --f-mid: #C7CA85; --f-wash: #1E1F15; --f-deep: #C7CA85; }
  :root[data-theme="dark"] .f-left-out { --f-bg: #3C2840; --f-glow: #5A3146; --f-ink: #F4E5F8; --f-mid: #DFB2E9; --f-wash: #221B23; --f-deep: #DFB2E9; }
  :root[data-theme="dark"] .f-not-good-enough { --f-bg: #452819; --f-glow: #543B11; --f-ink: #FDE6DB; --f-mid: #F5B391; --f-wash: #251C17; --f-deep: #F5B391; }
  :root[data-theme="dark"] .f-unsettled { --f-bg: #10392E; --f-glow: #024A4E; --f-ink: #D9F2E8; --f-mid: #84D8BD; --f-wash: #15211D; --f-deep: #84D8BD; }
  :root[data-theme="dark"] .f-dreading-school { --f-bg: #262F4A; --f-glow: #44385F; --f-ink: #E3EBFE; --f-mid: #ACC3FE; --f-wash: #1A1E27; --f-deep: #ACC3FE; }
  :root[data-theme="dark"] .f-stuck-online { --f-bg: #093740; --f-glow: #1D4360; --f-ink: #D6F1F7; --f-mid: #7BD3E9; --f-wash: #142023; --f-deep: #7BD3E9; }
  :root[data-theme="dark"] .f-breathe { --f-bg: #26331F; --f-glow: #324527; --f-ink: #E4EFDD; --f-mid: #A8C79F; --f-wash: #1B2118; --f-deep: #A8C79F; }
}

/* ---------- Base ---------- */
@layer base {
  html {
    background: var(--ground);
    scroll-padding-top: calc(var(--header-h) + 1rem);
  }
  /* Pages with the sticky age filter keep focused things clear of both bars */
  html:has(.filter) { scroll-padding-top: calc(var(--header-h) + 5.5rem); }
  #main:focus { outline: none; }
  body {
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--ground);
    color: var(--ink);
    font-family: var(--sans);
    font-size: var(--step-0);
    line-height: 1.6;
    font-optical-sizing: auto;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-feature-settings: "cv11", "ss03";
  }
  h1, h2, h3, h4 {
    font-family: var(--serif);
    font-weight: 380;
    line-height: 1.1;
    letter-spacing: -0.012em;
    font-variation-settings: "SOFT" 50, "WONK" 0;
    text-wrap: balance;
  }
  p, li, dd { text-wrap: pretty; }
  a {
    color: var(--link);
    text-decoration-line: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.2em;
    transition: text-decoration-thickness 0.2s var(--ease-out), color 0.2s var(--ease-out);
  }
  a:hover { text-decoration-thickness: 2px; }
  :focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 3px;
    border-radius: 0.375rem;
  }
  ::selection { background: var(--clay-soft); color: var(--ink); }
  strong { font-weight: 600; }
  abbr[title] { text-decoration: none; }
  hr { border: 0; border-top: 1px solid var(--rule); margin: 0; }
}

/* ---------- Layout ---------- */
@layer layout {
  .wrap {
    width: 100%;
    max-width: calc(var(--wrap) + var(--gutter) * 2);
    margin-inline: auto;
    padding-inline: max(var(--gutter), env(safe-area-inset-left));
  }
  .measure { max-width: var(--measure); }
  .section { padding-block: var(--section); }
  .section--warm { background: var(--ground-warm); }
  .stack > * + * { margin-top: 1rem; }
  .skip {
    position: absolute;
    left: 1rem;
    top: -4rem;
    z-index: 100;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    background: var(--ink);
    color: var(--ground);
    text-decoration: none;
  }
  .skip:focus { top: 1rem; }
}

/* ---------- Components ---------- */
@layer components {

  /* Header */
  .site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--ground);
    border-bottom: 1px solid transparent;
    padding-top: env(safe-area-inset-top);
    view-transition-name: site-header;
  }
  @supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
    .site-header {
      background: var(--header-bg);
      -webkit-backdrop-filter: saturate(1.5) blur(16px);
      backdrop-filter: saturate(1.5) blur(16px);
    }
  }
  .site-header.is-scrolled { border-bottom-color: var(--rule-soft); }
  .site-header__inner {
    min-height: var(--header-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
  }
  .brand {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 2.75rem;
    color: var(--ink);
    text-decoration: none;
    font-family: var(--serif);
    font-size: 1.25rem;
    font-weight: 420;
    letter-spacing: -0.018em;
    white-space: nowrap;
    font-variation-settings: "SOFT" 60, "WONK" 0;
  }
  .brand__dots { display: inline-flex; gap: 0.3125rem; }
  .brand__dots i { width: 0.4375rem; height: 0.4375rem; border-radius: 50%; display: block; }
  .brand__dots i:nth-child(1) { background: var(--clay); }
  .brand__dots i:nth-child(2) { background: var(--rose); }
  .brand__dots i:nth-child(3) { background: var(--sage); }
  .site-nav { display: flex; align-items: center; gap: 0.25rem; }
  .site-nav__link {
    display: none;
    align-items: center;
    min-height: 2.75rem;
    padding-inline: 0.75rem;
    border-radius: 999px;
    color: var(--ink-soft);
    text-decoration: none;
    font-size: 0.9375rem;
  }
  .site-nav__link:hover { color: var(--ink); }
  .site-nav__link[aria-current="page"] { color: var(--ink); }
  @media (min-width: 52rem) { .site-nav__link { display: inline-flex; } }

  /* Buttons */
  .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 3rem;
    padding: 0 1.375rem;
    border-radius: 999px;
    font-family: var(--sans);
    font-size: 0.96875rem;
    font-weight: 550;
    line-height: 1.2;
    letter-spacing: 0.005em;
    text-decoration: none;
    white-space: nowrap;
    transition: transform 0.18s var(--ease-out), background-color 0.2s var(--ease-out), color 0.2s var(--ease-out), border-color 0.2s var(--ease-out);
  }
  .btn:active { transform: scale(0.97); }
  .btn--solid { background: var(--ink); color: var(--ground); border: 1px solid var(--ink); }
  .btn--solid:hover { background: color-mix(in srgb, var(--ink) 88%, var(--clay)); }
  .btn--quiet { background: transparent; color: var(--ink); border: 1px solid var(--rule); }
  .btn--quiet:hover { border-color: var(--ink); }
  .btn--help { min-height: 2.75rem; padding: 0 1.125rem; background: var(--ink); color: var(--ground); border: 1px solid var(--ink); font-size: 0.9375rem; }
  .btn--help .btn__pulse { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--clay-soft); }
  .btn svg { width: 1.125rem; height: 1.125rem; flex: none; }

  /* Who it is for: one segmented choice. The three brand dots stand for the three ages. */
  .who { border: 0; padding: 0; margin: 0; min-width: 0; }
  .who__legend { padding: 0; margin-bottom: 0.625rem; font-size: 0.9375rem; font-weight: 600; color: var(--ink); }
  .who--quiet .who__legend { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
  .who__options {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.25rem;
    padding: 0.25rem;
    border-radius: 1.25rem;
    background: var(--paper);
    border: 1px solid var(--rule-soft);
  }
  .who__options--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .who__option {
    position: relative;
    display: grid;
    align-content: center;
    justify-items: center;
    gap: 0.0625rem;
    min-height: 3.5rem;
    padding: 0.5rem 0.25rem;
    border-radius: 1rem;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out);
  }
  .who__option input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; margin: 0; cursor: pointer; }
  .who__name { display: inline-flex; align-items: center; gap: 0.4375rem; font-size: 0.96875rem; font-weight: 600; line-height: 1.3; color: var(--ink); }
  .who__name::before { content: ""; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--dot, var(--clay)); flex: none; }
  .who__range { font-size: 0.8125rem; line-height: 1.3; color: var(--ink-soft); }
  .who__option--children { --dot: var(--sage); }
  .who__option--teenagers { --dot: var(--rose); }
  .who__option--adults { --dot: var(--clay); }
  .who__option--all .who__name::before { display: none; }
  .who__option:hover { background: var(--paper-raised); }
  /* Without :has(), the chosen age is underlined; with it, the whole choice fills */
  .who__option input:checked ~ .who__name { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.3em; }
  .who__option:has(input:checked) { background: var(--ink); box-shadow: 0 8px 18px -12px rgba(42, 37, 32, 0.7); }
  .who__option:has(input:checked) .who__name { text-decoration: none; color: var(--ground); }
  .who__option:has(input:checked) .who__range { color: color-mix(in srgb, var(--ground) 82%, var(--ink)); }
  .who__option:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }

  /* The colours of the three ages, for anything that belongs to one */
  [data-audience="children"], .age--children { --age: var(--sage); --age-soft: var(--sage-soft); }
  [data-audience="teenagers"], .age--teenagers { --age: var(--rose); --age-soft: var(--rose-soft); }
  [data-audience="adults"], .age--adults { --age: var(--clay); --age-soft: var(--clay-soft); }

  /* A feeling's mark */
  .mark { display: block; }
  .tip__steps { margin-top: 1.5rem; counter-reset: step; display: grid; gap: 0.875rem; }
  .tip__steps li {
    counter-increment: step;
    display: grid;
    grid-template-columns: 2rem 1fr;
    gap: 0.75rem;
    align-items: baseline;
    font-size: var(--step-0);
  }
  .tip__steps li::before {
    content: counter(step);
    font-family: var(--serif);
    font-size: 1.375rem;
    line-height: 1;
    color: var(--clay-deep);
    font-variation-settings: "SOFT" 100, "WONK" 0;
    font-feature-settings: "lnum";
    text-align: right;
  }
  .tip__why { margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--rule-soft); }
  .tip__label { font-family: var(--sans); font-size: 0.875rem; font-weight: 600; line-height: 1.4; letter-spacing: 0.01em; color: var(--ink); margin-bottom: 0.25rem; font-variation-settings: normal; }
  .tip__why p { color: var(--ink-soft); }
  .tip__grownup { margin-top: 1rem; padding: 0.875rem 1rem; border-radius: 0.875rem; background: color-mix(in srgb, var(--sage-soft) 45%, transparent); }
  .tip__grownup p { color: var(--ink); font-size: 0.96875rem; }
  /* Where the tip comes from: quiet, but always there */
  .tip__source { margin-top: 1rem; font-size: 0.875rem; line-height: 1.5; color: var(--ink-soft); }
  .tip__source a { color: var(--ink); text-decoration-color: color-mix(in srgb, var(--ink) 35%, transparent); }
  .tip__source a:hover { text-decoration-color: currentColor; }
  .tip__actions { margin-top: 1.5rem; display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.25rem; }

  /* Where to find support: a short list of people to contact, after "when it's more than a tip" */
  .support { margin-top: 1rem; }
  .support__title { font-family: var(--sans); font-size: 0.875rem; font-weight: 600; line-height: 1.4; color: var(--ink); margin-bottom: 0.25rem; font-variation-settings: normal; }
  .support__list { display: grid; }
  .support__item { padding-block: 0.75rem; border-top: 1px solid var(--rule-soft); }
  .support__item:last-child { padding-bottom: 0; }
  .support__name { font-weight: 600; color: var(--ink); text-decoration-color: color-mix(in srgb, var(--ink) 30%, transparent); }
  .support__name:hover { text-decoration-color: currentColor; }
  .support__say { margin-top: 0.125rem; font-size: 0.9375rem; color: var(--ink-soft); }
  .support__how { margin-top: 0.375rem; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.125rem 0.875rem; font-size: 0.9375rem; }
  .support__contact { font-weight: 600; }
  .support__when { font-size: 0.8125rem; color: var(--ink-soft); }
  @container (min-width: 44rem) {
    .tip__steps li { grid-template-columns: 2.5rem 1fr; }
  }

  /* Crisis block (canonical furniture, rendered from content/help.json) */
  .crisis { display: grid; gap: 0; container-type: inline-size; }
  .crisis__tier { padding-block: 1.125rem; border-top: 1px solid var(--crisis-rule, var(--rule)); display: grid; gap: 0.75rem; }
  .crisis__tier:first-child { border-top: 0; padding-top: 0.25rem; }
  .crisis__label { font-family: var(--serif); font-size: 1.25rem; font-weight: 420; line-height: 1.25; font-variation-settings: "SOFT" 60, "WONK" 0; }
  .crisis__res { display: grid; gap: 0.125rem; font-size: 0.96875rem; color: var(--crisis-soft, var(--ink-soft)); }
  @container (min-width: 44rem) {
    .crisis__tier { grid-template-columns: minmax(0, 1fr) auto; column-gap: 2.5rem; align-items: start; }
    .crisis__label { grid-column: 1 / -1; }
    .crisis__actions { justify-content: flex-end; }
  }
  .crisis__name { color: var(--crisis-ink, var(--ink)); font-weight: 600; }
  .crisis__actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
  .crisis__actions .btn { min-height: 2.875rem; }
  .crisis a:not(.btn) { color: var(--crisis-link, var(--link)); }

  .panel-invert {
    --crisis-rule: var(--invert-rule);
    --crisis-soft: var(--invert-soft);
    --crisis-ink: var(--invert-ink);
    --crisis-link: var(--invert-link);
    background: var(--invert-bg);
    color: var(--invert-ink);
    border-radius: var(--radius-panel);
  }
  .panel-invert a:not(.btn) { color: var(--invert-link); }
  .panel-invert .btn--solid { background: var(--invert-ink); color: var(--invert-bg); border-color: var(--invert-ink); }
  .panel-invert .btn--quiet { color: var(--invert-ink); border-color: var(--invert-rule); }
  .panel-invert .btn--quiet:hover { border-color: var(--invert-ink); }
  /* Inverted surfaces carry their own focus ring, so it shows on the dark (or, in dark mode, light) panel */
  .panel-invert, .sheet, .notice { --focus: var(--invert-ink); }
  .panel-invert .btn:focus-visible, .sheet .btn:focus-visible, .sheet .close:focus-visible { outline-offset: 3px; }

  /* Notice for urgent safety lines (panic) */
  .notice {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.875rem;
    align-items: start;
    padding: 1rem 1.25rem;
    border-radius: 1rem;
    background: var(--invert-bg);
    color: var(--invert-ink);
    font-size: 1rem;
    font-weight: 500;
  }
  .notice--draft { margin-block: 1rem 0; }
  .notice svg { width: 1.375rem; height: 1.375rem; margin-top: 0.1rem; }
  .notice__line { display: block; }
  .notice__line + .notice__line { margin-top: 0.5rem; }
  .notice a { color: var(--invert-link); }

  /* Rooms list */
  .room-list { display: grid; }
  .room {
    display: grid;
    grid-template-columns: 4rem 1fr;
    gap: 1rem;
    align-items: center;
    padding-block: 1rem;
    border-top: 1px solid var(--rule);
    color: inherit;
    text-decoration: none;
  }
  .room-list li:last-child .room { border-bottom: 1px solid var(--rule); }
  .room__mark { width: 4rem; height: 4rem; border-radius: 1rem; display: grid; place-items: center; overflow: hidden; }
  .room__mark::after { content: ""; width: 1.875rem; height: 1.875rem; border-radius: 50%; background: var(--orb, var(--clay)); transition: transform 0.6s var(--ease-breath); }
  .room:hover .room__mark::after { transform: scale(1.18); }
  .room__mark--breath { background: #E3E7DD; --orb: #3D5240; }
  .room__mark--regulation { background: #E8EEF2; --orb: #13314F; }
  .room__mark--sleep { background: #131D38; --orb: #C8D4E8; }
  .room__mark--character { background: var(--paper); }
  .room__mark--character::after { display: none; }
  .room__mark img { width: 3.25rem; height: auto; }
  .room__name { display: block; font-family: var(--serif); font-size: 1.375rem; font-weight: 420; line-height: 1.2; color: var(--ink); font-variation-settings: "SOFT" 60, "WONK" 0; }
  .room__line { display: block; margin-top: 0.125rem; color: var(--ink-soft); font-size: 0.9375rem; line-height: 1.5; }
  .room:hover .room__name { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }

  /* Sources */
  .sources { display: grid; gap: 0.5rem; font-size: 0.9375rem; color: var(--ink-soft); }
  .sources a { color: var(--ink); }
  .sources__pub { color: var(--ink-soft); }

  /* Byline */
  .byline { display: flex; align-items: center; gap: 0.75rem; color: var(--ink-soft); font-size: 0.9375rem; }
  .byline__mark { width: 2.25rem; height: 2.25rem; border-radius: 50%; background: var(--paper); border: 1px solid var(--rule); display: grid; place-items: center; font-family: var(--serif); font-size: 0.9375rem; color: var(--ink); flex: none; }

  /* Toast */
  .toast {
    position: fixed;
    left: 50%;
    bottom: calc(1.5rem + env(safe-area-inset-bottom));
    transform: translateX(-50%);
    z-index: 90;
    padding: 0.75rem 1.125rem;
    border-radius: 999px;
    background: var(--ink);
    color: var(--ground);
    font-size: 0.9375rem;
    box-shadow: var(--shadow-sheet);
    max-width: calc(100vw - 2rem);
    overflow-wrap: anywhere;
    transition: opacity 0.2s var(--ease-out);
  }
  .toast:empty { opacity: 0; padding: 0; pointer-events: none; box-shadow: none; }

  /* Dialog: shared */
  .sheet::backdrop, .guide::backdrop { background: var(--scrim); }
  @supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
    .sheet::backdrop { -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
  }

  /* Help sheet */
  .sheet {
    width: min(38rem, 100%);
    max-height: min(88dvh, 52rem);
    margin: auto auto 0;
    border-radius: var(--radius-panel) var(--radius-panel) 0 0;
    background: var(--invert-bg);
    color: var(--invert-ink);
    padding: 0;
    overflow: hidden;
    overscroll-behavior: contain;
  }
  @media (min-width: 40rem) {
    .sheet { margin: auto; border-radius: var(--radius-panel); }
  }
  .sheet[open] { display: flex; flex-direction: column; }
  .sheet__bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.25rem 1.5rem 0.75rem; }
  .sheet__title { font-size: 1.625rem; font-weight: 400; }
  .sheet__body { overflow-y: auto; padding: 0.5rem 1.5rem calc(1.5rem + env(safe-area-inset-bottom)); }
  .sheet__more { margin-top: 1.25rem; font-size: 0.96875rem; color: var(--invert-soft); }
  .sheet .crisis { --crisis-rule: var(--invert-rule); --crisis-soft: var(--invert-soft); --crisis-ink: var(--invert-ink); --crisis-link: var(--invert-link); }
  .sheet .btn--solid { background: var(--invert-ink); color: var(--invert-bg); border-color: var(--invert-ink); }
  .sheet .btn--quiet { color: var(--invert-ink); border-color: var(--invert-rule); }
  .sheet a:not(.btn) { color: var(--invert-link); }
  .close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.75rem;
    min-height: 2.75rem;
    padding: 0 0.875rem;
    border-radius: 999px;
    border: 1px solid currentColor;
    font-size: 0.9375rem;
    font-weight: 500;
  }
  .close:hover { opacity: 1; }

  /* Standalone tab bar: only when installed to the home screen */
  .tabbar { display: none; }
  @media (display-mode: standalone) {
    .tabbar {
      position: fixed;
      left: 0;
      right: 0;
      bottom: 0;
      z-index: 60;
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      padding: 0.375rem 0.5rem calc(0.375rem + env(safe-area-inset-bottom));
      background: var(--header-bg);
      -webkit-backdrop-filter: saturate(1.5) blur(16px);
      backdrop-filter: saturate(1.5) blur(16px);
      border-top: 1px solid var(--rule-soft);
      view-transition-name: tabbar;
    }
    .tabbar a { display: grid; justify-items: center; gap: 0.125rem; min-height: 3rem; padding-top: 0.375rem; color: var(--ink-soft); text-decoration: none; font-size: 0.8125rem; font-weight: 500; }
    .tabbar a[aria-current="page"] { color: var(--ink); }
    .tabbar svg { width: 1.5rem; height: 1.5rem; }
    body { padding-bottom: calc(4rem + env(safe-area-inset-bottom)); }
    html { scroll-padding-bottom: calc(4.5rem + env(safe-area-inset-bottom)); }
    .toast { bottom: calc(5rem + env(safe-area-inset-bottom)); }
  }
  /* Short screens (a phone on its side, or the page zoomed right in): nothing sticks */
  @media (max-height: 32rem) {
    .site-header, .filter { position: static; }
    html, html:has(.filter) { scroll-padding-top: 1rem; }
  }
}

/* ---------- Pages ---------- */
@layer pages {
  /* Wide screens: the question and the tip on the left, the feelings on the right */

  .search__field { position: relative; margin-top: 0.625rem; }
  .search__field svg { position: absolute; left: 1.125rem; top: 50%; width: 1.125rem; height: 1.125rem; transform: translateY(-50%); color: var(--ink-soft); pointer-events: none; }
  .search__field input { width: 100%; min-height: 3.25rem; padding: 0 1.25rem 0 3rem; border-radius: 999px; border: 1px solid var(--field-rule); background: var(--paper-raised); color: var(--ink); font: inherit; font-size: 1.0625rem; -webkit-appearance: none; appearance: none; }
  .search__field input::placeholder { color: var(--ink-soft); opacity: 0.85; }
  .search__field input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; display: none; }
  .search__title { display: block; font-weight: 600; line-height: 1.3; }
  .search__meta { display: block; margin-top: 0.125rem; font-size: 0.875rem; color: var(--ink-soft); }
  .search__empty { padding: 0.5rem 0.25rem; color: var(--ink-soft); }
  .foundations__source { margin-top: 2rem; color: var(--ink-soft); font-size: 0.875rem; }

  .section-title { font-size: var(--step-4); font-weight: 350; line-height: 1.04; letter-spacing: -0.024em; font-variation-settings: "SOFT" 60, "WONK" 0; }
  .lede { margin-top: 1rem; font-size: var(--step-1); line-height: 1.55; color: var(--ink-soft); max-width: 36rem; }

  /* Help panel on home */
  .help-panel { padding: clamp(1.75rem, 1rem + 3vw, 3.5rem); display: grid; gap: 2rem 4rem; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); align-items: start; }
  .help-panel__title { font-size: var(--step-4); font-weight: 350; line-height: 1.05; letter-spacing: -0.024em; }
  .help-panel__lede { margin-top: 1rem; color: var(--invert-soft); font-size: var(--step-1); line-height: 1.5; max-width: 26rem; }
  .help-panel__more { margin-top: 1.5rem; }

  /* Promises */
  .promises { margin-top: 2.5rem; display: grid; gap: 0 3rem; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); }
  .promise { padding-block: 1.125rem; border-top: 1px solid var(--rule); }
  .promise dt { font-weight: 600; }
  .promise dd { margin-top: 0.25rem; color: var(--ink-soft); font-size: 0.96875rem; }
  .crumb { display: inline-flex; align-items: center; gap: 0.5rem; min-height: 2.75rem; color: var(--ink-soft); font-size: 0.9375rem; text-decoration: none; }
  .crumb:hover { color: var(--ink); text-decoration: underline; text-decoration-thickness: 1px; }
  .crumb svg { width: 1rem; height: 1rem; }
  .issue__safety { margin-top: 2rem; max-width: 42rem; }

  .filter {
    position: sticky;
    top: calc(var(--header-h) + env(safe-area-inset-top));
    z-index: 40;
    padding-block: 0.75rem;
    background: var(--ground);
    border-bottom: 1px solid var(--rule-soft);
  }
  @supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
    .filter { background: var(--header-bg); -webkit-backdrop-filter: saturate(1.5) blur(16px); backdrop-filter: saturate(1.5) blur(16px); }
  }
  @supports (background: color-mix(in srgb, red 50%, transparent)) {
    .filter { background: color-mix(in srgb, var(--ground) 93%, transparent); }
  }

  /* On a phone the sticky filter keeps its four choices in one slim row */
  @media (max-width: 40rem) {
    .filter .who__option { min-height: 3rem; padding-inline: 0.125rem; }
    .filter .who__range { display: none; }
  }
  @media (max-width: 30rem) {
    .filter .who__name { font-size: 0.875rem; }
    .filter .who__name::before { display: none; }
  }
  /* The smallest phones (320px): keep the header on one line and every choice inside its box */
  @media (max-width: 22.5rem) {
    .brand { gap: 0.5rem; font-size: 1.0625rem; }
    .btn--help { padding: 0 0.875rem; }
    .who__name { font-size: 0.875rem; gap: 0.3125rem; }
    .who__range { font-size: 0.75rem; }
  }

  /* When a single age is chosen, only its sections show */
  [data-show="children"] [data-audience]:not([data-audience="children"]),
  [data-show="teenagers"] [data-audience]:not([data-audience="teenagers"]),
  [data-show="adults"] [data-audience]:not([data-audience="adults"]) { display: none; }

  .more { margin-top: var(--section); display: grid; gap: 2rem 4rem; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); align-items: start; }
  .more__title { font-size: var(--step-3); font-weight: 380; }
  .more__list { display: grid; gap: 1.25rem; }
  .more__item { padding-left: 1.25rem; border-left: 2px solid var(--dot, var(--clay)); }
  .more__item[data-audience="children"] { --dot: var(--sage); }
  .more__item[data-audience="teenagers"] { --dot: var(--rose); }
  .more__item[data-audience="adults"] { --dot: var(--clay); }
  .more__item h3 { font-family: var(--sans); font-size: 0.9375rem; font-weight: 600; margin-bottom: 0.25rem; }
  .more__item p { color: var(--ink-soft); }

  .issue-foot { margin-top: var(--section); padding-top: 2.5rem; border-top: 1px solid var(--rule); display: grid; gap: 2.5rem 4rem; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); align-items: start; }
  .issue-foot h2 { font-family: var(--sans); font-size: 0.9375rem; font-weight: 600; margin-bottom: 0.75rem; }

  /* Tip page */
  .tip-page { padding-block: clamp(1.5rem, 1rem + 3vw, 4rem) var(--section); }
  
  .aside-block + .aside-block { margin-top: 2rem; }
  .aside-block h2 { font-family: var(--sans); font-size: 0.9375rem; font-weight: 600; margin-bottom: 0.75rem; }
  .aside-list { display: grid; gap: 0.75rem; }
  .aside-list a { font-family: var(--serif); font-size: 1.1875rem; line-height: 1.3; font-variation-settings: "SOFT" 60, "WONK" 0; }
  .aside-list span { display: block; color: var(--ink-soft); font-size: 0.875rem; font-family: var(--sans); }

  /* Help page */
  .help-hero { padding-block: clamp(2rem, 1.2rem + 3.5vw, 4.5rem) 2.5rem; }
  .help-hero__title { font-size: var(--step-5); font-weight: 340; line-height: 0.98; letter-spacing: -0.03em; }
  .help-now { padding: clamp(1.5rem, 1rem + 2.5vw, 3rem); }
  .help-now__title { font-size: var(--step-3); font-weight: 380; margin-bottom: 1.25rem; }
  .services { margin-top: var(--section); }
  .service-group + .service-group { margin-top: 3rem; }
  .service-group h3 { display: inline-flex; align-items: center; gap: 0.75rem; font-size: var(--step-2); font-weight: 400; margin-bottom: 0.5rem; }
  .service-group h3::before { content: ""; width: 0.625rem; height: 0.625rem; border-radius: 50%; background: var(--dot, var(--ink-faint)); }
  .service-group[data-audience="children"] { --dot: var(--sage); }
  .service-group[data-audience="teenagers"] { --dot: var(--rose); }
  .service-group[data-audience="adults"] { --dot: var(--clay); }
  .service-list { display: grid; }
  .service { display: grid; gap: 0.375rem 2rem; padding-block: 1.125rem; border-top: 1px solid var(--rule); grid-template-columns: minmax(0, 1fr); }
  @media (min-width: 48rem) { .service { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); } }
  .service h4, .service__name { font-family: var(--sans); font-size: 1.0625rem; font-weight: 600; letter-spacing: 0; }
  .service p { color: var(--ink-soft); font-size: 0.96875rem; }
  .service__contact { font-weight: 500; color: var(--ink); }
  .at-home { margin-top: var(--section); }
  .at-home .lede { max-width: 44rem; }
  .at-home__after { color: var(--ink-soft); padding-top: 1.125rem; border-top: 1px solid var(--rule); max-width: 44rem; }
  .at-home__own { font-size: var(--step-1); font-weight: 400; margin-top: 2.5rem; margin-bottom: 0.375rem; }
  .at-home__own + p { color: var(--ink-soft); max-width: 44rem; margin-bottom: 0.75rem; }
  .keep-right { margin-top: var(--section); padding-top: 2rem; border-top: 1px solid var(--rule); display: grid; gap: 1.5rem 4rem; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); color: var(--ink-soft); }
  .keep-right h2 { font-size: var(--step-2); font-weight: 400; color: var(--ink); margin-bottom: 0.5rem; }

  /* Long-form pages (about, privacy, terms, accessibility) */
  .doc { padding-block: clamp(2rem, 1.2rem + 3.5vw, 4.5rem) var(--section); }
  .doc__title { font-size: var(--step-5); font-weight: 340; line-height: 0.98; letter-spacing: -0.03em; }
  .doc__lede { margin-top: 1rem; font-family: var(--serif); font-size: var(--step-1); color: var(--ink-soft); max-width: 36rem; font-variation-settings: "SOFT" 50, "WONK" 0; }
  .doc__body { margin-top: clamp(2rem, 1.5rem + 2vw, 3.5rem); max-width: var(--measure); }
  .doc__body h2 { font-size: var(--step-3); font-weight: 380; margin-top: 2.5rem; margin-bottom: 0.75rem; }
  .doc__body h3 { font-size: var(--step-2); font-weight: 400; margin-top: 1.75rem; margin-bottom: 0.5rem; }
  .doc__body p + p, .doc__body p + ul, .doc__body ul + p { margin-top: 1rem; }
  .doc__body ul { padding-left: 1.25rem; display: grid; gap: 0.5rem; }
  .doc__body li::marker { color: var(--clay-deep); }

  /* Footer */
  .site-footer { margin-top: var(--section); padding-block: var(--section) calc(2.5rem + env(safe-area-inset-bottom)); background: var(--ground-warm); border-top: 1px solid var(--rule-soft); }
  /* When the page already ends on a warm band, the footer continues it rather than leaving a strip between */
  main:has(> .section--warm:last-child) + .site-footer { margin-top: 0; }
  .footer-panels { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr)); }
  .footer-panel { padding: clamp(1.5rem, 1rem + 1.5vw, 2.25rem); border-radius: var(--radius-sheet); background: var(--paper); border: 1px solid var(--rule-soft); }
  .footer-panel h2 { font-size: var(--step-3); font-weight: 380; line-height: 1.12; }
  .footer-panel p { margin-top: 0.75rem; color: var(--ink-soft); }
  .footer-panel .btn { margin-top: 1.25rem; }
  .signup { margin-top: 1.25rem; display: flex; flex-wrap: wrap; gap: 0.5rem; }
  .signup label { flex-basis: 100%; font-size: 0.875rem; color: var(--ink-soft); }
  .signup input { flex: 1 1 12rem; min-width: 0; min-height: 3rem; padding: 0 1.125rem; border-radius: 999px; border: 1px solid var(--field-rule); background: var(--paper-raised); }
  .signup input::placeholder { color: var(--ink-soft); opacity: 0.8; }
  .signup__error { margin-top: 0.625rem; font-size: 0.9375rem; font-weight: 500; color: var(--ink); }
  .signup__error:empty, .signup__done:empty { margin: 0; }
  .signup .btn { margin-top: 0; }
  .signup__done { margin-top: 1.25rem; font-weight: 500; }
  .signup__fine { margin-top: 0.75rem !important; font-size: 0.875rem; }
  .footer-links { margin-top: 3.5rem; display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); }
  .footer-links h2 { font-family: var(--sans); font-size: 0.875rem; font-weight: 600; margin-bottom: 0.75rem; }
  .footer-links ul { display: grid; gap: 0; list-style: none; padding: 0; }
  .footer-links a { display: inline-flex; align-items: center; min-height: 2.5rem; color: var(--ink); text-decoration: none; font-size: 0.96875rem; }
  .footer-links a:hover { text-decoration: underline; text-decoration-thickness: 1px; }
  .footer-legal { margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--rule); display: grid; gap: 0.5rem; color: var(--ink-soft); font-size: 0.875rem; }
}

/* ---------- The 2026 design: feelings as colour ---------- */
@layer components {

  /* Tip: the parts shared by a tip card and a tip page */
  .tip__title { font-size: var(--step-4); font-weight: 360; line-height: 1.04; letter-spacing: -0.022em; }
  .tip__time { display: inline-flex; align-items: center; min-height: 1.75rem; padding: 0 0.75rem; border-radius: 999px; background: color-mix(in srgb, var(--f-ink) 10%, transparent); font-size: 0.8125rem; font-weight: 600; line-height: 1.2; }
  .tip__steps li::before { color: var(--f-deep); }
  .tip__grownup { background: var(--f-wash); border: 1px solid color-mix(in srgb, var(--f-mid) 16%, transparent); }
  .tipcard[open] .tip__grownup { background: var(--f-wash); }
  .btn[aria-pressed="true"] { background: var(--f-bg); border-color: var(--f-mid); color: var(--f-ink); }

  /* A tip on its feeling's page: its name, opening to the whole thing */
  .tipcards { display: grid; gap: 0.75rem; }
  .tipcard { border-radius: 1.5rem; background: var(--f-wash); border: 1px solid color-mix(in srgb, var(--f-mid) 14%, transparent); transition: background-color 0.3s var(--ease-out); }
  .tipcard[open] { background: var(--paper-raised); }
  .tipcard__summary { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "title chev" "time chev"; align-items: center; gap: 0.5rem 1rem; padding: 1.125rem 1.25rem; border-radius: 1.5rem; cursor: pointer; list-style: none; -webkit-tap-highlight-color: transparent; }
  .tipcard__summary::-webkit-details-marker { display: none; }
  .tipcard__title { grid-area: title; font-size: var(--step-2); font-weight: 400; line-height: 1.16; letter-spacing: -0.012em; font-variation-settings: "SOFT" 60, "WONK" 0; }
  .tipcard__time { grid-area: time; justify-self: start; display: inline-flex; align-items: center; min-height: 1.625rem; padding: 0 0.6875rem; border-radius: 999px; background: var(--f-bg); color: var(--f-ink); font-size: 0.8125rem; font-weight: 600; line-height: 1.2; }
  .tipcard__summary .chev { grid-area: chev; width: 2.5rem; height: 2.5rem; padding: 0.75rem; border-radius: 50%; background: color-mix(in srgb, var(--f-bg) 55%, transparent); color: var(--f-ink); transform: rotate(90deg); transition: transform 0.35s var(--ease-out); }
  .tipcard[open] .tipcard__summary .chev { transform: rotate(-90deg); }
  .tipcard__summary:hover .tipcard__title { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.16em; }
  .tipcard__body { padding: 0 1.25rem 1.375rem; }
  .tipcard__body .tip__steps { margin-top: 0.5rem; }
  .tipcard__body > *, .tip__body > * { max-width: 42rem; }
  .tipcard .tip__actions { gap: 0.5rem; }
  .tipcard .tip__actions .btn { min-height: 2.875rem; padding-inline: 1.0625rem; }
  .tipcard__links { margin-top: 1rem; display: flex; flex-wrap: wrap; gap: 0.375rem 1.5rem; font-size: 0.9375rem; }
  .tipcard::details-content { block-size: 0; overflow: clip; transition: block-size 0.42s var(--ease-out), content-visibility 0.42s allow-discrete; }
  .tipcard[open]::details-content { block-size: auto; }
  @media (min-width: 40rem) {
    .tipcard__summary { grid-template-columns: minmax(0, 1fr) auto auto; grid-template-areas: "title time chev"; padding: 1.25rem 1.25rem 1.25rem 1.75rem; }
    .tipcard__body { padding: 0 1.75rem 1.75rem; }
  }

  /* Other feelings, each in its own colour */
  .chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
  .chip { display: inline-flex; align-items: center; min-height: 3rem; padding: 0 1.25rem 0.125rem; border-radius: 999px; background: var(--f-bg); color: var(--f-ink); text-decoration: none; font-family: var(--serif); font-style: italic; font-size: 1.3125rem; font-variation-settings: "SOFT" 100, "WONK" 0; transition: transform 0.25s var(--ease-out); }
  .chip:hover { transform: translateY(-2px); }

  /* Do it with me: one step at a time, in the feeling's colour */
  .guide { width: 100%; max-width: 100%; height: 100%; max-height: 100dvh; margin: 0; background: radial-gradient(90% 60% at 80% 0%, var(--f-glow), transparent 70%), var(--f-bg); color: var(--f-ink); --focus: var(--f-ink); }
  .guide[open] { display: grid; grid-template-rows: auto 1fr auto; }
  .guide::backdrop { background: var(--scrim); }
  .guide__bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: calc(1rem + env(safe-area-inset-top)) var(--gutter) 1rem; }
  .guide__title { font-family: var(--serif); font-style: italic; font-size: 1.125rem; line-height: 1.3; max-width: 24ch; text-wrap: balance; font-variation-settings: "SOFT" 100, "WONK" 0; }
  .guide__stage { display: grid; place-content: center; justify-items: center; text-align: center; gap: 1.5rem; padding: 1rem var(--gutter); }
  .guide__dots { display: flex; gap: 0.375rem; min-height: 0.5rem; }
  .guide__dots i { width: 0.5rem; height: 0.5rem; border-radius: 999px; background: currentColor; opacity: 0.22; transition: width 0.35s var(--ease-out), opacity 0.35s var(--ease-out); }
  .guide__dots i.is-done { opacity: 0.5; }
  .guide__dots i.is-on { width: 1.75rem; opacity: 1; }
  .guide__count { font-size: 0.9375rem; font-weight: 500; font-feature-settings: "tnum"; min-height: 1.5em; }
  .guide__step { max-width: 22ch; font-family: var(--serif); font-size: clamp(1.75rem, 1.2rem + 2.6vw, 3.25rem); font-weight: 360; line-height: 1.16; letter-spacing: -0.014em; font-variation-settings: "SOFT" 70, "WONK" 0; text-wrap: balance; }
  .guide__step a { color: inherit; }
  .guide__controls { display: flex; justify-content: center; gap: 0.75rem; padding: 1rem var(--gutter) calc(1.5rem + env(safe-area-inset-bottom)); }
  .guide__controls .btn { min-width: 8rem; }
  .guide .btn--solid { background: var(--f-ink); border-color: var(--f-ink); color: var(--f-bg); }
  .guide .btn--quiet { border-color: color-mix(in srgb, var(--f-ink) 45%, transparent); color: var(--f-ink); }
  .pacer-wrap { display: grid; justify-items: center; gap: 1.25rem; }
  .pacer { position: relative; width: min(56vw, 16rem); aspect-ratio: 1; display: grid; place-items: center; }
  .pacer__ring { position: absolute; inset: 0; border-radius: 50%; border: 1px solid color-mix(in srgb, var(--f-ink) 30%, transparent); }
  .pacer__orb { width: 100%; height: 100%; border-radius: 50%; background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--f-mid) 55%, var(--f-glow)), var(--f-mid)); transform: scale(0.42); transition-property: transform; transition-timing-function: var(--ease-breath); }
  .pacer-wrap[data-phase="in"] .pacer__orb { transform: scale(1); }
  .pacer-wrap[data-phase="out"] .pacer__orb { transform: scale(0.42); }
  .pacer__cue { min-height: 1.4em; margin: 0; font-family: var(--serif); font-size: 1.5rem; line-height: 1.4; font-style: italic; font-variation-settings: "SOFT" 100, "WONK" 0; }

  /* On a feeling's pages, the main button takes the feeling's deep tone */
  body[class^="f-"] main .btn--solid { background: var(--f-deep); border-color: var(--f-deep); }
  body[class^="f-"] main .btn--solid:hover { background: color-mix(in srgb, var(--f-deep) 86%, var(--f-ink)); }
}

@layer pages {

  /* Home: the question, then nine feelings in colour */
  .hero { padding-block: clamp(1.25rem, 0.5rem + 3.5vw, 4rem) clamp(1.25rem, 1rem + 1.5vw, 2.25rem); }
  .hero > .wrap { display: grid; gap: 0 clamp(2rem, 1rem + 4vw, 6rem); }
  .hero__greeting { font-family: var(--serif); font-style: italic; font-size: var(--step-1); color: var(--ink-soft); font-variation-settings: "SOFT" 100, "WONK" 0; min-height: 1.6em; }
  .hero__title { margin-top: 0.125rem; font-size: clamp(2.75rem, 1.6rem + 5.6vw, 6.5rem); font-weight: 330; line-height: 0.96; letter-spacing: -0.035em; font-variation-settings: "SOFT" 70, "WONK" 0; }
  .hero__lede { margin-top: 1rem; max-width: 33rem; font-size: var(--step-0); line-height: 1.55; color: var(--ink-soft); }
  .hero__who { margin-top: 1.25rem; max-width: 30rem; }
  @media (min-width: 60rem) {
    .hero > .wrap { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); grid-template-areas: "greet greet" "title lede" "title who" "now now"; align-items: end; }
    .hero__greeting { grid-area: greet; }
    .hero__title { grid-area: title; align-self: start; }
    .hero__lede { grid-area: lede; margin-top: 0.75rem; }
    .hero__who { grid-area: who; margin-top: 1.25rem; }
    .now { grid-area: now; }
  }

  /* Something to try now */
  .now { margin-top: 1.25rem; display: grid; gap: 0.75rem 1.5rem; align-items: center; padding: 1rem 1.125rem; border-radius: 1.5rem; background: radial-gradient(70% 140% at 100% 0%, var(--f-glow), transparent 70%), var(--f-bg); color: var(--f-ink); animation: rise 0.5s var(--ease-out) both; }
  .now__label { font-size: 0.8125rem; font-weight: 600; }
  .now__tip { display: grid; gap: 0.25rem; }
  .now__title { font-family: var(--serif); font-size: var(--step-2); line-height: 1.14; color: inherit; text-decoration: none; font-variation-settings: "SOFT" 60, "WONK" 0; }
  .now__title:hover { text-decoration: underline; text-decoration-thickness: 1px; }
  .now__time { font-size: 0.875rem; }
  .now__actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
  .now .btn--solid { background: var(--f-ink); border-color: var(--f-ink); color: var(--f-bg); }
  .now .btn--quiet { border-color: color-mix(in srgb, var(--f-ink) 45%, transparent); color: var(--f-ink); }
  .now { --focus: var(--f-ink); }
  @media (max-width: 47.99rem) {
    .now { gap: 0.5rem; padding: 0.875rem 1rem 1rem; }
    .now__title { font-size: var(--step-1); }
    .now .btn { min-height: 2.625rem; padding-inline: 1.125rem; }
    .hero__lede { font-size: 1rem; margin-top: 0.75rem; }
    .hero__who { margin-top: 1rem; }
    .hero .who__option { min-height: 3.125rem; }
  }
  @media (min-width: 48rem) {
    .now { grid-template-columns: auto minmax(0, 1fr) auto; padding: 1rem 1rem 1rem 1.5rem; }
    .now__tip { grid-template-columns: auto auto; justify-content: start; align-items: baseline; gap: 0.25rem 1rem; }
  }

  .feelings { padding-bottom: clamp(2.5rem, 2rem + 3vw, 5rem); }
  .tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.625rem; }
  .tiles__cell { display: grid; }
  .tiles__cell--worried { grid-column: span 2; }
  .tiles__cell--stuck-online { grid-column: span 2; }
  @media (min-width: 44rem) {
    .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.875rem; }
    .tiles__cell--worried { grid-column: auto; }
    .tiles__cell--stuck-online { grid-column: span 2; }
  }
  @media (min-width: 68rem) {
    .tiles { grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 1rem; }
    .tiles__cell { grid-column: span 4; }
    .tiles__cell--worried, .tiles__cell--cant-sleep, .tiles__cell--grieving { grid-column: span 5; }
    .tiles__cell--panicky, .tiles__cell--low, .tiles__cell--lonely { grid-column: span 3; }
    .tiles__cell--not-good-enough { grid-column: span 5; }
    .tiles__cell--unsettled { grid-column: span 3; }
    .tiles__cell--dreading-school, .tiles__cell--stuck-online { grid-column: span 6; }
    .tile__word { font-size: clamp(2.75rem, 1.5rem + 1.6vw, 3.25rem); }
  }
  .tile {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: clamp(9.25rem, 7rem + 9vw, 15rem);
    padding: clamp(0.9375rem, 0.7rem + 1vw, 1.625rem);
    border-radius: clamp(1.375rem, 1rem + 1.2vw, 2rem);
    background: radial-gradient(85% 95% at 100% 0%, var(--f-glow), transparent 68%), var(--f-bg);
    color: var(--f-ink);
    text-decoration: none;
    overflow: hidden;
    container-type: inline-size;
    --focus: var(--ink);
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.4s var(--ease-out), box-shadow 0.4s var(--ease-out);
  }
  .tile__word { font-family: var(--serif); font-style: italic; font-size: clamp(1.5rem, 13.5cqi, 3.5rem); font-weight: 340; line-height: 1; letter-spacing: -0.025em; font-variation-settings: "SOFT" 100, "WONK" 0; }
  .tile__short { margin-top: 0.4375rem; max-width: 15rem; padding-right: 0.25rem; font-size: clamp(0.8125rem, 0.78rem + 0.2vw, 0.9375rem); line-height: 1.35; }
  .tile__count { margin-top: auto; padding-top: 0.75rem; font-size: 0.8125rem; font-weight: 600; }
  .tile__mark { position: absolute; right: clamp(0.625rem, 4cqi, 1.25rem); bottom: clamp(0.625rem, 4cqi, 1.25rem); width: clamp(2.5rem, 24cqi, 5.5rem); color: var(--f-mid); }
  .tile__mark .mark { width: 100%; height: auto; stroke-width: 1.25; }
  .tile:hover { transform: translateY(-4px); box-shadow: 0 18px 30px -22px color-mix(in srgb, var(--f-ink) 70%, transparent); }
  .tile:active { transform: scale(0.98); }
  .tile:hover .mark > *, .tile:focus-visible .mark > * { stroke-dasharray: 130; animation: draw 1.4s var(--ease-out); }

  /* Search */
  .search { margin-top: clamp(1.5rem, 1.25rem + 1.5vw, 2.5rem); max-width: 36rem; }
  .search__label { display: block; font-size: 0.9375rem; font-weight: 600; }
  .search__result { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 0.875rem; padding: 0.75rem 1rem; border-radius: 1rem; background: var(--f-wash); border: 1px solid color-mix(in srgb, var(--f-mid) 14%, transparent); color: var(--ink); text-decoration: none; }
  .search__result:hover { border-color: var(--f-mid); }
  .search__dot { width: 1.75rem; height: 1.75rem; border-radius: 50%; background: radial-gradient(circle at 70% 25%, var(--f-glow), var(--f-bg) 70%); border: 1px solid color-mix(in srgb, var(--f-mid) 30%, transparent); }
  .search__title--feeling { font-family: var(--serif); font-style: italic; font-size: 1.25rem; font-weight: 400; }
  .search__result .chev { width: 1rem; height: 1rem; color: var(--ink-faint); }

  /* Kept tips */
  .kept { padding-bottom: clamp(2.5rem, 2rem + 3vw, 5rem); }
  .kept__title { font-size: var(--step-3); font-weight: 380; }
  .kept__note { margin-top: 0.375rem; color: var(--ink-soft); font-size: 0.9375rem; }
  .kept__list { margin-top: 1rem; display: grid; gap: 0.5rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); }
  .kept__item { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 0.5rem; padding: 0.375rem 0.5rem 0.375rem 1.125rem; border-radius: 1.125rem; background: var(--f-bg); color: var(--f-ink); --focus: var(--f-ink); }
  .kept__item a { padding-block: 0.5rem; color: inherit; font-family: var(--serif); font-size: 1.1875rem; line-height: 1.25; text-decoration: none; font-variation-settings: "SOFT" 60, "WONK" 0; }
  .kept__item a:hover { text-decoration: underline; text-decoration-thickness: 1px; }
  .kept__remove { min-height: 2.75rem; padding: 0 0.75rem; border-radius: 999px; font-size: 0.8125rem; font-weight: 600; color: inherit; }
  .kept__remove:hover { text-decoration: underline; }

  /* A breath first */
  .pause__card { display: grid; gap: 1.5rem 3rem; align-items: center; padding: clamp(1.5rem, 1rem + 3vw, 3.5rem); border-radius: clamp(1.5rem, 1rem + 1.5vw, 2.25rem); background: radial-gradient(70% 120% at 100% 50%, var(--f-glow), transparent 70%), var(--f-bg); color: var(--f-ink); --f-bg: #D6E2CF; --f-glow: #E9F0DC; --f-ink: #1D3320; --f-mid: #3D5F40; --focus: var(--f-ink); overflow: hidden; }
  .pause__title { font-size: var(--step-4); font-weight: 350; line-height: 1.04; letter-spacing: -0.024em; max-width: 14ch; }
  .pause__lede { margin-top: 1rem; max-width: 30rem; font-size: var(--step-1); line-height: 1.5; }
  .pause__text .btn { margin-top: 1.5rem; background: var(--f-ink); border-color: var(--f-ink); color: var(--f-bg); }
  .pause__orb { position: relative; justify-self: center; width: min(60vw, 15rem); aspect-ratio: 1; display: grid; place-items: center; }
  .pause__orb span { grid-area: 1 / 1; border-radius: 50%; animation: breathe 10s var(--ease-breath) infinite; }
  .pause__orb span:nth-child(1) { width: 100%; height: 100%; background: color-mix(in srgb, var(--f-mid) 14%, transparent); }
  .pause__orb span:nth-child(2) { width: 72%; height: 72%; background: color-mix(in srgb, var(--f-mid) 24%, transparent); animation-delay: -0.25s; }
  .pause__orb span:nth-child(3) { width: 44%; height: 44%; background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--f-mid) 60%, var(--f-glow)), var(--f-mid)); animation-delay: -0.5s; }
  @media (min-width: 52rem) { .pause__card { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); } }

  /* Five things that keep you steady */
  .steady { margin-top: 2.25rem; display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 12.5rem), 1fr)); }
  .steady__item { padding: 1.25rem 1.25rem 1.5rem; border-radius: 1.5rem; background: var(--tint); }
  .steady__item--1 { --tint: color-mix(in srgb, var(--clay-soft) 60%, var(--paper)); }
  .steady__item--2 { --tint: color-mix(in srgb, var(--sage-soft) 70%, var(--paper)); }
  .steady__item--3 { --tint: color-mix(in srgb, var(--rose-soft) 70%, var(--paper)); }
  .steady__item--4 { --tint: color-mix(in srgb, var(--sage-soft) 40%, var(--paper)); }
  .steady__item--5 { --tint: color-mix(in srgb, var(--clay-soft) 35%, var(--paper)); }
  .steady__name { font-family: var(--serif); font-style: italic; font-size: var(--step-3); font-weight: 360; line-height: 1.1; font-variation-settings: "SOFT" 100, "WONK" 0; }
  .steady__line { margin-top: 0.5rem; font-size: 0.96875rem; line-height: 1.5; }

  /* Six small rooms, each in its own colours */
  .section--rooms { padding-top: 0; }
  .roomtiles { margin-top: 2.25rem; display: grid; gap: 0.75rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  @media (min-width: 52rem) { .roomtiles { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; } }
  .roomtile { display: flex; flex-direction: column; height: 100%; min-height: 12.5rem; padding: clamp(1rem, 0.75rem + 1vw, 1.5rem); border-radius: 1.5rem; background: var(--r-bg); color: var(--r-ink); text-decoration: none; --focus: var(--ink); transition: transform 0.4s var(--ease-out); }
  .roomtile:hover { transform: translateY(-4px); }
  .roomtile__art { width: 3.75rem; height: 3.75rem; display: grid; place-items: center; }
  .roomtile__art img { width: 100%; height: auto; }
  .roomtile__orb { width: 2.75rem; height: 2.75rem; border-radius: 50%; background: var(--r-orb); transition: transform 0.8s var(--ease-breath); }
  .roomtile:hover .roomtile__orb { transform: scale(1.2); }
  .roomtile__name { margin-top: 1.25rem; font-family: var(--serif); font-size: clamp(1.25rem, 1.1rem + 0.7vw, 1.625rem); font-weight: 420; line-height: 1.15; font-variation-settings: "SOFT" 60, "WONK" 0; overflow-wrap: anywhere; }
  .roomtile__line { margin-top: 0.375rem; font-size: 0.875rem; line-height: 1.45; }
  .roomtile--breath { --r-bg: #E3E9DC; --r-ink: #24352A; --r-orb: #3D5240; }
  .roomtile--regulation { --r-bg: #DCE6EE; --r-ink: #13314F; --r-orb: #13314F; }
  .roomtile--sleep { --r-bg: #0E1830; --r-ink: #E5EBF5; --r-orb: #C8D4E8; }
  .roomtile--mootivation { --r-bg: #F3EADB; --r-ink: #4A2E14; }
  .roomtile--purrspective { --r-bg: #F5E1DA; --r-ink: #5C211A; }
  .roomtile--wisewoofs { --r-bg: #E6E9D8; --r-ink: #38421F; }

  /* A feeling's page */
  .fhero { margin: 0.25rem clamp(0.5rem, 0.2rem + 1.5vw, 1.5rem) 0; border-radius: clamp(1.5rem, 1rem + 2vw, 2.75rem); background: radial-gradient(70% 110% at 100% 0%, var(--f-glow), transparent 68%), var(--f-bg); color: var(--f-ink); overflow: hidden; --focus: var(--f-ink); }
  .fhero__inner { position: relative; padding-block: clamp(0.75rem, 0.5rem + 1.5vw, 2rem) clamp(1.5rem, 1.1rem + 2.2vw, 3.5rem); }
  .fhero .wrap { padding-inline: clamp(1.125rem, 0.6rem + 2.4vw, 3.5rem); }
  .fhero .crumb { color: inherit; }
  .fhero .crumb:hover { color: inherit; }
  .fhero__title { margin-top: clamp(1rem, 0.6rem + 2.4vw, 3rem); font-style: italic; font-size: clamp(3.25rem, 1.8rem + 7.4vw, 9rem); font-weight: 320; line-height: 0.92; letter-spacing: -0.04em; font-variation-settings: "SOFT" 100, "WONK" 0; position: relative; z-index: 1; }
  .fhero__short { margin-top: 0.875rem; font-size: var(--step-1); font-weight: 500; position: relative; z-index: 1; }
  .fhero__intro { margin-top: 1.25rem; max-width: 40rem; font-family: var(--serif); font-size: var(--step-1); line-height: 1.5; font-weight: 360; font-variation-settings: "SOFT" 50, "WONK" 0; position: relative; z-index: 1; }
  .fhero__mark { position: absolute; right: clamp(0.5rem, 3vw, 4rem); top: clamp(0.75rem, 2vw, 2.5rem); width: clamp(6.5rem, 3rem + 17vw, 20rem); color: var(--f-mid); opacity: 0.55; pointer-events: none; }
  .fhero__mark .mark { width: 100%; height: auto; stroke-width: 0.9; }
  .fhero__mark .mark > * { stroke-dasharray: 130; animation: draw 2.2s var(--ease-out) both; }
  .issue__safety { margin-top: 1rem; max-width: 46rem; }
  .filter { border-bottom-color: transparent; margin-top: 0.5rem; }

  .age-section { padding-top: clamp(2rem, 1.5rem + 2vw, 3.5rem); }
  .age-section__title { font-size: var(--step-3); font-weight: 380; }
  .age-section__note { margin-top: 0.375rem; color: var(--ink-soft); font-size: 0.96875rem; max-width: 26rem; }
  .age-section__head { margin-bottom: 1.125rem; }
  @media (min-width: 60rem) {
    .age-section { display: grid; grid-template-columns: minmax(0, 17rem) minmax(0, 1fr); gap: 0 clamp(2rem, 1rem + 4vw, 5rem); align-items: start; }
    .age-section__head { position: sticky; top: calc(var(--header-h) + 6rem); margin-bottom: 0; }
  }

  /* A word from the counsellor, after the tips */
  .fnote { margin-top: var(--section); padding: clamp(1.5rem, 1rem + 2.5vw, 3rem); border-radius: clamp(1.5rem, 1rem + 1.5vw, 2.25rem); background: var(--f-wash); }
  .fnote__text + .fnote__text { margin-top: 1rem; }
  .fnote__text { max-width: 46rem; font-family: var(--serif); font-size: var(--step-1); font-weight: 360; line-height: 1.4; letter-spacing: -0.008em; font-variation-settings: "SOFT" 60, "WONK" 0; }
  .fnote .byline { margin-top: 1.25rem; }
  .more { margin-top: clamp(3rem, 2rem + 4vw, 6rem); }
  .more__item { --dot: var(--f-mid); }
  .more__item[data-audience] { --dot: var(--f-mid); }
  .elsewhere { margin-top: var(--section); }
  .elsewhere h2 { font-size: var(--step-3); font-weight: 380; margin-bottom: 1rem; }

  /* A tip's own page */
  .tip-page__grid { margin-top: 0.5rem; display: grid; gap: 2.5rem 4rem; grid-template-columns: minmax(0, 1fr); align-items: start; }
  @media (min-width: 64rem) { .tip-page__grid { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); } }
  .tip--page { border-radius: clamp(1.5rem, 1rem + 1.5vw, 2.25rem); background: var(--paper-raised); border: 1px solid var(--rule-soft); overflow: hidden; container-type: inline-size; }
  .tip__head { position: relative; padding: clamp(1.375rem, 1rem + 2vw, 2.75rem); padding-right: clamp(5rem, 22cqi, 11rem); background: radial-gradient(70% 120% at 100% 0%, var(--f-glow), transparent 68%), var(--f-bg); color: var(--f-ink); }
  .tip__for { font-size: 0.9375rem; font-weight: 500; }
  .tip__head .tip__title { margin-top: 0.625rem; }
  .tip__head .tip__time { margin-top: 1rem; }
  .tip__mark { position: absolute; right: clamp(0.75rem, 4cqi, 2rem); top: clamp(0.75rem, 4cqi, 2rem); width: clamp(3.5rem, 16cqi, 7.5rem); color: var(--f-mid); opacity: 0.7; }
  .tip__mark .mark { width: 100%; height: auto; stroke-width: 1.1; }
  .tip__body { padding: clamp(1.375rem, 1rem + 2vw, 2.75rem); padding-top: 0.5rem; }
  .tip--page .tip__steps li { font-size: var(--step-1); }
  .tip--page .issue__safety { margin-top: 1.25rem; }

  /* All tips */
  .doc--head { padding-bottom: clamp(1.5rem, 1rem + 2vw, 3rem); }
  .alltips { display: grid; gap: 0.75rem; }
  .alltips__band { padding: clamp(1.25rem, 1rem + 1.6vw, 2.25rem); border-radius: clamp(1.375rem, 1rem + 1vw, 2rem); background: var(--f-wash); display: grid; gap: 1rem 3rem; }
  .alltips__word a { font-style: italic; font-size: var(--step-4); font-weight: 330; color: var(--f-deep); text-decoration: none; letter-spacing: -0.024em; font-variation-settings: "SOFT" 100, "WONK" 0; }
  .alltips__word a:hover { text-decoration: underline; text-decoration-thickness: 1px; }
  .alltips__cols { display: grid; gap: 1.25rem 2rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); }
  .alltips__cols h3 { font-family: var(--sans); font-size: 0.875rem; font-weight: 600; margin-bottom: 0.25rem; font-variation-settings: normal; }
  .alltips__cols a { display: inline-block; padding-block: 0.375rem; color: var(--ink); text-decoration-color: color-mix(in srgb, var(--ink) 30%, transparent); }
  @media (min-width: 60rem) { .alltips__band { grid-template-columns: minmax(0, 16rem) minmax(0, 1fr); } }
}
@keyframes draw { from { stroke-dashoffset: 130; } to { stroke-dashoffset: 0; } }

/* ---------- Utilities ---------- */
@layer utilities {
  .visually-hidden {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0);
    white-space: nowrap; border: 0;
  }
  .mt-2 { margin-top: 2rem; }
}

/* ---------- Page transitions (Chrome and Safari 18.2+; others simply navigate) ---------- */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 0.32s; animation-timing-function: var(--ease-out); }
::view-transition-group(*) { animation-duration: 0.42s; animation-timing-function: var(--ease-out); }
.vt-worried { view-transition-name: f-worried; }
.vt-panicky { view-transition-name: f-panicky; }
.vt-overwhelmed { view-transition-name: f-overwhelmed; }
.vt-low { view-transition-name: f-low; }
.vt-angry { view-transition-name: f-angry; }
.vt-cant-sleep { view-transition-name: f-cant-sleep; }
.vt-lonely { view-transition-name: f-lonely; }
.vt-grieving { view-transition-name: f-grieving; }
.vt-under-pressure { view-transition-name: f-under-pressure; }
.vt-left-out { view-transition-name: f-left-out; }
.vt-not-good-enough { view-transition-name: f-not-good-enough; }
.vt-unsettled { view-transition-name: f-unsettled; }
.vt-dreading-school { view-transition-name: f-dreading-school; }
.vt-stuck-online { view-transition-name: f-stuck-online; }

.vtb-worried { view-transition-name: fb-worried; }
.vtb-panicky { view-transition-name: fb-panicky; }
.vtb-overwhelmed { view-transition-name: fb-overwhelmed; }
.vtb-low { view-transition-name: fb-low; }
.vtb-angry { view-transition-name: fb-angry; }
.vtb-cant-sleep { view-transition-name: fb-cant-sleep; }
.vtb-lonely { view-transition-name: fb-lonely; }
.vtb-grieving { view-transition-name: fb-grieving; }
.vtb-under-pressure { view-transition-name: fb-under-pressure; }
.vtb-left-out { view-transition-name: fb-left-out; }
.vtb-not-good-enough { view-transition-name: fb-not-good-enough; }
.vtb-unsettled { view-transition-name: fb-unsettled; }
.vtb-dreading-school { view-transition-name: fb-dreading-school; }
.vtb-stuck-online { view-transition-name: fb-stuck-online; }

/* Dialog entry (progressive: browsers without @starting-style just appear) */
.sheet[open] { animation: sheet-in 0.36s var(--ease-out); }
@keyframes sheet-in { from { transform: translateY(1.5rem); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: none; } }
/* The one thing on the home page that moves by itself: a slow breath, four seconds in and six out */
@keyframes breathe { 0% { transform: scale(0.62); } 40% { transform: scale(1); } 100% { transform: scale(0.62); } }
@keyframes rise { from { opacity: 0; transform: translateY(0.5rem); } to { opacity: 1; transform: none; } }

/* ---------- Respect people who prefer less motion ---------- */
@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* ---------- When script is off ----------
   The age choices and the search need script. Without it they are left out rather than
   shown as controls that do nothing; the feelings are plain links and every tip is on its
   page, so nothing is lost. */
@media (scripting: none) {
  .hero__who, .search, .filter { display: none; }
}

/* ---------- High contrast modes ---------- */
@media (forced-colors: active) {
  .who__option:has(input:checked) { forced-color-adjust: none; background: Highlight; }
  .who__option:has(input:checked) .who__name, .who__option:has(input:checked) .who__range { forced-color-adjust: none; color: HighlightText; }
  .tip, .tile, .tipcard, .fhero, .roomtile, .now, .pause__card, .chip, .panel-invert, .sheet, .notice, .toast, .pacer__orb { border: 1px solid CanvasText; }
}

/* ---------- Print: a tip prints as a clean card ---------- */
@media print {
  @page { margin: 16mm; }
  :root { --ground: #fff; --paper-raised: #fff; --ink: #000; --ink-soft: #333; --rule: #bbb; --rule-soft: #ddd; }
  body { font-size: 12pt; }
  .site-header, .site-footer, .tabbar, .filter, .tip__actions, .btn, .elsewhere, .skip, dialog { display: none !important; }
  a { color: #000; text-decoration: none; }
  .print-url { display: block !important; margin-top: 1rem; font-size: 10pt; color: #333; }
}
.print-url { display: none; }
