/* Nthano Zathu: chitenje by day, fireside by night. One world, two lights. Mobile first. */

@font-face {
  font-family: "Titan One";
  src: url("/fonts/titan-one-latin.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Arial/Roboto Bold stretched to Titan One's width, so the swap does not reflow headings. */
@font-face {
  font-family: "Titan Fallback";
  src: local("Arial Bold"), local("Arial-BoldMT"), local("Roboto Bold"), local("Roboto-Bold");
  size-adjust: 113.5%;
}

/* ---------- Day: a bright cloth laid out in the sun ---------- */
:root {
  --sun: #f5c451;          /* sun gold: the ground of the cloth */
  --sun-light: #fbd57a;    /* gold thread on red */
  --red: #8a1606;          /* chitenje red, from the badge rim */
  --red-deep: #5e0e03;
  --indigo: #232a6e;
  --bark: #2a1407;         /* bark brown: ink, wood */
  --baobab: #24501d;

  --ground: var(--sun);
  --ink: var(--bark);
  --ink-soft: #5a2e10;
  --heading: var(--red);
  --link: var(--indigo);
  --accent: var(--red);            /* filled button */
  --accent-ink: var(--sun-light);
  --band: var(--red);              /* the story band under the picture */
  --band-ink: var(--sun-light);
  --band-deep: var(--red-deep);    /* ground behind a letterboxed picture */
  --invite: var(--baobab);
  --invite-ink: #fde6b0;
  --wood: var(--bark);             /* header and footer */
  --wood-ink: var(--sun-light);
  --field: #fde3a0;
  --error: #9b1405;
  --glow: rgba(255, 184, 84, 0.34);        /* by day: sun haze around the letterboxed picture */
  --firelight: rgba(255, 206, 110, 0.12);  /* by day: sunlight falling on the band */
  --pic-shadow: 0 14px 26px -8px rgba(38, 8, 0, 0.55);
  --pic-light: 0 0 transparent;             /* by night: firelight on the picture itself */
  --pic-light-fill: none;
  --check: url("/img/check.svg");
  --horizon-glow: rgba(255, 164, 58, 0.62); /* the sunset behind the baobabs */
  --grass-edge: url("/img/grass.svg");
  --embers: none;                           /* embers and fireflies only by night */
  --night-sky: none;
  /* Day sky over the ground: soft sun rays from the top right corner. */
  --sky: radial-gradient(ellipse 55% 60% at 88% 0, rgba(255, 243, 206, 0.6), transparent 70%),
    repeating-conic-gradient(from 196deg at 88% -60px, rgba(255, 244, 210, 0.38) 0deg 5deg, transparent 5deg 13deg);
  --sky-mask: radial-gradient(ellipse 85% 100% at 88% 0, #000 10%, transparent 72%);
  --band-accent: var(--sun);
  --band-accent-ink: var(--bark);
  --focus: var(--indigo);
  --strip: url("/img/chitenje.svg");
  --weave: url("/img/weave.svg") 0 0 / 8px 8px;     /* cloth: ground, band */
  --grain: url("/img/grain.svg") 0 0 / 240px 240px; /* wood: header, footer */
  --earth: url("/img/earth.svg") 0 0 / 160px 160px; /* earth: the invite field */
  --horizon: 112px;

  --radius: 999px;
  --radius-s: 14px;
  --tap: 48px;
  --display: "Titan One", "Titan Fallback", "Arial Black", sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  --gutter: 16px;
  --col: 60rem;      /* one column for header, band, invite, prose, inbox and footer */
  --inline: max(var(--gutter), calc((100% - var(--col)) / 2));
  --measure: 38rem;  /* about 65 characters of body text */

  color-scheme: light;
}

/* ---------- Night: the same cloth by the storytelling fire ---------- */
[data-theme="dark"] {
  --ground: #0e1330;
  --ink: #f4e2bf;
  --ink-soft: #d9bf93;
  --heading: #ffb24a;
  --link: #ffc27a;
  --accent: #ff8a3d;
  --accent-ink: #1c0a03;
  --band: #4a130a;
  --band-ink: #ffd08a;
  --band-deep: #120a14;
  --invite: #10261b;
  --invite-ink: #f1dcae;
  --wood: #080b1f;
  --wood-ink: #ffc56e;
  --field: #171d42;
  --error: #ff9a80;
  --glow: rgba(255, 128, 40, 0.55);
  --firelight: rgba(255, 128, 40, 0.3);
  --band-accent: #ffb24a;
  --band-accent-ink: #1c0a03;
  --focus: #ffd08a;
  --strip: url("/img/chitenje-night.svg");
  --pic-shadow: 0 18px 70px 4px rgba(255, 128, 40, 0.55);
  --pic-light: inset 0 -90px 70px -50px rgba(255, 118, 30, 0.55), inset 0 0 70px 6px rgba(255, 106, 24, 0.3), inset 0 0 0 2px rgba(255, 176, 96, 0.28);
  --pic-light-fill: radial-gradient(ellipse 85% 55% at 50% 108%, rgba(255, 140, 48, 0.3), transparent 72%);
  --check: url("/img/check-night.svg");
  --horizon-glow: rgba(255, 112, 32, 0.4);
  --grass-edge: url("/img/grass-night.svg");
  --embers: url("/img/embers.svg");
  --night-sky: url("/img/stars.svg");
  --sky: url("/img/stars.svg") 50% 0 / 400px 300px repeat-x;
  --sky-mask: linear-gradient(#000 16px, transparent 104px); /* ends above the first line of text */
  color-scheme: dark;
}

/* Night without the script: follow the phone. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #0e1330;
    --ink: #f4e2bf;
    --ink-soft: #d9bf93;
    --heading: #ffb24a;
    --link: #ffc27a;
    --accent: #ff8a3d;
    --accent-ink: #1c0a03;
    --band: #4a130a;
    --band-ink: #ffd08a;
    --band-deep: #120a14;
    --invite: #10261b;
    --invite-ink: #f1dcae;
    --wood: #080b1f;
    --wood-ink: #ffc56e;
    --field: #171d42;
    --error: #ff9a80;
    --glow: rgba(255, 128, 40, 0.55);
    --firelight: rgba(255, 128, 40, 0.3);
    --band-accent: #ffb24a;
    --band-accent-ink: #1c0a03;
    --focus: #ffd08a;
    --strip: url("/img/chitenje-night.svg");
    --pic-shadow: 0 18px 70px 4px rgba(255, 128, 40, 0.55);
    --pic-light: inset 0 -90px 70px -50px rgba(255, 118, 30, 0.55), inset 0 0 70px 6px rgba(255, 106, 24, 0.3), inset 0 0 0 2px rgba(255, 176, 96, 0.28);
    --pic-light-fill: radial-gradient(ellipse 85% 55% at 50% 108%, rgba(255, 140, 48, 0.3), transparent 72%);
    --check: url("/img/check-night.svg");
    --horizon-glow: rgba(255, 112, 32, 0.4);
    --grass-edge: url("/img/grass-night.svg");
    --embers: url("/img/embers.svg");
    --night-sky: url("/img/stars.svg");
    --sky: url("/img/stars.svg") 50% 0 / 400px 300px repeat-x;
    --sky-mask: linear-gradient(#000 16px, transparent 104px); /* ends above the first line of text */
    color-scheme: dark;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--wood);
  scrollbar-color: var(--heading) var(--ground);
}

body {
  margin: 0;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--weave), var(--ground);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--body);
  caret-color: var(--heading);
}

