﻿/* Tripleaf â€” Wayfarer. Tokens from .cursor/rules/design-tokens.mdc. */

:root {
  color-scheme: light;
  --paper: #f7f5f1;
  --surface-0: #ffffff;
  --surface-card: #efebe3;
  --ink: #16233a;
  --on-ink: #ffffff;
  --ink-soft: #5c6b7a;
  --terracotta: #c1552e;
  --on-terracotta: #ffffff;
  --border-soft: #e3e0d8;
  --surface-dark: #16233a;
  --on-dark: #fbfaf7;
  --surface: var(--surface-0);
  --footer: var(--surface-dark);
  --border: var(--border-soft);
  --accent: var(--terracotta);
  --accent-soft: #efddcb;
  --accent-hover: var(--terracotta);
  --zest: var(--terracotta);
  --zest-hover: var(--terracotta);
  --teal: var(--terracotta);
  --indigo: var(--ink);
  --coral: var(--terracotta);
  --sky: var(--terracotta);
  --sunshine: var(--terracotta);
  --mist: var(--surface-card);
  --shadow-soft: 0 2px 8px rgba(22, 35, 58, 0.06);
  --shadow-lift: 0 16px 32px rgba(22, 35, 58, 0.10);
  --radius-pill: 999px;
  --radius-card: 24px;
  --radius-chip: 12px;
  --radius-bubble: 24px;
  --blob: 42% 58% 61% 39% / 45% 41% 59% 55%;
  --shadow-warm: var(--shadow-lift);
  --font-display: "Sora", "Segoe UI", sans-serif;
  --font-body: "Inter", "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --size-hero: clamp(2.25rem, 6vw, 3.75rem);
  --size-display: clamp(2.25rem, 6vw, 3.75rem);
  --size-h2: clamp(1.75rem, 3vw, 2.25rem);
  --size-h3: 1.375rem;
  --size-subhead: 1.375rem;
  --size-body: 1.0625rem;
  --size-caption: 0.9375rem;
  --size-button: 1rem;
  --measure: 40rem;
  --wrap: 75rem;
  --gutter: 1.5rem;
  --section-space: clamp(3.5rem, 8vw, 7.5rem);
  --header-height: 4.75rem;
}

* {
  box-sizing: border-box;
}

html {
  scroll-padding-top: var(--header-height);
}

img {
  max-width: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-body);
  font-size: var(--size-body);
  font-weight: 400;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: 0.4rem;
  z-index: 40;
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-pill);
  background: var(--ink);
  color: var(--on-ink);
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: none;
}

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

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

.scene {
  --paper: #fbfaf7;
  --ink-soft: #4a5568;
  --radius-card: 20px;
  flex: 1 1 auto;
  padding: clamp(0.75rem, 2vw, 2rem) var(--gutter) clamp(1.5rem, 4vw, 3.5rem);
  background: var(--paper);
}

.board {
  /* Layouts inside the card respond to the card's own width, not the window's. */
  container: board / inline-size;
  width: min(100%, 46rem);
  margin: 0 auto;
  padding: clamp(1.15rem, 2.8vw, 2.1rem) clamp(1.1rem, 3vw, 2.4rem) clamp(1.6rem, 3vw, 2.6rem);
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: var(--radius-card);
}

.board:has(main.studio) {
  width: min(100%, 100rem);
  display: flex;
  flex-direction: column;
  min-height: calc(100dvh - var(--header-height));
  padding: 0.7rem 0.85rem 0.75rem;
}

.scene:has(main.studio) {
  padding: 0.55rem clamp(0.4rem, 1.5vw, 1.25rem) 0.7rem;
}

@media (min-width: 62rem) {
  .board:has(main.studio) {
    height: calc(100dvh - var(--header-height));
    max-height: calc(100dvh - var(--header-height));
    overflow: auto;
  }
}

body:has(main.studio) .site-footer,
body:has(main.studio) .site-nav,
body:not(:has(main.home)) .header-cta {
  display: none;
}

main {
  width: 100%;
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 0.25rem 1rem;
}

main.wide {
  max-width: 46rem;
}

main.studio {
  max-width: none;
  margin: 0;
  padding: 0;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

main.home {
  max-width: none;
  margin: 0;
  padding: 0;
  container: home / inline-size;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: transparent;
  border-bottom: 0;
  padding: 1.25rem var(--gutter) 0;
}

.site-header-inner {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 1.5rem;
  padding: 0.85rem 0.75rem 0.85rem 1.5rem;
  background: var(--surface-0);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-soft);
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.1rem;
  font-weight: 600;
}

.nav-menu {
  position: relative;
}

.nav-menu > summary {
  display: none;
}

.header-cta {
  margin-top: 0;
  margin-left: auto;
}

@media (max-width: 47.99rem) {
  :root {
    --header-height: 4.75rem;
  }

  .site-header-inner > .site-nav {
    display: none;
  }

  .nav-menu {
    margin-left: auto;
  }

  .nav-menu > summary {
    display: inline-flex;
    align-items: center;
    list-style: none;
    cursor: pointer;
    font-weight: 600;
    padding: 0.45rem 0.9rem;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-pill);
    background: var(--surface-0);
  }

  .nav-menu > summary::-webkit-details-marker {
    display: none;
  }

  .nav-menu .site-nav {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 0.4rem);
    min-width: 12rem;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.55rem 0.7rem;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-card);
    background: var(--surface-0);
    box-shadow: var(--shadow-soft);
    z-index: 30;
  }

  .nav-menu[open] .site-nav {
    display: flex;
  }

  .header-cta {
    margin-left: 0;
  }
}

@media (min-width: 48rem) {
  .header-cta {
    margin-left: 0;
  }

  .site-nav {
    margin-left: auto;
  }

  .nav-menu {
    display: none;
  }
}

.site-nav a {
  color: var(--ink);
  text-decoration: none;
}

.site-nav a:hover {
  color: var(--terracotta);
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-transform: none;
  text-decoration: none;
  color: var(--ink);
}

.logo-mark,
.footer-mark {
  width: clamp(1.6rem, 2.6vw, 2.1rem);
  height: auto;
  display: block;
}

.site-footer {
  margin: 0;
  padding: 2.5rem 0 2.75rem;
  background: var(--surface-dark);
  color: var(--on-dark);
}

.site-footer-inner {
  display: grid;
  gap: 1rem;
}

.site-footer p {
  margin: 0;
  font-size: var(--size-caption);
  color: var(--on-dark);
}

.logo-on-dark {
  color: var(--on-dark);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
}

.footer-links a {
  color: var(--on-dark);
  font-weight: 600;
  text-decoration: none;
}

.footer-links a:hover {
  text-decoration: underline;
}

@media (prefers-reduced-motion: reduce) {
  .photo-list li,
  .book-page,
  .upload-wait-spinner,
  .upload-wait-bar-fill.is-unknown {
    animation: none;
  }

  button:hover,
  .button:hover,
  .card:hover {
    transform: none;
    box-shadow: none;
  }
}

