/* =========================================================
   How it works — page styles (group B)
   Simplified (Oct 2026): hero · four steps · the tag · any phone · next step · close.
   Builds on athar.css (shared .steps, .promise, .id-form, .next-step). Logical properties only.
   ========================================================= */

/* ---------- hero (shared .hero-grid / .hero-media contract) ---------- */
.how-hero-text .label { margin-block-end: 1.1rem; }
.how-hero-actions { margin-top: 2rem; }
.how-hero-photo > img { object-position: 50% 42%; }
@media (max-width: 520px) {
  .how-hero-actions .btn { flex: 1 1 100%; }
}

/* ---------- four steps: shared .steps, each step led by its picture ---------- */
/* equal columns (the pictures carry the rhythm, so no column rules) */
.how-steps { column-gap: clamp(1rem, 2.2vw, 2rem); }
.how-steps > li, .how-steps > li:first-child { padding-inline: 0; }
.how-steps > li + li { border-inline-start: 0; }
.how-steps > li > .step-visual { order: -1; margin-block-end: .75rem; }

.step-visual {
  position: relative; margin: 0;
  aspect-ratio: 4 / 5; border-radius: 24px; overflow: hidden;
  background: var(--athar-cream);
  box-shadow: var(--shadow-card);
}
.step-visual > img { width: 100%; height: 100%; object-fit: cover; }
/* product stills sit on their own cream backdrop: show them whole */
.step-visual.product > img { object-fit: contain; padding: 8%; }
/* the last step: the certificate, on a small phone */
.step-visual.screen-visual { display: grid; place-items: center; }
.screen-visual .phone { --w: 44%; padding: 1.2%; }

.steps-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem 2rem; margin-top: clamp(2rem, 4vw, 3rem); padding-top: clamp(1.25rem, 2.5vw, 1.75rem); border-top: 1px solid rgba(104, 73, 37, .2); }
.steps-foot .link { min-height: 44px; }

@media (max-width: 960px) {
  /* two by two (the inline --steps:4 is overridden by the columns themselves) */
  .how-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 2.5rem; }
  /* a squarer picture keeps the 2 × 2 grid from towering on tablets */
  .step-visual { aspect-ratio: 1 / 1; }
  .screen-visual .phone { --w: 36%; }
}
/* phones: a picture thumbnail beside the number, title and line */
@media (max-width: 760px) {
  .how-steps { grid-template-columns: 1fr; row-gap: 0; }
  .how-steps > li, .how-steps > li:first-child {
    grid-template-columns: clamp(6.5rem, 30vw, 8.5rem) minmax(0, 1fr);
    column-gap: 1.1rem; row-gap: .3rem; padding-block: 1.25rem;
  }
  .how-steps > li > .step-visual { grid-column: 1; grid-row: 1 / span 3; align-self: start; margin: 0; border-radius: 18px; }
  .how-steps > li::before { grid-column: 2; grid-row: 1; font-size: 1.5rem; margin: 0; }
  .how-steps > li > h3 { grid-row: 2; }
  .how-steps > li > p { grid-row: 3; }
  .steps-foot { flex-direction: column; align-items: flex-start; }
}

