/* PastaDice — design tokens, layout, components. 8px grid throughout. */

@font-face {
  font-family: "Inter";
  src: url("/fonts/inter-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
/* Cyrillic lives in its own file; browsers fetch it only when a page uses it. */
@font-face {
  font-family: "Inter";
  src: url("/fonts/inter-cyrillic-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* Metric-matched fallback so the swap to Inter causes no layout shift. */
@font-face {
  font-family: "Inter Fallback";
  src: local("Arial");
  ascent-override: 90.49%;
  descent-override: 22.56%;
  line-gap-override: 0%;
  size-adjust: 107.06%;
}

:root {
  --ink: #1d1310;
  --ink-2: #43342d;
  --ink-3: #6b5a51;
  --line: rgba(29, 19, 16, 0.09);
  --line-2: rgba(29, 19, 16, 0.16);
  --page: #fffdfa;
  --cream: #fff8ee;
  --cream-2: #fbefdc;
  --paper: #fff;
  --tomato: #e5432a;
  --tomato-600: #d6371f;
  --tomato-700: #b02a15;
  --saffron: #ffb020;
  --basil: #2a8048;
  --gold: #a87c1f;

  --shadow-sm: 0 1px 2px rgba(60, 35, 20, 0.08), 0 1px 1px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 2px 5px -1px rgba(60, 35, 20, 0.14), 0 1px 3px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 13px 27px -5px rgba(60, 35, 20, 0.16), 0 8px 16px -8px rgba(0, 0, 0, 0.18);
  --shadow-xl: 0 50px 100px -20px rgba(60, 35, 20, 0.22), 0 30px 60px -30px rgba(0, 0, 0, 0.26);

  --ease: cubic-bezier(0.215, 0.61, 0.355, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --skew: 7vw;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Inter", "Inter Fallback", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink-2);
  background: var(--page);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg { display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.i {
  flex: none;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.i-fill { fill: currentColor; stroke-width: 1; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-200%);
}
.skip:focus { transform: none; }

:focus-visible {
  outline: 3px solid rgba(229, 67, 42, 0.55);
  outline-offset: 3px;
}

.container {
  width: 100%;
  max-width: 1128px;
  margin: 0 auto;
  padding-inline: 16px;
}

html[data-view="home"] .only-shared,
html[data-view="shared"] .only-home {
  display: none;
}

/* ── Nav ──────────────────────────────────────────────────────────────── */

.nav {
  position: absolute;
  inset: 0 0 auto;
  z-index: 10;
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.03em;
  text-decoration: none;
  border-radius: 8px;
}
.logo-mark {
  width: 26px;
  height: 26px;
  filter: drop-shadow(0 2px 3px rgba(176, 42, 21, 0.3));
  transition: transform 0.5s var(--ease-spring);
}
.logo:hover .logo-mark { transform: rotate(-90deg); }
.nav-links {
  position: relative;
  display: flex;
  align-items: center;
  gap: 20px;
}
.nav-links > a {
  padding: 8px 0;
  color: var(--ink-2);
  font-size: 15px;
  font-weight: 550;
  text-decoration: none;
  border-radius: 6px;
  transition: color 0.2s;
}
.nav-links > a:hover { color: var(--ink); }
.nav-how,
.nav-hide-sm { display: none; }
.nav-links > a { white-space: nowrap; }

.lang { position: relative; }
.lang summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 8px 0 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 0 0 1px var(--line), var(--shadow-sm);
  color: var(--ink);
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.02em;
  list-style: none;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.2s, box-shadow 0.2s;
}
.lang summary::-webkit-details-marker { display: none; }
.lang summary:hover { background: #fff; box-shadow: inset 0 0 0 1px var(--line-2), var(--shadow-md); }
.lang summary .i { width: 16px; height: 16px; }
.lang summary .i-chev { width: 14px; height: 14px; color: var(--ink-3); transition: transform 0.2s var(--ease); }
.lang[open] summary .i-chev { transform: rotate(180deg); }
/* Closed <details> content is still styled by the browser; hiding it outright
   stops non-Russian pages from downloading the Cyrillic font for one menu item. */
.lang:not([open]) .lang-menu { display: none; }
.lang-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 20;
  min-width: 176px;
  padding: 6px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 0 0 1px var(--line), var(--shadow-lg);
  animation: fade-in 0.2s var(--ease) both;
}
.lang-menu a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 12px;
  border-radius: 10px;
  color: var(--ink-2);
  font-size: 15px;
  font-weight: 550;
  text-decoration: none;
  transition: background-color 0.15s, color 0.15s;
}
.lang-menu a:hover { background: var(--cream); color: var(--ink); }
.lang-menu a[aria-current] { color: var(--ink); font-weight: 650; }
.lang-menu a[aria-current]::after {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--tomato);
}
/* "Also in your language" pill. Absolutely placed so it never shifts the nav. */
.lang-hint {
  position: absolute;
  top: 50%;
  right: 76px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 12px 0 14px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
  transform: translateY(-50%);
  animation: hint-in 0.5s var(--ease) both;
}
.lang-hint .i { width: 14px; height: 14px; stroke-width: 2; }
@keyframes hint-in {
  from { opacity: 0; transform: translateY(-50%) translateX(8px); }
  to { opacity: 1; transform: translateY(-50%); }
}

/* ── Hero ─────────────────────────────────────────────────────────────── */

.hero {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  min-height: 100vh;
  min-height: 100svh;
  padding: 96px 0 calc(40px + var(--skew));
}
html[data-view="shared"] .hero {
  min-height: 0;
  padding: 120px 0 calc(72px + var(--skew));
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - var(--skew)), 0 100%);
  background: linear-gradient(120deg, #fff6e6 0%, #ffe0ae 100%);
}
/* The mesh gradient: five soft colour fields drifting on the compositor.
   Transform-only, so it costs no main-thread time and holds 60fps. */
.blob {
  position: absolute;
  width: 62vmax;
  height: 62vmax;
  border-radius: 50%;
  will-change: transform;
  animation: drift-a 22s ease-in-out infinite alternate;
}
.b1 {
  top: -24vmax;
  right: -18vmax;
  background: radial-gradient(closest-side, rgba(244, 88, 58, 0.95), rgba(244, 88, 58, 0.55) 45%, rgba(244, 88, 58, 0));
}
.b2 {
  right: -14vmax;
  bottom: -30vmax;
  background: radial-gradient(closest-side, rgba(255, 176, 32, 0.95), rgba(255, 176, 32, 0.6) 45%, rgba(255, 176, 32, 0));
  animation: drift-b 27s ease-in-out infinite alternate;
}
.b3 {
  top: 8%;
  left: 34%;
  width: 48vmax;
  height: 48vmax;
  background: radial-gradient(closest-side, rgba(255, 205, 150, 0.95), rgba(255, 205, 150, 0.5) 50%, rgba(255, 205, 150, 0));
  animation: drift-c 31s ease-in-out infinite alternate;
}
.b4 {
  bottom: -30vmax;
  left: 16%;
  width: 46vmax;
  height: 46vmax;
  background: radial-gradient(closest-side, rgba(150, 205, 125, 0.8), rgba(150, 205, 125, 0.4) 50%, rgba(150, 205, 125, 0));
  animation: drift-d 25s ease-in-out infinite alternate;
}
.b5 {
  right: 18%;
  bottom: -16vmax;
  width: 40vmax;
  height: 40vmax;
  background: radial-gradient(closest-side, rgba(238, 80, 48, 0.75), rgba(238, 80, 48, 0.35) 50%, rgba(238, 80, 48, 0));
  animation: drift-e 29s ease-in-out infinite alternate;
}
@keyframes drift-a { to { transform: translate3d(-16vmax, 12vmax, 0) scale(1.22); } }
@keyframes drift-b { to { transform: translate3d(-18vmax, -14vmax, 0) scale(1.15); } }
@keyframes drift-c { to { transform: translate3d(12vmax, 12vmax, 0) scale(1.3); } }
@keyframes drift-d { to { transform: translate3d(16vmax, -8vmax, 0) scale(1.25); } }
@keyframes drift-e { to { transform: translate3d(-12vmax, -12vmax, 0) scale(0.85); } }
/* Cream wash behind the copy keeps text contrast high over the moving mesh. */
.hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(255, 249, 238, 0.94) 0%,
    rgba(255, 249, 238, 0.8) 30%,
    rgba(255, 249, 238, 0) 62%
  );
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 32px;
  align-items: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 14px 0 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 0 0 1px var(--line), var(--shadow-sm);
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.005em;
}
.eyebrow-dot {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--tomato);
}
.eyebrow-dot::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1.5px solid var(--tomato);
  opacity: 0;
  animation: ping 2.4s var(--ease) infinite;
}
@keyframes ping {
  0% { transform: scale(0.5); opacity: 0.7; }
  70%, 100% { transform: scale(1.4); opacity: 0; }
}