/* Dusk and dawn: the one authored moment. Colours ease when the sun/moon is tapped. */
body, .site-header, .band, .invite, .site-footer, .site-footer::after, .feature-picture {
  transition: background-color 0.6s cubic-bezier(0.16, 1, 0.3, 1), color 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

::selection { background: var(--heading); color: var(--ground); }

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

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: 0.005em;
  text-wrap: balance;
  margin: 0;
}

p { margin: 0; text-wrap: pretty; }

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

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

/* The main column is its own layer, so the sky can sit behind the page content. */
.site-main { flex: 1 0 auto; position: relative; isolation: isolate; }

/* The sky over the ground: sun rays by day, stars by night. Hidden under the picture on the home page. */
.site-main::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  z-index: -1;
  height: 460px;
  background: var(--sky);
  -webkit-mask: var(--sky-mask);
  mask: var(--sky-mask);
  pointer-events: none;
}

/* Every page ends on open ground, where the footer's baobab horizon rises. */
.site-main > :last-child { margin-bottom: 0; padding-bottom: var(--end, 48px); }

/* The chitenje strip: pattern tile from the badge border. */
.prose h2::before,
.lost::before {
  content: "";
  display: block;
  height: 28px;
  background: var(--strip) repeat-x left center / 32px 28px;
}

