/* ═══════════════════════════════════════════════
   菊 KIKU — Kyoto kissaten
   washi #F7F3EC · sumi #2B2725 · roasted #8C7B6B · shu #B8432F
   ═══════════════════════════════════════════════ */

:root {
  --washi: #F7F3EC;
  --washi-deep: #EFE9DE;
  --sumi: #2B2725;
  --sumi-soft: #4A433E;
  --roast: #8C7B6B;       /* decorative lines, large labels */
  --roast-text: #6E5F51;  /* small roasted text — AA on washi */
  --shu: #B8432F;
  --serif: "Shippori Mincho", "Hiragino Mincho ProN", serif;
  --sans: "Zen Kaku Gothic New", "Hiragino Kaku Gothic ProN", sans-serif;
  --ease-breathe: cubic-bezier(0.22, 1, 0.36, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--washi);
  color: var(--sumi);
  font-family: var(--sans);
  font-weight: 300;
  font-size: 17px;
  line-height: 1.9;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--shu); color: var(--washi); }

a { color: inherit; }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--shu);
  outline-offset: 3px;
}

h1, h2, h3, .ph-kanji, .hero-tate, .foot-kanji { font-family: var(--serif); font-weight: 500; }

/* ── paper grain ── */
.grain {
  position: fixed;
  inset: -50%;
  width: 200%;
  height: 200%;
  pointer-events: none;
  z-index: 60;
  opacity: 0.5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.06'/%3E%3C/svg%3E");
}

/* ── side labels (vertical japanese) ── */
.side-label {
  position: absolute;
  top: clamp(4rem, 12vh, 8rem);
  right: clamp(1.1rem, 4vw, 3.4rem);
  writing-mode: vertical-rl;
  font-family: var(--serif);
  font-size: 0.95rem;
  letter-spacing: 0.55em;
  color: var(--roast);
  user-select: none;
}

/* ═══════════ HERO ═══════════ */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-columns: 1fr minmax(280px, 420px) 1fr;
  align-items: center;
  padding: clamp(1.4rem, 4vw, 3rem);
}

.wordmark {
  position: absolute;
  top: clamp(1.4rem, 4vw, 2.6rem);
  left: clamp(1.4rem, 4vw, 3rem);
}
.wordmark-link {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  text-decoration: none;
}
.wordmark-link .wordmark-kanji { transition: color 0.5s var(--ease-breathe), transform 0.5s var(--ease-breathe); }
.wordmark-link:hover .wordmark-kanji { color: var(--shu); transform: rotate(-5deg); }
.wordmark-kanji {
  font-family: var(--serif);
  font-size: 1.9rem;
  line-height: 1;
}
.wordmark-latin {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 0.82rem;
  letter-spacing: 0.42em;
  display: flex;
  flex-direction: column;
  line-height: 1.5;
}
.wordmark-latin em {
  font-style: normal;
  font-weight: 300;
  font-size: 0.62rem;
  letter-spacing: 0.3em;
  color: var(--roast-text);
}

/* cup figure — hanging-scroll frame */
.hero-cup {
  grid-column: 2;
  position: relative;
  width: 100%;
}
html.js .hero-cup {
  opacity: 0;
  transform: translateY(24px);
  animation: heroIn 2.2s var(--ease-breathe) 0.3s forwards;
}
.hero-cup img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 74vh;
  object-fit: cover;
  filter: sepia(0.06) saturate(0.92);
}
html.js .hero-cup img {
  /* ken-burns so slow it feels like light moving, not motion */
  animation: kenburns 26s var(--ease-breathe) 3s infinite alternate;
}
@keyframes kenburns {
  from { transform: scale(1) translateY(0); }
  to   { transform: scale(1.045) translateY(-6px); }
}
.hero-cup::after {           /* thin scroll border */
  content: "";
  position: absolute;
  inset: -12px;
  border: 1px solid rgba(43, 39, 37, 0.22);
  pointer-events: none;
}

