/* Tag Table launch site. Tokens match the app's own so the page and the embedded app feel like one thing. */

:root {
  color-scheme: light dark;
  --paper: #f7f1e6;
  --surface: #fffdf8;
  --sunken: #efe6d6;
  --ink: #2a2118;
  --ink-muted: #6b5d4e;
  --rule: #c4b29a;
  --kraft: #c9a375;
  --kraft-ink: #3b2a17;
  --accent: #2b4c7e;
  --accent-strong: #1f3a63;
  --on-accent: #ffffff;
  --focus: #d9480f;
  --string: #8a6a45;

  --tag-ink: #000000;
  --tag-blue: #7fb8e8;
  --tag-green: #8fd19e;
  --tag-yellow: #f6d55c;
  --tag-orange: #f4a261;
  --tag-pink: #f2a2c8;
  --week-colour: var(--tag-yellow);

  --lift: 0 1px 2px rgb(42 33 24 / 0.08), 0 10px 28px rgb(42 33 24 / 0.12);
  --grain: 0.04;

  --display: "Zilla Slab", Rockwell, "Roboto Slab", Georgia, serif;
  --body: "Atkinson Hyperlegible Next", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;

  --gutter: 2rem;
  --dash-h: repeating-linear-gradient(90deg, var(--rule) 0 8px, transparent 8px 14px);
  --dash-v: repeating-linear-gradient(180deg, var(--rule) 0 8px, transparent 8px 14px);
  --swing-ease: cubic-bezier(0.3, 1.4, 0.5, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #1c1813;
    --surface: #26201a;
    --sunken: #16120e;
    --ink: #f3eadb;
    --ink-muted: #bfb09a;
    --rule: #5a4d3e;
    --kraft: #a88458;
    --kraft-ink: #1c140a;
    --accent: #9db8e8;
    --accent-strong: #b8ccf0;
    --on-accent: #14213a;
    --focus: #ffa94d;
    --string: #c9a375;
    --lift: 0 1px 2px rgb(0 0 0 / 0.45), 0 10px 28px rgb(0 0 0 / 0.4);
    --grain: 0.06;
  }
}

@media (max-width: 40rem) {
  :root {
    --gutter: 1.25rem;
  }
}

/* ---------- Base ---------- */

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background-color: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}

/* Paper grain: one feTurbulence noise over the whole page. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  opacity: var(--grain);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

h1,
h2,
h3 {
  font-family: var(--display);
  line-height: 1.08;
  margin: 0;
  text-wrap: balance;
}

h2 {
  font-size: clamp(1.875rem, 4vw, 3rem);
  font-weight: 700;
  margin-block: 0.5rem 1.25rem;
  max-width: 22ch;
}

@media (min-width: 75rem) {
  h2 {
    letter-spacing: -0.02em;
  }
}

h3 {
  font-size: 1.3rem;
  font-weight: 600;
}

p {
  margin: 0 0 1rem;
  max-width: 38rem;
}

a {
  color: var(--accent);
}

a:focus-visible,
button:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.wrap {
  width: min(72rem, 100% - 2 * var(--gutter));
  margin-inline: auto;
}

.stamp {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin: 0;
}

.muted {
  color: var(--ink-muted);
}

/* Bands alternate and meet along a dashed cut line. */
.band {
  position: relative;
  padding-block: clamp(4rem, 9vw, 7rem);
}

.band + .band::before,
.silence + .band::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 2px;
  background: var(--dash-h);
}

.band-paper {
  background-color: var(--paper);
}

.band-sunken {
  background-color: var(--sunken);
}

/* ---------- Buttons and links ---------- */

.btn,
.text-link {
  -webkit-tap-highlight-color: transparent;
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease,
    background-color 0.15s ease;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 44px;
  min-width: 44px;
  padding: 0.5rem 1.25rem;
  border: 2px solid transparent;
  border-radius: 10px;
  font: 700 1rem/1.2 var(--body);
  text-decoration: none;
  cursor: pointer;
}

.btn-lg {
  min-height: 52px;
  padding-inline: 1.5rem;
  font-size: 1.0625rem;
}

.btn-primary {
  background-color: var(--accent);
  color: var(--on-accent);
  box-shadow: var(--lift);
}

