:root {
  --bg: #fdf9f0;
  --surface: #f5edda;
  --surface-raised: #ecdfc2;
  --ink: #1c1410;
  --ink-muted: #7a6b52;
  --gold: #dc931a;
  --gold-ink: #241704;
  --red: #c1001f;
  --red-ink: #fdf8ee;
  --border: #e3d3ac;
  --font-display: 'Baloo 2', sans-serif;
  --font-body: 'Work Sans', sans-serif;
}

* { box-sizing: border-box; }

html { background: var(--bg); }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  max-width: 880px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 3rem;
}

@media (min-width: 701px) {
  body { padding-left: 7.5rem; }
}
@media (max-width: 700px) {
  body { padding-bottom: 6.5rem; }
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.2;
  margin: 0 0 0.5rem;
}
h1 { font-size: 2.1rem; }
h2 { font-size: 1.5rem; margin-top: 2.5rem; }
h3 { font-size: 1.2rem; }
h4 { font-size: 1.05rem; }


p { color: var(--ink-muted); max-width: 60ch; }

a { color: var(--gold); font-weight: 600; }

.series-index {
  font-family: var(--font-body);
  font-weight: 600;
  color: var(--gold);
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  margin: 0 0 0.25rem;
}

/* Dock navigation: quiet by default. Hover only lifts an item; gold is
   reserved for the page you're on, so the two never look alike. */
#nav { position: fixed; z-index: 50; }
@media (min-width: 701px) {
  #nav { left: 18px; top: 50%; transform: translateY(-50%); }
}
@media (max-width: 700px) {
  #nav { left: 50%; bottom: 14px; transform: translateX(-50%); }
}

.dock {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px;
  background: rgba(255, 253, 248, 0.82);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  border: 1px solid rgba(28, 20, 16, 0.08);
  border-radius: 20px;
  box-shadow: 0 1px 2px rgba(28, 20, 16, 0.06), 0 12px 32px rgba(28, 20, 16, 0.12);
}
@media (max-width: 700px) {
  .dock { flex-direction: row; }
}

.dock .dock-item {
  width: 42px;
  height: 42px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 12px;
  background: transparent;
  color: var(--ink-muted);
  text-decoration: none;
  position: relative;
  transition: transform 140ms ease-out, background 140ms ease-out, color 140ms ease-out;
}
.dock .dock-item svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.dock .dock-item:hover,
.dock .dock-item:focus-visible {
  background: rgba(28, 20, 16, 0.06);
  color: var(--ink);
  transform: scale(1.08);
  filter: none;
}
.dock .dock-item.is-active {
  background: var(--gold);
  color: var(--gold-ink);
}
.dock .dock-item.is-active:hover { background: var(--gold); }

.dock-divider {
  width: 22px;
  height: 1px;
  margin: 4px 0;
  background: rgba(28, 20, 16, 0.12);
}
@media (max-width: 700px) {
  .dock-divider { width: 1px; height: 22px; margin: 0 4px; }
}

/* Tooltips */
.dock .dock-item[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  left: calc(100% + 14px);
  top: 50%;
  transform: translate(-4px, -50%);
  background: var(--ink);
  color: var(--bg);
  padding: 4px 9px;
  border-radius: 6px;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease, transform 120ms ease;
}
.dock .dock-item:hover[data-tip]::after,
.dock .dock-item:focus-visible[data-tip]::after {
  opacity: 1;
  transform: translate(0, -50%);
}
@media (max-width: 700px) {
  .dock .dock-item[data-tip]::after { display: none; }
}

/* Account: avatar + small menu */
.dock-account { position: relative; }
.dock .dock-avatar {
  border-radius: 50%;
  width: 36px;
  height: 36px;
  margin: 3px;
  background: var(--ink);
  color: var(--bg);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
}
.dock .dock-avatar:hover,
.dock .dock-avatar[aria-expanded="true"] {
  background: var(--ink);
  color: var(--bg);
  box-shadow: 0 0 0 3px rgba(220, 147, 26, 0.45);
}
.account-menu {
  position: absolute;
  left: calc(100% + 16px);
  bottom: -8px;
  min-width: 210px;
  padding: 0.85rem;
  background: #fffdf8;
  border: 1px solid rgba(28, 20, 16, 0.08);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(28, 20, 16, 0.16);
}
.account-menu[hidden] { display: none; }
.account-menu p { margin: 0; max-width: none; }
.account-name { font-weight: 600; color: var(--ink); font-size: 0.92rem; }
.account-email { font-size: 0.8rem; margin-bottom: 0.75rem !important; overflow: hidden; text-overflow: ellipsis; }
.account-link {
  display: block;
  margin-bottom: 0.5rem;
  padding: 0.4rem 0;
  font-size: 0.85rem;
  color: var(--ink);
  text-decoration: none;
}
.account-link:hover { color: var(--gold-ink, var(--ink)); text-decoration: underline; }
.account-menu .account-logout {
  width: 100%;
  height: auto;
  padding: 0.45rem 0.8rem;
  font-size: 0.85rem;
}
@media (max-width: 700px) {
  .account-menu { left: auto; right: -8px; bottom: calc(100% + 18px); }
}
@media (prefers-reduced-motion: reduce) {
  .dock .dock-item, .dock .dock-item[data-tip]::after { transition: none; }
}

/* Catalog grid */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 1.1rem;
  margin-top: 1.5rem;
}
.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}
@media (max-width: 700px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
.card {
  display: block;
  color: inherit;
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.1rem;
  transition: border-color 150ms, transform 150ms;
}
.card:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
}
.card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 0.75rem;
  background: var(--surface-raised);
}
.card .spec-no {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--gold);
  margin-bottom: 0.3rem;
}
.card h3, .card h4 { margin: 0; }
.card p { margin: 0.35rem 0 0; font-size: 0.92rem; }

/* Candle detail photo */
.candle-photo { position: relative; max-width: 320px; margin: 1rem 0; }
.candle-photo img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
}

/* Collection grid tiles: hover crossfade from neutral placeholder to the
   candle's own vasetto photo; owned tiles just show the filled photo. */
.tile-photo-stack {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface-raised);
  margin-bottom: 0.75rem;
}
.tile-photo-stack .tile-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.tile-photo-reveal {
  opacity: 0;
  transition: opacity 220ms ease;
}
.tile:hover .tile-photo-reveal,
.tile:focus-visible .tile-photo-reveal,
.tile.is-active .tile-photo-reveal {
  opacity: 1;
}
.tile-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ink-muted);
  background: var(--surface-raised);
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
  margin-top: 0.4rem;
}
.tile-badge.is-owned {
  color: var(--gold-ink);
  background: var(--gold);
}

/* Scent smoke (see scentFx in app.js). The SVG's bottom-centre sits on the
   wick of the filled-jar photo: all filled-jar shots share one framing
   (862x744, wick at 37.4% / 25.3%), which inside a square object-fit:contain
   box lands at 37.4% / 28.7%. Strands rise as long dashes travelling up each
   path, fading in at the wick and out as they climb. */
.scent-fx {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: visible;
  color: var(--scent-color);
}
.smoke {
  position: absolute;
  left: 37.4%;
  bottom: 71.3%;
  width: 26%;
  height: auto;
  aspect-ratio: 1 / 2;
  transform: translateX(-50%);
  overflow: visible;
  -webkit-mask-image: linear-gradient(to top, transparent 0%, #000 12%, #000 38%, transparent 90%);
  mask-image: linear-gradient(to top, transparent 0%, #000 12%, #000 38%, transparent 90%);
}
.strand {
  stroke-dasharray: 90 200;
  stroke-dashoffset: 90;
  opacity: 0.6;
  animation: strand-rise 6.5s linear infinite;
}
.strand.s1 { opacity: 0.5; animation-duration: 7.8s; animation-delay: -2.6s; }
.strand.s2 { opacity: 0.45; animation-duration: 9s; animation-delay: -5.1s; }
.strand--haze {
  stroke-dasharray: 140 200;
  opacity: 0.12;
  animation-duration: 11s;
  animation-delay: -4s;
}
/* The modal photo is bigger and sits close to the top of a scrolling box,
   so a proportionally shorter column keeps the smoke inside it. */
.modal-photo .smoke { width: 16%; }

@keyframes strand-rise {
  from { stroke-dashoffset: 90; }
  to   { stroke-dashoffset: -200; }
}
@media (prefers-reduced-motion: reduce) {
  .tile-photo-reveal { transition: none; }
  .strand { animation: none; stroke-dasharray: none; }
}

/* Homepage catalog: numbered archive specimens, floating on the page with
   no card chrome. Photos are cut out (transparent PNG) so nothing may draw
   a background behind or under them — not the stack, not the <img> itself
   (the shared ".card img" rule above does, which is why it's overridden
   again here down to the image level). */
#catalog .card {
  background: none;
  border: none;
  padding: 0;
  text-align: left;
}
#catalog .card:hover {
  border-color: transparent;
  transform: none;
}
#catalog .grid-3 {
  gap: 3rem 1.75rem;
}
#catalog .tile-photo-stack {
  background: none;
  overflow: visible;
  margin-bottom: 0.9rem;
}
/* Hover: the jar floats up a little and its shadow grows in from beneath.
   The shadow is its own element (not a filter on the photo) so it is never
   clipped and stays on the "floor" while the jar rises. */
#catalog .tile-photo-stack .tile-photo,
#catalog .tile-photo-stack .scent-fx,
#catalog .tile-photo-stack .jar-glow,
#catalog .tile-photo-stack .jar-shine {
  transition: translate 480ms cubic-bezier(0.2, 0.8, 0.2, 1), opacity 360ms ease;
}
#catalog .tile-photo-stack .tile-photo {
  object-fit: contain;
  background: none;
}
#catalog .tile:hover .tile-photo-stack > :not(.tile-shadow),
#catalog .tile:focus-visible .tile-photo-stack > :not(.tile-shadow),
#catalog .tile.is-active .tile-photo-stack > :not(.tile-shadow) {
  translate: 0 -10px;
}
.tile-shadow {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  overflow: visible;
  fill: rgb(28, 20, 16);
  filter: blur(6px);
  opacity: 0.32;
  translate: 0 2%;
  transform-origin: 50% 78%;
  transition: opacity 480ms ease, transform 480ms cubic-bezier(0.2, 0.8, 0.2, 1);
  pointer-events: none;
}
/* The popup photo is bigger: same footprint, a little more blur. */
.modal-photo .tile-shadow { filter: blur(9px); }
/* As the jar lifts its shadow spreads a little and deepens beneath it. */
#catalog .tile:hover .tile-shadow,
#catalog .tile:focus-visible .tile-shadow,
#catalog .tile.is-active .tile-shadow {
  opacity: 0.5;
  transform: scale(1.06);
}
/* Empty jars read a touch smaller than the filled ones (owned tiles keep
   full size: the smoke origin is calibrated to that framing). */