.steam {
  position: absolute;
  left: 0;
  top: -18%;
  width: 100%;
  height: 62%;
  pointer-events: none;
  z-index: 2;
  mix-blend-mode: screen;
}

/* vertical hero text */
.hero-tate {
  grid-column: 3;
  justify-self: center;
  writing-mode: vertical-rl;
  font-family: var(--serif);
  font-size: clamp(2.6rem, 5.5vw, 4.6rem);
  letter-spacing: 0.42em;
  line-height: 1;
  color: var(--sumi);
}
html.js .hero-tate {
  opacity: 0;
  transform: translateY(-18px);
  animation: heroIn 2.4s var(--ease-breathe) 1s forwards;
}

.hero-foot {
  position: absolute;
  bottom: clamp(1.6rem, 5vh, 3.4rem);
  left: clamp(1.4rem, 4vw, 3rem);
  display: flex;
  align-items: flex-end;
  gap: 1.6rem;
}
.hero-eng {
  font-size: 0.95rem;
  line-height: 2;
  letter-spacing: 0.06em;
  color: var(--sumi-soft);
}
html.js .hero-eng {
  opacity: 0;
  animation: heroIn 2s var(--ease-breathe) 1.7s forwards;
}

/* scroll hint */
.hero-scroll {
  position: absolute;
  bottom: clamp(1.6rem, 5vh, 3.4rem);
  right: clamp(1.6rem, 4vw, 3.2rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7rem;
}
html.js .hero-scroll {
  opacity: 0;
  animation: heroIn 2s var(--ease-breathe) 2.4s forwards;
}
.hero-scroll-line {
  width: 1px;
  height: 64px;
  background: var(--roast);
  overflow: hidden;
  position: relative;
}
.hero-scroll-line::after {
  content: "";
  position: absolute;
  left: 0; top: 0;
  width: 100%; height: 40%;
  background: var(--sumi);
  animation: scrollDrip 2.6s ease-in-out infinite;
}
.hero-scroll-txt {
  writing-mode: vertical-rl;
  font-size: 0.62rem;
  letter-spacing: 0.4em;
  color: var(--roast-text);
  text-transform: uppercase;
}

@keyframes scrollDrip {
  0%   { transform: translateY(-110%); }
  60%  { transform: translateY(260%); }
  100% { transform: translateY(260%); }
}
@keyframes heroIn {
  to { opacity: 1; transform: translateY(0); }
}

/* ── hanko seal ── */
.hanko {
  width: 72px;
  height: 72px;
  border-radius: 10px;
  background: var(--shu);
  color: var(--washi);
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-size: 2.1rem;
  box-shadow: inset 0 0 0 2.5px var(--shu), inset 0 0 0 5px var(--washi);
  transform: scale(1) rotate(-5deg);
}
html.js .hanko {
  transform: scale(2.2) rotate(-14deg);
  opacity: 0;
  /* stamped in by JS adding .stamped */
}
.hanko.stamped {
  animation: stamp 0.72s cubic-bezier(0.34, 1.4, 0.44, 1) forwards;
}
.hanko span { transform: rotate(-3deg); user-select: none; }
.hanko-small { width: 58px; height: 58px; font-size: 1.7rem; border-radius: 8px; margin-top: 2.6rem; }

@keyframes stamp {
  0%   { opacity: 0; transform: scale(2.2) rotate(-14deg); }
  55%  { opacity: 1; transform: scale(0.94) rotate(-4deg); }
  72%  { transform: scale(1.05) rotate(-5deg); }
  100% { opacity: 1; transform: scale(1) rotate(-5deg); }
}

/* ═══════════ SECTIONS — breathing rhythm ═══════════ */
section {
  position: relative;
  padding: clamp(7rem, 18vh, 13rem) clamp(1.4rem, 7vw, 8rem);
  max-width: 1200px;
  margin: 0 auto;
}

/* slow breathe-in reveal */
html.js .reveal {
  opacity: 0;
  transform: translateY(36px);
  transition: opacity 1.8s var(--ease-breathe), transform 1.8s var(--ease-breathe);
}
html.js .reveal.in { opacity: 1; transform: none; }

/* section headings */
section h2 {
  display: flex;
  align-items: baseline;
  gap: 1.2rem;
  font-size: clamp(1.9rem, 3.4vw, 2.6rem);
  letter-spacing: 0.14em;
  margin-bottom: 1rem;
}
section h2 em {
  font-style: normal;
  font-family: var(--sans);
  font-weight: 300;
  font-size: 0.85rem;
  letter-spacing: 0.5em;
  text-transform: uppercase;
  color: var(--roast);
}

/* ═══════════ PHILOSOPHY ═══════════ */
.philosophy { text-align: center; }
.ph-inner { position: relative; max-width: 620px; margin: 0 auto; }

.enso {
  width: clamp(200px, 30vw, 300px);
  height: auto;
  display: block;
  margin: 0 auto 2.6rem;
  transform: rotate(-4deg); /* hand-drawn asymmetry */
}
.enso .ink-draw { stroke: var(--sumi); stroke-linecap: round; }
.enso-main { stroke-width: 8; opacity: 0.82; }
.enso-dry  { stroke-width: 2.2; opacity: 0.3; } /* dry-brush ghost stroke */

.ph-kanji {
  display: block; /* override generic h2 flex — must center */
  font-size: clamp(2.4rem, 6vw, 3.8rem);
  letter-spacing: 0.3em;
  margin-left: 0.3em; /* balance tracking */
}
.ph-reading {
  font-size: 0.8rem;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--shu);
  margin: 1.1rem 0 3rem;
}
.ph-copy {
  text-align: left;
  display: grid;
  gap: 1.6rem;
  color: var(--sumi-soft);
}

