/* RPMBase and RPMVault case pages. Loaded after portfolio.css.
   Each page sets its brand on <body class="rpm rpm-base|rpm-vault">. The brand
   zones (hero, ticker, tour, dash) stay dark in both themes, like the apps;
   the rest follows the portfolio's light/dark theme. Everything that moves
   sits under html.motion (no prefers-reduced-motion). */

.rpm-base  { --brand: #0094F8; --brand-2: #68C8FC; --brand-deep: #0360C6; --on-brand: #00142E; --zone: #060B16; --zone-2: #0B1630; --zone-3: #12203D; --red: #FF5A4E; --ar: 600 / 1300; }
.rpm-vault { --brand: #FF9F5F; --brand-2: #FFD0AE; --brand-deep: #F2731F; --on-brand: #1A0E05; --zone: #0E0906; --zone-2: #1B120C; --zone-3: #2A1B11; --red: #FF4D3D; --ar: 600 / 1301; }
.rpm { overflow-x: clip; }
.rpm .zone { background: var(--zone); color: #F1F1EF; --ink-2z: #A6A8B0; --line-z: rgba(255, 255, 255, .09); }

/* ---------- Hero ---------- */
.rpm-hero { position: relative; isolation: isolate; overflow: hidden; }
.rpm-hero::before { content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(60% 70% at 78% 40%, color-mix(in srgb, var(--brand) 28%, transparent), transparent 70%),
    radial-gradient(40% 50% at 10% 100%, color-mix(in srgb, var(--brand-deep) 22%, transparent), transparent 70%),
    linear-gradient(var(--zone), var(--zone-2)); }
.rpm-hero::after { content: ""; position: absolute; inset: 0; z-index: -1; opacity: .5;
  background-image: linear-gradient(var(--line-z) 1px, transparent 1px), linear-gradient(90deg, var(--line-z) 1px, transparent 1px);
  background-size: 56px 56px; -webkit-mask-image: radial-gradient(70% 70% at 70% 40%, #000, transparent); mask-image: radial-gradient(70% 70% at 70% 40%, #000, transparent); }
.rpm-hero .wrap { display: grid; gap: 32px; align-items: center; padding-top: 28px; padding-bottom: 56px; }
@media (min-width: 980px) { .rpm-hero .wrap { grid-template-columns: 1.02fr 1fr; gap: 24px; padding-top: 40px; padding-bottom: 88px; min-height: min(820px, calc(100svh - 70px)); } }
.rpm-hero .back { color: var(--ink-2z); text-decoration: none; font-size: 15px; }
.rpm-hero .back:hover { color: #fff; }
.rpm-id { display: flex; align-items: center; gap: 14px; margin: 26px 0 22px; }
.rpm-id img { width: 56px; height: 56px; border-radius: 14px; box-shadow: 0 0 0 1px rgba(255, 255, 255, .08), 0 14px 30px -10px color-mix(in srgb, var(--brand) 60%, transparent); }
.rpm-id b { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
.rpm-id small { display: block; color: var(--ink-2z); font-size: 14px; }
.rpm-hero h1 { margin: 0; font-size: clamp(44px, 7vw, 86px); line-height: .96; letter-spacing: -0.05em; font-weight: 700; }
.rpm-hero h1 em { font-style: normal; color: var(--brand); display: inline-block; }
.rpm-hero .lead { margin: 22px 0 0; max-width: 50ch; font-size: clamp(17px, 1.7vw, 20px); line-height: 1.55; color: #C9CBD2; }
.rpm-cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.rpm .zone .btn { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .14); color: #fff; }
.rpm .zone .btn:hover { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .3); }
.rpm .zone .btn.go { background: var(--brand); border-color: var(--brand); color: var(--on-brand); font-weight: 700; box-shadow: 0 10px 30px -12px var(--brand); }
.rpm .zone .btn.go:hover { background: var(--brand-2); border-color: var(--brand-2); }
.rpm .zone .btn.soon { opacity: .6; cursor: default; }
.rpm-facts { display: flex; flex-wrap: wrap; gap: 8px; margin: 28px 0 0; padding: 0; list-style: none; }
.rpm-facts li { padding: 7px 12px; border-radius: 999px; font-size: 14px; color: #D7D9DF; background: rgba(255, 255, 255, .05); border: 1px solid var(--line-z); }
.rpm-facts li b { color: #fff; font-weight: 650; }

/* Dash: tachometer behind, phone in front, a few live chips */
.dash { position: relative; width: 100%; max-width: 600px; margin: 0 auto; aspect-ratio: 1 / 1.02; perspective: 1200px; }
.gauge { position: absolute; right: -2%; top: 0; width: 84%; height: auto; overflow: visible; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.gauge .g-track { fill: none; stroke: rgba(255, 255, 255, .07); stroke-width: 14; }
.gauge .g-value { fill: none; stroke: var(--brand); stroke-width: 14; stroke-linecap: round; filter: drop-shadow(0 0 10px color-mix(in srgb, var(--brand) 70%, transparent)); }
.gauge .g-red { fill: none; stroke: var(--red); stroke-width: 6; opacity: .85; }
.gauge .g-tick { stroke: rgba(255, 255, 255, .55); stroke-width: 3; stroke-linecap: round; }
.gauge .g-tick.minor { stroke: rgba(255, 255, 255, .22); stroke-width: 2; }
.gauge .g-num { fill: rgba(255, 255, 255, .62); font: 600 17px "Schibsted Grotesk", system-ui, sans-serif; text-anchor: middle; dominant-baseline: middle; }
.gauge .g-num.hot { fill: var(--red); }
.gauge .g-needle { transform-origin: 200px 200px; }
.gauge .g-needle line { stroke: var(--brand-2); stroke-width: 4; stroke-linecap: round; }
.gauge .g-hub { fill: var(--zone-3); stroke: var(--brand); stroke-width: 3; }
.gauge .g-read { fill: #fff; font: 700 34px "Schibsted Grotesk", system-ui, sans-serif; text-anchor: middle; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.gauge .g-unit { fill: rgba(255, 255, 255, .5); font: 600 12px "Schibsted Grotesk", system-ui, sans-serif; text-anchor: middle; letter-spacing: .2em; }
.gauge:focus-visible { outline: 3px solid var(--brand-2); outline-offset: 6px; border-radius: 50%; }
.gauge-hint { position: absolute; right: 4%; top: 2%; margin: 0; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2z); }

.rpm-phone { position: absolute; left: 6%; bottom: 0; width: 42%; max-width: 270px; border-radius: 15% / 7%; padding: 2.4%;
  background: linear-gradient(160deg, #3a3d46, #121318 40%, #2b2d35 70%, #0c0d10); box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .8), 0 0 0 1px rgba(255, 255, 255, .06);
  transform: rotateY(var(--ry, 10deg)) rotateX(var(--rx, 4deg)) rotateZ(-2deg); transform-style: preserve-3d; transition: transform .5s cubic-bezier(.2, .7, .2, 1); }
.rpm-phone img { display: block; width: 100%; aspect-ratio: var(--ar); border-radius: 12% / 5.6%; }
.chip { position: absolute; display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 14px; white-space: nowrap;
  background: rgba(16, 18, 26, .78); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border: 1px solid rgba(255, 255, 255, .1);
  box-shadow: 0 16px 34px -18px rgba(0, 0, 0, .8); font-size: 14px; color: #E6E7EB; }
.chip b { display: block; font-size: 15px; color: #fff; }
.chip small { display: block; color: var(--ink-2z); font-size: 12px; }
.chip i { flex: none; width: 30px; height: 30px; border-radius: 9px; background: color-mix(in srgb, var(--brand) 22%, transparent); display: grid; place-items: center; }
.chip i svg { width: 16px; height: 16px; fill: none; stroke: var(--brand-2); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.chip.k1 { right: 0; bottom: 3%; }
.chip.k2 { left: 30%; bottom: 17%; }
.chip.k3 { left: 0; top: 6%; }
@media (max-width: 560px) { .chip { font-size: 12px; padding: 8px 10px; } .chip b { font-size: 13px; } .chip i { width: 24px; height: 24px; } .chip.k3 { display: none; } }

/* ---------- Ticker ---------- */
.ticker { overflow: hidden; border-top: 1px solid var(--line-z); border-bottom: 1px solid var(--line-z); background: var(--zone); }
.ticker-track { display: flex; width: max-content; padding: 16px 0; }
.ticker-track > span { display: flex; align-items: center; flex: none; font-size: 14px; font-weight: 650; letter-spacing: .18em; text-transform: uppercase; color: #C5C7CE; white-space: nowrap; }
.ticker i { display: inline-block; width: 18px; height: 2px; margin: 0 22px; background: var(--brand); border-radius: 2px; }

/* ---------- Tour ---------- */
.tour-zone { padding: 88px 0 72px; background: linear-gradient(var(--zone), var(--zone-2)); }
.tour-zone .section-head h2 { color: #fff; }
.tour-zone .section-head p { color: var(--ink-2z); }
.tour { position: relative; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 64px; }
.step { display: grid; gap: 24px; justify-items: center; text-align: center; }
.step-shot { width: min(280px, 72vw); border-radius: 30px; border: 6px solid #15161b; box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .9), 0 0 0 1px rgba(255, 255, 255, .06); }
.step-n { display: block; font-size: 64px; line-height: 1; font-weight: 700; letter-spacing: -0.05em; color: transparent; -webkit-text-stroke: 1.5px color-mix(in srgb, var(--brand) 70%, transparent); margin-bottom: 8px; }
.step h3 { margin: 0 0 12px; font-size: clamp(26px, 3vw, 38px); letter-spacing: -0.03em; line-height: 1.08; font-weight: 650; color: #fff; }
.step p { margin: 0 auto; color: #B8BAC2; font-size: 17px; max-width: 42ch; }
.tour-phone { display: none; }
@media (min-width: 980px) {
  .tour { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 72px; }
  .tour-phone { display: grid; grid-template-columns: auto auto; gap: 28px; align-items: center; justify-content: center; position: sticky; align-self: start;
    --pw: min(300px, calc((100vh - 170px) * .462)); top: calc(50vh - var(--pw) * 1.083 - 8px); }
  .tour-screens { position: relative; width: var(--pw); aspect-ratio: var(--ar); border-radius: 13% / 6%; border: 7px solid #15161b; overflow: hidden; background: #000;
    box-shadow: 0 50px 90px -40px rgba(0, 0, 0, .95), 0 0 0 1px rgba(255, 255, 255, .07), 0 0 80px -30px color-mix(in srgb, var(--brand) 55%, transparent); }
  .tour-screens img { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transform: translateY(4%) scale(1.02); transition: opacity .5s ease, transform .7s cubic-bezier(.2, .7, .2, 1); }
  .tour-screens img.on { opacity: 1; transform: none; }
  .tour-rail { position: relative; width: 3px; height: calc(var(--pw) * 1.6); border-radius: 3px; background: rgba(255, 255, 255, .1); overflow: hidden; }
  .tour-rail span { position: absolute; left: 0; right: 0; top: 0; height: 100%; background: linear-gradient(var(--brand-2), var(--brand)); transform-origin: top; transform: scaleY(var(--p, .25)); transition: transform .6s cubic-bezier(.2, .7, .2, 1); }
  .steps { gap: 0; }
  .step { min-height: 76vh; align-content: center; justify-items: start; text-align: left; }
  .step p { margin: 0; }
  .step-shot { display: none; }
  html[data-motion-ready] .step { opacity: .28; transition: opacity .5s ease; }
  html[data-motion-ready] .step.on { opacity: 1; }
}

/* ---------- Dash cards (the extra band of each page) ---------- */
.rpm-dash { padding: 24px 0 96px; background: var(--zone-2); }
.rpm-dash .grid { display: grid; gap: 16px; }
@media (min-width: 900px) { .rpm-dash .grid { grid-template-columns: 1fr 1fr; gap: 20px; } }
.card { position: relative; padding: 28px; border-radius: 24px; background: linear-gradient(160deg, var(--zone-3), var(--zone)); border: 1px solid var(--line-z); overflow: hidden; }
.card h3 { margin: 0 0 4px; font-size: 22px; letter-spacing: -0.02em; font-weight: 650; color: #fff; }
.card > p { margin: 0 0 24px; color: var(--ink-2z); font-size: 15px; }
.card .eg { position: absolute; right: 20px; top: 22px; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2z); border: 1px solid var(--line-z); border-radius: 999px; padding: 3px 9px; }

/* Countdown rings */
.dues { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.dues li { display: grid; grid-template-columns: 56px 1fr auto; gap: 14px; align-items: center; }
.ring { width: 56px; height: 56px; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 6; }
.ring .bg { stroke: rgba(255, 255, 255, .08); }
.ring .fg { stroke: var(--brand); stroke-linecap: round; stroke-dasharray: 151; stroke-dashoffset: calc(151 * (1 - var(--v))); transition: stroke-dashoffset 1.4s cubic-bezier(.2, .7, .2, 1); transition-delay: calc(var(--i, 0) * 150ms); }
.dues b { display: block; color: #fff; font-size: 16px; }
.dues small { color: var(--ink-2z); font-size: 13px; }
.dues em { font-style: normal; font-size: 13px; font-weight: 650; color: var(--brand-2); background: color-mix(in srgb, var(--brand) 16%, transparent); padding: 4px 10px; border-radius: 999px; white-space: nowrap; }

/* Donut */
.donut-wrap { display: grid; grid-template-columns: 170px 1fr; gap: 24px; align-items: center; }
@media (max-width: 420px) { .donut-wrap { grid-template-columns: 1fr; justify-items: center; } }
.donut { width: 170px; height: 170px; transform: rotate(-90deg); }
.donut circle { fill: none; stroke-width: 22; }
.donut .bg { stroke: rgba(255, 255, 255, .06); }
.donut .seg { stroke-dasharray: calc(var(--len) * 1px) 999; stroke-dashoffset: calc(var(--off) * -1px); transition: stroke-dasharray 1.2s cubic-bezier(.2, .7, .2, 1); transition-delay: calc(var(--i) * 180ms); }
.legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.legend li { display: flex; align-items: center; gap: 10px; color: #D9DBE1; font-size: 15px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; background: var(--c); flex: none; }
.legend b { margin-left: auto; color: #fff; font-variant-numeric: tabular-nums; }

/* Spec duel */
.duel-head { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: center; margin-bottom: 22px; }
.duel-head span { font-weight: 650; color: #fff; font-size: 16px; line-height: 1.25; }
.duel-head span:last-child { text-align: right; }
.duel-head small { display: block; color: var(--ink-2z); font-weight: 500; font-size: 13px; }
.duel-head i { font-style: normal; font-size: 12px; font-weight: 700; letter-spacing: .1em; color: var(--on-brand); background: var(--brand); border-radius: 999px; padding: 6px 9px; }
.spec { margin: 0 0 18px; }
.spec dt { display: flex; justify-content: space-between; font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2z); margin-bottom: 8px; }
.spec dd { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.bar { position: relative; height: 34px; border-radius: 9px; background: rgba(255, 255, 255, .05); overflow: hidden; }
.bar span { position: absolute; top: 0; bottom: 0; width: calc(var(--w) * 100%); background: rgba(255, 255, 255, .16); transition: width 1.3s cubic-bezier(.2, .7, .2, 1); }
.bar.l span { right: 0; border-radius: 9px 0 0 9px; }
.bar.r span { left: 0; border-radius: 0 9px 9px 0; }
.bar.win span { background: linear-gradient(90deg, var(--brand-deep), var(--brand)); }
.bar.l.win span { background: linear-gradient(270deg, var(--brand-deep), var(--brand)); }
.bar b { position: absolute; top: 50%; transform: translateY(-50%); font-size: 14px; color: #fff; font-variant-numeric: tabular-nums; z-index: 1; }
.bar.l b { left: 10px; }
.bar.r b { right: 10px; }

/* Odometer */
.odo-card { display: grid; align-content: center; gap: 14px; text-align: center; }
.odo { display: inline-flex; justify-content: center; gap: 4px; font-size: clamp(54px, 9vw, 104px); font-weight: 700; letter-spacing: -0.04em; line-height: 1; color: #fff; }
.odo .d { display: inline-block; width: .62em; text-align: center; height: 1em; overflow: hidden; padding: 0 .04em; border-radius: 10px; background: rgba(255, 255, 255, .05); }
.odo .d span { display: block; transition: transform 1.8s cubic-bezier(.2, .7, .1, 1); transition-delay: calc(var(--i) * 120ms); }
.odo .d em { display: block; height: 1em; font-style: normal; }
.odo .sep, .odo .plus { color: var(--brand); }
.odo-card p { margin: 0; color: var(--ink-2z); font-size: 16px; }

/* Case-study bits that follow the theme */
.rpm .built-grid li::before { background: var(--brand); }
.rpm .contact { background: linear-gradient(135deg, var(--zone-2), var(--zone)); color: #fff; box-shadow: inset 0 0 0 1px var(--line-z); }
.rpm .contact p { color: #B8BAC2; }
.rpm .contact .links a { background: rgba(255, 255, 255, .06); color: #fff; }
.rpm .contact .links a:hover { background: color-mix(in srgb, var(--brand) 22%, transparent); }

/* ================= Motion ================= */
@keyframes rpm-rise { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }
@keyframes rpm-float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -10px; } }
@keyframes rpm-slide { to { transform: translateX(-50%); } }
@keyframes rpm-glow { 0%, 100% { opacity: .75; } 50% { opacity: 1; } }
.motion .rpm-hero .rise { opacity: 0; animation: rpm-rise .9s cubic-bezier(.2, .7, .1, 1) forwards; animation-delay: calc(var(--r) * 90ms + 60ms); }
.motion .rpm-phone { animation: rpm-rise 1.1s cubic-bezier(.2, .7, .1, 1) .25s both; }
.motion .chip { animation: rpm-float 5s ease-in-out infinite; }
.motion .chip.k2 { animation-delay: -1.7s; animation-duration: 6s; }
.motion .chip.k3 { animation-delay: -3.1s; animation-duration: 5.6s; }
.motion .gauge .g-red { animation: rpm-glow 2.4s ease-in-out infinite; }
.motion .ticker-track { animation: rpm-slide 46s linear infinite; }
.motion .card:not(.in) .ring .fg { stroke-dashoffset: 151; }
.motion .card:not(.in) .donut .seg { stroke-dasharray: 0 999; }
.motion .card:not(.in) .bar span { width: 0; }
.motion .card:not(.in) .odo .d span { transform: none !important; }
@media (max-width: 979px) { .motion[data-motion-ready] .step:not(.in) { opacity: 0; transform: translateY(26px); } .motion .step { transition: opacity .7s ease, transform .8s cubic-bezier(.2, .7, .2, 1); } }
.rpm .visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
