/* ==========================================================================
   きかせて — components
   Consumes tokens.css only. No raw hex, no raw font stacks, no raw type
   sizes in this file — if a value isn't a token, it's a spacing/layout
   measure or a percentage.
   ========================================================================== */

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-min);
  font-weight: var(--w-regular);
  font-size: var(--text-body);
  line-height: var(--leading-body);
  -webkit-font-smoothing: antialiased;
  padding-bottom: 120px; /* clear the fixed bottom nav */
}

::selection { background: var(--kaki); color: var(--kaki-ink); }

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

h1, h2, h3, p, figure, ul, ol, dl { margin: 0; }

/* JP line-break control: no orphaned single-character last lines */
p, li, figcaption { text-wrap: pretty; }
h1, h2, h3 { text-wrap: balance; }

a { color: inherit; }

/* ---- type roles ---------------------------------------------------------- */

.display {
  font-size: var(--text-display);
  line-height: var(--leading-display);
  letter-spacing: var(--track-display);
  font-weight: var(--w-medium);
}

.sub {
  font-size: var(--text-sub);
  line-height: var(--leading-sub);
  letter-spacing: var(--track-display);
  font-weight: var(--w-regular);
}

.lead {
  font-size: var(--text-lead);
  line-height: 1.8;
}

.mono-label {
  font-family: var(--font-mono);
  font-size: var(--text-label);
  line-height: var(--leading-label);
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  font-weight: var(--w-regular);
}

.ui-label {
  font-family: var(--font-ui);
  font-size: var(--text-label);
  line-height: var(--leading-label);
  letter-spacing: var(--track-ui);
  font-weight: var(--w-regular);
}

.ash { color: var(--ash); }

.hand {
  font-family: var(--font-hand);
  line-height: 1.9;
}

.tategaki {
  writing-mode: vertical-rl;
  text-orientation: mixed;
}

/* ---- layout -------------------------------------------------------------- */