/* ---------- Header ---------- */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 60px;
  padding: 6px var(--inline);
  padding-top: max(6px, env(safe-area-inset-top));
  /* Carved wood by day; by night the same bar is a strip of starry sky. */
  position: relative;
  z-index: 2;
  background: var(--night-sky) -20px 0 / 400px 300px repeat-x, var(--grain), var(--wood);
  box-shadow: 0 4px 12px -2px rgba(12, 4, 0, 0.5);
  color: var(--wood-ink);
  --focus: var(--wood-ink);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: var(--tap);
  color: inherit;
  text-decoration: none;
}
.brand-badge { width: 40px; height: 40px; flex: none; }
.brand-name { font-family: var(--display); font-size: 1.3rem; line-height: 1; letter-spacing: 0.01em; }

.theme-toggle {
  display: grid;
  place-items: center;
  width: var(--tap);
  height: var(--tap);
  flex: none;
  padding: 0;
  border: 2px solid currentColor;
  border-radius: 50%;
  background: transparent;
  color: var(--wood-ink);
  cursor: pointer;
}
.theme-toggle[hidden] { display: none; }
.theme-toggle:hover { background: rgba(255, 213, 122, 0.14); }
.theme-toggle:focus-visible { border-radius: 50%; }

/* Sun by day: a disc with eight rays. */
.theme-icon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background:
    radial-gradient(circle, currentColor 0 33%, transparent 35% 47%, transparent 0),
    repeating-conic-gradient(from -11.25deg, currentColor 0 22.5deg, transparent 0 45deg);
  -webkit-mask: radial-gradient(circle, #000 0 70%, transparent 71%);
  mask: radial-gradient(circle, #000 0 70%, transparent 71%);
}
/* Moon by night: a crescent carved out of a disc. */
[data-theme="dark"] .theme-icon {
  width: 24px;
  height: 24px;
  background: radial-gradient(circle at 70% 32%, transparent 0 52%, currentColor 54%);
  -webkit-mask: none;
  mask: none;
}

/* ---------- Buttons ---------- */
.button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 52px;
  padding: 12px 24px;
  border: 3px solid currentColor;
  border-radius: var(--radius);
  background: transparent;
  color: var(--heading);
  font: 400 1.125rem/1.2 var(--display);
  letter-spacing: 0.01em;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.2s, color 0.2s;
}
.button:hover { background: color-mix(in srgb, currentColor 12%, transparent); }
.button:active { transform: scale(0.97); }

