/*
  Suzume Coffee Stand: a demonstration site, built from the same code as a real client build.
  Phone first. Colours come from palettes.js, generated from the checked palette files;
  the values below are palette A, so the page reads correctly before the script runs.
  Media queries sit below the rules they override (HANDOFF section 7).
*/

:root {
  --bg: #FBF8F1;
  --surface: #F2EBDD;
  --text: #2B2215;
  --muted: #5E513E;
  --primary: #08451D;
  --accent: #40331C;
  --accent-text: #FBF8F1;
  --border: #DCCFB5;
  --focus: #08451D;
  --band-1: #E2BA19;
  --band-2: #F2EBDD;
  --detail: #C78210;

  --font-display: "Zen Maru Gothic", "Hiragino Maru Gothic ProN", system-ui, sans-serif;
  --font-body: "Zen Kaku Gothic New", "Hiragino Sans", system-ui, sans-serif;
  --gutter: 20px;
  --radius: 18px;
  --maxw: 1120px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.7;
  letter-spacing: 0.01em;
}
img { display: block; max-width: 100%; height: auto; }
a { color: var(--primary); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 700; line-height: 1.25; margin: 0 0 0.5em; }
h2 { font-size: 30px; color: var(--primary); letter-spacing: 0.02em; }
h3 { font-size: 21px; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }

/* Preview furniture */
.preview-ribbon {
  background: var(--accent);
  color: var(--accent-text);
  font-size: 15px;
  text-align: center;
  padding: 6px var(--gutter);
}

/* Top bar */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px var(--gutter);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.brand-mark {
  width: 40px; height: 40px; flex: none;
  display: grid; place-items: center;
  font-family: var(--font-display); font-size: 21px; line-height: 1;
  color: var(--accent-text); background: var(--accent); border-radius: 10px;
}
.brand-words { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 19px; letter-spacing: 0.06em; text-transform: uppercase; }
.brand-ja { font-family: var(--font-display); font-size: 12px; letter-spacing: 0.35em; color: var(--muted); }
.topnav { display: flex; align-items: center; gap: 16px; }
.topnav > a:not(.btn) { color: var(--text); text-decoration: none; font-weight: 500; }
.brand-ja { white-space: nowrap; }
@media (max-width: 420px) { .topnav > a[href="#story"] { display: none; } }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 10px 22px;
  border-radius: 999px;
  background: var(--accent); color: var(--accent-text);
  font-family: var(--font-display); font-weight: 700; font-size: 17px;
  text-decoration: none; border: 2px solid var(--accent);
  transition: box-shadow 0.3s ease, transform 0.2s ease;
}
.btn:hover { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent), 0 0 24px -4px color-mix(in srgb, var(--detail) 60%, transparent); }
.btn.ghost { background: transparent; color: var(--text); }
.btn.small { min-height: 40px; padding: 6px 16px; font-size: 16px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* Hero: the photo first, the words on calm paper below it, never over it */
.hero { position: relative; }
.hero-photo { margin: 0; }
.hero-photo img { width: 100%; height: 44vh; min-height: 280px; max-height: 620px; object-fit: cover; object-position: 50% 40%; }
.hero-card {
  position: relative; z-index: 2;
  margin: -44px 12px 0;
  padding: 26px 22px 24px;
  background: var(--bg);
  border-radius: var(--radius) var(--radius) 0 0;
}
.kicker { font-size: 15px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
h1 { margin-bottom: 14px; }
.h1-main { display: block; font-size: 40px; color: var(--primary); letter-spacing: 0.01em; }
.h1-meaning { display: block; font-family: var(--font-body); font-weight: 400; font-size: 19px; color: var(--muted); margin-top: 4px; }
.promise { font-size: 19px; }
.status {
  margin-bottom: 14px;
  display: inline-flex; align-items: center; gap: 10px;
  padding: 8px 16px; border-radius: 14px;
  background: var(--surface); font-weight: 500; line-height: 1.4;
}
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); flex: none; }
.status.is-open .dot { background: var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 18%, transparent); }

/* Visit */
.visit {
  margin: 8px 12px 0;
  padding: 26px 22px;
  background: var(--surface);
  border-radius: var(--radius);
}
.facts { margin: 0 0 18px; }
.facts > div { padding: 12px 0; border-top: 1px solid var(--border); }
.facts dt { font-family: var(--font-display); font-weight: 700; color: var(--primary); }
.facts dd { margin: 0; }