.container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.container-text {
  max-width: var(--container-text);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { margin-block: var(--gap-section); }

.section-head {
  display: flex;
  align-items: baseline;
  gap: var(--gap-inline);
  margin-bottom: var(--gap-block);
}
.section-head .mono-label { white-space: nowrap; }
.section-head::after {
  content: "";
  flex: 1;
  border-top: 1px solid var(--line);
  align-self: center;
}

/* ---- buttons ------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--gap-inline-xs);
  padding: 15px 24px;
  border: 0;
  border-radius: var(--radius);
  text-decoration: none;
  cursor: pointer;
  font-family: var(--font-ui);
  font-size: var(--text-label);
  letter-spacing: var(--track-ui);
  line-height: var(--leading-label);
  transition: opacity 150ms ease-out;
}
.btn:hover { opacity: 0.85; }

.btn-primary { background: var(--kaki); color: var(--kaki-ink); }

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--ink);
  padding: 14px 23px;
}

.text-link {
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--ash);
}
.text-link:hover { text-decoration-color: var(--ink); }

/* ---- fixed bottom nav ---------------------------------------------------- */

.site-nav {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 22px;
  background: var(--white);
  border-radius: var(--radius);
  padding: 10px 12px 10px 20px;
  width: max-content;
  max-width: calc(100vw - 24px);
  transition: transform 250ms ease-out;
}
/* hidden while reading down the page; returns on scroll-up (site.js) */
.site-nav.nav-hidden { transform: translateX(-50%) translateY(140%); }

.nav-wordmark {
  font-family: var(--font-min);
  font-size: var(--text-lead);
  font-weight: var(--w-medium);
  letter-spacing: 0.04em;
  text-decoration: none;
  line-height: 1;
  padding-bottom: 2px;
}

.nav-links { display: flex; gap: 18px; }
.nav-links a { text-decoration: none; }
.nav-links a:hover { text-decoration: underline; text-underline-offset: 4px; }

.site-nav .btn { padding: 12px 18px; }

@media (max-width: 640px) {
  .nav-links { display: none; }
  .site-nav { gap: 12px; padding: 8px 9px 8px 16px; bottom: 12px; }
  .nav-wordmark { font-size: 1.05rem; }
  .site-nav .btn { padding: 10px 14px; }
  /* clearance scrim so the floating nav never beheads content mid-glyph */
  body::after {
    content: "";
    position: fixed;
    left: 0; right: 0; bottom: 0;
    height: 88px;
    background: linear-gradient(to top, var(--paper) 30%, transparent);
    pointer-events: none;
    z-index: 40;
  }
}

/* ---- hero ---------------------------------------------------------------- */

.hero {
  position: relative;
  /* the fold belongs to the hero alone — the ticker starts below it */
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero-center {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 720px;
  padding-inline: var(--gutter);
  display: grid;
  gap: var(--gap-stack);
  justify-items: center;
}

.hero h1 { text-wrap: balance; }

.hero-testimonial { max-width: 420px; text-wrap: balance; }
.hero-testimonial cite { font-style: normal; }

.hero-photos { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.hero-photos figure { position: absolute; margin: 0; }
.hero-photos img { width: 100%; height: 100%; object-fit: cover; }

/* scattered editorial positions — radical scale contrast, edge bleeds, one overlap */
.hp-1 { width: 26%; max-width: 390px; aspect-ratio: 4/3;  top: 7%;    left: -4%; }   /* dominant, bleeds left  */
.hp-2 { width: 8%;  max-width: 120px; aspect-ratio: 3/4;  top: 4%;    right: 26%; }
.hp-3 { width: 7%;  max-width: 104px; aspect-ratio: 1/1;  top: 40%;   left: 17%; }   /* overlaps hp-1's corner */
.hp-4 { width: 12%; max-width: 175px; aspect-ratio: 4/3;  bottom: -7%; left: 12%; }  /* bleeds bottom, clear of nav */
.hp-5 { width: 20%; max-width: 300px; aspect-ratio: 4/3;  bottom: 11%; right: -3.5%; } /* bleeds right         */
.hp-6 { width: 6%;  max-width: 90px;  aspect-ratio: 3/4;  top: 27%;   right: 8%; }

@media (max-width: 760px) {
  /* full small-viewport height: the ticker starts below the fold,
     so the floating nav never lands on it at the hero stop */
  .hero { min-height: 100svh; }
  .hp-1 { width: 42%; top: 4%; left: -7%; }
  .hp-2 { width: 17%; top: 6%; right: 9%; }
  .hp-5 { width: 34%; bottom: 16%; right: -6%; }
  .hp-4 { width: 20%; bottom: -4%; left: 12%; }
  .hp-3, .hp-6 { display: none; }
}

.hero .corner { position: absolute; z-index: 2; }
.corner-bl { left: var(--gutter); bottom: 24px; }
.corner-br { right: var(--gutter); bottom: 24px; }
@media (max-width: 640px) { .hero .corner { display: none; } }

/* ---- ticker -------------------------------------------------------------- */

.ticker {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  padding-block: 12px;
}
.ticker-track {
  display: flex;
  gap: 0;
  width: max-content;
  animation: ticker 36s linear infinite;
}
.ticker-track > span { white-space: nowrap; padding-inline: 14px; }
.ticker-track > span::after { content: "・"; padding-left: 28px; color: var(--ash); }
@keyframes ticker { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .ticker-track { animation: none; } }

/* ---- tategaki manifesto --------------------------------------------------- */

.manifesto {
  display: flex;
  justify-content: center;
  padding-block: var(--gap-block);
}
.manifesto-inner {
  display: flex;
  flex-direction: row-reverse;
  justify-content: center;
  gap: clamp(28px, 5vw, 64px);
}
.manifesto .tategaki {
  font-size: var(--text-sub);
  line-height: 2.4;
  letter-spacing: 0.06em;
  /* 15em = room for the longest 14-char phrase; no runover columns, ever */
  height: 15em;
}
.manifesto .mono-label { align-self: flex-end; }

/* ---- editions grid -------------------------------------------------------- */

.editions-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(20px, 3vw, 44px);
}
@media (max-width: 900px) { .editions-grid { grid-template-columns: repeat(2, 1fr); } }

.edition-card { display: grid; gap: var(--gap-inline); align-content: start; text-decoration: none; }
.edition-card .cover { transition: transform 200ms ease-out; }
.edition-card:hover .cover { transform: translateY(-4px); }

.edition-card h3 { font-size: var(--text-lead); font-weight: var(--w-regular); line-height: 1.5; margin-top: var(--gap-inline); }
.edition-card .tagline { color: var(--ash); font-size: var(--text-body); line-height: 1.7; }
.edition-card .meta { display: flex; gap: var(--gap-inline); flex-wrap: wrap; margin-top: var(--gap-inline-xs); }

/* ---- book cover ----------------------------------------------------------- */

.cover {
  aspect-ratio: 10 / 14;
  position: relative;
  background-color: var(--edition-tint);
  border-radius: var(--radius);
  overflow: hidden;
  container-type: inline-size;
}
.cover-cloth {
  position: absolute; inset: 0;
  background-size: cover;
  background-position: center;
}
.cover-title {
  position: absolute;
  top: 8%;
  right: 10%;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  color: var(--paper);
  font-family: var(--font-min);
  font-weight: var(--w-medium);
  font-size: 8.2cqw;
  letter-spacing: 0.22em;
  line-height: 1;
}
.cover-pub {
  position: absolute;
  bottom: 6%;
  left: 10%;
  writing-mode: vertical-rl;
  color: var(--paper);
  opacity: 0.75;
  font-family: var(--font-min);
  font-size: 3.6cqw;
  letter-spacing: 0.3em;
}

/* ---- chapters (what's inside) --------------------------------------------- */

.inside {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(32px, 6vw, 96px);
  align-items: start;
}
@media (max-width: 860px) { .inside { grid-template-columns: 1fr; } }

.inside-left { display: grid; gap: var(--gap-stack); position: sticky; top: 48px; }
.inside-left figure { width: 78%; margin-top: var(--gap-stack); }
.inside-left figure img { aspect-ratio: 4/3; object-fit: cover; } /* reserves space — no layout shift while loading */
@media (max-width: 860px) { .inside-left { position: static; } }

.chapters { list-style: none; padding: 0; display: grid; }
.chapters li {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: var(--gap-inline);
  padding-block: 22px;
  border-top: 1px solid var(--line);
  align-items: baseline;
}
.chapters li:last-child { border-bottom: 1px solid var(--line); }
.chapters .ch-name { font-size: var(--text-lead); }
.chapters .ch-desc { color: var(--ash); margin-top: 4px; }

.keeps { display: grid; gap: var(--gap-stack); margin-top: var(--gap-block); }
.keeps > div { display: grid; gap: var(--gap-inline-xs); }

/* ---- full-bleed photo ------------------------------------------------------ */

.bleed {
  position: relative;
  width: 100%;
  /* a full-bleed moment is a full viewport — never letterboxed */
  min-height: 100vh;
  overflow: hidden;
}
.bleed img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.bleed-quote {
  position: absolute;
  left: var(--gutter);
  bottom: clamp(48px, 10vh, 96px);
  color: var(--paper);
  max-width: 640px;
  text-wrap: balance;
}
.bleed-meta {
  position: absolute;
  top: 32px;
  right: var(--gutter);
  color: var(--paper);
}

/* ---- testimonials ---------------------------------------------------------- */

.stories { display: grid; gap: var(--gap-block); }
.story {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(24px, 4vw, 72px);
  padding-top: var(--gap-block);
  border-top: 1px solid var(--line);
}
@media (max-width: 760px) { .story { grid-template-columns: 1fr; } }
.story:nth-child(even) .story-title { order: 2; }
.story-title { text-wrap: balance; }
.story-body { display: grid; gap: var(--gap-stack); max-width: 560px; }
.story-quote {
  font-family: var(--font-hand);
  font-size: var(--text-lead);
  line-height: 2;
  padding: var(--gap-stack);
  background: var(--white);
  border-radius: var(--radius);
}
.story-quote .ui-label { margin-top: var(--gap-inline); display: block; }

/* ---- occasions ------------------------------------------------------------- */

.occasions { list-style: none; padding: 0; display: grid; }
.occasions li {
  display: grid;
  grid-template-columns: 110px 1fr auto;
  gap: var(--gap-inline);
  align-items: baseline;
  padding-block: 18px;
  border-top: 1px solid var(--line);
}
.occasions li:last-child { border-bottom: 1px solid var(--line); }
.occasions .oc-name { font-size: var(--text-lead); }
.occasions .oc-note { color: var(--ash); text-align: right; max-width: 400px; text-wrap: balance; }
@media (max-width: 640px) {
  .occasions li { grid-template-columns: 82px 1fr; }
  .occasions .oc-note { grid-column: 2; text-align: left; }
}

/* ---- UGC ------------------------------------------------------------------- */

.ugc {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(14px, 2vw, 28px);
  align-items: start;
}
@media (max-width: 760px) { .ugc { grid-template-columns: repeat(2, 1fr); } }
.ugc figure { display: grid; gap: var(--gap-inline-xs); }
.ugc figure:nth-child(2) { margin-top: 40px; }
.ugc figure:nth-child(4) { margin-top: 24px; }
@media (max-width: 760px) { .ugc figure:nth-child(2), .ugc figure:nth-child(4) { margin-top: 0; } }
.ugc img { aspect-ratio: 1/1; object-fit: cover; border-radius: var(--radius); }

/* ---- set & add-ons --------------------------------------------------------- */

.addons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(16px, 2.5vw, 32px);
}
@media (max-width: 860px) { .addons { grid-template-columns: 1fr; } }
.addon {
  background: var(--white);
  border-radius: var(--radius);
  padding: clamp(24px, 3vw, 40px);
  display: grid;
  gap: var(--gap-inline);
  align-content: start;
}
.addon h3 { font-size: var(--text-lead); font-weight: var(--w-regular); }
.addon .price { margin-top: var(--gap-inline); }
.addon .note { color: var(--ash); }

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

.faq details { border-top: 1px solid var(--line); }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--gap-inline);
  padding-block: 22px;
  font-size: var(--text-lead);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--font-mono); color: var(--ash); }
