/* Styles for the extras in fx.js. Every block only applies while its switch
   there is on (html gets the class fx-<name>), so turning one off in fx.js
   removes it completely. */

/* ── FX-1 rings and crumbs (fx-rings) ───────────────────────── */
.fx-rings .fx-bit { position: absolute; pointer-events: none; display: block; }
/* a wet ring: dark edge, a thin shine inside it, damp just within; part of it has dried away */
.fx-rings .fx-ring {
  inset: 2%; translate: var(--fx-rx, 6%) var(--fx-ry, 7%); border-radius: 50%;
  border: 2px solid rgb(22 10 3 / .34);
  background: radial-gradient(closest-side, transparent 84%, rgb(22 10 3 / .13) 95%, transparent 100%);
  box-shadow: inset 0 0 0 1px rgb(255 240 215 / .09), 0 0 6px rgb(22 10 3 / .2);
  -webkit-mask: conic-gradient(from var(--fx-rr, 0deg), #000 0 var(--fx-ra, 280deg), transparent 0);
  mask: conic-gradient(from var(--fx-rr, 0deg), #000 0 var(--fx-ra, 280deg), transparent 0);
}
.fx-rings .fx-ring--old { border-width: 1px; opacity: .55; background: none; }
.fx-rings .fx-ring.fx-amber { border-color: rgb(150 82 20 / .5); box-shadow: inset 0 0 0 1px rgb(255 200 120 / .12), 0 0 6px rgb(120 60 10 / .3); }
.fx-rings .fx-crumbs { left: 0; top: 0; width: 2px; height: 2px; border-radius: 50%; box-shadow: var(--fx-crumbs); }
/* what was left beside a section title */
.fx-rings .world__title { position: relative; }
.fx-rings .fx-left { width: 4.6rem; height: 4.6rem; }
.fx-rings .fx-left .fx-ring { inset: 0; opacity: .85; }
.fx-rings .fx-left--whiskey { width: 3.4rem; height: 3.4rem; }
html:not(.fx-rings) .fx-bit { display: none; }

/* ── FX-2 time of day (fx-daylight + fx-light-…) ────────────── */
.fx-daylight body::after {
  content: ""; position: fixed; z-index: -1; top: 0; left: 0; width: 100%; height: 100vh; height: 100lvh;
  pointer-events: none; opacity: 0; transition: opacity 2s ease;
}
.fx-daylight.fx-light-day body::after {
  opacity: 1; background: radial-gradient(130% 75% at 50% -12%, rgb(255 250 232 / .27), transparent 64%);
}
.fx-daylight.fx-light-evening body::after {
  opacity: 1; background: radial-gradient(95% 65% at 88% -5%, rgb(255 168 78 / .3), transparent 68%),
    linear-gradient(rgb(40 14 0 / .17), rgb(40 14 0 / .17));
}
.fx-daylight.fx-light-night body::after {
  opacity: 1; background: radial-gradient(70% 42% at 50% 30%, rgb(255 184 96 / .17), transparent 72%),
    linear-gradient(rgb(12 5 0 / .42), rgb(12 5 0 / .42));
  animation: fx-candle 5.5s ease-in-out infinite;
}
@keyframes fx-candle { 0%, 100% { opacity: 1; } 22% { opacity: .9; } 38% { opacity: .97; } 61% { opacity: .86; } 80% { opacity: .95; } }

/* ── FX-3 mats flip to open (fx-flip) ───────────────────────── */
.fx-flip .matw { perspective: 700px; }
.fx-flip .mat.fx-flipping { animation: fx-flip-out .18s ease-in forwards; }
@keyframes fx-flip-out { to { rotate: y 90deg; } }
.fx-flip .panel { perspective: 1400px; perspective-origin: var(--x, 50%) var(--y, 50%); }
.fx-flip .panel::before {
  transform: none; rotate: y -90deg; scale: var(--s0, .1);
  transition: scale .4s var(--glide), rotate .2s ease-in .2s;
}
.fx-flip .panel.is-open::before {
  transform: none; rotate: y 0deg; scale: 1;
  transition: rotate .34s ease-out .16s, scale .6s var(--glide) .16s;
}
.fx-flip .panel.is-open .panel__in { transition-delay: .42s; }

/* ── FX-4 tilt (fx-tilt) ────────────────────────────────────── */
.fx-tilt .mat { translate: calc(var(--fx-tx, 0) * 4px) calc(var(--fx-ty, 0) * 4px); }
.fx-tilt .mat__photo { translate: calc(var(--fx-tx, 0) * 3px) calc(var(--fx-ty, 0) * 3px); }
.fx-tilt .mat {
  box-shadow: inset 0 0 0 1px rgb(44 24 12 / .3),
    calc(var(--fx-tx, 0) * -5px) calc(8px - var(--fx-ty, 0) * 4px) 0 -4px rgb(0 0 0 / .35),
    calc(var(--fx-tx, 0) * -12px) calc(18px - var(--fx-ty, 0) * 9px) 24px -8px rgb(0 0 0 / .6);
}
.fx-tilt .mat--food {
  box-shadow: inset 0 0 0 1px rgb(0 0 0 / .08), inset 0 -6px 10px -4px rgb(0 0 0 / .12),
    calc(var(--fx-tx, 0) * -5px) calc(10px - var(--fx-ty, 0) * 4px) 0 -4px rgb(0 0 0 / .3),
    calc(var(--fx-tx, 0) * -14px) calc(22px - var(--fx-ty, 0) * 10px) 28px -8px rgb(0 0 0 / .65);
}
.fx-tilt .mat--whiskey {
  box-shadow: inset 0 0 0 1px rgb(246 227 191 / .22),
    calc(var(--fx-tx, 0) * -5px) calc(8px - var(--fx-ty, 0) * 4px) 0 -4px rgb(0 0 0 / .4),
    calc(var(--fx-tx, 0) * -12px) calc(18px - var(--fx-ty, 0) * 9px) 24px -8px rgb(0 0 0 / .65);
}

/* ── FX-5 "New" as a hand-written tag (fx-newtag) ───────────── */
@font-face { font-family: "Caveat"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("/shared/fonts/caveat-600-latin.woff2") format("woff2"); }
.fx-newtag .hm-tag.hm-tag--new {
  font: 600 1.1875rem/1 "Caveat", "Segoe Print", "Bradley Hand", cursive; letter-spacing: .01em;
  color: #3a2113; border: 0; border-radius: 2px; padding: .2rem .6rem .25rem 1.2rem;
  background: radial-gradient(circle at .62rem 50%, rgb(40 20 8 / .75) 0 .12rem, transparent .15rem), #f3e3bc;
  -webkit-clip-path: polygon(.55rem 0, 100% 0, 100% 100%, .55rem 100%, 0 50%);
  clip-path: polygon(.55rem 0, 100% 0, 100% 100%, .55rem 100%, 0 50%);
  transform-origin: .62rem 50%; rotate: -5deg;
  animation: fx-swing 1.5s ease-out .55s 1 backwards;
}
.fx-newtag .hm-tags:has(.hm-tag--new) { align-items: center; filter: drop-shadow(0 1px 1px rgb(0 0 0 / .35)); }
@keyframes fx-swing { 0% { rotate: 24deg; } 25% { rotate: -19deg; } 50% { rotate: 6deg; } 75% { rotate: -9deg; } 100% { rotate: -5deg; } }

/* ── FX-6 swipe between items (fx-swipe) ────────────────────── */
.fx-swipe .hm-sheet:not(.ed) .hm-sheet__in { touch-action: pan-y; }
.fx-swipe .hm-sheet:not(.ed) .hm-sheet__fig { -webkit-user-select: none; user-select: none; }
.fx-swipe .hm-sheet:not(.ed) .hm-sheet__fig img { -webkit-user-drag: none; }

/* ── FX-7 Guinness settle (fx-settle) ───────────────────────── */
@property --fx-sbg { syntax: "<color>"; inherits: true; initial-value: #120b08; }
@property --fx-sink { syntax: "<color>"; inherits: true; initial-value: #f3e6cb; }
@property --fx-smuted { syntax: "<color>"; inherits: true; initial-value: #cbb48e; }
@property --fx-head { syntax: "<length>"; inherits: true; initial-value: 4.5rem; }
.fx-settle .panel.fx-stout {
  --fx-sbg: #120b08; --fx-sink: #f3e6cb; --fx-smuted: #cbb48e; --fx-head: 4.5rem;
  --bg: var(--fx-sbg); --ink: var(--fx-sink); --muted: var(--fx-smuted); --line: rgb(243 230 203 / .22);
  --accent: #f3e6cb; --on-accent: #120b08; --ruby: #f0b7a4; --tag-ink: #120b08;
}
/* the head: cream across the top, scrolling away with the page */
.fx-settle .panel.fx-stout .panel__in {
  background: linear-gradient(#f1e3c4, #f1e3c4 calc(var(--fx-head) - .7rem), rgb(226 205 165 / .6) calc(var(--fx-head) - .25rem), rgb(226 205 165 / 0) var(--fx-head)) local no-repeat;
}
.fx-settle .panel.fx-stout .panel__back { --tk-fill: #120b08; --tk-line: #8d8272; color: #f3e6cb; }
/* first opening of a visit: tan settles to black, the head gathers */
.fx-settle .panel.fx-stout.fx-pour { animation: fx-pour 2.6s cubic-bezier(.5, 0, .3, 1) .3s both; }
@keyframes fx-pour {
  0% { --fx-sbg: #b98a5c; --fx-sink: #2c180c; --fx-smuted: #4a2e1a; --fx-head: 0rem; }
  35% { --fx-sbg: #8a6240; --fx-sink: #2c180c; --fx-smuted: #4a2e1a; --fx-head: 1.2rem; }
  55% { --fx-sbg: #4b301c; --fx-sink: #f3e6cb; --fx-smuted: #cbb48e; }
  100% { --fx-sbg: #120b08; --fx-sink: #f3e6cb; --fx-smuted: #cbb48e; --fx-head: 4.5rem; }
}

/* ── FX-8 candle at night (fx-candle) ───────────────────────── */
.fx-tealight { display: none; }
.fx-candle .top { position: relative; overflow-x: clip; }
.fx-candle.fx-light-night .fx-tealight {
  display: block; position: absolute; right: max(1rem, 50% - 11.5rem); top: 2.6rem; width: 2.6rem; pointer-events: none;
}
.fx-candle .fx-tealight img { display: block; width: 100%; height: auto; filter: brightness(.82) sepia(.35); }
.fx-candle .fx-tealight__flame {
  position: absolute; left: 54%; bottom: 76%; width: .55rem; height: 1.05rem; translate: -50% 0;
  border-radius: 50% 50% 50% 50% / 68% 68% 32% 32%; transform-origin: 50% 100%;
  background: radial-gradient(60% 55% at 50% 72%, #fff7d6 0 30%, #ffc94a 55%, #ff8a1e 82%, rgb(255 110 20 / 0) 100%);
  filter: blur(.3px); animation: fx-flame 1.9s ease-in-out infinite;
}
/* the glow stops at the candle's right-hand margin: a box sticking out past the edge of the
   screen makes phones widen the whole page (popups cut off, page zooms out) */
.fx-candle .fx-tealight__glow {
  position: absolute; right: -1rem; bottom: 60%; width: 7.9rem; height: 11rem; translate: 0 50%;
  background: radial-gradient(circle 5.5rem at calc(100% - 2.4rem) 50%, rgb(255 190 96 / .34), rgb(255 170 70 / .12) 45%, transparent 72%);
  mix-blend-mode: screen; animation: fx-glow 4.3s ease-in-out infinite;
}
@keyframes fx-flame {
  0%, 100% { transform: scale(1, 1) rotate(-2deg); } 20% { transform: scale(.94, 1.08) rotate(3deg); }
  45% { transform: scale(1.05, .93) rotate(-4deg); } 70% { transform: scale(.97, 1.05) rotate(2deg); }
}
@keyframes fx-glow { 0%, 100% { opacity: 1; } 27% { opacity: .8; } 44% { opacity: .95; } 68% { opacity: .74; } 85% { opacity: .92; } }

/* ── FX-9 mats land on the table (fx-landing) ───────────────── */
.fx-landing .mat.hm-reveal { opacity: 0; transform: none; }
.fx-landing .mat.hm-reveal.is-in {
  opacity: 1; animation: fx-land .6s cubic-bezier(.22, 1, .36, 1) calc(var(--i, 0) * 70ms) backwards;
}
@keyframes fx-land {
  /* subtle since 2026-11-15: a short drop and a slight turn, one soft settle, no bounce */
  0% { opacity: 0; transform: translateY(-22px) scale(1.1) rotate(calc(var(--s, 1) * -9deg)); }
  40% { opacity: 1; }
  75% { transform: translateY(0) scale(.99) rotate(calc(var(--s, 1) * 1deg)); }
  100% { transform: none; }
}
/* FX-9 on phones (two columns, since 2026-11-15): left mats slide in from the
   left, right mats from the right, each rolling a few degrees as it arrives.
   --s is 1 for the left column and -1 for the right (style.css). */
@media (max-width: 719.98px) {
  .fx-landing .mat.hm-reveal.is-in { animation-name: fx-land-side; }
}
@keyframes fx-land-side {
  0% { opacity: 0; transform: translateX(calc(var(--s, 1) * -44px)) rotate(calc(var(--s, 1) * -8deg)); }
  45% { opacity: 1; }
  100% { transform: none; }
}

/* ── FX-10 table clutter (fx-clutter) ───────────────────────── */
/* everything left on the table lies under the mats and plates, never on top of them */
.fx-clutter .matw, .fx-rings .matw { z-index: 1; }
.fx-clutter .mats { position: relative; }
.fx-clutter .mats > .fx-spot { position: absolute; pointer-events: none; translate: none; }
.fx-thing { position: absolute; display: block; height: auto; pointer-events: none; filter: drop-shadow(0 2px 0 rgb(0 0 0 / .3)) drop-shadow(0 5px 6px rgb(0 0 0 / .4)); }
.fx-thing--pack { width: 60%; }
.fx-thing--lighter { width: 21%; }
.fx-thing--cap { width: 1.7rem; filter: drop-shadow(0 2px 2px rgb(0 0 0 / .55)) brightness(.85); }
.fx-spot--cell .fx-thing--pack { width: 74%; }
html:not(.fx-clutter) .fx-thing, html:not(.fx-clutter) .mats > .fx-spot { display: none; }

@media (prefers-reduced-motion: reduce) {
  .fx-daylight.fx-light-night body::after, .fx-newtag .hm-tag.hm-tag--new,
  .fx-candle .fx-tealight__flame, .fx-candle .fx-tealight__glow, .fx-landing .mat.hm-reveal.is-in { animation: none; }
}
