/*
 * waffle.page — site stylesheet.
 *
 * Direction (docs/audience-and-design.md): the page is a library. A catalogue
 * serif for the voice (Bodoni Moda), a plain grotesque for reading (Hanken
 * Grotesk), and a monospace for anything that is a file or a property (IBM
 * Plex Mono). Colour comes from the collections themselves — torii vermilion,
 * saffron, leaf, camel, clay, oxblood — on a warm paper and a deep ink.
 *
 * Rules: colours only through the custom properties below; type in rem or
 * clamp(), never px; every animation and transition disappears under
 * prefers-reduced-motion; zero third-party requests.
 */

@font-face {
  font-family: 'Bodoni Moda';
  font-style: normal;
  font-display: swap;
  font-weight: 400 900;
  src: url('/assets/fonts/bodoni-moda-latin-opsz-normal.woff2') format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Bodoni Moda';
  font-style: italic;
  font-display: swap;
  font-weight: 400 900;
  src: url('/assets/fonts/bodoni-moda-latin-opsz-italic.woff2') format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Hanken Grotesk';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('/assets/fonts/hanken-grotesk-latin-wght-normal.woff2') format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url('/assets/fonts/ibm-plex-mono-latin-400-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-display: swap;
  font-weight: 500;
  src: url('/assets/fonts/ibm-plex-mono-latin-500-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light dark;

  --font-display: 'Bodoni Moda', 'Didot', 'Bodoni 72', Georgia, serif;
  --font-body: 'Hanken Grotesk', 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-micro: 160ms;
  --dur-component: 260ms;
  --dur-view: 700ms;

  /* Paper and ink. Contrast: ink/paper 15.4:1, dim/paper 6.7:1, accent/paper 5.1:1. */
  --paper: #f3efe7;
  --paper-2: #e9e3d7;
  --paper-3: #ddd5c6;
  --ink: #1b1815;
  --ink-dim: #5b5249;
  --rule: color-mix(in srgb, var(--ink) 16%, transparent);
  --rule-strong: color-mix(in srgb, var(--ink) 70%, transparent);
  --accent: #b8361a;        /* torii vermilion, text-safe */

  /* Collection colours, taken from the sample photos. Decorative only. */
  --c-vermilion: #d2401e;
  --c-saffron: #e2a42b;
  --c-leaf: #2f6b3a;
  --c-camel: #b07a45;
  --c-clay: #c9877f;
  --c-oxblood: #7b2d26;

  /* The dark band keeps its own ink/paper so it reads dark in both themes. */
  --band-bg: #1b1815;
  --band-fg: #efe8dc;
  --band-dim: #a89f90;
  --band-rule: color-mix(in srgb, #efe8dc 18%, transparent);
  --band-accent: #ff7a52;

  --focus: var(--accent);
  --radius: 0.25rem;
  --radius-card: 0.375rem;
  --shadow-lift: 0 1px 1px rgb(27 24 21 / 6%), 0 12px 32px -8px rgb(27 24 21 / 22%);

  --page: 78rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  --header-h: 3.75rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    /* Contrast: ink/paper 15.2:1, dim/paper 7.1:1, accent/paper 7.2:1. */
    --paper: #16130f;
    --paper-2: #211d18;
    --paper-3: #2d2822;
    --ink: #efe8dc;
    --ink-dim: #a89f90;
    --accent: #ff7a52;
    --band-bg: #221e19;
    --shadow-lift: 0 1px 1px rgb(0 0 0 / 40%), 0 12px 32px -8px rgb(0 0 0 / 60%);
  }
}

/* ── Base ─────────────────────────────────────────────────────────────── */

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1rem);
}

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

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

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.04;
  letter-spacing: -0.015em;
  margin: 0 0 0.5em;
  font-variation-settings: 'opsz' 36;
  text-wrap: balance;
}
h1 em, h2 em, h3 em { font-style: italic; color: var(--accent); }

h1 { font-size: clamp(2.6rem, 6.4vw, 5.6rem); }
h2 { font-size: clamp(2.25rem, 5.6vw, 4.75rem); }
h3 { font-size: clamp(1.375rem, 2.4vw, 1.75rem); line-height: 1.15; }

p { margin: 0 0 1em; }

a { color: inherit; text-decoration-color: color-mix(in srgb, currentColor 45%, transparent); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-color: currentColor; }

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

code, kbd, pre { font-family: var(--font-mono); }
code { font-size: 0.86em; padding: 0.05em 0.35em; border-radius: var(--radius); background: var(--paper-2); }

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

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -4rem;
  z-index: 20;
  padding: 0.5rem 1rem;
  background: var(--ink);
  color: var(--paper);
  font-weight: 600;
}
.skip-link:focus { top: 0.75rem; }