.faq details[open] summary::after { content: "−"; }
.faq .faq-a { padding-bottom: 26px; max-width: 560px; color: var(--ink); }

/* ---- closing CTA ------------------------------------------------------------ */

.closing {
  text-align: center;
  display: grid;
  justify-items: center;
  align-content: center;
  /* the split-headline moment owns a full viewport — nothing else in its frame */
  min-height: 86vh;
  margin-block: var(--gap-section);
}

.closing-cta {
  text-align: center;
  display: grid;
  gap: var(--gap-stack);
  justify-items: center;
  margin-block: 0 var(--gap-block);
}
.closing-cta .btn-row { display: flex; gap: var(--gap-inline); flex-wrap: wrap; justify-content: center; }
.closing .btn-row { display: flex; gap: var(--gap-inline); flex-wrap: wrap; justify-content: center; }

/* headline physically split around a floating image (one per page) */
.split-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(20px, 3.5vw, 56px);
  width: 100%;
}
.split-head h2 { font-size: var(--text-display); line-height: var(--leading-display); letter-spacing: var(--track-display); font-weight: var(--w-medium); white-space: nowrap; }
.split-head figure { width: clamp(220px, 32vw, 460px); aspect-ratio: 4/3; }
.split-head img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 760px) {
  .split-head { flex-direction: column; gap: var(--gap-stack); }
  .split-head h2 { white-space: normal; }
  .split-head .sh-a { align-self: flex-start; margin-left: var(--gutter); }
  .split-head .sh-b { align-self: flex-end; margin-right: var(--gutter); }
}