.btn-primary:hover {
  background-color: var(--accent-strong);
}

.btn-ghost {
  background-color: transparent;
  border-color: var(--ink);
  color: var(--ink);
}

.btn-ghost:hover {
  background-color: color-mix(in srgb, var(--ink) 8%, transparent);
}

.btn-kraft {
  background-color: var(--kraft-ink);
  /* The light --surface in both themes: the dark --surface would vanish on the dark --kraft-ink. */
  color: #fffdf8;
}

.btn-kraft:hover {
  background-color: color-mix(in srgb, var(--kraft-ink) 85%, var(--surface));
}

.btn:active,
.text-link:active {
  transform: translateY(1px);
}

.text-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  min-width: 44px;
  padding-inline: 0.25rem;
  font-weight: 700;
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
  border-radius: 6px;
}

.text-link:hover {
  background-color: color-mix(in srgb, var(--accent) 10%, transparent);
}

.skip {
  position: absolute;
  left: 1rem;
  top: 1rem;
  z-index: 100;
  padding: 0.75rem 1rem;
  min-height: 44px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 700;
  border-radius: 8px;
  box-shadow: var(--lift);
  transform: translateY(-200%);
}

.skip:focus {
  transform: none;
}

/* ---------- Header ---------- */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  color: var(--ink);
  text-decoration: none;
  border-radius: 8px;
}

.logo {
  width: 32px;
  height: 32px;
  flex: none;
  transform-origin: 50.7% 39.7%;
}

.logo-sm {
  width: 24px;
  height: 24px;
}

.wordmark {
  font: 700 1.375rem/1 var(--display);
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

@media (max-width: 40rem) {
  .header-see {
    display: none;
  }
}

/* ---------- Hero ---------- */

.hero {
  overflow: clip;
  padding-block: 1rem 4rem;
}

.hero-grid {
  display: grid;
  gap: 2.5rem;
  align-items: center;
}

@media (min-width: 60rem) {
  .hero-grid {
    grid-template-columns: 7fr 5fr;
    min-height: min(88vh, 54rem);
  }
}

h1 {
  font-size: clamp(2.5rem, 6.5vw, 5.25rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-block: 0.75rem 1.25rem;
}

.rise {
  display: block;
}

.lede {
  font-size: 1.125rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-block: 1.75rem 1.25rem;
}

.week-stamp {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--ink);
  margin-bottom: 0.5rem;
}

.week-stamp[hidden] {
  display: none;
}

.swatch {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  background: var(--week-colour);
  border: 1px solid var(--tag-ink);
}

.reassure {
  font-size: 0.9375rem;
  color: var(--ink-muted);
}

.hero-art {
  position: relative;
  height: 26rem;
  font-size: 16px;
}

@media (max-width: 59.99rem) {
  .hero-art {
    height: 18rem;
    font-size: 12px;
    width: min(100%, 26rem);
    margin-inline: auto;
  }
}

.plane {
  position: absolute;
  inset: 0;
  translate: calc(var(--px, 0) * var(--depth)) calc(var(--py, 0) * var(--depth));
}

.plane-back {
  --depth: 6px;
}

.plane-tags {
  --depth: 12px;
}

.plane-front {
  --depth: 18px;
}

.back-sheet {
  position: absolute;
  top: -6%;
  right: -22%;
  width: 88%;
  height: 100%;
  rotate: -3deg;
  background-color: color-mix(in srgb, var(--surface) 70%, transparent);
  border: 1px solid color-mix(in srgb, var(--rule) 50%, transparent);
  --d50: color-mix(in srgb, var(--rule) 50%, transparent);
  background-image:
    repeating-linear-gradient(180deg, var(--d50) 0 8px, transparent 8px 14px),
    repeating-linear-gradient(180deg, var(--d50) 0 8px, transparent 8px 14px),
    repeating-linear-gradient(90deg, var(--d50) 0 8px, transparent 8px 14px),
    repeating-linear-gradient(90deg, var(--d50) 0 8px, transparent 8px 14px),
    repeating-linear-gradient(90deg, var(--d50) 0 8px, transparent 8px 14px);
  background-size:
    2px 100%,
    2px 100%,
    100% 2px,
    100% 2px,
    100% 2px;
  background-position:
    33.33% 0,
    66.66% 0,
    0 25%,
    0 50%,
    0 75%;
  background-repeat: no-repeat;
}

.wall-string {
  position: absolute;
  top: 1.2em;
  left: -10%;
  width: 120%;
  height: 3em;
  overflow: visible;
}

.wall-string path {
  fill: none;
  stroke: var(--string);
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
}

.htag {
  position: absolute;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  padding: 2.6em 0.8em 0;
  color: var(--ink);
  filter: drop-shadow(0 1px 1px rgb(42 33 24 / 0.12)) drop-shadow(0 8px 14px rgb(42 33 24 / 0.16));
  transform-origin: 50% 1.4em;
  rotate: var(--rest);
}

.htag::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--surface);
  clip-path: polygon(0 17%, 19% 0, 81% 0, 100% 17%, 100% 100%, 0 100%);
}

