/* ==========================================================================
   Font — loaded locally from /fonts (see README.md)
   ========================================================================== */
@font-face {
  font-family: 'Darvish';
  src: url('../fonts/DarvishVF.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ==========================================================================
   Tokens
   ========================================================================== */
:root {
  --white: #ffffff;
  --black: #000000;
  --grey: #cacaca;
  --taupe: #897a64;

  --ink-soft: rgba(0, 0, 0, .68);
  --line-dark: rgba(255, 255, 255, .2);
  --line-dark-strong: rgba(255, 255, 255, .35);

  --font: 'Darvish', Tahoma, 'Segoe UI', system-ui, sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --gutter: clamp(1.25rem, 4vw, 3.5rem);
  --radius: 6px;
}

/* ==========================================================================
   Base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }
html.is-locked { overflow: hidden; }

body {
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.8;
  color: var(--black);
  background: var(--white);
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: default; }
input { font: inherit; }
svg { display: block; }
:focus-visible { outline: 2px solid var(--taupe); outline-offset: 3px; }

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

@keyframes rise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px; padding: .75rem 1.6rem;
  border: 1px solid var(--black); border-radius: var(--radius);
  background: transparent; color: var(--black); font-weight: 700;
  transition: background-color .25s, color .25s, border-color .25s;
}
.btn:hover { background: var(--black); color: var(--white); }

.btn--light { background: var(--white); border-color: var(--white); color: var(--black); }
.btn--light:hover { background: var(--taupe); border-color: var(--taupe); color: var(--black); }
.btn--light.is-selected { background: var(--taupe); border-color: var(--taupe); color: var(--black); }

.btn--solid { background: var(--taupe); border-color: var(--taupe); color: var(--black); }
.btn--solid:hover { background: var(--white); border-color: var(--white); color: var(--black); }

.text-btn {
  padding: .5rem 0; color: var(--black); font-weight: 700;
  border-bottom: 1px solid var(--taupe);
  transition: border-color .25s;
}
.text-btn:hover { border-color: var(--black); }

.icon-btn {
  flex: none; width: 46px; height: 46px; display: grid; place-items: center;
  border: 1px solid var(--line-dark-strong); border-radius: var(--radius);
  color: var(--white); transition: background-color .25s, color .25s;
}
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn:hover { background: var(--white); color: var(--black); }

/* ==========================================================================
   Steps
   ========================================================================== */
.step { min-height: 100dvh; display: flex; flex-direction: column; }

/* ---- Step 1: priority ---------------------------------------------------- */
.step--ask { padding: 0; }

.ask__title {
  padding: var(--gutter);
  font-size: clamp(1.25rem, 2.4vw, 1.75rem);
  font-weight: 400; line-height: 1.9;
  animation: fade .9s var(--ease) both;
}

.ask__choices {
  flex: 1; display: flex; min-height: 60dvh;
  border-top: 1px solid var(--grey);
}

.choice {
  position: relative; min-width: 0; overflow: hidden;
  flex: 1 1 0; display: grid; place-items: center; padding: 2rem;
  transition: flex-grow .65s var(--ease), padding .65s var(--ease),
              background-color .35s, color .35s, opacity .45s;
}
.choice + .choice { border-inline-start: 1px solid var(--grey); }

.choice__word {
  display: block; font-weight: 700; line-height: 1.3;
  font-size: clamp(3.5rem, min(12vw, 26vh), 12rem);
  animation: rise .9s var(--ease) both;
}
.choice:nth-child(2) .choice__word { animation-delay: .12s; }

@media (hover: hover) {
  .choice:hover { background: var(--black); color: var(--white); }
}
.choice:focus-visible { background: var(--black); color: var(--white); outline-offset: -8px; }

.ask__choices.is-choosing .choice { pointer-events: none; }
.ask__choices.is-choosing .choice.is-chosen { background: var(--black); color: var(--white); }
.ask__choices.is-choosing .choice:not(.is-chosen) { flex-grow: 0; padding-inline: 0; opacity: 0; }

@media (max-width: 640px) and (orientation: portrait) {
  .ask__choices { flex-direction: column; }
  .choice + .choice { border-inline-start: 0; border-top: 1px solid var(--grey); }
  .choice__word { font-size: clamp(4rem, min(24vw, 16vh), 8rem); }
  .ask__choices.is-choosing .choice:not(.is-chosen) { padding-block: 0; }
}

/* ---- Step 2: plans ------------------------------------------------------- */
.step--plans {
  width: 100%; max-width: 1400px; margin-inline: auto;
  padding: var(--gutter); gap: clamp(1.5rem, 3vw, 2.5rem);
}
.step--plans.has-summary { padding-bottom: 9rem; }

.plans__top { display: flex; justify-content: space-between; align-items: flex-start; gap: 1.5rem; }
.plans__title { font-size: clamp(1.9rem, 4.2vw, 3.25rem); line-height: 1.4; font-weight: 700; }
.plans__hint { margin-top: .5rem; font-size: 1.15rem; color: var(--ink-soft); }
.step--plans.is-enter .plans__top { animation: fade .7s var(--ease) both; }

.plans {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid var(--grey);
}
.plan {
  display: flex; flex-direction: column; gap: 1.75rem;
  padding: clamp(1.5rem, 3vw, 2.5rem);
  transition: background-color .4s, color .4s;
}
.plan + .plan { border-inline-start: 1px solid var(--grey); }
.plan.is-recommended { background: var(--black); color: var(--white); }
.plan.is-selected { box-shadow: inset 0 4px 0 var(--taupe); }
.step--plans.is-enter .plan { animation: rise .8s var(--ease) both; }
.step--plans.is-enter .plan:nth-child(1) { animation-delay: .05s; }
.step--plans.is-enter .plan:nth-child(2) { animation-delay: .15s; }
.step--plans.is-enter .plan:nth-child(3) { animation-delay: .25s; }

.plan__flag { min-height: 1.8em; font-weight: 700; font-size: .95rem; }
.plan__flag:not(:empty)::before {
  content: ''; display: inline-block; width: .55rem; height: .55rem;
  margin-inline-end: .5rem; background: var(--taupe);
}
.plan__name { font-size: clamp(2rem, 3.4vw, 2.9rem); line-height: 1.3; font-weight: 700; }
.plan__quality { margin-top: .75rem; font-size: 1.15rem; color: var(--ink-soft); }
.plan.is-recommended .plan__quality { color: var(--grey); }

.meter { display: flex; gap: 6px; margin-top: 1rem; }
.meter i { display: block; width: 2.25rem; height: 4px; background: var(--grey); }
.meter i.on { background: var(--taupe); }

.price { margin-top: auto; display: grid; gap: .1rem; }
.price__num { font-size: clamp(2.2rem, 3.6vw, 3.1rem); font-weight: 700; line-height: 1.3; font-variant-numeric: tabular-nums; }
.price__unit { color: var(--ink-soft); }
.plan.is-recommended .price__unit { color: var(--grey); }

.plan .btn { width: 100%; }
.plan.is-recommended .btn { border-color: var(--white); color: var(--white); }
.plan.is-recommended .btn:hover { background: var(--white); color: var(--black); }

@media (max-width: 820px) {
  .plans { grid-template-columns: minmax(0, 1fr); }
  .plan + .plan { border-inline-start: 0; border-top: 1px solid var(--grey); }
  .plan { gap: 1.25rem; }
  .price { margin-top: .5rem; }
  .plans__top { flex-direction: column-reverse; gap: .5rem; }
  .plans__top .text-btn { align-self: flex-start; }
}

/* What's included */
.included { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 3fr); gap: 1.5rem 2.5rem; margin-top: clamp(.5rem, 2vw, 1.5rem); }
.included__title { font-size: 1.35rem; font-weight: 700; line-height: 1.6; }
.included__list {
  list-style: none; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr));
  column-gap: 2.5rem;
}
.included__list li {
  display: flex; align-items: baseline; gap: .75rem;
  padding-block: .7rem; border-bottom: 1px solid var(--grey);
}
.included__list li::before {
  content: ''; flex: none; width: .5rem; height: .5rem; border-radius: 50%;
  background: var(--taupe); transform: translateY(-.1em);
}
@media (max-width: 820px) { .included { grid-template-columns: minmax(0, 1fr); } }

