/* ============ Design tokens — Coffee Bucket brand · Japanese · minimal · quiet ============ */
:root {
  /* Brand palette: #ECEBEB · #63371C · #BC7E44 · #5B741E · #000000 */
  --bg: #ecebeb;
  /* brand light grey */
  --bg-2: #e3e1df;
  --surface: #f4f3f2;
  --surface-solid: #f6f5f4;
  --line: rgba(0, 0, 0, .11);
  --line-strong: rgba(0, 0, 0, .26);
  --text: #141211;
  /* brand black, softened */
  --muted: #7d7873;
  --accent: #63371c;
  /* brand roast brown */
  --accent-2: #bc7e44;
  /* brand caramel */
  --seal: #63371c;
  --good: #5b741e;
  /* brand green */
  --bad: #a8402f;
  --radius: 4px;
  --font: 'IBM Plex Sans Thai', system-ui, sans-serif;
  --display: 'Cormorant Garamond', 'Noto Serif Thai', serif;
  --jp: 'Shippori Mincho', 'Noto Serif Thai', serif;
  --brand: 'Jost', 'IBM Plex Sans Thai', sans-serif;
  --ease: cubic-bezier(.25, .1, .25, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  font-weight: 300;
  background: var(--bg);
  color: var(--text);
  line-height: 1.85;
  letter-spacing: .01em;
  -webkit-font-smoothing: antialiased;
}

/* faint paper grain */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .35;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .3 0 0 0 0 .28 0 0 0 0 .26 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

a {
  color: var(--accent);
  text-decoration: none;
}

strong,
b {
  font-weight: 500;
}

code {
  font-size: .88em;
  background: var(--bg-2);
  padding: .1em .45em;
  border-radius: 2px;
}

.muted {
  color: var(--muted);
  font-weight: 300;
}

.neg {
  color: var(--bad) !important;
}

::selection {
  background: var(--accent-2);
  color: var(--surface);
}

/* ============ Nav ============ */
.nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.6rem clamp(1.4rem, 6vw, 5rem);
  transition: background .6s var(--ease), padding .6s var(--ease), border-color .6s;
  border-bottom: 1px solid transparent;
}

.scrolled .nav {
  background: rgba(236, 235, 235, .9);
  backdrop-filter: blur(10px);
  border-bottom-color: var(--line);
  padding-block: 1rem;
}

.brand {
  display: flex;
  gap: .85rem;
  align-items: center;
  color: var(--text);
}

.brand-mark {
  height: 2.4rem;
  width: auto;
  display: block;
  transition: transform .8s var(--ease);
}

.brand:hover .brand-mark {
  transform: rotate(-8deg);
}

.brand-word {
  display: flex;
  flex-direction: column;
  font-family: var(--brand);
  font-weight: 500;
  font-size: 1rem;
  letter-spacing: .26em;
  line-height: 1.15;
}

.brand-word small {
  font-size: .52rem;
  font-weight: 400;
  letter-spacing: .32em;
  color: var(--muted);
  margin-top: .2rem;
}

.nav-links {
  display: flex;
  gap: 2.6rem;
}

.nav-links a {
  color: var(--muted);
  font-size: .88rem;
  letter-spacing: .06em;
  position: relative;
  transition: color .4s var(--ease);
}

.nav-links a::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -6px;
  height: 1px;
  width: 0;
  background: var(--text);
  transition: width .5s var(--ease), left .5s var(--ease);
}

.nav-links a:hover {
  color: var(--text);
}

.nav-links a:hover::after {
  width: 100%;
  left: 0;
}

/* ============ Hero ============ */
.hero {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(3rem, 7vw, 7rem);
  align-items: center;
  padding: 9rem clamp(1.4rem, 6vw, 5rem) 6rem;
  max-width: 1280px;
  margin: 0 auto;
}

.hero-text {
  position: relative;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: .32em;
  font-size: .7rem;
  color: var(--muted);
  font-weight: 400;
  margin-bottom: 1.4rem;
  display: flex;
  align-items: center;
  gap: .9rem;
}

.eyebrow::before {
  content: '';
  width: 2rem;
  height: 1px;
  background: var(--line-strong);
}

h1 {
  font-family: var(--display);
  font-size: clamp(2.8rem, 6vw, 4.8rem);
  line-height: 1.3;
  font-weight: 400;
  letter-spacing: .01em;
}

h1 em {
  font-style: normal;
  font-weight: 300;
  color: var(--accent);
}

.lead {
  font-size: 1.02rem;
  color: #4f4b47;
  max-width: 30rem;
  margin: 2rem 0 3rem;
  font-weight: 300;
}

