:root {
  --paper: #f4f3ee;
  --surface: #ffffff;
  --ink: #14161f;
  --muted: #5b6070;
  --line: #d9d8cf;
  --cobalt: #2b3fd6;
  --cobalt-dark: #1f2fa8;
  --butter: #ffd95a;
  --error: #b3261e;
  --radius: 14px;
}

[data-theme="dark"] {
  --paper: #12141c;
  --surface: #1b1e29;
  --ink: #f2f1ea;
  --muted: #9a9fb2;
  --line: #33374a;
  --cobalt: #7c89ff;
  --cobalt-dark: #97a2ff;
  --butter: #ffd95a;
  --error: #ff7a70;
}

[data-theme="dark"] .plan.pro { box-shadow: 8px 8px 0 rgba(255, 217, 90, .35); }
[data-theme="dark"] img, [data-theme="dark"] svg.brand-mark { filter: none; }

html { transition: background-color .25s ease; }
body { transition: background-color .25s ease, color .25s ease; }
.card, .item, .choice, .stat, .ticket, .plan, .day, .linkbox, .qr-card {
  transition: background-color .25s ease, border-color .25s ease;
}

* { box-sizing: border-box; margin: 0; -webkit-tap-highlight-color: transparent; }

html { scroll-behavior: smooth; }

body {
  font-family: "DM Sans", system-ui, sans-serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.5;
  min-height: 100vh;
  padding-bottom: env(safe-area-inset-bottom);
}

/* iOS zooms in on any input under 16px; keep all inputs at 16px+ */
input, select, textarea, button { font-size: 16px; }

/* Real tap feedback for touch screens, since :hover doesn't fire there */
button, .choice, a.btn-a {
  -webkit-user-select: none; user-select: none;
  transition: transform .08s ease, background-color .15s ease, border-color .15s ease;
}
button:active, .choice:active, a.btn-a:active { transform: scale(0.97); }

/* Every tappable control should be comfortably thumb-sized */
.choice, .btn, .btn-a, .tabs button { min-height: 44px; }

h1, h2, h3, .wordmark {
  font-family: "Bricolage Grotesque", "DM Sans", sans-serif;
  letter-spacing: -0.02em;
}

:focus-visible { outline: 3px solid var(--cobalt); outline-offset: 2px; }

.wordmark { font-weight: 800; font-size: 1.4rem; }
.wordmark span { color: var(--cobalt); }

/* ---------- Auth page ---------- */
.shell {
  max-width: 1040px;
  margin: 0 auto;
  padding: 20px 20px 48px;
}

.shell > header { padding: 8px 0 24px; display: flex; justify-content: space-between; align-items: center; }

.split { display: grid; gap: 32px; }

@media (min-width: 860px) {
  .split { grid-template-columns: 1.05fr 1fr; gap: 64px; align-items: center; padding-top: 40px; }
}

.intro h1 {
  font-size: clamp(2.2rem, 6vw, 3.6rem);
  line-height: 1.02;
  font-weight: 800;
  max-width: 12ch;
}

.intro p { margin-top: 16px; color: var(--muted); max-width: 36ch; font-size: 1.05rem; }

/* booking slip: a preview of what customers will see */
.slip {
  margin-top: 32px;
  max-width: 340px;
  background: var(--surface);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  transform: rotate(-2deg);
  box-shadow: 6px 6px 0 var(--butter);
}
.slip-top { padding: 16px 18px; }
.slip-top small { color: var(--muted); }
.slip-top strong { display: block; font-size: 1.15rem; font-family: "Bricolage Grotesque", sans-serif; }
.slip-perf { border-top: 2px dashed var(--ink); }
.slip-bottom { padding: 14px 18px; display: flex; justify-content: space-between; align-items: center; }
.slip-bottom b { font-size: 1.4rem; font-family: "Bricolage Grotesque", sans-serif; }
.slip-tag { background: var(--butter); border-radius: 99px; padding: 2px 10px; font-size: .85rem; font-weight: 600; }

@media (max-width: 859px) { .slip { display: none; } }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
}

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--paper);
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 20px;
}
.tabs button {
  border: 0; background: transparent; padding: 10px; border-radius: 8px;
  font: inherit; font-weight: 600; color: var(--muted); cursor: pointer;
}
.tabs button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }

label { display: block; font-weight: 600; font-size: .92rem; margin: 14px 0 6px; }
input {
  width: 100%; padding: 12px 14px; font: inherit;
  border: 1.5px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink);
}
input:focus { border-color: var(--cobalt); outline: none; box-shadow: 0 0 0 3px rgba(43,63,214,.18); }
.hint { font-size: .85rem; color: var(--muted); margin-top: 6px; word-break: break-all; }

.btn {
  width: 100%; margin-top: 20px; padding: 14px; border: 0; border-radius: 10px;
  background: var(--cobalt); color: #fff; font: inherit; font-weight: 700; font-size: 1rem; cursor: pointer;
}
.btn:hover { background: var(--cobalt-dark); }
.btn:disabled { opacity: .6; cursor: wait; }
.btn.secondary { background: transparent; color: var(--ink); border: 1.5px solid var(--ink); width: auto; margin: 0; padding: 8px 14px; font-size: .9rem; }
.btn.secondary:hover { background: var(--ink); color: #fff; }

.msg { margin-top: 14px; font-size: .92rem; min-height: 1.3em; color: var(--error); }
.msg.ok { color: #1b6e3a; }

[hidden] { display: none !important; }

/* Loading skeleton, used while data is fetched */
.skel { background: linear-gradient(90deg, var(--line) 25%, #ece9dd 37%, var(--line) 63%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite; border-radius: 8px; }
.skel-line { height: 14px; margin: 6px 0; }
.skel-block { height: 56px; border-radius: 12px; margin-bottom: 10px; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
@media (prefers-reduced-motion: reduce) { .skel { animation: none; } }

/* ---------- Dashboard ---------- */
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 0 24px; gap: 12px;
}
.dash h1 { font-size: clamp(1.8rem, 5vw, 2.6rem); font-weight: 800; }
.linkbox {
  margin-top: 20px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  background: var(--surface); border: 1.5px dashed var(--ink); border-radius: var(--radius); padding: 14px 16px;
}
.linkbox code { flex: 1; min-width: 200px; word-break: break-all; font-size: .95rem; }
.empty { margin-top: 24px; color: var(--muted); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---------- Dashboard sections ---------- */
.panel { margin-top: 28px; }
.panel h2 { font-size: 1.4rem; font-weight: 800; margin-bottom: 4px; }
.panel .sub { color: var(--muted); font-size: .95rem; margin-bottom: 14px; }

.list { display: grid; gap: 10px; margin-bottom: 16px; }
.item {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px;
}
.item b { display: block; }
.item small { color: var(--muted); }
.btn.danger { color: var(--error); border-color: var(--error); }
.btn.danger:hover { background: var(--error); color: #fff; }

.row3 { display: grid; grid-template-columns: 1fr; gap: 0 12px; }
@media (min-width: 600px) { .row3 { grid-template-columns: 2fr 1fr 1fr; } }
.btn.inline { width: auto; padding: 12px 20px; margin-top: 16px; }

.hours { display: grid; gap: 8px; }
.day {
  display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px;
}
.day label { margin: 0; display: flex; align-items: center; gap: 10px; font-weight: 600; }
.day input[type="checkbox"] { width: 22px; height: 22px; accent-color: var(--cobalt); flex-shrink: 0; }
.day input[type="time"] { width: auto; padding: 8px 6px; min-width: 0; }
.day.off input[type="time"] { opacity: .35; pointer-events: none; }
@media (max-width: 380px) {
  .day { grid-template-columns: 1fr; }
  .day > input[type="time"] { justify-self: stretch; }
}

/* ---------- Public booking page ---------- */
.book { max-width: 620px; margin: 0 auto; padding: 20px 20px 64px; }
.book h1 { font-size: clamp(2rem, 7vw, 2.8rem); font-weight: 800; line-height: 1.05; }
.book .about { color: var(--muted); margin-top: 8px; }
.step { margin-top: 28px; }
.step h2 { font-size: 1.15rem; font-weight: 800; margin-bottom: 10px; }

.choices { display: grid; gap: 10px; }
.choice {
  text-align: left; font: inherit; cursor: pointer; width: 100%;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px;
  display: flex; justify-content: space-between; align-items: center; gap: 12px; color: var(--ink);
}
.choice small { color: var(--muted); display: block; }
.choice:hover { border-color: var(--ink); }
.choice[aria-pressed="true"] { border-color: var(--cobalt); background: #eef0ff; box-shadow: 0 0 0 2px var(--cobalt) inset; }

.dates {
  display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 10px;
  scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.dates .choice { flex: 0 0 auto; width: auto; flex-direction: column; align-items: center; gap: 0; min-width: 76px; min-height: 76px; justify-content: center; scroll-snap-align: start; text-align: center; }
.dates .choice b { font-size: 1.3rem; font-family: "Bricolage Grotesque", sans-serif; }

.times { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.times .choice { justify-content: center; padding: 10px 0; font-weight: 600; }

.ticket {
  margin-top: 24px; background: var(--surface); border: 2px solid var(--ink); border-radius: var(--radius);
  box-shadow: 6px 6px 0 var(--butter);
}
.ticket .top { padding: 18px; }
.ticket .top small { color: var(--muted); }
.ticket .top strong { display: block; font-size: 1.3rem; font-family: "Bricolage Grotesque", sans-serif; }
.ticket .perf { border-top: 2px dashed var(--ink); }
.ticket .bottom { padding: 16px 18px; display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.ticket .bottom b { font-size: 1.5rem; font-family: "Bricolage Grotesque", sans-serif; }
.ticket .tag { background: var(--butter); border-radius: 99px; padding: 2px 12px; font-weight: 600; font-size: .9rem; }
.footer-note { margin-top: 32px; text-align: center; color: var(--muted); font-size: .85rem; }

/* ---------- Bookings list ---------- */
.day-head { font-size: 1rem; font-weight: 800; margin: 18px 0 8px; }
.booking { flex-wrap: wrap; }
.booking small a { color: var(--cobalt); font-weight: 600; }
.actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tag { border-radius: 99px; padding: 2px 10px; font-size: .82rem; font-weight: 600; }
.tag.pending { background: var(--butter); }
.tag.confirmed { background: #c9f0d6; color: #14532d; }

/* ---------- Landing page ---------- */
.land { max-width: 1040px; margin: 0 auto; padding: 0 20px; }
.nav { display: flex; justify-content: space-between; align-items: center; padding: 16px 0; gap: 10px; }
.nav .links { display: flex; gap: 14px; align-items: center; }
.nav a { color: var(--ink); font-weight: 600; text-decoration: none; white-space: nowrap; }
.nav a:hover { color: var(--cobalt); }
@media (max-width: 420px) {
  .nav .links a:not(.btn-a) { display: none; } /* keep just Get started on very small screens */
  .nav a.btn-a { padding: 10px 14px; font-size: .92rem; }
}

.btn-a {
  display: inline-block; padding: 14px 22px; border-radius: 10px; font-weight: 700; text-decoration: none;
  background: var(--cobalt); color: #fff; border: 2px solid var(--cobalt);
}
.btn-a:hover { background: var(--cobalt-dark); border-color: var(--cobalt-dark); color: #fff; }
.btn-a.ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-a.ghost:hover { background: var(--ink); color: #fff; }
.nav a.btn-a { color: #fff; padding: 8px 16px; }

.hero { display: grid; gap: 40px; padding: 32px 0 64px; }
@media (min-width: 860px) { .hero { grid-template-columns: 1.2fr 1fr; align-items: center; padding: 56px 0 88px; } }
.hero h1 { font-size: clamp(2.6rem, 8vw, 4.6rem); line-height: 1; font-weight: 800; max-width: 11ch; }
.hero p { margin-top: 18px; font-size: 1.15rem; color: var(--muted); max-width: 38ch; }
.hero .cta { margin-top: 28px; display: flex; gap: 12px; flex-wrap: wrap; }
.hero .slip { display: block; margin: 0 auto; max-width: 360px; width: 100%; }

.section { padding: 56px 0; border-top: 1px solid var(--line); }
.section > h2 { font-size: clamp(1.7rem, 5vw, 2.4rem); font-weight: 800; max-width: 20ch; line-height: 1.1; }
.section > .lead { margin-top: 12px; color: var(--muted); max-width: 52ch; }

.who { margin-top: 28px; display: grid; gap: 14px; }
@media (min-width: 720px) { .who { grid-template-columns: repeat(3, 1fr); } }
.who div { padding-left: 14px; border-left: 4px solid var(--butter); }
.who b { display: block; font-family: "Bricolage Grotesque", sans-serif; font-size: 1.15rem; }
.who span { color: var(--muted); }

.steps { margin: 28px 0 0; padding: 0; list-style: none; display: grid; gap: 18px; counter-reset: s; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 44px 1fr; gap: 14px; align-items: start; }
.steps li::before {
  content: counter(s); width: 44px; height: 44px; border-radius: 50%; background: var(--ink); color: var(--butter);
  display: grid; place-items: center; font-family: "Bricolage Grotesque", sans-serif; font-weight: 800; font-size: 1.2rem;
}
.steps b { display: block; font-size: 1.05rem; }
.steps span { color: var(--muted); }

.plans { margin-top: 28px; display: grid; gap: 18px; }
@media (min-width: 720px) { .plans { grid-template-columns: 1fr 1fr; align-items: stretch; } }
.plan { border-radius: var(--radius); padding: 26px; border: 1.5px solid var(--ink); background: var(--surface); display: flex; flex-direction: column; }
.plan h3 { font-size: 1.3rem; font-weight: 800; }
.plan .price { font-family: "Bricolage Grotesque", sans-serif; font-size: 3rem; font-weight: 800; line-height: 1.1; margin: 8px 0; }
.plan .price small { font-size: 1rem; font-weight: 500; font-family: "DM Sans", sans-serif; opacity: .7; }
.plan ul { list-style: none; padding: 0; margin: 14px 0 24px; display: grid; gap: 10px; flex: 1; }
.plan li { padding-left: 24px; position: relative; }
.plan li::before { content: "✓"; position: absolute; left: 0; font-weight: 800; color: var(--cobalt); }
.plan li em { font-style: normal; font-size: .8rem; font-weight: 700; background: var(--butter); color: var(--ink); border-radius: 99px; padding: 1px 8px; margin-left: 6px; }
.plan.pro { background: var(--ink); color: #fff; box-shadow: 8px 8px 0 var(--butter); }
.plan.pro li::before { color: var(--butter); }
.plan.pro .btn-a { background: var(--butter); border-color: var(--butter); color: var(--ink); text-align: center; }
.plan .btn-a { text-align: center; }
.pricing-note { margin-top: 18px; color: var(--muted); font-size: .95rem; max-width: 60ch; }

.land footer { padding: 32px 0 48px; border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }

/* ================= Animation pass ================= */

/* Wordmark: the dot has a pulse, the whole mark hops on hover */
.wordmark { display: inline-flex; }
.wordmark span { color: var(--cobalt); display: inline-block; animation: dotPulse 2.4s ease-in-out infinite; }
a.wordmark:hover, .wordmark:hover { animation: wmHop .5s ease; }
@keyframes dotPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.35) rotate(-8deg); } }
@keyframes wmHop { 0% { transform: translateY(0); } 30% { transform: translateY(-6px) rotate(-3deg); } 55% { transform: translateY(0) rotate(2deg); } 100% { transform: translateY(0); } }

/* Floating, slightly wobbling ticket/slip illustration */
.slip {
  animation: slipFloat 5s ease-in-out infinite;
  transform-origin: 50% 100%;
}
@keyframes slipFloat {
  0%, 100% { transform: rotate(-2deg) translateY(0); }
  50% { transform: rotate(1.5deg) translateY(-10px); }
}

/* Drifting gradient blobs behind the hero, pure CSS, no images */
.hero { position: relative; overflow: visible; isolation: isolate; }
.hero::before, .hero::after {
  content: ""; position: absolute; z-index: -1; border-radius: 50%; filter: blur(38px); opacity: .55;
  will-change: transform;
}
.hero::before {
  width: 260px; height: 260px; background: var(--butter);
  top: -60px; left: -40px; animation: blobA 9s ease-in-out infinite;
}
.hero::after {
  width: 320px; height: 320px; background: var(--cobalt); opacity: .28;
  bottom: -80px; right: -60px; animation: blobB 11s ease-in-out infinite;
}
@keyframes blobA { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(30px,40px) scale(1.15); } }
@keyframes blobB { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(-25px,-30px) scale(1.1); } }

/* Button shine sweep on hover */
.btn-a, .btn { position: relative; overflow: hidden; }
.btn-a::after, .btn:not(.secondary):not(.danger)::after {
  content: ""; position: absolute; top: 0; left: -60%; width: 40%; height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255,255,255,.55), transparent);
  transform: skewX(-20deg); transition: left .55s ease;
}
.btn-a:hover::after, .btn:not(.secondary):not(.danger):hover::after { left: 130%; }

/* Scroll reveal: sections settle into place as they enter view */
.reveal { opacity: 0; transform: translateY(28px) rotate(-.4deg); transition: opacity .6s ease, transform .6s cubic-bezier(.2,.8,.2,1); }
.reveal.in { opacity: 1; transform: translateY(0) rotate(0); }

/* Choice buttons (services/dates/times) pop in with a stagger */
.choices .choice, .dates .choice, .times .choice { animation: popIn .35s cubic-bezier(.2,.9,.3,1.3) backwards; }
.choices .choice:nth-child(1), .dates .choice:nth-child(1), .times .choice:nth-child(1) { animation-delay: .02s; }
.choices .choice:nth-child(2), .dates .choice:nth-child(2), .times .choice:nth-child(2) { animation-delay: .06s; }
.choices .choice:nth-child(3), .dates .choice:nth-child(3), .times .choice:nth-child(3) { animation-delay: .10s; }
.choices .choice:nth-child(4), .dates .choice:nth-child(4), .times .choice:nth-child(4) { animation-delay: .14s; }
.choices .choice:nth-child(5), .dates .choice:nth-child(5), .times .choice:nth-child(5) { animation-delay: .18s; }
.choices .choice:nth-child(n+6), .dates .choice:nth-child(n+6), .times .choice:nth-child(n+6) { animation-delay: .2s; }
@keyframes popIn { from { opacity: 0; transform: scale(.85) translateY(6px); } to { opacity: 1; transform: scale(1) translateY(0); } }

/* Selected choice gets a little confirm bounce */
.choice[aria-pressed="true"] { animation: choicePick .3s ease; }
@keyframes choicePick { 0% { transform: scale(1); } 40% { transform: scale(1.06); } 100% { transform: scale(1); } }

/* Ticket entrance on successful booking, plus confetti pieces */
#done .ticket { animation: ticketIn .55s cubic-bezier(.2,.8,.25,1.2); }
@keyframes ticketIn { from { opacity: 0; transform: translateY(24px) rotate(-6deg) scale(.9); } to { opacity: 1; transform: translateY(0) rotate(0) scale(1); } }

.confetti-piece {
  position: fixed; top: -10px; z-index: 999; pointer-events: none; border-radius: 2px;
  animation: confettiFall linear forwards;
}
@keyframes confettiFall {
  to { transform: translateY(100vh) rotate(540deg); opacity: .9; }
}
@media (prefers-reduced-motion: reduce) {
  .wordmark span, a.wordmark:hover, .wordmark:hover, .slip, .hero::before, .hero::after,
  .btn-a::after, .btn::after, .choice, .choice[aria-pressed="true"], #done .ticket, .confetti-piece {
    animation: none !important; transition: none !important;
  }
  .reveal { opacity: 1; transform: none; }
}

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 18px; }
.stat { background: var(--surface); border: 1.5px solid var(--ink); border-radius: var(--radius); padding: 16px 18px; }
.stat-num { display: block; font-family: "Bricolage Grotesque", sans-serif; font-size: 1.9rem; font-weight: 800; }
.stat-label { color: var(--muted); font-size: .88rem; }

/* ---------- Live indicator ---------- */
.live-dot {
  display: inline-block; width: 9px; height: 9px; border-radius: 50%;
  background: var(--line); margin-left: 8px; vertical-align: middle;
}
.live-dot.on { background: #2fae5e; animation: livePulse 1.8s ease-in-out infinite; }
@keyframes livePulse { 0%,100% { box-shadow: 0 0 0 0 rgba(47,174,94,.5); } 70% { box-shadow: 0 0 0 7px rgba(47,174,94,0); } }

/* ---------- Toasts ---------- */
#toasts { position: fixed; top: 14px; right: 14px; left: 14px; z-index: 1000; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; pointer-events: none; }
.toast {
  pointer-events: auto; cursor: pointer; max-width: 320px;
  background: var(--ink); color: #fff; font-weight: 600; font-size: .92rem;
  padding: 12px 16px; border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.25);
  animation: toastIn .35s cubic-bezier(.2,.85,.3,1.2), toastOut .3s ease 5.7s forwards;
}
.toast::before { content: "🔔  "; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-16px) scale(.95); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-10px); } }
@media (prefers-reduced-motion: reduce) { .toast, .live-dot.on { animation: none !important; } }

/* ---------- QR card ---------- */
.qr-card {
  margin-top: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; display: flex; gap: 16px; align-items: center; flex-wrap: wrap;
}
.qr-card canvas { border-radius: 8px; border: 1px solid var(--line); flex-shrink: 0; }
.qr-card > div { flex: 1; min-width: 180px; }

/* ---------- Theme toggle ---------- */
.theme-btn {
  width: 40px; height: 40px; border-radius: 50%; border: 1.5px solid var(--line);
  background: var(--surface); color: var(--ink); display: grid; place-items: center;
  cursor: pointer; flex-shrink: 0; position: relative; overflow: hidden;
}
.theme-btn svg { width: 20px; height: 20px; transition: transform .4s cubic-bezier(.2,.8,.2,1.2), opacity .3s ease; }
.theme-btn .sun { position: absolute; }
.theme-btn .moon { position: absolute; }
[data-theme="dark"] .theme-btn .sun { opacity: 0; transform: rotate(90deg) scale(.4); }
[data-theme="dark"] .theme-btn .moon { opacity: 1; transform: rotate(0) scale(1); }
:root:not([data-theme="dark"]) .theme-btn .sun { opacity: 1; transform: rotate(0) scale(1); }
:root:not([data-theme="dark"]) .theme-btn .moon { opacity: 0; transform: rotate(-90deg) scale(.4); }
.theme-btn:active { transform: scale(.9); }

.theme-fixed { position: fixed; top: 14px; right: 14px; z-index: 200; }

/* ---------- PWA install button ---------- */
.install-btn {
  position: relative; overflow: visible;
  animation: installGlow 2.2s ease-in-out infinite;
}
@keyframes installGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(43,63,214,.45); }
  50% { box-shadow: 0 0 0 10px rgba(43,63,214,0); }
}
[data-theme="dark"] .install-btn { animation-name: installGlowDark; }
@keyframes installGlowDark {
  0%, 100% { box-shadow: 0 0 0 0 rgba(124,137,255,.55); }
  50% { box-shadow: 0 0 0 10px rgba(124,137,255,0); }
}

.ios-install-tip {
  margin-top: 14px; background: var(--surface); border: 1.5px dashed var(--ink);
  border-radius: 12px; padding: 12px 16px; font-size: .92rem; color: var(--muted);
  display: flex; align-items: center; gap: 8px;
}
.ios-install-tip b { color: var(--ink); }

/* ---------- Installed-app boot animation ---------- */
.splash {
  display: none;
  position: fixed; inset: 0; z-index: 9999;
  background: var(--cobalt);
  align-items: center; justify-content: center;
  clip-path: circle(150% at 50% 50%);
}
html.is-installed-launch .splash {
  display: flex;
  animation: splashIris 1.6s cubic-bezier(.5,0,.2,1) forwards;
}
@keyframes splashIris {
  0%, 52% { clip-path: circle(150% at 50% 50%); }
  100% { clip-path: circle(0% at 50% 50%); }
}

.splash-ring {
  position: absolute; width: 40px; height: 40px; border-radius: 50%;
  border: 3px solid var(--butter); opacity: 0;
}
html.is-installed-launch .splash-ring {
  animation: ringPulse 0.9s ease-out 0.35s;
}
@keyframes ringPulse {
  0% { transform: scale(1); opacity: .9; }
  100% { transform: scale(9); opacity: 0; }
}

.splash-word {
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 800; font-size: 2.4rem; color: #fff;
  display: inline-block; transform: scale(0);
}
html.is-installed-launch .splash-word {
  animation: wordPop 0.55s cubic-bezier(.2,1.4,.4,1) 0.1s forwards;
}
@keyframes wordPop {
  0% { transform: scale(0) rotate(-8deg); opacity: 0; }
  60% { transform: scale(1.15) rotate(2deg); opacity: 1; }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}
.splash-sub {
  color: rgba(255,255,255,.75); font-size: .85rem; font-weight: 600;
  opacity: 0;
}
html.is-installed-launch .splash-sub {
  animation: subFade 0.5s ease 0.6s forwards;
}
@keyframes subFade { to { opacity: 1; } }
.splash-word .dot { color: var(--butter); display: inline-block; }
html.is-installed-launch .splash-word .dot {
  animation: dotSpin 0.6s ease-out 0.45s;
}
@keyframes dotSpin {
  0% { transform: scale(0.6) rotate(0); }
  100% { transform: scale(1) rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
  html.is-installed-launch .splash { animation: none; display: none; }
}
