/* =========================================================
   ATHAR · أثر — About (about.html)
   A small, quiet exhibition of one word (polish, 13 Oct 2026). Five rooms, one idea each:
     1 Hero        — "A trace worth leaving." beside the trace itself: the deck's cover photo
                     (roots raking a fingerprint into the dune), hung as a print in an ivory mount;
                     it opens from the fingerprint's core outward.
     2 The word    — أثر, large and textured, beside what it means.
     3 The mark    — the memorable moment: a specimen plate. The logo draws itself (print, tree,
                     name) and each part is named on a leader line as it appears (about.js).
     4 Principles  — three, on hairlines, with the deck's sage icon discs.
     5 Founders    — one line; then the shared green closing band.
   Shared patterns (.page-hero contract, .closing, .disc, .reveal) come from athar.css. Logical
   properties only, so Arabic mirrors; the logo itself is never mirrored.
   ========================================================= */

/* ---------- 1 · hero: the print ---------- */
.about-hero-copy .label { margin-block-end: 1.1rem; }
.about-hero-copy .lead, .word-note, .principles .text { text-wrap: pretty; }
/* a phrase that must not break (a negation and its verb, a verb and its object) */
.nb { white-space: nowrap; }

.about-print {
  --mount: clamp(10px, 1.35vw, 20px);
  justify-self: end;
  /* fit the first screen: never taller than the viewport leaves room for */
  width: min(100%, calc((100svh - var(--header-h) - 14rem) * 1.395 + 2 * var(--mount)));
  min-width: min(100%, 340px);
}
.about-print-mount {
  position: relative; padding: var(--mount);
  background: var(--athar-ivory); border-radius: 30px;
  box-shadow: 0 34px 70px -28px rgba(56, 40, 20, .32), 0 2px 6px rgba(56, 40, 20, .05);
}
/* a second, inner hairline in the mat, as a framed print has */
.about-print-mount::before {
  content: ""; position: absolute; z-index: 1; inset: calc(var(--mount) * .45);
  border: 1px solid rgba(104, 73, 37, .14); border-radius: 25px; pointer-events: none;
}
.about-print-mount img { width: 100%; height: auto; aspect-ratio: 1200 / 860; object-fit: cover; border-radius: 18px; background: var(--athar-sand); }
.about-print figcaption {
  display: flex; align-items: center; gap: .75rem; margin-block-start: 1.1rem; padding-inline: calc(var(--mount) + .25rem);
  font-size: .9375rem; line-height: 1.5; color: var(--athar-brown); font-weight: 600;
}
.about-print figcaption::before { content: ""; flex: none; width: 28px; height: 1.5px; background: var(--athar-brown); opacity: .7; }
html[lang="ar"] .about-print figcaption { font-size: 1rem; }

