/* Koyo · Komorebi — base, componentes compartidos y movimiento */

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  background: var(--paper);
}
body {
  min-height: 100dvh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.6;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
img { height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: not-allowed; }
a { color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; }
ul, ol { list-style: none; padding: 0; }
fieldset { border: 0; padding: 0; min-width: 0; }
legend { padding: 0; }
table { border-collapse: collapse; }
[hidden] { display: none !important; }
::selection { background: var(--clay-wash); color: var(--ink); }

:focus-visible {
  outline: 2.5px solid var(--clay);
  outline-offset: 3px;
  border-radius: 10px;
}
[data-theme="dark"] :focus-visible { outline-color: var(--clay-soft); }

/* Los títulos reciben foco por programa al cambiar de pantalla (lectores de pantalla); no son interactivos. */
:is(h1, h2, .view)[tabindex="-1"]:focus { outline: none; }

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; left: 16px; top: -60px; z-index: 100;
  padding: 10px 18px; border-radius: var(--r-pill);
  background: var(--ink); color: var(--paper); font-weight: 700;
  transition: top var(--t-comp) var(--ease);
}
.skip-link:focus { top: 12px; }
.noscript { padding: 40px; text-align: center; }

/* ── Tipografía ─────────────────────────────────────────────── */

.display, .h1, .h2, .h3 {
  font-family: var(--font-display);
  font-weight: 750;
  letter-spacing: -0.035em;
  line-height: 1.02;
  text-wrap: balance;
}
.display { font-size: var(--fs-display); font-weight: 800; letter-spacing: -0.045em; line-height: 0.96; }
.h1 { font-size: var(--fs-h1); }
.h2 { font-size: var(--fs-h2); letter-spacing: -0.03em; line-height: 1.1; }
.h3 { font-size: var(--fs-h3); letter-spacing: -0.02em; line-height: 1.2; font-weight: 700; }
.block, .display-line { display: block; }
.accent {
  font-style: italic;
  font-weight: 750;
  color: var(--clay);
  letter-spacing: -0.04em;
  padding-right: 0.06em;
}
.lead { font-size: clamp(1.02rem, 0.95rem + 0.3vw, 1.2rem); color: var(--ink-soft); max-width: 34ch; line-height: 1.6; text-wrap: pretty; }
.muted { color: var(--ink-soft); }
.micro {
  font-size: var(--fs-micro);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--ink-soft);
}
.mono { font-family: var(--font-mono); font-feature-settings: "zero"; letter-spacing: -0.01em; }
.kr { font-family: var(--font-kr); letter-spacing: 0; font-style: normal; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 12px;
  font-size: var(--fs-micro); letter-spacing: 0.16em; text-transform: uppercase;
  font-weight: 700; color: var(--clay);
}
.eyebrow-line { width: 28px; height: 1.5px; background: currentColor; border-radius: 2px; }
.icon { width: 22px; height: 22px; flex: none; }

/* ── Botones ────────────────────────────────────────────────── */

.cta {
  --pad: 14px 22px;
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  min-height: 52px; padding: var(--pad);
  border-radius: var(--r-pill);
  background: var(--cta);
  color: #fff;
  font-family: var(--font-display); font-weight: 700; font-size: 1rem; letter-spacing: -0.01em;
  box-shadow: 0 14px 30px -12px rgba(153, 70, 42, 0.55);
  transition: transform var(--t-micro) var(--ease), box-shadow var(--t-comp) var(--ease), filter var(--t-comp) var(--ease);
  isolation: isolate;
  overflow: hidden;
}
.cta::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.28) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform 900ms var(--ease);
}
.cta:hover::after { transform: translateX(120%); }
.cta:hover { box-shadow: 0 18px 38px -12px rgba(153, 70, 42, 0.65); }
.cta:active { transform: scale(0.97); }
.cta:disabled { filter: grayscale(1) opacity(0.45); box-shadow: none; }
.cta .icon { width: 20px; height: 20px; }
.cta--lg { min-height: 60px; font-size: 1.06rem; --pad: 16px 18px 16px 28px; }
.cta--xl { min-height: 72px; font-size: 1.2rem; --pad: 18px 18px 18px 34px; gap: 22px; }
.cta--block { width: 100%; }
.cta-orb {
  display: grid; place-items: center;
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  transition: transform var(--t-comp) var(--ease);
}
.cta--xl .cta-orb { width: 48px; height: 48px; }
.cta:hover .cta-orb { transform: translateX(4px); }

