/* CBCo Tag – mobile-first styles */
:root {
  --blue: #2070BC;
  --blue-deep: #134f8c;
  --blue-soft: #e8f1fb;
  --teal: #5cc2b8;
  --ink: #12263f;
  --muted: #5b6b80;
  --bg: #f4f8fd;
  --card: #ffffff;
  --line: #d6e3f2;
  --danger: #c0392b;
  --radius: 18px;
  --shadow: 0 10px 30px rgba(18, 38, 63, .10);
  --head: 'Josefin Sans', 'Futura', 'Century Gothic', system-ui, sans-serif;
  --body: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh;
  font-family: var(--body); color: var(--ink); background: var(--bg);
  -webkit-font-smoothing: antialiased;
  background-image: radial-gradient(circle at 15% -10%, #dcebfb 0, transparent 45%), radial-gradient(circle at 110% 30%, #e3f4f2 0, transparent 40%);
  background-attachment: fixed;
}
button, input, textarea { font: inherit; color: inherit; }
a { color: var(--blue); }

.wrap { max-width: 520px; margin: 0 auto; padding: 18px 16px 40px; }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 6px 2px 14px; }
.brand { font-family: var(--head); font-weight: 700; letter-spacing: .28em; color: var(--blue); font-size: 15px; text-decoration: none; }
.brand small { letter-spacing: .2em; font-weight: 600; color: var(--muted); margin-left: 6px; }
.back { background: none; border: 0; color: var(--blue); font-weight: 600; padding: 8px 4px; cursor: pointer; display: none; }
.back.show { display: inline-block; }

.screen { display: none; animation: rise .35s ease both; }
.screen.active { display: block; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

h1, h2 { font-family: var(--head); text-transform: uppercase; letter-spacing: .08em; color: var(--blue); margin: 0 0 8px; line-height: 1.05; }
h1 { font-size: clamp(34px, 10vw, 46px); }
h2 { font-size: clamp(24px, 7vw, 30px); }
.lede { color: var(--muted); font-size: 17px; line-height: 1.45; margin: 0 0 18px; }
.center { text-align: center; }
.small { font-size: 13px; color: var(--muted); line-height: 1.45; }

/* hero can */
.hero { position: relative; display: flex; justify-content: center; margin: 4px 0 10px; }
.hero img, .hero canvas { width: min(56vw, 230px); height: auto; filter: drop-shadow(0 18px 24px rgba(18,38,63,.18)); }
.hero .bubble { position: absolute; top: 18%; right: 6%; background: var(--card); color: var(--blue); font-family: var(--head); font-weight: 700; letter-spacing: .08em; padding: 10px 14px; border-radius: 16px 16px 16px 4px; box-shadow: var(--shadow); transform: rotate(4deg); font-size: 14px; animation: bob 2.6s ease-in-out infinite; }
@keyframes bob { 50% { transform: rotate(4deg) translateY(-6px); } }

/* buttons */
.btn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 56px; border-radius: 999px; border: 2px solid var(--blue); background: var(--blue); color: #fff; font-family: var(--head); font-weight: 700; letter-spacing: .12em; text-transform: uppercase; font-size: 16px; padding: 14px 22px; cursor: pointer; text-decoration: none; transition: transform .1s, background .2s, opacity .2s; -webkit-tap-highlight-color: transparent; }
.btn:active { transform: scale(.98); }
.btn.ghost { background: transparent; color: var(--blue); }
.btn.light { background: var(--card); color: var(--blue); border-color: var(--line); }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn svg { width: 22px; height: 22px; flex: none; }
.stack { display: grid; gap: 12px; }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; }

/* option cards */
.options { display: grid; gap: 12px; margin-top: 8px; }
.option { display: flex; align-items: center; gap: 16px; padding: 18px; background: var(--card); border: 2px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); cursor: pointer; text-align: left; width: 100%; transition: border-color .2s, transform .1s; }
.option:active { transform: scale(.99); }
.option:hover { border-color: var(--blue); }
.option .ico { width: 54px; height: 54px; border-radius: 16px; background: var(--blue-soft); color: var(--blue); display: grid; place-items: center; flex: none; }
.option .ico svg { width: 28px; height: 28px; }
.option strong { display: block; font-family: var(--head); text-transform: uppercase; letter-spacing: .08em; color: var(--blue); font-size: 17px; margin-bottom: 2px; }
.option span { color: var(--muted); font-size: 14px; }
.option .tag { margin-left: auto; font-size: 11px; font-weight: 700; color: var(--teal); text-transform: uppercase; letter-spacing: .1em; align-self: flex-start; }

