/* =========================================================
   dopaming.coffee — page sample
   Design tokens per build guide v1.0 §4
   ========================================================= */
:root {
  --color-roast: #241812;
  --color-sack: #F4EFE7;
  --color-light-roast: #B96F2E;
  --color-dark-roast: #6F4E37;
  --color-commerce: #1E6B3F;

  --color-text-light: #F4EFE7;
  --color-text-dark: #241812;
  --color-line-dark: rgba(244, 239, 231, 0.18);
  --color-line-light: rgba(36, 24, 18, 0.18);

  /* Noto* are named per guide; not web-loaded (perf: LCP<2.5s, fewer fonts).
     System serif/gothic/mono fallbacks carry the mincho/gothic/mono roles. */
  --font-story: "Noto Serif JP", "Yu Mincho", "YuMincho", "Hiragino Mincho ProN", serif;
  --font-ui: "Noto Sans JP", "Yu Gothic", "YuGothic", "Hiragino Kaku Gothic ProN", system-ui, sans-serif;
  --font-proof: "IBM Plex Mono", "SFMono-Regular", Consolas, "Courier New", monospace;

  --content-max: 1440px;
  --reading-max: 720px;
  --space-section: clamp(72px, 12vw, 180px);
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  background: var(--color-roast);
  color: var(--color-text-light);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.9;
  letter-spacing: .04em;
  font-feature-settings: "palt";
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-weight: 600; }
:focus-visible { outline: 3px solid var(--color-light-roast); outline-offset: 3px; }

/* ---------- type roles ---------- */
.story { font-family: var(--font-story); line-height: 1.85; letter-spacing: .06em; text-wrap: balance; }
.story--xl { font-size: clamp(1.9rem, 7vw, 3.4rem); }
.story--lg { font-size: clamp(1.5rem, 4.4vw, 2.4rem); }
.eyebrow, .proof-badge, .model, .metrics, .proof, .facts,
.card__formula, .card__price, .card__meta, .product__price, .product__meta, .ec__meta {
  font-family: var(--font-proof);
  letter-spacing: .12em;
}
.reading { max-width: var(--reading-max); margin-inline: auto; }
.lead { margin-top: 1.4em; max-width: 38em; }
.note { margin-top: 1.4em; max-width: 38em; font-size: .92rem; opacity: .82; }

/* =========================================================
   S0 header
   ========================================================= */
.site-head {
  position: fixed; inset: 0 0 auto; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: 14px 20px;
  transition: background-color .4s ease, backdrop-filter .4s ease;
}
.site-head[data-scrolled] {
  background: rgba(36, 24, 18, 0.86);
  backdrop-filter: saturate(140%) blur(8px);
}
.brand { font-family: var(--font-proof); font-size: .95rem; letter-spacing: .08em; }
.nav { display: none; gap: 18px; font-size: .8rem; align-items: center; }
.nav a { border-bottom: 1px solid transparent; padding-bottom: 2px; }
.nav a:hover { border-color: currentColor; }

.nav-toggle { display: inline-flex; flex-direction: column; gap: 5px; width: 40px; height: 40px;
  align-items: center; justify-content: center; background: none; border: 0; cursor: pointer; }
.nav-toggle span { width: 22px; height: 2px; background: var(--color-text-light); transition: transform .3s, opacity .3s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.m-nav {
  position: fixed; inset: 64px 0 auto; z-index: 25;
  display: flex; flex-direction: column;
  background: rgba(36, 24, 18, 0.97); border-top: 1px solid var(--color-line-dark);
}
.m-nav a { padding: 16px 24px; border-bottom: 1px solid var(--color-line-dark); font-size: 1rem; }

/* =========================================================
   S1 hero
   ========================================================= */
.hero {
  position: relative;
  min-height: min(900px, 100svh);
  display: grid;
  grid-template-rows: 1fr auto;
  background: var(--color-roast);
  overflow: hidden;
}
.hero__media { position: absolute; inset: 0; z-index: 0; }
.hero__media img { width: 100%; height: 100%; object-fit: cover; opacity: .72; }
.hero__media::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(36,24,18,.55) 0%, rgba(36,24,18,.15) 40%, rgba(36,24,18,.85) 100%);
}
.hero__copy {
  position: relative; z-index: 1; align-self: end;
  padding: 0 24px calc(28px + env(safe-area-inset-bottom)) 24px;
  width: 100%; max-width: var(--content-max); margin-inline: auto;
}
.eyebrow { font-size: .68rem; opacity: .82; margin-bottom: 1.2em; }
.hero .story--xl { margin: 0; }
.scroll-cue {
  display: inline-flex; align-items: center; gap: .8em; margin-top: 2em;
  font-family: var(--font-proof); font-size: .72rem; letter-spacing: .16em;
}
.scroll-cue .arrow { display: inline-block; }
.scroll-cue--up { margin-top: 2.5em; }