h1,
.h1 {
  margin-top: 16px;
  color: var(--ink);
  font-size: clamp(2.375rem, 1.5rem + 3.9vw, 4.25rem);
  font-weight: 680;
  line-height: 1.04;
  letter-spacing: -0.042em;
  text-wrap: balance;
  overflow-wrap: break-word;
}
.lede {
  max-width: 32em;
  margin-top: 16px;
  color: var(--ink-2);
  font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.25rem);
  line-height: 1.55;
  letter-spacing: -0.011em;
  text-wrap: pretty;
}
.hero-copy .btn { margin-top: 28px; }

/* ── Buttons ──────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition:
    transform 0.2s var(--ease),
    box-shadow 0.2s var(--ease),
    background-color 0.2s,
    opacity 0.2s;
}
.btn .i { width: 18px; height: 18px; stroke-width: 1.8; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(1px) scale(0.985); transition-duration: 0.06s; }
.btn[disabled] { cursor: default; transform: none; }

.btn-primary {
  color: #fff;
  background: linear-gradient(180deg, #db3c23 0%, #c12d16 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    inset 0 -1px 0 rgba(0, 0, 0, 0.14),
    0 1px 2px rgba(120, 30, 10, 0.35),
    0 10px 24px -8px rgba(193, 45, 22, 0.6);
}
.btn-primary:hover {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    inset 0 -1px 0 rgba(0, 0, 0, 0.14),
    0 2px 4px rgba(120, 30, 10, 0.3),
    0 18px 32px -10px rgba(193, 45, 22, 0.7);
}
.btn-primary:active {
  box-shadow:
    inset 0 2px 4px rgba(0, 0, 0, 0.2),
    0 1px 2px rgba(120, 30, 10, 0.3);
}
.btn-dark {
  color: #fff;
  background: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 16px -8px rgba(29, 19, 16, 0.5);
}
.btn-dark:hover { background: #2c1e19; }
.btn-ghost {
  color: var(--ink);
  background: #fff;
  box-shadow: inset 0 0 0 1px var(--line-2), var(--shadow-sm);
}
.btn-ghost:hover { box-shadow: inset 0 0 0 1px var(--line-2), var(--shadow-md); }
.btn-lg { height: 52px; padding: 0 28px; font-size: 16px; }
.btn-xl { width: 100%; height: 56px; font-size: 18px; font-weight: 650; letter-spacing: -0.015em; }
.btn-xl .i { width: 22px; height: 22px; }

.icon-btn {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-3);
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s, transform 0.2s var(--ease);
}
.icon-btn:hover { background: var(--cream-2); color: var(--ink); }
.icon-btn:active { transform: scale(0.92); }
.icon-btn[aria-pressed="true"] { background: var(--cream-2); color: var(--tomato-700); }
.icon-btn .i { width: 18px; height: 18px; }

/* ── Roller card ──────────────────────────────────────────────────────── */