h1 {
  font-family: var(--font-display);
  font-size: var(--size-hero);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.035em;
  margin: 0.7rem 0 0.9rem;
  color: var(--ink);
}

h2,
.h2 {
  font-family: var(--font-display);
  font-size: var(--size-h2);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin: 0 0 0.75rem;
  color: var(--ink);
}

h3,
.h3,
.subhead {
  font-family: var(--font-display);
  font-size: var(--size-h3);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0 0 0.5rem;
}

p {
  color: var(--ink);
  margin: 0 0 1rem;
  font-weight: 400;
}

.hint {
  color: var(--ink-soft);
  margin: 0 0 1rem;
}

.hint,
.caption,
.page-label,
.credit,
.photo-list span {
  font-size: var(--size-caption);
}

.error {
  color: var(--ink);
  background: var(--accent-soft);
  padding: 0.75rem 1.1rem;
  border-radius: var(--radius-bubble);
}

.notice-banner {
  color: var(--ink);
  background: var(--accent-soft);
  padding: 0.9rem 1.15rem;
  border-radius: var(--radius-bubble);
  margin: 0 0 1.25rem;
}

.fine-print {
  margin: 2rem 0 0;
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--ink-soft);
  max-width: 36rem;
}

form {
  margin-top: 1.75rem;
}

label,
legend {
  display: block;
  font-size: var(--size-caption);
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--ink);
}

input[type="file"] {
  display: block;
  width: 100%;
  max-width: 100%;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--paper);
  font-family: var(--font-body);
  color: var(--ink);
}

button,
.button {
  margin-top: 0;
  padding: 1rem 2rem;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--ink);
  color: var(--on-ink);
  font-family: var(--font-body);
  font-size: var(--size-button);
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  box-shadow: var(--shadow-soft);
  transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

button:hover,
.button:hover {
  background: var(--ink);
  color: var(--on-ink);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lift);
}

button.quiet {
  background: var(--paper);
  color: var(--ink);
  border: 2px solid var(--ink);
  box-shadow: none;
}

button.quiet:hover {
  background: var(--mist);
  color: var(--ink);
}

button:disabled,
button.quiet:disabled {
  background: var(--mist);
  color: var(--ink-soft);
  border-color: transparent;
  cursor: default;
  transform: none;
  box-shadow: none;
}

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

a.back {
  font-size: var(--size-caption);
  font-weight: 600;
}

a.quiet-link {
  display: inline-block;
  margin-top: 0;
  padding: 0.65rem 1.2rem;
  border: 2px solid var(--ink);
  border-radius: var(--radius-pill);
  background: var(--paper);
  color: var(--ink);
  text-decoration: none;
  font-size: var(--size-button);
  font-weight: 600;
}

a.quiet-link:hover {
  background: var(--mist);
}

.price {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ink);
}

.photo-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(6.5rem, 1fr));
  gap: 0.75rem;
  padding: 0;
  margin: 1.5rem 0;
  list-style: none;
}

.photo-list li {
  min-width: 0;
  animation: rise 0.45s ease both;
}

.photo-list li:nth-child(1) { animation-delay: 0.02s; }
.photo-list li:nth-child(2) { animation-delay: 0.06s; }
.photo-list li:nth-child(3) { animation-delay: 0.1s; }
.photo-list li:nth-child(4) { animation-delay: 0.14s; }
.photo-list li:nth-child(5) { animation-delay: 0.18s; }
.photo-list li:nth-child(n+6) { animation-delay: 0.22s; }

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.photo-list img {
  width: 100%;
  aspect-ratio: 4 / 3;
  height: auto;
  object-fit: cover;
  background: var(--mist);
  border-radius: 0.9rem;
}

.photo-list span {
  display: block;
  color: var(--ink-soft);
  margin-top: 0.35rem;
  overflow-wrap: anywhere;
}

fieldset {
  border: 0;
  margin: 0;
  padding: 0;
}

legend {
  padding: 0;
}

.choice {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
}

/* ---------- Book options chooser ---------- */

.options fieldset {
  margin-bottom: 0;
  padding: 0;
  border-radius: 0;
  background: transparent;
}

.options fieldset.is-off {
  opacity: 0.5;
}

.options-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem 1.15rem;
  margin: 0 0 0.35rem;
}

@container board (min-width: 36rem) {
  .options-grid {
    grid-template-columns: 1fr 1fr;
  }

  .options-grid .options-span {
    grid-column: 1 / -1;
  }
}

.options-grid .text-field {
  margin: 0;
}

.options-grid .hint {
  margin: 0.35rem 0 0;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 0.85rem;
  margin: 1.1rem 0 0.75rem;
}

.form-actions button,
.form-actions .button,
.form-actions .quiet-link {
  margin: 0;
}

.check-row {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  margin: 0.15rem 0 0;
  font-weight: 600;
}

.check-row input {
  margin-top: 0.2rem;
  flex: 0 0 auto;
}

.fold {
  margin: 1rem 0;
  border: 2px solid var(--ink);
  border-radius: var(--radius-card);
  background: var(--surface);
  padding: 0.15rem 0.9rem;
}

.fold > summary {
  cursor: pointer;
  font-weight: 600;
  padding: 0.7rem 0;
}

.fold .photo-list,
.fold .fine-print {
  margin-top: 0.25rem;
}

.fine-fold {
  margin-top: 1.25rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.compact-action {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.5rem 0.65rem;
  margin: 0 0 0.75rem;
}

.compact-action .text-field {
  flex: 1 1 12rem;
  margin: 0;
}

.compact-action button {
  margin: 0;
  padding: 0.65rem 1rem;
}

.option-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin: 0 0 0.9rem;
  padding: 2px;
}

.option-card {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 100%;
  min-width: min(100%, 11rem);
  gap: 0.55rem;
  margin: 0;
  padding: 0.95rem 1.45rem;
  border: 2px solid transparent;
  border-radius: var(--radius-card);
  background: var(--mist);
  cursor: pointer;
  font-weight: 600;
}

.option-grid .option-card {
  max-width: 100%;
}

@container board (min-width: 36rem) {
  .option-grid .option-card {
    flex: 1 1 16rem;
    max-width: calc(50% - 0.3rem);
  }
}

.option-card:hover {
  background: var(--accent-soft);
}

.option-card:has(input:checked) {
  border-color: var(--ink);
  background: var(--paper);
  box-shadow: 0 0 0 1px var(--ink);
}

.option-card:has(input:focus-visible) {
  box-shadow: 0 0 0 2px var(--ink);
}

.option-card:has(input:disabled) {
  cursor: default;
  opacity: 0.45;
}

.option-card input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.option-body {
  display: block;
  min-width: 0;
}

.option-name {
  display: block;
  font-weight: 700;
  color: var(--ink);
}

.option-spec {
  display: block;
  margin-top: 0.15rem;
  font-size: var(--size-caption);
  font-weight: 500;
  color: var(--ink-soft);
}

