:root {
  --espresso: #2a1a12;
  --roast: #4a2c1d;
  --mocha: #7a4a2e;
  --caramel: #d9a05b;
  --caramel-deep: #b9792f;
  --cream: #f5ead8;
  --milk: #fbf5ea;
  --pandan: #5f7f4a;
  --lotus: #e8b4a8;
  --ink: #2a1a12;
  --ink-soft: #6b5446;
  --line: rgba(42, 26, 18, .12);

  --serif: "Fraunces", Georgia, serif;
  --sans: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", sans-serif;
  --script: "Dancing Script", cursive;

  --radius: 18px;
  --shadow: 0 1px 2px rgba(42, 26, 18, .06), 0 12px 32px -8px rgba(42, 26, 18, .18);
  --shadow-lg: 0 2px 4px rgba(42, 26, 18, .08), 0 30px 60px -20px rgba(42, 26, 18, .35);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--milk);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg, video { display: block; max-width: 100%; }
a { color: inherit; }
button, input { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.1; }
h2 { font-family: var(--serif); font-weight: 500; font-size: clamp(2rem, 4.5vw, 3rem); letter-spacing: -.01em; }
em { font-style: italic; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55em;
  padding: .85em 1.5em;
  border-radius: 999px;
  border: 1.5px solid transparent;
  font-weight: 600; font-size: 1rem;
  text-decoration: none; cursor: pointer;
  transition: transform .15s ease, background-color .2s, box-shadow .2s, color .2s;
  white-space: nowrap;
}
.btn svg { width: 1.2em; height: 1.2em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--espresso); color: var(--cream); box-shadow: 0 8px 20px -8px rgba(42, 26, 18, .6); }
.btn-primary:hover { background: var(--roast); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { background: rgba(42, 26, 18, .05); border-color: rgba(42, 26, 18, .25); }
.btn-ghost-light { background: transparent; border-color: rgba(245, 234, 216, .35); color: var(--cream); }
.btn-ghost-light:hover { background: rgba(245, 234, 216, .1); }
.btn-small { padding: .55em 1.1em; font-size: .9rem; }
:focus-visible { outline: 2.5px solid var(--caramel-deep); outline-offset: 3px; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px clamp(16px, 4vw, 48px);
  background: rgba(251, 245, 234, .82);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-mark { width: 38px; height: 38px; }
.brand-mark rect { fill: var(--espresso); }
.brand-mark .cup { fill: var(--cream); }
.brand-mark .handle { fill: none; stroke: var(--cream); stroke-width: 3; }
.brand-mark .steam { fill: none; stroke: var(--caramel); stroke-width: 2.5; stroke-linecap: round; }
.brand-text { font-family: var(--serif); font-size: 1.3rem; font-weight: 600; letter-spacing: -.01em; }
.brand-text span { color: var(--caramel-deep); font-style: normal; }
.topnav { display: flex; align-items: center; gap: 22px; }
.topnav > a:not(.btn) { text-decoration: none; font-weight: 500; color: var(--ink-soft); }
.topnav > a:not(.btn):hover { color: var(--ink); }

/* ---------- hero ---------- */
.hero {
  position: relative;
  display: grid; grid-template-columns: 1.1fr 1fr; align-items: center; gap: clamp(24px, 5vw, 72px);
  max-width: 1200px; margin: 0 auto;
  padding: clamp(40px, 8vw, 110px) clamp(16px, 4vw, 48px) clamp(56px, 8vw, 120px);
  overflow: clip;
}
.hero::before {
  content: ""; position: absolute; inset: -10% -20% auto auto; width: 70vw; height: 70vw; max-width: 900px; max-height: 900px;
  background: radial-gradient(closest-side, rgba(217, 160, 91, .28), transparent 70%);
  z-index: -1; pointer-events: none;
}
.eyebrow {
  display: inline-block; margin: 0 0 18px;
  font-size: .78rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--mocha);
}
.hero h1 {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(3.2rem, 9vw, 6.5rem); letter-spacing: -.03em; line-height: .95;
}
.say { font-style: italic; color: var(--caramel-deep); display: inline-block; }
.lede { font-size: clamp(1.05rem, 1.6vw, 1.25rem); color: var(--ink-soft); max-width: 32ch; margin: 24px 0 32px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.privacy-note { display: flex; align-items: center; gap: 8px; margin: 28px 0 0; font-size: .9rem; color: var(--ink-soft); }
.privacy-note svg { width: 18px; height: 18px; fill: none; stroke: var(--pandan); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.hero-art { position: relative; height: clamp(420px, 52vw, 600px); }
.mock-strip {
  position: absolute; width: clamp(150px, 17vw, 210px);
  padding: 12px 12px 0; border-radius: 6px;
  display: grid; gap: 8px;
  box-shadow: var(--shadow-lg);
}
.mock-a { background: var(--cream); left: 18%; top: 2%; transform: rotate(-6deg); z-index: 2; animation: float-a 7s ease-in-out infinite; }
.mock-b { background: var(--espresso); right: 8%; top: 12%; transform: rotate(7deg); animation: float-b 8s ease-in-out infinite; }
.mock-shot { aspect-ratio: 4 / 3; border-radius: 4px; display: grid; place-items: center; }
.mock-shot svg { width: 70%; fill: none; stroke: rgba(42, 26, 18, .55); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.mock-shot svg .st { stroke: rgba(255, 255, 255, .9); }
.mock-shot.s1 { background: linear-gradient(135deg, #e7c39a, #b9792f); }
.mock-shot.s2 { background: linear-gradient(135deg, #c9d3b0, #6f8f58); }
.mock-shot.s3 { background: linear-gradient(135deg, #f0d7cb, #d98c7a); }
.mock-shot.s4 { background: linear-gradient(135deg, #8a5a3c, #3c2216); }
.mock-shot.s4 svg { stroke: rgba(245, 234, 216, .75); }
.mock-foot { padding: 10px 0 14px; text-align: center; font-family: var(--serif); line-height: 1.05; }
.mock-foot em { display: block; font-size: 1.35rem; font-weight: 600; }
.mock-foot span { font-family: var(--sans); font-size: .62rem; letter-spacing: .3em; text-transform: uppercase; font-weight: 600; color: var(--caramel-deep); }
.mock-b .mock-foot { color: var(--cream); }
.mock-b .mock-foot span { color: var(--caramel); }
.bean { position: absolute; width: 26px; height: 36px; border-radius: 50%; background: var(--roast); box-shadow: inset -4px -4px 8px rgba(0,0,0,.25); }
.bean::after { content: ""; position: absolute; left: 50%; top: 10%; bottom: 10%; width: 4px; margin-left: -2px; border-radius: 4px; background: var(--espresso); transform: rotate(12deg); }
.b1 { left: 4%; bottom: 14%; transform: rotate(-30deg); }
.b2 { right: 2%; bottom: 4%; transform: rotate(40deg) scale(.8); }
.b3 { left: 48%; top: -2%; transform: rotate(70deg) scale(.65); opacity: .85; }
@keyframes float-a { 50% { transform: rotate(-4deg) translateY(-10px); } }
@keyframes float-b { 50% { transform: rotate(5deg) translateY(8px); } }

/* ---------- how ---------- */
.how {
  background: var(--espresso); color: var(--cream);
  padding: clamp(64px, 9vw, 120px) clamp(16px, 4vw, 48px);
  text-align: center;
}
.steps {
  list-style: none; margin: 48px auto 0; padding: 0; max-width: 1100px;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px;
  text-align: left;
}
.steps li {
  padding: 28px; border-radius: var(--radius);
  background: rgba(245, 234, 216, .05); border: 1px solid rgba(245, 234, 216, .12);
}
.step-num {
  display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 18px;
  border-radius: 50%; background: var(--caramel); color: var(--espresso);
  font-family: var(--serif); font-size: 1.3rem; font-weight: 700;
}
.steps h3 { font-family: var(--serif); font-weight: 500; font-size: 1.5rem; margin-bottom: 8px; }
.steps p { margin: 0; color: rgba(245, 234, 216, .72); }
.steps em { color: var(--caramel); }

/* ---------- booth ---------- */
.booth { max-width: 1200px; margin: 0 auto; padding: clamp(56px, 8vw, 110px) clamp(16px, 4vw, 48px); scroll-margin-top: 60px; }
.booth-head { text-align: center; margin-bottom: 36px; }
.booth-head p { color: var(--ink-soft); margin: 10px 0 0; }
.booth-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; }

.stage {
  position: relative; overflow: hidden;
  width: 100%; aspect-ratio: 4 / 3;
  border-radius: 24px;
  background: radial-gradient(circle at 30% 20%, #4a2c1d, var(--espresso) 70%);
  box-shadow: var(--shadow-lg);
  transition: aspect-ratio .3s ease;
}
.stage[data-layout="single"] { aspect-ratio: 4 / 5; max-width: 560px; margin: 0 auto; }
.stage video {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transition: opacity .4s ease;
}
.stage.live video { opacity: 1; }
.stage.mirrored video { transform: scaleX(-1); }
.stage-idle {
  position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 14px;
  padding: 24px; text-align: center; color: var(--cream);
}
.stage-idle > svg { width: 56px; height: 56px; fill: none; stroke: var(--caramel); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.stage-idle p { margin: 0; max-width: 34ch; color: rgba(245, 234, 216, .8); }
.stage-idle-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 6px; }
.stage-idle .btn-primary { background: var(--cream); color: var(--espresso); }
.stage-idle .btn-primary:hover { background: #fff; }
.stage.live .stage-idle { display: none; }

.stage-tools { position: absolute; top: 14px; right: 14px; display: flex; gap: 8px; }
.stage:not(.live) .stage-tools { display: none; }
.stage.shooting .stage-tools { opacity: 0; pointer-events: none; }
.icon-btn {
  width: 42px; height: 42px; display: grid; place-items: center;
  border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(42, 26, 18, .5); color: var(--cream);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  transition: background-color .2s;
}
.icon-btn:hover { background: rgba(42, 26, 18, .75); }
.icon-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn[aria-pressed="false"] { opacity: .55; }
.icon-btn[aria-pressed="false"] .wave { display: none; }

.countdown {
  position: absolute; inset: 0; display: grid; place-content: center; justify-items: center;
  pointer-events: none; opacity: 0; transition: opacity .2s;
  background: radial-gradient(circle, rgba(42, 26, 18, .0) 30%, rgba(42, 26, 18, .45));
}
.countdown.show { opacity: 1; }
.count-label {
  font-size: .8rem; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--cream);
  background: rgba(42, 26, 18, .55); padding: 6px 14px; border-radius: 999px; margin-bottom: 12px;
}
.count-num {
  font-family: var(--serif); font-style: italic; font-weight: 500;
  font-size: clamp(6rem, 18vw, 12rem); line-height: 1; color: var(--cream);
  text-shadow: 0 6px 30px rgba(0, 0, 0, .35);
}
.count-num.tick { animation: tick .9s ease-out; }
@keyframes tick { 0% { transform: scale(1.5); opacity: 0; } 25% { transform: scale(1); opacity: 1; } 100% { transform: scale(.85); opacity: .85; } }
.flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.flash.go { animation: flash .5s ease-out; }
@keyframes flash { 0% { opacity: .95; } 100% { opacity: 0; } }

.shutter-row { position: relative; display: flex; align-items: center; justify-content: center; margin-top: 22px; min-height: 92px; }
.progress { position: absolute; left: 0; top: 50%; transform: translateY(-50%); display: flex; gap: 8px; }
.progress .pip {
  width: 54px; aspect-ratio: 4 / 3; border-radius: 8px; overflow: hidden;
  background: rgba(42, 26, 18, .06); border: 1.5px dashed rgba(42, 26, 18, .2);
}
.progress .pip.done { border: 0; box-shadow: var(--shadow); }
.progress .pip img { width: 100%; height: 100%; object-fit: cover; }
.cancel { position: absolute; right: 0; top: 50%; transform: translateY(-50%); }
.shutter {
  width: 84px; height: 84px; border-radius: 50%; padding: 6px; cursor: pointer;
  border: 4px solid var(--espresso); background: var(--milk);
  transition: transform .15s ease;
}
.shutter-inner { display: block; width: 100%; height: 100%; border-radius: 50%; background: var(--caramel-deep); transition: transform .2s, border-radius .2s, background-color .2s; }
.shutter:hover .shutter-inner { background: var(--caramel); }
.shutter:active { transform: scale(.94); }
.shutter:disabled { cursor: default; }
.shutter:disabled .shutter-inner { transform: scale(.55); border-radius: 12px; background: var(--mocha); }

/* panel */
.panel {
  background: #fff; border: 1px solid var(--line); border-radius: 24px; padding: 24px;
  box-shadow: var(--shadow); display: grid; gap: 22px;
}
.field h3 { font-size: .78rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--mocha); margin-bottom: 10px; }
.hint { font-weight: 400; letter-spacing: .04em; text-transform: none; color: var(--ink-soft); opacity: .7; margin-left: 4px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 999px; cursor: pointer;
  border: 1.5px solid var(--line); background: var(--milk);
  font-size: .9rem; font-weight: 500;
  transition: border-color .15s, background-color .15s, color .15s;
}
.chip:hover { border-color: rgba(42, 26, 18, .3); }
.chip[aria-pressed="true"] { background: var(--espresso); border-color: var(--espresso); color: var(--cream); }
.chip:disabled { opacity: .45; cursor: not-allowed; }
.chips-filter .chip { padding: 5px 14px 5px 5px; }
.swatch {
  width: 28px; height: 28px; border-radius: 50%; flex: none;
  background: conic-gradient(from 200deg, #e7b98a, #6f8f58, #d98c7a, #3c6f8f, #e7b98a);
}
.chips-frame .chip { padding: 5px 14px 5px 5px; }
.frame-dot { width: 28px; height: 28px; border-radius: 50%; flex: none; border: 1.5px solid rgba(42, 26, 18, .2); }
.chip[aria-pressed="true"] .frame-dot { border-color: rgba(245, 234, 216, .7); }
.text-input {
  width: 100%; padding: 12px 14px; border-radius: 12px;
  border: 1.5px solid var(--line); background: var(--milk);
  font-size: 1rem; transition: border-color .15s;
}
.text-input:focus { outline: none; border-color: var(--caramel-deep); }

/* roll */
.roll { margin-top: 56px; }
.roll h3 { font-family: var(--serif); font-weight: 500; font-size: 1.6rem; margin-bottom: 18px; }
.roll-list { display: flex; gap: 16px; overflow-x: auto; padding: 4px 4px 16px; scroll-snap-type: x mandatory; }
.roll-list button {
  flex: none; height: 220px; padding: 0; border: 0; border-radius: 6px; overflow: hidden; cursor: pointer;
  box-shadow: var(--shadow); scroll-snap-align: start; background: none;
  transition: transform .2s;
}
.roll-list button:hover { transform: translateY(-4px) rotate(-1deg); }
.roll-list img { height: 100%; width: auto; max-width: none; }

/* ---------- result dialog ---------- */
.result {
  width: min(980px, calc(100vw - 32px)); max-height: calc(100dvh - 32px);
  padding: 0; border: 0; border-radius: 28px;
  background: var(--milk); color: var(--ink); box-shadow: var(--shadow-lg);
  overflow: auto;
}
.result::backdrop { background: rgba(42, 26, 18, .7); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.result[open] { animation: pop .35s cubic-bezier(.2, .9, .3, 1.2); }
@keyframes pop { from { transform: translateY(20px) scale(.97); opacity: 0; } }
.result-inner { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 360px; }
.close-x {
  position: absolute; top: 14px; right: 14px; z-index: 2;
  width: 40px; height: 40px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(42, 26, 18, .08); font-size: 1.6rem; line-height: 1;
}
.close-x:hover { background: rgba(42, 26, 18, .15); }
.result-preview {
  display: grid; place-items: center; padding: 32px;
  background:
    radial-gradient(circle at 20% 10%, rgba(217, 160, 91, .25), transparent 50%),
    linear-gradient(160deg, #e9dcc6, #d9c6a8);
  min-height: 360px;
}
.result-preview img {
  max-height: min(72dvh, 680px); width: auto; border-radius: 4px;
  box-shadow: 0 30px 50px -20px rgba(42, 26, 18, .55);
  transform: rotate(-1.5deg);
}
.result-side { padding: 36px 28px 28px; display: grid; gap: 20px; align-content: start; }
.result-side h2 { font-size: 2.2rem; }
.result-sub { margin: -10px 0 0; color: var(--ink-soft); }
.result-actions { display: grid; gap: 10px; margin-top: 4px; }

/* ---------- footer ---------- */
.site-foot {
  background: var(--espresso); color: var(--cream); text-align: center;
  padding: 64px clamp(16px, 4vw, 48px) 40px;
}
.foot-brand { font-family: var(--serif); font-size: 2rem; font-weight: 600; }
.foot-brand span { color: var(--caramel); font-style: normal; }
.site-foot p { margin: 8px 0 24px; color: rgba(245, 234, 216, .7); }
.fb-link {
  display: inline-flex; align-items: center; gap: 10px; padding: 12px 22px; border-radius: 999px;
  background: rgba(245, 234, 216, .1); text-decoration: none; font-weight: 600;
  transition: background-color .2s;
}
.fb-link:hover { background: rgba(245, 234, 216, .18); }
.fb-link svg { width: 20px; height: 20px; fill: var(--caramel); }
.site-foot .fine { font-size: .8rem; margin: 32px 0 0; opacity: .6; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 100;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--espresso); color: var(--cream); padding: 12px 20px; border-radius: 999px;
  font-weight: 500; box-shadow: var(--shadow-lg); transition: opacity .25s, transform .25s;
  max-width: calc(100vw - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .booth-grid { grid-template-columns: 1fr; }
  .result-inner { grid-template-columns: 1fr; }
  .result-preview img { max-height: 56dvh; }
}
@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; text-align: center; }
  .lede { margin-left: auto; margin-right: auto; }
  .hero-actions, .privacy-note { justify-content: center; }
  .hero-art { height: 400px; max-width: 420px; width: 100%; margin: 0 auto; }
  .mock-strip { width: 150px; }
  .mock-a { left: 12%; }
  .steps { grid-template-columns: 1fr; }
  .topnav > a:not(.btn) { display: none; }
}
@media (max-width: 560px) {
  .brand-text { font-size: 1.1rem; }
  .brand-mark { width: 32px; height: 32px; }
  .stage { border-radius: 18px; }
  .shutter-row { flex-direction: column; gap: 14px; min-height: 0; }
  .progress, .cancel { position: static; transform: none; }
  .progress { order: 2; }
  .progress .pip { width: 44px; }
  .cancel { order: 3; }
  .result { border-radius: 22px; }
  .result-preview { padding: 22px; min-height: 0; }
  .result-side { padding: 24px 20px 22px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