/* Selection summary bar */
.summary {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem;
  padding: 1rem var(--gutter) calc(1rem + env(safe-area-inset-bottom));
  background: var(--black); color: var(--white);
  transform: translateY(105%); visibility: hidden;
  transition: transform .6s var(--ease), visibility 0s linear .6s;
}
.summary.is-visible { transform: none; visibility: visible; transition-delay: 0s; }
.summary__main { display: flex; flex-wrap: wrap; align-items: baseline; gap: .1rem 1.75rem; }
.summary__text { color: var(--grey); }
.summary__text b { color: var(--white); }
.summary__total { font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 700; line-height: 1.5; }
.summary .btn { flex: none; min-height: 46px; }

/* ==========================================================================
   Offcanvas
   ========================================================================== */
.sheet {
  position: fixed; top: 0; left: 0; right: 0; height: 100vh; height: 100dvh; z-index: 50;
  visibility: hidden; transition: visibility 0s linear .6s;
}
.sheet.is-open { visibility: visible; transition-delay: 0s; }

.sheet__backdrop {
  position: absolute; inset: 0; background: rgba(0, 0, 0, .6);
  opacity: 0; transition: opacity .5s;
}
.sheet.is-open .sheet__backdrop { opacity: 1; }

.sheet__panel {
  --gut: clamp(1rem, 2.4vw, 2rem);
  --bar-h: 72px;
  position: absolute; top: 0; bottom: 0; left: 0;
  width: 100%;
  display: flex; flex-direction: column;
  background: var(--black); color: var(--white);
  transform: translateY(100%);
  transition: transform .6s var(--ease);
}
.sheet.is-open .sheet__panel { transform: none; }

