/* Towrix + Subrix: colour chapters.
   Palette and type come from the two apps themselves; the proportions
   (one flat field per chapter, ink or paper text, one accent on the action)
   come from the dealt direction. */

/* ---------- tokens ---------- */
:root {
  /* the apps' own colours */
  --ground: #f3f5fa;
  --paper: #ffffff;
  --ink: #0d1b3d;
  --cobalt: #1c47b8;
  --navy: #0d1b3d;
  --gold: #f6c443;
  --down: #c2413a;
  --up: #0f6b4a;
  --on-dark: #f1f4fc;

  /* the field this chapter is painted in */
  --field: var(--ground);
  --field-ink: var(--ink);
  --accent: var(--cobalt);
  --accent-ink: #ffffff;
  --panel: var(--paper);
  --panel-ink: var(--ink);

  /* five type steps, no sixth */
  --step-small: clamp(0.8125rem, 0.79rem + 0.1vw, 0.875rem);
  --step-body: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
  --step-lead: clamp(1.25rem, 1.1rem + 0.7vw, 1.625rem);
  --step-head: clamp(2rem, 1.3rem + 3.2vw, 4rem);
  --step-display: clamp(2.75rem, 6.4vw, 6.25rem);

  --margin: clamp(16px, 3vw, 32px);
  --gap: clamp(16px, 1.6vw, 28px);
  --radius: 14px;              /* the apps' own card radius */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scrollbar-gutter: stable both-edges; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: Rubik, "Segoe UI", system-ui, sans-serif;
  font-size: var(--step-body);
  font-weight: 400;
  line-height: 1.5;
  background: var(--ground);
  color: var(--ink);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img, video, svg { display: block; max-width: 100%; }
img, video { height: auto; }

h1, h2, h3 {
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.025em;
  margin: 0;
  text-wrap: balance;
}
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }

a { color: inherit; }
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}
.chapter--cobalt :focus-visible, .chapter--navy :focus-visible { outline-color: var(--gold); }

::selection { background: var(--gold); color: var(--navy); }

.skip {
  position: absolute; inset-inline-start: var(--margin); top: -100px;
  background: var(--navy); color: var(--on-dark);
  padding: 12px 22px; border-radius: 999px; z-index: 50;
  transition: top 0.2s var(--ease);
}
.skip:focus { top: 12px; }

/* ---------- the shared grid ---------- */
.wrap {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--gap);
  margin-inline: var(--margin);
}

.chapter {
  --pad: clamp(72px, 9vh, 128px);
  padding-block: var(--pad);
  background: var(--field);
  color: var(--field-ink);
  min-height: 90svh;
  display: grid;
  align-content: center;
  position: relative;
}

