/* Triple Paws Adventures: design prototype.
   One stylesheet, two designed layouts. The phone layout is everything under
   720px and is written as its own composition, not as overrides that shrink
   the desktop one. */

/* ---------- Tokens ---------- */

@font-face {
  font-family: "Rosario";
  src: url("../assets/fonts/rosario.woff2") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Rosario";
  src: url("../assets/fonts/rosario-italic.woff2") format("woff2");
  font-weight: 300 700;
  font-style: italic;
  font-display: swap;
}

:root {
  /* Fixed by Tom: the coral family of the start screen. */
  --coral: #EE7159;      /* outline, links, actions */
  --rose: #CA4F52;       /* card ground */
  --peach: #EBC69A;      /* the lit outline, sandstone */

  /* Extended: taken from the logo detail and the illustrated scene. */
  --night: #000000;      /* the ground everywhere */
  --basalt: #241E1F;     /* raised panels, and the hero ground */
  --seam: #3B3132;       /* hairlines between dark surfaces */
  --chalk: #FFFFFF;      /* frames, headings */
  --bone: #EFE7E1;       /* body copy */
  --ash: #A99E98;        /* secondary copy */
  --glow: #A5EEDE;       /* the teal flower: focus only */

  /* One scheme for every profile. The hero stands on the panel colour and
     the aura is two lighter steps of it, so coral is left for accents. */
  --aura-far: #31292A;
  --aura-mid: #43393A;

  --font: "Rosario", "Trebuchet MS", "Segoe UI", sans-serif;

  --frame: 4px;          /* the white card frame */
  --line: 2px;
  --r-card: 28px;
  --r-plate: 18px;
  --r-small: 10px;

  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 72px;

  --fast: 150ms;
  --med: 280ms;
  --ease: cubic-bezier(.2, .7, .2, 1);

  --page: 1180px;
  --bar: 92px;
}


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

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--night); color-scheme: dark; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--night);
  color: var(--bone);
  font: 400 1.125rem/1.6 var(--font);
  font-variant-numeric: lining-nums;
}
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }
a { color: var(--coral); text-underline-offset: .18em; }
a:hover { color: var(--peach); }
:focus-visible { outline: 3px solid var(--glow); outline-offset: 3px; border-radius: 4px; }
h2 { font-size: 1.6rem; font-weight: 600; line-height: 1.2; color: var(--chalk); }
.label {
  font-size: .875rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--peach);
}

/* The hover card: Tom's black plate with the white frame, small. It opens on
   hover, on keyboard focus, and on tap where there is no hover. It never
   takes the pointer, so it cannot sit between the visitor and the next row. */