/* camera */
.cam { position: relative; width: 100%; aspect-ratio: 1 / 1; border-radius: 28px; overflow: hidden; background: #0b1726; box-shadow: var(--shadow); }
.cam video, .cam img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cam .mirror { transform: scaleX(-1); }
.cam .guide { position: absolute; inset: 12% 18% 10%; border: 3px dashed rgba(255,255,255,.55); border-radius: 50% 50% 46% 46%; pointer-events: none; }
.cam .rec-badge { position: absolute; top: 14px; left: 14px; background: rgba(192,57,43,.92); color: #fff; font-weight: 700; padding: 6px 12px; border-radius: 999px; font-size: 14px; display: none; align-items: center; gap: 6px; }
.cam .rec-badge.on { display: flex; }
.cam .rec-badge::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: #fff; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .2; } }
.cam .count { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-family: var(--head); font-size: 120px; font-weight: 700; text-shadow: 0 4px 30px rgba(0,0,0,.4); pointer-events: none; }
.cam .msg { position: absolute; inset: 0; display: grid; place-items: center; color: #cfe0f3; padding: 30px; text-align: center; }
.shutter-row { display: flex; align-items: center; justify-content: center; gap: 26px; margin: 18px 0 6px; }
.shutter { width: 78px; height: 78px; border-radius: 50%; border: 5px solid var(--blue); background: #fff; cursor: pointer; position: relative; box-shadow: var(--shadow); }
.shutter::after { content: ''; position: absolute; inset: 7px; border-radius: 50%; background: var(--blue); transition: all .2s; }
.shutter.video::after { background: var(--danger); }
.shutter.recording::after { inset: 22px; border-radius: 8px; }
.ring { position: absolute; inset: -9px; transform: rotate(-90deg); pointer-events: none; }
.ring circle { fill: none; stroke: var(--danger); stroke-width: 5; stroke-linecap: round; }
.icon-btn { width: 52px; height: 52px; border-radius: 50%; border: 2px solid var(--line); background: var(--card); color: var(--blue); display: grid; place-items: center; cursor: pointer; }
.icon-btn svg { width: 24px; height: 24px; }

/* forms */
.field { margin: 18px 0; }
.field label.lbl { display: block; font-family: var(--head); text-transform: uppercase; letter-spacing: .1em; font-weight: 700; font-size: 14px; color: var(--blue); margin-bottom: 8px; }
.input, textarea.input { width: 100%; border: 2px solid var(--line); border-radius: 14px; padding: 14px 16px; background: var(--card); font-size: 17px; outline: none; transition: border-color .2s; }
.input:focus { border-color: var(--blue); }
textarea.input { min-height: 96px; resize: vertical; line-height: 1.4; }
.counter { text-align: right; font-size: 13px; color: var(--muted); margin-top: 4px; }
.counter.over { color: var(--danger); font-weight: 700; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 6px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 1.5px solid var(--line); background: var(--card); border-radius: 999px; padding: 9px 14px; font-size: 14px; cursor: pointer; white-space: nowrap; color: var(--ink); }
.chip.on, .chip:hover { border-color: var(--blue); color: var(--blue); background: var(--blue-soft); }

.voices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.voice { position: relative; border: 2px solid var(--line); background: var(--card); border-radius: 16px; padding: 12px 44px 12px 12px; text-align: left; cursor: pointer; min-height: 64px; }
.voice strong { display: block; font-size: 15px; }
.voice span { font-size: 12.5px; color: var(--muted); }
.voice.on { border-color: var(--blue); background: var(--blue-soft); box-shadow: 0 0 0 3px rgba(32,112,188,.15); }
.voice .play { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 32px; height: 32px; border-radius: 50%; border: 0; background: var(--blue); color: #fff; display: grid; place-items: center; cursor: pointer; }
.voice .play svg { width: 14px; height: 14px; }
.voice .play.loading { opacity: .5; }

.check { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; font-size: 15px; line-height: 1.4; cursor: pointer; }
.check input { width: 22px; height: 22px; accent-color: var(--blue); flex: none; margin-top: 1px; }

.preview-sq { width: 64%; margin: 0 auto 16px; aspect-ratio: 1; border-radius: 22px; overflow: hidden; box-shadow: var(--shadow); border: 4px solid #fff; }
.preview-sq img, .preview-sq video { width: 100%; height: 100%; object-fit: cover; display: block; }
.mini { display: flex; align-items: center; gap: 12px; background: var(--card); border-radius: 16px; padding: 10px; border: 1.5px solid var(--line); margin-bottom: 10px; }
.mini img, .mini video { width: 56px; height: 56px; object-fit: cover; border-radius: 12px; }
.mini button { margin-left: auto; background: none; border: 0; color: var(--blue); font-weight: 600; cursor: pointer; }

/* brewing */
.brew { text-align: center; padding-top: 10px; }
.brew-can { width: 130px; height: 210px; margin: 10px auto 22px; border-radius: 22px 22px 18px 18px; background: #fff; border: 4px solid var(--blue); position: relative; overflow: hidden; box-shadow: var(--shadow); }
.brew-can::before { content: 'CBCo'; position: absolute; top: 18px; left: 0; right: 0; text-align: center; font-family: var(--head); font-weight: 700; letter-spacing: .3em; color: var(--blue); z-index: 2; }
.brew-fill { position: absolute; left: 0; right: 0; bottom: 0; height: 8%; background: linear-gradient(180deg, #f6c453, #e9a21f); transition: height 1.2s ease; }
.brew-fill::before { content: ''; position: absolute; left: -10%; right: -10%; top: -14px; height: 18px; background: #fffaf0; border-radius: 50%; box-shadow: 0 -4px 0 #fff; }
.bubble-dot { position: absolute; bottom: 0; width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,.75); animation: up 2.4s linear infinite; }
@keyframes up { to { transform: translateY(-190px); opacity: 0; } }
.brew-msg { font-family: var(--head); text-transform: uppercase; letter-spacing: .1em; color: var(--blue); font-size: 18px; min-height: 26px; }
.bar { height: 8px; background: var(--blue-soft); border-radius: 99px; overflow: hidden; margin: 16px 0 6px; }
.bar i { display: block; height: 100%; width: 3%; background: var(--blue); border-radius: 99px; transition: width 1s ease; }
.card { background: var(--card); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); border: 1.5px solid var(--line); margin-top: 22px; text-align: left; }
.card h3 { margin: 0 0 6px; font-family: var(--head); text-transform: uppercase; letter-spacing: .08em; color: var(--blue); font-size: 16px; }

/* player */
.player { position: relative; display: flex; justify-content: center; margin: 4px 0 8px; }
.player canvas { width: min(68vw, 300px); height: auto; filter: drop-shadow(0 22px 26px rgba(18,38,63,.22)); }
.player .tap { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: none; border: 0; cursor: pointer; }
.player .tap span { display: flex; align-items: center; gap: 10px; background: var(--blue); color: #fff; font-family: var(--head); font-weight: 700; letter-spacing: .12em; text-transform: uppercase; padding: 16px 24px; border-radius: 999px; box-shadow: 0 10px 30px rgba(32,112,188,.45); animation: pulse 1.8s ease-in-out infinite; }
.player .tap svg { width: 20px; height: 20px; }
@keyframes pulse { 50% { transform: scale(1.06); } }
.share-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.share-grid .btn { min-height: 52px; font-size: 14px; }
.share-grid .wide { grid-column: 1 / -1; }

.toast { visibility: hidden; position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%) translateY(calc(100% + 40px)); background: var(--ink); color: #fff; padding: 14px 18px; border-radius: 14px; max-width: calc(100% - 32px); width: 480px; box-shadow: 0 10px 30px rgba(0,0,0,.25); transition: transform .3s ease; z-index: 50; font-size: 15px; line-height: 1.4; }
.toast.show { visibility: visible; transform: translateX(-50%) translateY(0); }
.toast.err { background: var(--danger); }

.foot { margin-top: 28px; text-align: center; font-size: 12px; color: var(--muted); line-height: 1.6; }
.foot a { color: var(--muted); }
.hidden { display: none !important; }
.spinner { width: 20px; height: 20px; border: 3px solid rgba(255,255,255,.35); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; }
.btn.ghost .spinner, .btn.light .spinner { border-color: rgba(32,112,188,.25); border-top-color: var(--blue); }
@keyframes spin { to { transform: rotate(360deg); } }
@media (min-width: 700px) { .wrap { padding-top: 30px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