.wrap {
  width: 100%;
  max-width: var(--page);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.kicker {
  display: flex;
  align-items: center;
  gap: 0.6em;
  margin: 0 0 1.1rem;
  font-family: var(--font-mono);
  font-size: clamp(0.72rem, 1.6vw, 0.8rem);
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

/* ── Header / footer ─────────────────────────────────────────────────── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: var(--header-h);
  max-width: none;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-style: italic;
  font-size: 1.5rem;
  letter-spacing: -0.01em;
  text-decoration: none;
}
.brand img { width: 1.6rem; height: 1.6rem; }

.site-nav { margin-left: auto; }
.site-nav ul {
  display: flex;
  align-items: center;
  gap: clamp(0.5rem, 2.2vw, 1.75rem);
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-nav a:not(.button) {
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.375rem 0;
}
.site-nav a:not(.button):hover { text-decoration: underline; }
.site-nav .nav-secondary { display: none; }
@media (min-width: 48rem) { .site-nav .nav-secondary { display: list-item; } }

.site-footer {
  border-top: 1px solid var(--rule);
  padding: clamp(2.5rem, 6vw, 4rem) 0 3rem;
  font-size: 0.9375rem;
  color: var(--ink-dim);
}
.site-footer .wrap { display: grid; gap: 1.5rem; }
@media (min-width: 48rem) {
  .site-footer .wrap { grid-template-columns: 1fr auto; align-items: end; }
}
.site-footer strong { font-family: var(--font-display); font-style: italic; font-weight: 600; font-size: 1.25rem; color: var(--ink); }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; }
.site-footer a { color: var(--ink); }
.site-footer p { margin: 0.25rem 0; }
.site-footer .credit { font-size: 0.8125rem; }
.wordmark {
  margin: 0 0 clamp(1.5rem, 4vw, 3rem);
  padding: 0 var(--gutter);
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(5rem, 24vw, 21rem);
  line-height: 0.8;
  letter-spacing: -0.035em;
  color: var(--ink);
  text-align: center;
  overflow: hidden;
}
.wordmark::first-letter { color: var(--accent); }

/* ── Buttons ─────────────────────────────────────────────────────────── */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-height: 2.875rem;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius);
  border: 1px solid var(--ink);
  font-family: var(--font-body);
  font-weight: 650;
  font-size: 1rem;
  letter-spacing: 0.005em;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color var(--dur-micro) var(--ease-out), color var(--dur-micro) var(--ease-out), transform var(--dur-micro) var(--ease-out);
}
.button-primary { background: var(--ink); color: var(--paper); }
.button-primary:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.button-quiet { background: transparent; color: var(--ink); }
.button-quiet:hover { background: var(--paper-2); }
.site-header .button { min-height: 2.375rem; padding: 0.35rem 0.95rem; font-size: 0.9375rem; }
@media (prefers-color-scheme: dark) {
  .button-primary:hover { color: #16130f; }
}

/* ── Hero: the wall ──────────────────────────────────────────────────── */

.hero {
  position: relative;
  height: min(calc(100svh - var(--header-h)), 60rem);
  min-height: 36rem;
  overflow: hidden;
  background: var(--paper-2);
  isolation: isolate;
}

.wall {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(0.5rem, 1.1vw, 1rem);
  padding: 0 clamp(0.5rem, 1.1vw, 1rem);
}
@media (min-width: 40rem) { .wall { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 60rem) { .wall { grid-template-columns: repeat(5, 1fr); } }
@media (min-width: 80rem) { .wall { grid-template-columns: repeat(6, 1fr); } }
.wall-col:nth-child(n + 3) { display: none; }
@media (min-width: 40rem) { .wall-col:nth-child(3) { display: block; } }
@media (min-width: 60rem) { .wall-col:nth-child(4), .wall-col:nth-child(5) { display: block; } }
@media (min-width: 80rem) { .wall-col:nth-child(6) { display: block; } }

.wall-col {
  --speed: 150s;
  animation: drift var(--speed) linear infinite;
  will-change: transform;
}
.wall-col:nth-child(1) { --speed: 170s; margin-top: -4rem; }
.wall-col:nth-child(2) { --speed: 130s; margin-top: -11rem; }
.wall-col:nth-child(3) { --speed: 190s; margin-top: -2rem; }
.wall-col:nth-child(4) { --speed: 145s; margin-top: -9rem; }
.wall-col:nth-child(5) { --speed: 175s; margin-top: -5rem; }
.wall-col:nth-child(6) { --speed: 140s; margin-top: -13rem; }
@keyframes drift {
  from { transform: translateY(0); }
  to { transform: translateY(-50%); }
}
.hero:has(.wall-toggle:checked) .wall-col { animation-play-state: paused; }

.wall-run {
  list-style: none;
  margin: 0;
  padding: 0 0 clamp(0.5rem, 1.1vw, 1rem);
  display: grid;
  gap: clamp(0.5rem, 1.1vw, 1rem);
}
.tile {
  margin: 0;
  animation: tile-in 900ms var(--ease-out) both;
}
.wall-col:nth-child(2) .tile { animation-delay: 80ms; }
.wall-col:nth-child(3) .tile { animation-delay: 160ms; }
.wall-col:nth-child(4) .tile { animation-delay: 240ms; }
.wall-col:nth-child(5) .tile { animation-delay: 320ms; }
.wall-col:nth-child(6) .tile { animation-delay: 400ms; }
@keyframes tile-in { from { opacity: 0; transform: translateY(1.5rem); } }

.tile img {
  width: 100%;
  border-radius: var(--radius-card);
  background: var(--paper-3);
}
.tile-cap {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.4rem 0.1rem 0;
  font-family: var(--font-mono);
  font-size: clamp(0.66rem, 0.9vw, 0.72rem);
  line-height: 1.3;
}
.tile-title { color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-folder { color: var(--ink-dim); white-space: nowrap; }

/* The placard: a museum label pinned over the wall. */
.placard {
  position: absolute;
  z-index: 2;
  left: clamp(0.5rem, 1.1vw, 1rem);
  right: clamp(0.5rem, 1.1vw, 1rem);
  bottom: clamp(0.5rem, 3vw, 2.5rem);
  max-width: 48rem;
  padding: clamp(1.25rem, 3.4vw, 2.5rem);
  background: var(--paper);
  border-top: 0.375rem solid var(--ink);
  box-shadow: var(--shadow-lift);
  animation: placard-in 1100ms var(--ease-out) 250ms both;
}
@keyframes placard-in { from { opacity: 0; transform: translateY(2rem); } }
.nowrap { white-space: nowrap; }
.placard h1 { font-size: clamp(2.3rem, 4.2vw, 3.75rem); margin-bottom: 0.4em; }
.placard h1 .l { display: block; }
.placard .lede {
  max-width: 34rem;
  font-size: clamp(1.02rem, 1.9vw, 1.2rem);
  color: var(--ink-dim);
  margin-bottom: 1.5rem;
}
.placard .kicker { color: var(--ink); }
.placard .dot {
  width: 0.55rem; height: 0.55rem;
  border-radius: 50%;
  background: var(--c-vermilion);
  box-shadow: 0.85rem 0 0 var(--c-saffron), 1.7rem 0 0 var(--c-leaf);
  margin-right: 1.8rem;
}
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.fineprint { margin: 1rem 0 0; font-size: 0.875rem; color: var(--ink-dim); }

/* Pause control: a real checkbox, so it works without script. */
.wall-toggle {
  position: absolute;
  opacity: 0;
  width: 1px; height: 1px;
  pointer-events: none;
}
.wall-pause {
  position: absolute;
  z-index: 3;
  top: 1rem;
  right: var(--gutter);
  padding: 0.35rem 0.7rem;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
}
.wall-pause::before { content: '❙❙ '; letter-spacing: -0.1em; }
.wall-toggle:checked + .wall-pause::before { content: '▶ '; }
.wall-toggle:focus-visible + .wall-pause { outline: 2px solid var(--focus); outline-offset: 3px; }
.wall-pause .when-paused { display: none; }
.wall-toggle:checked + .wall-pause .when-paused { display: inline; }
.wall-toggle:checked + .wall-pause .when-running { display: none; }

@media (max-width: 39.99rem) {
  .hero { min-height: 40rem; }
  .placard { left: 0.75rem; right: 0.75rem; bottom: 0.75rem; }
  .placard .actions .button { flex: 1 1 auto; }
}

/* ── Sections ────────────────────────────────────────────────────────── */

.section { padding: clamp(4rem, 10vw, 8rem) 0 0; }
.section-head { max-width: 50rem; margin-bottom: clamp(2rem, 5vw, 3.5rem); }
.section-head p:not(.kicker) { color: var(--ink-dim); font-size: clamp(1.05rem, 2vw, 1.25rem); max-width: 40rem; }
.section-head .kicker::after {
  content: '';
  flex: 1;
  max-width: 6rem;
  height: 1px;
  background: var(--rule-strong);
}

/* 01 — what it is */
.triad {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0;
  border-top: 1px solid var(--rule-strong);
}
@media (min-width: 56rem) { .triad { grid-template-columns: repeat(3, 1fr); } }
.triad li {
  padding: 1.75rem 0 1.5rem;
  border-bottom: 1px solid var(--rule);
}
@media (min-width: 56rem) {
  .triad li { padding: 2rem 2rem 0 0; border-bottom: 0; }
  .triad li + li { padding-left: 2rem; border-left: 1px solid var(--rule); }
}
.triad h3 { font-size: clamp(1.75rem, 3vw, 2.4rem); }
.triad .num { font-style: italic; color: var(--accent); margin-right: 0.15em; }
.triad p { color: var(--ink-dim); margin: 0; }

/* 02 — views: a sticky stage re-sorted by the steps beside it */
.views-body {
  display: grid;
  gap: clamp(1.5rem, 4vw, 4rem);
}
@media (min-width: 60rem) {
  .views-body { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: start; }
  .stage-col { order: 2; height: 100%; }
}
.stage-sticky {
  position: sticky;
  top: calc(var(--header-h) + 1rem);
}
@media (max-width: 59.99rem) {
  .views-body { display: block; }
  .stage-col { display: contents; }
  .stage-sticky {
    top: var(--header-h);
    z-index: 4;
    padding: 0.75rem 0 0.5rem;
    background: var(--paper);
    margin: 0 calc(-1 * var(--gutter));
    padding-inline: var(--gutter);
    border-bottom: 1px solid var(--rule);
  }
}

.view-tabs {
  display: none;
  gap: 0;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid var(--rule);
}
.js .view-tabs { display: flex; }
.view-tab {
  appearance: none;
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  padding: 0.5rem 0.9rem 0.55rem;
  font-family: var(--font-mono);
  font-size: clamp(0.72rem, 1.8vw, 0.8125rem);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-dim);
  cursor: pointer;
}
.view-tab:hover { color: var(--ink); }
.view-tab[aria-pressed='true'] { color: var(--ink); border-bottom-color: var(--accent); }

.stage {
  position: relative;
  aspect-ratio: 1000 / 765;
  overflow: hidden;
  border-radius: var(--radius-card);
  background: var(--paper-2);
  view-transition-name: stage;
}
@media (max-width: 59.99rem) { .stage { aspect-ratio: 1000 / 700; } }
.stage-note {
  margin: 0.6rem 0 0;
  font-size: 0.8125rem;
  color: var(--ink-dim);
}
@media (max-width: 59.99rem) { .stage-note { display: none; } }

.stage-bg > * { position: absolute; inset: 0; opacity: 0; transition: opacity var(--dur-view) var(--ease-out); }
.stage[data-view='table'] .bg-table,
.stage[data-view='map'] .bg-map,
.stage[data-view='calendar'] .bg-cal { opacity: 1; }

/* Map backdrop: Kyoto's street grid, its two rivers, the hills. */
.bg-map { width: 100%; height: 100%; }
.bg-map .hills { fill: color-mix(in srgb, var(--c-leaf) 14%, var(--paper-2)); }
.bg-map .park { fill: color-mix(in srgb, var(--c-leaf) 20%, var(--paper-2)); }
.bg-map .streets { fill: none; stroke: var(--paper-3); stroke-width: 5; }
.bg-map .river { fill: none; stroke: color-mix(in srgb, #3f7fa6 45%, var(--paper-2)); stroke-width: 7; stroke-linecap: round; stroke-linejoin: round; }
.bg-map .river.wide { stroke-width: 11; }

/* Item geometry per view. Positions per item are generated (see bottom). */
.stage-items {
  list-style: none;
  margin: 0;
  padding: 0;
  position: absolute;
  inset: 0;
}
.si { position: relative; }
.si img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--radius); }
.si > span { display: none; }

/* Masonry */
.stage[data-view='masonry'] .stage-items {
  columns: 4;
  column-gap: 0.6rem;
  padding: 0.6rem;
}
@media (max-width: 39.99rem) {
  .stage[data-view='masonry'] .stage-items { columns: 4; column-gap: 0.35rem; padding: 0.35rem; }
  .stage[data-view='masonry'] .si { margin-bottom: 0.35rem; }
  .stage[data-view='masonry'] .si-title { display: none !important; }
}
.stage[data-view='masonry'] .si { break-inside: avoid; margin-bottom: 0.6rem; }
.stage[data-view='masonry'] .si img { height: auto; }
.stage[data-view='masonry'] .si-title {
  display: block;
  padding: 0.25rem 0.05rem 0;
  font-family: var(--font-mono);
  font-size: clamp(0.62rem, 1vw, 0.7rem);
  line-height: 1.25;
}

/* Table */
.stage[data-view='table'] .stage-items { padding-top: 2.1rem; }
.bg-table,
.stage[data-view='table'] .si {
  display: grid;
  grid-template-columns: 2.1rem minmax(0, 1.6fr) minmax(0, 1.1fr) minmax(0, 0.8fr) minmax(0, 0.7fr);
  gap: 0 0.8rem;
  align-items: center;
  padding: 0 0.75rem;
}
.bg-table {
  bottom: auto;
  height: 2.1rem;
  font-family: var(--font-mono);
  font-size: clamp(0.62rem, 1.1vw, 0.7rem);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-dim);
  border-bottom: 1px solid var(--rule-strong);
}
.stage[data-view='table'] .si {
  height: calc((100% - 2.1rem) / 13);
  border-bottom: 1px solid var(--rule);
  font-size: clamp(0.7rem, 1.25vw, 0.84rem);
}
.stage[data-view='table'] .si picture { display: block; }
.stage[data-view='table'] .si img { width: 1.6rem; height: 1.6rem; }
.stage[data-view='table'] .si > span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stage[data-view='table'] .si-title { font-weight: 600; }
.stage[data-view='table'] .si-date,
.stage[data-view='table'] .si-cat { font-family: var(--font-mono); font-size: 0.92em; color: var(--ink-dim); }
.stage[data-view='table'] .si-status {
  justify-self: start;
  padding: 0 0.45em;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 0.85em;
}
.stage[data-view='table'] .si-status[data-s='booked'] { border-color: var(--accent); color: var(--accent); }
@media (max-width: 39.99rem) {
  .bg-table, .stage[data-view='table'] .si { grid-template-columns: 1.7rem minmax(0, 1.4fr) minmax(0, 1.2fr) minmax(0, 0.9fr); gap: 0 0.5rem; padding: 0 0.5rem; }
  .bg-table .c-cat, .stage[data-view='table'] .si-cat { display: none !important; }
  .stage[data-view='table'] .si img { width: 0.85rem; height: 0.85rem; border-radius: 0.1rem; }
  .stage[data-view='table'] .si { font-size: 0.66rem; }
}

/* Map */
.stage[data-view='map'] .si {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: clamp(1.9rem, 5vw, 2.9rem);
  aspect-ratio: 1;
  translate: -50% -50%;
  border-radius: 50%;
  border: 2px solid var(--paper);
  box-shadow: 0 0 0 1.5px var(--accent), var(--shadow-lift);
  background: var(--paper);
}
.stage[data-view='map'] .si img { border-radius: 50%; }

/* Calendar: Sunday-first, October 11–24, 2026, like the app's month grid. */
.bg-cal,
.stage[data-view='calendar'] .stage-items {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  grid-template-rows: 1.8rem 1.5rem repeat(3, minmax(0, 1fr)) 1.5rem repeat(3, minmax(0, 1fr));
}
.bg-cal .wd {
  grid-row: 1;
  align-self: center;
  padding-left: 0.45rem;
  font-family: var(--font-mono);
  font-size: clamp(0.58rem, 1vw, 0.68rem);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-dim);
}
.bg-cal .day {
  grid-row: span 4;
  padding: 0.25rem 0.45rem;
  border-top: 1px solid var(--rule);
  border-left: 1px solid var(--rule);
  font-family: var(--font-mono);
  font-size: clamp(0.6rem, 1vw, 0.72rem);
  color: var(--ink-dim);
}
.bg-cal .day:nth-child(7n + 1) { border-left: 0; }
.bg-cal .day:nth-child(n + 8):nth-child(-n + 14) { grid-row: 2 / span 4; }
.bg-cal .day:nth-child(n + 15) { grid-row: 6 / span 4; }
.stage[data-view='calendar'] .si {
  grid-column: var(--dc);
  grid-row: var(--dr);
  margin: 0.12rem 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  min-width: 0;
  padding: 0.12rem;
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--c-vermilion) 16%, var(--paper));
  font-size: clamp(0.58rem, 0.95vw, 0.7rem);
  line-height: 1.15;
  overflow: hidden;
}
.stage[data-view='calendar'] .si picture { display: block; flex: none; }
.stage[data-view='calendar'] .si img { width: 1.4rem; height: 1.4rem; }
.stage[data-view='calendar'] .si-title { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 39.99rem) {
  .stage[data-view='calendar'] .si { justify-content: center; margin: 0.08rem 0.1rem; }
  .stage[data-view='calendar'] .si-title { display: none; }
  .stage[data-view='calendar'] .si img { width: 1.15rem; height: 1.15rem; }
}