/* ---- footer ------------------------------------------------------------------ */

.footer { margin-top: 0; overflow: hidden; }
.footer-wordmark {
  font-family: var(--font-min);
  font-weight: var(--w-medium);
  font-size: clamp(88px, 21vw, 300px);
  line-height: 1.1;
  letter-spacing: 0.02em;
  text-align: center;
  white-space: nowrap;
  /* the wordmark is its own composed viewport — nothing competes with it */
  min-height: 85vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.footer-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  justify-content: center;
  padding-block: 12px 6px;
  opacity: 0.8;
}
.footer-meta a { text-decoration: none; }
.footer-meta a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---- edition page ------------------------------------------------------------ */

.ed-hero {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(32px, 6vw, 96px);
  align-items: center;
  min-height: 78vh;
  padding-top: 48px;
}
@media (max-width: 860px) { .ed-hero { grid-template-columns: 1fr; min-height: 0; padding-top: 32px; } }
.ed-hero .cover { max-width: 420px; width: 100%; margin-inline: auto; }
@media (max-width: 640px) {
  .ed-hero { padding-top: 20px; padding-bottom: 64px; gap: 32px; }
  .ed-hero .cover { max-width: min(76vw, 320px); }
}
.ed-hero-info { display: grid; gap: var(--gap-stack); justify-items: start; }
.ed-hero-info .meta-row { display: flex; flex-wrap: wrap; gap: var(--gap-inline); }
.ed-price { font-size: var(--text-lead); }
.ed-cta { display: grid; gap: var(--gap-inline); justify-items: start; }
.badge-soon {
  display: inline-block;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  padding: 10px 16px;
}

