/* Two Lane — homepage choreography.
 *
 * The hero and the fanning deck carry the top of the page. Everything below
 * them earns its space by showing something: a device, a diagram, a meter, a
 * number that moves. A heading and a paragraph in a tall padded band reads as
 * blank, however good the words are.
 *
 * All motion is CSS scroll timelines — no library. Every animation starts
 * from a visible state, and the lot is off under prefers-reduced-motion.
 */

/* Numbers that count as you reach them. Registered so they can be animated;
   the initial value is the real figure, so a page at rest shows the truth and
   only an actual scroll-through sees it climb. */
@property --n { syntax: '<integer>'; initial-value: 97; inherits: false; }
@property --n2 { syntax: '<integer>'; initial-value: 64; inherits: false; }
@property --n3 { syntax: '<integer>'; initial-value: 62; inherits: false; }

/* ------------------------------------------------------------------ hero */

.hero {
  position: relative;
  min-height: 100svh;
  display: flex; align-items: center;
  padding: 96px 0 60px;
  overflow: hidden;
  isolation: isolate;
  background: #221E19;
  color: #FBF7F0;
}
.hero-img {
  position: absolute; inset: -10% -2% 0 -2%;
  background: url('/img/road.jpg') 62% 58% / cover no-repeat;
  z-index: -3;
  transform-origin: 60% 65%;
}
.hero-wash {
  position: absolute; inset: 0; z-index: -2;
  background:
    linear-gradient(105deg, rgba(9,8,14,0.90) 0%, rgba(9,8,14,0.62) 42%, rgba(9,8,14,0.18) 72%),
    linear-gradient(to bottom, rgba(9,8,14,0.55) 0%, rgba(9,8,14,0.05) 40%, rgba(9,8,14,0.62) 100%);
}
.hero-grid {
  position: relative; display: grid; gap: 40px; align-items: center;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
}
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; gap: 30px; } }