.roller {
  --die: 96px;
  position: relative;
  padding: 16px 24px 24px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow:
    inset 0 1px 0 #fff,
    0 0 0 1px rgba(29, 19, 16, 0.06),
    var(--shadow-xl);
}
.roller-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 32px;
}
.roller-title {
  color: var(--ink-3);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.stage {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 52px;
  height: calc(var(--die) + 104px);
  padding-bottom: 44px;
  perspective: 900px;
  perspective-origin: 50% 30%;
}
.die-slot {
  position: relative;
  width: var(--die);
  height: var(--die);
  transform-style: preserve-3d;
}
.die-shadow {
  position: absolute;
  left: 4%;
  right: 4%;
  bottom: -30px;
  height: 24px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(70, 35, 12, 0.34), rgba(70, 35, 12, 0));
  transform: translateZ(-60px);
}
.die-lift,
.die-tilt,
.cube {
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
}
.die-lift { will-change: transform; }
.die-tilt { transform: rotateX(-18deg) rotateY(22deg); }
.die-tilt--r { transform: rotateX(-18deg) rotateY(-22deg); }
.cube {
  position: relative;
  transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg);
  will-change: transform;
}

.die--shape {
  --face-a: #fffefb;
  --face-b: #f0e4d0;
  --die-ink: #2a1c16;
  --die-core: #e6d8c2;
}
.die--sauce {
  --face-a: #ee5136;
  --face-b: #c93019;
  --die-ink: #fff8ee;
  --die-core: #bb2b15;
}
.cube.is-gold {
  --face-a: #fbeeb6;
  --face-b: #d0a23a;
  --die-ink: #4a3205;
  --die-core: #b98a2c;
}

