/* =========================================================
   ATHAR · How it works (how-it-works.html)
   Polish pass (13 Oct 2026), one idea per section:
     1 Hero      — the phone-and-tag photograph in an arch, ringed by fingerprint lines that ripple
                   out once (a tap), with the Tree ID that joins everything
     2 Journey   — the page's moment: four stations on ONE continuous line, three ridges like the
                   lines of the mark's fingerprint. how.js measures the stations and draws the line
                   (a row on wide screens, a switchback on narrow ones); each segment draws as its
                   station is revealed and the station comes to life
     3 The tag   — the annotated tag photo, its legend lighting the pins
     4 App & web — an ivory panel (the card, in the app) beside a green block (your tree, on the
                   web: find it by its ID)
     Next step · closing band (two equal paths)
   Builds on athar.css (.page-hero, .promise, .id-form, .next-step, .closing). Logical properties
   only, so Arabic mirrors; the line follows the stations, so it mirrors too.
   ========================================================= */

body[data-page="how"] { --how-bg: var(--athar-cream); }
.how .label .ms { font-size: 1.35em; }
.how .link { min-height: 44px; }
.how .h2 + .rule { margin-block: 1.3rem 0; }
.how :is(.how-rings, .how-line, .how-ring) { max-width: none; }
/* the next-step strip has its own hairlines: no section hairline above it */
.how .section.tight.how-next:not(.dune)::before { content: none; }

/* ---------- phone frame (real app screenshots, 390 × 844) ---------- */
.phone {
  position: relative; display: block; margin: 0;
  width: var(--w, 280px);
  padding: 2.6%;
  border-radius: 16% / 7.4%;
  background: var(--athar-ink);
  box-shadow: 0 22px 44px rgba(40, 30, 15, .2), 0 4px 12px rgba(40, 30, 15, .1), inset 0 0 0 1px rgba(255, 255, 255, .08);
}
.phone::before {
  content: ""; position: absolute; z-index: 2;
  top: 2.3%; inset-inline: 0; margin-inline: auto;
  width: 28%; height: 2.6%;
  border-radius: 999px; background: var(--athar-ink);
}
.phone .screen {
  display: block; width: 100%; aspect-ratio: 390 / 844; overflow: hidden;
  border-radius: 13.5% / 6.3%;
  background: var(--athar-cream);
}
.phone .screen img { width: 100%; height: 100%; object-fit: cover; object-position: top; }

/* =========================================================
   1 · HERO
   ========================================================= */
.how-hero { padding-block-end: clamp(3.5rem, 7vw, 6rem); }
/* the rings fade out before the hero's top edge (its overflow would otherwise cut them in a straight
   line under the header): a cream veil over the hero's top padding, where nothing else sits */
.how-hero::after {
  content: ""; position: absolute; z-index: 1; pointer-events: none;
  inset-inline: 0; inset-block-start: 0; height: clamp(2rem, 4vw, 3.5rem);
  background: linear-gradient(to bottom, var(--athar-cream) 20%, transparent);
}
.how-hero-text .label { margin-block-end: 1.1rem; }
/* the dateline's words sit on the cream, above the rings; its hairline runs through them */
.how-hero .dateline { position: relative; z-index: 2; }
.how-hero .dateline > span { background: var(--athar-cream); padding-inline-end: .35rem; box-shadow: -.5rem 0 0 var(--athar-cream); }
html[dir="rtl"] .how-hero .dateline > span { box-shadow: .5rem 0 0 var(--athar-cream); }
.how-hero-actions { margin-top: 2rem; }

/* the stage: --aw is the arch's width; everything else is drawn from it */
.how-stage {
  --aw: clamp(250px, min(31vw, (100vh - var(--header-h) - 12rem) * .76), 470px);
  position: relative; margin: 0; justify-self: center;
  width: var(--aw); height: calc(var(--aw) * 1.3);
  margin-block-start: calc(var(--aw) * .06);
}
@supports (height: 100svh) {
  .how-stage { --aw: clamp(250px, min(31vw, (100svh - var(--header-h) - 12rem) * .76), 470px); }
}
.how-arch {
  position: absolute; inset: 0; z-index: 1; overflow: hidden; isolation: isolate;
  border-radius: calc(var(--aw) / 2) calc(var(--aw) / 2) 28px 28px;
  background: var(--athar-sand);
  box-shadow: 0 calc(var(--aw) * .07) calc(var(--aw) * .16) rgba(104, 73, 37, .2), 0 2px 8px rgba(56, 40, 20, .06);
}
.how-arch img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 42%; }