.option-blurb {
  display: block;
  margin-top: 0.2rem;
  font-size: var(--size-caption);
  font-weight: 500;
  color: var(--ink-soft);
}

.badge {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.12rem 0.5rem;
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  color: var(--ink);
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.spec-list {
  display: grid;
  gap: 0.85rem;
  margin: 1.5rem 0;
  padding: 1.15rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
}

.spec-list > div {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.75rem;
}

.spec-list dt {
  min-width: 6rem;
  font-size: var(--size-caption);
  color: var(--ink-soft);
}

.spec-list dd {
  margin: 0;
  color: var(--ink);
}

.notice {
  background: var(--mist);
  padding: 0.95rem 1.25rem;
  margin: 1.25rem 0;
  border-radius: var(--radius-pill);
}

.notice p {
  color: var(--ink);
}

.notice ul,
details ul {
  padding-left: 1.2rem;
  color: var(--ink-soft);
}

details {
  margin: 1rem 0 1.5rem;
  color: var(--ink-soft);
  font-size: var(--size-caption);
}

/* ---------- Book pages ---------- */

.spread {
  position: relative;
  width: 100%;
  max-width: 28rem;
  /* Page shape comes from the chosen format: --page-w/--page-h are set inline. */
  aspect-ratio: var(--page-w, 1) / var(--page-h, 1);
  background: var(--surface);
  overflow: hidden;
  border: 1px solid var(--border);
  container-type: inline-size;
}

.safe-area {
  position: absolute;
  border: 1px dashed var(--accent);
  opacity: 0.55;
  pointer-events: none;
}

.spread.bleed img,
.slot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform-origin: center;
}

.spread.bleed img.fit-contain,
.slot img.fit-contain {
  object-fit: contain;
  background: var(--mist);
}

.spread.framed {
  background: var(--mist);
}

.spread.framed > .slot {
  position: absolute;
  inset: 7%;
  height: auto;
}

.spread-slots {
  position: absolute;
  inset: 0;
  display: grid;
  gap: 0.35rem;
  padding: 0.35rem;
  background: var(--mist);
}

.spread.pair .spread-slots {
  grid-template-columns: 1fr 1fr;
}

.spread.stack .spread-slots {
  grid-template-rows: 1fr 1fr;
}

.spread.split .spread-slots {
  grid-template-columns: 1.65fr 1fr;
}

.spread.split_stack .spread-slots {
  grid-template-rows: 1.65fr 1fr;
}

.spread.trio .spread-slots {
  grid-template-columns: 1fr 1fr 1fr;
}

.spread.stack_trio .spread-slots {
  grid-template-rows: 1fr 1fr 1fr;
}

.spread.hero_pair .spread-slots {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1.45fr 1fr;
}

.spread.hero_pair .spread-slots .slot:first-child {
  grid-column: 1 / -1;
}

.spread.hero_side .spread-slots {
  grid-template-columns: 1.45fr 1fr;
  grid-template-rows: 1fr 1fr;
}

.spread.hero_side .spread-slots .slot:first-child {
  grid-row: 1 / -1;
}

.spread.quad .spread-slots {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
}

.slot {
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  background: var(--accent-soft);
}

.slot-hit {
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.slot-hit.is-on {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.slot-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  background: repeating-linear-gradient(
    -45deg,
    var(--accent-soft),
    var(--accent-soft) 8px,
    var(--surface) 8px,
    var(--surface) 16px
  );
  color: var(--ink);
  text-decoration: none;
  font-size: var(--size-caption);
  font-weight: 500;
  text-align: center;
}

.back-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 1.5rem;
}

.back-mark {
  width: 12%;
  min-width: 0.75rem;
  height: auto;
  opacity: 0.9;
}

.book-page {
  animation: rise 0.28s ease;
}

.page-label {
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 0.5rem;
}

/* ---------- Editor (studio) ---------- */

.studio-head {
  flex: 0 0 auto;
  margin: 0 0 0.45rem;
}

.studio-head h1 {
  margin: 0 0 0.15rem;
  font-size: clamp(1.15rem, 2.2vw, 1.5rem);
}

.studio-head p {
  margin: 0;
  font-size: var(--size-caption);
}

.studio-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.75rem clamp(0.7rem, 1.4vw, 1.4rem);
  align-items: start;
  margin: 0;
  flex: 1 1 auto;
  min-height: 0;
}