.button--primary {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 6px 16px -6px rgba(20, 6, 0, 0.55);
}
.button--primary:hover { background: color-mix(in srgb, var(--accent) 86%, #fff); }

.button:disabled, .button[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; transform: none; }

/* ---------- Feature (home) ---------- */
.feature { background: var(--band-deep); }

.feature-picture {
  --pic-h: max(240px, min(110vw, 60svh, calc(100svh - 350px)));
  position: relative;
  z-index: 1;
  display: block;
  /* At night the picture glows as if firelit; by day --glow is clear. */
  /* Seen beside a letterboxed picture: sun haze by day, firelight and stars by night. */
  background:
    radial-gradient(ellipse 62% 95% at 50% 62%, var(--glow), transparent 78%),
    var(--night-sky) 50% 0 / 400px 300px repeat,
    var(--weave),
    var(--band-deep);
}
.feature-picture img {
  width: 100%;
  /* Tall enough to carry the page, narrow enough that Kalulu and the sign both stay in frame. */
  /* On short phones it gives way so the heading and button stay in the first screen. */
  height: var(--pic-h);
  object-fit: cover;
  object-position: 54% 50%;
}
/* A layer exactly over the picture (letterboxed on wide screens): its drop shadow by day; by night the fire's
   light on the picture itself, warm from below and at the edges. The picture's pixels are untouched. */
.feature-picture::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: min(100%, calc(var(--pic-h) * 1.7768));
  transform: translateX(-50%);
  background: var(--pic-light-fill);
  box-shadow: var(--pic-shadow), var(--pic-light);
  pointer-events: none;
}

.band {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  /* The bottom padding is where the invite's grass grows over the cloth. */
  padding: 34px var(--inline) 60px;
  /* Pattern strip, then light falling from the picture onto the cloth: sun by day, fire by night. */
  background:
    var(--strip) 0 0 / 32px 28px repeat-x,
    radial-gradient(ellipse 90% 70% at 50% 0, var(--firelight), transparent 75%),
    var(--weave),
    var(--band);
  /* The cloth darkens into a fold where the field rises over it. */
  box-shadow: inset 0 -44px 40px -34px rgba(20, 4, 0, 0.45);
  color: var(--band-ink);
  --heading: var(--band-ink);
  --accent: var(--band-accent);
  --accent-ink: var(--band-accent-ink);
  --focus: var(--band-ink);
}
.band-title { font-size: clamp(1.7rem, 7.4vw, 2.75rem); }
.band-sub { font-size: 1.0625rem; line-height: 1.5; max-width: 38ch; }
.band .button { margin-top: 6px; }


/* ---------- Invite ---------- */
.invite {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 40px var(--inline) 48px;
  /* A field: earth grain, with warm light (sun or fire) spilling over the grass at the top. */
  background:
    radial-gradient(ellipse 80% 160px at 50% 0, var(--firelight), transparent 80%),
    var(--earth),
    var(--invite);
  color: var(--invite-ink);
  --heading: var(--invite-ink);
  --focus: var(--invite-ink);
}
/* The field rises over the band on a grass edge with white flowers; fireflies hover over it at night. */
.invite::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% - 2px);
  height: 50px;
  background:
    var(--embers) -120px -66px / 480px 120px repeat-x,
    var(--grass-edge) 0 100% / 300px 50px repeat-x;
  filter: drop-shadow(0 -5px 6px rgba(20, 6, 0, 0.35));
  pointer-events: none;
}
.invite h2 { font-size: clamp(1.6rem, 6.6vw, 2.4rem); color: var(--heading); }
.invite p { max-width: 52ch; }
.invite .button { margin-top: 8px; }

/* ---------- Prose (About, Privacy) ---------- */
.prose {
  padding: 36px var(--inline) 56px;
  --end: 56px;
}
.prose > * { max-width: var(--measure); }
.prose h1 { font-size: clamp(2rem, 8.6vw, 3.25rem); color: var(--heading); margin-bottom: 18px; }
.prose h2 { font-size: clamp(1.4rem, 5.6vw, 1.9rem); color: var(--heading); margin: 44px 0 12px; }
.prose h2::before { height: 20px; background-size: 23px 20px; margin-bottom: 26px; border-radius: 4px; }
.prose p + p { margin-top: 1em; }
.prose .lead { font-size: 1.25rem; line-height: 1.5; color: var(--ink-soft); }
.prose p:has(> .button) { margin-top: 32px; }

/* ---------- 404 ---------- */
.lost {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 0 var(--inline) 64px;
  --end: 64px;
}
.lost::before { max-width: 34rem; margin: 40px 0 12px; border-radius: 4px; }
.lost > * { max-width: 34rem; }
.lost h1 { font-size: clamp(2rem, 9vw, 3.25rem); color: var(--heading); }
.lost p { font-size: 1.1875rem; }
.lost .button { margin-top: 12px; }

/* ---------- Footer ---------- */
.site-footer {
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  padding: 42px var(--inline) max(28px, env(safe-area-inset-bottom));
  background: var(--strip) 0 0 / 32px 28px repeat-x, var(--grain), var(--wood);
  color: var(--wood-ink);
  --focus: var(--wood-ink);
}