.tip { position: relative; }
.tip__for { margin: 0; padding: 0; border: 0; background: none; font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit; text-align: inherit; cursor: help; }
span.tip > .tip__for, .names .tip__for { text-decoration: underline dotted; text-decoration-thickness: 2px; text-underline-offset: .22em; }
.tip__card {
  position: absolute; z-index: 30; top: calc(100% + 8px); left: 0;
  width: max-content; max-width: min(360px, calc(100vw - 48px));
  display: grid; gap: 4px; padding: 12px 16px 14px;
  background: var(--night); border: 3px solid var(--chalk); border-radius: 14px;
  font-size: 1.125rem; font-weight: 400; line-height: 1.45; letter-spacing: 0; text-transform: none; text-align: left; color: var(--bone);
  pointer-events: none; opacity: 0; visibility: hidden; transform: translateY(-4px);
  transition: opacity var(--fast), transform var(--fast), visibility 0s var(--fast);
}
.tip--fill > .tip__card { right: 0; width: auto; max-width: none; }
.tip:has(.tip__for:focus-visible) > .tip__card, .tip.is-open > .tip__card { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
/* With a mouse the card travels with the cursor: the script fills one
   floating card. Without the script the card opens in place. */
@media (hover: hover) {
  html:not(.js) .tip:hover > .tip__card { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
}
.tip__float { position: fixed; z-index: 40; top: 0; left: 0; max-width: 360px; transition: opacity var(--fast), visibility 0s var(--fast); }
.tip__float.is-on { opacity: 1; visibility: visible; transition-delay: 0s; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}

/* ---------- Start screen ---------- */

.start main {
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: var(--s6) var(--s5);
  text-align: center;
  --card: clamp(170px, min(14vw, 27vh), 300px);
}
.start__logo { width: calc(var(--card) * 1.15); }
.start__logo img { width: 100%; }
.start__intro { margin-top: var(--s6); display: grid; gap: var(--s5); font-size: clamp(1.05rem, 1.25vw, 1.5rem); color: var(--chalk); }
.start__intro strong { color: var(--coral); font-weight: 600; }

.select { display: flex; justify-content: center; gap: calc(var(--card) * .16); margin-top: var(--s6); }
.cat {
  position: relative; flex: 0 0 var(--card); aspect-ratio: 520 / 820; display: block;
  border-radius: calc(var(--card) * .106);
}
/* Each base silhouette is placed where it sits inside the 520 x 820 card, read
   from the mask box of the hover file, so the swap does not move the cat. */
.cat__base {
  position: absolute;
  left: calc(var(--x) / 520 * 100%);
  top: calc(var(--y) / 820 * 100%);
  width: calc(var(--w) / 520 * 100%);
}
.cat__card {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; transform: scale(.965);
  transition: opacity var(--med) var(--ease), transform var(--med) var(--ease);
}
@media (hover: hover) {
  .cat:hover .cat__card, .cat:focus-visible .cat__card { opacity: 1; transform: none; }
}
/* No hover to wait for: the cards are simply shown. */
@media (hover: none) {
  .cat__card { opacity: 1; transform: none; }
}

/* ABOUT turns into a small card of its own, as in Tom's hover screen. */
.about-link {
  position: relative; isolation: isolate;
  margin-top: var(--s5); padding: 7px 26px; border: var(--frame) solid transparent; border-radius: 20px;
  text-decoration: none; transition: border-color var(--med) var(--ease);
}
/* The card's ground: rose, with the two auras of the cat cards around the
   plate. It is loaded from the start, so it is there the moment the card opens. */
.about-link::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: 16px;
  background: var(--rose) url("../assets/svg/about-aura.svg") center / cover no-repeat;
  opacity: 0; transition: opacity var(--med) var(--ease);
}
@media (prefers-reduced-motion: no-preference) {
  .about-link::before { background-image: url("../assets/svg/about-aura-flow.svg"); }
}
.about-link span {
  display: block; padding: 0 12px; border: 3px solid transparent; border-radius: var(--r-small);
  color: var(--chalk); font-size: clamp(1rem, 1.25vw, 1.5rem); letter-spacing: .02em; text-transform: uppercase;
}
.about-link:hover, .about-link:focus-visible, .about-link[aria-current] { border-color: var(--chalk); }
.about-link:hover::before, .about-link:focus-visible::before, .about-link[aria-current]::before { opacity: 1; }
.about-link:hover span, .about-link:focus-visible span, .about-link[aria-current] span { background: rgba(0, 0, 0, .85); border-color: var(--chalk); color: var(--chalk); }

/* ---------- Top bar and cat switcher ---------- */

/* The same ABOUT card as on the start screen, at bar size. */
.topbar__about { justify-self: end; margin: 0; padding: 5px 16px; border-width: 3px; border-radius: 16px; }
.topbar__about::before { border-radius: 13px; }
.topbar__about span { padding: 0 10px; border-width: 2px; font-size: 1rem; letter-spacing: .06em; }

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: var(--s5);
  height: var(--bar); padding: 0 var(--s6);
  background: rgba(0, 0, 0, .92); border-bottom: var(--line) solid var(--seam);
  transition: border-color var(--med);
}
/* At the top of the page the bar has no edge. It gets one once there is
   something scrolling under it. */
.js .topbar:not(.is-scrolled) { border-bottom-color: transparent; }
.brand { display: flex; align-items: center; gap: var(--s3); justify-self: start; text-decoration: none; color: var(--chalk); }
.brand img { height: 64px; width: auto; }
/* Two states of one mark: plain at rest, the detailed one on hover and on the
   current page. Used by the logo and by the paws. */
.on { display: none; }
.brand:hover .off, .catnav a:hover .off, .catnav a[aria-current] .off { display: none; }
.brand:hover .on, .catnav a:hover .on, .catnav a[aria-current] .on { display: block; }

.catnav { display: flex; gap: var(--s5); }
.catnav a {
  display: grid; justify-items: center; gap: 4px; min-width: 76px;
  color: var(--ash); text-decoration: none;
  font-size: .74rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; line-height: 1;
}
.catnav i {
  display: grid; place-items: center; width: 60px; height: 60px;
  border: 3px solid transparent; border-radius: 14px;
  transition: background var(--fast), border-color var(--fast);
}
.catnav img { height: 50px; width: auto; }
.catnav a:hover { color: var(--chalk); }
.catnav a[aria-current] { color: var(--chalk); }
.catnav a[aria-current] i { background: var(--rose); border-color: var(--chalk); }
.catnav__home { display: none !important; }