/* Three columns once there is room: page list, the page itself, the tools. */
@container board (min-width: 62rem) {
  .studio-grid {
    grid-template-columns: clamp(7.5rem, 11cqw, 11.5rem) minmax(0, 1fr) minmax(18rem, 24rem);
    align-items: stretch;
  }

  .page-rail-col,
  .tool-panel,
  .studio-stage {
    min-height: 0;
    max-height: none;
  }

  .page-rail-col {
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .tool-panel {
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
}

.page-rail-col {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.55rem;
  align-items: end;
  min-width: 0;
}

.page-rail {
  display: flex;
  gap: 0.55rem;
  flex-direction: row;
  overflow-x: auto;
  padding-bottom: 0.35rem;
  min-width: 0;
}

.rail-add {
  display: flex;
  align-items: end;
  margin: 0;
}

.rail-add button {
  margin: 0;
  width: 100%;
  min-width: 4.6rem;
  max-width: 5.6rem;
  padding: 0.7rem 0.55rem;
  border-radius: var(--radius-pill);
  font-size: var(--size-caption);
  line-height: 1.25;
  white-space: normal;
}

@container board (min-width: 62rem) {
  .page-rail-col {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
  }

  .page-rail {
    flex: 1 1 auto;
    flex-direction: column;
    overflow-x: hidden;
    overflow-y: auto;
    min-height: 0;
    padding-right: 0.3rem;
    padding-bottom: 0;
  }

  .rail-add {
    flex: 0 0 auto;
    position: sticky;
    bottom: 0;
    padding-top: 0.35rem;
    background: linear-gradient(180deg, transparent, var(--paper) 0.4rem);
  }

  .rail-add button {
    min-width: 0;
    max-width: none;
  }
}

.page-rail a,
.rail-item {
  display: block;
  flex: 0 0 auto;
  width: 5.8rem;
  color: inherit;
  text-decoration: none;
  border: 2px solid transparent;
  border-radius: 1.1rem;
  padding: 0.25rem;
}

@container board (min-width: 62rem) {
  .page-rail a,
  .rail-item {
    width: auto;
  }
}

.page-rail a.is-current,
.rail-item.is-current {
  border-color: var(--accent);
}

.rail-item.is-movable {
  cursor: grab;
}

.rail-item.is-dragging {
  opacity: 0.42;
}

.rail-item.is-title {
  background: var(--accent-soft);
}

.rail-item.drop-before {
  box-shadow: inset 3px 0 0 var(--accent);
}

.rail-item.drop-after {
  box-shadow: inset -3px 0 0 var(--accent);
}

@container board (min-width: 62rem) {
  .rail-item.drop-before {
    box-shadow: inset 0 3px 0 var(--accent);
  }

  .rail-item.drop-after {
    box-shadow: inset 0 -3px 0 var(--accent);
  }
}

.rail-label {
  display: block;
  font-size: 0.7rem;
  font-family: var(--font-mono);
  color: var(--ink-soft);
  margin-bottom: 0.2rem;
}

.rail-thumb {
  display: block;
  width: 100%;
  aspect-ratio: var(--page-w, 1) / var(--page-h, 1);
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.85rem;
}

.rail-thumb .title-missing-hint,
.rail-thumb .title-photo-hint {
  display: none;
}

.rail-thumb .title-badge {
  font-size: 0.32rem;
  padding: 0.08rem 0.2rem;
}

.rail-thumb .title-missing {
  padding: 0.2rem 0.28rem;
}

.rail-thumb .spread {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  aspect-ratio: auto;
  border: 0;
}

.page-rail .spread img,
.page-rail .slot-hit,
.page-rail .slot-empty {
  pointer-events: none;
}

.page-rail .back-page {
  padding: 0.4rem;
  gap: 0.2rem;
}

.page-rail .credit {
  font-size: 0.45rem;
  line-height: 1.25;
  text-align: center;
  margin: 0;
}

.page-rail .slot-empty {
  font-size: 0.55rem;
}

.studio-head h1 {
  margin-top: 0;
}

.studio-stage {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* Size the big page from the book shape, not from the photo.
   width:auto + max-height:100% can collapse to 0px until an image
   loads â€” that looked like a blank page. */
.studio-stage .spread {
  width: min(
    100%,
    34rem,
    calc((100dvh - 16rem) * var(--page-w, 1) / var(--page-h, 1))
  );
  max-width: 100%;
  height: auto;
  min-height: 12rem;
  aspect-ratio: var(--page-w, 1) / var(--page-h, 1);
  margin: 0 auto;
  flex: 0 0 auto;
}

@container board (max-width: 61.99rem) {
  .studio-stage .spread {
    width: min(
      100%,
      calc((100dvh - 26rem) * var(--page-w, 1) / var(--page-h, 1))
    );
  }

  .preview-tools {
    width: 100%;
  }
}

@container board (min-width: 62rem) {
  .studio-stage .spread {
    width: min(
      100%,
      34rem,
      calc((100dvh - 12rem) * var(--page-w, 1) / var(--page-h, 1))
    );
    max-height: none;
  }
}

.stage-note {
  margin: 0.4rem auto 0;
  width: min(100%, 34rem);
  text-align: center;
  flex: 0 0 auto;
}

.preview-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.45rem 0.7rem;
  width: min(100%, 34rem);
  margin: 0 auto 0.65rem;
  flex: 0 0 auto;
}

.preview-tools button,
.preview-tools .approve-form {
  margin-top: 0;
}

.preview-tools .approve-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  flex: 1 1 100%;
  margin: 0;
}

.preview-tools .approve-form {
  flex: 1 1 9rem;
  margin: 0;
}

.preview-tools .approve-form button {
  width: 100%;
  margin-top: 0;
  padding: 0.55rem 0.85rem;
}

.page-status {
  margin: 0;
  flex: 1 1 6rem;
  min-width: 0;
  text-align: center;
  font-family: var(--font-mono);
  font-size: var(--size-caption);
  color: var(--ink-soft);
  overflow-wrap: anywhere;
}

/* Keep Previous / page / Next on one line on small screens. */
@container board (max-width: 34rem) {
  .preview-tools {
    gap: 0.4rem;
  }

  .preview-tools a.quiet-link,
  .preview-tools button {
    padding: 0.5rem 0.7rem;
    font-size: var(--size-caption);
  }
}

.tool-panel {
  min-width: 0;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-bubble);
  padding: 0.7rem 0.8rem 0.85rem;
}

.tool-tabs {
  display: flex;
  gap: 0.2rem;
  margin: 0 0 0.55rem;
  padding: 0.22rem;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--mist);
}

.tool-tab {
  flex: 1 1 0;
  margin: 0;
  padding: 0.45rem 0.4rem;
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--ink-soft);
  font-size: var(--size-caption);
  font-weight: 600;
}

.tool-tab:hover {
  background: var(--accent-soft);
  color: var(--ink);
}

.tool-tab.is-current {
  background: var(--ink);
  color: var(--surface);
}

.tool-tab.is-current:hover {
  background: var(--ink);
  color: var(--surface);
}

.tool-panes {
  min-height: 0;
  flex: 1 1 auto;
  overflow: auto;
}

.tool-pane {
  display: none;
}

.tool-pane.is-current {
  display: block;
}

.tool-pane h2 {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.tool-panel .caption {
  margin: 0.35rem 0 0.3rem;
}

.tool-panel form {
  margin-top: 0.4rem;
}

.tool-block {
  margin: 0 0 1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border);
}

.tool-block:last-of-type {
  border-bottom: 0;
  margin-bottom: 0.5rem;
}

.tool-block h2 {
  margin: 0 0 0.45rem;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.photo-file {
  margin: 0 0 0.45rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--ink-soft);
  overflow-wrap: anywhere;
}

.page-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
  margin: 0.65rem 0 0.35rem;
}

.page-actions form {
  margin: 0;
}

.page-actions button {
  width: 100%;
  margin-top: 0;
  padding: 0.5rem 0.55rem;
  font-size: 0.75rem;
}

.tool-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 0.75rem;
}

.tool-row form,
.layout-picks form,
.reorder form {
  margin: 0;
}

.tool-row button,
.reorder button {
  margin-top: 0;
  padding: 0.45rem 0.65rem;
  font-size: 0.75rem;
}

.layout-picks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(5.4rem, 1fr));
  gap: 0.4rem;
  margin: 0 0 0.85rem;
}

.layout-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  width: 100%;
  margin: 0;
  padding: 0.55rem 0.5rem 0.55rem;
  background: var(--mist);
  color: var(--ink);
  border: 1px solid transparent;
  border-radius: var(--radius-bubble);
  text-align: left;
}

.layout-card:hover {
  background: var(--accent-soft);
  color: var(--ink);
}

.layout-card.is-picked {
  border-color: var(--ink);
  background: var(--paper);
  box-shadow: 0 0 0 1px var(--ink);
}

.layout-card:disabled {
  opacity: 1;
  cursor: default;
}

.layout-name {
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.25;
}

.layout-thumb {
  display: grid;
  width: calc(3.35rem * var(--page-w, 1) / max(var(--page-w, 1), var(--page-h, 1)));
  aspect-ratio: var(--page-w, 1) / var(--page-h, 1);
  height: auto;
  margin-inline: auto;
  padding: 0.18rem;
  background: var(--surface);
  border: 1px solid var(--border);
  gap: 0.12rem;
}

.layout-thumb i {
  display: block;
  min-width: 0;
  min-height: 0;
  background: var(--accent-soft);
}