.sheet__bar {
  flex: none; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  min-height: var(--bar-h);
  padding: .75rem var(--gut); padding-top: calc(.75rem + env(safe-area-inset-top));
  border-bottom: 1px solid var(--line-dark);
}

.tabs {
  display: flex; gap: .25rem; padding: .25rem; min-width: 0;
  border: 1px solid var(--line-dark-strong); border-radius: var(--radius);
  overflow-x: auto; scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  min-height: 40px; padding: .25rem 1.15rem; white-space: nowrap;
  border-radius: 4px; color: var(--grey);
  transition: background-color .25s, color .25s;
}
.tab:hover { color: var(--white); }
.tab[aria-pressed="true"] { background: var(--white); color: var(--black); font-weight: 700; }

.sheet__body {
  --player-h: min(72dvh, 640px);
  --player-w: calc(var(--player-h) * 9 / 16);
  flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; gap: 2rem;
  padding: 1.25rem var(--gut) calc(2.5rem + env(safe-area-inset-bottom));
}

@media (min-width: 900px), (min-width: 700px) and (orientation: landscape) {
  .sheet__panel {
    width: min(1120px, 100%);
    transform: translateX(-100%);
  }
  .sheet.is-open .sheet__panel { transform: none; }
  .sheet__body {
    --player-h: clamp(240px, calc(100dvh - var(--bar-h) - 8rem), 800px);
    grid-template-columns: max-content minmax(0, 1fr);
    gap: clamp(2rem, 4vw, 4rem);
    padding-top: 1.5rem;
  }
}

/* Stage: player + pagination */
.stage { display: flex; flex-direction: column; align-items: center; min-width: 0; }
@media (min-width: 900px), (min-width: 700px) and (orientation: landscape) {
  .stage { width: max(var(--player-w), 21rem); position: sticky; top: 0; align-self: start; }
}

.player {
  position: relative; isolation: isolate; overflow: hidden;
  width: min(var(--player-w), 100%); aspect-ratio: 9 / 16;
  background: var(--black);
  border: 1px solid var(--line-dark-strong); border-radius: 14px;
}
.player video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: contain; background: var(--black);
}
.player video.is-swap { animation: swap .45s var(--ease); }
@keyframes swap { from { opacity: 0; transform: scale(1.02); } to { opacity: 1; transform: none; } }

.player__hit { position: absolute; inset: 0; z-index: 1; display: grid; place-items: center; }
.player__bigplay {
  display: grid; place-items: center; width: 76px; height: 76px; border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, .85); background: rgba(0, 0, 0, .35); color: var(--white);
  opacity: 0; transform: scale(.85);
  transition: opacity .3s, transform .3s var(--ease);
}
.player__bigplay svg { width: 34px; height: 34px; transform: translateX(2px); }
.player:not(.is-playing) .player__bigplay { opacity: 1; transform: none; }
.player.is-error .player__bigplay { display: none; }

.player__empty {
  position: absolute; inset: 0; z-index: 1;
  display: grid; align-content: center; justify-items: center; gap: .75rem;
  padding: 1.5rem; text-align: center; color: var(--grey); background: var(--black);
}
.player__empty code { font-size: .75rem; color: var(--taupe); word-break: break-all; }

/* Player controls */
.player__ui {
  position: absolute; inset-inline: 0; bottom: 0; z-index: 2;
  display: grid; gap: .1rem; padding: 2.75rem .9rem .6rem;
  background: linear-gradient(to top, rgba(0, 0, 0, .88), rgba(0, 0, 0, 0));
  opacity: 0; transition: opacity .3s; pointer-events: none;
}
.player.show-ui .player__ui,
.player:not(.is-playing) .player__ui { opacity: 1; }
.player.show-ui .player__ui > *,
.player:not(.is-playing) .player__ui > * { pointer-events: auto; }

.player__row { display: flex; align-items: center; gap: .15rem; }
.player__time { display: flex; gap: .3em; direction: ltr; padding-inline: .5rem; font-size: .85rem; color: var(--grey); font-variant-numeric: tabular-nums; white-space: nowrap; }

.ctl {
  flex: none; width: 44px; height: 44px; display: grid; place-items: center;
  border-radius: var(--radius); color: var(--white); transition: background-color .2s;
}
.ctl:hover { background: rgba(255, 255, 255, .16); }
.ctl svg { width: 24px; height: 24px; }

.ico-pause, .ico-mute, .ico-fs-out { display: none; }
.player.is-playing .ico-play { display: none; }
.player.is-playing .ico-pause { display: block; }
.player.is-muted .ico-vol { display: none; }
.player.is-muted .ico-mute { display: block; }
.player.is-fs .ico-fs-in { display: none; }
.player.is-fs .ico-fs-out { display: block; }

.ctl-nav { display: none; }
.player.is-fs .ctl-nav { display: flex; }

.seek {
  --p: 0%;
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 22px; margin: 0; background: transparent; cursor: pointer; direction: ltr;
}
.seek::-webkit-slider-runnable-track { height: 4px; border-radius: 4px; background: linear-gradient(to right, var(--white) var(--p), rgba(255, 255, 255, .3) var(--p)); }
.seek::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; margin-top: -5px; border-radius: 50%; background: var(--white); border: 0; }
.seek::-moz-range-track { height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .3); }
.seek::-moz-range-progress { height: 4px; border-radius: 4px; background: var(--white); }
.seek::-moz-range-thumb { width: 14px; height: 14px; border: 0; border-radius: 50%; background: var(--white); }

/* Fullscreen */
.player.is-fs { width: 100%; height: 100%; aspect-ratio: auto; border: 0; border-radius: 0; }
.player.is-fs .player__ui { padding: 3.5rem max(1.25rem, env(safe-area-inset-right)) max(1rem, env(safe-area-inset-bottom)); }
.player.is-fs .ctl { width: 52px; height: 52px; }

/* Pagination */
.pager { display: flex; align-items: center; gap: .5rem; width: min(100%, 26rem); margin-top: 1.1rem; }
.pager__arrow {
  flex: none; width: 46px; height: 46px; display: grid; place-items: center;
  border: 1px solid var(--line-dark-strong); border-radius: var(--radius);
  transition: background-color .25s, color .25s, opacity .25s;
}
.pager__arrow svg { width: 22px; height: 22px; }
.pager__arrow:disabled { opacity: .3; }
.pager__arrow:not(:disabled):hover { background: var(--white); color: var(--black); }

.pager__list { flex: 1; min-width: 0; display: flex; gap: .125rem; padding: 2px; overflow-x: auto; scrollbar-width: none; }
.pager__list::-webkit-scrollbar { display: none; }
.pager__num {
  flex: none; min-width: 38px; height: 46px; border-radius: var(--radius); color: var(--grey);
  transition: background-color .25s, color .25s;
}
.pager__num:first-child { margin-inline-start: auto; }
.pager__num:last-child { margin-inline-end: auto; }
.pager__num:hover { color: var(--white); }
.pager__num[aria-current="true"] { background: var(--white); color: var(--black); font-weight: 700; }

/* Choose plan + calculator */
.choose { display: flex; flex-direction: column; gap: 1.5rem; min-width: 0; max-width: 36rem; }
.choose__name { font-size: clamp(2rem, 3.2vw, 2.8rem); line-height: 1.3; font-weight: 700; }
.choose__quality { margin-top: .75rem; font-size: 1.15rem; color: var(--grey); }
.choose__price { margin-top: 1rem; color: var(--grey); }
.choose__num { display: block; font-size: 1.9rem; font-weight: 700; line-height: 1.3; color: var(--white); font-variant-numeric: tabular-nums; }
.choose__note {
  padding-inline-start: .85rem; border-inline-start: 2px solid var(--taupe);
  color: var(--grey); font-size: .95rem;
}
.choose .btn { width: 100%; }

.reveal { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .6s var(--ease); }
.reveal.is-open { grid-template-rows: 1fr; }
.reveal__inner { min-height: 0; overflow: hidden; padding-inline: 6px; margin-inline: -6px; }

.calc {
  display: grid; gap: 1.25rem; padding-top: 1.5rem; padding-bottom: 6px;
  border-top: 1px solid var(--line-dark);
  opacity: 0; transform: translateY(10px);
  transition: opacity .5s .15s, transform .5s var(--ease) .15s;
}
.reveal.is-open .calc { opacity: 1; transform: none; }
.calc__label { font-weight: 700; }

.stepper { display: flex; align-items: stretch; width: fit-content; border: 1px solid var(--line-dark-strong); border-radius: var(--radius); }
.stepper__btn { width: 52px; min-height: 52px; font-size: 1.6rem; line-height: 1; transition: background-color .2s, color .2s; }
.stepper__btn:first-child { border-radius: 5px 0 0 5px; }
.stepper__btn:last-child { border-radius: 0 5px 5px 0; }
.stepper__btn:not(:disabled):hover { background: var(--white); color: var(--black); }
.stepper__btn:disabled { opacity: .3; }
.stepper__input {
  width: 4.75rem; text-align: center; font-size: 1.6rem; font-weight: 700;
  color: var(--white); background: transparent; border: 0;
  border-inline: 1px solid var(--line-dark-strong); border-radius: 0;
}
.stepper__input:focus-visible { outline-offset: -3px; }

.calc__row { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1rem; }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip {
  min-width: 56px; min-height: 44px; padding: 0 1rem;
  border: 1px solid var(--line-dark-strong); border-radius: var(--radius); color: var(--grey);
  transition: background-color .2s, color .2s, border-color .2s;
}
.chip:hover { color: var(--white); border-color: var(--white); }
.chip[aria-pressed="true"] { background: var(--white); border-color: var(--white); color: var(--black); font-weight: 700; }

.result { display: grid; gap: .25rem; padding-block: 1.25rem; border-block: 1px solid var(--line-dark); }
.result__eq { font-size: 1.15rem; color: var(--grey); }
.result__label { color: var(--grey); }
.result__total { font-size: clamp(2.4rem, 5vw, 3.6rem); font-weight: 700; line-height: 1.3; font-variant-numeric: tabular-nums; }
.result__unit { font-size: 1.2rem; font-weight: 400; color: var(--taupe); }

/* ==========================================================================
   Reduced motion
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important; animation-delay: 0s !important;
    transition-duration: .01ms !important; transition-delay: 0s !important;
  }
}