/* ---------- Profile ---------- */

.profile { max-width: var(--page); margin: 0 auto; padding: var(--s6) var(--s6) var(--s8); }

/* The hero is Tom's hover card grown up: an aura, the cat, and a black plate.
   On the card the plate holds a name; here it holds the story.
   The portrait is one fixed size on every profile. The plate takes exactly its
   height, and only grows past it if a story ever runs longer than the box. */
.hero {
  --pw: 384px; --ph: 512px; --aura-pad: 70px;
  position: relative; isolation: isolate; overflow: hidden;
  display: grid; grid-template-columns: auto 1fr; align-items: start; gap: var(--s6);
  padding: 44px;
  background: var(--basalt); border: var(--frame) solid var(--chalk); border-radius: var(--r-card);
}
.hero__portrait { position: relative; }
/* The aura hugs the portrait, as it hugs the cat on the card. It is drawn at
   the portrait's own proportions and never stretched. */
.hero__portrait::before {
  content: ""; position: absolute; z-index: -1; inset: calc(var(--aura-pad) * -1);
  background: url("../assets/svg/aura.svg") center / 100% 100% no-repeat;
}
@media (prefers-reduced-motion: no-preference) {
  .hero__portrait::before { background-image: url("../assets/svg/aura-flow.svg"); }
}
.hero__portrait img {
  box-sizing: content-box; width: var(--pw); height: var(--ph); max-width: none; object-fit: cover;
  border: 5px solid var(--chalk); border-radius: var(--r-plate); background: var(--night);
}
.hero__plate {
  position: relative; z-index: 1; /* above the aura, which reaches under it */
  container-type: inline-size;
  min-height: calc(var(--ph) + 10px); padding: 26px 30px 28px;
  background: rgba(0, 0, 0, .85); border: var(--frame) solid var(--chalk); border-radius: var(--r-plate);
}
.hero__plate h1 { font-size: 3.4rem; font-weight: 400; line-height: .95; letter-spacing: .02em; text-transform: uppercase; color: var(--chalk); }
.hero__plate h1, .hero__class { padding-right: 108px; }
.hero__class {
  position: relative; margin-top: var(--s2);
  font-size: 1.2rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; line-height: 1.3; color: var(--peach);
}
.hero__class i { font-style: normal; }
/* No room for class and subclass on one line: they stack, without the dot. */
@container (max-width: 509px) {
  .hero__class i { display: none; }
  .hero__class .tip { display: block; }
}
/* Text tooltips hang from the line they sit in, not from the word. */
.hero__class .tip, .facts dd span.tip { position: static; }
.level {
  /* The paw sits inside the plate's corner. The aura is wider than the
     corner has room for and spills over the plate's frame. */
  position: absolute; top: -36px; right: -32px; width: 189px; height: 186px; padding-top: 34px;
  display: grid; place-content: center; justify-items: center;
  background: url("../assets/svg/level.svg") center / contain no-repeat; color: var(--chalk);
}
/* The aura moves unless the visitor has asked for less motion. */
@media (prefers-reduced-motion: no-preference) {
  .level { background-image: url("../assets/svg/level-flow.svg"); }
}
.level .label { font-size: .68rem; letter-spacing: .1em; line-height: 1; }
.level b { font-size: 2.3rem; font-weight: 600; line-height: .95; }
.hero__story { margin-top: var(--s5); display: grid; gap: .75em; font-size: clamp(.9375rem, 3.5cqw, 1.0625rem); line-height: 1.55; }

/* Too narrow for portrait and story side by side: the portrait stands on top. */
@media (max-width: 1079px) {
  .hero { --pw: 264px; --ph: 352px; --aura-pad: 49px; grid-template-columns: minmax(0, 1fr); justify-items: center; gap: 52px; padding: 54px var(--s5) var(--s5); }
  .hero__plate { justify-self: stretch; min-height: 0; }
  .hero__story { font-size: 1.0625rem; }
}