.layout-thumb-full {
  padding: 0;
}

.layout-thumb-framed {
  padding: 0.32rem;
  background: var(--paper);
}

.layout-thumb-pair {
  grid-template-columns: 1fr 1fr;
}

.layout-thumb-stack {
  grid-template-rows: 1fr 1fr;
}

.layout-thumb-split {
  grid-template-columns: 1.6fr 1fr;
}

.layout-thumb-split_stack {
  grid-template-rows: 1.6fr 1fr;
}

.layout-thumb-trio {
  grid-template-columns: 1fr 1fr 1fr;
}

.layout-thumb-stack_trio {
  grid-template-rows: 1fr 1fr 1fr;
}

.layout-thumb-hero_pair {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1.3fr 1fr;
}

.layout-thumb-hero_pair i:first-child {
  grid-column: 1 / -1;
}

.layout-thumb-hero_side {
  grid-template-columns: 1.3fr 1fr;
  grid-template-rows: 1fr 1fr;
}

.layout-thumb-hero_side i:first-child {
  grid-row: 1 / -1;
}

.layout-thumb-quad {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
}

.layout-thumb-place_full {
  padding: 0;
  grid-template-rows: 1fr 0.32fr;
}

.layout-thumb-place_full i:last-child {
  background: var(--zest);
}

.layout-thumb-place_split {
  grid-template-columns: 1.3fr 1fr;
}

.layout-thumb-place_split i:last-child {
  background: var(--paper);
  border: 1px solid var(--border);
}

.layout-thumb-place_stack {
  grid-template-rows: 1.4fr 1fr;
}

.layout-thumb-place_stack i:last-child {
  background: var(--paper);
  border: 1px solid var(--border);
}

.reorder {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.75rem 0;
}

.fit-form label {
  margin-top: 0.28rem;
  margin-bottom: 0.15rem;
}

.fit-form input[type="range"] {
  width: 100%;
}

.library .photo-list {
  margin: 0.5rem 0 0;
  grid-template-columns: repeat(auto-fill, minmax(4.5rem, 1fr));
}

.library .photo-list button {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  border: 1px solid transparent;
}

.library .photo-list button:hover {
  background: var(--accent-soft);
  border-color: var(--border);
}

.library .photo-list span {
  font-size: 0.65rem;
}

.approve-form button {
  width: 100%;
}

.studio-dock {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  margin: 0.55rem 0 0;
  padding-top: 0.55rem;
  border-top: 1px solid var(--border);
  flex: 0 0 auto;
}

.studio-dock form,
.studio-dock p,
.studio-dock details {
  margin: 0;
}

.studio-dock button {
  margin-top: 0;
  padding: 0.5rem 0.9rem;
}

.studio-dock summary {
  cursor: pointer;
  font-size: var(--size-caption);
  color: var(--ink);
}

.dock-price {
  flex: 1 1 12rem;
  min-width: 0;
}

.add-photos input[type="file"] {
  margin-top: 0.35rem;
  font-size: var(--size-caption);
}

.dock-quote,
.printer-quote {
  flex: 1 1 16rem;
  min-width: 0;
}

.quote-loading {
  margin: 0.5rem 0 0;
  color: var(--ink-soft);
}

.quote-error {
  margin: 0.5rem 0 0;
}

.quote-breakdown {
  margin: 0.5rem 0 0;
}

.quote-country {
  margin-top: 0.35rem;
}

.printer-quote button {
  margin-top: 0.5rem;
}

/* ---------- Home (Explorer leftovers stay unused; marketing uses body.is-market) ---------- */

.home .hero,
.home .values,
.home .how,
.home .formats,
.home .start-band {
  padding-block: var(--section-space);
}

.home .how,
.home .formats,
.home .start-band,
.home .trust-band {
  scroll-margin-top: var(--header-height);
}

.display {
  font-family: var(--font-display);
  font-size: var(--size-display);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.04em;
  margin: 0 0 1.15rem;
  max-width: 12ch;
}

.lede,
.section-lede {
  margin: 0 0 1.5rem;
  color: var(--ink);
  font-size: var(--size-body);
  font-weight: 400;
  line-height: 1.6;
  max-width: 36rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem 1.5rem;
  margin: 0;
}

a.button {
  display: inline-block;
  margin-top: 0;
}

a.button:hover {
  background: var(--ink);
  color: var(--on-ink);
}

.text-link {
  font-size: var(--size-button);
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 0.1rem;
}

.text-link:hover {
  color: var(--terracotta);
  border-color: var(--terracotta);
}

.card {
  background: var(--surface-card);
  border: 0;
  border-radius: var(--radius-card);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lift);
}

.values-grid,
.steps,
.format-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--gutter);
  list-style: none;
  padding: 0;
  margin: 0;
}

@container home (min-width: 64rem) {
  .values-grid,
  .steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .format-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.value-card,
.steps .card {
  padding: 1.4rem 1.35rem 1.5rem;
}

.value-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.value-card h3,
.value-card .h3,
.value-card p {
  text-align: center;
  max-width: 22rem;
}

.value-card .icon-chip {
  margin: 0 auto 0.9rem;
}

.value-card p,
.step-copy {
  margin: 0;
}

.icon-chip {
  display: inline-grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  margin: 0 0 0.9rem;
  border-radius: var(--radius-chip);
  color: var(--ink);
}

.icon-chip svg {
  width: 1.35rem;
  height: 1.35rem;
}

.chip-terracotta { background: var(--terracotta); color: var(--paper); }
.chip-coral { background: var(--coral); color: var(--ink); }
.chip-sky { background: var(--sky); color: var(--ink); }
.chip-sunshine { background: var(--sunshine); color: var(--ink); }

.step-num {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 4vw, 3rem);
  font-weight: 800;
  color: var(--ink);
  line-height: 1;
}

.step-label {
  display: block;
  margin-top: 0.65rem;
  font-family: var(--font-display);
  font-size: var(--size-h3);
  font-weight: 700;
  color: var(--ink);
}

.step-copy {
  display: block;
  margin-top: 0.4rem;
  color: var(--ink);
}

.format-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
  list-style: none;
}

.format-photo {
  position: relative;
}

.format-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  height: auto;
  object-fit: cover;
  display: block;
}

.format-caption {
  margin: 0;
  padding: 0.85rem 1rem 0.35rem;
  font-weight: 600;
}

.format-prices {
  margin-top: auto;
  padding: 0.85rem 1rem 1rem;
  border-top: 2px solid var(--ink);
}

.format-from {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  margin: 0 0 0.7rem;
}

.format-from .price {
  font-size: 1.05rem;
}

.format-from-label {
  color: var(--ink-soft);
  font-size: var(--size-caption);
}

.format-price-list {
  display: grid;
  gap: 0.4rem;
  margin: 0;
}

.format-price-list > div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
}

.format-price-list dt {
  color: var(--ink-soft);
  font-size: var(--size-caption);
  font-weight: 400;
}