.htag-outline {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
}

.htag-outline polygon {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.5;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.htag-hole {
  position: absolute;
  top: 1em;
  left: 50%;
  width: 0.85em;
  height: 0.85em;
  translate: -50% 0;
  border-radius: 50%;
  background: var(--paper);
  border: 1.5px solid var(--ink);
  z-index: 3;
}

.htag-hole::before {
  content: "";
  position: absolute;
  bottom: 50%;
  left: 50%;
  width: 1.5px;
  height: 3.6em;
  translate: -50% 0;
  background: var(--string);
}

.htag-price {
  font: 700 clamp(2.75rem, 6vw, 4.5rem) / 1 var(--display);
  letter-spacing: -0.02em;
}

.htag-cat {
  font-weight: 700;
  font-size: 1em;
  line-height: 1.25;
  margin-top: 0.3em;
}

.htag-cond {
  font-size: 0.95em;
  color: var(--ink-muted);
}

.htag-band {
  margin: auto -0.8em 0;
  padding: 0.5em 0.7em;
  display: flex;
  align-items: center;
  gap: 0.35em;
  flex-wrap: wrap;
  background: var(--week-colour);
  color: var(--tag-ink);
  font-size: 0.8em;
  font-weight: 700;
  line-height: 1.2;
}

.htag-band b {
  font-family: var(--display);
  font-size: 1.3em;
}

.htag-back {
  left: 2%;
  top: 4.4em;
  width: 8.5em;
  height: 11em;
}

.htag-back .htag-price {
  font-size: calc(clamp(2.75rem, 6vw, 4.5rem) * 0.62);
}

.htag-mid {
  left: 25%;
  top: 4.9em;
  width: 10em;
  height: 12.5em;
}

.htag-mid .htag-price {
  font-size: calc(clamp(2.75rem, 6vw, 4.5rem) * 0.78);
}

.htag-front {
  left: 50%;
  top: 4.6em;
  width: 11.5em;
  height: 15em;
}

.hero-scissors {
  position: absolute;
  left: 38%;
  top: 17.6em;
  width: 3.5em;
  height: 3.5em;
  color: var(--ink);
  rotate: -20deg;
}

/* ---------- How it works ---------- */

.steps {
  list-style: none;
  margin: 2.5rem 0 0;
  padding: 0;
  display: grid;
  gap: 2rem;
  position: relative;
}

.steps::before {
  content: "";
  position: absolute;
  background: var(--dash-h);
  height: 2px;
  top: 0.55rem;
  left: 0;
  right: 0;
}

@media (min-width: 52rem) {
  .steps {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 51.99rem) {
  .steps {
    padding-left: 2rem;
  }

  .steps::before {
    background: var(--dash-v);
    width: 2px;
    height: auto;
    top: 0;
    bottom: 0;
    left: 0.4rem;
    right: auto;
  }
}

.step-num {
  display: inline-block;
  position: relative;
  padding: 0.1rem 0.5rem;
  background: var(--sunken);
  border: 1.5px solid var(--ink-muted);
  border-radius: 4px;
  rotate: -2deg;
}

.step-art {
  margin-block: 1rem;
  min-height: 8.5rem;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 12px;
  box-shadow: var(--lift);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 0.6rem;
}

.step h3 {
  margin-bottom: 0.35rem;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.chip {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border: 1.5px solid var(--rule);
  border-radius: 999px;
  background: var(--surface);
  font-size: 0.9375rem;
  line-height: 1.4;
}

.chip.is-on {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, var(--surface));
  font-weight: 700;
}

.chip-ghost {
  border-style: dashed;
  color: var(--ink-muted);
}

.sum {
  font: 600 1.5rem/1.2 var(--display);
  margin: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.price-field {
  display: inline-block;
  min-width: 4.4ch;
  padding: 0.2rem 0.6rem;
  background: #ffffff;
  color: #000000;
  border: 1.5px solid var(--ink);
  border-radius: 8px;
  font-variant-numeric: tabular-nums;
}

.mini-sheet {
  display: grid;
  grid-template-columns: repeat(3, 2.6rem);
  gap: 0.25rem;
  padding: 0.35rem;
  background: var(--paper);
  border: 1px dashed var(--rule);
}

.mini-sheet i {
  display: block;
  height: 1.3rem;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-bottom: 0.4rem solid var(--week-colour);
}

/* ---------- The sheet (the peak) ---------- */

.sheet-sec {
  --p: 1;
  /* clip, not hidden: lifted tags never widen the page and sticky pinning still works. */
  overflow-x: clip;
}

.sheet-grid {
  display: grid;
  gap: 2.5rem;
  align-items: center;
}

@media (min-width: 60rem) {
  .sheet-grid {
    grid-template-columns: 2fr 3fr;
  }
}

.facts {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
}

.facts li {
  color: var(--ink);
  padding: 0.2rem 0.5rem;
  border: 1.5px solid currentColor;
  border-radius: 4px;
}

.js .sheet-sec .facts li {
  color: var(--ink-muted);
  transition: background-color 0.2s ease;
}

.js .sheet-sec[data-stage="print"] [data-for="print"],
.js .sheet-sec[data-stage="cut"] [data-for="cut"],
.js .sheet-sec[data-stage="lift"] [data-for="lift"] {
  color: var(--ink);
  font-weight: 700;
  background-color: color-mix(in srgb, var(--week-colour) 35%, transparent);
}

.sheet-stage {
  display: flex;
  justify-content: center;
}

.sheet {
  container-type: inline-size;
  position: relative;
  width: min(100%, 34rem);
  aspect-ratio: 7.5 / 10;
  background: var(--surface);
  box-shadow: var(--lift);
  rotate: -1.5deg;
  --h: clamp(0, calc((var(--p) - 0.55) * 10), 1);
  --v: clamp(0, calc((var(--p) - 0.65) * 10), 1);
  --l: clamp(0, calc((var(--p) - 0.75) * 4), 1);
}

.sheet-tags {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(8, 1fr);
}

.stag {
  --row: clamp(0, calc(var(--p) * 14.5455 - var(--r) + 1), 1);
  position: relative;
  margin: 1.1cqw;
  padding: 0.9cqw 1.5cqw 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--surface);
  color: var(--ink);
  opacity: var(--row);
  translate: 0 calc((1 - var(--row)) * -4px);
}

.stag-price {
  font: 700 5.4cqw/1 var(--display);
  letter-spacing: -0.02em;
}

.stag-cat {
  font-weight: 700;
  font-size: 2.3cqw;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stag-cond {
  font-size: 2.1cqw;
  line-height: 1.2;
  color: var(--ink-muted);
}

.stag-band {
  margin: auto -1.5cqw 0;
  padding: 0.35cqw 1.3cqw;
  display: flex;
  gap: 0.8cqw;
  align-items: baseline;
  background: var(--week-colour);
  color: var(--tag-ink);
  font-size: 2cqw;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
}

.stag-wk {
  margin-left: auto;
}

@container (max-width: 30rem) {
  .stag-cat,
  .stag-cond,
  .stag-name,
  .stag-wk {
    display: none;
  }

  .stag-price {
    font-size: 7.5cqw;
    margin-top: 1cqw;
  }

  .stag-band {
    font-size: 3.6cqw;
  }
}

.well {
  position: relative;
  display: grid;
}

.well::before {
  content: "";
  position: absolute;
  inset: 1.1cqw;
  background: var(--sunken);
  box-shadow: inset 0 1px 4px rgb(0 0 0 / 0.18);
  opacity: var(--l);
}

.stag.lift {
  --lk: 1;
  z-index: 3;
  translate: calc(var(--l) * var(--lk) * var(--lx)) calc(var(--l) * var(--lk) * var(--ly) + (1 - var(--row)) * -4px);
  rotate: calc(var(--l) * var(--lr));
  box-shadow: 0 calc(var(--l) * 14px) calc(var(--l) * 30px) rgb(42 33 24 / calc(var(--l) * 0.35));
}

/* After the rule above so it wins: keep every lifted tag inside the page gutter at 390 px. */
@container (max-width: 30rem) {
  .stag.lift {
    --lk: 0.45;
  }
}

.print-head {
  position: absolute;
  left: -2%;
  right: -2%;
  height: 4px;
  top: calc((1 + min(1, var(--p) / 0.55) * 7) * 12.5%);
  background: color-mix(in srgb, var(--ink) 30%, transparent);
  box-shadow: 0 0 14px 3px color-mix(in srgb, var(--week-colour) 60%, transparent);
  border-radius: 2px;
  opacity: calc(1 - clamp(0, calc((var(--p) - 0.5) * 20), 1));
  z-index: 4;
}

.cuts {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.cut-h,
.cut-v {
  position: absolute;
  display: block;
}

.cut-h {
  left: 0;
  right: 0;
  height: 2px;
  margin-top: -1px;
  top: calc(var(--k) * 12.5%);
  background: var(--dash-h);
  clip-path: inset(0 calc(100% - var(--h) * 100%) 0 0);
}

.cut-v {
  top: 0;
  bottom: 0;
  width: 2px;
  margin-left: -1px;
  left: calc(var(--k) * 33.3333%);
  background: var(--dash-v);
  clip-path: inset(0 0 calc(100% - var(--v) * 100%) 0);
}

.cut-scissors {
  position: absolute;
  top: -15px;
  left: 0;
  width: 30px;
  height: 30px;
  color: var(--ink);
  translate: calc(var(--h) * 100cqw - 15px) 0;
  opacity: calc(clamp(0, calc((var(--p) - 0.55) * 40), 1) - clamp(0, calc((var(--p) - 0.75) * 20), 1));
}

.cut-scissors svg {
  width: 100%;
  height: 100%;
}

/* Desktop with room: pin the sheet and let the scroll print it. */
@media (min-width: 60rem) and (min-height: 641px) and (prefers-reduced-motion: no-preference) {
  .js .sheet-sec {
    height: 260vh;
    padding-block: 0;
  }

  .js .sheet-pin {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    align-items: center;
  }

  .js .sheet {
    height: min(80vh, 44rem);
    width: auto;
  }
}

/* The authored silence: a breath after the peak. */
.silence {
  position: relative;
  height: 12vh;
  min-height: 4rem;
  display: grid;
  place-items: center;
  background: var(--paper);
}

.silence-line {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(24rem, 60%);
  height: 2px;
  translate: -50% -50%;
  background: var(--dash-h);
}

.silence-scissors {
  position: relative;
  width: 20px;
  height: 20px;
  color: var(--ink-muted);
  background: var(--paper);
}

/* ---------- Rotation ---------- */

.week-controls {
  display: none;
  align-items: center;
  gap: 0.75rem;
  margin-block: 2rem 1.25rem;
  flex-wrap: wrap;
}

.js .week-controls {
  display: flex;
}

.week-label {
  min-width: 10ch;
  text-align: center;
  color: var(--ink);
  font-size: 0.875rem;
}

.board {
  list-style: none;
  margin: 2rem 0 1.25rem;
  padding: 0.75rem 0.25rem;
  display: grid;
  gap: 1rem;
  border-radius: 14px;
}

.js .week-controls + .board {
  margin-top: 0;
}

@media (min-width: 52rem) {
  .board {
    grid-template-columns: repeat(5, 1fr);
    align-items: end;
  }
}

.board.is-swapping {
  animation: board-in 200ms ease-out;
}

.card {
  position: relative;
  display: grid;
  gap: 0.15rem;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 12px;
}

.card-letter {
  display: grid;
  place-items: center;
  width: 3.5rem;
  height: 3.5rem;
  margin-bottom: 0.5rem;
  background: var(--c);
  color: var(--tag-ink);
  border-radius: 8px;
  font: 700 2.5rem/1 var(--display);
}

.card-name {
  font-weight: 700;
}

.card-age {
  color: var(--ink-muted);
  font-size: 0.9375rem;
}

.card-off {
  font: 600 1.375rem/1.2 var(--display);
}

.card.is-current {
  scale: 1.08;
  z-index: 1;
  box-shadow: var(--lift);
  border-color: var(--ink);
}

.card-stamp {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  padding: 0.1rem 0.4rem;
  color: var(--ink);
  border: 1.5px solid var(--ink);
  border-radius: 4px;
  rotate: 4deg;
}

@media (max-width: 51.99rem) {
  .board {
    padding-inline: 4%;
  }

  .card {
    grid-template-columns: auto 1fr;
    column-gap: 1rem;
  }

  .card-letter {
    grid-row: span 3;
    margin: 0;
  }
}

.note {
  color: var(--ink-muted);
}

/* ---------- Features ---------- */

.features {
  list-style: none;
  margin: 2.5rem 0 0;
  padding: 0;
  display: grid;
  column-gap: 3.5rem;
}

@media (min-width: 52rem) {
  .features {
    grid-template-columns: 1fr 1fr;
  }
}

.features li {
  display: flex;
  gap: 0.9rem;
  padding-block: 1.4rem;
  background: var(--dash-h) top left / 100% 1px no-repeat;
}

.features h3 {
  font-family: var(--body);
  font-size: 1.0625rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.features p {
  margin: 0;
}

.bullet {
  flex: none;
  width: 20px;
  height: 20px;
  margin-top: 0.15rem;
}

/* ---------- The real app ---------- */

.phone-note {
  display: none;
}

.app-frame {
  position: relative;
  margin-top: 2rem;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-top: 10px solid var(--kraft);
  border-radius: 14px;
  box-shadow: var(--lift);
}

.frame-stamp {
  position: absolute;
  top: -10px;
  right: 1rem;
  padding: 0.15rem 0.5rem;
  background: var(--kraft);
  color: var(--kraft-ink);
  border-radius: 0 0 6px 6px;
  line-height: 1.3;
}

.app-frame iframe {
  display: block;
  width: 100%;
  height: 760px;
  border: 0;
  border-radius: 0 0 13px 13px;
  background: var(--paper);
}

.full-link {
  margin-top: 1rem;
}

@media (max-width: 40rem) {
  .phone-note {
    display: block;
    margin-top: 1rem;
    color: var(--ink-muted);
  }

  .app-frame iframe {
    height: 640px;
  }
}

/* ---------- FAQ ---------- */

.faq {
  margin-top: 1.5rem;
  max-width: 46rem;
}

.faq details {
  background: var(--dash-h) bottom left / 100% 1px no-repeat;
}

.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 44px;
  padding-block: 1rem;
  font: 600 1.25rem/1.3 var(--display);
  cursor: pointer;
  list-style: none;
  border-radius: 6px;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "+";
  flex: none;
  font: 600 1.75rem/1 var(--display);
  color: var(--ink-muted);
  transition: transform 0.25s ease;
}

.faq details[open] summary::after {
  transform: rotate(45deg);
}

.faq details p {
  padding-bottom: 1rem;
}

/* ---------- Close ---------- */

.close {
  overflow: clip;
  padding-top: 0;
}

.close-wrap {
  display: flex;
  justify-content: center;
  padding-top: 6rem;
}

.close-tag {
  position: relative;
  isolation: isolate;
  width: min(22rem, 100%);
  padding: 4.5rem 2rem 2.25rem;
  text-align: center;
  color: var(--kraft-ink);
  filter: drop-shadow(0 1px 2px rgb(42 33 24 / 0.15)) drop-shadow(0 12px 24px rgb(42 33 24 / 0.2));
  transform-origin: 50% 2.4rem;
  transition: rotate 0.4s ease;
}

.close-tag::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--kraft);
  clip-path: polygon(0 13%, 18% 0, 82% 0, 100% 13%, 100% 100%, 0 100%);
}

.close-tag .stamp {
  color: var(--kraft-ink);
}

.close-tag h2 {
  margin: 0.75rem auto 1.5rem;
  font-size: clamp(1.75rem, 3.4vw, 2.25rem);
  letter-spacing: -0.01em;
}

.close-hole {
  position: absolute;
  top: 2rem;
  left: 50%;
  width: 1rem;
  height: 1rem;
  translate: -50% 0;
  border-radius: 50%;
  background: var(--sunken);
  border: 2px solid var(--kraft-ink);
}

.close-string {
  position: absolute;
  bottom: calc(100% - 2.5rem);
  left: 50%;
  width: 2px;
  height: 14rem;
  translate: -50% 0;
  background: var(--string);
}

.close-small {
  margin: 1rem auto 0;
  font-size: 0.9375rem;
}

.close-tag:has(.btn:hover, .btn:focus-visible) {
  rotate: -1deg;
}

/* ---------- Footer ---------- */

.site-footer {
  position: relative;
  padding-block: 2rem;
  background: var(--paper);
}

.site-footer::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 2px;
  background: var(--dash-h);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 2rem;
}

.footer-inner p {
  margin: 0;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
}

.footer-nav {
  display: flex;
  gap: 1rem;
}

/* ---------- Phones: no text under 15 px ---------- */

@media (max-width: 40rem) {
  .stamp,
  .week-label {
    font-size: 0.9375rem;
    letter-spacing: 0.04em;
  }

  .site-header .btn {
    padding-inline: 0.9rem;
  }

  /* Label centred on its own row, the two buttons side by side beneath it. */
  .js .week-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
  }

  .week-label {
    grid-column: 1 / -1;
    grid-row: 1;
    text-align: center;
  }

  .wordmark {
    font-size: 1.25rem;
  }

  .htag-band {
    font-size: 0.75rem;
  }
}