.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 12px 20px; border-radius: var(--r-pill);
  font-weight: 700; font-family: var(--font-display); letter-spacing: -0.01em;
  transition: background var(--t-comp) var(--ease), transform var(--t-micro) var(--ease);
}
.button:active { transform: scale(0.97); }
.button--ghost { background: var(--paper-high); color: var(--ink); }
.button--ghost:hover { background: var(--paper-max); }
.button--paper { background: var(--sun); color: var(--ink); box-shadow: var(--shadow); flex: 1; }
.button--paper:hover { background: var(--paper); }

.icon-button {
  display: grid; place-items: center;
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--paper-high);
  transition: background var(--t-comp) var(--ease), transform var(--t-micro) var(--ease);
}
.icon-button:hover { background: var(--paper-max); }
.icon-button:active { transform: scale(0.94); }

.pill-back {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 8px 18px 8px 12px; border-radius: var(--r-pill);
  background: var(--paper-high); font-weight: 700; font-size: var(--fs-sm);
  transition: background var(--t-comp) var(--ease), transform var(--t-micro) var(--ease);
}
.pill-back:hover { background: var(--paper-max); }
.pill-back:active { transform: scale(0.96); }
.pill-back .icon { width: 18px; height: 18px; transition: transform var(--t-comp) var(--ease); }
.pill-back:hover .icon { transform: translateX(-3px); }

.text-link {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 40px; font-weight: 700; font-size: var(--fs-sm); color: var(--clay);
  text-underline-offset: 4px;
}
.text-link:hover { text-decoration: underline; }
.text-link .icon { width: 17px; height: 17px; }
.text-link--small { min-height: 32px; font-size: 0.78rem; color: var(--ink-soft); margin-left: auto; }

.chip-link {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 36px; padding: 6px 14px; border-radius: var(--r-pill);
  background: var(--paper-high); font-size: 0.8rem; font-weight: 700;
  transition: background var(--t-comp) var(--ease);
}
.chip-link:hover { background: var(--paper-max); }
.chip-link .icon { width: 15px; height: 15px; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: var(--r-pill);
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.02em;
}
.chip .icon { width: 14px; height: 14px; }
.chip--matcha { background: var(--leaf); color: var(--matcha); }
.chip--leaf { background: var(--leaf); color: var(--matcha); }

/* ── Controles ──────────────────────────────────────────────── */

.stepper {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px; border-radius: var(--r-pill); background: var(--paper-high);
}
.step-btn {
  display: grid; place-items: center;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--sun); box-shadow: 0 2px 6px rgba(29, 28, 19, 0.06);
  transition: transform var(--t-micro) var(--ease), background var(--t-comp) var(--ease);
}
.step-btn:hover { background: var(--paper); }
.step-btn:active { transform: scale(0.9); }
.step-btn:disabled { opacity: 0.35; box-shadow: none; }
.step-btn .icon { width: 18px; height: 18px; }
.qty-value { min-width: 34px; text-align: center; font-weight: 600; font-size: 1.05rem; }
.stepper--sm .step-btn { width: 38px; height: 38px; }
.stepper--sm .qty-value { min-width: 28px; font-size: 0.95rem; }

.switch-input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch {
  position: relative; flex: none;
  width: 54px; height: 32px; border-radius: var(--r-pill);
  background: var(--paper-max);
  transition: background var(--t-comp) var(--ease);
}
.switch::after {
  content: ""; position: absolute; top: 4px; left: 4px;
  width: 24px; height: 24px; border-radius: 50%; background: var(--sun);
  box-shadow: 0 2px 6px rgba(29, 28, 19, 0.18);
  transition: transform var(--t-comp) var(--ease);
}
.switch-input:checked + .switch { background: var(--matcha-soft); }
.switch-input:checked + .switch::after { transform: translateX(22px); }
.switch-input:focus-visible + .switch { outline: 2.5px solid var(--clay); outline-offset: 3px; }