.lead strong {
  color: var(--good);
  font-weight: 500;
}

.hero-stats {
  display: flex;
  gap: 0;
  margin-bottom: 3rem;
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.hero-stats div {
  display: flex;
  flex-direction: column;
  padding: 1.2rem 2rem 1.2rem 0;
  margin-right: 2rem;
  border-right: 1px solid var(--line);
}

.hero-stats div:last-child {
  border-right: none;
  margin-right: 0;
}

.hero-stats b {
  font-family: var(--display);
  font-size: 2.2rem;
  font-weight: 400;
  color: var(--text);
  line-height: 1.1;
}

.hero-stats span {
  font-size: .78rem;
  color: var(--muted);
  letter-spacing: .03em;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: .8rem;
  padding: .95rem 1.8rem;
  border-radius: 2px;
  background: var(--accent);
  color: var(--surface);
  font-weight: 400;
  font-size: .9rem;
  letter-spacing: .08em;
  border: 1px solid var(--accent);
  transition: background .5s var(--ease), color .5s var(--ease);
}

.btn:hover {
  background: transparent;
  color: var(--accent);
}

.hero-media {
  position: relative;
}

.hero-media img {
  width: 100%;
  aspect-ratio: 4/5;
  object-fit: cover;
  border-radius: 2px;
  display: block;
  filter: saturate(.85);
}

.hero-media::before {
  /* vertical calligraphic label */
  content: '珈琲 · 静けさ';
  position: absolute;
  top: 0;
  right: calc(100% + 1.4rem);
  writing-mode: vertical-rl;
  font-family: var(--jp);
  font-size: .9rem;
  letter-spacing: .5em;
  color: var(--muted);
}

.hero-badge {
  position: absolute;
  left: 0;
  bottom: -1.6rem;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: .7rem 1.2rem;
  font-size: .8rem;
  color: #4f4b47;
  display: flex;
  align-items: center;
  gap: .6rem;
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--good);
  animation: breathe 4s ease-in-out infinite;
}

/* ============ Channel bar ============ */
.channel-bar {
  position: sticky;
  top: 68px;
  z-index: 40;
  max-width: 1280px;
  margin: 0 auto 1rem;
  padding: 1rem clamp(1.4rem, 6vw, 5rem);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .6rem 1.4rem;
}

.channel-bar::before {
  content: '';
  position: absolute;
  inset: 0 clamp(.4rem, 4vw, 3.5rem);
  z-index: -1;
  background: rgba(244, 243, 242, .93);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  border-radius: 2px;
}

.channel-label {
  color: var(--muted);
  font-size: .82rem;
  letter-spacing: .06em;
}

.channel-tabs {
  display: flex;
  gap: 0;
  flex-wrap: wrap;
}

.tab {
  font: inherit;
  font-size: .86rem;
  cursor: pointer;
  display: flex;
  gap: .45rem;
  align-items: center;
  padding: .45rem 1.1rem;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  border: none;
  border-bottom: 1px solid transparent;
  transition: color .4s var(--ease), border-color .4s var(--ease);
}

.tab:hover {
  color: var(--text);
}

.tab.active {
  color: var(--text);
  border-bottom-color: var(--text);
  font-weight: 500;
}

.channel-note {
  flex-basis: 100%;
  font-size: .78rem;
  color: var(--muted);
}

/* ============ Sections ============ */
.section {
  max-width: 1280px;
  margin: 0 auto;
  padding: 7rem clamp(1.4rem, 6vw, 5rem);
}

.section-alt {
  position: relative;
}

.section-alt::before {
  content: '';
  position: absolute;
  inset: 0 -50vw;
  z-index: -1;
  background: var(--bg-2);
}

.section-head {
  max-width: 36rem;
  margin-bottom: 4rem;
}

h2 {
  font-family: var(--display);
  font-size: clamp(2rem, 3.6vw, 2.7rem);
  font-weight: 400;
  line-height: 1.3;
  margin-bottom: 1rem;
  letter-spacing: .01em;
}

.section-head p:not(.eyebrow) {
  color: var(--muted);
  font-size: .95rem;
}

.pill {
  font-family: var(--font);
  font-size: .72rem;
  letter-spacing: .1em;
  vertical-align: middle;
  padding: .2rem .7rem;
  border-radius: 2px;
  color: var(--seal);
  border: 1px solid var(--seal);
}

/* ============ Cards ============ */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  padding: 1px 0 0 1px;
}