.columns { display: grid; grid-template-columns: 340px 1fr; gap: var(--s6); margin-top: var(--s6); align-items: start; }
.sheet { display: grid; gap: var(--s5); position: relative; z-index: 1; }
/* The script reports the sheet's height. A sheet taller than the window
   sticks by its bottom edge instead of its top, so all of it can be reached. */
.js .sheet { position: sticky; top: min(calc(var(--bar) + var(--s5)), calc(100vh - var(--sheet-h, 0px) - var(--s5))); }
.story { display: grid; gap: var(--s7); min-width: 0; }

.panel { background: var(--basalt); border-radius: var(--r-card); padding: var(--s5) var(--s5) var(--s6); }
.panel > h2 { margin-bottom: var(--s4); }

.facts dl { display: grid; gap: var(--s4); }
.facts dt { margin-bottom: 2px; }
.facts dd { color: var(--chalk); }
.facts dd { position: relative; }
.names { display: grid; gap: 1px; }

/* Stats: icon, name and score, as on a levelling screen. Icon and name
   explain the stat. The score opens its sum, and a score that carries a
   bonus says so beside it. Both cards hang from the row. */
.stats ul { display: grid; gap: var(--s1); margin: 0 calc(var(--s2) * -1); }
.stat { position: relative; display: grid; grid-template-columns: 1fr auto; align-items: center; }
.stat .tip { position: static; }
.stat .tip__for { padding: var(--s2); border-radius: var(--r-small); }
.stat__what .tip__for { display: grid; grid-template-columns: 60px 1fr; align-items: center; gap: var(--s4); width: 100%; }
.stat__what img, .stat__icon { width: 60px; height: 60px; }
/* Not an icon. Marks where Tom's goes. */
.stat__icon {
  display: grid; place-items: center; border: var(--line) dashed var(--peach); border-radius: 50%;
  font-size: .875rem; font-weight: 600; letter-spacing: .12em; color: var(--peach);
}
.stat__name { font-size: 1.15rem; font-weight: 600; line-height: 1.2; color: var(--chalk); }
.stat__score .tip__for { display: flex; align-items: baseline; justify-content: flex-end; gap: 6px; min-width: 60px; }
.stat__score .tip__for b { font-size: 1.9rem; font-weight: 600; line-height: 1; color: var(--chalk); font-variant-numeric: tabular-nums lining-nums; }
.stat__score .tip__for i { font-style: normal; font-size: 1rem; font-weight: 600; line-height: 1; color: var(--peach); }
/* A line of a ledger: what it is, then the figure in a column of its own.
   The total stands under a rule. */
.tally { display: grid; grid-template-columns: 1fr auto; gap: var(--s6); }
.tally b { text-align: right; font-weight: 600; color: var(--chalk); font-variant-numeric: tabular-nums lining-nums; }
.tally--total { margin-top: 4px; padding-top: 6px; border-top: var(--line) solid var(--seam); color: var(--chalk); font-weight: 600; }
/* Abilities: a row each, icon and name. What each one does is in its hover card. */
.abilities ul { display: grid; gap: var(--s1); margin: 0 calc(var(--s2) * -1); }
.ability .tip__for { display: grid; grid-template-columns: 60px 1fr; align-items: center; gap: 2px var(--s4); width: 100%; padding: var(--s2); border-radius: var(--r-small); }
.ability img { width: 60px; height: 60px; grid-row: 1 / span 2; }
.ability__name { align-self: end; font-size: 1.15rem; font-weight: 600; line-height: 1.2; color: var(--chalk); }
.ability__name:last-child { grid-row: 1 / span 2; align-self: center; }
.ability .label { grid-column: 2; align-self: start; }
.ability > .tip__card { right: 0; width: auto; max-width: none; }