/* The footer is the dark ground under a baobab horizon. The silhouette is a mask coloured by --wood,
   so one drawing serves day and night; its far hills are the wood colour at 30% over the sky. */
@supports (-webkit-mask-image: url("/img/horizon.svg")) or (mask-image: url("/img/horizon.svg")) {
  /* Room for the horizon, only where it is drawn: without masks the footer keeps its plain strip. */
  .site-main > :last-child { padding-bottom: calc(var(--end, 48px) + var(--horizon)); }
  .site-footer { padding-top: 22px; background: var(--grain), var(--wood); }
  .site-footer::before,
  .site-footer::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    pointer-events: none;
  }
  /* The light behind the trees: the setting sun by day, fire glow and embers by night. */
  .site-footer::before {
    bottom: 100%;
    height: calc(var(--horizon) * 1.5);
    background:
      var(--embers) 60px 30px / 640px 160px repeat-x,
      radial-gradient(ellipse 60% 70% at 76% 100%, var(--horizon-glow), transparent 72%);
  }
  .site-footer::after {
    bottom: calc(100% - 1px);
    height: var(--horizon);
    background: var(--grain), var(--wood);
    -webkit-mask: url("/img/horizon.svg") 0 100% / auto 100% repeat-x;
    mask: url("/img/horizon.svg") 0 100% / auto 100% repeat-x;
  }
}
.footer-links, .footer-channels { display: flex; flex-wrap: wrap; gap: 0 20px; }
.footer-links a, .footer-channels a {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  color: inherit;
  font-size: 1.0625rem;
  text-decoration-color: color-mix(in srgb, currentColor 45%, transparent);
}
.footer-channels:empty { display: none; }
.footer-channels a { font-weight: 600; }
.footer-note { margin-top: 10px; font-family: var(--display); font-size: 1rem; opacity: 0.85; }

/* ---------- Forms (Task 5 markup) ---------- */
.form { display: flex; flex-direction: column; gap: 22px; margin-top: 28px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-weight: 650; }
.field input, .field textarea, .field select {
  width: 100%;
  min-height: var(--tap);
  padding: 11px 14px;
  border: 2px solid var(--ink-soft);
  border-radius: var(--radius-s);
  background: var(--field);
  box-shadow: inset 0 2px 4px rgba(40, 10, 0, 0.16);
  color: var(--ink);
  font: inherit;
}
.field textarea { min-height: 14rem; resize: vertical; line-height: 1.55; }
.field input:focus-visible, .field textarea:focus-visible { border-color: var(--focus); outline-offset: 1px; border-radius: var(--radius-s); }
.field ::placeholder { color: var(--ink-soft); opacity: 1; }
.field--error input, .field--error textarea { border-color: var(--error); border-width: 3px; }
.field-error { color: var(--error); font-weight: 650; }
.field--check { gap: 2px; }

/* A checkbox drawn from the cloth: a pressed-in field-coloured box, filled red (amber by night) with a check.
   The whole label is the tap row; the box sits centred on the label's first line. */
.check {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  min-height: var(--tap);
  padding: 10px 0;
  font-weight: 400;
  line-height: 1.6;
  cursor: pointer;
}
.field .check { font-weight: 400; }
.check input,
.field .check input {
  -webkit-appearance: none;
  appearance: none;
  flex: none;
  width: 28px;
  height: 28px;
  min-height: 0;
  margin: calc((1.6em - 28px) / 2) 0 0;
  padding: 0;
  border: 3px solid var(--ink-soft);
  border-radius: 8px;
  background: var(--field);
  box-shadow: inset 0 2px 4px rgba(40, 10, 0, 0.16);
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s;
}
.check:hover input { border-color: var(--heading); }
.check input:checked,
.field .check input:checked { border-color: var(--heading); background: var(--check) center / 20px 20px no-repeat, var(--heading); }
.check input:focus-visible,
.field .check input:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 8px; }
.field--error .check input { border-color: var(--error); }
.hint { color: var(--ink-soft); font-size: 0.9375rem; }
.form-error {
  padding: 14px 18px;
  border-radius: var(--radius-s);
  background: var(--weave), var(--band);
  box-shadow: 0 8px 18px -10px rgba(30, 6, 0, 0.6);
  color: var(--band-ink);
  font-weight: 650;
}
.cf-turnstile { min-height: 65px; margin: 4px 0; }