.format-price-list dd {
  margin: 0;
}

.format-price-fallback {
  margin: 0;
  padding: 0.85rem 1rem 1rem;
  color: var(--ink-soft);
  font-size: var(--size-caption);
}

.data-pill {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  display: inline-block;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-pill);
  background: var(--zest);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 500;
}

.start-band .dock {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: end;
  justify-content: space-between;
  margin: 0;
  padding: 1.25rem 1.35rem;
}

.dock-field {
  margin: 0;
  flex: 1 1 16rem;
  min-width: 0;
}

.dock-field span {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 600;
}

.dock input[type="file"] {
  border: 2px solid var(--ink);
  background: var(--surface);
  padding: 0.7rem 1rem;
  border-radius: var(--radius-pill);
}

.dock button {
  margin: 0;
  white-space: nowrap;
}

.trust-band {
  padding-block: var(--section-space);
  background: linear-gradient(90deg, var(--teal), var(--indigo));
}

.trust-card {
  max-width: 42rem;
  margin: 0 auto;
  padding: clamp(1.5rem, 4vw, 2.4rem);
  border: 2px solid var(--paper);
  border-radius: var(--radius-card);
  background: rgba(22, 35, 58, 0.18);
  color: var(--paper);
  box-shadow: var(--shadow-lift);
  overflow-wrap: anywhere;
}

.trust-card h2,
.trust-card p {
  color: var(--paper);
}

.trust-card p {
  margin: 0;
  font-size: 1.125rem;
}

input[type="text"],
input[type="number"],
input[type="email"],
input[type="tel"],
textarea,
select {
  display: block;
  width: 100%;
  max-width: 100%;
  padding: 0.7rem 1rem;
  border: 2px solid var(--ink);
  border-radius: var(--radius-pill);
  background: var(--surface);
  font-family: var(--font-body);
  font-size: var(--size-body);
  font-weight: 500;
  color: var(--ink);
}

textarea {
  resize: vertical;
  min-height: 4.5rem;
  border-radius: var(--radius-bubble);
}

.text-field,
.text-form {
  margin: 0 0 0.85rem;
}

.text-form > button {
  margin-top: 0.4rem;
}

.checkout-form > button[type="submit"] {
  margin-top: 0.35rem;
}

.address-grid {
  display: grid;
  gap: 0.85rem;
  margin: 0 0 1.25rem;
}

.checkout-form {
  margin-top: 1.25rem;
}

.checkout-form .subhead {
  margin-top: 1.75rem;
}

@container board (min-width: 36rem) {
  .address-grid {
    grid-template-columns: 1fr 1fr;
  }

  .address-grid .text-field.wide {
    grid-column: 1 / -1;
  }
}

.text-form button {
  margin-top: 0.65rem;
}

.text-form.map-pin-form {
  padding-top: 0.75rem;
  border-top: 2px solid var(--ink);
}

.cover-page .cover-copy {
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: 8%;
  z-index: 1;
  pointer-events: none;
}

.cover-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 3.2cqw, 1.85rem);
  font-weight: 600;
  color: var(--surface);
  text-shadow: 0 1px 12px rgba(34, 30, 27, 0.55);
}

.cover-author {
  margin: 0.25rem 0 0;
  font-size: var(--size-caption);
  color: var(--surface);
  text-shadow: 0 1px 10px rgba(34, 30, 27, 0.5);
}

.map-page {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: var(--safe-y, 5%) var(--safe-x, 4%);
  background: var(--paper);
  aspect-ratio: var(--page-w, 1) / var(--page-h, 1);
}

.title-page {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0;
  background: var(--ink);
  color: var(--paper);
  aspect-ratio: var(--page-w, 1) / var(--page-h, 1);
}

.title-photo {
  position: absolute;
  inset: 0;
}

.title-photo .slot-hit,
.title-photo .slot-still,
.title-photo .slot-empty {
  position: absolute;
  inset: 0;
}

.title-page .slot-empty {
  background: var(--ink);
  color: color-mix(in srgb, var(--paper) 55%, transparent);
}

.title-page .slot-empty span {
  display: none;
}

.title-scrim {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 60%;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(
    to top,
    color-mix(in srgb, var(--ink) 90%, transparent) 0%,
    color-mix(in srgb, var(--ink) 55%, transparent) 42%,
    transparent 100%
  );
}

.title-badge {
  position: absolute;
  top: var(--safe-y, 5%);
  left: var(--safe-x, 4%);
  z-index: 2;
  margin: 0;
  padding: 0.22rem 0.55rem;
  width: fit-content;
  background: var(--zest);
  color: var(--ink);
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: clamp(0.42rem, 3.2cqw, 0.72rem);
  font-weight: 500;
  letter-spacing: 0.04em;
}

.title-copy {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  padding: var(--safe-y, 5%) var(--safe-x, 4%);
  max-width: 92%;
}

.title-name {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 12cqw, 4.4rem);
  font-weight: 800;
  line-height: 1.05;
  color: var(--paper);
  overflow-wrap: anywhere;
}

.title-caption {
  margin: 0.45rem 0 0;
  font-family: var(--font-body);
  font-size: clamp(0.7rem, 3.4cqw, 1.05rem);
  font-weight: 400;
  line-height: 1.35;
  color: color-mix(in srgb, var(--paper) 80%, transparent);
}

.title-missing {
  margin: 0;
  padding: 0.7rem 0.85rem;
  border: 2px dashed color-mix(in srgb, var(--paper) 45%, transparent);
  border-radius: var(--radius-chip);
  font-family: var(--font-body);
  font-size: clamp(0.85rem, 4.2cqw, 1.2rem);
  font-style: italic;
  font-weight: 400;
  color: color-mix(in srgb, var(--paper) 70%, transparent);
}

.title-missing-hint {
  margin: 0.4rem 0 0;
  font-size: clamp(0.55rem, 2.4cqw, 0.78rem);
  color: color-mix(in srgb, var(--paper) 55%, transparent);
}

.title-photo-hint {
  position: absolute;
  top: 42%;
  left: var(--safe-x, 4%);
  right: var(--safe-x, 4%);
  z-index: 2;
  margin: 0;
  text-align: center;
  font-size: clamp(0.65rem, 3cqw, 0.9rem);
  color: color-mix(in srgb, var(--paper) 60%, transparent);
  pointer-events: none;
}

.title-page.is-blank .title-scrim {
  height: 55%;
}

.map-page {
  justify-content: flex-start;
  gap: 0.55rem;
}

.map-head {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex: 0 0 auto;
  z-index: 2;
}

.map-stat.data-pill {
  position: static;
  margin: 0;
  padding: 0.22rem 0.6rem;
  font-size: clamp(0.42rem, 2.4cqw, 0.72rem);
}

.map-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 5.4cqw, 1.9rem);
  font-weight: 800;
  line-height: 1.05;
  color: var(--ink);
}

.trip-map {
  position: relative;
  flex: 1;
  width: 100%;
  min-height: 0;
  overflow: visible;
  background: var(--ink);
}