.core {
  position: absolute;
  inset: 5%;
  background: var(--die-core);
}
.cx { transform: rotateY(90deg); }
.cy { transform: rotateX(90deg); }

.face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6%;
  border-radius: 17%;
  background: linear-gradient(145deg, var(--face-a), var(--face-b));
  box-shadow:
    inset 0 0 0 1px rgba(60, 30, 10, 0.07),
    inset 0 calc(var(--die) * -0.05) calc(var(--die) * 0.1) rgba(60, 30, 10, 0.1),
    inset 0 calc(var(--die) * 0.04) calc(var(--die) * 0.07) rgba(255, 255, 255, 0.45);
  color: var(--die-ink);
  backface-visibility: hidden;
}
.face .i {
  width: 42%;
  height: 42%;
  stroke-width: 1.45;
}
.face span {
  font-size: calc(var(--die) * 0.092);
  font-weight: 680;
  line-height: 1;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}
.f0 { transform: translateZ(calc(var(--die) / 2)); }
.f1 { transform: rotateY(90deg) translateZ(calc(var(--die) / 2)); }
.f2 { transform: rotateY(180deg) translateZ(calc(var(--die) / 2)); }
.f3 { transform: rotateY(-90deg) translateZ(calc(var(--die) / 2)); }
.f4 { transform: rotateX(90deg) translateZ(calc(var(--die) / 2)); }
.f5 { transform: rotateX(-90deg) translateZ(calc(var(--die) / 2)); }

.die-lift.shake { animation: shake 0.34s linear infinite; }
@keyframes shake {
  0%, 100% { transform: translate3d(0, -8px, 0) rotate(0deg); }
  25% { transform: translate3d(-3px, -14px, 0) rotate(-6deg); }
  50% { transform: translate3d(2px, -9px, 0) rotate(5deg); }
  75% { transform: translate3d(-2px, -15px, 0) rotate(-4deg); }
}

.captions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: end;
  gap: 8px;
  text-align: center;
}
.caption { margin: 0; }
.caption-k {
  display: block;
  color: var(--ink-3);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.08em;
  line-height: 16px;
  text-transform: uppercase;
}
.caption-v {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 17px;
  font-weight: 650;
  line-height: 24px;
  letter-spacing: -0.02em;
  white-space: nowrap;
  text-overflow: ellipsis;
  transition: color 0.3s;
}
.caption-v.is-empty { color: rgba(29, 19, 16, 0.28); }
.caption-v.is-gold { color: var(--gold); }
.caption-v.pop { animation: pop 0.5s var(--ease-spring) both; }
@keyframes pop {
  from { transform: translateY(6px) scale(0.92); opacity: 0; }
  to { transform: none; opacity: 1; }
}
.caption-plus {
  color: rgba(29, 19, 16, 0.28);
  font-size: 17px;
  font-weight: 500;
  line-height: 24px;
}

.action {
  position: relative;
  height: 56px;
  margin-top: 20px;
}
.wait {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  height: 56px;
  padding: 0 8px 0 22px;
  border-radius: 999px;
  background: var(--cream);
  box-shadow: inset 0 0 0 1px var(--line);
  overflow: hidden;
  animation: fade-in 0.5s var(--ease) both;
}
.wait-clock {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.wait-label {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--ink-3);
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: 0.08em;
  line-height: 14px;
  text-transform: uppercase;
}
.wait-time {
  color: var(--ink);
  font-size: 21px;
  font-weight: 650;
  line-height: 24px;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.wait .btn { height: 40px; padding: 0 16px 0 18px; }
.wait-bar {
  position: absolute;
  inset: auto 0 0;
  height: 2px;
  background: rgba(29, 19, 16, 0.06);
}
.wait-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--saffron), var(--tomato));
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform 1s linear;
}
@keyframes fade-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

