/* Home variant "box": Be insanely fast. Rafa stands in the hero with live tool cards round him; below, one tinted
   panel per job, each with a "See it work" demo (see-it-work.css) or a small looping card (box.js).
   Every class here starts with bx- so nothing leaks into site.css. */

.v-box {
  --bx-lilac: #E7DCFB; --bx-blue: #DBE6F3; --bx-mint: #DCEFE4; --bx-rose: #F3DFE6; --bx-sand: #F4E8D8;
  --bx-lift: 0 18px 40px -18px rgba(6, 1, 15, 0.35), 0 4px 4px rgba(164, 174, 183, 0.2);
  --bx-glow: 0 26px 50px -18px rgba(127, 60, 232, 0.55), 0 4px 4px rgba(164, 174, 183, 0.2);
  padding-bottom: 88px;
}

/* ---------- Hero ---------- */
.bx-hero { text-align: center; padding-top: clamp(20px, 3vw, 44px); overflow: hidden; }
.bx-hero h1 { font-size: clamp(2.9rem, 7vw, 6.5rem); line-height: 0.96; letter-spacing: -0.045em; margin: 0; }
.bx-hero h1 em { font-style: normal; color: var(--violet); }
.bx-sub { margin: 18px auto 0; font-size: clamp(1.1rem, 1.6vw, 1.375rem); line-height: 1.45; max-width: 31em; color: var(--ink-800); }
.bx-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 14px; margin-top: 24px; }
.bx-fine { margin: 12px 0 0; font-size: var(--step--1); color: var(--ink-500); }