@media (prefers-reduced-motion: no-preference) {
  /* the photo opens like a ripple from the fingerprint's core (44% 70% of the frame) */
  .about-print-mount img { animation: about-print-open 2.1s cubic-bezier(.62, .02, .2, 1) .15s both; }
  .about-print-mount { animation: about-print-hang 1.3s var(--ease) both; }
  .about-print figcaption { animation: about-fade .9s var(--ease) 1.4s both; }
}
@keyframes about-print-open {
  from { clip-path: circle(0% at 44% 70%); transform: scale(1.06); }
  to { clip-path: circle(100% at 44% 70%); transform: none; }
}
@keyframes about-print-hang { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes about-fade { from { opacity: 0; } to { opacity: 1; } }

/* ---------- 2 · the word ---------- */
.word-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(2rem, 5vw, 5rem); align-items: center; }
.word-glyph {
  display: block; text-align: center; unicode-bidi: isolate; letter-spacing: 0;
  font-family: var(--font-arabic-display); font-weight: 700;
  font-size: clamp(8rem, 17vw, 16.5rem); line-height: 1.15; padding-block: .02em .08em;
  color: var(--athar-brown);
  /* the deck's fingerprint-line texture inside the heavy letters (README §4.2) */
  background: repeating-linear-gradient(-58deg, rgba(255, 255, 255, 0) 0 14px, rgba(255, 255, 255, .13) 14px 22px), currentColor;
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.word-glyph::selection { -webkit-text-fill-color: var(--athar-brown); }
.word-copy { padding-block: .75rem; padding-inline-start: clamp(2rem, 5vw, 5rem); border-inline-start: 1px solid var(--line); }
.word-copy .label { margin-block-end: .9rem; }
.word-note { max-width: 44ch; color: var(--athar-ink); }
html[lang="ar"] .word-note { font-size: 1.1875rem; line-height: 1.9; }

/* ---------- 3 · the mark: a specimen plate ---------- */
.about-mark {
  --lw: clamp(280px, 26vw, 380px);          /* the logo's width */
  --reach: clamp(250px, 23vw, 330px);       /* from the logo's edge to the outer edge of a key */
  --tw: clamp(196px, 16vw, 236px);          /* a key's text width */
}
.mark-head { display: grid; justify-items: center; text-align: center; margin-block-end: clamp(2.5rem, 5vw, 4rem); }
.mark-head .label { margin-block-end: .9rem; }
.mark-head .rule { margin-block-end: 0; }

.plate {
  position: relative; max-width: 1180px; margin-inline: auto;
  padding: clamp(3rem, 6vw, 5.5rem) clamp(1.5rem, 4vw, 3rem) clamp(2rem, 3.6vw, 3rem);
  background: var(--athar-ivory); border-radius: 36px;
  box-shadow: 0 30px 70px -34px rgba(56, 40, 20, .3), 0 2px 6px rgba(56, 40, 20, .04);
}
.plate::before {
  content: ""; position: absolute; inset: clamp(10px, 1.1vw, 16px);
  border: 1px solid rgba(104, 73, 37, .14); border-radius: 26px; pointer-events: none;
}
.plate-fig { position: relative; width: var(--lw); margin-inline: auto; }
.plate-stage { position: relative; aspect-ratio: 214.896 / 269.236; }
.plate-stage > img { width: 100%; height: 100%; }
/* the static logo (no JS) sits inside the same 8-unit margin the drawing has, so the pins still land */
.plate-stage > img[src*="athar-logo-primary"] { padding: 3.723%; }
/* a faint under-drawing of the mark, so the plate is never blank: the line traces over it */
.plate-stage::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: url("/assets/logo/athar-logo-mono-brown.svg") center / 92.554% auto no-repeat;
  opacity: .075;
}
.plate-stage > img { position: relative; }

/* a pin on the part being named (it never moves with the language: the logo is not mirrored,
   but it is near-symmetric, so a pin measured from the inline-start edge lands on the mirrored part) */
.pin {
  position: absolute; z-index: 2;
  inset-inline-start: calc(var(--ax) * 100%); inset-block-start: calc(var(--ay) * 100%);
  width: 11px; height: 11px; margin-inline-start: -5.5px; margin-block-start: -5.5px;
  border-radius: 50%; background: var(--athar-brown); box-shadow: 0 0 0 3px var(--athar-ivory), 0 0 0 4px rgba(104, 73, 37, .28);
}

/* the key: each label sits beyond the logo's edge, joined to its pin by a hairline */
.plate-key { position: absolute; inset: 0; margin: 0; padding: 0; list-style: none; }
.key { position: absolute; inset-block-start: calc(var(--ay) * 100%); display: flex; align-items: center; gap: 1rem; transform: translateY(-50%); }
.key.b { inset-inline-start: calc(var(--ax) * 100%); width: calc((1 - var(--ax)) * var(--lw) + var(--reach)); }
.key.a { inset-inline-end: calc((1 - var(--ax)) * 100%); width: calc(var(--ax) * var(--lw) + var(--reach)); flex-direction: row-reverse; }
.key .ln { flex: 1; min-width: 2rem; height: 1px; background: rgba(104, 73, 37, .5); }
.key.b .ln { transform-origin: 0 50%; }
.key.a .ln { transform-origin: 100% 50%; }
html[dir="rtl"] .key.b .ln { transform-origin: 100% 50%; }
html[dir="rtl"] .key.a .ln { transform-origin: 0 50%; }
.key .txt { flex: none; width: var(--tw); display: grid; gap: .3rem; }
.key.a .txt { text-align: end; }
.key .k {
  display: inline-flex; align-items: baseline; gap: .55rem;
  font-size: var(--fs-label); font-weight: 700; letter-spacing: var(--track-caps); text-transform: uppercase; color: var(--athar-brown);
}
.key.a .k { justify-content: flex-end; }
.key .n { font-family: var(--font-num); font-weight: 700; letter-spacing: .08em; font-variant-numeric: lining-nums tabular-nums; }
.key .t { font-weight: 800; color: var(--athar-green); font-size: 1.125rem; line-height: 1.3; letter-spacing: -0.005em; text-wrap: balance; }
html[lang="ar"] .key .k { letter-spacing: 0; text-transform: none; font-size: .95rem; }
html[lang="ar"] .key .t { font-family: var(--font-arabic-display); font-weight: 700; font-size: 1.1875rem; line-height: 1.6; letter-spacing: 0; }

.plate-foot { display: flex; justify-content: center; margin-block-start: clamp(2.25rem, 4vw, 3.25rem); }
.mark-replay { min-height: 44px; }

/* choreography: about.js marks the plate ready, then turns each pin and key on as its part is drawn.
   Without the script (or with reduced motion) everything is simply there. */
@media (prefers-reduced-motion: no-preference) {
  .plate-ready .pin { transform: scale(0); transition: transform .55s cubic-bezier(.3, 1.6, .5, 1); }
  .plate-ready .pin.on { transform: none; }
  .plate-ready .key .ln { transform: scaleX(0); transition: transform .85s cubic-bezier(.7, 0, .2, 1) .12s; }
  .plate-ready .key.on .ln { transform: none; }
  .plate-ready .key .txt { opacity: 0; transform: translateY(6px); transition: opacity .7s var(--ease) .6s, transform .7s var(--ease) .6s; }
  .plate-ready .key.on .txt { opacity: 1; transform: none; }
}

/* ---------- 4 · three principles: three wall texts on one hairline (the headline's rule is the only brown accent) ---------- */
.principles-grid { display: grid; gap: clamp(2.25rem, 4.5vw, 3.75rem); }
.principles-head .label { margin-block-end: .9rem; }
.principles-head .rule { margin-block-end: 0; }
.principles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-block-start: 1px solid var(--line); }
.principles > li {
  display: grid; align-content: start; gap: 1.15rem;
  padding-block: clamp(1.75rem, 3vw, 2.5rem) .25rem; padding-inline: clamp(1.25rem, 3vw, 2.75rem);
}
.principles > li:first-child { padding-inline-start: 0; }
.principles > li:last-child { padding-inline-end: 0; }
.principles > li + li { border-inline-start: 1px solid var(--line); }
.principles .disc { width: 60px; height: 60px; }
.principles .disc .ms { font-size: 29px; }
.principles .title { font-weight: 800; color: var(--athar-green); font-size: clamp(1.2rem, 1.6vw, 1.45rem); line-height: 1.25; letter-spacing: -0.01em; }
.principles .text { color: var(--athar-ink); opacity: .8; margin-block-start: .4rem; max-width: 40ch; }
html[lang="ar"] .principles .title { font-family: var(--font-arabic-display); font-weight: 700; letter-spacing: 0; line-height: 1.45; }
html[lang="ar"] .principles .text { font-size: 1.0625rem; line-height: 1.85; }

/* ---------- 5 · founders: one line, centred ---------- */
.founders { display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; gap: .5rem 1.25rem; text-align: center; }
.founders .names { text-wrap: balance; font-weight: 800; color: var(--athar-green); font-size: clamp(1.15rem, 1.8vw, 1.5rem); line-height: 1.35; }
html[lang="ar"] .founders .names { font-family: var(--font-arabic-display); font-weight: 700; }
.founders .nm { white-space: nowrap; }
/* the separator travels with the name after it, so a line never ends on one */
.founders .sep { color: var(--athar-brown); opacity: .55; }

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
  /* the plate: the logo, then a numbered key beneath it (pins carry the same numbers) */
  .plate-fig { width: 100%; }
  .plate-stage { width: min(66%, 320px); margin-inline: auto; }
  .plate-key {
    position: static; display: grid; gap: 1.25rem; max-width: 30rem; margin-inline: auto;
    margin-block-start: clamp(2rem, 6vw, 2.75rem); padding-block-start: clamp(1.5rem, 4vw, 2rem); border-block-start: 1px solid var(--line);
  }
  .key, .key.a, .key.b { position: static; width: auto; transform: none; display: block; }
  .key .ln { display: none; }
  .key .txt, .key.a .txt { width: auto; text-align: start; grid-template-columns: 30px minmax(0, 1fr); column-gap: .9rem; row-gap: .1rem; align-items: center; }
  .key .k { display: contents; }
  .key .k > [data-lang] { grid-column: 2; }
  .key .t { grid-column: 2; }
  .key .n, .pin {
    display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
    background: var(--athar-green); color: var(--athar-cream);
    font-family: var(--font-num); font-weight: 700; font-size: .75rem; letter-spacing: .02em; line-height: 1;
  }
  .key .n { grid-row: 1 / span 2; align-self: start; }
  /* numbered pins sit just outside the part they name, so they never cover the letters */
  .pin { width: 28px; height: 28px; margin-block-start: -14px; box-shadow: 0 0 0 3px var(--athar-ivory); }
  .pin.a { margin-inline-start: -30px; }
  .pin.b { margin-inline-start: -2px; }
  .pin::after { content: attr(data-n); }
}
/* on phones the key sits under the logo: keep it readable (dimmed) while its part is still drawing */
@media (max-width: 1000px) and (prefers-reduced-motion: no-preference) {
  .plate-ready .key .txt { opacity: .32; transform: none; transition: opacity .7s var(--ease) .3s; }
  .plate-ready .key .n { background: var(--athar-tan); transition: background-color .5s var(--ease) .3s; }
  .plate-ready .key.on .n { background: var(--athar-green); }
}
@media (max-width: 960px) {
  .about-print { justify-self: start; width: min(100%, 580px); min-width: 0; }
  /* tablets keep the two columns, with a smaller glyph */
  .word-grid { grid-template-columns: minmax(0, 4fr) minmax(0, 6fr); gap: clamp(1.5rem, 4vw, 2.5rem); }
  .word-glyph { font-size: clamp(7rem, 18vw, 10rem); }
  .word-copy { padding-inline-start: clamp(1.5rem, 4vw, 2.5rem); }
  .principles { grid-template-columns: 1fr; }
  .principles > li, .principles > li:first-child, .principles > li:last-child { grid-template-columns: auto minmax(0, 1fr); gap: 1.1rem; padding: clamp(1.25rem, 3vw, 1.75rem) 0; border-block-end: 1px solid var(--line); }
  .principles > li + li { border-inline-start: 0; }
  /* the founders line brings its own hairline (athar.css), so the last principle needs none */
  .principles > li:last-child { border-block-end: 0; }
  .principles .disc { width: 52px; height: 52px; }
  .principles .disc .ms { font-size: 25px; }
  .principles .text { max-width: 52ch; }
}
@media (max-width: 720px) {
  .word-grid { grid-template-columns: 1fr; gap: .25rem; }
  /* justify-self follows the page's direction (the glyph itself is set right-to-left) */
  .word-glyph { justify-self: start; text-align: center; font-size: clamp(7rem, 32vw, 11rem); }
  .word-copy { padding-inline-start: 0; border-inline-start: 0; padding-block: 0; }
}
@media (max-width: 620px) {
  .plate { border-radius: 28px; padding-inline: 1.25rem; }
  .plate::before { border-radius: 20px; }
  .principles > li, .principles > li:first-child, .principles > li:last-child { gap: 1rem; }
  .principles .disc { width: 48px; height: 48px; }
  .principles .disc .ms { font-size: 24px; }
  .founders { flex-direction: column; align-items: center; gap: .35rem; }
  /* phones: one name per line, no separators */
  .founders .nm { display: block; }
  .founders .sep { display: none; }
}
