@view-transition {
  navigation: auto;
}

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.35s;
  animation-timing-function: ease;
}

@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) {
    animation: none !important;
  }
}

:root {
  --ground: #faf4fb;
  --ground-raised: #ffffff;
  --ink: #2b2233;
  --ink-soft: #6b5f78;
  --accent: #b9a8e8;
  --accent-strong: #9a84d9;
  --blush: #f3c9d6;
  --mint: #bee8d6;
  --sky: #bfd7ef;
  --grape: #cec3ef;
  --lilac: #e1d3ee;
  --blush-ink: #7a3a52;
  --mint-ink: #2f5f49;
  --sky-ink: #2c5273;
  --grape-ink: #3f2c77;
  --lilac-ink: #5e397f;
  --line: rgba(43, 34, 51, 0.12);
  --shadow: 0 18px 40px -20px rgba(80, 50, 100, 0.35);
  --bubble-core: rgba(255, 255, 255, 0.9);
  --bubble-tint: rgba(185, 168, 232, 0.25);
  --bubble-tint-soft: rgba(185, 168, 232, 0.05);
  --bubble-sheen: rgba(255, 255, 255, 0.85);
  --bubble-shade: rgba(154, 132, 217, 0.16);
  color-scheme: light;
}

/* dark applies when the system asks for it, unless the visitor forced light */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #221a2e;
    --ground-raised: #2c2239;
    --ink: #f2ecf7;
    --ink-soft: #c3b6d1;
    --accent: #cbbdf2;
    --accent-strong: #b39ef0;
    --blush: #e7a8bd;
    --mint: #9fd6ba;
    --sky: #9cc0e8;
    --grape: #a996e3;
    --lilac: #c9aee0;
    --blush-ink: #2b1219;
    --mint-ink: #12261c;
    --sky-ink: #12222f;
    --grape-ink: #18112d;
    --lilac-ink: #22152e;
    --line: rgba(242, 236, 247, 0.14);
    --shadow: 0 18px 40px -20px rgba(0, 0, 0, 0.6);
    --bubble-core: rgba(226, 216, 250, 0.5);
    --bubble-tint: rgba(179, 158, 240, 0.22);
    --bubble-tint-soft: rgba(179, 158, 240, 0.05);
    --bubble-sheen: rgba(226, 216, 250, 0.4);
    --bubble-shade: rgba(0, 0, 0, 0.35);
    color-scheme: dark;
  }
}

/* visitor forced dark — same values, applied regardless of system setting.
   keep in sync with the media-query block above */
:root[data-theme="dark"] {
  --ground: #221a2e;
  --ground-raised: #2c2239;
  --ink: #f2ecf7;
  --ink-soft: #c3b6d1;
  --accent: #cbbdf2;
  --accent-strong: #b39ef0;
  --blush: #e7a8bd;
  --mint: #9fd6ba;
  --sky: #9cc0e8;
  --grape: #a996e3;
  --lilac: #c9aee0;
  --blush-ink: #2b1219;
  --mint-ink: #12261c;
  --sky-ink: #12222f;
  --grape-ink: #18112d;
  --lilac-ink: #22152e;
  --line: rgba(242, 236, 247, 0.14);
  --shadow: 0 18px 40px -20px rgba(0, 0, 0, 0.6);
  --bubble-core: rgba(226, 216, 250, 0.5);
  --bubble-tint: rgba(179, 158, 240, 0.22);
  --bubble-tint-soft: rgba(179, 158, 240, 0.05);
  --bubble-sheen: rgba(226, 216, 250, 0.4);
  --bubble-shade: rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: Optima, Candara, "Noto Sans", sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
}

.display {
  font-family: "Iowan Old Style", Palatino, "Palatino Linotype", "Book Antiqua", serif;
}

.caption {
  font-family: ui-monospace, "SF Mono", "Cascadia Code", Consolas, monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.68rem;
  color: var(--ink-soft);
}

.stage {
  max-width: 640px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 5rem;
  position: relative;
  pointer-events: none;
}

/* .stage is click-through so bubbles behind it stay poppable; opt
   the actual interactive/opaque pieces back in explicitly */
.bar,
.label-panel,
.invitation,
.parcel,
footer.shop-footer {
  pointer-events: auto;
}

/* ambient bubbles */
.bubble-field {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.bubble {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, var(--bubble-core), var(--bubble-tint) 55%, var(--bubble-tint-soft) 75%);
  box-shadow:
    inset 5px 7px 12px -6px var(--bubble-sheen),
    inset -4px -5px 10px -7px var(--bubble-shade);
  animation: drift 14s ease-in-out infinite;
  pointer-events: auto;
  cursor: pointer;
}
.b1 { width: 46px; height: 46px; left: 8%; top: 12%; animation-delay: 0s; }
.b2 { width: 26px; height: 26px; left: 85%; top: 22%; animation-delay: 2s; }
.b3 { width: 64px; height: 64px; left: 78%; top: 68%; animation-delay: 4s; }
.b4 { width: 20px; height: 20px; left: 15%; top: 78%; animation-delay: 1s; }
.b5 { width: 34px; height: 34px; left: 50%; top: 5%; animation-delay: 3s; }