/* View transitions: only the items move; the page itself never cross-fades. */
::view-transition-old(root),
::view-transition-new(root) { animation: none; }
::view-transition-group(*) { animation-duration: var(--dur-view); animation-timing-function: var(--ease-out); }
::view-transition-old(stage),
::view-transition-new(stage) { animation-duration: var(--dur-view); }

/* Steps */
.steps { list-style: none; margin: 0; padding: 0; }
.step {
  min-height: 78vh;
  padding: clamp(2rem, 8vh, 5rem) 0;
  border-top: 1px solid var(--rule);
}
.step:first-child { border-top: 0; padding-top: 0.5rem; }
@media (max-width: 59.99rem) { .step { min-height: 0; padding: 2.5rem 0; } }
.step .kicker { color: var(--accent); }
.step h3 { font-size: clamp(1.9rem, 3.4vw, 2.75rem); }
.step > p:not(.kicker) { color: var(--ink-dim); max-width: 32rem; }

.shot { margin: 1.75rem 0 0; }
.shot img {
  width: 100%;
  border-radius: var(--radius-card);
  border: 1px solid var(--rule);
  box-shadow: var(--shadow-lift);
}
.shot figcaption, .phone figcaption, .finder figcaption {
  margin-top: 0.7rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--ink-dim);
}