#catalog .tile-photo-base,
#catalog .tile-photo-reveal {
  transform: scale(0.9);
}
#catalog .tile-photo-reveal { opacity: 0; }
#catalog .tile:hover .tile-photo-reveal,
#catalog .tile:focus-visible .tile-photo-reveal,
#catalog .tile.is-active .tile-photo-reveal {
  opacity: 1;
}
#catalog .spec-no {
  font-size: 0.85rem;
  letter-spacing: 0.03em;
  margin-bottom: 0.15rem;
}
#catalog h4 {
  font-size: 1.15rem;
}
@media (prefers-reduced-motion: reduce) {
  #catalog .tile-photo-stack > * { transition: none; }
}

/* Intro loader: a small logo in the middle of the plain cream page. The
   logo stays whole and dark; behind it coloured "wax" rises quickly to about
   3/4 of its height, changing hue on the way up, and shows through the
   letters and the clear parts of the mark (logo.png is transparent there).
   The wax stays inside the logo's box and below its flame (the jar's body
   starts ~23% from the top), so no colour shows around the mark. Then the
   overlay fades out and the homepage rises in underneath. */
.intro-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  transition: opacity 600ms ease 150ms;
}
.intro-mark {
  position: relative;
  width: min(28vw, 120px);
  line-height: 0;
}
.intro-mark img { position: relative; display: block; width: 100%; height: auto; }
.intro-wax {
  position: absolute;
  left: 1%;
  right: 1%;
  bottom: 1%;
  height: 0;
  background: #7b4fd6;
  animation: intro-wax-rise 1.5s cubic-bezier(0.3, 0.1, 0.25, 1) 200ms forwards;
}
@keyframes intro-wax-rise {
  0% { height: 0; background: #7b4fd6; }
  20% { background: #a63fd0; }
  40% { background: #d23bb4; }
  60% { background: #f0478f; }
  80% { background: #fb6f5e; }
  100% { height: 74%; background: #f7871f; }
}
.intro-overlay.is-leaving { opacity: 0; pointer-events: none; }

/* Homepage content held back while the intro plays, then risen in. */
body.intro-playing { overflow: hidden; }
body.intro-playing .home-hero,
body.intro-playing #catalog,
body.intro-playing #nav { opacity: 0; }
body.intro-done .home-hero,
body.intro-done #catalog { animation: page-rise 900ms cubic-bezier(0.2, 0.8, 0.2, 1) both; }
body.intro-done .home-hero { animation-delay: 380ms; }
body.intro-done #catalog { animation-delay: 520ms; }
body.intro-done #nav { animation: page-fade 700ms ease 700ms both; }
@keyframes page-rise {
  from { opacity: 0; translate: 0 18px; }
  to { opacity: 1; translate: 0 0; }
}
@keyframes page-fade { from { opacity: 0; } to { opacity: 1; } }

/* Candle modal — opens in place of navigating to candle.html. Kept in the
   DOM at all times (not [hidden]) so opacity/transform can transition on
   the way in and out; .is-open is what actually shows it. */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(28, 20, 16, 0);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 260ms ease, background-color 260ms ease, visibility 0s linear 260ms;
}
.modal-overlay.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  background: rgba(28, 20, 16, 0.55);
  transition: opacity 260ms ease, background-color 260ms ease, visibility 0s linear 0s;
}
.modal-box {
  position: relative;
  background: #fdf9f0;
  border-radius: 18px;
  width: 100%;
  max-width: 780px;
  max-height: 85vh;
  overflow: auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  padding: 2rem;
  box-shadow: 0 24px 60px rgba(28, 20, 16, 0.32);
  transform: translateY(28px) scale(0.96);
  transition: transform 340ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.modal-overlay.is-open .modal-box {
  transform: translateY(0) scale(1);
}
@media (prefers-reduced-motion: reduce) {
  .modal-overlay, .modal-box { transition: none; }
}
@media (max-width: 700px) {
  .modal-box { grid-template-columns: 1fr; max-height: 90vh; padding: 1.5rem; }
}
.modal-photo {
  position: relative;
}
.modal-photo img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  background: none;
}
.modal-info {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}
.modal-info h2 { margin-top: 0.15rem; }
#modal-collection-actions {
  margin-top: auto;
  padding-top: 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.6rem;
}
#modal-collection-actions button {
  padding: 0.55rem 1.3rem;
  font-size: 0.88rem;
  border-radius: 999px;
}
#modal-collection-actions p {
  margin: 0;
  text-align: right;
}
/* What a candle needs before it can be requested, shown on its button. */
#modal-collection-actions .lock-reason {
  max-width: 100%;
  padding: 0.6rem 0.8rem;
  border: 1px dashed var(--border);
  border-radius: 10px;
  background: #f6f3ec;
  font-size: 0.9rem;
  line-height: 1.4;
  text-align: left;
  overflow-wrap: anywhere;
}
#modal-collection-actions .lock-reason[hidden],
#modal-collection-actions button[hidden] { display: none; }
.modal-close {
  position: absolute;
  z-index: 5;
  top: 1rem;
  right: 1rem;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 50%;
  background: var(--surface-raised);
  color: var(--ink);
  border: none;
  cursor: pointer;
}
.modal-close svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
}
.modal-close:hover { background: var(--gold); color: var(--gold-ink); }

/* Homepage candle modal = a two-sided card. The entrance moves from the box
   to .modal-flip, which also holds the perspective; the faces stack in one
   grid cell and the back (the box label) is laid over the front's height
   and scrolls on its own if the label is longer. */
.modal-flip {
  position: relative;
  width: 100%;
  max-width: 780px;
  perspective: 2000px;
  transform: translateY(28px) scale(0.96);
  transition: transform 340ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.modal-overlay.is-open .modal-flip { transform: translateY(0) scale(1); }
.modal-card {
  position: relative;
  display: grid;
  transform-style: preserve-3d;
  transition: transform 780ms cubic-bezier(0.45, 0.05, 0.2, 1);
}
.modal-card.is-flipped { transform: rotateY(180deg); }
.modal-card.no-anim { transition: none; }
.modal-card.is-settled { transform: none; transition: none; }
.modal-card.is-settled .modal-back { transform: none; }
.modal-card.is-settled .modal-front { visibility: hidden; }
/* The front can be stretched to the label's height: keep the jar and its
   shadow together, centred. */
.modal-front .modal-photo { align-self: center; }
.modal-box.modal-front, .modal-overlay.is-open .modal-box.modal-front { transform: none; transition: none; }
.modal-front, .modal-back {
  grid-area: 1 / 1;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}
.modal-back {
  max-height: 85vh;
  transform: rotateY(180deg);
  background: #f3ead6;
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(28, 20, 16, 0.32);
  overflow: auto;
  padding: 2rem 1.75rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.1rem;
}
.modal-back .modal-close { background: #fff; }
@media (prefers-reduced-motion: reduce) {
  .modal-flip, .modal-card { transition: none; }
}
@media (max-width: 700px) {
  .modal-back { padding: 1.5rem 1rem 1.25rem; max-height: 90vh; }
}
@media (min-width: 701px) {
  .modal-back { padding: 1.5rem 1.75rem 1.25rem; gap: 0.9rem; }
  .label-sheet { margin-top: 2.75rem; }
}

/* The label itself: a paper sticker, like the one on the box. */
.label-sheet {
  width: 100%;
  max-width: 560px;
  margin-top: 0.75rem;
  background:
    radial-gradient(circle at 20% 10%, rgba(255, 255, 255, 0.9), transparent 60%),
    #fffdf8;
  color: #1a1a1a;
  border-radius: 6px;
  padding: 1.2rem 1.35rem 1.1rem;
  box-shadow: 0 1px 0 rgba(28, 20, 16, 0.06), 0 10px 26px rgba(28, 20, 16, 0.16);
  outline: 1px solid rgba(28, 20, 16, 0.08);
  outline-offset: -7px;
  font-size: 0.8rem;
  line-height: 1.5;
}
.label-head {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding-bottom: 0.65rem;
  margin-bottom: 0.7rem;
  border-bottom: 1px dashed rgba(28, 20, 16, 0.25);
}
.label-head img { width: 30px; height: auto; }
.label-head div { display: flex; flex-direction: column; line-height: 1.2; }
.label-head strong { font: 700 1.05rem/1.2 var(--font-display); }
.label-sheet h3 {
  margin: 0 0 0.45rem;
  font: 600 0.78rem/1.3 var(--font-body);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.label-text p { margin: 0 0 0.6rem; color: inherit; }
@media (min-width: 701px) {
  .label-sheet { max-width: none; }
  .label-text { display: grid; grid-template-columns: 1fr 1fr; column-gap: 1.6rem; }
}
.label-text b { font-weight: 600; }
.label-icons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-top: 0.6rem;
  border-top: 1px dashed rgba(28, 20, 16, 0.25);
}
.label-icon { width: 38px; height: 38px; }
.label-icon svg { width: 100%; height: 100%; display: block; }

.label-turn {
  align-self: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}
.label-turn svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.modal-back .label-turn {
  padding: 0.55rem 1.3rem;
  font-size: 0.88rem;
  border-radius: 999px;
  flex-shrink: 0;
}

/* Forms */
form {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  max-width: 380px;
  margin-top: 1.5rem;
}
label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.9rem;
  color: var(--ink-muted);
}
input, textarea, select {
  font-family: var(--font-body);
  font-size: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--ink);
  border-radius: 8px;
  padding: 0.55rem 0.7rem;
}
input:focus, textarea:focus, select:focus, button:focus-visible, .dock-item:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}
textarea { min-height: 4.5rem; resize: vertical; }

button {
  font-family: var(--font-body);
  font-size: 0.86rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  cursor: pointer;
  background: var(--gold);
  color: var(--gold-ink);
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 0.45rem 0.85rem;
  align-self: flex-start;
  transition: filter 120ms, border-color 120ms, color 120ms, background 120ms;
}
button:hover { filter: brightness(1.05); }

/* Secondary / ghost — for actions that shouldn't shout as loud as the
   primary gold button: table row actions, cancel, reject, remove. */
.btn-ghost {
  background: transparent;
  color: var(--ink-muted);
  border-color: var(--border);
  font-weight: 500;
}
.btn-ghost:hover {
  border-color: var(--gold);
  color: var(--ink);
  filter: none;
}
.btn-danger.btn-ghost:hover {
  border-color: var(--red);
  color: var(--red);
}

.error { color: var(--red); font-size: 0.9rem; }