.map-sat {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  pointer-events: none;
}

.map-sat-wash {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: color-mix(in srgb, var(--paper) 10%, transparent);
}

.map-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    repeating-linear-gradient(
      to right,
      color-mix(in srgb, var(--paper) 28%, transparent) 0,
      color-mix(in srgb, var(--paper) 28%, transparent) 1px,
      transparent 1px,
      transparent 8.3%
    ),
    repeating-linear-gradient(
      to bottom,
      color-mix(in srgb, var(--paper) 28%, transparent) 0,
      color-mix(in srgb, var(--paper) 28%, transparent) 1px,
      transparent 1px,
      transparent 12.5%
    );
}

.map-route {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.map-route polyline {
  fill: none;
  stroke: color-mix(in srgb, var(--paper) 82%, var(--ink));
  stroke-width: 0.7;
  stroke-dasharray: 2.4 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.trip-map-pins {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  pointer-events: none;
}

.map-mark {
  position: absolute;
  width: 0;
  height: 0;
}

.map-pin {
  position: absolute;
  left: 0;
  top: 0;
  width: 0.7rem;
  height: 0.7rem;
  margin: -0.35rem 0 0 -0.35rem;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--zest);
}

.map-pin.is-terracotta { background: var(--terracotta); }
.map-pin.is-teal { background: var(--teal); }
.map-pin.is-coral { background: var(--coral); }
.map-pin.is-sky { background: var(--sky); }
.map-pin.is-sunshine { background: var(--sunshine); }
.map-pin.is-zest { background: var(--zest); }

.map-label {
  position: absolute;
  top: 0.48rem;
  left: 0;
  transform: translateX(-50%);
  text-align: center;
  white-space: nowrap;
  line-height: 1.15;
}

.map-mark.is-v-bottom .map-label {
  top: auto;
  bottom: 0.55rem;
}

.map-mark.is-end .map-label {
  transform: translateX(calc(-100% + 0.35rem));
  text-align: right;
}

.map-mark.is-start .map-label {
  transform: translateX(-0.2rem);
  text-align: left;
}

.map-mark.is-end.is-v-bottom .map-label,
.map-mark.is-start.is-v-bottom .map-label {
  bottom: 0.55rem;
}

.map-label strong {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(0.55rem, 2.6cqw, 0.9rem);
  font-weight: 700;
  color: var(--ink);
  text-shadow:
    0 0 4px var(--paper),
    0 1px 0 var(--paper),
    1px 0 0 var(--paper),
    -1px 0 0 var(--paper);
}

.map-label em {
  display: block;
  font-family: var(--font-body);
  font-style: normal;
  font-size: clamp(0.42rem, 2cqw, 0.68rem);
  color: var(--ink-soft);
  text-shadow:
    0 0 4px var(--paper),
    0 1px 0 var(--paper);
}

.map-empty {
  position: absolute;
  left: 50%;
  top: 48%;
  transform: translate(-50%, -50%);
  margin: 0;
  padding: 0.7rem 0.95rem;
  border: 2px dashed color-mix(in srgb, var(--ink) 35%, var(--paper));
  border-radius: var(--radius-chip);
  font-style: italic;
  color: var(--ink-soft);
  text-align: center;
  white-space: nowrap;
}

.rail-thumb .map-label,
.rail-thumb .map-stat,
.rail-thumb .map-title,
.rail-thumb .map-empty,
.rail-thumb .map-sat,
.rail-thumb .map-sat-wash {
  display: none;
}

.rail-thumb .map-pin {
  width: 0.32rem;
  height: 0.32rem;
  margin: -0.16rem 0 0 -0.16rem;
  border-width: 1px;
}

.map-pin-editor {
  display: grid;
  gap: 0.35rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid color-mix(in srgb, var(--ink) 16%, var(--paper));
}

.map-pin-editor.is-off {
  opacity: 0.55;
}

.pin-toggle {
  width: fit-content;
}

.place-page {
  background: var(--paper);
}

.place_full .place-photo {
  position: absolute;
  inset: 0;
}

.place_split {
  display: grid;
  grid-template-columns: 1.28fr 1fr;
}

.place_stack {
  display: grid;
  grid-template-rows: 1.4fr 1fr;
}

.place-photo {
  position: relative;
  min-width: 0;
  min-height: 0;
  background: var(--mist);
}

.place-photo .slot-hit,
.place-photo .slot-still,
.place-photo .slot-empty {
  position: absolute;
  inset: 0;
}

.place-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.4rem;
  padding: 10%;
  min-width: 0;
}

.place_full .place-copy {
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: 8%;
  z-index: 1;
  pointer-events: none;
  padding: 0.8rem 1rem;
  background: var(--zest);
  border: 2px solid var(--ink);
  border-radius: var(--radius-chip);
}

.place-kicker {
  margin: 0;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
}

.place_split .place-kicker,
.place_stack .place-kicker {
  width: fit-content;
  padding: 0.18rem 0.55rem;
  background: var(--zest);
  border: 2px solid var(--ink);
  border-radius: var(--radius-pill);
}

.place-name {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 4.4cqw, 1.85rem);
  font-weight: 700;
  line-height: 1.05;
  color: var(--ink);
}

.place-blurb {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--ink);
}

.place_split .place-blurb,
.place_stack .place-blurb {
  color: var(--ink-soft);
}

.slot-hit,
.slot-still {
  position: relative;
}

.slot-still {
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.spread img.is-missing {
  visibility: hidden;
}

.slot-hit:has(img.is-missing)::after,
.slot-still:has(img.is-missing)::after {
  content: "Photo could not be shown";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: var(--accent-soft);
  color: var(--ink);
  font-size: var(--size-caption);
  font-weight: 600;
  text-align: center;
}

.photo-caption,
.page-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  margin: 0;
  padding: 0.35rem 0.5rem;
  background: linear-gradient(transparent, rgba(34, 30, 27, 0.62));
  color: var(--surface);
  font-size: 0.7rem;
  line-height: 1.3;
}

.page-caption {
  z-index: 1;
}

@media (max-width: 45rem) {
  .dock {
    flex-direction: column;
    align-items: stretch;
  }

  .dock button {
    width: 100%;
  }
}

.upload-wait {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  place-items: center;
  padding: var(--gutter);
  background: var(--paper);
}

.upload-wait.is-on {
  display: grid;
}

.upload-wait[hidden] {
  display: none !important;
}

.signout-form {
  margin: 0;
}

.signout-form button {
  margin: 0;
}

.nav-email {
  color: var(--ink-soft);
  font-size: var(--size-caption);
}

.save-book {
  margin: 1.5rem 0;
  padding: 1.25rem 1.35rem;
}

.save-book form {
  margin-top: 0.75rem;
}

.save-book-status {
  margin: 0.6rem 0 0;
  font-size: var(--size-caption);
  color: var(--ink);
}

.save-book-status.error {
  color: var(--ink);
}