.layouts-row {
  display: grid;
  gap: 1.5rem;
  margin-top: clamp(2rem, 5vw, 4rem);
  padding-top: 2rem;
  border-top: 1px solid var(--rule-strong);
}
@media (min-width: 56rem) { .layouts-row { grid-template-columns: 1fr 1fr; align-items: start; } }
.layouts-row p { margin: 0; color: var(--ink-dim); max-width: 34rem; }
.layouts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.layouts li {
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
}

/* 03 — your files */
.files-body {
  display: grid;
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: center;
}
@media (min-width: 64rem) { .files-body { grid-template-columns: minmax(0, 8fr) minmax(0, 3fr); } }

.finder { margin: 0; }
.finder-bar {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  height: 2.4rem;
  padding: 0 0.9rem;
  background: var(--paper-3);
  border: 1px solid var(--rule);
  border-bottom: 0;
  border-radius: 0.6rem 0.6rem 0 0;
}
.finder-bar span { width: 0.7rem; height: 0.7rem; border-radius: 50%; background: color-mix(in srgb, var(--ink) 22%, transparent); }
.finder-bar b {
  margin: 0 auto;
  padding-right: 3rem;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.875rem;
}
.finder-cols {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.25fr) minmax(0, 1.5fr);
  min-height: 24rem;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 0 0 0.6rem 0.6rem;
  box-shadow: var(--shadow-lift);
  overflow: hidden;
}
.fcol {
  list-style: none;
  margin: 0;
  padding: 0.5rem 0.35rem;
  border-right: 1px solid var(--rule);
  font-size: clamp(0.72rem, 1.2vw, 0.84rem);
  min-width: 0;
}
.fcol li {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.18rem 0.5rem;
  border-radius: var(--radius);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fcol li::before {
  content: '';
  flex: none;
  width: 0.95rem;
  height: 0.78rem;
}
.fcol .is-dir::before { background: color-mix(in srgb, #3f7fa6 60%, var(--paper)); border-radius: 0.12rem 0.3rem 0.12rem 0.12rem; }
.fcol .is-md::before { height: 0.95rem; width: 0.75rem; border: 1px solid var(--ink-dim); border-radius: 0.1rem; background: var(--paper); margin-inline: 0.1rem; }
.fcol .is-base::before { height: 0.95rem; width: 0.75rem; border-radius: 0.1rem; background: var(--c-saffron); margin-inline: 0.1rem; }
.fcol .is-dir::after { content: '›'; margin-left: auto; color: var(--ink-dim); }
.fcol .is-open { background: var(--ink); color: var(--paper); }
.fcol .is-open::after { color: var(--paper); }
.fcol-files { max-height: 26rem; overflow: hidden; }
.fcol-preview { padding: 1rem 1.1rem; border-right: 0; background: var(--paper-2); }
.fname { margin: 0 0 0.75rem; font-family: var(--font-mono); font-size: 0.75rem; color: var(--ink-dim); }
.fcol-preview pre { margin: 0; white-space: pre-wrap; }
.fcol-preview code {
  display: block;
  padding: 0;
  background: none;
  font-size: clamp(0.68rem, 1.1vw, 0.8rem);
  line-height: 1.6;
  color: var(--ink);
}
.fcol-preview .fm { color: var(--ink-dim); }
.fcol-preview .emb { color: var(--accent); }
@media (max-width: 47.99rem) {
  .finder-cols { grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); }
  .fcol-root { display: none; }
}
@media (max-width: 29.99rem) {
  .finder-cols { grid-template-columns: 1fr; }
  .fcol-files { max-height: 9.6rem; border-right: 0; border-bottom: 1px solid var(--rule); }
  .fcol-files li:not(.is-open):nth-child(-n + 7) { display: none; }
}

.becomes { display: grid; justify-items: center; gap: 0.75rem; }
.becomes-label {
  margin: 0;
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  color: var(--accent);
}
.becomes-label::before { content: '↓ '; font-style: normal; }
@media (min-width: 64rem) { .becomes-label::before { content: '→ '; } }
.card-demo {
  width: min(100%, 20rem);
  background: var(--paper);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-lift);
  overflow: hidden;
  border: 1px solid var(--rule);
}
.card-demo .card-body { padding: 0.9rem 1rem 1rem; }
.card-demo h3 { font-size: 1.5rem; margin-bottom: 0.5rem; }
.props { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 0.35rem 1rem; }
.props div { display: flex; justify-content: space-between; gap: 0.5rem; border-bottom: 1px dotted var(--rule-strong); }
.props dt, .props dd { margin: 0; font-family: var(--font-mono); font-size: 0.75rem; }
.props dt { color: var(--ink-dim); }

@supports (animation-timeline: view()) {
  .card-demo { animation: card-rise linear both; animation-timeline: view(); animation-range: entry 5% cover 35%; }
}
@keyframes card-rise { from { transform: translateY(4rem) rotate(-3deg); } }

.files-points {
  list-style: none;
  margin: clamp(2rem, 5vw, 3.5rem) 0 0;
  padding: 0;
  display: grid;
  gap: 1.25rem 2.5rem;
  border-top: 1px solid var(--rule-strong);
  padding-top: 1.75rem;
}
@media (min-width: 56rem) { .files-points { grid-template-columns: repeat(3, 1fr); } }
.files-points li { color: var(--ink-dim); }
.files-points strong { display: block; color: var(--ink); font-family: var(--font-display); font-weight: 600; font-size: 1.3rem; line-height: 1.2; margin-bottom: 0.3rem; }

/* 04 — capture */
.capture-grid { display: grid; gap: clamp(2rem, 5vw, 4rem); align-items: start; }
@media (min-width: 56rem) { .capture-grid { grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); } }
.ledger { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule-strong); }
.ledger li {
  display: grid;
  grid-template-columns: 7rem minmax(0, 1fr);
  gap: 1rem;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--rule);
}
@media (max-width: 29.99rem) { .ledger li { grid-template-columns: 1fr; gap: 0.3rem; } }
.ledger-tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  padding-top: 0.2rem;
}
.ledger p { margin: 0; color: var(--ink-dim); }
.ledger strong { color: var(--ink); font-weight: 650; }
.after-list { margin-top: 1.5rem; font-family: var(--font-display); font-style: italic; font-size: clamp(1.2rem, 2.2vw, 1.5rem); line-height: 1.3; }
kbd {
  display: inline-block;
  min-width: 1.5em;
  padding: 0 0.3em;
  margin: 0 0.1em;
  border: 1px solid var(--rule-strong);
  border-bottom-width: 2px;
  border-radius: var(--radius);
  background: var(--paper);
  font-size: 0.85em;
  text-align: center;
  color: var(--ink);
}
.phone { margin: 0; justify-self: center; max-width: 18rem; }
.phone img {
  border-radius: 1.6rem;
  border: 0.45rem solid var(--ink);
  box-shadow: var(--shadow-lift);
}