/* ---------- Motion (only when it is welcome) ---------- */

@media (prefers-reduced-motion: no-preference) {
  .brand:hover .logo {
    animation: logo-swing 600ms var(--swing-ease);
  }

  .rise {
    animation: rise 0.7s ease-out both;
    animation-delay: calc(var(--i) * 80ms + 100ms);
  }

  .htag {
    animation:
      tag-swing 1.4s var(--swing-ease) var(--d) both,
      tag-sway 7s ease-in-out calc(1.4s + var(--d) + var(--so, 0s)) infinite;
  }

  .htag-back {
    --so: 0.9s;
  }

  .htag-front {
    --so: 1.8s;
  }

  .js [data-reveal] {
    opacity: 0;
    translate: 0 16px;
    transition:
      opacity 0.5s ease-out,
      translate 0.5s ease-out;
    transition-delay: calc(var(--i) * 100ms);
  }

  .js .features [data-reveal] {
    translate: 0 12px;
    transition-delay: calc(var(--i) * 60ms);
  }

  .js [data-reveal].in {
    opacity: 1;
    translate: 0 0;
  }

  .close-tag.swing {
    animation: close-swing 2.4s ease-out;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .faq summary::after,
  .close-tag {
    transition: none;
  }

  .close-tag:has(.btn:hover, .btn:focus-visible) {
    rotate: none;
  }
}

@keyframes logo-swing {
  0%,
  100% {
    rotate: 0deg;
  }
  50% {
    rotate: 6deg;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    translate: 0 12px;
  }
  to {
    opacity: 1;
    translate: 0 0;
  }
}

@keyframes tag-swing {
  from {
    rotate: calc(var(--rest) + 5deg);
  }
  to {
    rotate: var(--rest);
  }
}

@keyframes tag-sway {
  0%,
  100% {
    rotate: var(--rest);
  }
  25% {
    rotate: calc(var(--rest) + 1.2deg);
  }
  75% {
    rotate: calc(var(--rest) - 1.2deg);
  }
}

@keyframes board-in {
  from {
    opacity: 0;
    translate: var(--slide, 8px) 0;
  }
  to {
    opacity: 1;
    translate: 0 0;
  }
}

@keyframes close-swing {
  0% {
    rotate: 0deg;
  }
  15% {
    rotate: 3deg;
  }
  35% {
    rotate: -2.2deg;
  }
  55% {
    rotate: 1.4deg;
  }
  75% {
    rotate: -0.6deg;
  }
  100% {
    rotate: 0deg;
  }
}
