/* أثر · hero prototype · Pack 02: light identity */

/* ---------- fonts (self-hosted, subset per script) ---------- */
@font-face{font-family:"Amiri";font-weight:400;font-display:swap;src:url(../fonts/amiri-arabic-400-normal.woff2) format("woff2");unicode-range:U+0600-06FF,U+0750-077F,U+0870-08FF,U+FB50-FDFF,U+FE70-FEFF,U+200C-200E,U+2010-2011,U+204F,U+2E41;}
@font-face{font-family:"Amiri";font-weight:700;font-display:swap;src:url(../fonts/amiri-arabic-700-normal.woff2) format("woff2");unicode-range:U+0600-06FF,U+0750-077F,U+0870-08FF,U+FB50-FDFF,U+FE70-FEFF,U+200C-200E,U+2010-2011,U+204F,U+2E41;}
@font-face{font-family:"IBM Plex Sans Arabic";font-weight:400;font-display:swap;src:url(../fonts/ibm-plex-sans-arabic-arabic-400-normal.woff2) format("woff2");unicode-range:U+0600-06FF,U+0750-077F,U+0870-08FF,U+FB50-FDFF,U+FE70-FEFF,U+200C-200E,U+2010-2011,U+204F,U+2E41;}
@font-face{font-family:"IBM Plex Sans Arabic";font-weight:500;font-display:swap;src:url(../fonts/ibm-plex-sans-arabic-arabic-500-normal.woff2) format("woff2");unicode-range:U+0600-06FF,U+0750-077F,U+0870-08FF,U+FB50-FDFF,U+FE70-FEFF,U+200C-200E,U+2010-2011,U+204F,U+2E41;}
@font-face{font-family:"IBM Plex Sans Arabic";font-weight:400;font-display:swap;src:url(../fonts/ibm-plex-sans-arabic-latin-400-normal.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;}
@font-face{font-family:"IBM Plex Mono";font-weight:400;font-display:swap;src:url(../fonts/ibm-plex-mono-latin-400-normal.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;}
@font-face{font-family:"IBM Plex Mono";font-weight:500;font-display:swap;src:url(../fonts/ibm-plex-mono-latin-500-normal.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;}

/* ---------- tokens (light identity) ---------- */
:root{
  --hajar:#EFE8DC; --aaj:#F8F3EB; --hibr:#2B211C; --ramad:#6F6358;
  --zafaran:#A9741F; --zafaran-soft:#D9A441; --nuhas:#9A5530; --ward:#B4706B; --leel:#1E1714;
  --ease-out:cubic-bezier(.16,1,.3,1);

  --f-head:"Amiri",serif;
  --f-body:"IBM Plex Sans Arabic",system-ui,sans-serif;
  --f-num:"IBM Plex Mono","IBM Plex Sans Arabic",ui-monospace,monospace;
  --gut:6vw;
}

*,*::before,*::after{box-sizing:border-box}
html{background:var(--hajar);color:var(--hibr);-webkit-text-size-adjust:100%}
body{margin:0;font-family:var(--f-body);font-size:1rem;line-height:1.6;background:var(--hajar)}
h1,h2,p,ul{margin:0}
button{font:inherit}
img,video,svg,canvas{display:block}

/* ---------- hero shell ----------
   Geometry vars (--nx, --ntop, --nshelf, --bx/--by/--bw/--bh, --wx/--wy/--ww/--wh) are written by JS
   from the plate's rendered cover box on resize only. The fallbacks below are the 1440x900 values. */
.hero{position:relative;height:100svh;overflow:hidden;background:var(--hajar)}
.hero__stage{position:absolute;inset:0;overflow:hidden;
  /* first-paint fallbacks, so nothing jumps before the deferred JS measures (in vw/svh so they scale) */
  --nx:49.33vw; --ntop:32.4svh; --nshelf:75.7svh;
  --bx:42.26vw; --by:43.16svh; --bw:22.64svh; --bh:33.87svh;
  --wx:43.25vw; --wy:8.94svh;  --ww:19.47svh; --wh:22.1svh;
  /* 16:9 clip framed on the plume's upper curls, so wisps show inside the letters at p .7 */
  --smoke-zoom:3.2; --smoke-ox:40%; --smoke-oy:66%;}
@media (max-width:767.98px){
  .hero__stage{--nx:50vw; --ntop:38.8svh; --nshelf:71.7svh;
    --bx:31.38vw; --by:47.04svh; --bw:17.2svh; --bh:25.72svh;
    --wx:23.38vw; --wy:9.74svh; --ww:24.61svh; --wh:27.94svh}
}
/* until the reveal only the plate shows (never a flat field); no CSS transitions on anything GSAP scrubs */
/* the plate and the bottle paint as soon as they decode (they are the LCP); type waits for its font */
body.is-loading .wordmark,body.is-loading .copy,body.is-loading .cap{visibility:hidden}

.camera,.bottle-cam{position:absolute;inset:0;transform-origin:var(--nx) calc((var(--ntop) + var(--nshelf)) / 2)}

/* 1. plates: same room, three times of day, full-bleed cover */
.plate,.plate img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;object-position:50% 50%}
.plate--dusk,.plate--night{opacity:0}

/* 2 + 6. note layers: one 3:2 image each; at most ~60% of it on screen; centre band (niche) stays clear */
.layer{position:absolute;inset:0;opacity:0;pointer-events:none}
.layer img{width:100%;height:100%;object-fit:cover;object-position:50% 50%;
  /* ~60% of the image on screen, feathered (a hard clip shows cut elements) */
  -webkit-mask-image:linear-gradient(to bottom, transparent 8%, #000 26%, #000 70%, transparent 88%);
          mask-image:linear-gradient(to bottom, transparent 8%, #000 26%, #000 70%, transparent 88%)}
.layer--far img{filter:blur(3px)}
/* desktop: a narrower window, so fewer elements are on screen at once (mobile keeps its band) */
@media (min-width:768px){
  .layer img{-webkit-mask-image:linear-gradient(to bottom, transparent 24%, #000 36%, #000 58%, transparent 70%);
                     mask-image:linear-gradient(to bottom, transparent 24%, #000 36%, #000 58%, transparent 70%)}
}

/* SCREEN SPACE: the wordmark group sits above the camera, outside the push-in (same stacking level,
   no wrapper, so multiply/screen still blend with the plates underneath) */
.letter-dark,.wordmark,.smoke-in{z-index:1}
/* night only: soft darkening behind the letters so the screen-blended smoke reads */
.letter-dark{position:absolute;left:calc(var(--wx) - var(--ww) * .55);top:calc(var(--wy) - var(--wh) * .45);
  width:calc(var(--ww) * 2.1);height:calc(var(--wh) * 1.9);opacity:0;
  background:radial-gradient(closest-side, rgba(20,14,10,.62), rgba(20,14,10,.32) 55%, rgba(20,14,10,0))}

/* 3. wordmark: inked into the stone above the niche */
.wordmark{position:absolute;left:var(--wx);top:var(--wy);width:var(--ww);height:var(--wh);
  color:var(--hibr);opacity:.85;mix-blend-mode:multiply}
.wordmark__svg{width:100%;height:100%}

/* 4a. smoke inside the letters: mask and video share exactly the wordmark box */
/* inside the mask: a dark --leel base, then the video screened on top, so the wisps read against dark */
.smoke-in{position:absolute;left:var(--wx);top:var(--wy);width:var(--ww);height:var(--wh);opacity:0;
  isolation:isolate;transform-origin:50% 60%;
  -webkit-mask:url(../brand/athar-ruqaa.svg) 0 0 / 100% 100% no-repeat;
          mask:url(../brand/athar-ruqaa.svg) 0 0 / 100% 100% no-repeat}
.smoke-in__base{position:absolute;inset:0;background:var(--leel);opacity:0}
/* desktop: the screened smoke inside the letters at .75, so the dark base shows between the wisps */
@media (min-width:768px){.smoke-in .smoke__video{opacity:.75}}
.smoke-in .smoke__video{position:relative;mix-blend-mode:screen;width:100%;height:100%;object-fit:cover;object-position:50% 100%;
  transform:scale(var(--smoke-zoom, 3));transform-origin:var(--smoke-ox, 50%) var(--smoke-oy, 88%)}
/* 4b. unmasked smoke for the flood; thins out at the bottom so the night caption sits on stone, not smoke */
.smoke-full{position:absolute;inset:0;width:100%;height:100%;opacity:0;mix-blend-mode:screen;
  -webkit-mask-image:linear-gradient(to top, transparent 0, transparent 13%, #000 34%);
          mask-image:linear-gradient(to top, transparent 0, transparent 13%, #000 34%)}

/* 5. bottle: body + cap on one canvas, standing on the niche shelf */
.bottle-cam{pointer-events:none}
.bottle{position:absolute;left:var(--bx);top:var(--by);width:var(--bw);height:var(--bh);transform-origin:50% 50%}
.bottle__grade{position:absolute;inset:0;filter:sepia(0) saturate(1) brightness(1)}
.bottle__body,.bottle__cap{position:absolute;inset:0}
.bottle img{width:100%;height:100%}
.bottle__shadow{position:absolute;left:18%;width:64%;top:94%;height:6%;opacity:0;border-radius:50%;filter:blur(2.5px);
  background:radial-gradient(closest-side, rgba(43,33,28,.7), rgba(43,33,28,.25) 60%, rgba(43,33,28,0))}
.bottle__rim{position:absolute;top:36%;bottom:5%;right:22.5%;width:2px;opacity:0;filter:blur(.6px);
  background:linear-gradient(to bottom, transparent, rgba(255,226,180,.9) 25%, rgba(255,226,180,.9) 75%, transparent)}

/* contact shadows: light comes from the right, so shadows fall to the left */
.shadow{position:absolute;opacity:0;pointer-events:none;border-radius:50%}
.shadow--morning{left:calc(var(--bx) + var(--bw) * .02);top:calc(var(--nshelf) - var(--bh) * .022);
  width:calc(var(--bw) * .78);height:calc(var(--bh) * .05);
  background:radial-gradient(closest-side, rgba(43,33,28,.55), rgba(43,33,28,0));filter:blur(2px);opacity:1}
.shadow--dusk{left:calc(var(--bx) - var(--bw) * .45);top:calc(var(--nshelf) - var(--bh) * .026);
  width:calc(var(--bw) * 1.25);height:calc(var(--bh) * .055);
  background:radial-gradient(closest-side, rgba(60,30,18,.5), rgba(60,30,18,0));filter:blur(4px)}
.shadow--night{left:calc(var(--bx) - var(--bw) * .25);top:calc(var(--nshelf) - var(--bh) * .1);
  width:calc(var(--bw) * 1.5);height:calc(var(--bh) * .2);mix-blend-mode:screen;
  background:radial-gradient(closest-side, rgba(255,170,80,.55), rgba(255,140,60,0));filter:blur(6px)}

/* 7. captions: real text, centred under the niche, warm ink on day plates, ivory on night */
.copy{display:contents}
.notes{display:none}
.cap{position:absolute;left:0;right:0;bottom:calc(6.5svh + env(safe-area-inset-bottom));margin-inline:auto;width:fit-content;
  max-width:min(40vw, 36rem);text-align:center;font-family:var(--f-head);font-weight:400;
  font-size:clamp(1.5rem, 2.1vw, 2.3rem);line-height:1.45;color:var(--hibr);opacity:0;visibility:hidden;text-wrap:balance}
.cap__lead{font-weight:700}
.cap--open{opacity:1;visibility:visible}
.cap--base{color:var(--aaj);text-shadow:0 1px 2px rgba(20,14,10,.6)}
/* feathered ivory veil, used only where a plate is busy behind a dark caption */
.cap--veil::before{content:"";position:absolute;inset:-1.4rem -2.4rem;z-index:-1;
  background:radial-gradient(closest-side, rgba(248,243,235,.55), rgba(248,243,235,.3) 60%, rgba(248,243,235,0))}

/* 8. product card (over the morning plate, on the niche axis) */
/* centred on the niche axis, in the space under the wordmark (--card-y written by JS) */
.card{position:absolute;left:calc(var(--nx) - 9rem);top:var(--card-y, 33svh);width:18rem;
  padding:1.5rem 1.5rem 1.6rem;background:var(--aaj);color:var(--hibr);border-radius:3px;opacity:0;visibility:hidden;
  box-shadow:0 24px 50px -24px rgba(43,33,28,.45), 0 2px 6px rgba(43,33,28,.08)}
.card__slot{width:10rem;height:14.96rem;margin:0 auto 1.25rem}  /* bottle canvas aspect */
.card__name{font-family:var(--f-head);font-weight:700;font-size:1.75rem;line-height:1.3}
.card__meta{margin-top:.35rem;color:var(--ramad);font-family:var(--f-body)}
.card__meta .num{font-family:var(--f-num);font-weight:500;color:var(--hibr)}
.card__btn{margin-top:1.25rem;width:100%;min-height:48px;border:0;border-radius:2px;cursor:pointer;
  background:var(--hibr);color:var(--aaj);font-family:var(--f-body);font-weight:500;font-size:1.05rem;
  box-shadow:inset 0 0 0 1px rgba(217,164,65,.45)}             /* saffron only as a 1px inner line */
.card__btn:hover{box-shadow:inset 0 0 0 1px var(--zafaran-soft)}
.card__btn:focus-visible{outline:2px solid var(--hibr);outline-offset:3px}
/* >= 1024px ending: no card box; text on the stone to the LEFT of the niche, centred on the niche's middle */
.card--wall{left:auto;right:var(--card-right);top:var(--card-y);width:auto;max-width:22rem;padding:0;background:none;box-shadow:none}
.card--wall .card__slot{display:none}
.card--wall .card__name{font-size:clamp(1.9rem, 2.3vw, 2.5rem)}
.card--wall .card__meta{color:var(--hibr)}
.card--wall .card__btn{width:auto;padding:0 2rem}

/* ---------- fixed header: wordmark (start) + one-stroke bottle cart (end); no bar ---------- */
.site-header{position:fixed;top:0;left:0;right:0;z-index:30;display:flex;justify-content:space-between;align-items:center;
  padding:calc(10px + env(safe-area-inset-top)) calc(var(--gut) - 10px) 0;pointer-events:none;color:var(--hibr)}
body.is-night .site-header{color:var(--aaj)}                 /* night plate only; a switch, not an animation */
.site-header > *{pointer-events:auto;display:grid;place-items:center;min-width:44px;min-height:44px;padding:0;
  color:inherit;background:none;border:0;cursor:pointer;border-radius:2px}
.site-header__mark svg{height:28px;width:auto;fill:currentColor}
.site-header__cart svg{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linejoin:round}
.site-header > :focus-visible{outline:2px solid currentColor;outline-offset:2px}
/* feathered ivory veil behind the two items only, raised where a plate is dark under them (dusk corners) */
.site-header{--veil:0}
.site-header > *{position:relative}
.site-header > *::before{content:"";position:absolute;inset:-14px -18px;z-index:-1;opacity:var(--veil);pointer-events:none;
  background:radial-gradient(closest-side, rgba(248,243,235,.72), rgba(248,243,235,.38) 60%, rgba(248,243,235,0))}
/* quiet skip link under the header (start of the reading edge is the right; it sits at the left as specified) */
.skip{position:fixed;z-index:30;left:var(--gut);top:calc(58px + env(safe-area-inset-top));display:inline-flex;align-items:center;
  min-height:44px;font:400 .95rem/1.4 var(--f-body);color:var(--hibr);text-decoration:underline;text-decoration-thickness:1px;
  text-underline-offset:.3em}
.skip.is-off{pointer-events:none}
.skip:focus-visible{opacity:1 !important;pointer-events:auto;outline:2px solid var(--hibr);outline-offset:3px}

/* stack, back to front */
.camera{z-index:1}.card{z-index:2}.bottle-cam{z-index:3}.layer--near{z-index:4}.cap,.copy{z-index:5}


/* will-change only while the pin is live */
.hero.is-live .camera,.hero.is-live .bottle-cam,.hero.is-live .bottle,.hero.is-live .bottle__cap,
.hero.is-live .layer,.hero.is-live .plate,.hero.is-live .smoke-in,.hero.is-live .smoke-full{will-change:transform,opacity}

/* debug overlay (?debug) and niche crosshair */
.debug{position:fixed;left:12px;bottom:12px;z-index:50;display:flex;gap:.9rem;align-items:baseline;
  padding:.45rem .7rem;background:rgba(0,0,0,.78);color:#fff;font:500 13px/1.3 var(--f-num);direction:ltr;border-radius:3px;pointer-events:none}
.debug[hidden]{display:none}
.debug__beat{color:var(--zafaran-soft)}
.debug__smoke{color:#9ad}
.niche-debug{display:none}
.is-debug .niche-debug{display:block;position:absolute;inset:0;pointer-events:none;
  background:
    linear-gradient(#0bf,#0bf) var(--nx) 0 / 1px 100% no-repeat,
    linear-gradient(#f0b,#f0b) 0 var(--ntop) / 100% 1px no-repeat,
    linear-gradient(#f0b,#f0b) 0 var(--nshelf) / 100% 1px no-repeat}

/* ---------- mobile ---------- */
@media (max-width:767.98px){
  .layer--far{display:none}
  .layer--near{inset:auto;left:0;width:100vw;height:66.5vw;top:calc((var(--ntop) + var(--nshelf)) / 2 - 33.25vw)}
  .cap{bottom:calc(4.5svh + env(safe-area-inset-bottom));max-width:90vw;font-size:clamp(1.25rem, 5.4vw, 1.55rem)}
  .card{left:4vw;right:4vw;width:auto;top:auto;bottom:calc(3svh + env(safe-area-inset-bottom));margin:0;
    display:grid;grid-template-columns:6.2rem 1fr;gap:1rem;align-items:center;padding:1rem}
  .card__slot{width:6.2rem;height:9.27rem;margin:0}
  .card__name{font-size:1.45rem}
  .card__btn{margin-top:.7rem}
  .debug{left:50%;bottom:auto;top:calc(8px + env(safe-area-inset-top));transform:translateX(-50%);font-size:11px;gap:.5rem}  /* between the header items */
  /* 9:16 clip: the plume head is narrow and low, so zoom onto it */
  .hero__stage{--smoke-ox:50%;--smoke-oy:70%;--smoke-zoom:2.7}
}

/* ---------- reduced motion: morning plate, bottle in the niche, ink wordmark, notes, card ---------- */
@media (prefers-reduced-motion:reduce){

  .plate--dusk,.plate--night,.layer,.letter-dark,.smoke-in,.smoke-full,.bottle__rim,
  .shadow--dusk,.shadow--night,.cap--top,.cap--heart,.cap--base{display:none}
  .copy{display:block;position:absolute;right:var(--gut);top:0;bottom:0;margin-block:auto;height:fit-content;max-width:min(30vw, 26rem)}
  .copy::before{content:"";position:absolute;inset:-2.5rem -3rem;z-index:-1;
    background:radial-gradient(closest-side, rgba(248,243,235,.6), rgba(248,243,235,.35) 60%, rgba(248,243,235,0))}
  .cap--open{position:static;margin:0;max-width:none;text-align:start;width:auto}
  .notes{display:block;list-style:none;padding:0;margin-top:1.2rem;font-family:var(--f-head);font-size:1.3rem;line-height:1.85;color:var(--hibr)}
  .card{opacity:1;visibility:visible}
  .card__slot{display:none}
  .debug{display:none}
  .card{left:7vw;top:0;bottom:0;margin-block:auto;height:fit-content}
}
@media (prefers-reduced-motion:reduce) and (max-width:767.98px){
  .hero{height:auto}
  .hero__stage{position:relative;min-height:165svh}
  .copy{left:var(--gut);right:var(--gut);top:calc(var(--nshelf) + 4svh);bottom:auto;margin:0;max-width:none;text-align:center}
  .cap--open{text-align:center}
  .notes{font-size:1.2rem}
  .card{display:block;position:absolute;top:auto;bottom:4svh;left:var(--gut);right:var(--gut)}
}