/* 05 + 06 — the dark band: sync and privacy */
.dark-band {
  margin-top: clamp(4rem, 10vw, 8rem);
  padding-bottom: clamp(4rem, 10vw, 7rem);
  background: var(--band-bg);
  color: var(--band-fg);
  --ink: var(--band-fg);
  --ink-dim: var(--band-dim);
  --rule: var(--band-rule);
  --rule-strong: color-mix(in srgb, var(--band-fg) 55%, transparent);
  --accent: var(--band-accent);
  --focus: var(--band-accent);
}
.dark-band .section { padding-top: clamp(4rem, 9vw, 7rem); }
.columns-3, .columns-2 {
  display: grid;
  gap: 2rem 3rem;
  border-top: 1px solid var(--rule-strong);
  padding-top: 1.75rem;
}
@media (min-width: 56rem) { .columns-3 { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 48rem) { .columns-2 { grid-template-columns: 1fr 1fr; } }
.columns-3 h3, .columns-2 h3 { font-size: clamp(1.5rem, 2.6vw, 2rem); }
.columns-3 p, .columns-2 p { color: var(--ink-dim); margin: 0; }
.dark-band .note {
  margin: 2.5rem 0 0;
  padding: 1.5rem 0 0 1.5rem;
  border-left: 3px solid var(--accent);
  max-width: 52rem;
  color: var(--ink-dim);
  font-size: 0.975rem;
}
.dark-band .note strong { color: var(--ink); }
.dark-band code { background: color-mix(in srgb, var(--band-fg) 12%, transparent); }

/* 07 — get Waffle */
.platforms {
  display: grid;
  border-top: 1px solid var(--rule-strong);
}
@media (min-width: 48rem) { .platforms { grid-template-columns: 1fr 1fr; } }
@media (min-width: 72rem) { .platforms { grid-template-columns: repeat(4, 1fr); } }
.platform {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 1.75rem 1.5rem 1.75rem 0;
  border-bottom: 1px solid var(--rule);
}
@media (min-width: 48rem) {
  .platform:nth-child(even) { padding-left: 1.5rem; border-left: 1px solid var(--rule); }
}
@media (min-width: 72rem) {
  .platform { border-bottom: 0; }
  .platform + .platform { padding-left: 1.5rem; border-left: 1px solid var(--rule); }
}
.platform h3 { margin: 0; font-size: clamp(1.75rem, 3vw, 2.25rem); }
.platform p { margin: 0; color: var(--ink-dim); font-size: 0.975rem; }
.platform .cta { margin-top: auto; padding-top: 1rem; }
.platform .status {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink);
}
.platform .status::before { content: '○ '; color: var(--accent); }