.bubble.popping {
  animation: bubble-pop 0.3s ease forwards;
  pointer-events: none;
}
.bubble.appearing {
  animation: bubble-appear 0.4s ease forwards;
}

@keyframes drift {
  0%, 100% { transform: translateY(0) translateX(0); }
  50% { transform: translateY(-22px) translateX(10px); }
}
@keyframes bubble-pop {
  0% { transform: scale(1); opacity: 1; }
  60% { transform: scale(1.6); opacity: 0.5; }
  100% { transform: scale(2); opacity: 0; }
}
@keyframes bubble-appear {
  0% { transform: scale(0.2); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .bubble { animation: none; }
}

.bubble-counter {
  position: relative;
  z-index: 1;
  display: table;
  margin: 1.75rem auto 0;
  background: var(--ground-raised);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.4rem 0.85rem;
  box-shadow: var(--shadow);
}

header.masthead {
  position: relative;
  z-index: 1;
  text-align: center;
  margin-bottom: 2.75rem;
}

.medallion {
  width: 132px;
  height: 132px;
  margin: 0 auto 0.75rem;
  filter: drop-shadow(0 10px 18px rgba(80, 50, 100, 0.25));
}

.medallion.small {
  width: 84px;
  height: 84px;
}

/* Soapy artwork on the landing page — bare transparent PNG, no frame.
   Width capped so the square canvas never outgrows the shelf below. */
.mascot {
  display: block;
  width: min(340px, 100%);
  height: auto;
  margin: 0 auto 0.75rem;
}

h1.wordmark {
  font-size: 2.4rem;
  margin: 0;
  letter-spacing: 0.01em;
}
h1.wordmark.small { font-size: 1.8rem; }

.tagline {
  margin: 0.35rem 0 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

/* shelf grid */
.shelf {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.1rem;
}
@media (max-width: 480px) {
  .shelf { grid-template-columns: 1fr; }
}

.bar {
  position: relative;
  display: block;
  text-decoration: none;
  color: inherit;
  border-radius: 26px;
  padding: 1.4rem 1.2rem 1.1rem;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.5);
  transition: transform 0.18s ease;
}
.bar:hover { transform: translateY(-3px); }
.bar:focus-visible { outline: 3px solid var(--accent-strong); outline-offset: 3px; }

.bar.blush { background: linear-gradient(165deg, var(--blush), color-mix(in srgb, var(--blush) 70%, white)); color: var(--blush-ink); }
.bar.mint  { background: linear-gradient(165deg, var(--mint), color-mix(in srgb, var(--mint) 70%, white)); color: var(--mint-ink); }
.bar.sky   { background: linear-gradient(165deg, var(--sky), color-mix(in srgb, var(--sky) 70%, white)); color: var(--sky-ink); }
.bar.grape { background: linear-gradient(165deg, var(--grape), color-mix(in srgb, var(--grape) 70%, white)); color: var(--grape-ink); }
.bar.lilac { background: linear-gradient(165deg, var(--lilac), color-mix(in srgb, var(--lilac) 70%, white)); color: var(--lilac-ink); }

.bar .icon { width: 34px; height: 34px; margin-bottom: 0.65rem; }
.bar .name { font-family: "Iowan Old Style", Palatino, serif; font-size: 1.15rem; display: block; margin-bottom: 0.15rem; }
.bar .sub { font-size: 0.8rem; opacity: 0.85; display: block; }

footer.shop-footer {
  position: relative;
  z-index: 1;
  text-align: center;
  margin-top: 3rem;
  font-size: 0.85rem;
  color: var(--ink-soft);
}
footer.shop-footer a { color: var(--accent-strong); text-decoration: none; border-bottom: 1px dotted var(--accent-strong); }

.label-panel {
  position: relative;
  z-index: 1;
  background: var(--ground-raised);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 1.6rem 1.6rem 1.2rem;
  box-shadow: var(--shadow);
}
.label-panel + .label-panel {
  margin-top: 1.1rem;
}

.label-panel h2 {
  font-family: "Iowan Old Style", Palatino, serif;
  font-size: 1.3rem;
  margin: 0 0 0.3rem;
}
.label-panel .caption { display: block; margin-bottom: 1.1rem; }

ul.ingredients {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
ul.ingredients li {
  border-radius: 12px;
  border: 1px solid var(--line);
}
ul.ingredients li a {
  color: var(--ink);
  text-decoration: none;
  font-size: 0.92rem;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  padding: 0.65rem 0.75rem;
}
ul.ingredients li .g-icon {
  width: 20px;
  height: 20px;
  flex: none;
  color: var(--accent-strong);
}
ul.ingredients li .g-label { font-weight: 600; }
ul.ingredients li .g-sub { color: var(--ink-soft); font-size: 0.78rem; margin-left: auto; }

.blurb {
  margin-top: 1.5rem;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--ink-soft);
}
.blurb + .blurb {
  margin-top: 0.75rem;
}

/* invitation line under the shelf — more weight than the footer link,
   less than a tile, since it's the first thing a new visitor needs */
.invitation {
  position: relative;
  z-index: 1;
  text-align: center;
  margin: 1.75rem 0 0;
  font-size: 0.9rem;
  color: var(--ink-soft);
}
.invitation a {
  color: var(--accent-strong);
  text-decoration: none;
  border-bottom: 1px dotted var(--accent-strong);
}

/* packaging — each service sits wrapped; the summary is the printed
   wrapper (tile colours, matching the shelf), the body is the plain
   paper inside, kept on --ground-raised so long copy stays readable */
.parcel {
  position: relative;
  z-index: 1;
  border-radius: 20px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.5);
  overflow: hidden;
}
.parcel + .parcel {
  margin-top: 1.1rem;
}