/* ═══════════ MENU ═══════════ */
.menu-head { max-width: 560px; margin-bottom: 5rem; }
.menu-note { color: var(--roast-text); font-size: 0.95rem; }

.menu-groups { display: grid; gap: 5rem; }

.menu-group h3 {
  font-size: 1.15rem;
  letter-spacing: 0.28em;
  color: var(--sumi);
  border-bottom: 1px solid rgba(43,39,37,0.18);
  padding-bottom: 0.9rem;
  margin-bottom: 0.4rem;
}

.menu-group ul { list-style: none; }

.menu-item {
  position: relative;
  display: grid;
  grid-template-columns: minmax(200px, 300px) 1fr auto;
  gap: 0.4rem 2.4rem;
  align-items: baseline;
  padding: 1.5rem 1rem 1.5rem 1.4rem;
  border-bottom: 1px dashed rgba(140,123,107,0.35);
  transition: background 0.6s var(--ease-breathe), padding-left 0.6s var(--ease-breathe);
}
.menu-item::before {          /* hanko dot on hover */
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--shu);
  transform: translateY(-50%) scale(0);
  transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.menu-item:hover {
  background: rgba(140,123,107,0.07);
  padding-left: 1.9rem;
}
.menu-item:hover::before { transform: translateY(-50%) scale(1); }

.mi-name { display: flex; align-items: baseline; gap: 0.9rem; }
.mi-ja {
  font-family: var(--serif);
  font-size: 1.3rem;
  letter-spacing: 0.12em;
  transition: transform 0.5s var(--ease-breathe);
}
.menu-item:hover .mi-ja { transform: translateX(3px); }
.mi-en {
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--roast-text);
}
.mi-desc { font-size: 0.92rem; color: var(--sumi-soft); }
.mi-price {
  font-family: var(--serif);
  font-size: 1.05rem;
  letter-spacing: 0.08em;
  transition: color 0.5s;
}
.menu-item:hover .mi-price { color: var(--shu); }