.bx-scene { position: relative; height: clamp(430px, 46vw, 560px); margin-top: 8px; }
.bx-ring { position: absolute; left: 50%; bottom: -8%; width: min(1040px, 130%); aspect-ratio: 2 / 1; transform: translateX(-50%); border-radius: 999px 999px 0 0; border: 1.5px solid var(--violet-soft); border-bottom: 0; }
.bx-arch { position: absolute; left: 50%; bottom: 0; width: min(760px, 96%); aspect-ratio: 2 / 1; transform: translateX(-50%); border-radius: 999px 999px 0 0; background: var(--bx-lilac); }
.bx-rafa { position: absolute; left: 50%; bottom: 0; height: 96%; width: auto; max-width: none; transform: translateX(-50%); }
.bx-keys { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); display: flex; gap: 8px; }
.bx-keys kbd { display: inline-flex; align-items: center; justify-content: center; width: 52px; height: 52px; border: 0; border-radius: 14px; background: #fff; font: 700 1.375rem var(--font-display); color: var(--ink); box-shadow: var(--shadow-card); }

.bx-card { position: absolute; width: clamp(190px, 21vw, 260px); padding: 14px 16px; border-radius: 22px; background: #fff; text-align: left; display: flex; flex-direction: column; gap: 8px; color: var(--ink); box-shadow: var(--bx-lift); transition: box-shadow 0.4s; }
.bx-card.is-on { box-shadow: var(--bx-glow); }
.bx-c1 { left: 4%; top: 10%; } .bx-c2 { right: 3%; top: 4%; } .bx-c3 { left: 9%; bottom: 9%; } .bx-c4 { right: 8%; bottom: 12%; }
.bx-tag { align-self: flex-start; font-size: 0.8125rem; font-weight: 600; padding: 3px 10px; border-radius: 8px; background: #F1F3F7; color: var(--ink-700); }
.bx-note { font-size: 0.84rem; color: var(--ink-500); }
.bx-url { margin: 0; font-family: var(--font-mono); font-size: 0.875rem; line-height: 1.45; overflow-wrap: anywhere; }
.bx-junk { display: inline-block; max-width: 30ch; overflow: hidden; white-space: nowrap; vertical-align: bottom; color: var(--violet); transition: max-width 0.7s 0.2s var(--ease), opacity 0.4s 0.1s; }
.is-on .bx-junk { max-width: 0; opacity: 0; }
.bx-ok { align-self: flex-start; padding: 4px 11px; border-radius: 999px; background: var(--mint-wash); color: var(--mint-ink); font: 700 0.84rem var(--font-display); opacity: 0; transition: opacity 0.35s 0.6s; }
.is-on .bx-ok { opacity: 1; }
.bx-size { margin: 0; font: 700 2.1rem/1 var(--font-display); letter-spacing: -0.02em; }
.bx-size small { font-size: 1rem; }
.bx-meter { position: relative; height: 10px; border-radius: 5px; background: #F1F3F7; }
.bx-meter i { position: absolute; inset: 0 auto 0 0; width: 100%; border-radius: 5px; background: var(--violet); transition: width 1s var(--ease); }
.is-on .bx-meter i { width: 5.6%; }
.bx-pic { position: relative; height: 66px; border-radius: 12px; background: #3A3D62; padding: 13px 15px; display: flex; flex-direction: column; gap: 8px; }
.bx-pic i { height: 8px; width: 62%; border-radius: 4px; background: rgba(255, 255, 255, 0.85); }
.bx-pic i + i { width: 84%; background: rgba(255, 255, 255, 0.55); }
.bx-pic b { position: absolute; inset: 6px 8px; border: 2px dashed #fff; border-radius: 8px; background: rgba(146, 81, 247, 0.35); transform-origin: 0 0; transform: scale(0); transition: transform 0.6s var(--ease); }
.is-on .bx-pic b { transform: none; }
.bx-out { margin: 0; font: 700 0.94rem/1.3 var(--font-display); opacity: 0; transition: opacity 0.4s 0.45s; }
.is-on .bx-out { opacity: 1; }
.bx-hex { display: flex; align-items: center; gap: 12px; }
.bx-dot { flex: none; width: 46px; height: 46px; border-radius: 14px; background: #F08A5D; transition: background 0.5s; }
.is-on .bx-dot { background: var(--violet); }
.bx-hex b { font: 500 1.19rem var(--font-mono); opacity: 0.35; transition: opacity 0.4s 0.2s; }
.is-on .bx-hex b { opacity: 1; }

/* ---------- What it replaces ---------- */
.bx-swap { background: var(--ink); color: #fff; padding-block: 18px; overflow: hidden; }
.bx-swap ul { display: flex; gap: 44px; width: max-content; margin: 0; padding: 0; list-style: none; font: 700 1.19rem var(--font-display); white-space: nowrap; }
.bx-swap s { color: var(--ink-400); }

/* ---------- Panels ---------- */
.bx-levels { padding-block: clamp(56px, 7vw, 96px) 0; display: flex; flex-direction: column; gap: 24px; }
.bx-head { text-align: center; }
.bx-head h2 { font-size: clamp(2.25rem, 5vw, 4.25rem); line-height: 1; margin: 14px auto 12px; max-width: 13em; }
.bx-head .kicker { margin: 0; }
.bx-panel { position: relative; overflow: hidden; border-radius: 32px; display: grid; grid-template-columns: minmax(0, 1fr); background: var(--bx-tint, var(--bx-lilac)); }
.bx-panel-txt { padding: clamp(28px, 4vw, 56px); display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 14px; color: var(--ink-800); }
.bx-panel-txt h3 { font-size: clamp(1.9rem, 3.4vw, 2.9rem); line-height: 1.04; letter-spacing: -0.03em; margin: 0; }
.bx-panel-txt p { margin: 0; font-size: 1.19rem; line-height: 1.5; max-width: 26em; }
.bx-lvl { font: 500 0.94rem var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink); padding: 5px 12px; border-radius: 999px; background: rgba(255, 255, 255, 0.7); }
.bx-panel-txt kbd { font: 500 0.94rem var(--font-mono); padding: 6px 12px; border: 0; border-radius: 10px; background: #fff; color: var(--ink); box-shadow: none; }
.bx-count { font: 700 1.05rem var(--font-display); color: var(--ink); }
.bx-count s { color: var(--ink-500); margin-right: 6px; }
.bx-count b { color: var(--violet); }
.bx-panel-art { position: relative; min-height: 340px; }
.bx-panel-art > img { position: absolute; right: -2%; bottom: 0; height: 108%; width: auto; max-width: none; }
.bx-demo { position: absolute; left: 4%; top: 50%; transform: translateY(-50%); width: min(300px, 62%); padding: 16px 18px; border-radius: 22px; background: #fff; box-shadow: var(--bx-lift); display: flex; flex-direction: column; gap: 10px; color: var(--ink); text-align: left; }
.bx-film-wrap { padding: clamp(16px, 2.4vw, 32px); display: flex; align-items: center; }
.bx-film { margin: 0; width: 100%; }
.bx-film .film-pane { border-radius: 22px; box-shadow: var(--bx-lift); }
.bx-film .film-pane::after { display: none; }
.bx-film .siw-play { left: 14px; bottom: 14px; }
@media (min-width: 900px) { .bx-panel { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }

.bx-fields { display: flex; flex-direction: column; gap: 7px; font-size: 0.84rem; font-weight: 600; }
.bx-fields span { height: 32px; padding: 0 10px; border-radius: 8px; box-shadow: inset 0 0 0 1px var(--hairline); display: flex; align-items: center; transition: background 0.3s; }
.bx-fields b { font-weight: 600; opacity: 0; transition: opacity 0.3s; }
.is-on .bx-fields span { background: var(--violet-softer); box-shadow: none; }
.is-on .bx-fields b { opacity: 1; }
.is-on .bx-fields span:nth-child(2), .is-on .bx-fields span:nth-child(2) b { transition-delay: 0.3s; }
.is-on .bx-fields span:nth-child(3), .is-on .bx-fields span:nth-child(3) b { transition-delay: 0.6s; }
.bx-secret { font: 500 1.25rem var(--font-mono); letter-spacing: 0.1em; }
.bx-pill { align-self: flex-start; padding: 6px 16px; border-radius: 999px; background: #F1F3F7; color: var(--ink-800); font: 700 0.875rem var(--font-display); transition: background 0.3s, color 0.3s; }
.is-on .bx-pill, .bx-pill.is-go { background: var(--violet); color: #fff; }
.bx-clock { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font: 700 1.5rem var(--font-display); }
.bx-clock span { font-size: 0.875rem; color: var(--ink-500); }
.bx-clock + .bx-clock { padding: 8px 10px; margin: 0 -10px; border-radius: 12px; color: var(--violet); transition: background 0.3s; }
.is-on .bx-clock + .bx-clock { background: var(--violet-softer); }
.bx-meet { font: 700 1.05rem var(--font-display); }

/* ---------- Counts, closing, dock ---------- */
.bx-nums { padding-block: clamp(64px, 8vw, 104px); }
.bx-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(250px, 100%), 1fr)); gap: 20px; margin: 0; padding: 0; list-style: none; }
.bx-tiles li { background: #fff; border-radius: 26px; padding: 26px; box-shadow: var(--shadow-card); display: flex; flex-direction: column; gap: 6px; }
.bx-tiles b { font: 700 3.4rem/1 var(--font-display); letter-spacing: -0.03em; color: var(--violet); }
.bx-tiles s { color: var(--ink-500); font-size: 0.72em; margin-right: 10px; }
.bx-tiles li > span { color: var(--ink-500); }
/* The race in each tile: both rows take one step at a time at the same pace; RafaBox has fewer steps, so it
   is done while the usual way is still going. box.js adds is-go when the tiles come into view. */
.bx-race { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.bx-track { margin: 0; display: grid; grid-template-columns: 7.2em minmax(0, 1fr); align-items: center; gap: 8px; }
.bx-track em { font: 600 0.75rem var(--font-body, inherit); font-style: normal; color: var(--ink-500); white-space: nowrap; }
.bx-track > span { display: flex; align-items: center; gap: 4px; min-height: 20px; }
.bx-track i { flex: 1 1 0; max-width: 28px; height: 8px; border-radius: 4px; background: #9AA1B6; }
.bx-track-new i { background: var(--violet); }
.bx-track strong { padding: 2px 9px; border-radius: 999px; background: var(--mint-wash); color: var(--mint-ink); font: 700 0.75rem var(--font-display); white-space: nowrap; }
.bx-saved { margin: 26px 0 0; text-align: center; font-size: 1.19rem; color: var(--ink-800); }
.bx-saved b { font: 700 1.6em var(--font-display); color: var(--violet); font-variant-numeric: tabular-nums; margin-right: 4px; }
.bx-last { background: #fff; border-radius: 32px; overflow: hidden; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(380px, 100%), 1fr)); box-shadow: var(--shadow-card); }
.bx-last-say { padding: clamp(32px, 5vw, 64px); display: flex; flex-direction: column; align-items: flex-start; gap: 16px; }
.bx-last-say h2 { font-size: clamp(2.25rem, 5vw, 4.25rem); line-height: 1; margin: 0; }
.bx-last-say p { margin: 0; font-size: 1.25rem; line-height: 1.5; max-width: 26em; }
.bx-last-say .bx-price { font: 700 1.06rem var(--font-display); color: var(--ink); }
.bx-last img { width: 100%; height: 100%; min-height: 420px; object-fit: cover; object-position: 80% 50%; }
.bx-end { padding-bottom: clamp(56px, 7vw, 96px); }
.bx-dock { position: fixed; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 40; display: flex; align-items: center; gap: 14px; padding: 8px 8px 8px 20px; border-radius: 999px; background: var(--ink); color: #fff; font: 700 0.97rem var(--font-display); white-space: nowrap; box-shadow: 0 18px 40px -14px rgba(6, 1, 15, 0.5); }
.bx-dock a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border-radius: 999px; background: #fff; color: var(--ink); text-decoration: none; }

.bx-phone { display: none; }

/* Phone (the "Mobile" page of the design canvas): Rafa alone on his arch, the four live cards in a 2×2 grid
   under him, panels with words first, 2×2 count tiles, the closing picture on top. */
@media (max-width: 760px) {
  .bx-phone { display: inline; }
  .bx-actions { flex-direction: column; align-items: stretch; }
  .bx-actions .btn { justify-content: center; }
  .bx-scene { height: auto; padding-top: 330px; margin-top: 12px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .bx-ring { display: none; }
  .bx-arch { top: 160px; bottom: auto; width: 340px; }
  .bx-rafa { top: 0; bottom: auto; height: 330px; }
  .bx-keys { top: 276px; bottom: auto; gap: 6px; }
  .bx-keys kbd { width: 40px; height: 40px; border-radius: 12px; font-size: 1.125rem; }
  .bx-card { position: relative; inset: auto; width: auto; padding: 12px; border-radius: 20px; gap: 6px; }
  .bx-c1, .bx-c2 { margin-top: -18px; }
  .bx-url { font-size: 0.78rem; }
  .bx-junk { max-width: 17ch; }
  .bx-size { font-size: 1.75rem; }
  .bx-pic { height: 48px; padding: 10px 12px; gap: 6px; }
  .bx-pic i { height: 6px; }
  .bx-out { font-size: 0.84rem; }
  .bx-dot { width: 36px; height: 36px; border-radius: 11px; }
  .bx-hex b { font-size: 0.94rem; }
  .bx-note { font-size: 0.78rem; }

  .bx-levels { gap: 14px; }
  .bx-panel { border-radius: 28px; }
  .bx-panel-txt { padding: 24px 22px 8px; gap: 10px; }
  .bx-panel-txt p { font-size: 1.03rem; }
  .bx-lvl { font-size: 0.8125rem; padding: 4px 10px; }
  .bx-panel-art { min-height: 250px; }
  .bx-panel-art > img { right: -14px; height: 250px; }
  .bx-demo { left: 18px; width: 190px; padding: 14px; border-radius: 20px; }
  .bx-film-wrap { padding: 12px 14px 16px; }

  .bx-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .bx-tiles li { padding: 18px; border-radius: 22px; }
  .bx-tiles b { font-size: 2.5rem; }
  .bx-tiles li > span { font-size: 0.9rem; line-height: 1.4; }
  .bx-track { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .bx-track i { height: 7px; }

  .bx-last { border-radius: 28px; }
  .bx-last img { order: -1; height: 240px; min-height: 0; }
  .bx-last-say { padding: 24px 22px 26px; gap: 12px; }
  .bx-last-say .btn { align-self: stretch; justify-content: center; }

  .bx-dock span { display: none; } .bx-dock { padding-left: 8px; }
}
@media (max-width: 760px) and (prefers-reduced-motion: no-preference) {
  .bx-card { animation: none; }
}
@media (prefers-reduced-motion: no-preference) {
  [data-bx-race] .bx-track i, [data-bx-race] .bx-track strong { opacity: 0.18; }
  [data-bx-race] .bx-track strong { opacity: 0; }
  [data-bx-race].is-go .bx-track i { animation: bx-step 0.28s ease-out both; animation-delay: calc(var(--n) * 0.36s + 0.3s); }
  [data-bx-race].is-go .bx-track strong { animation: bx-step 0.3s ease-out both; animation-delay: calc(var(--done) * 0.36s + 0.3s); }
  .bx-track i:nth-child(1) { --n: 0; } .bx-track i:nth-child(2) { --n: 1; } .bx-track i:nth-child(3) { --n: 2; } .bx-track i:nth-child(4) { --n: 3; }
  .bx-track i:nth-child(5) { --n: 4; } .bx-track i:nth-child(6) { --n: 5; } .bx-track i:nth-child(7) { --n: 6; } .bx-track i:nth-child(8) { --n: 7; }
  [data-new="3"] { --done: 3; } [data-new="0"] { --done: 0; }
  .bx-hero h1 { animation: bx-sharpen 0.9s var(--ease) both; }
  .bx-card { animation: bx-bob 6s ease-in-out infinite; }
  .bx-c2 { animation-delay: -1.5s; } .bx-c3 { animation-delay: -3s; } .bx-c4 { animation-delay: -4.5s; }
  .bx-swap ul { animation: bx-slide 32s linear infinite; }
}
@keyframes bx-sharpen { from { filter: blur(14px); opacity: 0; transform: translateY(14px); } }
@keyframes bx-bob { 50% { translate: 0 -10px; } }
@keyframes bx-slide { to { transform: translateX(-50%); } }

.bx-panel[data-tint="blue"] { --bx-tint: var(--bx-blue); }
.bx-panel[data-tint="sand"] { --bx-tint: var(--bx-sand); }
.bx-panel[data-tint="mint"] { --bx-tint: var(--bx-mint); }
.bx-panel[data-tint="rose"] { --bx-tint: var(--bx-rose); }

/* Panels for features that are not in the released app yet. */
.bx-lvl-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.bx-soon { padding: 5px 12px; border-radius: 999px; background: var(--ink); color: #fff; font: 700 0.84rem var(--font-display); }
@keyframes bx-step { from { opacity: 0.18; transform: scaleX(0.4); } to { opacity: 1; transform: none; } }