.tagline {
  min-height: 20px;
  margin-top: 14px;
  color: var(--ink-3);
  font-size: 14px;
  line-height: 20px;
  text-align: center;
  letter-spacing: -0.005em;
}
.tagline.is-error { color: var(--tomato-700); font-weight: 550; }

/* ── Recipe ───────────────────────────────────────────────────────────── */

.result {
  position: relative;
  z-index: 2;
  margin-top: calc(var(--skew) * -0.7);
  padding-bottom: 32px;
  scroll-margin-top: 16px;
}
html[data-view="shared"] .result { min-height: 100vh; min-height: 100svh; }
.result.enter .recipe-frame { animation: rise 0.9s var(--ease) both; }
@keyframes rise {
  from { opacity: 0; transform: translateY(32px); }
  to { opacity: 1; transform: none; }
}

.recipe-frame { border-radius: 28px; }
.recipe {
  overflow: hidden;
  border-radius: 28px;
  background: var(--paper);
  box-shadow: 0 0 0 1px var(--line), var(--shadow-xl);
}

.recipe-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}
.recipe-media {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--cream-2);
}
.recipe-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.recipe-intro {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 28px 24px 32px;
}
.kicker {
  color: var(--tomato-700);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.08em;
  line-height: 16px;
  text-transform: uppercase;
}
.recipe h2 {
  margin-top: 12px;
  color: var(--ink);
  font-size: clamp(1.875rem, 1.45rem + 1.9vw, 2.75rem);
  font-weight: 680;
  line-height: 1.08;
  letter-spacing: -0.036em;
  text-wrap: balance;
  outline: none;
}
.recipe-lede {
  margin-top: 16px;
  color: var(--ink-2);
  font-size: 17px;
  line-height: 1.6;
  letter-spacing: -0.011em;
  text-wrap: pretty;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px 0 10px;
  border-radius: 999px;
  background: var(--cream);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.005em;
}
.chip .i { width: 16px; height: 16px; color: var(--tomato-700); stroke-width: 1.8; }
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin-top: 16px;
  color: var(--ink-3);
  font-size: 13px;
  font-weight: 500;
}
.recipe-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 28px;
}
.recipe-actions .btn { min-width: 132px; }
.btn.is-done { color: #fff; background: var(--basil); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), var(--shadow-sm); }

.recipe-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  border-top: 1px solid var(--line);
}
.recipe-col { padding: 32px 24px; }
.recipe-col + .recipe-col { border-top: 1px solid var(--line); }
.recipe-col h3 {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  color: var(--ink);
  font-size: 20px;
  font-weight: 650;
  line-height: 28px;
  letter-spacing: -0.022em;
}
.recipe-col h3 small {
  color: var(--ink-3);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}

.ingredients { margin-top: 12px; }
.ingredients li + li { border-top: 1px solid var(--line); }
.check {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.check input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}
.check-box {
  flex: none;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin-top: 1px;
  border-radius: 7px;
  background: #fff;
  box-shadow: inset 0 0 0 1.5px var(--line-2), var(--shadow-sm);
  color: #fff;
  transition: background-color 0.2s, box-shadow 0.2s, transform 0.25s var(--ease-spring);
}
.check-box .i {
  width: 14px;
  height: 14px;
  stroke-width: 3;
  stroke-dasharray: 24;
  stroke-dashoffset: 24;
  transition: stroke-dashoffset 0.25s var(--ease) 0.05s;
}
.check:hover .check-box { box-shadow: inset 0 0 0 1.5px var(--ink-3), var(--shadow-sm); }
.check input:focus-visible + .check-box { outline: 3px solid rgba(229, 67, 42, 0.55); outline-offset: 2px; }
.check input:checked + .check-box {
  background: var(--basil);
  box-shadow: inset 0 0 0 1.5px var(--basil);
  transform: scale(1.06);
}
.check input:checked + .check-box .i { stroke-dashoffset: 0; }
.check-text {
  color: var(--ink-2);
  font-size: 16px;
  line-height: 24px;
  letter-spacing: -0.011em;
  transition: color 0.2s;
}
.check-text b { color: var(--ink); font-weight: 650; }
.check input:checked ~ .check-text,
.check input:checked ~ .check-text b {
  color: var(--ink-3);
  text-decoration: line-through;
  text-decoration-color: rgba(29, 19, 16, 0.3);
}

