/* PhoneProof: "How the checks work" page (technology.html). Loaded after styles.css.
   Uses the tokens from styles.css. Base styles are the final, static state; motion is added
   only for .js + prefers-reduced-motion: no-preference, triggered by main.js (.in-view). */

:root {
  --t-chart-text: var(--muted);
  --t-band: color-mix(in srgb, var(--pc) 80%, transparent);
}

/* ---------- Hero ---------- */
.t-eyebrow {
  font-size: var(--step--1); font-weight: 600; letter-spacing: .02em;
  color: var(--primary-text); margin-bottom: .75rem;
}
.t-hero h1 { max-width: 12ch; }
.t-jump { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 1.75rem; max-width: 36rem; }
.t-jump a {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: 999px;
  background: var(--soft); color: var(--ink); text-decoration: none;
  font-size: var(--step--1); font-weight: 500; transition: background-color .2s;
}
.t-jump a:hover { background: var(--pc); color: var(--on-pc); }
.t-hero-phone { position: relative; z-index: 1; }

/* ---------- Shared ---------- */
.t-lead { margin-top: 1.25rem; color: var(--muted); font-size: var(--step-1); line-height: 1.5; max-width: 40rem; }
.t-note { margin-top: 2rem; color: var(--muted); font-size: var(--step--1); max-width: 62ch; }
.t-h2 {
  font-size: clamp(1.75rem, 1.3rem + 1.7vw, 2.75rem); line-height: 1.08;
  letter-spacing: -.022em; font-stretch: 90%; max-width: 18ch;
}

/* ---------- The idea (4-step flow) ---------- */
.t-flow { list-style: none; display: grid; gap: 28px; margin-top: clamp(2rem, 1.5rem + 2vw, 3.5rem); counter-reset: none; }
.t-flow-step {
  position: relative; background: var(--surface); border-radius: 28px; padding: 24px;
  display: grid; grid-template-columns: 64px 1fr; column-gap: 16px; align-content: start;
}
.t-flow-art { width: 64px; height: 64px; grid-row: span 3; }
.t-flow-n {
  display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  background: var(--primary); color: var(--on-primary); font-weight: 600; font-size: .875rem;
  font-variant-numeric: tabular-nums;
}
.t-flow-step h3 { margin-top: .6rem; }
.t-flow-step p { margin-top: .4rem; color: var(--muted); }
/* connector arrows between steps: down on small screens, right on wide ones */
.t-flow-step:not(:last-child)::after {
  content: ""; position: absolute; left: 50%; bottom: -21px; width: 12px; height: 12px; margin-left: -6px;
  border: solid var(--primary-text); border-width: 0 2.5px 2.5px 0; transform: rotate(45deg);
}
@media (min-width: 1024px) {
  .t-flow { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
  .t-flow-step { grid-template-columns: 1fr; }
  .t-flow-art { grid-row: auto; margin-bottom: 12px; }
  .t-flow-step:not(:last-child)::after { left: auto; right: -15px; bottom: auto; top: 54px; margin: 0; transform: rotate(-45deg); }
}
.fa-body { fill: none; stroke: var(--ink); stroke-width: 2.4; }
.fa-wave, .fa-line { fill: none; stroke: var(--primary-text); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.fa-line2 { fill: none; stroke: var(--warn); stroke-width: 2.6; stroke-linecap: round; stroke-dasharray: 4 4; }
.fa-track { fill: none; stroke: var(--track); stroke-width: 6; }
.fa-ring { fill: none; stroke: var(--primary); stroke-width: 6; stroke-linecap: round; stroke-dasharray: 82 100; transform: rotate(-90deg); transform-origin: 32px 32px; }
.fa-num { font-family: var(--font); font-size: 15px; font-weight: 700; fill: var(--ink); }

/* ---------- Group sections ---------- */
.t-grid { display: grid; gap: clamp(2rem, 1.5rem + 2vw, 3.5rem); align-items: center; }
.t-grid > * { min-width: 0; }
@media (min-width: 960px) {
  .t-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); gap: clamp(3rem, 2rem + 3vw, 5rem); }
  .t-flip .t-copy { order: 2; }
}
.t-copy p:not(.t-eyebrow) { margin-top: 1rem; color: var(--muted); font-size: 1.0625rem; line-height: 1.6; max-width: 36rem; }
.t-copy .t-h2 + p { margin-top: 1.25rem; }
.t-checks { list-style: none; display: grid; gap: .7rem; margin-top: 1.25rem; max-width: 36rem; color: var(--muted); }
.t-checks li { position: relative; padding-left: 1.4rem; line-height: 1.5; }
.t-checks li::before { content: ""; position: absolute; left: 0; top: .6em; width: 8px; height: 8px; border-radius: 50%; background: var(--primary-text); }
.t-checks b { color: var(--ink); font-weight: 600; }