/* wider gap where prose meets the shelf than between shelf items, so the
   two read as separate groups rather than one undifferentiated stack */
.label-panel + .parcel,
.parcel + .label-panel {
  margin-top: 2rem;
}

.parcel > summary {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1.1rem 1.2rem;
  cursor: pointer;
  list-style: none;
}
/* summary's default triangle: `list-style: none` above covers modern
   engines, this covers older Safari. Deliberately its own rule — sharing
   a selector list with ::marker would drop both wherever either pseudo
   is unrecognised, since one bad selector invalidates the whole list. */
.parcel > summary::-webkit-details-marker {
  display: none;
}
.parcel > summary:focus-visible {
  outline: 3px solid var(--accent-strong);
  outline-offset: -3px;
}

.parcel.blush > summary { background: linear-gradient(165deg, var(--blush), color-mix(in srgb, var(--blush) 70%, white)); color: var(--blush-ink); }
.parcel.mint  > summary { background: linear-gradient(165deg, var(--mint), color-mix(in srgb, var(--mint) 70%, white)); color: var(--mint-ink); }
.parcel.sky   > summary { background: linear-gradient(165deg, var(--sky), color-mix(in srgb, var(--sky) 70%, white)); color: var(--sky-ink); }
.parcel.grape > summary { background: linear-gradient(165deg, var(--grape), color-mix(in srgb, var(--grape) 70%, white)); color: var(--grape-ink); }
.parcel.lilac > summary { background: linear-gradient(165deg, var(--lilac), color-mix(in srgb, var(--lilac) 70%, white)); color: var(--lilac-ink); }

.parcel .icon { width: 30px; height: 30px; flex: none; }
.parcel .wrap-text { flex: 1; min-width: 0; }
.parcel .name { font-family: "Iowan Old Style", Palatino, serif; font-size: 1.15rem; display: block; }
.parcel .sub { font-size: 0.8rem; opacity: 0.85; display: block; }

.parcel .unwrap {
  flex: none;
  width: 18px;
  height: 18px;
  transition: transform 0.2s ease;
}
.parcel[open] .unwrap { transform: rotate(180deg); }
@media (prefers-reduced-motion: reduce) {
  .parcel .unwrap { transition: none; }
}

.parcel-body {
  background: var(--ground-raised);
  color: var(--ink);
  padding: 1.4rem 1.3rem 1.2rem;
}
.parcel-body section + section { margin-top: 1.5rem; }
.parcel-body h3 {
  font-family: "Iowan Old Style", Palatino, serif;
  font-size: 1.05rem;
  margin: 0 0 0.1rem;
}
.parcel-body .caption { display: block; }
.parcel-body .blurb { margin-top: 0.7rem; }

ul.steps {
  list-style: none;
  margin: 0.9rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  font-size: 0.9rem;
  line-height: 1.5;
}
ul.steps li {
  display: flex;
  gap: 0.7rem;
  align-items: baseline;
}
ul.steps .where {
  flex: none;
  width: 7.5rem;
  color: var(--ink-soft);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
@media (max-width: 480px) {
  ul.steps li { flex-direction: column; gap: 0.15rem; }
  ul.steps .where { width: auto; }
}

.address {
  font-family: ui-monospace, "SF Mono", "Cascadia Code", Consolas, monospace;
  font-size: 0.85em;
  overflow-wrap: anywhere;
}

/* light/dark toggle */
.theme-toggle {
  position: fixed;
  right: 1.1rem;
  bottom: 1.1rem;
  z-index: 10;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 50%;
  cursor: pointer;
  color: var(--accent-strong);
  background: var(--ground-raised);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  transition: transform 0.18s ease;
}
.theme-toggle:hover { transform: translateY(-2px); }
.theme-toggle:focus-visible { outline: 3px solid var(--accent-strong); outline-offset: 3px; }
.theme-toggle svg { width: 22px; height: 22px; }
@media (prefers-reduced-motion: reduce) {
  .theme-toggle { transition: none; }
}

/* the button shows the theme you'd switch TO; rules mirror the variable
   cascade above so the right icon is correct even before theme.js runs */
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
}
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
:root[data-theme="light"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: block; }