.shipping-fields {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  margin: 0.4rem 0 0;
  padding: 0;
  border: 0;
  min-width: 0;
}
.shipping-fields legend {
  padding: 0;
  margin-bottom: 0.2rem;
  font-weight: 600;
  color: var(--ink);
}
.shipping-fields .optional { font-weight: 400; font-size: 0.8rem; color: var(--ink-muted); }
.shipping-fields .hint { margin: 0; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.field-row > label { min-width: 0; }
.field-row input { min-width: 0; width: 100%; box-sizing: border-box; }

.hint {
  font-size: 0.9rem;
  color: var(--ink-muted);
  margin-top: 0.75rem;
}

section { margin-top: 2.5rem; }
section:first-of-type { margin-top: 1.5rem; }

/* ---------- Homepage ---------- */
body.home-page { max-width: 1080px; }

.home-hero {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0.5rem 0 2rem;
  border-bottom: 1px solid rgba(28, 20, 16, 0.08);
}
.home-logo { margin: 0; line-height: 0; flex-shrink: 0; }
.home-logo img { width: 88px; height: auto; }
.home-intro p { margin: 0; }
.home-tagline {
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 500;
  line-height: 1.25;
  color: var(--ink);
  max-width: 22ch;
}
.home-status { margin-top: 0.4rem !important; font-size: 0.92rem; }
.home-status strong { color: var(--ink); font-weight: 600; }
.home-status a { font-weight: 500; }
.unlock-notice {
  margin: 0.8rem 0 0;
  padding: 0.6rem 0.85rem;
  border-left: 3px solid var(--gold);
  background: rgba(220, 147, 26, 0.08);
  border-radius: 0 8px 8px 0;
  font-size: 0.9rem;
  max-width: 34rem;
}
.unlock-card {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  max-width: 380px;
  margin: 1rem 0 0;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: linear-gradient(135deg, #fff6e2, var(--surface));
}
.unlock-card[hidden] { display: none; }
.unlock-card strong { display: block; font-family: var(--font-display); font-size: 1.1rem; line-height: 1.2; }
.unlock-card p { margin: 0.3rem 0 0; font-size: 0.9rem; color: var(--ink-muted); }
.unlock-card a { font-weight: 600; }
.unlock-card-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  margin-top: 0.1rem;
  fill: var(--gold);
  filter: drop-shadow(0 0 6px rgba(220, 147, 26, 0.45));
}

.archive-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  margin: 2.5rem 0 1.75rem;
}
/* All / Special editions: two pills, the chosen one filled in ink. */
.archive-filter { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: #fffaf0;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 0.98rem;
  font-weight: 600;
  line-height: 1.1;
  box-shadow: 3px 3px 0 var(--ink);
  transition: transform 120ms, box-shadow 120ms, background 120ms, color 120ms;
}
.filter-btn:hover { filter: none; transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.filter-btn.is-active { background: var(--ink); color: #fff8ec; transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.filter-count {
  min-width: 1.5em;
  padding: 0.05rem 0.4rem;
  border-radius: 999px;
  background: rgba(28, 20, 16, 0.08);
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  text-align: center;
}
.filter-btn.is-active .filter-count { background: var(--gold); color: var(--gold-ink); }
.filter-spark { width: 15px; height: 15px; fill: var(--gold); }
.archive-side { display: flex; align-items: center; gap: 1rem; }
.archive-empty { grid-column: 1 / -1; margin: 1rem 0 2rem; text-align: center; max-width: none; }
.archive-total { font-size: 0.85rem; color: var(--ink-muted); }
.archive-progress {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
}
.archive-bar-fill {
  position: relative;
  width: 96px;
  height: 4px;
  border-radius: 999px;
  background: rgba(28, 20, 16, 0.1);
  overflow: hidden;
}
.archive-bar-fill > span {
  position: absolute;
  inset: 0 auto 0 0;
  background: var(--gold);
  border-radius: inherit;
}

/* ---------- Order tracker: a requested candle's steps, top of the homepage ---------- */
.order-tracker {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  width: 100%;
  margin: 1.75rem 0 0;
  padding: 1.15rem 1.35rem 1.2rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: linear-gradient(135deg, #fff6e2, var(--surface));
  box-shadow: 0 6px 24px rgba(120, 80, 20, 0.08);
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.order-tracker + .order-tracker { margin-top: 0.85rem; }
.order-tracker:hover { box-shadow: 0 8px 28px rgba(120, 80, 20, 0.14); }
.ot-head { display: flex; flex-direction: column; gap: 0.1rem; }
.ot-kicker { font-size: 0.78rem; font-weight: 600; color: var(--gold); letter-spacing: 0.02em; }
.ot-title { font-family: var(--font-display); font-size: 1.45rem; font-weight: 600; line-height: 1.15; }

.ot-track {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
}
/* The rail runs from the first dot's centre to the last one's. */
.ot-rail {
  position: absolute;
  top: 13px;
  left: 10%;
  right: 10%;
  height: 4px;
  border-radius: 999px;
  background: rgba(28, 20, 16, 0.1);
  overflow: hidden;
}
.ot-fill {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #f0b44a, var(--gold));
  transform-origin: left;
  transform: scaleX(0);
  transition: transform 1100ms cubic-bezier(0.25, 0.8, 0.25, 1) 150ms;
}
.order-tracker.is-filled .ot-fill { transform: scaleX(var(--fill)); }
.ot-step {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  text-align: center;
}
.ot-dot {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid rgba(28, 20, 16, 0.14);
  transition: background 300ms ease, border-color 300ms ease;
  transition-delay: calc(150ms + var(--i) * 220ms);
}
.ot-label { font-size: 0.78rem; font-weight: 500; color: var(--ink-muted); }
.order-tracker.is-filled .ot-step.is-done .ot-dot { background: var(--gold); border-color: var(--gold); }
.ot-step.is-done .ot-label,
.ot-step.is-current .ot-label { color: var(--ink); }
.ot-step.is-current .ot-label { font-weight: 600; }
.ot-step.is-current .ot-dot {
  width: 36px;
  height: 36px;
  margin-top: -3px;
  margin-bottom: -3px;
  background: var(--ink);
  border-color: var(--ink);
}
.ot-dot svg {
  width: 20px;
  height: 20px;
  fill: var(--gold);
  filter: drop-shadow(0 0 6px rgba(240, 160, 40, 0.9));
  transform-origin: 50% 90%;
  animation: ot-flicker 2.4s ease-in-out infinite;
}
@keyframes ot-flicker {
  0%, 100% { transform: scale(1) rotate(0deg); }
  30% { transform: scale(1.06, 0.95) rotate(-2deg); }
  60% { transform: scale(0.96, 1.05) rotate(2deg); }
}
.ot-line { font-size: 0.92rem; color: var(--ink-muted); }
.ot-tracking {
  display: inline-block;
  margin-left: 0.3rem;
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
  background: rgba(28, 20, 16, 0.07);
  color: var(--ink);
  font-weight: 600;
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
}
.order-tracker.is-delivered .ot-step.is-current .ot-dot { background: var(--gold); border-color: var(--gold); }
.order-tracker.is-delivered .ot-dot svg { fill: #fff6e2; }

@media (max-width: 700px) {
  .order-tracker { margin-top: 1.25rem; padding: 1rem 0.9rem 1.05rem; }
  .ot-title { font-size: 1.2rem; }
  .ot-label { font-size: 0.66rem; }
}
@media (prefers-reduced-motion: reduce) {
  .ot-fill, .ot-dot { transition: none; }
  .ot-dot svg { animation: none; }
}

/* Modal essences */
.modal-essences { margin-top: 0.75rem; }
.meta-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ink-muted);
  margin-bottom: 0.35rem;
}
.essence-tags { display: flex; flex-wrap: wrap; gap: 0.35rem; }
/* Notes of the fragrance, one row per group: label on the left, tags beside. */
.note-group { display: flex; align-items: baseline; gap: 0.6rem; }
.note-group + .note-group { margin-top: 0.4rem; }
.note-group-label {
  flex: 0 0 5.6rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink-muted);
}
.essence-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  background: rgba(28, 20, 16, 0.06);
  color: var(--ink);
}
.essence-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(28, 20, 16, 0.15);
}

@media (max-width: 700px) {
  .home-hero { gap: 1rem; padding-bottom: 1.5rem; }
  .home-logo img { width: 64px; }
  .home-tagline { font-size: 1.2rem; }
  #catalog .grid-3 { gap: 1.75rem 1rem; }
  #catalog h4 { font-size: 0.98rem; }
}

/* ---------- Candle details: cipher + first-time reveal (reveal.js) ---------- */
.candle-details { margin-top: 0.75rem; }
.candle-description { margin: 0.9rem 0 0; }

/* A cipher character: the real/stand-in character keeps the layout but is
   invisible; the glyph in data-g is drawn centred over its slot. */
.cc {
  position: relative;
  color: transparent;
}
.cc::after {
  content: attr(data-g);
  position: absolute;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  color: var(--ink-muted);
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 0.86em;
  line-height: inherit;
}
.is-locked .cc::after {
  opacity: 0.55;
  filter: blur(0.6px);
}
.is-locked .essence-tag { background: rgba(28, 20, 16, 0.045); }
.is-locked .essence-dot { background: rgba(28, 20, 16, 0.14); }

.lock-note {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 1rem 0 0;
  font-size: 0.82rem;
  color: var(--ink-muted);
}
.lock-note svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  stroke: var(--gold);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.essence-dot { background: var(--dot, rgba(28, 20, 16, 0.14)); }

/* While revealing: cipher glyphs glow gold, each character lands with a
   brief flash, each essence dot floods with the candle's colour. */
.is-revealing .cc::after {
  color: var(--gold);
  text-shadow: 0 0 6px rgba(220, 147, 26, 0.55);
}
.cc-set { animation: cc-land 700ms ease-out; }
@keyframes cc-land {
  0%   { color: var(--gold); text-shadow: 0 0 10px rgba(220, 147, 26, 0.9); }
  100% { color: inherit; text-shadow: none; }
}
.is-revealing .essence-tag {
  opacity: 0.35;
  transform: translateY(4px) scale(0.96);
  transition: opacity 320ms ease, transform 420ms cubic-bezier(0.2, 1.4, 0.4, 1);
}
.is-revealing .essence-tag .essence-dot {
  background: rgba(28, 20, 16, 0.14);
  transition: background 500ms ease 120ms;
}
.is-revealing .essence-tag.is-lit { opacity: 1; transform: none; }
.is-revealing .essence-tag.is-lit .essence-dot {
  background: var(--dot);
  animation: dot-pulse 900ms ease-out 120ms;
}
@keyframes dot-pulse {
  0%   { box-shadow: 0 0 0 0 var(--dot); }
  100% { box-shadow: 0 0 0 9px transparent; }
}

/* Newly owned jar (never opened): a warm glow breathes behind it and a band
   of light sweeps across it. The sweep is masked with the jar photo itself,
   so it only lights the glass and wax, never the empty space around. */