/* Timeline */
.timeline header { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); }
/* Order of the timeline. It needs the script, so it is hidden without it. */
.sort { display: flex; padding: 3px; background: var(--basalt); border-radius: 99px; }
html:not(.js) .sort { display: none; }
.sort button {
  padding: 5px 16px 6px; border: var(--line) solid transparent; border-radius: 99px; background: none; cursor: pointer;
  font: 600 .875rem/1.2 var(--font); letter-spacing: .12em; text-transform: uppercase; color: var(--ash);
}
.sort button:hover { color: var(--chalk); }
.sort button[aria-pressed="true"] { background: var(--night); border-color: var(--chalk); color: var(--chalk); cursor: default; }
.timeline > p { margin-top: var(--s3); color: var(--ash); max-width: 60ch; }
.timeline ol { position: relative; margin-top: var(--s6); padding-left: 44px; display: grid; gap: var(--s6); }
.timeline ol::before {
  content: ""; position: absolute; left: 12px; top: 14px; bottom: -40px; width: 4px; border-radius: 2px;
  background: linear-gradient(var(--aura-mid) calc(100% - 90px), transparent);
}
.entry { position: relative; }
.entry::before {
  content: ""; position: absolute; left: -44px; top: 30px; width: 28px; height: 28px;
  background: var(--coral); border: var(--frame) solid var(--night); border-radius: 50%; box-shadow: 0 0 0 var(--line) var(--coral);
}
.entry__card {
  display: grid; grid-template-columns: 1fr minmax(180px, 270px); grid-template-rows: auto 1fr; gap: var(--s4) var(--s6);
  background: var(--basalt); border-radius: var(--r-card); padding: var(--s5) var(--s5) var(--s5) var(--s6);
}
/* The artwork stands on the colour of the cloth it is printed on. That is the
   one place a collection brings its own colour into the world. */
.entry__art {
  grid-column: 2; grid-row: 1; align-self: start; display: block;
  aspect-ratio: 3 / 4; background: var(--plinth, var(--night)); border-radius: var(--r-plate); overflow: hidden;
  box-shadow: 0 0 0 var(--line) var(--seam); cursor: zoom-in;
}
.entry__art img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--med) var(--ease); }
.entry__art:hover img { transform: scale(1.03); }
.entry__text { grid-column: 1; grid-row: 1 / span 2; display: grid; gap: var(--s3); align-content: start; padding-top: var(--s2); }
.entry__meta { display: flex; align-items: center; gap: var(--s3); }
.entry__no { font-size: 1.25rem; font-weight: 600; color: var(--coral); }
.entry h3 { font-size: 1.7rem; font-weight: 600; line-height: 1.15; color: var(--chalk); }
.entry__card > .btn { grid-column: 2; grid-row: 2; align-self: start; justify-content: center; }
/* Five columns because build.py never puts more than five tiles in the strip
   (STRIP thumbnails plus "+N"), so the row always spans the card. */
.entry__gallery { grid-column: 1 / -1; grid-row: 3; display: grid; grid-template-columns: repeat(5, 1fr); gap: var(--s3); padding-top: var(--s4); border-top: var(--line) solid var(--seam); }
.entry__gallery a { display: block; aspect-ratio: 1; border-radius: var(--r-small); overflow: hidden; background: var(--night); cursor: zoom-in; box-shadow: 0 0 0 var(--line) var(--seam); }
.entry__gallery a:hover { box-shadow: 0 0 0 var(--line) var(--peach); }
.entry__gallery img { width: 100%; height: 100%; object-fit: cover; }
/* "+N": the images the strip leaves out. A count, not a picture, so it reads
   as a way into the viewer rather than a fifth photo. */
.entry__more a { display: grid; place-items: center; background: var(--night); color: var(--peach); text-decoration: none; }
/* The images behind "+N" are links for the viewer only. */
.entry__gallery a[hidden] { display: none; }
.entry__more b { font-size: 1.5rem; font-weight: 600; }