.save-book-ok {
  color: var(--ink);
  background: var(--accent-soft);
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius-bubble);
}

.save-book-again {
  margin-top: 0.65rem;
}

.save-book-inline {
  margin: 0.75rem 0 1rem;
  padding: 0;
  flex: 1 1 18rem;
  min-width: min(100%, 16rem);
}

.save-book-inline form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.5rem 0.75rem;
  margin: 0;
}

.save-book-inline .text-field {
  flex: 1 1 12rem;
  margin: 0;
}

.save-book-inline .save-book-status {
  flex: 1 1 100%;
  margin: 0;
}

.save-book-inline .save-book-again,
.save-book-inline .save-book-send {
  margin: 0;
}

.legal h2 {
  margin-top: 1.75rem;
}

.legal ul,
.legal ol {
  padding-left: 1.25rem;
  margin: 0 0 1rem;
}

.legal li {
  margin: 0 0 0.45rem;
}

.upload-wait-card {
  width: min(100%, 22rem);
  padding: 2rem 1.5rem;
  text-align: center;
}

.upload-wait-spinner {
  width: 2.5rem;
  height: 2.5rem;
  margin: 0 auto 1rem;
  border: 3px solid var(--ink);
  border-top-color: var(--zest);
  border-radius: 50%;
  animation: upload-spin 0.7s linear infinite;
}

.upload-wait-copy {
  margin: 0;
  color: var(--ink-soft);
}

.upload-wait-progress {
  margin-top: 1.25rem;
}

.upload-wait-bar {
  height: 0.75rem;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--surface);
  overflow: hidden;
}

.upload-wait-bar-fill {
  display: block;
  width: 0;
  height: 100%;
  background: var(--zest);
  border-radius: 999px;
  transition: width 0.2s ease-out;
}

.upload-wait-bar-fill.is-unknown {
  width: 30%;
  animation: upload-indeterminate 1.1s ease-in-out infinite;
}

.upload-wait-pct {
  display: inline-block;
  margin-top: 0.75rem;
}

.upload-wait-back {
  margin-top: 1.25rem;
}

body.is-uploading {
  overflow: hidden;
}

@keyframes upload-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes upload-indeterminate {
  0% {
    transform: translateX(-80%);
  }
  100% {
    transform: translateX(280%);
  }
}

/* ---------- Wayfarer marketing ---------- */

body.is-market {
  --size-display: clamp(2.25rem, 6vw, 3.875rem);
  --header-height: 5.5rem;
  --section-space: clamp(4rem, 10vw, 7.5rem);
  background: var(--paper);
}

body.is-market .site-header {
  background: transparent;
  border-bottom: 0;
}

body.is-market .site-nav {
  align-items: center;
  gap: 1.5rem;
  font-size: 1rem;
}

body.is-market .header-cta {
  margin-left: 0;
  padding: 0.65rem 1.35rem;
}

body.is-market .button-secondary {
  background: transparent;
  color: var(--ink);
  border: 2px solid var(--ink);
  box-shadow: none;
}

body.is-market .button-secondary:hover {
  background: var(--surface-0);
  color: var(--ink);
  box-shadow: var(--shadow-soft);
}

body.is-market .scene {
  background: transparent;
}

body.is-market .board {
  background: var(--surface-0);
  border: 0;
  box-shadow: var(--shadow-soft);
}

body.is-market .home .hero,
body.is-market .home .values,
body.is-market .home .how,
body.is-market .home .formats,
body.is-market .home .start-band,
body.is-market .home .trust-band {
  padding-block: var(--section-space);
}

body.is-market .home .hero {
  padding-top: clamp(4rem, 10vw, 7rem);
}

body.is-market .hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 3rem;
  align-items: center;
}

@container home (min-width: 64rem) {
  body.is-market .hero-grid {
    grid-template-columns: 1.05fr 0.95fr;
    gap: 4rem;
  }
}

body.is-market .kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  background: none;
  color: var(--terracotta);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

body.is-market .kicker svg {
  width: 1rem;
  height: 1rem;
  flex: 0 0 auto;
}

body.is-market .home .display {
  max-width: 11ch;
  margin: 1.1rem 0 0;
  line-height: 1.04;
  letter-spacing: -0.02em;
}

body.is-market .hero-copy .lede {
  margin: 1.35rem 0 2rem;
  max-width: 30rem;
  color: var(--ink-soft);
}

body.is-market .hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 0;
}

body.is-market .hero-photo-stage {
  position: relative;
}

body.is-market .hero-photo-backdrop {
  position: absolute;
  top: 6%;
  left: 10%;
  width: 88%;
  height: 88%;
  border-radius: 32px;
  background: linear-gradient(135deg, #efddcb 0%, #e7c9ae 100%);
  transform: rotate(4deg);
  z-index: 0;
}

body.is-market .hero-blob {
  position: relative;
  z-index: 1;
  margin: 0;
  aspect-ratio: 6 / 5;
  border-radius: var(--blob);
  overflow: hidden;
  box-shadow: var(--shadow-lift);
}

body.is-market .hero-blob img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

body.is-market .section-heading {
  text-align: center;
  max-width: 40rem;
  margin: 0 auto 3rem;
}

body.is-market .section-heading .kicker {
  justify-content: center;
}

body.is-market .section-heading h2 {
  margin: 0.85rem 0 0;
}

body.is-market .home .card {
  background: var(--surface-card);
  border: 0;
}

body.is-market .home .card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lift);
}

body.is-market .feature-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  padding: 2rem;
}

body.is-market .feature-card h3,
body.is-market .feature-card p {
  text-align: left;
  max-width: none;
  margin: 0;
  padding: 0;
}

body.is-market .feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: var(--radius-chip);
  background: var(--ink);
  color: var(--on-ink);
}

body.is-market .feature-icon svg {
  width: 1.6rem;
  height: 1.6rem;
  stroke: var(--on-ink);
}

body.is-market .feature-card h3 {
  margin-top: 1.35rem;
}

body.is-market .feature-card p {
  margin-top: 0.65rem;
  color: var(--ink-soft);
}

body.is-market .feature-more {
  margin-top: 1rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--terracotta);
  text-decoration: none;
}

body.is-market .feature-more::after {
  content: " →";
}

body.is-market .feature-more:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

body.is-market .format-prices {
  border-top: 1px solid var(--border-soft);
}

body.is-market .format-photo img {
  border-radius: 1.5rem 1.5rem 0 0;
}

body.is-market .data-pill {
  background: var(--surface-0);
  color: var(--ink);
  box-shadow: var(--shadow-soft);
}

body.is-market .trust-band {
  background: transparent;
}

body.is-market .trust-card {
  background: var(--surface-card);
  border: 0;
  color: var(--ink);
  box-shadow: var(--shadow-soft);
}

body.is-market .trust-card h2,
body.is-market .trust-card p {
  color: var(--ink);
}

body.is-market .dock input[type="file"] {
  border: 1px solid var(--border-soft);
}