.tile-photo-stack, .modal-photo { isolation: isolate; }
.jar-glow {
  position: absolute;
  inset: 4%;
  z-index: -1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 220, 150, 0.95), rgba(220, 147, 26, 0.45) 42%, transparent 70%);
  pointer-events: none;
  animation: glow-breathe 2.6s ease-in-out infinite;
}
@keyframes glow-breathe {
  0%, 100% { opacity: 0.55; transform: scale(0.92); }
  50%      { opacity: 1;    transform: scale(1.08); }
}
.jar-shine {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(105deg, transparent 38%, rgba(255, 255, 255, 0.85) 48%, rgba(255, 236, 190, 0.9) 52%, transparent 62%) no-repeat;
  background-size: 300% 100%;
  -webkit-mask: var(--jar) center / contain no-repeat;
  mask: var(--jar) center / contain no-repeat;
  mix-blend-mode: soft-light;
  animation: jar-sweep 3.2s ease-in-out infinite;
}
@keyframes jar-sweep {
  0%   { background-position: 120% 0; }
  55%, 100% { background-position: -20% 0; }
}
.modal-photo.is-new img {
  animation: jar-lift 2.6s ease-in-out infinite;
}
#catalog .tile.is-new .tile-photo {
  filter: drop-shadow(0 0 14px rgba(255, 196, 90, 0.75));
}
@keyframes jar-lift {
  0%, 100% { filter: brightness(1) drop-shadow(0 0 0 rgba(255, 196, 90, 0)); }
  50%      { filter: brightness(1.12) drop-shadow(0 0 22px rgba(255, 196, 90, 0.8)); }
}
.tile-badge.is-new {
  color: var(--gold-ink);
  background: var(--gold);
  box-shadow: 0 0 0 0 rgba(220, 147, 26, 0.6);
  animation: badge-ping 2.6s ease-out infinite;
}
@keyframes badge-ping {
  0%   { box-shadow: 0 0 0 0 rgba(220, 147, 26, 0.6); }
  70%, 100% { box-shadow: 0 0 0 8px rgba(220, 147, 26, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .cc-set, .jar-glow, .jar-shine, .modal-photo.is-new img, .tile-badge.is-new { animation: none; }
  .jar-shine { display: none; }
}

/* ---------- Special editions (specialOf() in app.js) ---------- */
/* A label beside the number in the candle's special colour (--sp), with a
   slow light glint running across it. */
.special-label {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.05rem 0.5rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: 0.08em;
  --sp-deep: color-mix(in srgb, var(--sp, #d9441f) 82%, #000);
  color: var(--sp-ink, #fff8ec);
  background: linear-gradient(110deg, var(--sp-deep) 0%, var(--sp, #d9441f) 40%,
    color-mix(in srgb, var(--sp, #d9441f) 45%, #f6dc8a) 50%, var(--sp, #d9441f) 60%, var(--sp-deep) 100%);
  background-size: 250% 100%;
  animation: special-glint 4.5s ease-in-out infinite;
}
@keyframes special-glint {
  0%, 35% { background-position: 100% 0; }
  70%, 100% { background-position: 0 0; }
}
/* The special jar keeps a faint halo in its colour even at rest. */
#catalog .tile.is-special .tile-photo {
  filter: drop-shadow(0 0 10px color-mix(in srgb, var(--sp, #d9441f) 18%, transparent));
}

/* Snow: flakes fall over the jar while the tile is hovered, and always in
   the popup. Pale blue so they read on the cream background. */
.snow-fx {
  position: absolute;
  inset: -8% 0 12%;
  pointer-events: none;
  z-index: 2;
}
.snowflake {
  position: absolute;
  top: 0;
  aspect-ratio: 1;
  color: #9dbbd6;
  opacity: 0;
  filter: drop-shadow(0 0 2px rgba(255, 255, 255, 0.9));
}
.snowflake svg { display: block; width: 100%; height: 100%; overflow: visible; }
#catalog .tile:hover .snowflake,
#catalog .tile:focus-visible .snowflake,
#catalog .tile.is-active .snowflake,
.modal-photo .snowflake {
  animation: snow-fall var(--dur) linear var(--delay) infinite;
}
@keyframes snow-fall {
  0%   { opacity: 0; transform: translate(0, 0) rotate(0deg); }
  12%  { opacity: 0.95; }
  50%  { transform: translate(var(--drift), 45cqh) rotate(90deg); }
  80%  { opacity: 0.85; }
  100% { opacity: 0; transform: translate(0, 90cqh) rotate(180deg); }
}
.snow-fx { container-type: size; }

/* Other jar effects (effectFx in app.js), same rules as the snow: still and
   invisible until the tile is hovered, always moving in the popup, inside
   the jar's square and never in the way of a click. */
.jar-fx {
  position: absolute;
  inset: 0 0 12%;
  pointer-events: none;
  z-index: 2;
  container-type: size;
}
.jar-fx .fx-bit {
  position: absolute;
  aspect-ratio: 1;
  opacity: 0;
}
.jar-fx svg { display: block; width: 100%; height: 100%; overflow: visible; }

/* Fireworks: four bursts of sparks that open out, droop and fade in turn. */
.fw-burst { position: absolute; width: 0; height: 0; }
.fw-burst i {
  position: absolute;
  left: -0.6cqmin;
  top: -2cqmin;
  width: 1.2cqmin;
  height: 4cqmin;
  border-radius: 1cqmin;
  background: linear-gradient(to bottom, var(--c), transparent);
  filter: drop-shadow(0 0 2px var(--c));
  opacity: 0;
}
.fw-burst::before {
  content: '';
  position: absolute;
  left: -3cqmin;
  top: -3cqmin;
  width: 6cqmin;
  height: 6cqmin;
  border-radius: 50%;
  background: radial-gradient(circle, #fff 0, var(--c) 40%, transparent 70%);
  opacity: 0;
}
#catalog .tile:hover .fw-burst,
#catalog .tile:focus-visible .fw-burst,
#catalog .tile.is-active .fw-burst,
.modal-photo .fw-burst { animation: fw-droop 2.8s ease-in var(--delay) infinite; }
#catalog .tile:hover .fw-burst i,
#catalog .tile:focus-visible .fw-burst i,
#catalog .tile.is-active .fw-burst i,
.modal-photo .fw-burst i { animation: fw-spark 2.8s cubic-bezier(0.2, 0.7, 0.3, 1) var(--delay) infinite; }
#catalog .tile:hover .fw-burst::before,
#catalog .tile:focus-visible .fw-burst::before,
#catalog .tile.is-active .fw-burst::before,
.modal-photo .fw-burst::before { animation: fw-flash 2.8s ease-out var(--delay) infinite; }
@keyframes fw-spark {
  0%   { opacity: 0; transform: rotate(var(--a)) translateY(0) scaleY(0.4); }
  4%   { opacity: 1; }
  32%  { opacity: 1; transform: rotate(var(--a)) translateY(calc(-1 * var(--r))) scaleY(1); }
  55%  { opacity: 0; transform: rotate(var(--a)) translateY(calc(-1.15 * var(--r))) scaleY(0.5); }
  100% { opacity: 0; transform: rotate(var(--a)) translateY(calc(-1.15 * var(--r))) scaleY(0.5); }
}
@keyframes fw-droop {
  0%, 30% { transform: translateY(0); }
  55%, 100% { transform: translateY(4cqmin); }
}
@keyframes fw-flash {
  0%   { opacity: 0; transform: scale(0.3); }
  4%   { opacity: 1; transform: scale(1); }
  18%, 100% { opacity: 0; transform: scale(1.4); }
}

/* Gold sparkles: little four-point stars twinkling in place. */
.fx-sparkles .fx-bit { filter: drop-shadow(0 0 3px rgba(255, 214, 110, 0.9)); }
#catalog .tile:hover .fx-sparkles .fx-bit,
#catalog .tile:focus-visible .fx-sparkles .fx-bit,
#catalog .tile.is-active .fx-sparkles .fx-bit,
.modal-photo .fx-sparkles .fx-bit { animation: fx-twinkle var(--dur) ease-in-out var(--delay) infinite; }
@keyframes fx-twinkle {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(0) rotate(0deg); }
  45%  { opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(45deg); }
  70%  { opacity: 0; transform: translate(-50%, -50%) scale(0.2) rotate(90deg); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(0) rotate(90deg); }
}

/* Hearts: rise from the bottom of the jar, swaying, and fade out. */
.fx-hearts .fx-bit { top: auto; bottom: 0; filter: drop-shadow(0 1px 2px rgba(120, 20, 40, 0.25)); }
#catalog .tile:hover .fx-hearts .fx-bit,
#catalog .tile:focus-visible .fx-hearts .fx-bit,
#catalog .tile.is-active .fx-hearts .fx-bit,
.modal-photo .fx-hearts .fx-bit { animation: fx-rise var(--dur) ease-out var(--delay) infinite; }
@keyframes fx-rise {
  0%   { opacity: 0; transform: translate(0, 0) scale(0.6); }
  15%  { opacity: 0.95; }
  50%  { transform: translate(var(--drift), -40cqh) scale(1) rotate(-8deg); }
  75%  { opacity: 0.8; }
  100% { opacity: 0; transform: translate(calc(-0.5 * var(--drift)), -82cqh) scale(0.9) rotate(8deg); }
}

/* Petals: drift down, turning and fluttering. */
.fx-petals .fx-bit { top: 0; }
#catalog .tile:hover .fx-petals .fx-bit,
#catalog .tile:focus-visible .fx-petals .fx-bit,
#catalog .tile.is-active .fx-petals .fx-bit,
.modal-photo .fx-petals .fx-bit { animation: fx-petal-fall var(--dur) linear var(--delay) infinite; }
#catalog .tile:hover .fx-petals svg,
#catalog .tile:focus-visible .fx-petals svg,
#catalog .tile.is-active .fx-petals svg,
.modal-photo .fx-petals svg { animation: fx-flutter 1.3s ease-in-out infinite alternate; }
@keyframes fx-petal-fall {
  0%   { opacity: 0; transform: translate(0, 0) rotate(0deg); }
  12%  { opacity: 0.95; }
  35%  { transform: translate(var(--drift), 30cqh) rotate(110deg); }
  65%  { transform: translate(calc(-0.6 * var(--drift)), 60cqh) rotate(220deg); }
  85%  { opacity: 0.85; }
  100% { opacity: 0; transform: translate(0, 88cqh) rotate(320deg); }
}
@keyframes fx-flutter {
  from { transform: scaleX(1); }
  to   { transform: scaleX(0.35); }
}

/* Friends (5 s loop): two little candles pop up, hop towards each other
   (squash on landing, stretch in the air), look at each other, blush and
   take each other's hand, lean in until their flames touch — a warm glow,
   a heart and a few sparks — sway together and hop back. Moves live on
   .fx-pal, squash & stretch on .pal-body, the face inside the SVG. */
.fx-pal {
  position: absolute;
  bottom: 4%;
  width: 18%;
  aspect-ratio: 2 / 3;
  opacity: 0;
  transform-origin: 50% 100%;
}
.fx-pal.is-left { left: 14%; }
.fx-pal.is-right { right: 14%; }
.fx-pal .pal-body { position: absolute; inset: 0; transform-origin: 50% 100%; }
.fx-pal svg { filter: drop-shadow(0 1px 1.5px rgba(28, 20, 16, 0.25)); }
.fx-pal.is-right svg { transform: scaleX(-1); }
.fx-pal .pal-flame, .fx-pal .pal-flame-core { transform-box: fill-box; transform-origin: 50% 100%; }
.fx-pal .pal-eyes { transform-box: fill-box; transform-origin: 50% 50%; }
.fx-pal .pal-cheeks { opacity: 0; }
.fx-pal .pal-arm { transform-box: fill-box; transform-origin: 0 0; }
.fx-pal-glow {
  position: absolute;
  left: 50%;
  bottom: 30%;
  width: 26%;
  aspect-ratio: 1;
  margin: 0 0 -13% -13%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 214, 120, 0.85) 0%, rgba(255, 176, 46, 0.35) 38%, rgba(255, 176, 46, 0) 70%);
  opacity: 0;
  transform: scale(0.3);
}
.fx-pal-spark {
  position: absolute;
  left: 50%;
  bottom: 33%;
  width: 2.2cqmin;
  height: 2.2cqmin;
  margin: 0 0 -1.1cqmin -1.1cqmin;
  border-radius: 50%;
  background: var(--c);
  opacity: 0;
}
.fx-pal-heart {
  position: absolute;
  left: 50%;
  bottom: 36%;
  width: 10%;
  aspect-ratio: 1;
  margin-left: -5%;
  color: #e8456b;
  opacity: 0;
}
.fx-pal-heart svg { filter: drop-shadow(0 1px 0 #1c1410) drop-shadow(0 -0.5px 0 #1c1410); }
#catalog .tile:hover .fx-pal.is-left,
#catalog .tile:focus-visible .fx-pal.is-left,
#catalog .tile.is-active .fx-pal.is-left,
.modal-photo .fx-pal.is-left { animation: fx-pal-left 5s ease-in-out infinite; }
#catalog .tile:hover .fx-pal.is-right,
#catalog .tile:focus-visible .fx-pal.is-right,
#catalog .tile.is-active .fx-pal.is-right,
.modal-photo .fx-pal.is-right { animation: fx-pal-right 5s ease-in-out infinite; }
#catalog .tile:hover .fx-pal .pal-body,
#catalog .tile:focus-visible .fx-pal .pal-body,
#catalog .tile.is-active .fx-pal .pal-body,
.modal-photo .fx-pal .pal-body { animation: fx-pal-squash 5s linear infinite; }
#catalog .tile:hover .fx-pal .pal-flame,
#catalog .tile:focus-visible .fx-pal .pal-flame,
#catalog .tile.is-active .fx-pal .pal-flame,
.modal-photo .fx-pal .pal-flame { animation: fx-pal-flame 5s ease-in-out infinite; }
#catalog .tile:hover .fx-pal .pal-flame-core,
#catalog .tile:focus-visible .fx-pal .pal-flame-core,
#catalog .tile.is-active .fx-pal .pal-flame-core,
.modal-photo .fx-pal .pal-flame-core { animation: fx-pal-flicker 0.45s ease-in-out infinite alternate; }
#catalog .tile:hover .fx-pal .pal-eyes,
#catalog .tile:focus-visible .fx-pal .pal-eyes,
#catalog .tile.is-active .fx-pal .pal-eyes,
.modal-photo .fx-pal .pal-eyes { animation: fx-pal-eyes 5s ease-in-out infinite; }
#catalog .tile:hover .fx-pal .pal-cheeks,
#catalog .tile:focus-visible .fx-pal .pal-cheeks,
#catalog .tile.is-active .fx-pal .pal-cheeks,
.modal-photo .fx-pal .pal-cheeks { animation: fx-pal-cheeks 5s ease-in-out infinite; }
#catalog .tile:hover .fx-pal .pal-arm,
#catalog .tile:focus-visible .fx-pal .pal-arm,
#catalog .tile.is-active .fx-pal .pal-arm,
.modal-photo .fx-pal .pal-arm { animation: fx-pal-arm 5s ease-in-out infinite; }
#catalog .tile:hover .fx-pal-glow,
#catalog .tile:focus-visible .fx-pal-glow,
#catalog .tile.is-active .fx-pal-glow,
.modal-photo .fx-pal-glow { animation: fx-pal-glow 5s ease-out infinite; }
#catalog .tile:hover .fx-pal-spark,
#catalog .tile:focus-visible .fx-pal-spark,
#catalog .tile.is-active .fx-pal-spark,
.modal-photo .fx-pal-spark { animation: fx-pal-spark 5s ease-out infinite; }
#catalog .tile:hover .fx-pal-heart,
#catalog .tile:focus-visible .fx-pal-heart,
#catalog .tile.is-active .fx-pal-heart,
.modal-photo .fx-pal-heart { animation: fx-pal-heart 5s ease-out infinite; }
/* Left friend; the right one is the same with x and angles mirrored. */
@keyframes fx-pal-left {
  0%       { opacity: 0; transform: translate(0, 0) rotate(0deg); }
  4%       { opacity: 1; }
  10%      { transform: translate(0, 0) rotate(0deg); animation-timing-function: ease-out; }
  14%      { transform: translate(3cqw, -7cqh) rotate(-4deg); animation-timing-function: ease-in; }
  18%      { transform: translate(6.5cqw, 0) rotate(0deg); animation-timing-function: ease-out; }
  22%      { transform: translate(10cqw, -7cqh) rotate(-4deg); animation-timing-function: ease-in; }
  26%      { transform: translate(13.5cqw, 0) rotate(0deg); animation-timing-function: ease-out; }
  30%      { transform: translate(16.5cqw, -5cqh) rotate(-3deg); animation-timing-function: ease-in; }
  34%, 42% { transform: translate(19cqw, 0) rotate(0deg); }
  48%      { transform: translate(19cqw, 0) rotate(17deg); }
  53%      { transform: translate(19.5cqw, 0) rotate(13deg); }
  58%      { transform: translate(19cqw, 0) rotate(17deg); }
  63%      { transform: translate(19.5cqw, 0) rotate(13deg); }
  68%, 72% { transform: translate(19cqw, 0) rotate(0deg); animation-timing-function: ease-out; }
  76%      { transform: translate(15cqw, -6cqh) rotate(4deg); animation-timing-function: ease-in; }
  80%      { transform: translate(10cqw, 0) rotate(0deg); animation-timing-function: ease-out; }
  84%      { transform: translate(5cqw, -6cqh) rotate(4deg); animation-timing-function: ease-in; }
  88%      { transform: translate(0, 0) rotate(0deg); }
  94%      { opacity: 1; }
  100%     { opacity: 0; transform: translate(0, 0) rotate(0deg); }
}
@keyframes fx-pal-right {
  0%       { opacity: 0; transform: translate(0, 0) rotate(0deg); }
  4%       { opacity: 1; }
  10%      { transform: translate(0, 0) rotate(0deg); animation-timing-function: ease-out; }
  14%      { transform: translate(-3cqw, -7cqh) rotate(4deg); animation-timing-function: ease-in; }
  18%      { transform: translate(-6.5cqw, 0) rotate(0deg); animation-timing-function: ease-out; }
  22%      { transform: translate(-10cqw, -7cqh) rotate(4deg); animation-timing-function: ease-in; }
  26%      { transform: translate(-13.5cqw, 0) rotate(0deg); animation-timing-function: ease-out; }
  30%      { transform: translate(-16.5cqw, -5cqh) rotate(3deg); animation-timing-function: ease-in; }
  34%, 42% { transform: translate(-19cqw, 0) rotate(0deg); }
  48%      { transform: translate(-19cqw, 0) rotate(-17deg); }
  53%      { transform: translate(-19.5cqw, 0) rotate(-13deg); }
  58%      { transform: translate(-19cqw, 0) rotate(-17deg); }
  63%      { transform: translate(-19.5cqw, 0) rotate(-13deg); }
  68%, 72% { transform: translate(-19cqw, 0) rotate(0deg); animation-timing-function: ease-out; }
  76%      { transform: translate(-15cqw, -6cqh) rotate(-4deg); animation-timing-function: ease-in; }
  80%      { transform: translate(-10cqw, 0) rotate(0deg); animation-timing-function: ease-out; }
  84%      { transform: translate(-5cqw, -6cqh) rotate(-4deg); animation-timing-function: ease-in; }
  88%      { transform: translate(0, 0) rotate(0deg); }
  94%      { opacity: 1; }
  100%     { opacity: 0; transform: translate(0, 0) rotate(0deg); }
}
@keyframes fx-pal-squash {
  0%           { transform: scale(0.4, 0.2); }
  5%           { transform: scale(1.12, 0.88); }
  8%, 10%      { transform: scale(1, 1); }
  12%, 20%, 28% { transform: scale(0.9, 1.1); }
  18%, 26%     { transform: scale(1.14, 0.86); }
  34%          { transform: scale(1.16, 0.84); }
  37%, 72%     { transform: scale(1, 1); }
  74%, 82%     { transform: scale(0.9, 1.1); }
  80%          { transform: scale(1.12, 0.88); }
  88%          { transform: scale(1.14, 0.86); }
  91%, 100%    { transform: scale(1, 1); }
}
/* The outer flame grows a little while the two touch, and flickers. */
@keyframes fx-pal-flame {
  0%, 44%, 66%, 100% { transform: scale(1, 1); }
  6%, 18%, 30%, 38%, 72%, 84% { transform: scale(0.9, 1.08); }
  12%, 24%, 34%, 78%, 90% { transform: scale(1.06, 0.92); }
  50%      { transform: scale(1.2, 1.35); }
  55%      { transform: scale(1.1, 1.2); }
  60%      { transform: scale(1.22, 1.32); }
}
@keyframes fx-pal-flicker {
  from { transform: scale(1, 1); }
  to   { transform: scale(0.8, 1.15); }
}
/* Eyes: a blink on the way, then they turn to the friend, a happy squint
   while the flames touch, a blink, and back. */
@keyframes fx-pal-eyes {
  0%, 20%, 36%, 100% { transform: translate(0, 0) scale(1, 1); }
  22%      { transform: translate(0, 0) scale(1, 0.1); }
  24%      { transform: translate(0, 0) scale(1, 1); }
  40%, 46% { transform: translate(1.2px, -0.3px) scale(1, 1); }
  50%, 60% { transform: translate(1.2px, -0.3px) scale(1.05, 0.3); }
  64%      { transform: translate(1.2px, -0.3px) scale(1, 1); }
  68%      { transform: translate(1.2px, -0.3px) scale(1, 0.1); }
  70%      { transform: translate(0.8px, 0) scale(1, 1); }
  76%      { transform: translate(0, 0) scale(1, 1); }
}
@keyframes fx-pal-cheeks {
  0%, 38%  { opacity: 0; }
  46%, 70% { opacity: 0.85; }
  82%, 100% { opacity: 0; }
}
/* The arm on the friend's side: the two take each other's hand once they
   meet, then tuck it away while they lean in. */
@keyframes fx-pal-arm {
  0%, 34%, 78%, 100% { transform: rotate(0deg); }
  38%, 43% { transform: rotate(-28deg); }
  48%, 68% { transform: rotate(25deg); }
}
@keyframes fx-pal-glow {
  0%, 46%  { opacity: 0; transform: scale(0.3); }
  50%      { opacity: 1; transform: scale(1.15); }
  58%      { opacity: 0.75; transform: scale(0.95); }
  64%      { opacity: 0.85; transform: scale(1.05); }
  72%, 100% { opacity: 0; transform: scale(0.6); }
}
@keyframes fx-pal-spark {
  0%, 48%  { opacity: 0; transform: rotate(var(--a)) translateX(0) scale(1); }
  50%      { opacity: 1; }
  60%      { opacity: 0.9; transform: rotate(var(--a)) translateX(var(--d)) scale(0.7); }
  66%, 100% { opacity: 0; transform: rotate(var(--a)) translateX(calc(var(--d) * 1.2)) scale(0.2); }
}
@keyframes fx-pal-heart {
  0%, 49%  { opacity: 0; transform: translateY(0) scale(0.2) rotate(0deg); }
  54%      { opacity: 1; transform: translateY(-4cqh) scale(1.3) rotate(-6deg); }
  60%      { transform: translateY(-7cqh) scale(1) rotate(5deg); }
  68%      { opacity: 1; transform: translateY(-11cqh) scale(1.05) rotate(-4deg); }
  80%, 100% { opacity: 0; transform: translateY(-18cqh) scale(0.85) rotate(3deg); }
}

@media (prefers-reduced-motion: reduce) {
  .special-label { animation: none; }
  .snow-fx, .jar-fx { display: none; }
}

/* ---------- Unlock "lighting" scene (unlock-fx.js) ----------
   Cumulative states on .unlock-fx, in order: is-dark → is-spark-1 (fails) →
   is-spark-2 (catches) → is-bead → is-lit (flame full) → is-rim (light
   catches the jar's rim) → is-glow (whole candle out of the dark) → is-text
   (number + name, ciphered) → [tap] is-decoding → is-sub → [tap] is-flying.
   is-hint shows the "Tap to …" suggestion; is-skipped = opening cut short by
   a tap. --flick (≈0.8–1.1) is set every frame by JS so the light breathes
   with the flame: never transition a property that uses it. */
@property --ufx-r {
  syntax: '<percentage>';
  inherits: false;
  initial-value: 0%;
}
body.unlock-fx-open { overflow: hidden; }
.unlock-fx {
  --flick: 1;
  --jar-w: min(78vw, 50vh, 440px);
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  padding: 16px;
  isolation: isolate;
  opacity: 0;
  transition: opacity 1100ms ease;
  color: #f6ead2;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}
/* The dark is its own layer so it can lift while the jar flies home. */
.ufx-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(ellipse at 50% 40%, #1a120b 0%, #0a0704 72%);
  transition: opacity 1100ms ease 150ms;
}
.unlock-fx.is-dark { opacity: 1; }
.unlock-fx.is-leaving { opacity: 0; transition-duration: 900ms; pointer-events: none; }

.ufx-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(0.4rem, 2vh, 1.2rem);
  /* Slow push-in as the candle comes out of the dark. */
  scale: 0.93;
  transition: scale 6500ms cubic-bezier(0.25, 0.6, 0.2, 1), translate 900ms ease;
}
.is-rim .ufx-stage { scale: 1; }
.unlock-fx.is-leaving .ufx-stage { scale: 1.05; transition-duration: 900ms; }

.ufx-jar {
  position: relative;
  width: var(--jar-w);
  aspect-ratio: 1;
}

/* Warm light thrown by the flame onto the room; breathes with --flick. */
.ufx-light {
  position: absolute;
  left: var(--wick-x);
  top: var(--wick-y);
  width: 270%;
  aspect-ratio: 1;
  translate: -50% -50%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 184, 92, 0.32) 0%, rgba(232, 128, 40, 0.13) 28%, rgba(120, 60, 20, 0) 60%);
  scale: 0;
  opacity: 0;
  filter: brightness(var(--flick));
  transition: scale 4200ms cubic-bezier(0.2, 0.7, 0.2, 1), opacity 1800ms ease;
  pointer-events: none;
}
.is-lit .ufx-light { scale: 0.22; opacity: 0.8; }
.is-rim .ufx-light { scale: 0.42; opacity: 0.9; }
.is-glow .ufx-light { scale: 1; opacity: 1; }

/* A pool of light where the jar stands, once it is fully lit. */
.ufx-floor {
  position: absolute;
  left: 50%;
  bottom: 6%;
  width: 90%;
  height: 16%;
  translate: -50% 0;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(255, 176, 90, 0.22), transparent 70%);
  opacity: 0;
  filter: brightness(var(--flick));
  transition: opacity 3000ms ease 1200ms;
}
.is-glow .ufx-floor { opacity: 1; }

/* The jar comes out of the dark from the flame outwards: first only the rim
   near the flame, dim and warm; then a slow widening circle of light while it
   warms from silhouette to fully lit. The wrapper carries the flicker (no
   transition, it changes every frame); the photo carries the slow states. */
.ufx-photo-wrap {
  position: absolute;
  inset: 0;
  filter: brightness(var(--flick));
}
.ufx-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  --ufx-r: 0%;
  -webkit-mask-image: radial-gradient(circle at var(--wick-x) var(--wick-y), #000 calc(var(--ufx-r) * 0.45), rgba(0, 0, 0, 0.4) calc(var(--ufx-r) * 0.75), transparent var(--ufx-r));
  mask-image: radial-gradient(circle at var(--wick-x) var(--wick-y), #000 calc(var(--ufx-r) * 0.45), rgba(0, 0, 0, 0.4) calc(var(--ufx-r) * 0.75), transparent var(--ufx-r));
  filter: brightness(0.25) sepia(0.7) saturate(1.5);
  transition: --ufx-r 2000ms cubic-bezier(0.3, 0.7, 0.2, 1), filter 2000ms ease;
}
.is-lit .ufx-photo { --ufx-r: 12%; filter: brightness(0.32) sepia(0.7) saturate(1.5); }
.is-rim .ufx-photo {
  --ufx-r: 30%;
  filter: brightness(0.5) sepia(0.55) saturate(1.4);
}
.is-glow .ufx-photo {
  --ufx-r: 170%;
  filter: brightness(1.02) sepia(0.12) saturate(1.05);
  transition: --ufx-r 4200ms cubic-bezier(0.45, 0.05, 0.25, 1), filter 4000ms ease;
}

.ufx-smoke {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 3000ms ease 1500ms;
  pointer-events: none;
}
.is-glow .ufx-smoke { opacity: 1; }
/* On the dark scene the candle-coloured smoke needs lifting to read. */
.ufx-smoke .scent-fx { filter: brightness(1.7) saturate(0.8); }

/* The wick sits inside the jar, behind the front glass: a faint copy of the
   photo, feathered around the strip between the front rim and the wood,
   lies over the flame's base so the rim and the glass haze pass in front. */
.ufx-glass {
  opacity: 0.45;
  -webkit-mask-image: radial-gradient(ellipse 4% 2.4% at var(--wick-x) 27.6%, #000 45%, transparent 100%);
  mask-image: radial-gradient(ellipse 4% 2.4% at var(--wick-x) 27.6%, #000 45%, transparent 100%);
}

/* Flame anchored on the wick: its base sits on the wick point. */
.ufx-wick {
  position: absolute;
  left: var(--wick-x);
  top: var(--wick-y);
  width: 0;
  height: 0;
}
.ufx-flame {
  position: absolute;
  left: 0;
  /* The flame's base (y≈124 of its 140 viewBox) rests on the wood. */
  bottom: calc(var(--jar-w) * -0.02);
  width: calc(var(--jar-w) * 0.075);
  height: auto;
  overflow: visible;
  translate: -50% 0;
  transform-origin: 50% 88%;
  scale: 0 0;
  opacity: 0;
  filter: drop-shadow(0 0 calc(var(--jar-w) * 0.018) rgba(255, 190, 100, 0.85));
  transition: scale 500ms ease-out, opacity 300ms ease;
}
.ufx-flame-sway { transform-origin: 30px 122px; transform-box: view-box; }
/* Born as a small blue bead, then it draws itself up into a full flame. */
.is-bead .ufx-flame { scale: 0.32 0.18; opacity: 1; }
.is-lit .ufx-flame {
  scale: 1 1;
  transition: scale 1600ms cubic-bezier(0.22, 1.2, 0.36, 1);
}

.ufx-halo {
  position: absolute;
  left: 0;
  top: 0;
  width: calc(var(--jar-w) * 0.34);
  aspect-ratio: 1;
  translate: -50% -60%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 214, 140, 0.5) 0%, rgba(255, 160, 60, 0.16) 38%, transparent 70%);
  scale: 0;
  opacity: 0;
  filter: brightness(var(--flick));
  transition: scale 1600ms ease-out, opacity 700ms ease;
}
.is-bead .ufx-halo { scale: 0.35; opacity: 0.7; }
.is-lit .ufx-halo { scale: 1; opacity: 1; }

/* Strikes: embers burst from the wick. The first one is weak and dies with
   a brief flash; the second is bigger and leaves the flame behind. */
.ufx-sparks { position: absolute; left: 0; top: 0; }
.ufx-spark {
  position: absolute;
  left: -1.5px;
  top: -1.5px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #ffe2a0;
  box-shadow: 0 0 6px 1px rgba(255, 180, 80, 0.9);
  opacity: 0;
}
.ufx-sparks-1 .ufx-spark { width: 2px; height: 2px; }
.is-spark-1 .ufx-sparks-1 .ufx-spark { animation: ufx-spark 520ms cubic-bezier(0.1, 0.7, 0.3, 1) var(--delay) forwards; }
.is-spark-2 .ufx-sparks-2 .ufx-spark { animation: ufx-spark 900ms cubic-bezier(0.1, 0.7, 0.3, 1) var(--delay) forwards; }
@keyframes ufx-spark {
  0% { opacity: 1; transform: rotate(var(--a)) translateX(0) scale(1.5); }
  60% { opacity: 0.9; }
  100% { opacity: 0; transform: rotate(var(--a)) translateX(var(--d)) translateY(14px) scale(0.3); }
}
.ufx-wick::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: calc(var(--jar-w) * 0.12);
  aspect-ratio: 1;
  translate: -50% -50%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 226, 160, 0.9), rgba(255, 160, 60, 0.25) 40%, transparent 70%);
  opacity: 0;
}
.is-spark-1 .ufx-wick::before { animation: ufx-flash 420ms ease-out; }
.is-spark-2 .ufx-wick::before { animation: ufx-flash 700ms ease-out 0ms; }
@keyframes ufx-flash {
  0% { opacity: 0; scale: 0.4; }
  18% { opacity: 1; scale: 1; }
  100% { opacity: 0; scale: 1.4; }
}

/* Number and name decrypt in gold under the jar. */
.ufx-text {
  text-align: center;
  opacity: 0;
  translate: 0 12px;
  transition: opacity 900ms ease, translate 1200ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.is-text .ufx-text { opacity: 1; translate: 0 0; }
.ufx-no {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1rem, 3.6vw, 1.2rem);
  letter-spacing: 0.12em;
  color: var(--gold);
}
.ufx-name {
  margin: 0.1rem 0 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.8rem, 7.5vw, 2.8rem);
  line-height: 1.1;
  color: #fbf1dc;
  text-shadow: 0 0 28px rgba(255, 170, 80, 0.35);
}
.ufx-c { position: relative; color: transparent; }
.ufx-c::after {
  content: attr(data-g);
  position: absolute;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 0.8em;
  font-weight: 400;
  color: var(--gold);
  text-shadow: 0 0 8px rgba(220, 147, 26, 0.8);
  opacity: 0.85;
}
.ufx-c.is-set { color: inherit; animation: ufx-land 1000ms ease-out; }
.ufx-c.is-set::after { content: none; }
@keyframes ufx-land {
  0% { color: #ffd27a; text-shadow: 0 0 18px rgba(255, 190, 90, 1); }
  100% { text-shadow: inherit; }
}
.ufx-sub {
  margin: 0.7rem 0 0;
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(246, 234, 210, 0.7);
  opacity: 0;
  transition: opacity 1200ms ease;
}
.is-sub .ufx-sub { opacity: 1; }

/* "Tap to …" hint, laid over the bottom of the scene. It only shows up if
   the person hasn't tapped by themselves after a while. */
.ufx-hint {
  position: absolute;
  left: 50%;
  bottom: calc(2.2rem + env(safe-area-inset-bottom));
  translate: -50% 8px;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin: 0;
  white-space: nowrap;
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(251, 231, 194, 0.78);
  opacity: 0;
  pointer-events: none;
  transition: opacity 900ms ease, translate 900ms ease;
}
.is-hint .ufx-hint { opacity: 1; translate: -50% 0; }
.ufx-hint-ring {
  position: relative;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 10px rgba(220, 147, 26, 0.8);
}
.ufx-hint-ring::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  border: 1.5px solid var(--gold);
  animation: ufx-ping 1.8s ease-out infinite;
}
@keyframes ufx-ping {
  0% { scale: 1; opacity: 0.9; }
  100% { scale: 3.2; opacity: 0; }
}

/* Tap 2: the dark lifts, the flame goes out, the text fades, and the jar
   (moved by JS) flies into its tile. */
.is-flying .ufx-bg { opacity: 0; }
.is-flying .ufx-text { opacity: 0 !important; transition: opacity 250ms ease !important; }
.is-flying .ufx-light,
.is-flying .ufx-floor,
.is-flying .ufx-smoke,
.is-flying .ufx-halo {
  opacity: 0 !important;
  transition: opacity 500ms ease !important;
}
.is-flying .ufx-flame {
  scale: 0.2 0 !important;
  opacity: 0 !important;
  transition: scale 450ms ease-in, opacity 450ms ease-in !important;
}
.is-flying .ufx-photo-wrap { filter: none; }
.is-flying .ufx-photo { filter: none; transition: filter 900ms ease; }
.unlock-fx.is-flying { cursor: default; pointer-events: none; }

/* Where it lands: a short pop and a gold ring in the list. */
#catalog .tile.just-added .tile-photo-stack { animation: ufx-landed 1400ms cubic-bezier(0.2, 0.8, 0.2, 1); }
@keyframes ufx-landed {
  0% { scale: 1; filter: drop-shadow(0 0 0 rgba(220, 147, 26, 0)); }
  25% { scale: 1.06; filter: drop-shadow(0 0 18px rgba(220, 147, 26, 0.75)); }
  100% { scale: 1; filter: drop-shadow(0 0 0 rgba(220, 147, 26, 0)); }
}

/* No photo of the filled jar: the flame and its light carry the moment. */
.ufx-jar.is-empty { aspect-ratio: 2 / 1; --wick-y: 75%; --wick-x: 50%; }

/* Tapped mid-way: everything settles quickly into the final scene. */
.unlock-fx.is-skipped *,
.unlock-fx.is-skipped .ufx-photo { transition-duration: 700ms !important; transition-delay: 0ms !important; }
.unlock-fx.is-skipped .ufx-spark,
.unlock-fx.is-skipped .ufx-wick::before { animation: none; opacity: 0; }

.unlock-fx.is-still,
.unlock-fx.is-still * { transition: none !important; animation: none !important; }

/* Coming soon: a dimmed, locked jar with only its number. Not a link and
   nothing happens on hover or touch. */
#catalog .tile.is-soon { cursor: default; }
#catalog .tile.is-soon .tile-photo {
  filter: grayscale(1) brightness(1.04);
  opacity: 0.38;
}
#catalog .tile.is-soon .tile-photo-stack > :not(.tile-shadow) { translate: none; }
#catalog .tile.is-soon .tile-shadow { opacity: 0.12; transform: none; }
#catalog .tile.is-soon h4 { color: var(--ink-muted); font-weight: 500; }
#catalog .tile.is-soon .spec-no { color: var(--ink-muted); }
.soon-lock {
  width: 0.95em;
  height: 0.95em;
  margin-right: 0.35em;
  vertical-align: -0.1em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

/* Invite a friend, in the account menu. */
.account-invite {
  margin: 0.25rem 0 0.75rem;
  padding: 0.7rem 0 0;
  border-top: 1px solid rgba(28, 20, 16, 0.08);
  max-width: 240px;
}
.account-menu .account-invite-title { font-weight: 600; color: var(--ink); font-size: 0.85rem; }
.account-menu .account-invite-text { font-size: 0.78rem; line-height: 1.4; margin: 0.2rem 0 0.5rem; }
.account-invite-url {
  display: block;
  padding: 0.35rem 0.5rem;
  margin-bottom: 0.45rem;
  font-size: 0.78rem;
  background: rgba(220, 147, 26, 0.1);
  border-radius: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  user-select: all;
}
.account-menu .account-invite-share {
  width: 100%;
  padding: 0.45rem 0.8rem;
  font-size: 0.85rem;
}
.account-menu .account-invite-stats { font-size: 0.75rem; margin-top: 0.4rem; color: var(--ink-muted); }
.account-menu .account-invite-stats:empty { display: none; }

/* ---------- Request a candle ---------- */
.request-btn {
  align-self: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 1.05rem;
  border-radius: 999px;
  font-size: 0.84rem;
  white-space: nowrap;
}
.request-btn.is-asked {
  background: transparent;
  color: var(--ink-muted);
  border-color: var(--border);
}
.request-btn svg { width: 15px; height: 15px; fill: none; stroke: var(--gold); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

#request-modal { z-index: 110; }
.modal-box.request-box {
  display: block;
  max-width: 480px;
  padding: 1.75rem 1.75rem 1.5rem;
}
/* The form is wider: room for bigger candles and the address on two lines. */
.modal-box.request-box:has(.request-form) { max-width: 860px; max-height: 90vh; padding: 2rem 2.2rem 1.8rem; }
.request-box h2 { margin: 0.15rem 0 0.9rem; }
.request-box .series-index { margin: 0; }
.request-info { font-size: 0.86rem; color: var(--ink-muted); margin: 0 0 1rem; }
.request-info.is-box {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.75rem 0.9rem;
  color: var(--ink);
}
.request-info.is-box p { margin: 0; }
.request-info svg { flex: 0 0 18px; width: 18px; height: 18px; margin-top: 0.1rem; fill: none; stroke: var(--gold); stroke-width: 2; stroke-linecap: round; }
.request-form { gap: 0; max-width: none; margin-top: 0.6rem; }
.request-form input, .request-form textarea { width: 100%; max-width: none; box-sizing: border-box; }
#modal-collection-actions button { align-self: auto; }
.request-form .optional { font-weight: 400; color: var(--ink-muted); font-size: 0.8rem; margin-left: 0.25rem; }
.request-form .error:empty { display: none; }
.request-lead { margin: 0 0 0.5rem; }
.request-address {
  margin: 0 0 0.75rem;
  padding: 0.7rem 0.9rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  line-height: 1.45;
}
.request-note { margin: 0 0 0.75rem; font-style: italic; color: var(--ink-muted); }
/* Three parts, one under the other: the candles, the address, note and send. */
.request-section { border: 0; margin: 0; padding: 1.4rem 0; min-width: 0; border-top: 1.5px solid var(--border); }
.request-section:first-child { border-top: 0; padding-top: 0.4rem; }
.request-section:last-child { padding-bottom: 0; }
/* Floated, the legend is an ordinary item of its fieldset: it doesn't sit on the border line. */
.request-step {
  float: left; width: 100%;
  display: flex; align-items: center; gap: 0.6rem; padding: 0; margin-bottom: 0.8rem;
  font: 700 1.15rem/1.2 var(--font-display); color: var(--ink);
}
.request-step span {
  display: inline-grid; place-items: center; width: 1.75rem; height: 1.75rem; flex: none;
  border-radius: 50%; background: var(--gold); color: #fff; font-size: 0.95rem;
}
.request-section .request-info { margin: -0.3rem 0 0.9rem; }
.request-ship { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 0.75rem 1rem; }
.request-ship > legend { grid-column: 1 / -1; }
.request-ship .is-wide { grid-column: 1 / -1; }
.request-ship label, .request-ship input { min-width: 0; }
.request-pick { display: flex; flex-direction: column; }
.request-finish { display: flex; flex-direction: column; gap: 0.75rem; }
/* The candles that can be chosen. */
.request-pick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.75rem;
}
.request-pick-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  padding: 0.8rem 0.6rem 0.85rem;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 14px;
  cursor: pointer;
  text-align: center;
  font-weight: 400;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}
.request-pick-item input { position: absolute; opacity: 0; pointer-events: none; }
.request-pick-item img { width: 110px; height: 110px; object-fit: contain; margin-bottom: 0.3rem; }
.request-pick-no { font-size: 0.74rem; font-weight: 600; letter-spacing: 0.06em; color: var(--gold); }
.request-pick-name { font-size: 0.9rem; line-height: 1.25; color: var(--ink); overflow-wrap: anywhere; }
.request-pick-item:hover { border-color: var(--gold); }
.request-pick-item:has(input:checked) { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold); background: #fffaf0; }
.request-pick-item:has(input:checked)::after {
  content: '✓';
  position: absolute;
  top: 0.45rem;
  right: 0.5rem;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 50%;
  background: var(--gold);
  color: #fff;
  font-size: 0.8rem;
  line-height: 1.4rem;
}
.request-pick-item:has(input:focus-visible) { outline: 2px solid var(--ink); outline-offset: 2px; }
/* Not choosable yet: a group of their own, each with what it takes. */
.request-locked-title {
  display: flex; align-items: center; gap: 0.45rem; margin: 1.4rem 0 0.7rem;
  font: 600 0.95rem/1.2 var(--font-body); color: var(--ink-muted);
}
.request-locked-title::before, .request-locked-item .request-pick-no::before {
  content: ''; flex: none; width: 0.85rem; height: 0.85rem; background: currentColor;
  -webkit-mask: var(--lock-icon) center / contain no-repeat;
  mask: var(--lock-icon) center / contain no-repeat;
}
.request-box {
  --lock-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 10V7a5 5 0 0 1 10 0v3h1a1 1 0 0 1 1 1v9a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1v-9a1 1 0 0 1 1-1Zm2 0h6V7a3 3 0 0 0-6 0Z'/%3E%3C/svg%3E");
}
.request-locked-list {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0.6rem;
}
.request-locked-item {
  display: flex; align-items: center; gap: 0.75rem; padding: 0.6rem 0.8rem 0.6rem 0.6rem;
  background: #f6f3ec; border: 1.5px dashed var(--border); border-radius: 14px;
}
.request-locked-item img { width: 64px; height: 64px; object-fit: contain; flex: none; filter: grayscale(1); opacity: 0.5; }
.request-locked-text { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; }
.request-locked-item .request-pick-no { display: inline-flex; align-items: center; gap: 0.3rem; color: var(--ink-muted); }
.request-locked-item .request-pick-no::before { width: 0.7rem; height: 0.7rem; }
.request-pick-why { margin-top: 0.2rem; font-size: 0.84rem; font-weight: 600; line-height: 1.35; color: #8a5a0b; overflow-wrap: anywhere; }
.request-chosen-list { display: grid; gap: 0.45rem; margin: 0 0 0.85rem; }
.request-chosen {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin: 0;
  padding: 0.55rem 0.8rem;
  background: #fff;
  border: 1.5px solid var(--gold);
  border-radius: 12px;
  font-weight: 600;
}
.request-chosen img { width: 48px; height: 48px; object-fit: contain; flex: none; }
.request-chosen-no { display: block; font-size: 0.72rem; letter-spacing: 0.06em; color: var(--gold); }
.request-actions { display: flex; justify-content: flex-end; gap: 0.6rem; margin-top: 0.25rem; }
.request-actions button { align-self: auto; padding: 0.55rem 1.3rem; border-radius: 999px; font-size: 0.88rem; }
@media (max-width: 700px) {
  .archive-head { margin: 1.75rem 0 1.25rem; gap: 0.9rem; }
  .archive-side { justify-content: space-between; width: 100%; }
  .filter-btn { padding: 0.45rem 0.85rem; font-size: 0.92rem; }
  .modal-box.request-box, .modal-box.request-box:has(.request-form) { padding: 1.4rem 1.1rem 1.2rem; }
  .request-pick-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.55rem; }
  .request-pick-item img { width: 84px; height: 84px; }
  .request-locked-list { grid-template-columns: 1fr; }
  .request-locked-item img { width: 52px; height: 52px; }
  .request-ship { grid-template-columns: 1fr 1fr; }
  .request-ship label:nth-of-type(3) { grid-column: 1 / -1; }
  .request-actions button { padding: 0.75rem 1.4rem; font-size: 0.95rem; }
}

/* Pointed out when arriving from the homepage's "Request a candle". */
.request-btn.is-hinted { animation: request-hint 1.2s ease-in-out 3; }
@keyframes request-hint { 50% { box-shadow: 0 0 0 6px rgba(220, 147, 26, 0.35); } }
@media (prefers-reduced-motion: reduce) { .request-btn.is-hinted { animation: none; box-shadow: 0 0 0 3px rgba(220, 147, 26, 0.45); } }

/* Language switch in the dock: the other language's code, one tap away. */
.dock .dock-lang {
  font-family: var(--font-body);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  cursor: pointer;
}

/* ---------- Help button (help.js) ----------
   Dan's mascot floating in the bottom right corner, drawn like the cartoon
   bits of the site (ink outline, solid shadow, a gold "?" badge). It opens
   a small card to leave a question and a WhatsApp number. On phones it sits
   above the dock and the card becomes a sheet across the bottom. */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.help-fab {
  position: fixed; right: 22px; bottom: 22px; z-index: 60;
  width: 64px; height: 64px; padding: 0; border: 3px solid var(--ink); border-radius: 50%;
  background: var(--bg); box-shadow: 3px 4px 0 var(--ink); cursor: pointer;
  transition: transform 180ms cubic-bezier(0.2, 1.4, 0.4, 1), box-shadow 180ms;
}
.help-fab img { display: block; width: 100%; height: 100%; border-radius: 50%; transition: transform 220ms cubic-bezier(0.2, 1.4, 0.4, 1); }
/* The button lifts, only the mascot tilts (the label stays level). */
.help-fab:hover { transform: translateY(-3px); }
.help-fab:hover img { transform: rotate(-8deg); }
.help-fab:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.help-fab:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.help-fab-badge {
  position: absolute; top: -7px; left: -7px; width: 26px; height: 26px; display: grid; place-items: center;
  border: 2.5px solid var(--ink); border-radius: 50%; background: var(--gold); color: var(--ink);
  font: 800 1rem/1 var(--font-display); transition: transform 180ms;
}
.help.is-open .help-fab-badge { transform: scale(0); }
.help-fab-tip {
  position: absolute; right: calc(100% + 12px); top: 50%; transform: translate(6px, -50%);
  padding: 0.5rem 0.85rem; border-radius: 999px; background: var(--ink); color: var(--bg);
  font: 600 0.9rem/1 var(--font-body); white-space: nowrap; opacity: 0; pointer-events: none;
  transition: opacity 150ms, transform 150ms;
}
@media (hover: hover) {
  .help-fab:hover .help-fab-tip, .help-fab:focus-visible .help-fab-tip { opacity: 1; transform: translate(0, -50%); }
}
.help.is-open .help-fab-tip { display: none; }

.help-card {
  position: fixed; right: 22px; bottom: 104px; z-index: 120;
  width: min(360px, calc(100vw - 24px)); max-height: calc(100dvh - 128px); overflow: auto;
  padding: 1.2rem 1.2rem 1rem; box-sizing: border-box;
  background: var(--bg); border: 3px solid var(--ink); border-radius: 24px; box-shadow: 6px 6px 0 var(--ink);
  opacity: 0; transform: translateY(14px) scale(0.96); transform-origin: 100% 100%;
  transition: opacity 200ms ease, transform 280ms cubic-bezier(0.2, 1.25, 0.4, 1);
}
.help-card.is-shown { opacity: 1; transform: none; }
.help-close {
  position: absolute; top: 0.55rem; right: 0.55rem; width: 40px; height: 40px; display: grid; place-items: center;
  padding: 0; border: 0; border-radius: 50%; background: none; color: var(--ink); cursor: pointer;
}
.help-close svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; }
.help-close:hover { background: var(--surface); }
.help-close:focus-visible { outline: 3px solid var(--gold); outline-offset: 0; }
.help-head { display: flex; align-items: center; gap: 0.8rem; padding-right: 2.2rem; }
.help-avatar { flex: none; width: 52px; height: 52px; border: 2.5px solid var(--ink); border-radius: 50%; }
.help-head h2 { margin: 0; font: 800 1.35rem/1.05 var(--font-display); color: var(--ink); }
.help-head p { margin: 0.25rem 0 0; max-width: none; font-size: 0.92rem; line-height: 1.4; color: var(--ink-muted); }
.help-form { display: grid; gap: 0.7rem; margin-top: 1rem; }
.help-form[hidden], .help-done[hidden], .help-error[hidden] { display: none; }
.help-field { display: grid; gap: 0.3rem; font-size: 0.85rem; font-weight: 600; color: var(--ink); }
.help-field input, .help-field textarea {
  width: 100%; box-sizing: border-box; min-height: 44px; padding: 0.6rem 0.8rem;
  border: 2px solid var(--border); border-radius: 12px; background: #fffdf8; color: var(--ink);
  font: 400 1rem/1.4 var(--font-body);
}
.help-field textarea { resize: vertical; min-height: 6.2rem; }
.help-field input:focus, .help-field textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(220, 147, 26, 0.25); }
.help-trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.help-error { margin: 0; max-width: none; font-size: 0.9rem; font-weight: 500; line-height: 1.4; color: var(--red); }
.help-send {
  display: flex; align-items: center; justify-content: center; gap: 0.5rem; min-height: 48px; margin-top: 0.2rem;
  border: 3px solid var(--ink); border-radius: 999px; background: var(--gold); color: var(--gold-ink);
  font: 700 1.05rem/1 var(--font-body); box-shadow: 3px 3px 0 var(--ink); cursor: pointer;
}
.help-send svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linejoin: round; }
.help-send:hover { filter: brightness(1.05); }
.help-send:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.help-send:disabled { opacity: 0.6; cursor: progress; }
.help-send:focus-visible, .help-again:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.help-note { margin: 0; max-width: none; text-align: center; font-size: 0.8rem; color: var(--ink-muted); }
.help-done { margin-top: 1.1rem; text-align: center; }
.help-done-title { margin: 0; font: 800 1.4rem/1.1 var(--font-display); color: var(--ink); }
.help-done-text { margin: 0.45rem auto 0; max-width: 18rem; line-height: 1.5; color: var(--ink-muted); }
.help-again {
  min-height: 44px; margin-top: 1rem; padding: 0 1.4rem; border: 2px solid var(--ink); border-radius: 999px;
  background: none; color: var(--ink); font: 600 0.95rem/1 var(--font-body); cursor: pointer;
}
.help-again:hover { background: var(--surface); }
@media (max-width: 700px) {
  .help-fab { right: 14px; bottom: 88px; width: 56px; height: 56px; }
  .help-card { left: 10px; right: 10px; bottom: 10px; width: auto; max-height: calc(100dvh - 20px); transform-origin: 50% 100%; }
  .help.is-open .help-fab { visibility: hidden; }
}
@media (prefers-reduced-motion: reduce) {
  .help-fab, .help-fab img, .help-card, .help-fab-badge, .help-fab-tip { transition: none; }
}

/* Privacy & cookies page (/privacy): the policy is written in both
   languages, only the one matching <html lang> shows. */
html[lang="it"] .legal[lang="en"], html:not([lang="it"]) .legal[lang="it"] { display: none; }
.legal h2 { font-size: 1.25rem; margin-top: 2rem; }
.legal ul { padding-left: 1.2rem; color: var(--ink-muted); max-width: 60ch; }
.legal li { margin-bottom: 0.45rem; }
.legal li strong, .legal p strong { color: var(--ink); }
.legal-updated { font-size: 0.85rem; }
.legal-table { overflow-x: auto; margin: 1rem 0; border: 1px solid var(--border); border-radius: 12px; }
.legal-table table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: 0.88rem; }
.legal-table th, .legal-table td { padding: 0.6rem 0.75rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--border); }
.legal-table th { background: var(--surface); font-weight: 600; }
.legal-table tr:last-child td { border-bottom: none; }
.legal-table td { color: var(--ink-muted); }
.legal-table code { font-size: 0.82rem; color: var(--ink); word-break: break-all; }