.btn {
  display: inline-flex; align-items: center; gap: var(--s2); padding: 9px 20px 10px;
  background: var(--coral); color: #000; border-radius: 99px; text-decoration: none; font-weight: 700; line-height: 1.2;
  transition: background var(--fast), transform var(--fast);
}
.btn:hover { background: var(--peach); color: #000; transform: translateY(-1px); }
.btn svg { width: .8em; height: .8em; }
/* Not on Etsy yet. Not a link, so it is neither focusable nor clickable. */
.btn--soon, .btn--soon:hover { background: var(--seam); color: var(--ash); transform: none; cursor: default; }

/* ---------- About ---------- */

.about { max-width: var(--page); margin: 0 auto; padding: var(--s7) var(--s6) var(--s8); display: grid; grid-template-columns: 220px minmax(0, 68ch); gap: var(--s8); align-items: start; }
.about h1 { grid-column: 2; font-size: clamp(2.6rem, 5vw, 4rem); font-weight: 400; text-transform: uppercase; letter-spacing: .02em; line-height: 1; color: var(--chalk); }
.about__nav { grid-column: 1; grid-row: 2; position: sticky; top: calc(var(--bar) + var(--s6)); display: grid; gap: var(--s2); border-left: 4px solid var(--seam); padding-left: var(--s4); }
/* Two levels: the sections, and under each its parts, set back and quieter. */
.about__nav a { color: var(--bone); font-weight: 600; text-decoration: none; line-height: 1.3; }
.about__nav a:not(.sub):not(:first-child) { margin-top: var(--s3); }
.about__nav .sub { padding-left: var(--s4); color: var(--ash); font-size: 1rem; font-weight: 400; }
.about__nav a:hover { color: var(--chalk); }
.about__body { grid-column: 2; grid-row: 2; display: grid; gap: var(--s8); }
.about__body section { display: grid; gap: var(--s4); scroll-margin-top: calc(var(--bar) + var(--s5)); }
.about__body section section { margin-top: var(--s5); }
.about__body h3 { font-size: 1.3rem; font-weight: 600; line-height: 1.25; color: var(--chalk); }
.about__body dl { display: grid; grid-template-columns: max-content 1fr; gap: var(--s2) var(--s5); }
.about__body dt { color: var(--ash); }
.about__body dd { color: var(--chalk); }

/* 404: one narrow column, the About title style, buttons as the way back. */
.lost { max-width: 68ch; margin: 0 auto; padding: var(--s8) var(--s6); display: grid; gap: var(--s4); }
.lost h1 { margin-bottom: var(--s3); font-size: clamp(2.6rem, 5vw, 4rem); font-weight: 400; text-transform: uppercase; letter-spacing: .02em; line-height: 1; color: var(--chalk); }
.lost { --card: clamp(150px, 12vw, 210px); }
.lost .select { margin-top: var(--s5); }
/* Phones: the carousel runs to the screen edges, as on the start page. */
@media (max-width: 719px) { .lost { --card: min(60vw, 40vh, 300px); } .lost .select { margin-inline: calc(-1 * var(--s6)); } }

/* Collapsed rows, one per product. Closed by default, several may be open.
   The marker is a plus that turns into the x of a close control. */
.fold { border-bottom: 1px solid var(--seam); }
:not(.fold) + .fold { border-top: 1px solid var(--seam); }
.fold + .fold { margin-top: calc(-1 * var(--s4)); } /* cancels the section gap: one ruled list */
.fold summary {
  display: flex; justify-content: space-between; align-items: baseline; gap: var(--s4);
  padding: var(--s3) 0; list-style: none; cursor: pointer; color: var(--chalk);
}
.fold summary::-webkit-details-marker { display: none; }
.fold summary::after {
  content: "+"; flex: none; color: var(--coral); font-size: 1.4rem; line-height: 1;
  transition: transform var(--fast) var(--ease);
}
.fold[open] summary::after { transform: rotate(45deg); }
.fold summary:hover::after { color: var(--chalk); }
.fold dl { padding-bottom: var(--s4); }
@media (prefers-reduced-motion: reduce) { .fold summary::after { transition: none; } }
/* Not copy. Marks where Tom's text goes, and what it has to cover. */
.todo { border: var(--line) dashed var(--peach); border-radius: var(--r-plate); padding: var(--s4) var(--s5); color: var(--ash); font-size: 1rem; }
.todo b { display: block; margin-bottom: var(--s1); }

/* ---------- Lightbox ---------- */

.lightbox { width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: rgba(0, 0, 0, .95); color: var(--chalk); overflow: hidden; }
.lightbox::backdrop { background: #000; }
.lightbox__track { display: flex; height: 100%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.lightbox__track::-webkit-scrollbar { display: none; }
.lightbox figure { flex: 0 0 100%; height: 100%; padding-bottom: 104px; display: grid; place-items: center; scroll-snap-align: center; scroll-snap-stop: always; }
.lightbox img { max-width: calc(100vw - 168px); max-height: calc(100dvh - 210px); border-radius: var(--r-small); cursor: zoom-in; }
.lightbox figure.is-zoomed { display: block; overflow: auto; }
.lightbox figure.is-zoomed img { max-width: none; max-height: none; width: 200vw; border-radius: 0; cursor: zoom-out; }
.lightbox button {
  position: absolute; display: grid; place-items: center; width: 52px; height: 52px;
  background: rgba(0, 0, 0, .85); color: var(--chalk); border: 3px solid var(--chalk); border-radius: 14px; font: 400 1.6rem/1 var(--font); cursor: pointer;
}
.lightbox button:hover { background: var(--rose); }
.lightbox__close { top: var(--s4); right: var(--s4); }
.lightbox__prev { left: var(--s4); top: calc(50% - 26px); }
.lightbox__next { right: var(--s4); top: calc(50% - 26px); }
.lightbox__count { position: absolute; left: 0; right: 0; bottom: 112px; text-align: center; pointer-events: none; }
/* Thumbnail strip along the bottom: every image of the design, the current
   one ringed in peach. It scrolls on its own when a design has many. */
.lightbox__strip { position: absolute; left: 0; right: 0; bottom: var(--s4); display: flex; justify-content: safe center; gap: var(--s2); padding: 4px var(--s4); overflow-x: auto; scrollbar-width: none; }
.lightbox__strip::-webkit-scrollbar { display: none; }
.lightbox .lightbox__strip button { position: static; flex: 0 0 auto; width: 64px; height: 64px; padding: 0; overflow: hidden; border: 0; border-radius: var(--r-small); background: var(--night); box-shadow: 0 0 0 var(--line) var(--seam); opacity: .6; transition: opacity var(--fast); }
.lightbox__strip[hidden] { display: none; }
.lightbox .lightbox__strip button:hover { background: var(--night); opacity: 1; }
.lightbox .lightbox__strip button[aria-current="true"] { opacity: 1; box-shadow: 0 0 0 var(--line) var(--peach); }
.lightbox__strip img { width: 100%; height: 100%; max-width: none; max-height: none; object-fit: cover; border-radius: 0; cursor: pointer; }

/* ---------- Page to page motion ---------- */

@view-transition { navigation: auto; }
.topbar { view-transition-name: topbar; }
::view-transition-group(*) { animation-duration: 340ms; animation-timing-function: var(--ease); }
@keyframes vt-out-left { to { opacity: 0; transform: translateX(-3%); } }
@keyframes vt-in-right { from { opacity: 0; transform: translateX(3%); } }
@keyframes vt-out-right { to { opacity: 0; transform: translateX(3%); } }
@keyframes vt-in-left { from { opacity: 0; transform: translateX(-3%); } }
html:active-view-transition-type(fwd)::view-transition-old(root) { animation: 300ms var(--ease) both vt-out-left; }
html:active-view-transition-type(fwd)::view-transition-new(root) { animation: 300ms var(--ease) both vt-in-right; }
html:active-view-transition-type(back)::view-transition-old(root) { animation: 300ms var(--ease) both vt-out-right; }
html:active-view-transition-type(back)::view-transition-new(root) { animation: 300ms var(--ease) both vt-in-left; }

@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  *, *::before, *::after { transition-duration: 0s !important; animation-duration: 0s !important; scroll-behavior: auto !important; }
  .cat__card { transform: none; }
}

/* ==========================================================================
   Phone layout
   ========================================================================== */

@media (max-width: 719px) {
  body { font-size: 1.0625rem; }
  body:not(.start) { padding-bottom: calc(80px + env(safe-area-inset-bottom)); }

  /* Start: the character select becomes a carousel. Whichever cat sits in the
     middle is the selected one and wears its card. */
  .start main { padding: var(--s5) 0 var(--s6); justify-content: flex-start; --card: min(60vw, 40vh, 300px); }
  .start__logo { width: min(52vw, 220px); margin-top: var(--s4); }
  .start__intro { margin-top: var(--s5); gap: var(--s3); padding: 0 var(--s5); font-size: 1.0625rem; }
  .select {
    position: relative; align-self: stretch; justify-content: flex-start; gap: var(--s4); margin-top: var(--s5);
    padding: var(--s2) calc(50% - var(--card) / 2);
    overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
  }
  .select::-webkit-scrollbar { display: none; }
  .cat { scroll-snap-align: center; }
  .cat__card { opacity: 1; transform: none; }
  .js .cat { opacity: .75; transform: scale(.9); transition: opacity var(--med) var(--ease), transform var(--med) var(--ease); }
  .js .cat:not(.is-active) .cat__card, .js .cat:not(.is-active):hover .cat__card { opacity: 0; transform: scale(.965); }
  .js .cat.is-active { opacity: 1; transform: none; }
  .js .cat.is-active .cat__card { opacity: 1; }
  .about-link { margin-top: var(--s4); }

  /* Chrome: the brand stays on top and scrolls away. The cats move to the
     thumb, as a tab bar. */
  .topbar { position: static; grid-template-columns: 1fr auto; height: 60px; padding: 0 var(--s4); border-bottom: 0; view-transition-name: none; }
  .brand img { height: 44px; }
  .catnav {
    position: fixed; z-index: 20; left: 0; right: 0; bottom: 0; justify-content: space-around; gap: 0;
    padding: 6px var(--s2) calc(6px + env(safe-area-inset-bottom));
    background: var(--night); border-top: var(--line) solid var(--seam);
    view-transition-name: catnav;
  }
  .catnav a { min-width: 72px; }
  .catnav i { width: 60px; height: 48px; }
  .catnav img { height: 40px; }
  .catnav__home { display: grid !important; }

  /* Profile */
  .profile { padding: var(--s2) var(--s4) var(--s7); }
  .hero { padding: 52px var(--s3) var(--s3); border-radius: 22px; }
  .hero__plate { padding: 18px 18px 22px; }
  .hero__plate h1 { font-size: 2.6rem; }
  .hero__plate h1, .hero__class { padding-right: 100px; }
  .hero__class { font-size: 1.05rem; }
  .level { top: -22px; right: -18px; width: 153px; height: 152px; padding-top: 27px; }
  .level .label { font-size: .56rem; }
  .level b { font-size: 1.85rem; }

  .columns { grid-template-columns: 1fr; gap: var(--s5); margin-top: var(--s6); }
  .js .sheet { position: static; }
  .story { gap: var(--s6); }
  .panel { padding: var(--s5) var(--s4); border-radius: 22px; }

  /* Timeline: the artwork leads, full width. */
  .timeline header, .timeline > p { padding: 0 var(--s2); }
  .timeline ol { padding-left: 22px; gap: var(--s6); margin-top: var(--s5); }
  .timeline ol::before { left: 2px; width: 3px; }
  .entry::before { left: -30px; top: 18px; width: 20px; height: 20px; border-width: 3px; }
  .entry__card { grid-template-columns: 1fr; grid-template-rows: none; gap: var(--s4); padding: var(--s3) var(--s3) var(--s5); border-radius: 22px; }
  .entry__art { grid-column: 1; grid-row: 1; }
  .entry__text { grid-column: 1; grid-row: 2; padding: 0 var(--s2); }
  .entry h3 { font-size: 1.5rem; }
  .entry__gallery { grid-row: 4; display: flex; margin: 0 calc(var(--s3) * -1); padding: var(--s4) var(--s4) 0; overflow-x: auto; scrollbar-width: none; }
  .entry__gallery::-webkit-scrollbar { display: none; }
  .entry__gallery li { flex: 0 0 auto; }
  .entry__gallery a { width: 96px; height: 96px; }
  .entry__card > .btn { grid-column: 1; grid-row: 3; margin: 0 var(--s2); padding: 13px 20px 14px; }

  /* About: the contents become a strip of chips that stays in reach. */
  .about { grid-template-columns: minmax(0, 1fr); gap: var(--s5); padding: var(--s4) var(--s4) var(--s7); }
  .about h1, .about__nav, .about__body { grid-column: 1; grid-row: auto; }
  .about__nav {
    top: 0; z-index: 10; display: flex; gap: var(--s2); margin: 0 calc(var(--s4) * -1); padding: var(--s3) var(--s4);
    border-left: 0; background: rgba(0, 0, 0, .94); overflow-x: auto; scrollbar-width: none; white-space: nowrap;
  }
  .about__nav::-webkit-scrollbar { display: none; }
  /* The strip carries the sections only. Their parts are a short scroll away. */
  .about__nav a:not(.sub):not(:first-child) { margin-top: 0; }
  .about__nav a:not(.sub) { padding: 4px 14px 5px; border: var(--line) solid var(--seam); border-radius: 99px; font-weight: 400; }
  .about__nav .sub { display: none; }
  .about__body { gap: var(--s7); }
  .about__body section { scroll-margin-top: 72px; }
  .about__body dl { grid-template-columns: 1fr; gap: 0; }
  .about__body dd { margin-bottom: var(--s3); }

  .lightbox img { max-width: 100vw; max-height: calc(100dvh - 220px); border-radius: 0; }
  .lightbox figure { padding-bottom: 84px; }
  .lightbox__count { bottom: 88px; }
  .lightbox .lightbox__strip button { width: 52px; height: 52px; }
  .lightbox figure.is-zoomed img { width: 260vw; }
  .lightbox__prev, .lightbox__next { display: none; }
  .lightbox > button { width: 46px; height: 46px; }
}