/* ---------- Inbox (Task 6 markup) ---------- */
.inbox { padding: 28px var(--inline) 56px; --end: 56px; }
.inbox h1 { font-size: clamp(1.8rem, 7vw, 2.6rem); color: var(--heading); margin-bottom: 16px; }
.status-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 20px; padding: 0; list-style: none; }
.status-tabs a {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  padding: 0 18px;
  border: 2px solid currentColor;
  border-radius: var(--radius);
  color: var(--heading);
  font-family: var(--display);
  text-decoration: none;
}
.status-tabs a[aria-current="page"] { background: var(--heading); border-color: var(--heading); color: var(--ground); box-shadow: 0 5px 12px -6px rgba(30, 6, 0, 0.6); }
.inbox-list { margin: 0; padding: 0; list-style: none; }
.inbox-item { padding: 22px 0; border-top: 1px solid color-mix(in srgb, var(--ink) 30%, transparent); }
.inbox-item--new { padding: 22px 16px; border-radius: var(--radius-s); background: color-mix(in srgb, var(--heading) 12%, transparent); border-top-color: transparent; }
.inbox-link { display: block; min-height: var(--tap); color: var(--ink); text-decoration: none; }
.inbox-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; }
.inbox-name {
  font-family: var(--display);
  font-size: 1.25rem;
  line-height: 1.3;
  color: var(--heading);
  text-decoration: underline 2px color-mix(in srgb, currentColor 40%, transparent);
  text-underline-offset: 0.2em;
}
.inbox-link:hover .inbox-name { text-decoration-color: currentColor; }
.inbox-meta { color: var(--ink-soft); font-size: 0.9375rem; }
.inbox-preview { display: block; max-width: var(--measure); margin-top: 6px; }
.inbox-item--new + .inbox-item--new { margin-top: 10px; }
.inbox-item--new .inbox-name::after {
  content: "New";
  display: inline-block; /* keeps the name's underline off the pill */
  margin-left: 10px;
  padding: 2px 10px;
  border-radius: var(--radius);
  background: var(--heading);
  color: var(--ground);
  font: 400 0.8125rem/1.5 var(--display);
  vertical-align: middle;
}
.story-text { margin-top: 10px; max-width: 65ch; white-space: pre-wrap; overflow-wrap: anywhere; }
.inbox-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.inbox-actions .button { width: auto; }
/* Deleting is apart from the everyday actions: its own row, the confirm box above the button. */
.inbox-delete {
  display: flex;
  flex: 1 0 100%;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid color-mix(in srgb, var(--ink) 30%, transparent);
}

/* Back to the list: an authored arrow in the link's own colour. */
.back-link { display: inline-flex; align-items: center; gap: 8px; min-height: var(--tap); font-weight: 650; }
.back-link::before {
  content: "";
  flex: none;
  width: 20px;
  height: 20px;
  background: currentColor;
  -webkit-mask: url("/img/back.svg") center / contain no-repeat;
  mask: url("/img/back.svg") center / contain no-repeat;
}

/* ---------- Wider screens ---------- */
@media (min-width: 720px) {
  :root { --gutter: 32px; --horizon: 150px; }
  .button { width: auto; align-self: flex-start; }
  .prose p > .button { display: inline-flex; }
  .brand-name { font-size: 1.5rem; }

  /* The whole composition, letterboxed on the story cloth. */
  .feature-picture { --pic-h: min(56.3vw, 68svh); }
  .feature-picture img { object-fit: contain; object-position: 50% 50%; } /* centred, so the light layer sits on it */
  .band {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: end;
    column-gap: 40px;
    padding-top: 48px;
    padding-bottom: 72px;
  }
  .band-title, .band-sub { grid-column: 1; }
  .band-sub { max-width: 56ch; }
  .band .button { grid-column: 2; grid-row: 1 / span 2; align-self: end; margin: 0; }

  .invite { padding-block: 64px; --end: 64px; }
  .invite::before { height: 60px; background-size: 640px 160px, 360px 60px; }
}

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