@charset "UTF-8";

:root {
  /* Primitive palette */
  --p-cream: oklch(0.933 0.006 80);
  --p-cream-deep: oklch(0.902 0.009 80);
  --p-paper: oklch(0.962 0.006 80);
  --p-charcoal: oklch(0.32 0.018 230);
  --p-charcoal-deep: oklch(0.255 0.014 230);
  --p-muted: oklch(0.43 0.012 100);
  --p-terracotta: oklch(0.53 0.105 42);
  --p-clay-soft: oklch(0.77 0.055 48);
  --p-sage: oklch(0.64 0.025 135);
  --p-sand: oklch(0.83 0.034 80);
  --p-line: oklch(0.79 0.009 80);
  --p-light-muted: oklch(0.79 0.009 80);
  /* Semantic palette */
  --surface: var(--p-cream);
  --surface-alt: var(--p-cream-deep);
  --surface-dark: var(--p-charcoal);
  --text: var(--p-charcoal);
  --text-muted: var(--p-muted);
  --text-on-dark: var(--p-paper);
  --accent: var(--p-terracotta);
  --border: var(--p-line);
  /* Component tokens */
  --page-gutter: 20px;
  --content-max: 1440px;
  --header-height: 76px;
  --font-display: "Noto Serif CJK SC", "Source Han Serif SC", "Songti SC", STSong, serif;
  --font-body: "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-height) + 16px); }
body {
  min-width: 320px;
  overflow-x: hidden;
  color: var(--text);
  background: var(--surface);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
body:has(dialog[open]) { overflow: hidden; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button, select, input[type="range"] { cursor: pointer; }
button { color: inherit; }
button:disabled { cursor: not-allowed; opacity: .5; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
::selection { color: var(--text-on-dark); background: var(--accent); }

.skip-link {
  position: fixed; z-index: 20; top: 8px; left: 8px; padding: 10px 16px;
  color: var(--text-on-dark); background: var(--surface-dark); transform: translateY(-150%);
}
.skip-link:focus { transform: translateY(0); }
.section-pad { padding: 96px var(--page-gutter); }
.section-index, .eyebrow {
  font-size: 11px; font-weight: 600; line-height: 1.4; letter-spacing: .18em; text-transform: uppercase;
}
h1, h2, h3 { font-family: var(--font-display); font-weight: 400; line-height: 1.14; text-wrap: balance; }
h2 { font-size: clamp(36px, 8vw, 72px); letter-spacing: -.04em; }

.site-header {
  position: sticky; z-index: 10; top: 0; height: var(--header-height); padding: 0 var(--page-gutter);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: color-mix(in oklch, var(--surface) 94%, transparent);
  border-bottom: 1px solid transparent; backdrop-filter: blur(12px);
  transition: border-color 180ms ease-out, transform 180ms ease-out;
}
.site-header.is-scrolled { border-color: var(--border); }
.brand { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; }
.brand-cn { font-family: var(--font-display); font-size: 27px; line-height: 1; letter-spacing: .08em; }
.brand-en { padding-left: 10px; border-left: 1px solid currentColor; font-size: 8px; font-weight: 600; line-height: 1.25; letter-spacing: .16em; }
.desktop-nav { display: none; }
.header-actions { display: flex; align-items: center; gap: 4px; }
.list-trigger { min-height: 44px; padding: 0 4px; border: 0; background: none; font-size: 12px; }
.list-count { display: inline-grid; min-width: 22px; height: 22px; margin-left: 4px; place-items: center; border: 1px solid var(--border); border-radius: 50%; font-size: 10px; }
.icon-button {
  display: inline-grid; width: 44px; height: 44px; place-items: center; border: 0; background: transparent;
  transition: transform 160ms ease-out, background-color 160ms ease-out;
}
.icon-button:hover { background: color-mix(in oklch, var(--text) 7%, transparent); }
.icon-button:active { transform: scale(.94); }

.hero { display: grid; min-height: calc(100dvh - var(--header-height)); }
.hero-copy { display: flex; padding: 64px var(--page-gutter) 48px; flex-direction: column; align-items: flex-start; }
.eyebrow { margin-bottom: 32px; color: var(--text-muted); }
.hero h1 { font-size: clamp(62px, 16vw, 116px); letter-spacing: -.07em; }
.hero-intro { max-width: 31em; margin-top: 32px; color: var(--text-muted); line-height: 1.85; }
.arrow-link {
  display: inline-flex; min-height: 44px; padding: 4px 0; align-items: center; justify-content: space-between; gap: 32px;
  border: 0; border-bottom: 1px solid currentColor; background: none; font-size: 13px; font-weight: 600; letter-spacing: .04em;
  transition: color 180ms ease-out, gap 180ms ease-out;
}
.arrow-link:hover { gap: 40px; color: var(--accent); }
.arrow-link:active { transform: translateY(1px); }
.hero-link { margin-top: 32px; }
.hero-note { display: flex; width: 100%; margin-top: auto; padding-top: 56px; gap: 16px; color: var(--text-muted); font-size: 10px; letter-spacing: .08em; }
.hero-note span + span { padding-left: 16px; border-left: 1px solid var(--border); }
.hero-media { position: relative; height: 68dvh; min-height: 440px; overflow: hidden; background: var(--p-sand); }
.hero-media img { width: 100%; height: 112%; object-fit: cover; object-position: center 58%; will-change: transform; }
.image-caption { position: absolute; right: 16px; bottom: 12px; color: var(--text-on-dark); font-size: 10px; letter-spacing: .12em; text-shadow: 0 1px 8px var(--p-charcoal-deep); }

.manifesto { display: grid; gap: 40px; max-width: var(--content-max); margin: 0 auto; }
.manifesto > div { display: grid; gap: 32px; }
.manifesto p:last-child { max-width: 36em; color: var(--text-muted); line-height: 1.9; }

.origin { max-width: var(--content-max); margin: 0 auto; padding-top: 48px; }
.origin-heading { display: grid; gap: 24px; margin-bottom: 48px; }
.origin-figure { position: relative; height: 62dvh; min-height: 420px; overflow: hidden; background: var(--surface-dark); }
.origin-figure img { width: 100%; height: 112%; object-fit: cover; will-change: transform; }
.origin-figure figcaption { position: absolute; right: 16px; bottom: 16px; padding: 6px 10px; color: var(--text-on-dark); background: color-mix(in oklch, var(--surface-dark) 80%, transparent); font-size: 11px; letter-spacing: .06em; }
.origin-story { display: grid; gap: 48px; padding-top: 40px; }
.origin-lead { max-width: 37em; font-family: var(--font-display); font-size: 21px; line-height: 1.85; }
.origin-facts { display: grid; gap: 24px; }
.origin-facts div { display: grid; grid-template-columns: 88px 1fr; align-items: baseline; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.origin-facts dt { font-size: 24px; font-weight: 300; letter-spacing: -.04em; }
.origin-facts dd { color: var(--text-muted); font-size: 13px; }

.products { max-width: var(--content-max); margin: 0 auto; }
.products-heading { display: grid; gap: 24px; margin-bottom: 48px; }
.products-heading > div { display: grid; gap: 24px; }
.products-heading h2 { font-size: clamp(36px, 7vw, 64px); }
.products-heading > p { color: var(--text-muted); font-size: 12px; line-height: 1.8; }
.product-grid {
  display: grid; grid-auto-flow: column; grid-auto-columns: min(82vw, 330px); gap: 20px;
  margin-right: calc(var(--page-gutter) * -1); padding-right: var(--page-gutter); padding-bottom: 32px;
  overflow-x: auto; overscroll-behavior-inline: contain; scroll-snap-type: inline mandatory; scrollbar-width: thin;
}
.product-card { scroll-snap-align: start; }
.product-offset { transform: translateY(0); }
.product-visual { position: relative; display: grid; aspect-ratio: 4 / 5; place-items: center; overflow: hidden; }
.visual-clay { background: var(--p-clay-soft); }
.visual-sage { background: var(--p-sage); }
.visual-sand { background: var(--p-sand); }
.coffee-bag {
  position: relative; display: flex; width: 52%; aspect-ratio: .69; padding: 16% 10% 8%;
  flex-direction: column; align-items: center; clip-path: polygon(4% 0, 96% 0, 100% 100%, 0 100%);
  box-shadow: 0 28px 24px color-mix(in oklch, var(--p-charcoal-deep) 24%, transparent);
  transition: transform 260ms ease-out;
}
.product-visual:hover .coffee-bag { transform: translateY(-8px) rotate(-1.5deg); }
.bag-ivory { color: var(--p-charcoal); background: var(--p-paper); }
.bag-charcoal { color: var(--p-paper); background: var(--p-charcoal); }
.bag-terracotta { color: var(--p-paper); background: var(--p-terracotta); }
.bag-seal { position: absolute; top: 7%; right: 0; left: 0; height: 1px; background: currentColor; opacity: .45; }
.bag-logo { font-family: var(--font-display); font-size: clamp(22px, 6vw, 34px); letter-spacing: .12em; }
.bag-line { width: 16px; height: 1px; margin: 14px 0 20px; background: currentColor; }
.bag-name { font-family: var(--font-display); font-size: clamp(20px, 5vw, 30px); letter-spacing: .15em; }
.bag-origin { margin-top: 6px; font-size: 7px; font-weight: 600; letter-spacing: .12em; }
.bag-weight { margin-top: auto; font-size: 8px; letter-spacing: .12em; }
.product-meta { display: flex; margin-top: 20px; align-items: flex-end; justify-content: space-between; gap: 12px; }
.product-process { margin-bottom: 4px; color: var(--text-muted); font-size: 11px; letter-spacing: .05em; }
.product-meta h3 { font-size: 25px; }
.price { font-size: 15px; }
.tasting { margin: 8px 0 12px; color: var(--text-muted); font-size: 13px; }
.product-open { width: 100%; }

.brew { display: grid; gap: 56px; color: var(--text-on-dark); background: var(--surface-dark); }
.brew-media img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; }
.brew-media p { margin-top: 12px; color: var(--p-light-muted); font-size: 11px; letter-spacing: .08em; }
.brew-content { display: flex; flex-direction: column; align-items: flex-start; }
.brew-content h2 { margin: 24px 0; }
.brew-content > p:not(.section-index) { max-width: 35em; color: var(--p-light-muted); }
.calculator { width: 100%; margin-top: 40px; padding-top: 24px; border-top: 1px solid color-mix(in oklch, var(--p-paper) 24%, transparent); }
.range-label { display: flex; align-items: baseline; justify-content: space-between; font-size: 13px; }
.range-label output { font-family: var(--font-display); font-size: 30px; }
input[type="range"] { width: 100%; height: 44px; margin: 8px 0; accent-color: var(--p-clay-soft); }
.ratio-row { display: flex; min-height: 56px; align-items: center; justify-content: space-between; gap: 16px; border-top: 1px solid color-mix(in oklch, var(--p-paper) 16%, transparent); border-bottom: 1px solid color-mix(in oklch, var(--p-paper) 16%, transparent); font-size: 13px; }
select { min-height: 44px; padding: 0 32px 0 12px; color: inherit; background: var(--surface-dark); border: 0; }
.water-result { display: flex; padding: 28px 0; align-items: center; justify-content: space-between; }
.water-result span { font-size: 13px; }
.water-result strong { font-family: var(--font-display); font-size: 44px; font-weight: 400; line-height: 1; }
.water-result small { font-family: var(--font-body); font-size: 13px; font-weight: 400; }
.pour-plan { list-style: none; }
.pour-plan li { display: flex; padding: 12px 0; justify-content: space-between; gap: 16px; border-top: 1px solid color-mix(in oklch, var(--p-paper) 16%, transparent); font-size: 12px; }
.pour-plan b { font-weight: 400; color: var(--p-light-muted); }

.closing { position: relative; max-width: var(--content-max); margin: 0 auto; }
.closing h2 { margin-top: 32px; font-size: clamp(48px, 10vw, 104px); }
.circle-link {
  display: flex; width: 144px; height: 144px; margin: 48px 0 0 auto; padding: 24px; align-items: center; justify-content: center; gap: 8px;
  color: var(--text-on-dark); background: var(--accent); border: 0; border-radius: 50%; text-align: left; font-size: 12px; line-height: 1.7;
  transition: transform 220ms ease-out, background-color 220ms ease-out;
}
.circle-link:hover { transform: rotate(-6deg) scale(1.04); background: color-mix(in oklch, var(--accent) 88%, var(--p-charcoal)); }
.circle-link:active { transform: scale(.97); }
.circle-link svg { flex: 0 0 auto; }

.site-footer { padding: 64px var(--page-gutter) 24px; color: var(--text-on-dark); background: var(--p-charcoal-deep); }
.footer-top { display: grid; max-width: var(--content-max); margin: 0 auto; gap: 40px; }
.footer-brand { justify-self: start; }
.footer-top > p { color: var(--p-light-muted); font-size: 13px; }
.footer-top nav { display: grid; gap: 12px; }
.footer-top nav a { display: inline-flex; min-height: 36px; align-items: center; font-size: 13px; transition: color 160ms ease-out; }
.footer-top nav a:hover { color: var(--p-clay-soft); }
.footer-bottom { display: flex; max-width: var(--content-max); margin: 56px auto 0; padding-top: 20px; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid color-mix(in oklch, var(--p-paper) 16%, transparent); color: var(--p-light-muted); font-size: 10px; }
.footer-bottom a { display: inline-flex; min-height: 44px; align-items: center; }

/* Native dialogs provide focus trapping and Escape support. */
dialog { color: var(--text); background: var(--surface); border: 0; }
dialog::backdrop { background: color-mix(in oklch, var(--p-charcoal-deep) 68%, transparent); backdrop-filter: blur(4px); }
dialog[open] { animation: dialog-in 220ms ease-out; }
dialog.is-closing { animation: dialog-out 150ms ease-in forwards; }
@keyframes dialog-in { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes dialog-out { to { opacity: 0; transform: translateY(8px) scale(.98); } }
.dialog-bar { display: flex; min-height: 72px; padding: 0 20px; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border); font-size: 10px; font-weight: 600; letter-spacing: .15em; }
.menu-dialog { width: 100%; max-width: none; height: 100dvh; max-height: none; margin: 0; }
.mobile-nav { display: grid; padding: 32px 20px; }
.mobile-nav a { display: flex; min-height: 80px; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border); font-family: var(--font-display); font-size: 32px; }
.mobile-nav a span { font-family: var(--font-body); font-size: 10px; }
.product-dialog, .list-dialog { width: 100%; max-width: none; height: 100dvh; max-height: none; margin: 0; }
.product-dialog-body, .list-body { padding: 40px 20px; overflow-y: auto; }
.dialog-process { color: var(--text-muted); font-size: 11px; letter-spacing: .08em; }
.product-dialog-body h2 { margin: 12px 0; font-size: 44px; }
.dialog-tasting { color: var(--accent); font-family: var(--font-display); font-size: 20px; }
.dialog-description { margin: 24px 0; color: var(--text-muted); }
.dialog-specs { border-top: 1px solid var(--border); }
.dialog-specs div { display: flex; padding: 12px 0; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--border); font-size: 12px; }
.dialog-specs dd { text-align: right; }
.grind-label { display: grid; margin: 28px 0; gap: 8px; font-size: 12px; }
.grind-label select { width: 100%; padding: 0 12px; color: var(--text); background: transparent; border: 1px solid var(--border); }
.primary-button {
  display: flex; width: 100%; min-height: 52px; padding: 12px 16px; align-items: center; justify-content: space-between; gap: 16px;
  color: var(--text-on-dark); background: var(--surface-dark); border: 1px solid var(--surface-dark); font-size: 13px;
  transition: background-color 180ms ease-out, transform 160ms ease-out;
}
.primary-button:hover { background: var(--accent); border-color: var(--accent); }
.primary-button:active { transform: scale(.985); }
.list-body h2 { font-size: 48px; }
.list-note { margin: 8px 0 32px; color: var(--text-muted); font-size: 12px; }
.empty-list { padding: 48px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.empty-list p { margin-bottom: 20px; font-family: var(--font-display); font-size: 24px; }
.empty-list button { width: auto; padding-right: 32px; }
.list-item { display: grid; grid-template-columns: 1fr auto; gap: 8px 16px; padding: 20px 0; border-top: 1px solid var(--border); }
.list-item h3 { font-size: 22px; }
.list-item p { color: var(--text-muted); font-size: 11px; }
.list-item .item-price { font-size: 14px; }
.remove-item { grid-column: 1 / -1; justify-self: start; min-height: 44px; padding: 0; color: var(--text-muted); background: none; border: 0; font-size: 11px; text-decoration: underline; text-underline-offset: 4px; }
.list-summary { display: flex; padding: 24px 0; align-items: center; justify-content: space-between; border-top: 1px solid var(--border); }
.list-summary strong { font-family: var(--font-display); font-size: 32px; font-weight: 400; }
.toast { position: fixed; z-index: 30; right: 16px; bottom: 16px; max-width: calc(100% - 32px); padding: 12px 18px; color: var(--text-on-dark); background: var(--p-charcoal-deep); font-size: 12px; opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity 180ms ease-out, transform 180ms ease-out; }
.toast.is-visible { opacity: 1; transform: translateY(0); }

/* Content remains visible without JavaScript; JS adds .reveal-ready to enable motion. */
.reveal-ready .reveal { opacity: 0; transform: translateY(24px); transition: opacity 650ms ease-out, transform 650ms ease-out; }
.reveal-ready .reveal.is-visible { opacity: 1; transform: translateY(0); }
.reveal-ready .product-card:nth-child(2) { transition-delay: 80ms; }
.reveal-ready .product-card:nth-child(3) { transition-delay: 160ms; }

@media (min-width: 600px) {
  :root { --page-gutter: 32px; --header-height: 84px; }
  .section-pad { padding-top: 120px; padding-bottom: 120px; }
  .hero-copy { padding-top: 80px; }
  .manifesto { grid-template-columns: 1fr 3fr; }
  .manifesto > div { grid-template-columns: 1.2fr 1fr; align-items: end; }
  .origin-heading { grid-template-columns: 1fr 3fr; }
  .origin-story { grid-template-columns: 1.25fr 1fr; gap: 64px; }
  .products-heading { grid-template-columns: 1fr auto; align-items: end; }
  .products-heading > div { grid-template-columns: auto; }
  .brew { grid-template-columns: 1fr 1fr; align-items: center; }
  .footer-top { grid-template-columns: 1fr 1fr; }
  .footer-top nav { grid-column: 2; }
  .product-dialog, .list-dialog { width: min(520px, 100%); height: 100dvh; margin: 0 0 0 auto; }
}

@media (min-width: 900px) {
  :root { --page-gutter: 48px; --header-height: 88px; }
  .desktop-nav { display: flex; align-items: center; gap: 32px; }
  .desktop-nav a { position: relative; display: inline-flex; min-height: 44px; align-items: center; font-size: 12px; }
  .desktop-nav a::after { position: absolute; right: 0; bottom: 6px; left: 0; height: 1px; background: currentColor; content: ""; transform: scaleX(0); transform-origin: right; transition: transform 180ms ease-out; }
  .desktop-nav a:hover::after { transform: scaleX(1); transform-origin: left; }
  .menu-trigger { display: none; }
  .list-trigger { padding: 0 8px; }
  .hero { grid-template-columns: 44% 56%; }
  .hero-copy { padding: 72px var(--page-gutter) 40px; }
  .hero h1 { font-size: clamp(72px, 7.5vw, 116px); }
  .hero-media { height: calc(100dvh - var(--header-height)); min-height: 620px; }
  .hero-intro { margin-top: 40px; }
  .hero-link { margin-top: 40px; }
  .manifesto { padding-top: 152px; padding-bottom: 152px; }
  .origin-heading { margin-bottom: 64px; }
  .origin-figure { height: 72dvh; max-height: 840px; }
  .origin-story { padding: 56px 8% 0; }
  .product-grid { grid-auto-flow: initial; grid-auto-columns: initial; grid-template-columns: repeat(3, 1fr); gap: 28px; margin-right: 0; padding-right: 0; padding-bottom: 64px; overflow: visible; }
  .product-offset { transform: translateY(64px); }
  .reveal-ready .product-offset { transform: translateY(88px); }
  .reveal-ready .product-offset.is-visible { transform: translateY(64px); }
  .coffee-bag { padding-top: 13%; }
  .bag-logo { font-size: clamp(26px, 2.8vw, 42px); }
  .bag-name { font-size: clamp(24px, 2.5vw, 36px); }
  .brew { grid-template-columns: 1.08fr .92fr; gap: 8%; padding-top: 144px; padding-bottom: 144px; }
  .brew-content { padding-right: 4%; }
  .closing { padding-top: 152px; padding-bottom: 152px; }
  .circle-link { position: absolute; right: var(--page-gutter); bottom: 152px; width: 168px; height: 168px; margin: 0; }
  .footer-top { grid-template-columns: 1.2fr 1fr .6fr; align-items: start; }
  .footer-top nav { grid-column: auto; }
}

@media (min-width: 1440px) {
  .site-header { padding-right: max(48px, calc((100vw - var(--content-max)) / 2)); padding-left: max(48px, calc((100vw - var(--content-max)) / 2)); }
  .hero-copy { padding-left: max(48px, calc((100vw - var(--content-max)) / 2)); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  [data-parallax] { transform: none !important; }
  .reveal-ready .reveal { opacity: 1; transform: none; }
  .reveal-ready .product-offset { transform: none; }
}