/* sample question spread */
.q-spread {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(16px, 2.5vw, 32px);
}
@media (max-width: 760px) { .q-spread { grid-template-columns: 1fr; } }
.q-page {
  background: var(--white);
  border-radius: var(--radius);
  padding: clamp(28px, 4vw, 48px);
  display: grid;
  gap: var(--gap-inline);
  align-content: start;
}
.q-page .q-text { font-size: var(--text-lead); line-height: 2; }
.q-page .rule { border-top: 1px solid var(--line); margin-top: var(--gap-stack); }
.q-page .rule + .rule { margin-top: 28px; }

.other-editions { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(16px, 2.5vw, 32px); }
@media (max-width: 760px) { .other-editions { grid-template-columns: repeat(3, 1fr); } }

/* ---- design-system page ------------------------------------------------------- */

.ds-swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; }
.ds-swatch { display: grid; gap: 8px; }
.ds-swatch .chip { height: 88px; border-radius: var(--radius); border: 1px solid var(--line); }
.ds-block { display: grid; gap: var(--gap-stack); margin-bottom: var(--gap-block); }
.ds-row { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }

/* ---- tablet refinements --------------------------------------------------------- */

@media (max-width: 1024px) {
  .inside-left figure { width: 100%; }
}
@media (max-width: 1100px) {
  .hp-3 { display: none; } /* would underlap the display headline on tablet */
}

/* ---- mobile cuts ----------------------------------------------------------------- */
/* Mobile is an edit, not a reflow: secondary texture goes, conversion stays.        */

@media (max-width: 640px) {
  .hp-4 { display: none; }                      /* 3 hero photos, headline breathes  */
  .edition-card .tagline { display: none; }     /* grid: cover, title, price only    */
  .occasions .oc-note { display: none; }        /* occasions: date + name, scannable */
  .occasions li { grid-template-columns: 82px 1fr; }
  .stories .story:nth-child(2) { display: none; } /* one strong story on mobile      */
  .manifesto .tategaki {
    font-size: var(--text-lead);
    line-height: 2.2;
  }
  .bleed { min-height: 72svh; }
  .bleed-meta { display: none; }
  .footer-wordmark { font-size: clamp(72px, 24vw, 120px); }
  .q-page .rule + .rule { display: none; }      /* one writing rule is enough        */
}

/* ---- legal pages ----------------------------------------------------------------- */

.legal dl { margin: var(--gap-block) 0; display: grid; }
.legal-row {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: var(--gap-inline);
  padding-block: 16px;
  border-top: 1px solid var(--line);
  align-items: baseline;
}
.legal dl .legal-row:last-child { border-bottom: 1px solid var(--line); }
.legal dd { margin: 0; }
@media (max-width: 640px) { .legal-row { grid-template-columns: 1fr; gap: 4px; } }
.legal-prose { display: grid; gap: var(--gap-inline); margin-block: var(--gap-stack) var(--gap-block); }
.legal-prose h2 { font-size: var(--text-lead); font-weight: var(--w-regular); margin-top: var(--gap-inline); }
.fill { background: var(--white); border: 1px dashed var(--ash); border-radius: var(--radius); padding: 0 6px; }

/* ---- reveal on scroll ---------------------------------------------------------- */

.reveal { opacity: 0; transform: translateY(14px); transition: opacity 450ms ease-out, transform 450ms ease-out; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }
