/* Kinolap landing page (/ and /vi/). Loaded after site.css and reuses its tokens (--ink, --chalk, --volt…),
   .wrap, .display, .h2, .lead, .section, .section-head, .pill, .btn, header and footer.
   Palette swatch colours are the real video palettes from packages/engine/src/scene/palettes.ts (bgTop, bgBottom,
   route, accent). No inline styles anywhere (CSP style-src 'self'). */

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.num { font-variant-numeric: tabular-nums; }
.landing main { overflow-x: clip; }

/* ---------- Hero ---------- */

.hero { padding-block: clamp(32px, 7vw, 88px) clamp(64px, 9vw, 112px); }
.hero-grid { display: grid; gap: clamp(40px, 6vw, 64px); align-items: center; }
@media (min-width: 960px) {
  .hero-grid { grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr); }
}

.hero .display { font-size: clamp(54px, 15vw, 124px); line-height: 0.88; }
.hero .display:lang(vi) { line-height: 1.02; font-size: clamp(50px, 13.6vw, 112px); }
.hero .lead { max-width: 30em; }
.hero-soon { margin: 30px 0 0; }
.hero-soon .pill { min-height: 44px; padding: 10px 18px; border-radius: 22px; font-size: 15px; line-height: 1.3; }
.hero-soon .pill .dot { align-self: flex-start; margin-top: 6px; }

/* The plate: a schematic board with the demo loop and the phone. */
.plate {
  position: relative; margin: 0;
  display: grid; grid-template-columns: minmax(0, 1fr) auto;
  border: 1px solid var(--rim); border-radius: 28px;
  background-color: var(--pit);
  background-image:
    linear-gradient(var(--hair) 1px, transparent 1px),
    linear-gradient(90deg, var(--hair) 1px, transparent 1px);
  background-size: 28px 28px;
  background-position: -1px -1px;
  overflow: hidden;
}
.plate-route {
  position: absolute; z-index: 0;
  top: 50%; left: 4%;
  height: 74%; width: auto;
  transform: translateY(-54%);
  overflow: visible;
}
.route-base { fill: none; stroke: var(--rim2); stroke-width: 9; stroke-linejoin: round; }
.route-draw { fill: none; stroke: var(--volt); stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1 1; stroke-dashoffset: 0; }
.route-head { fill: var(--volt); stroke: var(--pit); stroke-width: 2.5; }

.plate-note {
  grid-column: 1; grid-row: 1; position: relative; z-index: 1;
  margin: 0; padding: 16px 12px 16px 18px;
  font: 600 13px/1.35 var(--f-body); color: var(--fog);
}
.plate-note-top { align-self: start; }
@media (max-width: 599px) { .plate-note-top { display: none; } }
.plate-note-bottom {
  align-self: end; justify-self: start; color: var(--chalk); white-space: nowrap;
  margin: 0 0 14px 12px; padding: 8px 12px;
  background: var(--pit); border: 1px solid var(--rim); border-radius: 12px;
}
.plate-note-bottom .num { font: italic 700 22px/1 var(--f-cond); }

.plate .phone { grid-column: 2; grid-row: 1; z-index: 2; margin: 22px 18px 22px 0; width: min(62vw, 330px); }
.plate-caption {
  grid-column: 1 / -1; position: relative; z-index: 2;
  margin: 0; padding: 14px 18px 16px;
  border-top: 1px solid var(--rim); background: var(--pit);
  font-size: 14px; line-height: 1.45; color: var(--fog);
}
@media (min-width: 960px) {
  .plate { grid-template-columns: minmax(150px, 1fr) auto; }
  .plate .phone { margin: 36px 40px 36px 0; width: 300px; }
  .plate-note { padding: 24px 16px 24px 26px; }
  .plate-note-bottom { margin: 0 0 22px 18px; padding: 10px 14px; }
  .plate-route { left: 7%; height: 72%; }
  .plate-caption { padding: 16px 26px 18px; }
}

@media (prefers-reduced-motion: no-preference) {
  .route-draw { animation: route-draw 2.6s cubic-bezier(0.5, 0.05, 0.25, 1) 0.35s both; }
  .route-head { animation: route-head 0.45s cubic-bezier(0.3, 1.6, 0.5, 1) 2.85s both; transform-box: fill-box; transform-origin: center; }
}
@keyframes route-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes route-head { from { transform: scale(0); } to { transform: scale(1); } }

/* ---------- Phone frame + video ---------- */

.phone {
  position: relative;
  padding: 7px; border-radius: 38px;
  background: #050604;
  border: 1px solid var(--rim2);
  box-shadow: 0 28px 60px -24px rgba(0, 0, 0, 0.85), 0 0 0 5px rgba(11, 12, 10, 0.55);
}
.phone video {
  display: block; width: 100%; height: auto; aspect-ratio: 9 / 16;
  border-radius: 31px; background: #111317; object-fit: cover;
}
.phone-sm { padding: 6px; border-radius: 30px; }
.phone-sm video { border-radius: 24px; }

/* Play / pause button added by landing.js (without JS the native controls stay). */
.reel-toggle {
  position: absolute; right: 16px; bottom: 16px; z-index: 3;
  width: 44px; height: 44px; padding: 0; border-radius: 50%;
  display: grid; place-items: center;
  border: 1px solid rgba(242, 244, 236, 0.18);
  background: rgba(11, 12, 10, 0.72); color: var(--chalk);
  cursor: pointer;
}
.reel-toggle:hover { background: rgba(28, 31, 25, 0.9); }
.reel-toggle:focus-visible { outline: 2px solid var(--volt); outline-offset: 2px; border-radius: 50%; }
.reel-toggle::before, .reel-toggle::after { content: ""; display: block; }
/* paused: a play triangle */
.reel-toggle[data-state="paused"]::before {
  width: 0; height: 0; margin-left: 3px;
  border-style: solid; border-width: 7px 0 7px 12px; border-color: transparent transparent transparent currentColor;
}
.reel-toggle[data-state="paused"]::after { display: none; }
/* playing: two pause bars */
.reel-toggle[data-state="playing"] { grid-auto-flow: column; gap: 4px; place-content: center; }
.reel-toggle[data-state="playing"]::before,
.reel-toggle[data-state="playing"]::after { width: 4px; height: 13px; border-radius: 1px; background: currentColor; }
.phone-sm .reel-toggle { right: 12px; bottom: 12px; }

/* ---------- Looks ---------- */

.reels {
  list-style: none; margin: 0 calc(-1 * var(--gutter)); padding: 4px var(--gutter) 12px;
  display: grid; grid-auto-flow: column; grid-auto-columns: min(66vw, 280px); gap: 18px;
  overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory; scroll-padding-inline: var(--gutter);
  scrollbar-width: thin; scrollbar-color: var(--rim2) transparent;
}
.reels > li { scroll-snap-align: start; }
@media (min-width: 820px) {
  .reels { margin: 0; padding: 0; overflow: visible; grid-auto-flow: row; grid-template-columns: repeat(3, minmax(0, 310px)); justify-content: space-between; gap: 32px; }
  .reels > li:nth-child(2) { margin-top: 56px; }
}
.look { margin: 0; }
.look figcaption { margin-top: 16px; font-size: 15px; line-height: 1.45; color: var(--fog); max-width: 24em; }
.look figcaption strong { display: block; margin-bottom: 2px; font: italic 700 26px/1 var(--f-cond); text-transform: uppercase; color: var(--chalk); }

.kit { margin-top: clamp(56px, 8vw, 96px); display: grid; gap: clamp(48px, 6vw, 72px); }
.kit-title { margin: 0 0 20px; font: 600 17px/1.3 var(--f-body); color: var(--chalk); }

.swatches {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 18px 12px;
}
@media (min-width: 760px) { .swatches { grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 16px; } }
.sw { display: grid; gap: 8px; font-size: 13px; line-height: 1.2; color: var(--fog); }
.sw svg {
  width: 100%; height: auto; aspect-ratio: 9 / 16;
  padding: 20% 24%; border-radius: 10px;
  background: linear-gradient(var(--top), var(--bot));
  box-shadow: inset 0 0 0 1px rgba(242, 244, 236, 0.1);
}
.sw use { fill: none; stroke: var(--route); stroke-width: 15; stroke-linejoin: round; }
.sw circle { fill: var(--accent); stroke: var(--top); stroke-width: 7; }

.sw-rose   { --top: #FDF7F5; --bot: #F7D9D6; --route: #141414; --accent: #E8604C; }
.sw-night  { --top: #1A1D22; --bot: #0A0B0D; --route: #D4FF3A; --accent: #D4FF3A; }
.sw-volt   { --top: #F3FFA6; --bot: #D4FF3A; --route: #0E0F0B; --accent: #2A34FF; }
.sw-ocean  { --top: #0F3A57; --bot: #05141F; --route: #3DD6FF; --accent: #3DD6FF; }
.sw-forest { --top: #F1F5EA; --bot: #CFDEC0; --route: #1E4D2B; --accent: #E0662B; }
.sw-sand   { --top: #FBF4E6; --bot: #EBD8B6; --route: #1E1A14; --accent: #C4572A; }
.sw-mono   { --top: #FFFFFF; --bot: #E9E9E9; --route: #0A0A0A; --accent: #0A0A0A; }
.sw-sunset { --top: #2B1638; --bot: #5B2344; --route: #FF8A3D; --accent: #FF8A3D; }
.sw-arctic { --top: #F4F9FD; --bot: #D5E6F3; --route: #0C1B2A; --accent: #2F7DF6; }
.sw-grape  { --top: #2C1A4D; --bot: #130A24; --route: #FF6BB0; --accent: #FF6BB0; }

.templates { margin: 0; display: grid; }
.templates > div {
  display: grid; grid-template-columns: 8.5em minmax(0, 1fr); gap: 4px 16px; align-items: baseline;
  padding: 14px 0; border-top: 1px solid var(--rim);
}
.templates dt { font: italic 700 24px/1 var(--f-cond); text-transform: uppercase; }
.templates dd { margin: 0; color: var(--fog); font-size: 15px; line-height: 1.4; }
@media (min-width: 900px) {
  .templates { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0 24px; }
  .templates > div { grid-template-columns: none; align-content: start; padding-top: 16px; }
  .templates dd { margin-top: 6px; }
}
.kit-note { margin: 18px 0 0; font-size: 15px; color: var(--tert); }

/* ---------- Widgets ---------- */

@media (min-width: 960px) {
  .widgets-grid { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 64px; align-items: start; }
  .widgets-grid .section-head { margin-bottom: 0; position: sticky; top: 32px; }
}
.spec { margin: 0; }
.spec > div { display: grid; gap: 4px 24px; padding: 18px 0; border-top: 1px solid var(--rim); }
.spec > div:last-child { border-bottom: 1px solid var(--rim); }
@media (min-width: 640px) { .spec > div { grid-template-columns: 11em minmax(0, 1fr); } }
.spec dt { font-weight: 600; color: var(--chalk); }
.spec dd { margin: 0; color: var(--fog); }

/* ---------- How it works ---------- */

.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 40px; }
@media (min-width: 820px) { .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(24px, 4vw, 48px); } }
.steps li { position: relative; padding-top: 30px; }
/* A progress bar on each step, like the recap's own: a third, two thirds, done. */
.steps li::before, .steps li::after {
  content: ""; position: absolute; top: 0; left: 0; height: 4px; border-radius: 2px;
}
.steps li::before { right: 0; background: var(--rim); }
.steps li::after { width: 33.4%; background: var(--volt); }
.steps li:nth-child(2)::after { width: 66.7%; }
.steps li:nth-child(3)::after { width: 100%; }
.step-n { display: block; font: italic 700 52px/0.9 var(--f-cond); color: var(--chalk); }
.steps h3 { margin: 14px 0 8px; font: 600 21px/1.25 var(--f-body); }
.steps p { margin: 0; color: var(--fog); max-width: 30em; }

/* ---------- On the device ---------- */

.device-grid { display: grid; gap: 40px; align-items: start; }
@media (min-width: 960px) { .device-grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: 72px; } }
.device .h2 { max-width: 12em; }
.device-body { margin: 16px 0 0; max-width: 32em; color: var(--fog); font-size: clamp(17px, 2vw, 19px); }
.sheet { margin: 0; border: 1px solid var(--rim); border-radius: var(--radius); background: var(--pit); padding: 4px 20px; }
.sheet > div { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 13px 0; border-top: 1px solid var(--rim); }
.sheet > div:first-child { border-top: 0; }
.sheet dt { color: var(--fog); font-size: 15px; }
.sheet dd { margin: 0; text-align: right; font-weight: 600; }
.sheet > div:last-child dd { color: var(--volt); }

/* ---------- Finish ---------- */

.finish { border-top: 1px solid var(--hair); padding-bottom: clamp(64px, 10vw, 120px); }
/* The logo's finish band, run across the page: two rows of chalk and ink squares. */
.finish-band {
  height: 24px;
  background: repeating-conic-gradient(var(--chalk) 0 25%, var(--ink) 0 50%) 0 0 / 24px 24px;
  opacity: 0.9;
}
.finish-inner { padding-top: clamp(48px, 8vw, 88px); display: grid; gap: 40px; align-items: center; }
@media (min-width: 820px) { .finish-inner { grid-template-columns: minmax(0, 1fr) auto; } }
.finish-mark { width: clamp(96px, 20vw, 232px); height: auto; justify-self: start; }
@media (min-width: 820px) { .finish-mark { justify-self: end; margin-right: 24px; } }
.finish .h2 { max-width: 13em; }
.finish-copy > p { margin: 14px 0 0; max-width: 32em; color: var(--fog); font-size: clamp(17px, 2vw, 19px); }
.finish-actions { margin-top: 30px; display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; }
.stores { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.stores li {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border-radius: 999px;
  border: 1px solid var(--rim2); color: var(--fog); font-size: 14px; font-weight: 600;
}

@media (prefers-reduced-motion: reduce) {
  .reels { scroll-behavior: auto; }
}