/* Step inside */
.steps { padding: 56px 0 24px; }
.section-head { padding: 0 var(--gutter); }
.step-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.swipe-hint { font-weight: 500; color: var(--muted); margin: 0; }
.step-nav { display: flex; gap: 8px; }
.step-btn { width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: 20px; cursor: pointer; transition: box-shadow 0.3s ease; }
.step-btn:hover { box-shadow: 0 0 18px -4px color-mix(in srgb, var(--detail) 70%, transparent); }
.swipe-hint .arrow { display: inline-block; }
.step-track {
  list-style: none; margin: 0; padding: 8px var(--gutter) 16px;
  display: flex; gap: 14px;
  overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding: 0 var(--gutter);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.step-track::-webkit-scrollbar { display: none; }
.step-track { counter-reset: step; }
.step {
  counter-increment: step;
  flex: 0 0 84%; scroll-snap-align: start;
  background: var(--surface); border-radius: var(--radius); overflow: hidden;
}
.step img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.step-words { padding: 16px 18px 20px; }
.step-num::after { content: counter(step); font-family: var(--font-body); font-size: 15px; color: var(--muted); margin-left: 10px; vertical-align: middle; }
.step-num { display: block; font-family: var(--font-display); font-size: 30px; line-height: 1; color: var(--detail); margin-bottom: 8px; }
.step h3 { margin-bottom: 6px; }
.step p { margin: 0; }
.step-dots { display: flex; justify-content: center; gap: 8px; padding: 6px 0; }
.step-dots span { width: 8px; height: 8px; border-radius: 50%; background: var(--border); transition: background 0.3s, transform 0.3s; }
.step-dots span.on { background: var(--primary); transform: scale(1.25); }

/* Menu */
.menu { padding: 40px var(--gutter) 24px; }
.recommend {
  background: var(--band-1); color: var(--text);
  border-radius: var(--radius); padding: 20px 22px; margin: 8px 0 24px;
}
.recommend p { margin: 0; }
.recommend-label { font-family: var(--font-display); font-weight: 700; font-size: 20px; }
.recommend-text { font-size: 18px; }
.menu-body { display: grid; gap: 20px; }
.menu-photo { margin: 0; }
.menu-photo img { border-radius: var(--radius); aspect-ratio: 4 / 3; object-fit: cover; width: 100%; object-position: 50% 45%; }
.menu-card {
  background: color-mix(in srgb, var(--surface) 45%, var(--bg));
  border: 1px solid var(--border); border-radius: 6px;
  padding: 24px 20px 12px;
  box-shadow: 0 10px 30px -18px rgba(43, 34, 21, 0.35);
}
.menu-section { margin-bottom: 22px; }
.menu-section h3 {
  font-size: 15px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--text); padding-bottom: 8px; border-bottom: 1px solid var(--text); margin-bottom: 6px;
}
.menu-item { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 8px 0; border-bottom: 1px dashed var(--border); }
.menu-item:last-child { border-bottom: 0; }
.menu-name { font-weight: 500; }
.menu-price { font-variant-numeric: tabular-nums; font-weight: 500; }
.menu-note { grid-column: 1 / -1; color: var(--muted); font-size: 15px; line-height: 1.5; }
.price-note { color: var(--muted); font-size: 15px; }

/* Story: a dark band, ink as the ground and paper as the text (the checked text pair, reversed) */
.story-band { background: var(--text); color: var(--bg); margin-top: 40px; padding: 8px 0 40px; }
.story-band h2, .story-band .kicker, .story-band cite, .story-band figcaption { color: var(--bg); }
.story { padding: 40px var(--gutter) 8px; display: grid; gap: 22px; }
.story-quote { margin: 26px 0 0; padding: 4px 0 4px 20px; border-left: 3px solid var(--band-1); }
.story-quote p { font-family: var(--font-display); font-size: 21px; line-height: 1.6; margin-bottom: 10px; }
.story-quote cite { font-style: normal; font-size: 15px; }
.story-more { padding: 0 var(--gutter); display: grid; gap: 24px; }
.timeline { list-style: none; margin: 16px 0 0; padding: 0 0 0 22px; border-left: 1px solid color-mix(in srgb, var(--bg) 40%, transparent); }
.timeline li { position: relative; padding: 0 0 18px; }
.timeline li::before { content: ""; position: absolute; left: -28px; top: 9px; width: 11px; height: 11px; border-radius: 50%; background: var(--band-1); box-shadow: 0 0 12px 1px color-mix(in srgb, var(--band-1) 70%, transparent); }
.tl-when { display: block; font-family: var(--font-display); font-weight: 700; font-size: 19px; }
.tl-what { display: block; font-size: 17px; }
.story-photo { margin: 0; }
.story-photo img { border-radius: var(--radius); width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 25%; }
.story-words p { font-size: 18px; }
.cart { margin: 0; display: grid; grid-template-columns: 140px 1fr; gap: 16px; align-items: center; }
.cart img { border-radius: 12px; aspect-ratio: 3 / 4; object-fit: cover; }
.cart figcaption { font-family: var(--font-display); font-size: 18px; }

/* The little things */
.little { padding: 40px var(--gutter) 24px; }
.little-grid { display: grid; gap: 16px; }
.little-card { background: var(--surface); border-radius: var(--radius); overflow: hidden; }
.little-card img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.little-card h3, .little-card p, .little-card .stamp-row { margin-left: 20px; margin-right: 20px; }
.little-card h3 { margin-top: 18px; }
.little-plain { padding-top: 4px; border-left: 6px solid var(--band-1); }
.stamp-row { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 20px; font-family: var(--font-display); }
.stamp-row span {
  width: 25px; height: 25px; display: grid; place-items: center;
  border: 1.5px solid var(--detail); border-radius: 50%; font-size: 12px; color: var(--text);
}
.stamp-row .stamp-free { background: var(--band-1); border-color: var(--band-1); }