.hero h1 { color: #FBF7F0; max-width: 14ch; text-shadow: 0 2px 34px rgba(6,5,10,0.5); }
.hero h1 em { font-style: italic; color: var(--gold); }
.hero .sub {
  margin-top: 22px; max-width: 44ch; color: #EFEAE1; font-size: 19px;
  text-shadow: 0 1px 20px rgba(6,5,10,0.6);
}
.hero .cta { margin-top: 32px; display: flex; gap: 12px; flex-wrap: wrap; }

.hero-stage { display: grid; place-items: center; perspective: 1500px; perspective-origin: 50% 45%; }
.hero-phone {
  transform-style: preserve-3d;
  transform: rotateX(calc(6deg + var(--tiltX, 0deg))) rotateY(calc(-17deg + var(--tiltY, 0deg))) rotateZ(1.5deg);
  transition: transform .5s cubic-bezier(.22,.61,.36,1);
  filter: drop-shadow(0 46px 70px rgba(6,5,12,0.55));
}
.hero-phone .phone { max-width: 300px; }
@media (max-width: 900px) { .hero-phone .phone { max-width: 244px; } }

.hero .hint {
  display: inline-flex; align-items: center; gap: 10px; margin-top: 40px;
  color: #E6DFD3; font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; font-weight: 700;
}
.hero .hint .rule { display: block; width: 44px; height: 1px; background: rgba(255,255,255,0.5); }

/* ------------------------------------------------------------- statement
 * Two columns: the argument on the left, the moment it describes on the
 * right — a listing that promised something that was already gone.
 */

.statement { padding: clamp(72px, 11vh, 118px) 0; }
.statement .grid {
  display: grid; gap: 44px; align-items: center;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
}
@media (max-width: 860px) { .statement .grid { grid-template-columns: 1fr; gap: 34px; } }
.statement h2 { max-width: 17ch; }
.statement .after { margin-top: 22px; max-width: 50ch; color: var(--ink-2); font-size: 18px; }

.empty-stage { display: grid; place-items: center; perspective: 1300px; }
.empty-tilt {
  transform: rotateY(-13deg) rotateX(5deg) rotateZ(-1deg);
  transform-style: preserve-3d;
  filter: drop-shadow(0 30px 46px rgba(23,23,28,0.22));
}
.empty-tilt .phone { max-width: 246px; }
.sold { opacity: .55; }
.sold .m-name { text-decoration: line-through; }

/* the three facts under the statement */
.facts {
  margin-top: 46px; display: grid; gap: 1px;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  background: var(--border); border: 1px solid var(--border); border-radius: 16px; overflow: hidden;
}
.facts div { background: var(--surface); padding: 22px 24px; }
.facts .k { font-family: var(--display); font-size: 30px; line-height: 1; color: var(--ink); }
.facts .v { margin-top: 8px; font-size: 14.5px; color: var(--muted); line-height: 1.4; }

/* ------------------------------------------------------------ the fan */

.fan-wrap { height: 340vh; position: relative; view-timeline-name: --fan; view-timeline-axis: block; }
.fan-pin {
  position: sticky; top: 0; height: 100svh;
  display: grid; place-items: center;
  background: var(--deeper); color: #F6F2EA;
  overflow: clip;
}
.fan-head { position: absolute; top: clamp(46px, 9vh, 96px); left: 0; right: 0; text-align: center; padding: 0 24px; z-index: 3; }
.fan-head .eyebrow { color: var(--gold); }
.fan-head h2 { color: #F6F2EA; margin-top: 10px; max-width: 18ch; margin-inline: auto; }

.fan {
  position: relative; width: min(1000px, 92vw); height: min(560px, 58svh);
  perspective: 1600px; perspective-origin: 50% 50%;
  margin-top: clamp(70px, 13vh, 120px); transform-style: preserve-3d;
}
.fan-phone {
  position: absolute; left: 50%; top: 50%;
  width: clamp(150px, 17vw, 214px);
  margin-left: calc(clamp(150px, 17vw, 214px) / -2);
  margin-top: calc(clamp(150px, 17vw, 214px) * -1.03);
  transform-style: preserve-3d;
  --x: 0px; --z: 0px; --ry: 0deg; --rz: 0deg;
  transform: translate3d(0, 0, 0);
}
.fan-phone .phone { max-width: 100%; box-shadow: 0 26px 46px rgba(4,4,12,0.5); }
.fan-phone .label {
  position: absolute; left: 50%; translate: -50% 0; bottom: -34px; white-space: nowrap;
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.13em; text-transform: uppercase; color: #A9BCF0;
}
@media (max-width: 760px) {
  .fan { height: min(460px, 54svh); }
  .fan-phone { width: clamp(120px, 34vw, 160px); margin-left: calc(clamp(120px, 34vw, 160px) / -2); margin-top: calc(clamp(120px, 34vw, 160px) * -1.05); }
  .fan-phone .label { display: none; }
}

/* --------------------------------------------------------- meter block */

.meterband { padding: clamp(80px, 12vh, 130px) 0; background: var(--deep); color: #F6F2EA; }
.meterband .grid {
  display: grid; gap: 46px; align-items: center;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
}
@media (max-width: 900px) { .meterband .grid { grid-template-columns: 1fr; gap: 34px; } }
.meterband .eyebrow { color: var(--gold); }
.meterband h2 { color: #F6F2EA; margin-top: 12px; max-width: 16ch; }
.meterband .say { margin-top: 20px; color: #A9BCF0; font-size: 17px; max-width: 46ch; }

.meter { margin-top: 34px; height: 12px; border-radius: 999px; background: rgba(246,242,234,0.16); overflow: hidden; }
.meter span {
  display: block; height: 100%; width: 97%; border-radius: 999px;
  background: linear-gradient(90deg, var(--green-lit), #A6F0C4); transform-origin: left center;
}
.readout { margin-top: 18px; display: flex; align-items: baseline; gap: 15px; flex-wrap: wrap; }
.readout .big { font-family: var(--mono); font-size: clamp(46px, 9vw, 76px); line-height: 1; color: var(--green-lit); }
.readout .cap { color: #A9BCF0; font-size: 16.5px; max-width: 32ch; }

.ledger { border-radius: 16px; background: rgba(246,242,234,0.06); border: 1px solid rgba(169,188,240,0.22); overflow: hidden; }
.ledger .head {
  padding: 14px 18px; border-bottom: 1px solid rgba(169,188,240,0.2);
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: #A9BCF0;
}
.ledger .line {
  display: flex; align-items: center; gap: 12px; padding: 13px 18px;
  border-bottom: 1px solid rgba(169,188,240,0.14); font-size: 14.5px;
}
.ledger .line:last-child { border-bottom: 0; }
.ledger .tick { width: 20px; height: 20px; border-radius: 999px; display: grid; place-items: center; flex: none; font-size: 11px; font-weight: 700; }
.ledger .tick.yes { background: rgba(111,227,155,0.18); color: var(--green-lit); }
.ledger .tick.no { background: rgba(240,140,140,0.18); color: #F08C8C; }
.ledger .who { margin-left: auto; font-family: var(--mono); font-size: 12px; color: #A9BCF0; }

/* ---------------------------------------------------------- three steps */

.steps { padding: clamp(80px, 12vh, 130px) 0; }
.steps .row { margin-top: 46px; display: grid; gap: 26px; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); perspective: 1500px; }
.step { position: relative; }
.step .no {
  font-family: var(--mono); font-size: 13px; color: var(--action);
  letter-spacing: 0.1em; margin-bottom: 12px; display: block;
}
.step .dev {
  transform-style: preserve-3d;
  transform: rotateY(var(--sy, -10deg)) rotateX(4deg);
  filter: drop-shadow(0 24px 40px rgba(23,23,28,0.18));
  transition: transform .4s cubic-bezier(.22,.61,.36,1);
}
.step:hover .dev { transform: rotateY(0deg) rotateX(0deg) translateY(-6px); }
.step .dev .phone { max-width: 220px; }
.step h3 { margin-top: 24px; }
.step p { margin-top: 7px; color: var(--muted); font-size: 15.5px; }

/* ----------------------------------------------------------- features */

.feat { padding: clamp(80px, 12vh, 130px) 0; background: var(--surface); }
.feat .cards { margin-top: 42px; display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(268px, 1fr)); }
.fcard {
  border-radius: 18px; background: var(--ground); border: 1px solid var(--border);
  padding: 24px; text-decoration: none; color: inherit; display: flex; flex-direction: column; gap: 14px;
  transition: transform .35s cubic-bezier(.22,.61,.36,1), box-shadow .35s ease, border-color .35s ease;
}
.fcard:hover { transform: translateY(-5px); box-shadow: 0 24px 48px rgba(23,23,28,0.13); border-color: var(--border-firm); }
.fcard .peek {
  border-radius: 12px; overflow: hidden; border: 1px solid var(--border);
  background: var(--surface); padding: 12px; display: flex; flex-direction: column; gap: 8px;
}
.fcard h3 { margin: 0; }
.fcard p { color: var(--muted); font-size: 15px; margin: 0; }
.fcard .more { margin-top: auto; font-size: 13.5px; font-weight: 700; color: var(--action); }

/* --------------------------------------------------------------- loop */

.loop { padding: clamp(80px, 12vh, 130px) 0; }
.circuit {
  margin-top: 44px; display: grid; gap: 20px; align-items: stretch;
  grid-template-columns: 1fr auto 1fr;
}
@media (max-width: 860px) { .circuit { grid-template-columns: 1fr; } }
.node { border-radius: 18px; border: 1px solid var(--border); padding: 24px; background: var(--surface); }
.node.owner { background: var(--deep); border-color: transparent; color: #F6F2EA; }
.node h3 { margin-bottom: 6px; }
.node.owner h3 { color: #F6F2EA; }
.node .who { font-size: 12px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.node.owner .who { color: var(--gold); }
.node ul { margin: 14px 0 0; padding-left: 18px; color: var(--ink-2); font-size: 15px; }
.node.owner ul { color: #C9D4F2; }
.node li { margin-bottom: 7px; }
.node .peek { margin-top: 16px; border-radius: 12px; border: 1px solid var(--border); background: var(--ground); padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.node.owner .peek { border-color: rgba(169,188,240,0.25); background: rgba(246,242,234,0.06); }

.bridge { display: grid; place-items: center; padding: 0 6px; }
.bridge .pipe {
  width: 2px; height: 100%; min-height: 90px; background: linear-gradient(180deg, var(--action), var(--gold));
  border-radius: 999px; position: relative;
}
@media (max-width: 860px) { .bridge .pipe { width: 100%; height: 2px; min-height: 0; background: linear-gradient(90deg, var(--action), var(--gold)); } }
.bridge .chip {
  position: absolute; left: 50%; top: 50%; translate: -50% -50%;
  white-space: nowrap; background: var(--ground); border: 1px solid var(--border-firm);
  border-radius: 999px; padding: 7px 13px; font-size: 12px; font-weight: 700;
}
.arrowline { margin-top: 26px; padding: 20px 22px; border-radius: 15px; background: var(--deep); color: #F6F2EA; font-size: 16px; line-height: 1.5; }
.arrowline b { color: var(--gold); font-weight: 700; }

/* ------------------------------------------------------------ pricing */

.pricing { padding: clamp(80px, 12vh, 130px) 0; background: var(--surface); }
.rungs { margin-top: 36px; display: grid; gap: 15px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.rung { border: 1px solid var(--border); border-radius: 17px; padding: 24px; background: var(--ground); }
.rung.now { border-color: var(--action); border-width: 2px; }
.rung .h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.rung .nm { font-weight: 700; font-size: 16.5px; }
.rung .pr { font-family: var(--mono); font-size: 20px; }
.rung .per { font-family: var(--body); font-size: 12px; color: var(--muted); font-weight: 600; }
.rung .bd { margin-top: 9px; font-size: 14.5px; color: var(--muted); }
.rung .tag { margin-top: 11px; font-size: 12px; font-weight: 700; color: var(--action); }

.compare { margin-top: 26px; border: 1px solid var(--border); border-radius: 16px; overflow: hidden; background: var(--ground); }
.compare .r { display: grid; grid-template-columns: 1fr 92px 92px; gap: 10px; padding: 13px 20px; border-bottom: 1px solid var(--border); align-items: center; font-size: 15px; }
.compare .r:last-child { border-bottom: 0; }
.compare .r.hd { font-size: 11.5px; font-weight: 700; letter-spacing: 0.13em; text-transform: uppercase; color: var(--muted); background: var(--sunken); }
.compare .c { text-align: center; font-weight: 700; }
.compare .c.y { color: var(--green); }
.compare .c.n { color: var(--muted); }
@media (max-width: 620px) { .compare .r { grid-template-columns: 1fr 62px 62px; padding: 12px 14px; font-size: 14px; } }

/* ---------------------------------------------------------------- faq */

.faq { padding: clamp(80px, 12vh, 130px) 0; }
.faq .list { margin-top: 34px; display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.q { border: 1px solid var(--border); border-radius: 16px; padding: 22px 24px; background: var(--surface); }
.q h4 { margin-bottom: 8px; }
.q p { margin: 0; color: var(--muted); font-size: 15px; }

/* -------------------------------------------------------------- close */

.close { padding: clamp(90px, 15vh, 160px) 0 70px; text-align: center; }
.close h2 { margin: 0 auto; max-width: 16ch; }
.close p { margin: 18px auto 0; max-width: 46ch; color: var(--ink-2); }
.close .cta { margin-top: 30px; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ------------------------------------------------- scroll choreography */

@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {

    .hero-img { animation: drift linear both; animation-timeline: scroll(root); animation-range: 0 100svh; }
    @keyframes drift { from { transform: scale(1.05) translateY(0); } to { transform: scale(1.16) translateY(5%); } }

    .hero-grid { animation: heroGo linear both; animation-timeline: scroll(root); animation-range: 0 78svh; }
    @keyframes heroGo { from { transform: translateY(0); opacity: 1; } to { transform: translateY(-34px); opacity: 0.12; } }

    .fan-phone { animation: fanOut linear both; animation-timeline: --fan; animation-range: contain 0% contain 78%; }
    @keyframes fanOut {
      from { transform: translate3d(0, 0, 0) rotateY(0deg) rotate(0deg); }
      to   { transform: translate3d(var(--x), 0, var(--z)) rotateY(var(--ry)) rotate(var(--rz)); }
    }
    .fan-phone .label { animation: labelIn linear both; animation-timeline: --fan; animation-range: contain 34% contain 62%; }
    @keyframes labelIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

    .fan-head { animation: headGo linear both; animation-timeline: --fan; animation-range: contain 76% contain 100%; }
    @keyframes headGo { from { transform: translateY(0); opacity: 1; } to { transform: translateY(-22px); opacity: 0.25; } }

    .meter span { animation: fill linear both; animation-timeline: view(block); animation-range: cover 14% cover 60%; }
    @keyframes fill { from { transform: scaleX(0.04); } to { transform: scaleX(1); } }

    /* forwards, not both: before the range the registered initial value —
       the real figure — is what shows, so a page at rest never reads zero */
    .cnt  { animation: c1 linear forwards; animation-timeline: view(block); animation-range: cover 12% cover 58%; }
    .cnt2 { animation: c2 linear forwards; animation-timeline: view(block); animation-range: cover 12% cover 58%; }
    .cnt3 { animation: c3 linear forwards; animation-timeline: view(block); animation-range: cover 12% cover 58%; }
    @keyframes c1 { from { --n: 0; } to { --n: 97; } }
    @keyframes c2 { from { --n2: 0; } to { --n2: 64; } }
    @keyframes c3 { from { --n3: 0; } to { --n3: 62; } }

    .empty-tilt { animation: emptyIn linear both; animation-timeline: view(block); animation-range: entry 0% cover 44%; }
    @keyframes emptyIn {
      from { transform: rotateY(-24deg) rotateX(9deg) rotateZ(-2deg) translateY(28px); }
      to   { transform: rotateY(-13deg) rotateX(5deg) rotateZ(-1deg) translateY(0); }
    }

    .step .dev { animation: stepIn linear both; animation-timeline: view(block); animation-range: entry 0% cover 40%; }
    @keyframes stepIn {
      from { transform: rotateY(var(--sy, -10deg)) rotateX(11deg) translateY(34px); }
      to   { transform: rotateY(var(--sy, -10deg)) rotateX(4deg) translateY(0); }
    }

    .plate img { animation: plateIn linear both; animation-timeline: view(block); animation-range: entry 0% cover 48%; }
    @keyframes plateIn { from { transform: scale(1.06); } to { transform: scale(1); } }
  }
}

.cnt::after  { content: counter(n); counter-reset: n var(--n); }
.cnt2::after { content: counter(n2); counter-reset: n2 var(--n2); }
.cnt3::after { content: counter(n3); counter-reset: n3 var(--n3); }