/* ---------- 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: #20261E;
  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: #20261E;
}
.phone .screen {
  display: block; width: 100%; aspect-ratio: 390 / 844; overflow: hidden;
  border-radius: 13.5% / 6.3%;
  background: var(--athar-cream) url("/assets/logo/athar-mark-watermark.svg") center / 46% no-repeat;
}
.phone .screen img { width: 100%; height: 100%; object-fit: cover; object-position: top; }

/* ---------- what's on the tag ---------- */
.anatomy {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}
.anatomy-figure { margin: 0; }
/* the photo never mirrors, so the pins are positioned in a left-to-right frame */
.tag-figure {
  position: relative; direction: ltr;
  aspect-ratio: 1307 / 1120;
  border-radius: 28px; overflow: hidden;
  background: var(--athar-sand);
  box-shadow: 0 24px 60px rgba(56, 40, 20, .14);
}
.tag-figure > img { width: 100%; height: 100%; object-fit: cover; }
.pin {
  position: absolute; inset-inline-start: var(--x); top: var(--y);
  width: 34px; height: 34px; border-radius: 50%;
  transform: translate(-50%, -50%);
  display: grid; place-items: center;
  background: var(--athar-green); color: var(--athar-cream);
  font-family: var(--font-num); font-weight: 700; font-size: .95rem; line-height: 1;
  box-shadow: 0 0 0 4px rgba(252, 248, 239, .78), 0 6px 16px rgba(28, 22, 14, .28);
  transition: transform .3s var(--ease), background-color .3s, opacity .3s;
  pointer-events: none;
}
.pin::after {
  content: ""; position: absolute; inset: -4px; border-radius: 50%;
  border: 2px solid rgba(252, 248, 239, .9);
  animation: pin-pulse 2.8s var(--ease) infinite;
}
.pin:nth-of-type(2)::after { animation-delay: .7s; }
.pin:nth-of-type(3)::after { animation-delay: 1.4s; }
.pin:nth-of-type(4)::after { animation-delay: 2.1s; }
@keyframes pin-pulse {
  0% { transform: scale(1); opacity: .9; }
  70%, 100% { transform: scale(1.7); opacity: 0; }
}
.tag-figure.has-on .pin::after { animation: none; opacity: 0; }
.tag-figure.has-on .pin { opacity: .45; }
.tag-figure.has-on .pin.on { opacity: 1; background: var(--athar-brown); transform: translate(-50%, -50%) scale(1.18); }

.anatomy .label { margin-block-end: 1rem; }
.anatomy-list { display: grid; margin-top: .5rem; border-top: 1px solid var(--line); }
.anatomy-list > li {
  display: grid; grid-template-columns: 2.25rem 1fr; gap: 1rem; align-items: start;
  padding: .9rem .75rem; border-bottom: 1px solid var(--line);
  border-radius: 14px; cursor: default;
  transition: background-color .25s;
}
.anatomy-list > li.on { background: var(--athar-dune); }
.anatomy-list .n {
  width: 2.25rem; height: 2.25rem; border-radius: 50%;
  display: grid; place-items: center;
  border: 1.5px solid var(--athar-green); color: var(--athar-green);
  font-family: var(--font-num); font-weight: 700; font-size: .95rem;
  transition: background-color .25s, color .25s, border-color .25s;
}
.anatomy-list > li.on .n { background: var(--athar-brown); border-color: var(--athar-brown); color: var(--athar-cream); }
.anatomy-list h3 { font-weight: 800; color: var(--athar-green); font-size: 1.125rem; line-height: 1.3; }
html[lang="ar"] .anatomy-list h3 { font-family: var(--font-arabic-display); font-weight: 700; }
.anatomy-list p { color: var(--muted); margin-top: .15rem; font-size: .975rem; }
.anatomy-link { margin-top: 1.5rem; min-height: 44px; }
.anatomy-link .tree-id { color: inherit; opacity: .8; }

@media (max-width: 960px) {
  .anatomy { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .pin { width: 26px; height: 26px; font-size: .8rem; box-shadow: 0 0 0 3px rgba(252, 248, 239, .78), 0 4px 10px rgba(28, 22, 14, .28); }
  .anatomy-list > li { padding-inline: .5rem; }
}

/* ---------- any phone, no app ---------- */
.noapp { align-items: center; }
.secure-line { display: flex; gap: .6rem; align-items: flex-start; margin-top: 1.75rem; max-width: 46ch; color: var(--athar-ink); font-size: .975rem; }
.secure-line .ms { color: var(--athar-brown); font-size: 1.3rem; margin-top: .05em; }
.app-link { margin-top: 1.25rem; min-height: 44px; }
.ways { display: grid; gap: 0; }
.ways .card-row { align-items: flex-start; }
.ways .card-row + .card-row { margin-top: 0; }
.ways .card-row { padding-block: 1rem; border-bottom: 1px solid var(--line); }
.ways .card-row:first-child { padding-top: 0; }
.ways .id-form { margin-top: 1.5rem; max-width: none; }
@media (max-width: 960px) {
  .noapp { grid-template-columns: 1fr; }
}

/* ---------- Arabic secondary text: larger and looser ---------- */
html[lang="ar"] :is(.anatomy-list p, .ways .card-row .text, .secure-line) { font-size: 1.0625rem; line-height: 1.8; }