/* Quiet footer link to the policy, at the end of the public pages. */
.site-foot { margin-top: 3rem; font-size: 0.85rem; color: var(--ink-muted); }
.site-foot a { color: var(--ink-muted); font-weight: 500; }
.site-foot a:hover { color: var(--gold); }
.form-legal { font-size: 0.82rem; margin: 0.2rem 0 0.6rem; }

/* Cookie notice (app.js, mountCookieNotice): small, at the bottom, until "Ok".
   On phones it sits above the dock and left of the help button. */
.cookie-notice {
  position: fixed; z-index: 45; left: 50%; bottom: 22px; transform: translateX(-50%);
  width: min(520px, calc(100% - 15rem));
  display: flex; align-items: center; gap: 0.8rem; padding: 0.6rem 0.65rem 0.6rem 0.95rem;
  background: rgba(255, 253, 248, 0.94); border: 1px solid rgba(28, 20, 16, 0.12); border-radius: 14px;
  box-shadow: 0 8px 24px rgba(28, 20, 16, 0.14); font-size: 0.82rem; line-height: 1.4; color: var(--ink-muted);
}
.cookie-notice p { margin: 0; flex: 1; max-width: none; color: inherit; }
.cookie-notice a { white-space: nowrap; }
.cookie-notice button {
  flex: none; min-width: 44px; min-height: 36px; padding: 0 0.9rem; border: 2px solid var(--ink); border-radius: 999px;
  background: var(--bg); color: var(--ink); font: 600 0.85rem/1 var(--font-body); cursor: pointer;
}
.cookie-notice button:hover { background: var(--surface); }
@media (max-width: 700px) {
  .cookie-notice { left: 10px; right: 80px; bottom: 84px; width: auto; transform: none; padding: 0.5rem 0.5rem 0.5rem 0.75rem; font-size: 0.78rem; }
}
/* Not over the homepage logo intro: it shows once the page is there. */
body.intro-playing .cookie-notice { visibility: hidden; }