/* 08 — FAQ */
.faq-grid { display: grid; gap: 1rem 4rem; }
@media (min-width: 60rem) { .faq-grid { grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); } }
.faq { border-top: 1px solid var(--rule-strong); }
.faq details { border-bottom: 1px solid var(--rule); }
.faq summary {
  cursor: pointer;
  list-style: none;
  padding: 1.1rem 2.5rem 1.1rem 0;
  position: relative;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.25rem, 2.4vw, 1.6rem);
  line-height: 1.25;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: '+';
  position: absolute;
  right: 0.25rem;
  top: 1rem;
  font-family: var(--font-mono);
  font-size: 1.375rem;
  line-height: 1;
  color: var(--accent);
  transition: transform var(--dur-component) var(--ease-out);
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details > div { padding: 0 0 1.4rem; color: var(--ink-dim); max-width: 40rem; }
.faq details > div p:last-child { margin-bottom: 0; }

.home .site-footer { margin-top: clamp(4rem, 10vw, 8rem); }

/* ── Legal documents (rendered from the product repository) ─────────── */

.doc { max-width: 46rem; padding-top: clamp(2rem, 6vw, 4rem); padding-bottom: 4rem; }
.doc .doc-meta {
  padding: 1rem 1.25rem;
  margin-bottom: 2rem;
  border-left: 3px solid var(--accent);
  background: var(--paper-2);
  font-size: 0.9375rem;
}
.doc .doc-meta p { margin: 0; }
.doc h1 { font-size: clamp(2.25rem, 6vw, 3.5rem); }
.doc h2 { font-size: clamp(1.5rem, 3.4vw, 2.1rem); margin-top: 2.5rem; }
.doc h3 { margin-top: 1.75rem; }
.doc hr { border: 0; border-top: 1px solid var(--rule); margin: 2rem 0; }
.doc code { overflow-wrap: anywhere; }
.doc ul, .doc ol { padding-left: 1.25rem; }
.doc li { margin-bottom: 0.375rem; }
.doc blockquote {
  margin: 1rem 0;
  padding: 0.25rem 1rem;
  border-left: 3px solid var(--rule-strong);
  color: var(--ink-dim);
}
.table-scroll { overflow-x: auto; margin: 1rem 0 1.5rem; }
.doc table {
  width: 100%;
  border-collapse: collapse;
  font-size: clamp(0.75rem, 2.4vw, 0.875rem);
}
.doc th {
  font-family: var(--font-mono);
  font-size: clamp(0.65rem, 2vw, 0.75rem);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-align: left;
  color: var(--ink-dim);
}
.doc th, .doc td {
  padding: 0.5rem 0.625rem;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}