.field { display: grid; gap: 8px; }
.field-label { font-weight: 700; font-size: var(--fs-sm); }
.field-input {
  width: 100%; min-height: 56px; padding: 14px 18px;
  border: 0; border-radius: var(--r-ctl) var(--r-ctl) 8px 8px;
  background: var(--paper-high);
  box-shadow: inset 0 -1.5px 0 var(--ghost);
  font-size: 1.05rem; font-weight: 600;
  transition: box-shadow var(--t-comp) var(--ease), background var(--t-comp) var(--ease);
}
.field-input::placeholder { color: var(--ink-faint); font-weight: 500; }
.field-input:focus { outline: none; background: var(--paper-mid); box-shadow: inset 0 -2.5px 0 var(--clay); }
.field-error { display: none; color: var(--clay); font-size: var(--fs-sm); font-weight: 600; }
.field.is-invalid .field-input { box-shadow: inset 0 -2.5px 0 var(--clay); background: var(--clay-wash); }
.field.is-invalid .field-error { display: block; }

.meter { height: 8px; border-radius: var(--r-pill); background: rgba(87, 106, 78, 0.16); overflow: hidden; }
.meter-fill {
  display: block; height: 100%; width: 100%;
  border-radius: inherit; background: linear-gradient(90deg, var(--matcha-soft), var(--matcha));
  transform-origin: left; transform: scaleX(var(--p));
  animation: meter-in 1.1s var(--ease) both;
}
@keyframes meter-in { from { transform: scaleX(0); } }

/* ── Barra de demostración ──────────────────────────────────── */