.chapter--ground { --field: var(--ground); --field-ink: var(--ink); --accent: var(--cobalt); --accent-ink: #fff; }
.chapter--paper  { --field: var(--paper);  --field-ink: var(--ink); --accent: var(--cobalt); --accent-ink: #fff; }
.chapter--cobalt { --field: var(--cobalt); --field-ink: #ffffff;    --accent: var(--gold);   --accent-ink: var(--navy); }
.chapter--navy   { --field: var(--navy);   --field-ink: var(--on-dark); --accent: var(--gold); --accent-ink: var(--navy); }
.chapter--gold   { --field: var(--gold);   --field-ink: var(--ink); --accent: var(--cobalt); --accent-ink: #fff; }

/* every chapter's heading starts on the same edge */
.chapter > .wrap > h2,
.chapter > .wrap > .head { grid-column: 1 / 9; }

h2 { font-size: var(--step-head); }
.lead { font-size: var(--step-lead); line-height: 1.3; max-width: 22ch; }
.say  { font-size: var(--step-body); line-height: 1.55; max-width: 60ch; }
.small { font-size: var(--step-small); line-height: 1.5; }
b, strong { font-weight: 600; }

/* ---------- the one button shape: round, like the rings ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5em;
  padding: 0.85em 1.8em;
  background: var(--accent); color: var(--accent-ink);
  font: inherit; font-weight: 500; font-size: var(--step-body);
  text-decoration: none; border: 0; border-radius: 999px; cursor: pointer;
  transition: transform 0.18s var(--ease), filter 0.18s var(--ease);
}
.btn:hover { filter: brightness(1.08); transform: translateY(-2px); }
.btn:active { transform: translateY(0) scale(0.98); }

.btn--quiet {
  background: transparent; color: var(--field-ink);
  border: 2px solid currentColor;
}
.btn--quiet:hover { background: var(--field-ink); color: var(--field); filter: none; }

/* ---------- navigation: the first chapter's colours ---------- */
.nav {
  position: absolute; inset-inline: 0; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--gap);
  padding: clamp(18px, 2.4vh, 30px) var(--margin);
}
.nav__mark { font-size: var(--step-lead); font-weight: 600; letter-spacing: -0.02em; text-decoration: none; }
.nav__mark span { color: var(--cobalt); }
.nav__links { display: flex; gap: clamp(14px, 1.8vw, 30px); align-items: center; }
.nav__links a { font-size: var(--step-small); text-decoration: none; font-weight: 500; }
.nav__links a:hover { text-decoration: underline; text-underline-offset: 4px; }
.nav__lang { font-weight: 600; }

/* ---------- 1. hero: the two giant shapes ---------- */
.hero { min-height: 100svh; overflow: clip; }
.hero .wrap { align-items: center; }

.hero__art {
  position: absolute; inset: 0; pointer-events: none;
  display: grid; place-items: center;
}
.hero__art svg {
  position: absolute;
  width: 120vh; height: 120vh;
  /* the pair enters from the side the headline is not on */
  left: 78%; top: 55%;
  translate: -50% -50%;
  max-width: none;
}
[dir="rtl"] .hero__art svg { left: 22%; }

.hero__text { grid-column: 1 / 7; position: relative; z-index: 2; }
.hero h1 {
  font-size: var(--step-display);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 0.98;
}
.hero__said { margin-top: clamp(28px, 3.2vh, 48px); font-size: var(--step-lead); line-height: 1.35; max-width: 26ch; }
.hero__do { margin-top: clamp(28px, 3.2vh, 44px); display: flex; flex-wrap: wrap; gap: 14px; }

/* ---------- 2. intro: one statement, edge to edge ---------- */
.statement {
  grid-column: 1 / 8;
  font-size: var(--step-lead);
  font-weight: 500;
  line-height: 1.35;
  margin-top: clamp(28px, 4vh, 56px);
}
.statement--aside { grid-column: 9 / 13; align-self: end; font-weight: 400; font-size: var(--step-body); line-height: 1.55; }

.chips {
  grid-column: 1 / -1; margin-top: clamp(40px, 6vh, 86px);
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(24px, 4vw, 72px);
}
.chip img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: center top; }
.chip figcaption { margin-top: 16px; font-size: var(--step-lead); font-weight: 500; line-height: 1.25; }

/* ---------- 3 & 4. the two app chapters ---------- */
.app__head { grid-column: 1 / -1; }
.app__name { display: flex; align-items: center; gap: 16px; }
.app__name img { width: clamp(48px, 5vw, 72px); height: auto; border-radius: 22%; }
.app__name h2 { font-size: var(--step-head); }

.app__lead { grid-column: 1 / 7; margin-top: clamp(26px, 3.4vh, 44px); font-size: var(--step-lead); line-height: 1.3; }
.app__note { grid-column: 1 / 7; margin-top: 18px; }

.app__list {
  grid-column: 1 / 7; margin-top: clamp(28px, 3.6vh, 46px);
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(20px, 2.6vh, 34px) clamp(20px, 2.4vw, 40px); align-content: start;
}
.app__list h3 { font-size: var(--step-body); font-weight: 600; letter-spacing: 0; line-height: 1.35; }
.app__list p { margin-top: 6px; font-size: var(--step-small); }

.app__stage {
  grid-column: 8 / 13; grid-row: 2 / 5; align-self: center;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(16px, 2vw, 32px);
  align-items: start;
}
.app__film, .app__shot { position: relative; margin: 0; }
.app__film video, .app__film img, .app__shot img { width: 100%; aspect-ratio: 9 / 16; object-fit: cover; object-position: center top; background: var(--navy); border-radius: var(--radius); }
.app__film figcaption, .app__shot figcaption { margin-top: 12px; font-size: var(--step-small); font-weight: 500; opacity: 0.85; }

/* the shutter: the one signature move. Visible by default; the clip is
   only applied for the moment the move runs, so no script = no hidden shot. */
.shutter { display: block; overflow: clip; }
.shutter img { width: 100%; transform-origin: center; }
.js .shutter.is-shot { animation: shutter-open 1.1s var(--ease) both; }
.js .shutter.is-shot img { animation: shutter-settle 1.1s var(--ease) both; }
@keyframes shutter-open { from { clip-path: inset(0 0 0 100%); } to { clip-path: inset(0 0 0 0); } }
@keyframes shutter-settle { from { transform: scale(1.12); } to { transform: none; } }

/* the control on each moving picture */
.app__film { position: relative; }
.film__toggle {
  position: absolute; inset-block-end: 12px; inset-inline-end: 12px;
  width: 42px; height: 42px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--paper); color: var(--ink);
  transition: transform 0.16s var(--ease), background 0.16s var(--ease);
}
.film__toggle:hover { transform: scale(1.08); background: var(--gold); }
.film__toggle:active { transform: scale(0.94); }
.film__toggle::before {
  content: ""; display: block; margin: 0 auto;
  width: 0; height: 0;
  border-inline-start: 13px solid currentColor;
  border-block: 8px solid transparent;
}
[dir="rtl"] .film__toggle::before { rotate: 180deg; }
.film__toggle[data-state="playing"]::before {
  width: 12px; height: 14px; border: 0;
  background: currentColor;
  clip-path: polygon(0 0, 36% 0, 36% 100%, 0 100%, 0 0, 64% 0, 100% 0, 100% 100%, 64% 100%, 64% 0);
  rotate: none;
}

/* ---------- 5. how it works ---------- */
.steps {
  grid-column: 1 / -1; margin-top: clamp(36px, 5vh, 64px);
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(24px, 3vw, 56px);
}
.steps li { display: grid; gap: 12px; align-content: start; }
.steps h3 { font-size: var(--step-lead); font-weight: 500; line-height: 1.2; }
.steps p { font-size: var(--step-body); }

/* ---------- 6. prices and the calculator ---------- */
.plans { grid-column: 1 / -1; margin-top: clamp(34px, 4.5vh, 60px); display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gap); }
.plan { background: var(--panel); color: var(--panel-ink); border-radius: var(--radius); padding: clamp(20px, 2.4vw, 32px); display: grid; align-content: start; gap: 8px; }
.plan dd { order: 1; }
.plan dt { order: 2; font-size: var(--step-body); font-weight: 500; }
.plan .per { order: 3; }
.plan dd { margin: 0; font-size: var(--step-head); font-weight: 600; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.plan .per { font-size: var(--step-small); font-weight: 500; color: #55617f; }
.plan--best { background: var(--gold); color: var(--navy); }
.plan--best .per { color: #473c10; }

.extras { grid-column: 1 / 8; margin-top: clamp(26px, 3vh, 40px); display: grid; gap: 12px; }
.extras p { max-width: 52ch; }

.calc { grid-column: 8 / 13; margin-top: clamp(26px, 3vh, 40px); background: var(--panel); color: var(--panel-ink); border-radius: var(--radius); padding: clamp(22px, 2.4vw, 32px); }
.calc__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px; }
.calc__total { order: -1; }
.calc h3 { font-size: var(--step-body); font-weight: 600; letter-spacing: 0; }
.calc fieldset { border: 0; padding: 0; margin: 22px 0 0; }
.calc legend { padding: 0; font-size: var(--step-small); font-weight: 500; color: #55617f; margin-bottom: 10px; }
.calc__months { display: flex; flex-wrap: wrap; gap: 8px; }
.calc__months label { cursor: pointer; }
.calc__months input { position: absolute; opacity: 0; width: 0; height: 0; }
.calc__months span {
  display: inline-block;
  padding: 0.5em 1.1em; border-radius: 999px;
  background: var(--ground); color: var(--ink); font-size: var(--step-small); font-weight: 500;
  transition: background 0.16s var(--ease), color 0.16s var(--ease), transform 0.16s var(--ease);
}
.calc__months label:hover span { transform: translateY(-2px); }
.calc__months input:checked + span { background: var(--cobalt); color: #fff; }
.calc__months input:focus-visible + span { outline: 3px solid var(--cobalt); outline-offset: 3px; }

.stepper { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; }
.stepper > span { font-size: var(--step-small); }
.stepper div { display: flex; align-items: center; gap: 6px; }
.stepper button {
  width: 36px; height: 36px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--ground); color: var(--ink); font: inherit; font-size: var(--step-body); font-weight: 600;
  transition: background 0.16s var(--ease), transform 0.16s var(--ease);
}
.stepper button:hover { background: var(--cobalt); color: #fff; }
.stepper button:active { transform: scale(0.92); }
.stepper output { min-width: 2ch; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; }

.calc__total { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.calc__total .n { font-size: var(--step-head); font-weight: 600; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.calc__total .t { font-size: var(--step-small); color: #55617f; }

/* ---------- 7. questions ---------- */
.qa {
  grid-column: 1 / -1; margin-top: clamp(32px, 4vh, 54px);
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px clamp(20px, 3vw, 48px); align-content: start;
}
.qa details { background: var(--panel); color: var(--panel-ink); border-radius: var(--radius); }
.qa summary {
  padding: clamp(18px, 2vw, 26px); cursor: pointer; list-style: none;
  font-weight: 500; display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.qa summary::-webkit-details-marker { display: none; }
.qa summary::after { content: "+"; font-size: 1.5em; line-height: 1; font-weight: 400; transition: rotate 0.22s var(--ease); }
.qa details[open] summary::after { rotate: 45deg; }
.qa .a { padding: 0 clamp(18px, 2vw, 26px) clamp(20px, 2vw, 26px); max-width: 60ch; }
.qa .a p + p { margin-top: 10px; }

/* ---------- 8. get it, and the close ---------- */
.get { grid-column: 1 / -1; margin-top: clamp(34px, 4.5vh, 56px); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(22px, 3vw, 48px); }
.get__app h3 { font-size: var(--step-lead); font-weight: 600; letter-spacing: -0.02em; }
.get__app p { margin-top: 10px; font-size: var(--step-small); max-width: 36ch; }
.get__links { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 12px; }
.get__links .btn { font-size: var(--step-small); padding: 0.7em 1.4em; }

.close { grid-column: 1 / -1; margin-top: clamp(48px, 7vh, 96px); }
.close__name {
  grid-column: 1 / -1;
  font-size: clamp(3rem, 13vw, 13rem); font-weight: 600;
  letter-spacing: -0.04em; line-height: 0.9;
}
.close__row { display: flex; flex-wrap: wrap; gap: 14px clamp(18px, 2.4vw, 36px); align-items: baseline; }
.close__row a { font-size: var(--step-small); text-decoration: none; font-weight: 500; }
.close__row a:hover { text-decoration: underline; text-underline-offset: 4px; }
.close__fine { margin-top: 20px; font-size: var(--step-small); color: #aab6d8; max-width: 60ch; }

/* ---------- the motion layer ---------- */
.js .rise { opacity: 0; transform: translateY(26px); }
.js .rise.is-in {
  opacity: 1; transform: none;
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
  transition-delay: var(--d, 0ms);
}

@media (prefers-reduced-motion: reduce) {
  .js .rise, .js .rise.is-in { opacity: 1 !important; transform: none !important; transition: none !important; }
  .js .shutter.is-shot, .js .shutter.is-shot img { animation: none !important; }
  .btn, .stepper button, .calc__months span, .film__toggle { transition: none; }
}

/* ---------- phone ---------- */
@media (max-width: 900px) {
  .hero__text, .app__head, .app__lead, .app__note, .extras, .calc,
  .chapter > .wrap > h2, .chapter > .wrap > .head { grid-column: 1 / -1; }
  .hero { min-height: 100svh; }
  .hero .wrap { align-content: start; padding-top: 15svh; }
  .hero h1 { font-size: clamp(2.5rem, 11.5vw, 4rem); }
  .hero__said { font-size: var(--step-body); max-width: none; }
  .hero__art svg { width: 130vw; height: 130vw; inset-inline-start: 50%; top: auto; bottom: -22vw; translate: -50% 0; }
  .hero__do { margin-bottom: 42vw; }

  .nav__links { gap: 14px; }
  .nav__links a:not(.nav__lang) { display: none; }

  .statement { grid-column: 1 / -1; font-size: clamp(1.25rem, 5.2vw, 1.625rem); }
  .statement .gap { display: none; }
  .chips { grid-column: 1 / -1; grid-row: auto; margin-top: clamp(32px, 5vh, 56px); }
  .chip { width: 40vw; }
  .steps { grid-template-columns: 1fr; gap: clamp(26px, 4vh, 40px); }
  .qa { grid-template-columns: 1fr; }

  .app__stage { grid-column: 1 / -1; grid-row: auto; margin-top: clamp(32px, 5vh, 52px); }
  .app__list { grid-column: 1 / -1; }
  .chips { grid-template-columns: 1fr; }
  .chip figcaption { font-size: var(--step-body); }
  .statement--aside { grid-column: 1 / -1; align-self: start; margin-top: 18px; }

  .plans { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .get { grid-template-columns: 1fr; }
  .close__name { font-size: clamp(2.6rem, 15vw, 5rem); }
}

@media (max-width: 560px) {
  .plans { grid-template-columns: 1fr; }
  .chip img { aspect-ratio: 4 / 3; }
}