/* 404 */
.lost { text-align: center; padding: clamp(4rem, 14vw, 9rem) var(--gutter) 6rem; }
.lost h1 em { color: var(--accent); }
.lost p { color: var(--ink-dim); }

/* ── Generated: where each Kyoto item sits on the map and the calendar ── */
/* --x/--y: position on the map backdrop (from its coordinates); --dc/--dr:
   calendar column (weekday) and row (week and slot). */
.si:nth-child(1) { --x: 75.4%; --y: 43.0%; --dc: 2; --dr: 3; view-transition-name: si-0; }
.si:nth-child(2) { --x: 73.3%; --y: 50.0%; --dc: 2; --dr: 4; view-transition-name: si-1; }
.si:nth-child(3) { --x: 80.1%; --y: 51.4%; --dc: 2; --dr: 5; view-transition-name: si-2; }
.si:nth-child(4) { --x: 78.5%; --y: 90.3%; --dc: 3; --dr: 3; view-transition-name: si-3; }
.si:nth-child(5) { --x: 88.0%; --y: 8.2%; --dc: 3; --dr: 4; view-transition-name: si-4; }
.si:nth-child(6) { --x: 49.5%; --y: 13.4%; --dc: 4; --dr: 3; view-transition-name: si-5; }
.si:nth-child(7) { --x: 42.1%; --y: 18.6%; --dc: 4; --dr: 4; view-transition-name: si-6; }
.si:nth-child(8) { --x: 82.0%; --y: 55.3%; --dc: 4; --dr: 5; view-transition-name: si-7; }
.si:nth-child(9) { --x: 10.9%; --y: 37.2%; --dc: 5; --dr: 3; view-transition-name: si-8; }
.si:nth-child(10) { --x: 86.7%; --y: 60.7%; --dc: 6; --dr: 3; view-transition-name: si-9; }
.si:nth-child(11) { --x: 82.9%; --y: 56.9%; --dc: 6; --dr: 4; view-transition-name: si-10; }
.si:nth-child(12) { --x: 93.2%; --y: 26.8%; --dc: 7; --dr: 3; view-transition-name: si-11; }
.si:nth-child(13) { --x: 79.2%; --y: 80.1%; --dc: 1; --dr: 7; view-transition-name: si-12; }

/* ── Reduced motion: nothing moves ───────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
  }
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) { animation: none !important; }
  .wall-pause { display: none; }
}