/* ═══════════ SPACE ═══════════ */
.space-head { margin-bottom: 4rem; }

.space-wide { margin: 0 0 5rem; }
.space-wide img,
.space-square img {
  display: block;
  width: 100%;
  height: auto;
  filter: sepia(0.06) saturate(0.92);
}
.img-frame { overflow: hidden; }

figcaption {
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  color: var(--roast-text);
  margin-top: 1.1rem;
}

.space-pair {
  display: grid;
  grid-template-columns: 1fr minmax(260px, 380px);
  gap: clamp(2.5rem, 6vw, 5.5rem);
  align-items: start;
}
.space-copy { display: grid; gap: 1.6rem; color: var(--sumi-soft); max-width: 46ch; }

/* ═══════════ VISIT ═══════════ */
.visit-head { margin-bottom: 4rem; }

.visit-grid {
  display: grid;
  grid-template-columns: minmax(280px, 420px) 1fr;
  gap: clamp(3rem, 7vw, 6rem);
  align-items: start;
}

.vi-row {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 1.6rem;
  padding: 1.6rem 0;
  border-bottom: 1px dashed rgba(140,123,107,0.35);
}
.vi-row dt {
  font-family: var(--serif);
  font-size: 1.05rem;
  letter-spacing: 0.3em;
  color: var(--sumi);
}
.vi-row dd { font-size: 0.95rem; }
.vi-soft { color: var(--roast-text); font-size: 0.85rem; }

/* ink map */
.ink-map svg {
  width: 100%;
  height: auto;
  display: block;
  background: var(--washi-deep);
  border: 1px solid rgba(43,39,37,0.14);
}
.map-river { stroke: var(--roast); stroke-width: 5; stroke-linecap: round; opacity: 0.7; }
.map-river.thin { stroke-width: 2.5; opacity: 0.45; }
.map-street { stroke: var(--sumi); stroke-width: 3.4; stroke-linecap: round; opacity: 0.8; }
.map-lane { stroke: var(--sumi); stroke-width: 1.8; stroke-linecap: round; opacity: 0.55; }
.map-dot { fill: var(--shu); }
.map-label {
  font-family: var(--serif);
  font-size: 15px;
  fill: var(--sumi-soft);
  letter-spacing: 2px;
}
.map-label-shop { fill: var(--shu); font-size: 18px; }

/* ── ink brush draw-in (generic) ── */
html.js .ink-draw {
  stroke-dasharray: var(--len, 1200);
  stroke-dashoffset: var(--len, 1200);
}
.drawn .ink-draw {
  animation: inkDraw 2.6s var(--ease-breathe) forwards;
}
.drawn .ink-draw:nth-of-type(2) { animation-delay: 0.25s; }
.drawn .ink-draw:nth-of-type(3) { animation-delay: 0.5s; }
.drawn .ink-draw:nth-of-type(4) { animation-delay: 0.7s; }
.drawn .ink-draw:nth-of-type(5) { animation-delay: 0.9s; }
.drawn .ink-draw:nth-of-type(6) { animation-delay: 1.05s; }
.drawn .ink-draw:nth-of-type(7) { animation-delay: 1.2s; }
.drawn .ink-draw:nth-of-type(8) { animation-delay: 1.35s; }
@keyframes inkDraw { to { stroke-dashoffset: 0; } }

.map-dot { transform-origin: center; }
html.js .map-dot { opacity: 0; transition: opacity 0.6s 2s; }
html.js .drawn .map-dot { opacity: 1; animation: dotPulse 0.5s cubic-bezier(0.34,1.56,0.64,1) 2s backwards; }
html.js .map-label { opacity: 0; transition: opacity 1.4s var(--ease-breathe) 1.6s; }
html.js .drawn .map-label { opacity: 1; }
@keyframes dotPulse { 0% { transform: scale(0); } 100% { transform: scale(1); } }