.steps {
  margin-top: 20px;
  counter-reset: step;
}
.steps li {
  position: relative;
  min-height: 32px;
  padding: 3px 0 24px 48px;
  counter-increment: step;
  color: var(--ink-2);
  font-size: 16px;
  line-height: 1.65;
  letter-spacing: -0.011em;
  text-wrap: pretty;
}
.steps li:last-child { padding-bottom: 0; }
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--cream);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--tomato-700);
  font-size: 14px;
  font-weight: 680;
  font-variant-numeric: tabular-nums;
}
.steps li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 15.5px;
  top: 40px;
  bottom: 8px;
  width: 1px;
  background: var(--line);
}

/* Bottom band: countdown (home) or "your turn" (shared). */
.band {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
  align-items: center;
  padding: 32px 24px;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, var(--cream), #fff);
}
.band h3 {
  color: var(--ink);
  font-size: 20px;
  font-weight: 650;
  line-height: 28px;
  letter-spacing: -0.022em;
}
.band p {
  margin-top: 4px;
  color: var(--ink-3);
  font-size: 15px;
  line-height: 24px;
}
.band-bar {
  position: absolute;
  inset: -1px 0 auto;
  height: 2px;
}
.band-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--saffron), var(--tomato));
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform 1s linear;
}
.clock {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.clock-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.clock-num {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: #fff;
  box-shadow: inset 0 0 0 1px var(--line), inset 0 -2px 0 rgba(29, 19, 16, 0.04), var(--shadow-md);
  color: var(--ink);
  font-size: 30px;
  font-weight: 650;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.clock-unit {
  color: var(--ink-3);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.clock-sep {
  color: rgba(29, 19, 16, 0.25);
  font-size: 26px;
  font-weight: 600;
  line-height: 62px;
}

/* Legendary roll: a quiet gold frame, a slow shimmer, nothing more. */
.recipe-frame.is-legendary {
  padding: 3px;
  background: linear-gradient(
    90deg,
    #b98a2c 0%, #f1d98c 12.5%, #c79b35 25%, #fff3cc 37.5%,
    #b98a2c 50%, #f1d98c 62.5%, #c79b35 75%, #fff3cc 87.5%, #b98a2c 100%
  );
  background-size: 200% 100%;
  box-shadow: 0 0 0 1px rgba(150, 110, 25, 0.25), 0 40px 100px -30px rgba(190, 145, 40, 0.6);
  animation: gold-pan 9s linear infinite;
}
.result.enter .recipe-frame.is-legendary { animation: rise 0.9s var(--ease) both, gold-pan 9s linear infinite; }
.recipe-frame.is-legendary .recipe { border-radius: 25px; }
.recipe-frame.is-legendary .kicker { color: var(--gold); }
@keyframes gold-pan {
  to { background-position: 100% 0; }
}
.legend-badge {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 14px 0 10px;
  border-radius: 999px;
  background: linear-gradient(180deg, #fff6d6, #f0d483);
  box-shadow: inset 0 0 0 1px rgba(150, 110, 25, 0.35), 0 6px 16px -6px rgba(60, 40, 0, 0.5);
  color: #4a3205;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: -0.005em;
}
.legend-badge .i { width: 16px; height: 16px; color: #a87c1f; }
.recipe-frame.is-legendary .recipe-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, rgba(255, 244, 204, 0) 40%, rgba(255, 244, 204, 0.5) 50%, rgba(255, 244, 204, 0) 60%);
  transform: translateX(-100%);
  animation: sheen 6s var(--ease) 0.8s infinite;
}
@keyframes sheen {
  0% { transform: translateX(-100%); }
  28%, 100% { transform: translateX(100%); }
}

/* ── How it works ─────────────────────────────────────────────────────── */

.how { padding: 72px 0 80px; }
.how h2 {
  max-width: 16em;
  margin-top: 12px;
  color: var(--ink);
  font-size: clamp(1.75rem, 1.4rem + 1.6vw, 2.5rem);
  font-weight: 680;
  line-height: 1.1;
  letter-spacing: -0.035em;
  text-wrap: balance;
}
.how-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  margin-top: 40px;
}
.card {
  padding: 24px;
  border-radius: 20px;
  background: var(--paper);
  box-shadow: 0 0 0 1px var(--line), var(--shadow-md);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 0 0 1px var(--line), var(--shadow-lg);
}
.card-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--cream);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--tomato-700);
}
.card-icon .i { width: 22px; height: 22px; }
.card h3 {
  margin-top: 20px;
  color: var(--ink);
  font-size: 18px;
  font-weight: 650;
  line-height: 24px;
  letter-spacing: -0.02em;
}
.card p {
  margin-top: 8px;
  color: var(--ink-2);
  font-size: 15px;
  line-height: 24px;
  letter-spacing: -0.006em;
}