/* Find her */
.find { padding: 40px var(--gutter) 40px; display: grid; gap: 20px; }
.find-photo { margin: 0; }
.find-photo img { border-radius: var(--radius); width: 100%; aspect-ratio: 4 / 3; object-fit: cover; object-position: 50% 60%; }

/* Footer */
.footer { background: var(--surface); color: var(--text); text-align: center; padding: 40px var(--gutter) 48px; border-top: 1px solid var(--border); }
.footer a { color: var(--text); }
.signoff { font-family: var(--font-display); font-weight: 700; font-size: 30px; margin-bottom: 8px; }
.made-by { font-size: 15px; opacity: 0.85; }

/* Palette switch, preview only, inside the ribbon so it never covers the page */
.palette-switch { display: inline-flex; gap: 6px; margin-left: 6px; vertical-align: middle; }
.palette-switch button { min-width: 36px; min-height: 30px; border-radius: 999px; border: 1.5px solid var(--accent-text); background: transparent; color: var(--accent-text); font: 700 15px var(--font-display); cursor: pointer; }
.palette-switch button[aria-pressed="true"] { background: var(--accent-text); color: var(--accent); }

/* Glow: decoration only; every text pair passes with it switched off */
@property --glow-angle { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
.glow {
  position: relative;
  border: 1px solid color-mix(in srgb, var(--detail) 40%, var(--border));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--bg) 50%, transparent), 0 10px 32px -14px color-mix(in srgb, var(--detail) 55%, transparent);
}
.glow::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1.5px; pointer-events: none;
  background: conic-gradient(from var(--glow-angle), transparent 0 68%, var(--detail) 80%, var(--band-1) 86%, transparent 94%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  opacity: 0.85; z-index: 1;
}
html[data-mode="evening"] .hero-photo img { filter: brightness(0.82) saturate(0.95); }

/* Gentle arrival, only with scripts on and motion allowed */
.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.8s ease, transform 0.8s ease; }
.js .reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: no-preference) {
  .swipe-hint .arrow { animation: nudge 2.4s ease-in-out infinite; }
  .glow::before { animation: glow-travel 10s linear infinite; }
  .glow:nth-child(2n)::before { animation-duration: 13s; animation-delay: -4s; }
  .glow:nth-child(3n)::before { animation-duration: 11s; animation-delay: -7s; }
  @keyframes glow-travel { to { --glow-angle: 360deg; } }
  @keyframes nudge { 0%, 60%, 100% { transform: none; } 30% { transform: translateX(6px); } }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .step-dots span { transition: none; }
}

/* Wider screens */
@media (min-width: 760px) {
  :root { --gutter: 40px; }
  h2 { font-size: 36px; }
  .hero-photo img { height: 52vh; max-height: 560px; }
  .hero-card { max-width: 680px; margin: -56px auto 0; padding: 32px 36px 28px; }
  .h1-main { font-size: 50px; }
  .visit { max-width: var(--maxw); margin: 32px auto 0; padding: 32px 40px; display: grid; grid-template-columns: 1fr 1.6fr; gap: 24px 40px; }
  .visit h2 { grid-row: span 2; }
  .steps, .menu, .little, .find { max-width: var(--maxw); margin-left: auto; margin-right: auto; }
  .step { flex-basis: 40%; }
  .menu-body { grid-template-columns: 1fr 1.2fr; align-items: start; }
  .menu-photo img { aspect-ratio: 3 / 4; }
  .story { grid-template-columns: 1fr 1.2fr; align-items: center; gap: 48px; max-width: var(--maxw); margin: 0 auto; }
  .story-more { grid-template-columns: 1.4fr 1fr; align-items: center; gap: 48px; max-width: var(--maxw); margin: 0 auto; }
  .story-band { padding-bottom: 56px; }
  .cart { grid-template-columns: 1fr; }
  .cart img { max-width: 300px; }
  .little-grid { grid-template-columns: repeat(3, 1fr); }
  .find { grid-template-columns: 1.1fr 1fr; align-items: center; gap: 48px; }
}
@media (min-width: 1000px) {
  .hero { display: grid; grid-template-columns: 1.05fr 1fr; align-items: stretch; max-width: var(--maxw); margin: 24px auto 0; padding: 0 var(--gutter); gap: 0; }
  .hero-photo img { height: 100%; max-height: 720px; border-radius: var(--radius); }
  .hero-card { max-width: none; margin: 0; padding: 40px 0 40px 48px; border-radius: 0; display: flex; flex-direction: column; justify-content: center; }
}
@media (min-width: 1100px) {
  .step { flex-basis: 30%; }
  .h1-main { font-size: 56px; }
}