.card {
  position: relative;
  cursor: pointer;
  overflow: hidden;
  background: var(--bg);
  border: 1px solid var(--line);
  margin: -1px 0 0 -1px;
  padding: 2.2rem 2rem;
  outline: none;
  transition: background .6s var(--ease);
}

.card:hover,
.card:focus-visible {
  background: var(--surface);
}

.card:focus-visible {
  box-shadow: inset 0 0 0 1px var(--text);
}

.card-meta {
  font-size: .72rem;
  color: var(--muted);
  letter-spacing: .12em;
  text-transform: uppercase;
}

.card h3 {
  font-size: 1.45rem;
  font-weight: 400;
  margin-top: .6rem;
  line-height: 1.35;
}

.card-en {
  font-family: var(--display);
  font-style: italic;
  color: var(--muted);
  font-size: 1rem;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem 1rem;
  margin: 1rem 0 1.6rem;
}

.chips span {
  font-size: .76rem;
  color: var(--accent);
}

.chips span:not(:last-child)::after {
  content: '·';
  margin-left: 1rem;
  color: var(--line-strong);
}

.card-chart {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 1.4rem;
  align-items: center;
}

.donut {
  width: 112px;
  height: 112px;
  overflow: visible;
}

.donut .seg {
  transform-origin: center;
  animation: draw 1.4s var(--ease) both;
}

.donut text {
  text-anchor: middle;
  fill: var(--text);
}

.donut-top {
  font-family: var(--display);
  font-size: 6.4px;
  font-weight: 500;
  fill: var(--good) !important;
}

.donut-top.neg {
  fill: var(--bad) !important;
}

.donut-bottom {
  font-size: 3px;
  fill: var(--muted) !important;
}

.mini-legend {
  list-style: none;
  font-size: .78rem;
  display: grid;
  gap: .35rem;
}

.mini-legend li {
  display: flex;
  align-items: center;
  gap: .5rem;
  color: var(--muted);
}

.mini-legend i,
.breakdown i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex: none;
}

.mini-legend b {
  margin-left: auto;
  color: var(--text);
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}

.mini-legend .profit {
  color: var(--text);
  border-top: 1px solid var(--line);
  padding-top: .4rem;
  margin-top: .1rem;
}

.mini-legend .profit b {
  color: var(--good);
  font-weight: 500;
}

.card-foot {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 1.8rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
  gap: .5rem;
  flex-wrap: wrap;
}

.price {
  font-family: var(--display);
  font-size: 1.6rem;
  font-weight: 500;
}

.link {
  font-size: .8rem;
  color: var(--muted);
  letter-spacing: .06em;
  transition: color .5s var(--ease), transform .5s var(--ease);
}

.card:hover .link {
  color: var(--text);
  transform: translateX(4px);
}

.stack {
  display: flex;
  height: 6px;
  overflow: hidden;
  margin: 1.4rem 0 .5rem;
  gap: 2px;
}

.stack span {
  transition: flex .8s var(--ease);
  animation: grow 1.2s var(--ease) both;
  transform-origin: left;
}

.card-drink h3 {
  font-size: 1.3rem;
}

.ribbon {
  position: absolute;
  top: 1.4rem;
  right: 1.4rem;
  font-size: .68rem;
  letter-spacing: .1em;
  padding: .1rem .55rem;
  border: 1px solid var(--line-strong);
  color: var(--muted);
}

.profit-tag {
  font-size: .82rem;
  color: var(--good);
  font-weight: 500;
}

/* ============ Method ============ */
.method-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  padding: 1px 0 0 1px;
}

.mcard {
  background: var(--bg-2);
  border: 1px solid var(--line);
  margin: -1px 0 0 -1px;
  padding: 2.2rem 2rem;
}

.section-alt .mcard {
  background: var(--bg);
}

.mcard.wide {
  grid-column: span 2;
}

.mcard h3 {
  font-size: 1.1rem;
  font-weight: 500;
  margin-bottom: .8rem;
  display: flex;
  gap: 1rem;
  align-items: baseline;
}

.mcard h3 span {
  font-family: var(--display);
  color: var(--muted);
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: .1em;
}

.mcard p {
  color: var(--muted);
  font-size: .88rem;
  margin-bottom: 1.1rem;
}

.formula {
  font-family: var(--display);
  font-style: italic;
  font-size: 1.05rem;
  border-left: 1px solid var(--accent);
  padding: .3rem 0 .3rem 1.1rem;
  margin-bottom: 1.2rem;
  color: #4f4b47;
}

.mcard table {
  width: 100%;
  border-collapse: collapse;
  font-size: .85rem;
}