/* "A little more technical": clearly secondary */
.t-more {
  margin-top: clamp(2rem, 1.5rem + 2vw, 3rem); padding-top: 1.25rem;
  border-top: 1px solid var(--hair); max-width: 74ch;
}
.t-more-l {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: .8125rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted);
}
.t-more-l::before {
  content: ""; width: 14px; height: 14px; border-radius: 4px; flex: none;
  background: linear-gradient(var(--muted), var(--muted)) center / 8px 1.6px no-repeat,
              linear-gradient(var(--muted), var(--muted)) center / 1.6px 8px no-repeat;
  box-shadow: inset 0 0 0 1.4px var(--muted); opacity: .8;
}
.t-more p:not(.t-more-l) { margin-top: .6rem; color: var(--muted); font-size: var(--step--1); line-height: 1.6; }

/* ---------- Figures and charts ---------- */
.t-fig { margin: 0; background: var(--soft); border-radius: 28px; padding: clamp(14px, 1rem + 1vw, 28px); }
.soft .t-fig { background: var(--surface); }
.t-fig figcaption { margin-top: 14px; color: var(--muted); font-size: var(--step--1); line-height: 1.45; }
.t-panel + .t-panel { margin-top: 20px; }
.t-panel-t { font-size: var(--step--1); font-weight: 600; color: var(--ink); margin-bottom: 8px; }
.t-svg { width: 100%; height: auto; overflow: visible; }
.t-two { display: grid; gap: 20px; }
.t-two .t-panel + .t-panel { margin-top: 0; }
@media (min-width: 560px) and (max-width: 959px), (min-width: 1200px) { .t-two { grid-template-columns: 1fr 1fr; } }

.t-tx { font-family: var(--font); font-size: 14px; fill: var(--t-chart-text); }
.t-tx-s { font-size: 13px; }
.t-tx-ink { fill: var(--ink); font-weight: 600; }
@media (min-width: 700px) { .t-tx { font-size: 11px; } .t-tx-s { font-size: 10.5px; } }
/* the two camera charts are narrower, so their labels stay larger */
.t-two .t-tx { font-size: 15px; } .t-two .t-tx-s { font-size: 14px; }