.demo-bar {
  position: sticky; top: 0; z-index: 40;
  background: var(--night); color: var(--night-ink);
  font-size: 0.8rem;
}
.demo-bar-inner {
  display: flex; align-items: center; gap: 16px;
  max-width: var(--max); margin: 0 auto;
  min-height: 48px; padding: 6px var(--gutter);
}
.demo-id { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.demo-id strong { font-family: var(--font-display); font-weight: 700; white-space: nowrap; }
.demo-note { color: var(--night-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.demo-pulse { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: none; }
.demo-pulse::after, .live-dot::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; background: inherit;
  animation: ring 2.4s ease-out infinite;
}
@keyframes ring { from { transform: scale(1); opacity: 0.6; } to { transform: scale(2.6); opacity: 0; } }
.mode-switch {
  display: flex; gap: 2px; padding: 3px; border-radius: var(--r-pill);
  background: var(--night-mid);
}
.mode-link {
  display: inline-flex; align-items: center; gap: 7px;
  min-height: 36px; padding: 6px 14px; border-radius: var(--r-pill);
  color: var(--night-soft); font-weight: 700;
  transition: background var(--t-comp) var(--ease), color var(--t-comp) var(--ease);
}
.mode-link .icon { width: 17px; height: 17px; }
.mode-link:hover { color: var(--night-ink); }
.mode-link.is-active { background: var(--night-ink); color: var(--night); }
.demo-tools { display: flex; gap: 6px; flex: 1; justify-content: flex-end; }
.demo-tool {
  position: relative;
  display: inline-flex; align-items: center; gap: 7px;
  min-height: 36px; padding: 6px 12px; border-radius: var(--r-pill);
  color: var(--night-soft); font-weight: 700;
  transition: background var(--t-comp) var(--ease), color var(--t-comp) var(--ease);
}
.demo-tool:hover { background: var(--night-mid); color: var(--night-ink); }
.demo-tool .icon { width: 17px; height: 17px; }
.demo-tool--icon { width: 36px; padding: 0; justify-content: center; }
.demo-progress { color: var(--night-faint); font-size: 0.75rem; }
.demo-tool.has-dot::after {
  content: ""; position: absolute; top: 6px; left: 22px;
  width: 7px; height: 7px; border-radius: 50%; background: var(--clay-soft);
  box-shadow: 0 0 0 2px var(--night);
}

/* ── Marco de la app y barra del kiosco ─────────────────────── */

.app { position: relative; min-height: calc(100dvh - 48px); display: flex; flex-direction: column; }
.view { flex: 1; display: flex; flex-direction: column; }
.view:focus { outline: none; }
.screen { position: relative; flex: 1; width: 100%; }

.topbar {
  position: sticky; top: 48px; z-index: 30;
  display: flex; align-items: center; gap: 20px;
  min-height: 76px; padding: 10px var(--gutter);
  background: var(--glass);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  view-transition-name: topbar;
}
.brand { display: inline-flex; align-items: center; gap: 12px; min-height: 44px; }
.brand-mark {
  display: grid; place-items: center;
  width: 44px; height: 44px; border-radius: 14px;
  background: var(--ink); color: var(--paper);
}
.brand-mark .logo-mark { width: 24px; }
.logo-sun { fill: var(--clay-soft); }
.brand-text { display: grid; line-height: 1.1; }
.brand-name { font-family: var(--font-display); font-weight: 800; font-size: 1.15rem; letter-spacing: -0.03em; }
.brand-kr { font-size: 0.8rem; font-weight: 500; color: var(--ink-faint); margin-left: 2px; }
.brand-tag { font-size: 0.75rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-faint); font-weight: 600; margin-top: 3px; }

.steps { display: flex; align-items: center; gap: 6px; margin: 0 auto; }
.step { display: flex; align-items: center; gap: 8px; color: var(--ink-faint); font-weight: 700; font-size: var(--fs-sm); }
.step + .step::before { content: ""; width: 28px; height: 1.5px; border-radius: 2px; background: var(--paper-max); margin-right: 2px; }
.step-dot {
  display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  background: var(--paper-high); font-size: 0.75rem;
  transition: background var(--t-comp) var(--ease), color var(--t-comp) var(--ease);
}
.step-dot .icon { width: 14px; height: 14px; }
.step.is-done { color: var(--ink-soft); }
.step.is-done .step-dot { background: var(--matcha-soft); color: #fff; }
.step.is-done + .step::before { background: var(--matcha-soft); }
.step.is-current { color: var(--ink); }
.step.is-current .step-dot { background: var(--ink); color: var(--paper); box-shadow: 0 0 0 5px rgba(29, 28, 19, 0.08); }

.topbar-actions { display: flex; align-items: center; gap: 10px; }
.lang-toggle {
  display: inline-flex; align-items: center; gap: 2px;
  min-height: 44px; padding: 4px 6px 4px 12px; border-radius: var(--r-pill);
  background: var(--paper-high); color: var(--ink-soft);
}
.lang-toggle .icon { width: 17px; height: 17px; margin-right: 4px; }
.lang-option {
  min-width: 38px; min-height: 36px; border-radius: var(--r-pill);
  font-weight: 800; font-size: 0.78rem; letter-spacing: 0.04em;
  transition: background var(--t-comp) var(--ease), color var(--t-comp) var(--ease);
}
.lang-option.is-active { background: var(--ink); color: var(--paper); }
.bag-button {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 52px; padding: 6px 8px 6px 18px; border-radius: var(--r-pill);
  background: var(--ink); color: var(--paper); font-weight: 800; font-family: var(--font-display);
  transition: transform var(--t-micro) var(--ease), background var(--t-comp) var(--ease);
}
.bag-button:active { transform: scale(0.96); }
.bag-button.is-empty { background: var(--paper-high); color: var(--ink-soft); }
.bag-count {
  display: grid; place-items: center; min-width: 36px; height: 36px; padding: 0 8px;
  border-radius: var(--r-pill); background: var(--cta); color: #fff; font-size: 0.9rem;
}
.bag-button.is-empty .bag-count { background: var(--paper-max); color: var(--ink-soft); }

/* ── Revelados y View Transitions ───────────────────────────── */

.reveal, .reveal-group > * {
  animation: rise var(--t-scene) var(--ease) both;
  animation-delay: calc(var(--i, 0) * 55ms + 60ms);
}
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }
@keyframes fade { from { opacity: 0; } }

::view-transition-old(root),
::view-transition-new(root) { animation-duration: var(--t-scene); animation-timing-function: var(--ease); }
::view-transition-old(root) { animation-name: vt-out; }
::view-transition-new(root) { animation-name: vt-in; }
[data-nav="back"]::view-transition-old(root) { animation-name: vt-out-back; }
[data-nav="back"]::view-transition-new(root) { animation-name: vt-in-back; }
@keyframes vt-out { to { opacity: 0; transform: translateX(-28px) scale(0.99); filter: blur(2px); } }
@keyframes vt-in { from { opacity: 0; transform: translateX(36px); } }
@keyframes vt-out-back { to { opacity: 0; transform: translateX(28px); filter: blur(2px); } }
@keyframes vt-in-back { from { opacity: 0; transform: translateX(-36px); } }
::view-transition-group(product-hero) { animation-duration: 560ms; animation-timing-function: cubic-bezier(0.3, 0.7, 0.1, 1); }
::view-transition-old(product-hero), ::view-transition-new(product-hero) { height: 100%; object-fit: cover; }
::view-transition-group(topbar) { animation-duration: 0s; }
/* Cambios dentro de la misma pantalla (filtros, listas): la página no se desliza,
   sólo se reacomodan los elementos nombrados. */
[data-nav="none"]::view-transition-old(root),
[data-nav="none"]::view-transition-new(root) { animation: none; }
::view-transition-group(.card),
::view-transition-group(.item) { animation-duration: 460ms; animation-timing-function: var(--ease); }
::view-transition-new(.card):only-child,
::view-transition-new(.item):only-child { animation: vt-pop-in 380ms var(--ease) both; }
::view-transition-old(.card):only-child,
::view-transition-old(.item):only-child { animation: vt-pop-out 240ms ease both; }
@keyframes vt-pop-in { from { opacity: 0; transform: scale(0.92) translateY(10px); } }
@keyframes vt-pop-out { to { opacity: 0; transform: scale(0.94); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; scroll-behavior: auto !important; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}

/* ── Luz komorebi (firma de marca) ──────────────────────────── */

.komorebi { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; contain: strict; }
/* Rayos de luz: degradados ya difuminados (sin filter: blur) para que el compositor sólo mueva capas. */
.k-shaft {
  position: absolute; top: -30%; height: 160%; width: 22%;
  background: linear-gradient(90deg, rgba(255, 238, 200, 0) 0%, rgba(255, 238, 200, 0.22) 25%, rgba(255, 242, 214, 0.5) 50%, rgba(255, 238, 200, 0.22) 75%, rgba(255, 238, 200, 0) 100%);
  transform: rotate(24deg);
  animation: shaft 18s var(--ease-in-out) infinite alternate;
  will-change: transform, opacity;
}
.k-shaft--1 { left: 8%; }
.k-shaft--2 { left: 38%; width: 12%; animation-delay: -6s; }
.k-shaft--3 { left: 62%; width: 30%; animation-delay: -11s; }
@keyframes shaft {
  from { transform: rotate(24deg) translateX(-6%); opacity: 0.45; }
  to { transform: rotate(21deg) translateX(8%); opacity: 0.95; }
}
/* Sombras de hojas: manchas con borde suave en el propio degradado. */
.k-dapple {
  position: absolute; width: 64vmax; height: 64vmax;
  background:
    radial-gradient(circle at 20% 30%, rgba(120, 98, 58, 0.08) 0 4%, rgba(120, 98, 58, 0) 9%),
    radial-gradient(circle at 46% 22%, rgba(120, 98, 58, 0.06) 0 3%, rgba(120, 98, 58, 0) 7%),
    radial-gradient(circle at 70% 40%, rgba(120, 98, 58, 0.07) 0 5%, rgba(120, 98, 58, 0) 11%),
    radial-gradient(circle at 34% 62%, rgba(120, 98, 58, 0.05) 0 3%, rgba(120, 98, 58, 0) 8%),
    radial-gradient(circle at 62% 72%, rgba(120, 98, 58, 0.07) 0 5%, rgba(120, 98, 58, 0) 10%),
    radial-gradient(circle at 84% 64%, rgba(120, 98, 58, 0.05) 0 2%, rgba(120, 98, 58, 0) 6%),
    radial-gradient(circle at 12% 80%, rgba(120, 98, 58, 0.06) 0 4%, rgba(120, 98, 58, 0) 8%);
  animation: dapple 26s ease-in-out infinite alternate;
  will-change: transform;
}
.k-dapple--1 { right: -18vmax; top: -24vmax; }
.k-dapple--2 { left: -26vmax; bottom: -38vmax; animation-duration: 32s; animation-delay: -9s; }
@keyframes dapple {
  0% { transform: translate(0, 0) rotate(0deg) scale(1); }
  50% { transform: translate(2vmax, 1vmax) rotate(4deg) scale(1.03); }
  100% { transform: translate(-1vmax, 2.5vmax) rotate(-3deg) scale(0.99); }
}

/* ── Hojas (confirmación) ───────────────────────────────────── */

.leaf-layer { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 5; }
.leaf {
  position: absolute; top: -40px; left: var(--x);
  width: var(--size); height: calc(var(--size) * 0.62);
  background: var(--tone);
  border-radius: 0 100% 0 100%;
  opacity: 0;
  animation: leaf-fall var(--dur) cubic-bezier(0.3, 0.2, 0.4, 1) var(--delay) forwards;
}
@keyframes leaf-fall {
  0% { opacity: 0; transform: translate(0, 0) rotate(0); }
  10% { opacity: 0.95; }
  100% { opacity: 0; transform: translate(var(--drift), 92vh) rotate(var(--spin)); }
}

/* ── Vuelo a la bolsa ───────────────────────────────────────── */

.fly-ghost {
  position: fixed; z-index: 90; object-fit: cover; pointer-events: none;
  box-shadow: var(--shadow-lift);
  will-change: transform, opacity;
}

/* ── Avisos ─────────────────────────────────────────────────── */

.toast-root {
  position: fixed; left: 16px; right: 16px; bottom: max(24px, env(safe-area-inset-bottom)); z-index: 80;
  display: grid; gap: 8px; justify-items: center;
  pointer-events: none;
}
.toast span { max-width: min(520px, calc(100vw - 96px)); }
.toast {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 12px 20px 12px 14px; border-radius: var(--r-pill);
  background: rgba(29, 28, 19, 0.92); color: var(--paper);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  box-shadow: var(--shadow-lift);
  font-weight: 700; font-size: var(--fs-sm);
  opacity: 0; transform: translateY(14px) scale(0.96);
  transition: opacity var(--t-comp) var(--ease), transform var(--t-comp) var(--ease);
}
.toast.is-in { opacity: 1; transform: none; }
.toast .icon { width: 20px; height: 20px; padding: 3px; border-radius: 50%; background: var(--clay-soft); color: #fff; box-sizing: content-box; }
.toast--matcha .icon { background: var(--matcha-soft); }
.toast--night { background: var(--night-ink); color: var(--night); }
.toast--night .icon { background: var(--night); color: var(--night-ink); }

/* ── Diálogos ───────────────────────────────────────────────── */

.sheet {
  margin: auto; padding: 0; border: 0;
  width: min(520px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  border-radius: 32px;
  background: var(--paper); color: var(--ink);
  box-shadow: 0 40px 80px rgba(29, 28, 19, 0.22);
  animation: sheet-in var(--t-scene) var(--ease) both;
  overflow: auto;
}
.sheet::backdrop {
  background: rgba(29, 28, 19, 0.38);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  animation: fade var(--t-comp) var(--ease) both;
}
.sheet.is-closing { animation: sheet-out var(--t-comp) var(--ease) both; }
.sheet.is-closing::backdrop { animation: fade var(--t-comp) var(--ease) reverse both; }
@keyframes sheet-in { from { opacity: 0; transform: translateY(24px) scale(0.97); } }
@keyframes sheet-out { to { opacity: 0; transform: translateY(16px) scale(0.98); } }

.sheet--center > * { padding: 40px 36px 36px; text-align: center; display: grid; justify-items: center; gap: 12px; }

/* Recorrido */
.sheet--guide { width: min(460px, calc(100vw - 32px)); margin: 64px 16px auto auto; }
.guide { padding: 28px; display: grid; gap: 18px; }
.guide-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.guide-head .muted { margin-top: 6px; font-size: var(--fs-sm); }
.guide-meter { height: 6px; border-radius: var(--r-pill); background: var(--paper-high); overflow: hidden; }
.guide-meter-fill { display: block; height: 100%; background: var(--cta); transform-origin: left; transform: scaleX(var(--p)); transition: transform var(--t-scene) var(--ease); }
.guide-steps { display: grid; gap: 8px; }
.guide-step {
  display: flex; align-items: center; gap: 14px;
  padding: 10px 10px 10px 12px; border-radius: 18px; background: var(--paper-low);
}
.guide-check {
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; flex: none;
  background: var(--paper-high); font-family: var(--font-mono); font-size: 0.8rem; font-weight: 600;
}
.guide-check .icon { width: 16px; height: 16px; }
.guide-step.is-done .guide-check { background: var(--matcha-soft); color: #fff; }
.guide-step.is-done .guide-label { color: var(--ink-soft); text-decoration: line-through; text-decoration-color: var(--matcha-soft); }
.guide-label { flex: 1; font-weight: 600; font-size: 0.95rem; }

/* Inactividad */
.idle-ring {
  display: grid; place-items: center; width: 88px; height: 88px; border-radius: 50%;
  background: conic-gradient(var(--clay) calc(var(--p) * 360deg), var(--paper-high) 0);
  transition: background 1s linear;
  position: relative; font-size: 1.6rem; font-weight: 700; margin-bottom: 6px;
}
.idle-ring::before { content: ""; position: absolute; inset: 7px; border-radius: 50%; background: var(--paper); }
.idle-ring span { position: relative; }
.idle-actions { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; justify-content: center; }

/* ── Pantalla de carga ──────────────────────────────────────── */

.boot {
  position: fixed; inset: 0; z-index: 200;
  display: grid; place-items: center; align-content: center; gap: 22px;
  background: var(--paper); color: var(--ink);
  transition: opacity 500ms var(--ease), visibility 500ms;
}
.boot-mark { width: 72px; animation: boot-breathe 1.6s var(--ease-in-out) infinite alternate; }
.boot-line { width: 120px; height: 2px; border-radius: 2px; background: var(--paper-max); overflow: hidden; position: relative; }
.boot-line::after { content: ""; position: absolute; inset: 0; width: 40%; background: var(--clay); border-radius: inherit; animation: boot-load 1.1s var(--ease-in-out) infinite; }
@keyframes boot-breathe { from { opacity: 0.55; transform: scale(0.97); } to { opacity: 1; transform: scale(1); } }
@keyframes boot-load { from { transform: translateX(-100%); } to { transform: translateX(260%); } }
/* Sólo se ve si el arranque tarda más de 250 ms. */
.boot { animation: boot-appear 300ms ease 250ms both; }
@keyframes boot-appear { from { opacity: 0; } }
.is-ready .boot { animation: none; opacity: 0; visibility: hidden; }

/* ── Responsivo del marco ───────────────────────────────────── */

@media (max-width: 1100px) {
  .demo-note { display: none; }
}
/* Tablet horizontal: pasos compactos pero con nombre */
@media (max-width: 1180px) {
  .topbar { gap: 14px; }
  .steps { gap: 4px; }
  .step { font-size: 0.8rem; gap: 6px; }
  .step + .step::before { width: 12px; }
  .bag-label { display: none; }
  .bag-button { padding-left: 16px; }
}
@media (max-width: 900px) {
  .step-label { display: none; }
}
@media (max-width: 760px) {
  .demo-bar-inner { gap: 8px; padding-inline: 10px; }
  .demo-id strong { display: none; }
  .mode-link span, .demo-tool span:not(.demo-progress) { display: none; }
  .mode-link { padding: 6px 12px; }
  .demo-tools { flex: none; }
  .topbar { min-height: 64px; gap: 10px; padding-inline: 14px; }
  .steps { display: none; }
  .topbar-actions { margin-left: auto; }
  .brand-name { font-size: 1rem; }
  .bag-label { display: none; }
  .bag-button { padding-left: 14px; min-height: 48px; }
  .lang-toggle .icon { display: none; }
  .lang-toggle { padding-left: 4px; }
  .sheet--guide { margin: auto auto 16px; }
}