.mcard td,
.mcard th {
  padding: .55rem 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.mcard td:last-child,
.mcard th:last-child {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.mcard table.cols td:not(:first-child),
.mcard table.cols th:not(:first-child) {
  text-align: right;
}

.mcard th {
  color: var(--muted);
  font-weight: 400;
  font-size: .76rem;
  letter-spacing: .06em;
}

.mcard tr.total td {
  font-weight: 500;
  color: var(--text);
  border-bottom: none;
  padding-top: .9rem;
}

/* ============ Modal ============ */
.modal {
  margin: auto;
  width: min(760px, 94vw);
  max-height: 90vh;
  background: var(--surface-solid);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 3rem;
  box-shadow: 0 30px 80px -30px rgba(20, 18, 17, .35);
}

.modal[open] {
  animation: fade .6s var(--ease);
}

.modal::backdrop {
  background: rgba(20, 18, 17, .35);
  backdrop-filter: blur(3px);
}

.modal-close {
  position: absolute;
  top: 1.2rem;
  right: 1.4rem;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.8rem;
  font-weight: 200;
  cursor: pointer;
  line-height: 1;
  transition: color .4s var(--ease);
}

.modal-close:hover {
  color: var(--text);
}

.modal h2 {
  font-size: 2.1rem;
  margin-bottom: .2rem;
}

.modal .eyebrow {
  letter-spacing: .14em;
}

.modal h2 .muted {
  font-size: 1.1rem;
  font-family: var(--font);
}

.modal h4 {
  margin: 2.2rem 0 .3rem;
  font-weight: 500;
  font-size: .95rem;
}

.breakdown {
  width: 100%;
  border-collapse: collapse;
  margin-top: .8rem;
}

.breakdown td {
  padding: .75rem .4rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.breakdown td:first-child {
  width: 18px;
  padding-top: 1.1rem;
}

.breakdown b {
  font-weight: 400;
  display: block;
}

.breakdown small {
  color: var(--muted);
  font-size: .76rem;
}

.breakdown .num {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.row-profit b,
.row-profit .num:not(.muted) {
  color: var(--good);
  font-weight: 500;
}

.row-total td {
  border-bottom: none;
  font-weight: 500;
  font-size: 1.02rem;
  padding-top: 1.1rem;
}

.compare {
  display: grid;
  gap: .3rem;
  margin-top: .8rem;
}

.compare-row {
  display: grid;
  grid-template-columns: 170px 1fr 100px;
  align-items: center;
  gap: 1rem;
  font-size: .85rem;
  padding: .5rem .6rem;
  border-left: 1px solid transparent;
}

.compare-row.active {
  background: var(--bg);
  border-left-color: var(--text);
}

.compare-row b {
  text-align: right;
  color: var(--good);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.compare-row .bar {
  height: 4px;
  background: var(--line);
  overflow: hidden;
}

.compare-row .bar span {
  display: block;
  height: 100%;
  background: var(--good);
  animation: grow 1.2s var(--ease) both;
  transform-origin: left;
}

.hint {
  margin-top: 1.8rem;
  font-size: .82rem;
  color: var(--muted);
}

/* ============ Footer ============ */
.footer {
  text-align: center;
  padding: 4rem 1rem 5rem;
  border-top: 1px solid var(--line);
  font-size: .85rem;
}

.footer-logo {
  width: 84px;
  height: auto;
  display: block;
  margin: 0 auto 1.6rem;
  opacity: .9;
}

/* ============ Motion — slow and quiet ============ */
.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 1.4s var(--ease), transform 1.4s var(--ease);
}

.reveal.in {
  opacity: 1;
  transform: none;
}

@keyframes breathe {
  50% {
    opacity: .35;
  }
}

@keyframes draw {
  from {
    stroke-dasharray: 0 100;
  }
}

@keyframes grow {
  from {
    transform: scaleX(0);
  }
}

@keyframes fade {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}

/* ============ Responsive ============ */
@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding-top: 7rem;
  }

  .hero-media img {
    aspect-ratio: 4/3;
  }

  .hero-media::before {
    display: none;
  }

  .mcard.wide {
    grid-column: auto;
  }

  .nav-links {
    gap: 1.4rem;
  }
}

@media (max-width: 560px) {
  .nav-links {
    display: none;
  }

  .hero-stats div {
    padding-right: 1.2rem;
    margin-right: 1.2rem;
  }

  .compare-row {
    grid-template-columns: 1fr 80px;
  }

  .compare-row .bar {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .modal {
    padding: 2rem 1.2rem;
  }

  .channel-bar {
    top: 60px;
  }
}