/* ═══════════ FOOTER ═══════════ */
.foot {
  text-align: center;
  padding: clamp(6rem, 14vh, 9rem) 1.5rem 3rem;
}
.foot-rule {
  display: block;
  width: 1px;
  height: 72px;
  margin: 0 auto 3rem;
  background: linear-gradient(to bottom, transparent, var(--roast));
}
.foot-kanji { font-size: clamp(1.6rem, 3vw, 2.2rem); letter-spacing: 0.3em; }
.foot-eng {
  font-size: 0.8rem;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--roast-text);
  margin: 1rem 0 4rem;
}
.foot-credit {
  font-size: 0.78rem;
  color: var(--roast-text);
  letter-spacing: 0.04em;
}
.foot-credit a {
  color: var(--shu);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: text-underline-offset 0.3s ease, color 0.3s ease;
}
.foot-credit a:hover { text-underline-offset: 6px; color: var(--sumi); }

/* ═══════════ RESPONSIVE ═══════════ */
@media (max-width: 900px) {
  .space-pair, .visit-grid { grid-template-columns: 1fr; }
  .menu-item { grid-template-columns: 1fr auto; }
  .mi-desc { grid-column: 1 / -1; }
  .mi-price { grid-column: 2; grid-row: 1; justify-self: end; }
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  .hero {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr auto;
    padding-top: 6rem;
    padding-bottom: 9.5rem;
    gap: 2rem;
  }
  .hero-cup { grid-column: 1; max-width: 300px; justify-self: center; }
  .hero-cup img { max-height: 56vh; }
  .hero-tate {
    /* overlay on the dark upper-right of the photo, ink-on-print style */
    position: absolute;
    grid-column: auto;
    grid-row: auto;
    top: 9.5rem;
    right: 17%;
    z-index: 3;
    font-size: 1.65rem;
    letter-spacing: 0.4em;
    color: var(--washi);
    opacity: 0.92;
    text-shadow: 0 0 14px rgba(43, 39, 37, 0.5);
  }
  .hero-foot { right: 1.4rem; align-items: flex-end; justify-content: space-between; width: calc(100% - 2.8rem); }
  .hero-scroll { display: none; }
  .side-label { font-size: 0.8rem; right: 0.9rem; }
  .mi-name { flex-direction: column; gap: 0.1rem; }
  .menu-item { gap: 0.3rem 1.2rem; }
}

/* ═══════════ QA SOLO MODE (?solo=<section> — isolate one section for captures) ═══════════ */
html[data-solo] .hero,
html[data-solo] main > section,
html[data-solo] .foot { display: none; }
html[data-solo="hero"] .hero { display: grid; }
html[data-solo="philosophy"] #philosophy,
html[data-solo="menu"] #menu,
html[data-solo="space"] #space,
html[data-solo="visit"] #visit { display: block; }
html[data-solo="foot"] .foot { display: block; }

/* ═══════════ REDUCED MOTION ═══════════
   (no-JS and ?static=1 QA mode are handled by the html.js gate above:
    without the .js class every animated element keeps its visible end-state) */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  html.js .hero-cup, html.js .hero-tate, html.js .hero-eng, html.js .hero-scroll {
    animation: none;
    opacity: 1;
    transform: none;
  }
  .hero-scroll-line::after { animation: none; }
  html.js .reveal { opacity: 1; transform: none; transition: none; }
  html.js .hanko { opacity: 1; transform: scale(1) rotate(-5deg); }
  html.js .hanko.stamped { animation: none; }
  html.js .ink-draw { stroke-dasharray: none; stroke-dashoffset: 0; }
  html.js .drawn .ink-draw { animation: none; }
  html.js .map-dot, html.js .map-label { opacity: 1; transition: none; animation: none; }
  html.js .hero-cup img { animation: none; }
  .steam { display: none; }
}