.faces {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 32px;
  margin-top: 16px;
  padding: 24px;
  border-radius: 20px;
  background: var(--paper);
  box-shadow: 0 0 0 1px var(--line), var(--shadow-md);
  scroll-margin-top: 24px;
}
.faces-title {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.012em;
}
.swatch {
  width: 16px;
  height: 16px;
  border-radius: 5px;
  box-shadow: inset 0 0 0 1px rgba(29, 19, 16, 0.12), var(--shadow-sm);
}
.swatch--ivory { background: linear-gradient(145deg, #fffefb, #eadcc5); }
.swatch--tomato { background: linear-gradient(145deg, #ee5136, #c93019); }
.tiles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 16px;
}
.tiles li {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 4px 12px;
  border-radius: 14px;
  background: var(--cream);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.008em;
  text-align: center;
  white-space: nowrap;
}
.tiles .i { width: 28px; height: 28px; stroke-width: 1.4; }
.faces-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 15px;
  line-height: 24px;
}
.faces-note .i { margin-top: 2px; color: #c79b35; }
.faces-note strong { color: var(--ink); font-weight: 650; }

/* ── Footer ───────────────────────────────────────────────────────────── */

.footer {
  border-top: 1px solid var(--line);
  background: var(--cream);
}
.footer-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
  padding-top: 40px;
  padding-bottom: calc(40px + env(safe-area-inset-bottom));
}
.footer-note {
  max-width: 46ch;
  color: var(--ink-3);
  font-size: 13px;
  line-height: 20px;
}

/* ── 404 ──────────────────────────────────────────────────────────────── */

.lost {
  display: grid;
  place-items: center;
  min-height: 100vh;
  min-height: 100svh;
  padding: 96px 0;
  text-align: center;
}
.lost .lede { margin-inline: auto; }

/* ── Breakpoints ──────────────────────────────────────────────────────── */

@media (min-width: 480px) {
  .container { padding-inline: 24px; }
  .roller { --die: 108px; padding: 20px 32px 32px; }
  .stage { gap: 68px; }
  .nav-how { display: block; }
  .nav-links { gap: 24px; }
  .lang-hint { right: calc(100% + 16px); }
}

@media (min-width: 720px) {
  .nav-hide-sm { display: block; }
  .how { padding: 104px 0 112px; }
  .how-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
  .card { padding: 32px; }
  .faces { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 40px; margin-top: 24px; padding: 32px; }
  .faces-note { grid-column: 1 / -1; }
  .footer-inner { grid-template-columns: minmax(0, 1fr) auto; align-items: start; padding-block: 48px calc(48px + env(safe-area-inset-bottom)); }
  .band { grid-template-columns: minmax(0, 1fr) auto; padding: 40px 48px; }
  .recipe-intro { padding: 40px 48px 48px; }
  .recipe-col { padding: 40px 48px; }
  .recipe-media { aspect-ratio: 16 / 9; }
}

@media (min-width: 960px) {
  .hero { padding: 120px 0 calc(72px + var(--skew)); }
  .hero-grid { grid-template-columns: minmax(0, 1fr) 432px; gap: 72px; }
  html[data-view="shared"] .hero-grid { grid-template-columns: minmax(0, 720px); }
  .hero-bg::after {
    background: linear-gradient(
      100deg,
      rgba(255, 249, 238, 0.95) 0%,
      rgba(255, 249, 238, 0.82) 32%,
      rgba(255, 249, 238, 0) 64%
    );
  }
  .lede { margin-top: 24px; }
  .roller { --die: 112px; }

  .recipe-head { grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr); }
  .recipe-media { aspect-ratio: auto; min-height: 480px; }
  .recipe-intro { justify-content: center; padding: 56px; }
  .recipe-body { grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr); }
  .recipe-col { padding: 48px 56px; }
  .recipe-col + .recipe-col { border-top: 0; border-left: 1px solid var(--line); }
  .band { padding: 40px 56px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0s !important;
    transition-duration: 0.001ms !important;
  }
  .recipe-frame.is-legendary .recipe-media::after { display: none; }
}