/* the rings of a fingerprint around the arch, concentric with its round top (centre: aw/2 down) */
.how-rings {
  position: absolute; z-index: 0; pointer-events: none;
  inset-inline: calc(var(--aw) * -1); inset-block-start: calc(var(--aw) * -1);
  width: calc(var(--aw) * 3); height: calc(var(--aw) * 3);
  fill: none; stroke: var(--athar-brown);
  -webkit-mask-image: linear-gradient(to bottom, transparent 4%, #000 22%, #000 38%, transparent 70%);
  mask-image: linear-gradient(to bottom, transparent 4%, #000 22%, #000 38%, transparent 70%);
}
.how-rings circle { stroke-width: 1px; vector-effect: non-scaling-stroke; }
.how-rings circle:nth-child(1) { stroke-opacity: .42; }
.how-rings circle:nth-child(2) { stroke-opacity: .34; }
.how-rings circle:nth-child(3) { stroke-opacity: .27; }
.how-rings circle:nth-child(4) { stroke-opacity: .21; }
.how-rings circle:nth-child(5) { stroke-opacity: .16; }
.how-rings circle:nth-child(6) { stroke-opacity: .12; }
.how-rings circle:nth-child(7) { stroke-opacity: .085; }
.how-rings circle:nth-child(8) { stroke-opacity: .06; }

/* the Tree ID chip, overlapping the arch on the side of the copy */
.how-idchip {
  position: absolute; z-index: 2;
  inset-inline-start: calc(var(--aw) * -.17); inset-block-end: 13%;
  display: flex; align-items: center; gap: .8rem;
  padding: .65rem; padding-inline-end: 1.3rem;
  background: var(--athar-ivory); border-radius: 20px;
  box-shadow: 0 18px 40px rgba(56, 40, 20, .16), 0 2px 6px rgba(56, 40, 20, .06);
}
.how-idchip-mark { width: 52px; height: 52px; border-radius: 50%; background: var(--athar-sage); display: grid; place-items: center; flex: none; }
.how-idchip-mark img { height: 36px; width: auto; }
.how-idchip small { display: block; font-size: .75rem; font-weight: 700; letter-spacing: var(--track-caps); text-transform: uppercase; color: var(--athar-brown); line-height: 1.3; }
html[lang="ar"] .how-idchip small { letter-spacing: 0; text-transform: none; font-size: .875rem; }
.how-idchip .tree-id { display: block; font-size: 1.1rem; color: var(--athar-green); line-height: 1.35; }

/* motion: the arch settles, the rings ripple out once from its core (reduced motion: all still) */
@media (prefers-reduced-motion: no-preference) {
  .how-arch { animation: how-arch-in 1.2s var(--ease) both; }
  .how-rings circle { animation: how-ring-in 1.8s cubic-bezier(.2, .7, .2, 1) both; }
  .how-rings circle:nth-child(2) { animation-delay: .08s; }
  .how-rings circle:nth-child(3) { animation-delay: .16s; }
  .how-rings circle:nth-child(4) { animation-delay: .24s; }
  .how-rings circle:nth-child(5) { animation-delay: .32s; }
  .how-rings circle:nth-child(6) { animation-delay: .4s; }
  .how-rings circle:nth-child(7) { animation-delay: .48s; }
  .how-rings circle:nth-child(8) { animation-delay: .56s; }
  .how-idchip { animation: how-chip-in 1s var(--ease) .7s both; }
}
@keyframes how-arch-in { from { opacity: 0; transform: translateY(18px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes how-ring-in { from { opacity: 0; transform: scale(.82); } to { opacity: 1; transform: none; } }
@keyframes how-chip-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

@media (max-width: 960px) {
  .how-stage { --aw: min(64vw, 330px); margin-block-start: calc(var(--aw) * .2); }
  /* stacked under the copy: the rings fade out above the arch, clear of the buttons */
  .how-rings {
    -webkit-mask-image: linear-gradient(to bottom, transparent 14%, #000 28%, #000 38%, transparent 66%);
    mask-image: linear-gradient(to bottom, transparent 14%, #000 28%, #000 38%, transparent 66%);
  }
  .how-idchip { inset-inline-start: calc(var(--aw) * -.12); }
}
/* phones: a tighter hero, so the arch with the tag and the Tree ID chip is in the first screen. The
   two buttons share a row when they fit (wider phones), and stack full width when they don't. */
@media (max-width: 520px) {
  .how-hero { padding-block-start: 1.5rem; }
  .how-hero::after { height: 1.5rem; }
  .how-hero .dateline { margin-block-end: 1rem; }
  .how-hero-text .label { margin-block-end: .8rem; }
  .how-hero .hero-grid { row-gap: 1.5rem; }
  .how-hero-actions { margin-top: 1.5rem; --cluster: .6rem; }
  .how-hero-actions .btn { flex: 1 1 auto; padding-inline: 1.15rem; }
  .how-stage { --aw: min(62vw, 280px); margin-block-start: calc(var(--aw) * .02); }
  .how-idchip { inset-inline-start: calc(var(--aw) * -.14); inset-block-end: 15%; gap: .6rem; padding: .5rem; padding-inline-end: 1rem; border-radius: 16px; }
  .how-idchip-mark { width: 44px; height: 44px; }
  .how-idchip-mark img { height: 32px; }
  .how-idchip .tree-id { font-size: 1rem; }
}

/* =========================================================
   Section heads
   ========================================================= */
.how-head { max-width: 760px; margin-block-end: clamp(2.5rem, 5vw, 4rem); }
.how-head .label { margin-block-end: .9rem; }
.how-head-center { margin-inline: auto; text-align: center; }
.how-head-center .rule { margin-inline: auto; }

/* =========================================================
   2 · THE JOURNEY
   ========================================================= */
.how-journey { padding-block: clamp(4.5rem, 8vw, 7.5rem) clamp(4rem, 7vw, 6.5rem); }
.how-path {
  --how-axis: x;
  --D: clamp(176px, 15.5vw, 240px);
  --drop: calc(var(--D) * .46);
  position: relative;
  padding-block: calc(var(--D) * .08) 0;
}
/* the line: how.js sizes it to the page width (it comes in from the edge and runs on) */
.how-line { position: absolute; z-index: 0; pointer-events: none; overflow: visible; fill: none; }
.how-line.is-x {
  -webkit-mask-image: linear-gradient(to right, transparent 1%, #000 13%, #000 87%, transparent 99%);
  mask-image: linear-gradient(to right, transparent 1%, #000 13%, #000 87%, transparent 99%);
}
/* vertical: the surface starts 160px above the stations; the line fades in over the 36px lead-in and
   out over the 36px tail (how.js PAD / LEAD), clear of the heading above and the promise below */
.how-line.is-y {
  -webkit-mask-image: linear-gradient(to bottom, transparent 124px, #000 180px, #000 calc(100% - 180px), transparent calc(100% - 124px));
  mask-image: linear-gradient(to bottom, transparent 124px, #000 180px, #000 calc(100% - 180px), transparent calc(100% - 124px));
}
/* three ridges from one path: a tan band, a cream gap, a brown core */
.how-seg path { fill: none; stroke-linecap: butt; stroke-linejoin: round; stroke-dasharray: 1 1; stroke-dashoffset: 0; transition: stroke-dashoffset var(--seg-t, .6s) cubic-bezier(.45, 0, .25, 1); }
.how-seg .r1 { stroke: var(--athar-tan); stroke-width: 13px; }
.how-seg .r2 { stroke: var(--how-bg); stroke-width: 9.5px; }
.how-seg .r3 { stroke: var(--athar-brown); stroke-width: 1.75px; }
.how-path.is-live .how-seg:not(.on) path { stroke-dashoffset: 1; }

/* the markers site.js reveals (they only time the drawing). They sit exactly where they are drawn
   (no reveal lift). The row cue sits in the top band of the photos, so the row plays as soon as the
   photos are on screen, including right after the hero's "four steps" jump on a short screen. */
.how-cue { position: absolute; width: 1px; height: 1px; pointer-events: none; }
.js .how-cue.reveal:not(.in) { transform: none; }
.how-cue-all { inset-block-start: calc(var(--D) * .38); inset-inline-start: 50%; }
.how-node > .how-cue { inset-block-end: 0; inset-inline-start: 50%; }

.how-stations {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); column-gap: clamp(1rem, 2.4vw, 2.5rem);
}
.how-station { display: grid; justify-items: center; align-content: start; text-align: center; }
.how-station:nth-child(even) { padding-block-start: var(--drop); }

.how-node { position: relative; width: var(--D); aspect-ratio: 1; flex: none; }
.how-disc {
  position: absolute; inset: 0; margin: 0; overflow: hidden; isolation: isolate;
  border-radius: 50%; background: var(--athar-ivory);
  border: 6px solid var(--athar-ivory);
  box-shadow: 0 18px 40px rgba(56, 40, 20, .12), 0 2px 6px rgba(56, 40, 20, .05);
  transition: filter 1.1s var(--ease), transform 1.1s var(--ease);
}
.how-disc > img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.how-disc.sage { background: var(--athar-sage); }
/* the last station: the certificate, on a phone rising from the bottom of the disc */
.how-disc-phone { --w: 47%; position: absolute; inset-inline: 0; inset-block-start: 17%; margin-inline: auto; padding: 2.2%; }

/* the ring that draws around a station when the line arrives (from 12 o'clock, with the reading) */
.how-ring {
  position: absolute; inset: -11px; width: calc(100% + 22px); height: calc(100% + 22px);
  overflow: visible; pointer-events: none; transform: rotate(-90deg);
}
html[dir="rtl"] .how-ring { transform: scaleX(-1) rotate(-90deg); }
/* no viewBox and no non-scaling-stroke: px geometry keeps the normalised dash (pathLength) exact */
.how-ring circle { fill: none; stroke: var(--athar-brown); stroke-width: 1.25px; stroke-dasharray: 1 1; stroke-dashoffset: 0; transition: stroke-dashoffset .9s cubic-bezier(.4, 0, .2, 1); }
.how-station:last-child .how-ring circle { stroke: var(--athar-green); stroke-width: 1.5px; }

.how-text { display: grid; justify-items: center; gap: .45rem; margin-block-start: 1.6rem; max-width: 30ch; transition: opacity .8s var(--ease), transform .8s var(--ease); }
.how-n { font-family: var(--font-num); font-weight: 700; font-size: clamp(1.75rem, 2.3vw, 2.25rem); line-height: 1; color: var(--athar-brown); margin-block-end: .2rem; }
.how-station:last-child .how-n { color: var(--athar-green); }
.how-text h3 { font-weight: 800; color: var(--athar-green); font-size: clamp(1.15rem, 1.45vw, 1.375rem); line-height: 1.25; letter-spacing: -0.005em; text-wrap: balance; }
html[lang="ar"] .how-text h3 { font-family: var(--font-arabic-display); font-weight: 700; line-height: 1.45; letter-spacing: 0; }
.how-text p { color: var(--muted); max-width: 28ch; text-wrap: balance; }
/* a duration never splits across lines ("5 or 10 years") */
.how-nw { white-space: nowrap; }
html[lang="ar"] .how-text p { font-size: 1.0625rem; line-height: 1.8; }
/* the two equal paths, at the moment of choosing */
.how-ways { display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem; margin-block: .15rem .2rem; }
.how-ways li { display: inline-flex; align-items: center; gap: .35rem; padding: .3rem .8rem .3rem .65rem; border-radius: var(--radius-pill); background: var(--athar-sage); color: var(--athar-green); font-weight: 700; font-size: .875rem; line-height: 1.35; }
.how-ways .ms { font-size: 1.15rem; }
html[lang="ar"] .how-ways li { font-size: .95rem; padding-inline: .65rem .8rem; }

/* live (JS, motion allowed): a station waits, muted, until the line reaches it, then comes to life */
/* muted, but opaque: the line runs behind the discs */
.how-path.is-live .how-station:not(.on) .how-disc { filter: saturate(0) contrast(.8) brightness(1.1); transform: scale(.95); }
.how-path.is-live .how-station:not(.on) .how-ring circle { stroke-dashoffset: 1; }
.how-path.is-live .how-station:not(.on) .how-text { opacity: 0; transform: translateY(14px); }
.how-path .now, .how-path .now * { transition: none !important; }

.how-journey-foot { display: flex; justify-content: center; margin-block-start: clamp(3rem, 6vw, 4.5rem); }
.how-journey-foot .promise { justify-content: center; text-align: start; text-wrap: balance; }
/* wide: the promise runs on one line under the row (no lone "government property." below it) */
@media (min-width: 1000px) { .how-journey-foot .promise { max-width: none; } }

/* narrower screens (below 1180px, where four discs in a row would almost touch and leave the line
   only short stubs between them): one station per row, discs alternating sides; the line switches
   back between them. The pairs stay together: at most 880px wide, and on the even rows the text
   block sits against its photo (its lines stay start-aligned). */
@media (max-width: 1179px) {
  .how-path { --how-axis: y; --D: clamp(112px, 29vw, 184px); padding-block: 0; }
  .how-stations { grid-template-columns: minmax(0, 1fr); row-gap: clamp(3.5rem, 10vw, 5rem); max-width: 880px; margin-inline: auto; }
  .how-station, .how-station:nth-child(even) {
    grid-template-columns: var(--D) minmax(0, 1fr); column-gap: clamp(1.25rem, 4.5vw, 2.5rem);
    align-items: center; justify-items: start; text-align: start; padding-block-start: 0;
  }
  .how-station:nth-child(even) { grid-template-columns: minmax(0, 1fr) var(--D); }
  .how-station:nth-child(even) .how-node { order: 2; }
  .how-text { justify-items: start; margin: 0; max-width: 34ch; }
  .how-station:nth-child(even) .how-text { justify-self: end; }
  .how-ways { justify-content: flex-start; }
  .how-text p { max-width: none; }
  .how-journey .how-head { margin-block-end: 4rem; }
}
@media (max-width: 520px) {
  .how-disc { border-width: 4px; }
  .how-ring { inset: -8px; width: calc(100% + 16px); height: calc(100% + 16px); }
  .how-n { font-size: 1.6rem; }
  .how-ways li { font-size: .8125rem; }
  .how-journey-foot .promise { max-width: 34ch; }
}

/* =========================================================
   3 · WHAT'S ON THE TAG
   ========================================================= */
.how-tag-grid {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  grid-template-areas: "fig head" "fig legend"; grid-template-rows: 1fr 1fr;
  gap: 1.75rem clamp(2rem, 6vw, 6rem);
}
.how-tag-head { grid-area: head; align-self: end; }
.how-tag-copy { grid-area: legend; align-self: start; }
.how-tag-figure { grid-area: fig; align-self: center; margin: 0; }
/* the photo never mirrors, so the pins are placed in a left-to-right frame */
.tag-figure {
  position: relative; direction: ltr; aspect-ratio: 860 / 1080;
  max-height: min(720px, calc(100vh - var(--header-h) - 3rem)); margin-inline: auto;
  border-radius: 28px; overflow: hidden; background: var(--athar-sand);
  box-shadow: 0 24px 60px rgba(56, 40, 20, .16), 0 2px 8px rgba(56, 40, 20, .06);
}
.tag-figure > img { width: 100%; height: 100%; object-fit: cover; }
.pin {
  position: absolute; inset-inline-start: var(--x); top: var(--y);
  width: 36px; height: 36px; border-radius: 50%;
  transform: translate(-50%, -50%);
  display: grid; place-items: center;
  background: var(--athar-ivory); color: var(--athar-brown);
  font-family: var(--font-num); font-weight: 700; font-size: 1rem; line-height: 1;
  box-shadow: 0 0 0 1.5px var(--athar-brown), 0 8px 18px rgba(28, 22, 14, .28);
  transition: transform .3s var(--ease), background-color .3s, color .3s, opacity .3s;
  pointer-events: none;
}
.pin::after {
  content: ""; position: absolute; inset: -5px; border-radius: 50%;
  border: 1.5px solid rgba(252, 248, 239, .95);
  animation: pin-pulse 3.2s var(--ease) infinite;
}
.pin:nth-of-type(2)::after { animation-delay: .8s; }
.pin:nth-of-type(3)::after { animation-delay: 1.6s; }
.pin:nth-of-type(4)::after { animation-delay: 2.4s; }
@keyframes pin-pulse {
  0% { transform: scale(1); opacity: .95; }
  70%, 100% { transform: scale(1.75); opacity: 0; }
}
.tag-figure.has-on .pin::after { animation: none; opacity: 0; }
.tag-figure.has-on .pin { opacity: .5; }
.tag-figure.has-on .pin.on { opacity: 1; background: var(--athar-brown); color: var(--athar-cream); transform: translate(-50%, -50%) scale(1.2); }

.how-tag-head .label { margin-block-end: .9rem; }
/* the legend: two by two, the deck's numbered list with hairlines */
.anatomy-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: clamp(1.25rem, 3vw, 2.5rem); }
.anatomy-list > li {
  display: grid; grid-template-columns: 2.4rem minmax(0, 1fr); column-gap: .9rem; row-gap: .15rem; align-content: start;
  padding-block: 1.15rem 1.25rem; border-block-start: 1px solid rgba(104, 73, 37, .22);
  cursor: default;
}
.anatomy-list .n {
  grid-row: span 2; width: 2.4rem; height: 2.4rem; border-radius: 50%;
  display: grid; place-items: center;
  border: 1.5px solid var(--athar-brown); color: var(--athar-brown); background: var(--athar-ivory);
  font-family: var(--font-num); font-weight: 700; font-size: 1rem;
  transition: background-color .25s, color .25s;
}
.anatomy-list > li.on .n { background: var(--athar-brown); color: var(--athar-cream); }
.anatomy-list h3 { font-weight: 800; color: var(--athar-green); font-size: 1.15rem; line-height: 1.3; align-self: center; }
html[lang="ar"] .anatomy-list h3 { font-family: var(--font-arabic-display); font-weight: 700; }
.anatomy-list p { color: var(--muted); font-size: .975rem; text-wrap: pretty; }
html[lang="ar"] .anatomy-list p { font-size: 1.0625rem; line-height: 1.75; }
.anatomy-link { margin-top: 1.25rem; }
.anatomy-link .tree-id { color: inherit; opacity: .8; }

@media (max-width: 960px) {
  .how-tag-grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: "head" "fig" "legend"; grid-template-rows: auto; row-gap: 2rem; }
  .tag-figure { max-width: 520px; }
}
@media (max-width: 520px) {
  .anatomy-list { grid-template-columns: minmax(0, 1fr); }
  .pin { width: 28px; height: 28px; font-size: .85rem; }
}

/* =========================================================
   4 · THE CARD IN THE APP, YOUR TREE ON THE WEB
   ========================================================= */
.how-duo-sec { padding-block-end: clamp(3.5rem, 6vw, 5rem); }
.how-duo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); align-items: stretch; }
.how-panel {
  --pad: clamp(1.75rem, 3.6vw, 3.25rem);
  position: relative; overflow: hidden; isolation: isolate;
  display: flex; flex-direction: column;
  padding: var(--pad); border-radius: 32px;
}
.how-panel .label { margin-block-end: .9rem; }
.how-panel h3 { font-weight: 800; font-size: clamp(1.6rem, 2.4vw, 2.25rem); line-height: 1.1; letter-spacing: -0.015em; color: var(--athar-green); }
html[lang="ar"] .how-panel h3 { font-family: var(--font-arabic-display); font-weight: 700; letter-spacing: 0; line-height: 1.4; }
.how-panel-copy > p:not(.label) { margin-block-start: .7rem; max-width: 44ch; text-wrap: pretty; color: var(--athar-ink); font-size: 1.0625rem; }
html[lang="ar"] .how-panel-copy > p:not(.label) { line-height: 1.85; max-width: 46ch; }
.how-panel-copy .link { margin-block-start: .9rem; }

/* the app: an ivory card, the phone rising from its foot, one tap answered */
.how-panel-app { background: var(--athar-ivory); box-shadow: var(--shadow-card); }
.how-panel-visual {
  --pw: clamp(176px, 15vw, 222px); /* the phone's width: the waves and the chip are placed from it */
  position: relative; flex: 1; min-height: clamp(230px, 21vw, 300px);
  margin-block: 2rem calc(var(--pad) * -1); margin-inline: calc(var(--pad) * -1);
}
.how-app-phone { --w: var(--pw); position: absolute; z-index: 1; inset-inline: 0; inset-block-start: 0; margin-inline: auto; }
/* the waves spread from the target on the phone's scan screen, as the tap is answered */
.how-wave {
  position: absolute; z-index: 0; inset-inline: 0; margin-inline: auto; inset-block-start: calc(var(--pw) * 1.2);
  width: calc(var(--pw) * var(--s)); aspect-ratio: 1; translate: 0 -50%;
  border-radius: 50%; border: 1px solid var(--athar-brown); opacity: var(--o);
}
.how-wave.w1 { --s: 1.5; --o: .3; }
.how-wave.w2 { --s: 2; --o: .18; }
.how-wave.w3 { --s: 2.5; --o: .09; }
/* the chip sits below the scan screen's words (they end about .67 phone-widths down), over the target */
.how-secure {
  position: absolute; z-index: 2; inset-inline-end: 7%; inset-block-start: calc(var(--pw) * .78);
  display: flex; align-items: center; gap: .7rem; padding: .6rem; padding-inline-end: 1.1rem;
  background: var(--athar-ivory); border-radius: 18px;
  box-shadow: 0 16px 36px rgba(56, 40, 20, .16), 0 2px 6px rgba(56, 40, 20, .06);
}
.how-secure-ic { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--athar-green); color: var(--athar-cream); flex: none; }
.how-secure-ic .ms { font-size: 22px; }
.how-secure strong { display: block; font-weight: 800; color: var(--athar-green); font-size: .9375rem; line-height: 1.25; }
.how-secure small { display: block; color: var(--muted); font-size: .8125rem; line-height: 1.35; }
html[lang="ar"] .how-secure strong { font-family: var(--font-arabic-display); font-weight: 700; font-size: 1rem; }
html[lang="ar"] .how-secure small { font-size: .875rem; }

/* the web: the green block, the brand mark large in its corner, the search at its foot */
.how-panel-web { background: var(--athar-green); color: var(--athar-cream); }
.how-panel-web::before {
  content: ""; position: absolute; z-index: -1; pointer-events: none;
  inset-block-start: -14%; inset-inline-end: -12%; width: 66%; aspect-ratio: 149.6 / 189.1;
  background: url("/assets/logo/athar-mark-white.svg") center / contain no-repeat; opacity: .085;
}
.how-panel-web .label { color: var(--athar-sand); }
.how-panel-web h3 { color: var(--athar-cream); }
.how-panel-web .how-panel-copy > p:not(.label) { color: var(--athar-sand); }
.how-id { max-width: none; margin-block-start: auto; padding-block-start: 2.5rem; }
.how-id > label { color: var(--athar-cream); }
.how-id .row { background: var(--athar-cream); border-color: transparent; box-shadow: 0 14px 30px rgba(20, 30, 18, .22); }
.how-id .row:focus-within { border-color: var(--athar-cream); box-shadow: 0 0 0 3px rgba(233, 222, 202, .45); }
.how-id .btn { --bg: var(--athar-green); --bd: var(--athar-green); }
.how-id .error { color: var(--athar-cream); background: rgba(162, 64, 43, .55); padding: .35rem .75rem; border-radius: 10px; justify-self: start; }
.how-panel-web :focus-visible { outline-color: var(--athar-cream); }
.how-scan { display: flex; gap: .55rem; align-items: flex-start; margin-block-start: 1.15rem; color: var(--athar-sand); font-size: .9375rem; }
.how-scan .ms { color: var(--athar-cream); font-size: 1.25rem; margin-block-start: .05em; }
html[lang="ar"] .how-scan { font-size: 1rem; line-height: 1.75; }

@media (max-width: 960px) {
  .how-duo { grid-template-columns: minmax(0, 1fr); }
  .how-panel-visual { min-height: 250px; }
}
@media (max-width: 520px) {
  .how-panel { border-radius: 26px; }
  .how-panel-visual { min-height: 236px; margin-block-start: 1.5rem; }
  .how-secure { inset-inline-end: 4%; }
  .how-id { padding-block-start: 2rem; }
}

/* motion: the waves around the app phone breathe, slowly (reduced motion: still) */
@media (prefers-reduced-motion: no-preference) {
  .how-wave { animation: how-breathe 5.5s ease-in-out infinite; }
  .how-wave.w2 { animation-delay: .5s; }
  .how-wave.w3 { animation-delay: 1s; }
}
@keyframes how-breathe { 0%, 100% { scale: 1; } 50% { scale: 1.035; } }