.ch-grid { fill: none; stroke: var(--hair); stroke-width: 1; }
.ch-axis { fill: none; stroke: var(--hair); stroke-width: 1; }
.ch-ref { fill: none; stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 4; opacity: .7; }
.ch-arrow { fill: none; stroke: var(--muted); stroke-width: 1.2; stroke-linecap: round; stroke-linejoin: round; opacity: .7; }
.ch-chirp { fill: none; stroke: var(--primary-text); stroke-width: 1.3; stroke-linejoin: round; }
.ch-healthy { fill: none; stroke: var(--primary-text); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.ch-muffled { fill: none; stroke: var(--warn); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.ch-flash { fill: none; stroke: var(--warn); stroke-width: 2.6; stroke-linejoin: round; }
.ch-accel { fill: none; stroke: var(--primary-text); stroke-width: 1.5; stroke-linejoin: round; }
.ch-band { fill: var(--t-band); }
.ch-peak { fill: var(--primary); stroke: var(--surface); stroke-width: 2; }
.ch-dots circle { fill: var(--primary-text); }
.ch-bars rect { fill: var(--primary-text); }

.t-legend { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 10px; font-size: var(--step--1); color: var(--muted); }
.t-legend li { display: inline-flex; align-items: center; gap: 8px; }
.t-legend i { width: 18px; height: 4px; border-radius: 2px; flex: none; }
.lg-healthy { background: var(--primary-text); }
.lg-muffled { background: var(--warn); }
.t-legend .lg-ok, .t-legend .lg-dead, .t-legend .lg-rsv { width: 14px; height: 14px; border-radius: 4px; }
.lg-ok { background: #2BB673; }
.lg-dead { background: #101418; box-shadow: inset 0 0 0 3px #F5B83D; }
.lg-rsv { background: #252B33 repeating-linear-gradient(-45deg, transparent 0 3px, #5A6472 3px 4px); }

/* Touch map: drawn like the app's touch screen, which is dark in both themes */
.t-touch { display: flex; gap: clamp(14px, 3vw, 28px); align-items: center; justify-content: center; }
.t-device {
  width: min(52%, 220px); aspect-ratio: 9 / 18; flex: none;
  padding: 8px; border-radius: 30px; background: var(--frame);
  box-shadow: inset 0 0 0 1.5px var(--frame-edge), var(--shadow-phone);
}
.t-tgrid {
  width: 100%; height: 100%; border-radius: 22px; overflow: hidden; background: #101418;
  display: grid; grid-template-columns: repeat(8, 1fr); grid-template-rows: repeat(14, 1fr);
  padding: 3px;
}
.t-tgrid i { margin: 1px; border-radius: 2px; background: #2BB673; box-shadow: inset 0 0 0 1px rgb(0 0 0 / .15); }
.t-tgrid i.rsv { background: #252B33 repeating-linear-gradient(-45deg, transparent 0 4px, #464F5C 4px 5px); box-shadow: none; }
.t-tgrid i.dead { position: relative; background: #101418; box-shadow: inset 0 0 0 2px #F5B83D; z-index: 1; }
.t-tgrid i.dead::after { content: ""; position: absolute; inset: -5px; border-radius: 6px; border: 2px solid #F5B83D; opacity: .55; }
.t-swatches { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; width: min(36%, 132px); }
.t-swatches i { position: relative; aspect-ratio: 3 / 4; border-radius: 9px; box-shadow: inset 0 0 0 1px var(--hair); }
.t-swatches i:last-child { grid-column: span 2; aspect-ratio: auto; height: 40px; }
.sw-r { background: #E5322D; } .sw-g { background: #2BB673; } .sw-b { background: #1F5FE0; }
.sw-w { background: #FFFFFF; } .sw-grey { background: #8E8E93; } .sw-k { background: #000000; }
.sw-chk { background: repeating-conic-gradient(#000 0 25%, #FFF 0 50%) 0 0 / 12px 12px; }
.sw-grey b { position: absolute; left: 30%; top: 32%; width: 16px; height: 16px; border-radius: 50%; border: 2.5px solid #F5B83D; box-shadow: 0 0 0 2px rgb(0 0 0 / .25); }

/* Battery provenance labels */
.t-prov { list-style: none; display: grid; gap: 10px; margin-top: 18px; }
.t-prov li { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: baseline; font-size: var(--step--1); color: var(--muted); }
.pv { justify-self: start; display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .8125rem; font-weight: 600; white-space: nowrap; }
.pv-m { background: var(--pc); color: var(--on-pc); }
.pv-s { background: var(--surface-2); color: var(--ink); }
.soft .pv-s { background: var(--soft); }
.pv-u { background: var(--warn-c); color: var(--warn-text); }
@media (max-width: 479px) { .t-prov li { grid-template-columns: 1fr; gap: 4px; } }

/* Signal sky view */
.sky-ring { fill: none; stroke: var(--hair); stroke-width: 1.2; }
.sats circle { fill: var(--primary-text); }
.fix-dot { fill: var(--warn); }
.fix-halo { fill: var(--warn); opacity: .22; }
.tl-track { fill: var(--track); }
.tl-fill { fill: var(--primary); transform-box: fill-box; transform-origin: 0 50%; }
.t-radios { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 16px; }
@media (min-width: 560px) { .t-radios { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.t-radios li { display: grid; gap: 2px; padding: 10px 12px; border-radius: 14px; background: var(--soft); font-size: .8125rem; line-height: 1.3; }
.t-radios b { font-size: .9375rem; font-weight: 600; }
.t-radios span { color: var(--muted); }

/* Storage steps */
.t-steps-mini { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; counter-reset: s; }
.t-steps-mini li {
  counter-increment: s; display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px 6px 6px; border-radius: 999px; background: var(--surface); font-size: var(--step--1);
}
.soft .t-steps-mini li { background: var(--soft); }
.t-steps-mini li::before {
  content: counter(s); display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  background: var(--primary); color: var(--on-primary); font-size: .75rem; font-weight: 600;
}

/* ---------- The score ---------- */
.t-weights { display: grid; gap: 10px; }
.wt-head, .wt-row { display: grid; grid-template-columns: 5.4rem 3.2rem minmax(0, 1fr) 2.2rem; gap: 10px; align-items: center; }
.wt-head { font-size: .75rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.wt-head span:nth-child(2) { grid-column: 2 / 4; }
.wt-head span:last-child { text-align: right; }
.wt-n { font-weight: 600; }
.wt-w { color: var(--muted); font-size: var(--step--1); font-variant-numeric: tabular-nums; }
.wt-row b { text-align: right; font-variant-numeric: tabular-nums; color: var(--primary-text); }
/* bar length = weight (25% fills the track), fill = score */
.wt-bar { display: block; height: 14px; width: calc(var(--w) / 25 * 100%); border-radius: 7px; background: var(--track); overflow: hidden; }
.wt-bar i { display: block; height: 100%; width: calc(var(--s) * 1%); border-radius: 7px; background: var(--primary); transform-origin: 0 50%; }
.wt-row.is-capped .wt-bar i { background: var(--warn); }
.wt-row.is-capped b { color: var(--warn-text); }
.wt-total { display: flex; align-items: center; gap: 14px; margin-top: 10px; padding-top: 16px; border-top: 1px solid var(--hair); }
.wt-total svg { width: 64px; height: 64px; flex: none; }
.wt-ring { fill: none; stroke: var(--primary); stroke-width: 6; stroke-linecap: round; stroke-dasharray: 82 100; transform: rotate(-90deg); transform-origin: 32px 32px; }
.wt-total b { display: block; font-size: 2.25rem; line-height: 1; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.wt-total span { color: var(--muted); font-size: var(--step--1); }
@media (max-width: 379px) { .wt-head, .wt-row { grid-template-columns: 4.6rem 2.6rem minmax(0, 1fr) 2rem; gap: 8px; } }

.t-rules { list-style: none; display: grid; gap: 16px; margin-top: clamp(2.5rem, 2rem + 2vw, 3.5rem); }
.t-rules li { background: var(--surface); border-radius: 24px; padding: 22px 24px; }
.t-rules h3 { font-size: var(--step-0); }
.t-rules p { margin-top: .4rem; color: var(--muted); font-size: var(--step--1); line-height: 1.55; }
@media (min-width: 640px) { .t-rules { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .t-rules { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* ---------- Limits ---------- */
.t-limit-list { list-style: none; display: grid; gap: 0 clamp(2rem, 1.5rem + 2vw, 4rem); margin-top: clamp(2rem, 1.5rem + 2vw, 3rem); }
.t-limit-list li { border-top: 1px solid var(--hair); padding: 1.1rem 0 1.2rem 1.75rem; position: relative; }
.t-limit-list li::before { content: ""; position: absolute; left: 0; top: 1.65rem; width: 14px; height: 2px; border-radius: 1px; background: var(--warn); }
.t-limit-list h3 { font-size: var(--step-0); }
.t-limit-list p { margin-top: .3rem; color: var(--muted); font-size: var(--step--1); line-height: 1.55; max-width: 44ch; }
@media (min-width: 768px) { .t-limit-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- CTA ---------- */
.final .btn { margin-top: .5rem; }

/* =====================================================================
   Motion (only when JS is on and reduced motion is not requested)
   ===================================================================== */
@keyframes t-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes t-pop { from { opacity: 0; transform: scale(.4); } to { opacity: 1; transform: none; } }
@keyframes t-grow-y { from { transform: scaleY(0); } }
@keyframes t-grow-x { from { transform: scaleX(0); } }
@keyframes t-paint { from { background-color: #1B2129; } }
@keyframes t-ring82 { from { stroke-dasharray: 0 100; } to { stroke-dasharray: 82 100; } }
@keyframes t-halo { 0% { transform: scale(.6); opacity: .5; } 100% { transform: scale(2.2); opacity: 0; } }
@keyframes t-fade-up { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes t-wave { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }

@media (prefers-reduced-motion: no-preference) {
  /* line charts draw left to right */
  .js [data-inview] :is(.ch-chirp, .ch-healthy, .ch-muffled, .ch-flash, .ch-accel) { stroke-dasharray: 1; stroke-dashoffset: 1; }
  .js .in-view .ch-chirp { animation: t-draw 2.4s linear .2s forwards; }
  .js .in-view .ch-healthy { animation: t-draw 1.4s var(--ease) .5s forwards; }
  .js .in-view .ch-muffled { animation: t-draw 1.4s var(--ease) 1.1s forwards; }
  .js .in-view .ch-flash { animation: t-draw 2s linear .4s forwards; }
  .js .in-view .ch-accel { animation: t-draw 2.2s linear .3s forwards; }

  .js [data-inview] .ch-peak, .js [data-inview] .ch-dots circle, .js [data-inview] .sats circle,
  .js [data-inview] .fix { transform-box: fill-box; transform-origin: center; }
  .js [data-inview] .ch-peak { opacity: 0; }
  .js .in-view .ch-peak { animation: t-pop .4s var(--ease) 1.8s both; }
  .js .in-view .ch-dots circle { animation: t-pop .3s var(--ease) both; animation-delay: calc(.5s + var(--i) * 65ms); }
  .js .in-view .ch-bars rect { transform-box: fill-box; transform-origin: 50% 100%; animation: t-grow-y .6s var(--ease) both; animation-delay: calc(.2s + var(--i) * 90ms); }

  /* touch map paints in the order a finger would */
  .js .in-view .t-tgrid i:not(.rsv):not(.dead) { animation: t-paint .15s linear both; animation-delay: calc(.3s + var(--d) * 16ms); }
  .js [data-inview] .t-tgrid i.dead::after { opacity: 0; }
  .js .in-view .t-tgrid i.dead::after { animation: t-halo 1.4s ease-out 2.2s 3; }

  /* signal: satellites appear, timeline fills, then the fix */
  .js .in-view .sats circle { animation: t-pop .35s var(--ease) both; animation-delay: calc(.3s + var(--i) * .3s); }
  .js .in-view .tl-fill { animation: t-grow-x 2.4s linear .3s both; }
  .js [data-inview] .fix { opacity: 0; }
  .js .in-view .fix { animation: t-pop .4s var(--ease) 2.7s both; }
  .js .in-view .fix-halo { transform-box: fill-box; transform-origin: center; animation: t-halo 1.6s ease-out 3.1s 3; }

  /* idea flow */
  .js [data-inview] .t-flow-step { opacity: 0; }
  .js .in-view .t-flow-step { animation: t-fade-up .6s var(--ease) both; animation-delay: calc(var(--i) * 180ms); }
  .js .in-view .fa-wave { animation: t-wave 1.4s ease-in-out .4s 3; }
  .js .in-view .fa-ring { animation: t-ring82 1.2s var(--ease) .9s both; }

  /* score */
  .js .in-view .wt-bar i { animation: t-grow-x .9s var(--ease) both; animation-delay: calc(.2s + var(--i) * 110ms); }
  .js .in-view .wt-ring { animation: t-ring82 1.4s var(--ease) .9s both; }

  .t-jump a:hover { transition: background-color .2s; }
}