/* =========================================================
   scene bands (S2-S4, S7) — cold -> warm progression
   ========================================================= */
.scene { position: relative; padding: var(--space-section) 20px; }
.scene__inner { position: relative; z-index: 1; }
.scene--cold { background: linear-gradient(180deg, #20262e 0%, #241c18 100%); }
.scene--transition { background: linear-gradient(180deg, #241c18 0%, #2c2019 100%); }
.scene--warm { background: linear-gradient(180deg, #2c2019 0%, var(--color-dark-roast) 130%); }

.shot { position: relative; margin: 0 auto clamp(28px, 5vw, 56px); max-width: 1180px; overflow: hidden;
  border: 1px solid var(--color-line-dark); }
.shot img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 4 / 5; }
.shot figcaption {
  position: absolute; left: 12px; bottom: 12px;
  font-family: var(--font-proof); font-size: .66rem; letter-spacing: .1em;
  color: var(--color-text-light); background: rgba(36,24,18,.72);
  padding: .5em .9em; border: 1px solid var(--color-line-dark); max-width: calc(100% - 24px);
}
.proof-badge { margin-top: 1.8em; font-size: .72rem; line-height: 2; color: var(--color-light-roast); }

/* =========================================================
   content blocks (S5, S6, S8-S12)
   ========================================================= */
.block { padding: var(--space-section) 20px; }
.block--roast { background: var(--color-roast); color: var(--color-text-light); }
.block--sack { background: var(--color-sack); color: var(--color-text-dark); }
.block--sack .note { opacity: .72; }

/* proof / facts tables (HTML, not images) */
.proof, .facts { margin-top: 2.2em; border-top: 2px solid currentColor; }
.proof div, .facts div {
  display: grid; grid-template-columns: 1fr auto; gap: 1.2em;
  padding: .85em 0; border-bottom: 1px solid var(--color-line-light);
}
.block--roast .proof div, .block--roast .facts div,
.scene .proof div, .scene .facts div { border-bottom-color: var(--color-line-dark); }
.proof dt, .facts dt { color: inherit; opacity: .72; font-size: .82rem; }
.proof dd, .facts dd { text-align: right; font-variant-numeric: tabular-nums; }

/* =========================================================
   S6 NOVO
   ========================================================= */
.novo__grid { max-width: var(--content-max); margin-inline: auto; display: grid; gap: clamp(28px, 5vw, 56px); }
.novo__text h2 { margin-bottom: .8em; }
.novo__photo { border: 1px solid var(--color-line-dark); background: #1b1410; }
.novo__photo img { width: 100%; height: auto; }
.novo__proof .model { font-size: 1.15rem; letter-spacing: .18em; padding-bottom: .6em; border-bottom: 1px solid var(--color-line-dark); }
.metrics { list-style: none; margin-top: 1.4em; display: grid; gap: .7em; font-size: .8rem; }
.metrics li { padding-left: 1.4em; position: relative; opacity: .88; }
.metrics li::before { content: "—"; position: absolute; left: 0; color: var(--color-light-roast); }

/* =========================================================
   S8 price cards
   ========================================================= */
.cards, .products { max-width: var(--content-max); margin: clamp(32px,5vw,56px) auto 0;
  display: grid; gap: 18px; }
.card { border: 1px solid var(--color-line-dark); padding: 28px 24px; background: rgba(244,239,231,.03); }
.card__tier { font-family: var(--font-proof); font-size: .72rem; letter-spacing: .2em; color: var(--color-light-roast); }
.card__formula { margin-top: 1.4em; font-size: .82rem; opacity: .8; }
.card__price { margin-top: .3em; font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.card__meta { margin-top: .6em; font-size: .78rem; opacity: .72; }
.card--limited { border-style: dashed; }

/* =========================================================
   S10 products
   ========================================================= */
.product { border: 1px solid var(--color-line-light); background: rgba(36,24,18,.03); padding: 0 0 24px; }
.product__img { aspect-ratio: 1 / 1; overflow: hidden; background: #e9e2d6; border-bottom: 1px solid var(--color-line-light); }
.product__img img { width: 100%; height: 100%; object-fit: cover; }
.product__name { font-family: var(--font-story); font-size: 1.15rem; margin: 20px 24px 0; }
.product__desc { margin: .5em 24px 0; font-size: .92rem; }
.product__price { margin: 1em 24px 0; font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.product__meta { margin: .3em 24px 0; font-size: .76rem; opacity: .7; }

/* =========================================================
   buttons — EC green ONLY for purchase actions (guide §4.2)
   ========================================================= */
.btn { display: inline-block; font-family: var(--font-ui); font-size: .95rem; letter-spacing: .1em;
  padding: .95em 2.2em; border: 1px solid currentColor; cursor: pointer; background: none; color: inherit; }
.btn--buy { margin: 20px 24px 0; background: var(--color-commerce); color: var(--color-sack); border-color: var(--color-commerce); }
.btn--buy:hover { filter: brightness(1.12); }
.btn--lg { margin-top: 1.8em; padding: 1.05em 3em; }
.ec .btn--lg { margin-left: 0; margin-right: 0; }

/* =========================================================
   S11 EC / S12 circle / footer
   ========================================================= */
.ec__meta { margin-top: 1.4em; font-size: .82rem; opacity: .8; }
.circle { text-align: left; }
.circle__sign { margin-top: 1.6em; font-family: var(--font-proof); font-size: .9rem; letter-spacing: .16em; line-height: 2; }
.circle__sign span { opacity: .7; font-size: .78rem; }

.site-foot { background: #1b1410; color: var(--color-text-light); padding: 40px 20px calc(40px + env(safe-area-inset-bottom));
  font-size: .8rem; display: flex; flex-wrap: wrap; gap: .4em 1.4em; justify-content: space-between; align-items: baseline; }
.site-foot p:first-child { font-family: var(--font-proof); letter-spacing: .1em; }
.site-foot__note { opacity: .7; }

/* =========================================================
   scroll reveal — visible without JS; hidden only when html.js
   ========================================================= */
html.js .fx { opacity: 0; transform: translateY(1.1em); transition: opacity .8s ease, transform .8s ease; }
html.js .fx.inview { opacity: 1; transform: none; }

/* =========================================================
   responsive
   ========================================================= */
@media (min-width: 768px) {
  body { font-size: 17px; }
  .scene { padding: var(--space-section) 6vw; }
  .block { padding: var(--space-section) 6vw; }
  .shot img { aspect-ratio: 16 / 9; }
  .shot--pano img { aspect-ratio: 21 / 9; }
  .cards { grid-template-columns: repeat(3, 1fr); }
  .products { grid-template-columns: repeat(3, 1fr); gap: 24px; }
}

@media (min-width: 1024px) {
  .nav { display: flex; }
  .nav-toggle { display: none; }
  .hero { grid-template-rows: none; grid-template-columns: minmax(32%, 40%) 1fr; align-items: center; }
  .hero__media { position: relative; grid-column: 2; height: 100%; }
  .hero__media img { opacity: 1; }
  .hero__media::after { background: linear-gradient(90deg, rgba(36,24,18,1) 0%, rgba(36,24,18,.35) 22%, rgba(36,24,18,0) 55%); }
  .hero__copy { grid-column: 1; grid-row: 1; align-self: center; padding: 0 4vw; max-width: none; }
  .novo__grid { grid-template-columns: 3fr 4fr 3fr; align-items: center; }
  .novo__photo { order: 0; }
}

@media (min-width: 1440px) {
  .scene, .block { padding-inline: max(6vw, calc((100vw - var(--content-max)) / 2 + 40px)); }
}

/* mobile nav visibility handled via [hidden] in HTML/JS */
.m-nav[hidden] { display: none; }

/* =========================================================
   content sub-pages (/beans/, /beans/…/) — sack ground, solid header
   ========================================================= */
body.subpage { background: var(--color-sack); color: var(--color-text-dark); }
body.subpage .site-head { background: rgba(27, 20, 16, 0.95); backdrop-filter: saturate(140%) blur(8px); color: var(--color-text-light); }

.page { max-width: var(--reading-max); margin-inline: auto;
  padding: clamp(96px, 14vh, 140px) 20px var(--space-section); }
.page--wide { max-width: 900px; }
.page-eyebrow { font-family: var(--font-proof); font-size: .72rem; letter-spacing: .2em;
  color: var(--color-dark-roast); }
.page-title { margin: .3em 0 .6em; }
.page-lead { max-width: 40em; margin-bottom: 2.4em; }

/* tier subheads + bean list */
.tier { font-family: var(--font-proof); font-size: .78rem; letter-spacing: .16em;
  color: var(--color-dark-roast); margin: 2.6em 0 0; padding-bottom: .5em;
  border-bottom: 1px solid var(--color-text-dark); }
.beans { list-style: none; border-top: 1px solid var(--color-text-dark); }
.beans li { border-bottom: 1px solid var(--color-line-light); }
.beans a { display: grid; grid-template-columns: 1fr auto; gap: 1em; align-items: baseline;
  padding: 1.05em .2em; }
.beans a:hover { background: rgba(36, 24, 18, .05); }
.beans .nm { font-family: var(--font-story); font-size: 1.05rem; }
.beans .tag { font-family: var(--font-proof); font-size: .68rem; letter-spacing: .08em;
  color: var(--color-light-roast); margin-left: .8em; }
.beans .pr { font-family: var(--font-proof); font-variant-numeric: tabular-nums; }
.page-note { margin-top: 1.6em; font-size: .85rem; color: var(--color-dark-roast); }

/* prose (detail article) */
.prose > p { margin: 1.3em 0; max-width: 40em; }
.prose h2 { font-family: var(--font-story); font-size: 1.28rem; margin: 2.6em 0 .7em;
  padding-bottom: .35em; border-bottom: 1px solid var(--color-text-dark); }
.prose ul { margin: 1.3em 0 1.3em 1.3em; max-width: 40em; }
.prose li { margin: .5em 0; }
.prose strong { color: var(--color-dark-roast); }
.prose a { border-bottom: 1px solid currentColor; }
.figure { margin: 2em 0; border: 1px solid var(--color-line-light); overflow: hidden; }
.figure img { width: 100%; height: auto; }

/* denpyo (price / lot disclosure) */
.denpyo { font-family: var(--font-proof); font-size: .9rem; margin: 2em 0;
  border-top: 2px solid var(--color-text-dark); border-bottom: 2px solid var(--color-text-dark);
  padding: 1.1em 0; max-width: 34em; }
.denpyo dl { display: grid; grid-template-columns: auto 1fr; gap: .35em 1.5em; }
.denpyo dt { color: var(--color-dark-roast); }
.denpyo dd { text-align: right; font-variant-numeric: tabular-nums; }
.denpyo .total { border-top: 1px dashed var(--color-line-light); margin-top: .6em; padding-top: .6em; font-weight: 700; }

/* faq */
.faq { max-width: 40em; margin-top: 1em; }
.faq dt { font-weight: 700; margin-top: 1.6em; }
.faq dd { margin: .4em 0 0; color: #3d3229; }

/* roast selector */
.roast { display: flex; width: max-content; max-width: 100%; margin: 1.4em 0;
  border: 1px solid var(--color-text-dark); }
.roast label { padding: .7em 1.3em; cursor: pointer; font-size: .88rem;
  border-right: 1px solid var(--color-text-dark); }
.roast label:last-child { border-right: none; }
.roast input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.roast label:has(input:checked) { background: var(--color-text-dark); color: var(--color-sack); }
.roast input:focus-visible + span { outline: 3px solid var(--color-light-roast); outline-offset: 4px; }
.pagenav { margin-top: 3em; font-family: var(--font-proof); font-size: .82rem; }
.pagenav a { border-bottom: 1px solid currentColor; }
.figure video { width: 100%; height: auto; display: block; }
.btn + .btn, .btn + .inline-link { margin-left: 1.5em; }
.inline-link { border-bottom: 1px solid currentColor; font-size: .92rem; }

/* record article (kiroku) — measured tables */
.kiroku-body { max-width: 760px; }
.kiroku-body p { margin: 1.3em 0; max-width: 40em; }
.kiroku-body strong { color: var(--color-dark-roast); }
.table-scroll { overflow-x: auto; margin: 2em 0; }
.kiroku-body table { border-collapse: collapse; width: 100%; min-width: 420px;
  font-family: var(--font-proof); font-size: .85rem; font-variant-numeric: tabular-nums; }
.kiroku-body th { border-top: 2px solid var(--color-text-dark); border-bottom: 1px solid var(--color-text-dark);
  padding: .6em .8em; text-align: left; font-weight: 600; color: var(--color-dark-roast); white-space: nowrap; }
.kiroku-body td { border-bottom: 1px solid var(--color-line-light); padding: .6em .8em; }

/* =========================================================
   reduced motion — stop everything (guide §7)
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  html.js .fx { opacity: 1 !important; transform: none !important; }
}

/* header logo (2026-10-22) */
.brand { display: inline-flex; align-items: center; line-height: 0; }
.brand img { display: block; height: 48px; width: auto; }
@media (max-width: 640px) { .brand img { height: 38px; } }
