/* TATIONIL product pages: the carton, translated to the screen */

:root {
  --paper: #fbfbfa;
  --paper-2: #f1f1ef;
  --ink: #26282d;
  --ink-2: #5d6068;
  --line: #d9d9d6;
  --red: #c8102e;
  --red-deep: #8a0c1f;
  --g1: #d4d4d4;
  --g2: #a8a8a8;
  --g3: #c9c9c9;
  --g4: #858585;
  --font-en: 'Alegreya Sans', 'Segoe UI', system-ui, sans-serif;
  --font-ar: 'IBM Plex Sans Arabic', 'Segoe UI', Tahoma, sans-serif;
  --spine: 18px;
  --gutter: 16px;
  --pad-start: calc(var(--spine) + var(--gutter));
  --ease: cubic-bezier(0.7, 0, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: light;
}

@media (min-width: 720px) { :root { --spine: 56px; --gutter: 32px; } }
@media (min-width: 1100px) { :root { --spine: 96px; --gutter: 56px; } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html.pre-ar body { visibility: hidden; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.55 var(--font-en);
  overflow-x: hidden;
}
:root[lang='ar'] body { font-family: var(--font-ar); line-height: 1.75; }
[lang='en'] { font-family: var(--font-en); }

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.15; }
p { margin: 0; }

:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; border-radius: 4px; }

/* ── Spine: the carton's stripe band ───────────────────────────── */
.spine {
  position: fixed;
  inset-block: 0;
  inset-inline-start: 0;
  width: var(--spine);
  display: flex;
  z-index: 0;
  pointer-events: none;
}
.spine i { display: block; height: 100%; transform-origin: top; }
.spine i:nth-child(1) { width: 14%; background: var(--g1); margin-inline-end: 6%; --n: 0; }
.spine i:nth-child(2) { width: 18%; background: var(--g2); margin-inline-end: 6%; --n: 1; }
.spine i:nth-child(3) { width: 10%; background: var(--g3); margin-inline-end: 8%; --n: 2; }
.spine i:nth-child(4) { width: 38%; background: var(--g4); --n: 3; }

main, .foot { position: relative; z-index: 1; padding-inline: var(--pad-start) var(--gutter); }

/* ── Header ───────────────────────────────────────────────────── */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 12px;
  padding-inline: var(--gutter);
  margin-inline-start: var(--spine);
  position: sticky;
  top: 0;
  z-index: 5;
  transition: background-color 0.35s, box-shadow 0.35s, backdrop-filter 0.35s;
}
html.scrolled .top {
  background: rgb(251 251 250 / 0.8);
  -webkit-backdrop-filter: saturate(1.5) blur(14px);
  backdrop-filter: saturate(1.5) blur(14px);
  box-shadow: 0 1px 0 var(--line), 0 10px 30px -20px rgb(38 40 45 / 0.35);
}
.maker-mark { display: flex; align-items: center; gap: 0.6rem; font-size: 0.8125rem; line-height: 1.2; color: var(--ink-2); font-family: var(--font-en); }
.logo { width: 42px; height: 42px; color: var(--red); flex: none; }
.lang {
  font: 600 0.9375rem/1 var(--font-en);
  background: none;
  color: var(--ink);
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  padding: 0.55rem 1.05rem;
  cursor: pointer;
  min-height: 44px;
}
.lang[lang='ar'] { font-family: var(--font-ar); }
.lang:hover { background: var(--ink); color: var(--paper); }

/* ── Hero ─────────────────────────────────────────────────────── */
main { max-width: 1360px; }

.hero {
  display: grid;
  gap: 28px;
  padding-block: 12px 40px;
}
@media (min-width: 900px) {
  .hero {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr);
    align-items: center;
    min-height: min(86vh, 860px);
    gap: 48px;
  }
}

.wordmark {
  color: var(--red);
  font: 800 clamp(2.5rem, 9vw, 5.25rem)/0.95 var(--font-en);
  letter-spacing: 0.005em;
}
.tagline { margin-top: 0.5rem; font-size: 1.1875rem; color: var(--ink-2); max-width: 30em; }

.figure {
  margin-top: clamp(20px, 4vw, 40px);
  font: 800 clamp(3.25rem, 14vw, 7rem)/0.92 var(--font-en);
  letter-spacing: -0.02em;
  font-variant-numeric: lining-nums;
}
.figure .w { display: inline-block; white-space: nowrap; }
.figure .c { display: inline-block; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.figure--long { font-size: clamp(2.1rem, 8.6vw, 4.5rem); }

.picker { border: 0; padding: 0; margin: 26px 0 0; min-width: 0; }
.picker legend { padding: 0; margin-bottom: 0.65rem; font-size: 0.9375rem; color: var(--ink-2); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.5rem 1.05rem;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font: 700 1rem/1 var(--font-en);
  text-decoration: none;
  color: var(--ink);
  transition: border-color 0.2s, background-color 0.2s, color 0.2s, transform 0.2s;
}
.chip:hover { border-color: var(--red); }
.chip:active { transform: scale(0.96); }
.chip[aria-current='true'] { background: var(--red); border-color: var(--red); color: #fff; }

.facts {
  margin: 28px 0 0;
  display: grid;
  gap: 14px 28px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}
@media (min-width: 520px) { .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.facts dt { font-size: 0.875rem; color: var(--ink-2); }
.facts dd { margin: 2px 0 0; font-weight: 500; }

.hero-photo {
  position: relative;
  margin: 0;
  display: grid;
  place-items: center;
  padding: clamp(8px, 3vw, 32px);
}
.hero-photo img {
  position: relative;
  width: auto;
  max-width: 100%;
  max-height: 72vh;
  object-fit: contain;
  border-radius: 14px;
  box-shadow: 0 34px 60px -34px rgb(138 12 31 / 0.45), 0 2px 6px rgb(0 0 0 / 0.06);
  transition: transform 0.35s ease-out;
  view-transition-name: box-photo;
}
.glow {
  position: absolute;
  inset: -6% -10%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgb(200 16 46 / 0.2), rgb(200 16 46 / 0.06) 62%, transparent);
  animation: breathe 7s ease-in-out infinite alternate;
}

/* Phones/small tablets: show the box photo right under the name, so people can match it to the box in hand */
@media (max-width: 899px) {
  .hero { gap: 0; }
  .hero-copy { display: contents; }
  .wordmark { order: 1; }
  .tagline { order: 2; }
  .hero-photo { order: 3; margin-top: 18px; padding: 8px 0; }
  .hero-photo img { max-height: 46vh; }
  .figure { order: 4; }
  .picker { order: 5; }
  .facts { order: 6; }
}

/* ── Story: client text between photos ────────────────────────── */
.story { display: grid; gap: clamp(36px, 7vw, 88px); padding-block: 32px 56px; }
.story-row { display: grid; gap: 24px; align-items: center; }
@media (min-width: 900px) {
  .story-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; }
  .story-row:nth-child(even) .story-photo { order: -1; }
  .story-row:not(:has(.story-photo)) { grid-template-columns: minmax(0, 1fr); }
}

.note h2 { font-size: clamp(1.5rem, 3.6vw, 2.125rem); font-weight: 700; margin-bottom: 0.9rem; display: flex; align-items: center; gap: 0.55rem; }
.note p { font-size: 1.125rem; max-width: 36em; }
.note p + p { margin-top: 0.8rem; }

.note--genuine { border-inline-start: 4px solid var(--red); padding-inline-start: clamp(16px, 3vw, 28px); }
.note--genuine p:nth-of-type(2) { font-weight: 700; }
.note-mark { width: 1.35em; height: 1.35em; color: var(--red); flex: none; }

.flag {
  width: 1.05em;
  height: 1.05em;
  flex: none;
  border-radius: 3px;
  background:
    linear-gradient(#fff, #fff) center / 20% 62% no-repeat,
    linear-gradient(#fff, #fff) center / 62% 20% no-repeat,
    var(--red);
}

.story-photo { margin: 0; border-radius: 10px; overflow: hidden; background: var(--paper-2); }
.story-photo img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }

/* ── Details: styled after the "Supplement Facts" panel ────────── */
.details { padding-block: 24px 64px; border-top: 1px solid var(--line); }
.details-title { font-size: clamp(1.5rem, 3.6vw, 2.125rem); margin-bottom: 24px; }
.details-grid { display: grid; gap: 32px; }
@media (min-width: 900px) { .details-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; } }

.facts-panel { border: 2px solid var(--ink); padding: 14px 16px 10px; background: #fff; max-width: 34rem; }
.facts-panel h3 { font-size: 1.75rem; font-weight: 800; padding-bottom: 6px; border-bottom: 9px solid var(--ink); }
.facts-panel table { width: 100%; border-collapse: collapse; }
.facts-panel th { font-size: 0.875rem; font-weight: 700; text-align: start; padding: 8px 0 6px; border-bottom: 1px solid var(--ink); }
.facts-panel th:last-child, .facts-panel td:last-child { text-align: end; white-space: nowrap; padding-inline-start: 1rem; }
.facts-panel td { padding: 9px 0; border-bottom: 1px solid var(--ink); vertical-align: top; }
.facts-panel tr:last-child td { border-bottom: 0; }
.facts-panel td:last-child { font-weight: 800; font-variant-numeric: tabular-nums; }
.on-box { color: var(--ink-2); max-width: 34rem; }

.use { margin-top: 28px; max-width: 34rem; }
.use h3, .warnings h3 { font-size: 1.25rem; margin-bottom: 0.6rem; }

.warnings ul { list-style: none; margin: 0; padding: 0; }
.warnings li { position: relative; padding: 10px 0; padding-inline-start: 26px; border-bottom: 1px solid var(--line); }
.warnings li::before {
  content: '';
  position: absolute;
  inset-inline-start: 0;
  top: 0.95em;
  width: 13px;
  height: 13px;
  border-radius: 2px;
  background:
    linear-gradient(#fff, #fff) center / 22% 64% no-repeat,
    linear-gradient(#fff, #fff) center / 64% 22% no-repeat,
    var(--red);
}

/* ── Footer ───────────────────────────────────────────────────── */
.foot {
  display: grid;
  gap: 28px;
  padding-block: 40px 48px;
  background: #2b2d31;
  color: #e9e9e7;
}
@media (min-width: 720px) { .foot { grid-template-columns: 1fr 1fr auto; align-items: start; } }
.foot h2 { font-size: 0.9375rem; font-weight: 500; color: #b4b6bb; margin-bottom: 0.5rem; }
.foot .agent { font-size: 1.5rem; font-weight: 700; margin-bottom: 0.5rem; }
.foot address { font-style: normal; line-height: 1.6; }
.foot a { color: #fff; text-underline-offset: 3px; }
.foot-logo { width: 64px; height: 64px; color: var(--red); background: #fff; border-radius: 16px; padding: 4px; }
.btns { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 0.75rem; }
.btn {
  display: inline-flex; align-items: center; min-height: 46px; padding: 0.6rem 1.2rem;
  border-radius: 999px; border: 1.5px solid #fff; text-decoration: none; font-weight: 700;
}
.btn--primary { background: var(--red); border-color: var(--red); }

/* ── Motion ───────────────────────────────────────────────────── */
@keyframes draw { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes reveal { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes reveal-rtl { from { clip-path: inset(0 0 0 100%); } to { clip-path: inset(0 0 0 0); } }
@keyframes rise { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }
@keyframes breathe { from { opacity: 0.6; transform: scale(0.94); } to { opacity: 1; transform: scale(1.05); } }

@media (prefers-reduced-motion: no-preference) {
  html:not(.settled) .spine i { animation: draw 0.9s var(--ease) both; animation-delay: calc(var(--n) * 90ms); }
  html:not(.settled) .wordmark { animation: reveal 0.8s var(--ease) 0.35s both, foil 7s ease-in-out 1.3s infinite; }
  html:not(.settled)[dir='rtl'] .wordmark { animation-name: reveal-rtl, foil; }
  html:not(.settled) .hero-photo { animation: rise 0.9s var(--ease) 0.55s both; }
  html:not(.settled) .tagline,
  html:not(.settled) .picker,
  html:not(.settled) .facts { animation: rise 0.7s var(--ease) 0.7s both; }

  ::view-transition-old(root), ::view-transition-new(root) { animation-duration: 0.28s; }
  ::view-transition-group(box-photo) { animation-duration: 0.45s; animation-timing-function: var(--ease); }
}
@media (prefers-reduced-motion: reduce) {
  .glow { animation: none; }
  .hero-photo img, .chip { transition: none; }
}

/* ── Index + QR sheet (internal pages) ────────────────────────── */
.index-list { list-style: none; padding: 0; margin: 24px 0 64px; display: grid; gap: 12px; }
.index-list a { display: flex; justify-content: space-between; gap: 1rem; padding: 18px 0; border-bottom: 1px solid var(--line); text-decoration: none; font-size: 1.5rem; font-weight: 700; }
.index-list a span { color: var(--ink-2); font-size: 1rem; font-weight: 400; }
.index-list a:hover { color: var(--red); }

.qr-grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); margin: 24px 0 64px; }
.qr-card { border: 1.5px solid var(--line); border-radius: 10px; padding: 16px; background: #fff; break-inside: avoid; }
.qr-card img { width: 100%; aspect-ratio: 1; }
.qr-card h2 { font-size: 1.125rem; margin-top: 10px; }
.qr-card p { font-size: 0.8125rem; color: var(--ink-2); overflow-wrap: anywhere; margin-top: 4px; }
.qr-card .dl { display: flex; gap: 12px; margin-top: 10px; font-weight: 700; font-size: 0.9375rem; }
@media print {
  .spine, .top, .qr-card .dl, .no-print { display: none !important; }
  main { padding: 0 !important; }
  .qr-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ══ Motion layer ═══════════════════════════════════════════════════════════
   Everything below is decoration on top of a fully readable page:
   with reduced motion (or no JS) all of it is skipped and content shows as-is. */

/* Foil wordmark: the carton's title is foil-printed, so a light sweep crosses it now and then */
.wordmark {
  background: linear-gradient(105deg, var(--red) 0 42%, #e8455c 47%, #ffe3e7 50%, #e8455c 53%, var(--red) 58% 100%);
  background-size: 260% 100%;
  background-position: 100% 0;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
html.settled .wordmark { animation: foil 7s ease-in-out 1s infinite; }
@keyframes foil { 0% { background-position: 100% 0; } 28%, 100% { background-position: 0% 0; } }

/* Ambient colour behind the hero */
.hero { position: relative; isolation: isolate; }
.aura { position: absolute; inset: -12% -8% -6% calc(var(--spine) * -1); z-index: -1; pointer-events: none; overflow: hidden; }
.aura i { position: absolute; border-radius: 50%; will-change: transform; }
.aura i:nth-child(1) { width: 62vmax; height: 62vmax; top: -22vmax; inset-inline-end: -18vmax; background: radial-gradient(closest-side, rgb(200 16 46 / 0.16), transparent); animation: drift-a 19s ease-in-out infinite alternate; }
.aura i:nth-child(2) { width: 48vmax; height: 48vmax; bottom: -20vmax; inset-inline-start: -6vmax; background: radial-gradient(closest-side, rgb(133 133 133 / 0.2), transparent); animation: drift-b 23s ease-in-out infinite alternate; }
.aura i:nth-child(3) { width: 34vmax; height: 34vmax; top: 30%; inset-inline-start: 38%; background: radial-gradient(closest-side, rgb(255 120 140 / 0.13), transparent); animation: drift-c 17s ease-in-out infinite alternate; }
@keyframes drift-a { to { transform: translate(-9vmax, 7vmax) scale(1.12); } }
@keyframes drift-b { to { transform: translate(10vmax, -6vmax) scale(0.9); } }
@keyframes drift-c { to { transform: translate(-7vmax, -9vmax) scale(1.2); } }

/* Box photo floats gently (uses `translate`, so it stacks with the pointer tilt) */
.hero-photo img { animation: float 6s ease-in-out 1.6s infinite alternate; }
@keyframes float { from { translate: 0 0; } to { translate: 0 -12px; } }

/* Scroll progress: a thin red line along the top */
.progress { position: fixed; top: 0; inset-inline: 0; height: 3px; z-index: 10; background: linear-gradient(90deg, var(--red-deep), var(--red), #ff5a70); transform: scaleX(0); transform-origin: left; pointer-events: none; }
[dir='rtl'] .progress { transform-origin: right; background: linear-gradient(270deg, var(--red-deep), var(--red), #ff5a70); }
@supports (animation-timeline: scroll()) {
  .progress { animation: progress linear both; animation-timeline: scroll(root); }
}
@keyframes progress { to { transform: scaleX(1); } }

/* Strength figure: characters roll up one by one (on load and on every switch) */
@keyframes roll {
  from { opacity: 0; transform: translateY(0.55em) rotateX(-75deg); filter: blur(5px); }
  to { opacity: 1; transform: none; filter: none; }
}
.figure { perspective: 600px; }
.figure .c { animation: roll 0.7s var(--ease-out) both; animation-delay: calc(var(--i) * 38ms); transform-origin: 50% 100%; }
html:not(.settled) .figure .c { animation-delay: calc(650ms + var(--i) * 45ms); }

/* Chips */
.chip:hover { transform: translateY(-2px); box-shadow: 0 8px 18px -10px rgb(38 40 45 / 0.45); }
.chip[aria-current='true'] { box-shadow: 0 10px 22px -10px rgb(200 16 46 / 0.75); animation: pop 0.45s var(--ease-out); }
@keyframes pop { 0% { transform: scale(0.9); } 60% { transform: scale(1.06); } 100% { transform: none; } }
.btn { transition: transform 0.2s var(--ease-out), box-shadow 0.2s; }
.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 22px -10px rgb(0 0 0 / 0.6); }
.lang { transition: background-color 0.2s, color 0.2s, transform 0.2s var(--ease-out); }
.lang:hover { transform: translateY(-1px); }

/* Scroll reveal */
html.js [data-reveal] {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
  transition-delay: calc(var(--i, 0) * 90ms);
}
html.js [data-reveal].in { opacity: 1; transform: none; }
html.js [data-reveal].now, html.js [data-reveal].now * { transition: none !important; animation: none !important; }

/* Story photos: a band of carton stripes sweeps across and uncovers the photo */
.story-photo { position: relative; }
.story-photo img { transition: transform 1.6s var(--ease-out); }
.story-photo::after {
  content: '';
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  width: 46%;
  background: linear-gradient(90deg, var(--g1) 0 14%, transparent 14% 20%, var(--g2) 20% 38%, transparent 38% 44%, var(--g3) 44% 54%, transparent 54% 62%, var(--g4) 62% 100%);
  transform: translateX(-101%);
  pointer-events: none;
}
[dir='rtl'] .story-photo::after { transform: translateX(101%) scaleX(-1); }
html.js .story-photo[data-reveal] { opacity: 1; transform: none; clip-path: inset(0 100% 0 0); transition: clip-path 1.15s var(--ease); }
html.js[dir='rtl'] .story-photo[data-reveal] { clip-path: inset(0 0 0 100%); }
html.js .story-photo[data-reveal] img { transform: scale(1.14); }
html.js .story-photo[data-reveal].in { clip-path: inset(0 0 0 0); }
html.js .story-photo[data-reveal].in img { transform: none; }
html.js .story-photo[data-reveal].in::after { animation: sweep 1.15s var(--ease) both; }
html.js[dir='rtl'] .story-photo[data-reveal].in::after { animation-name: sweep-rtl; }
@keyframes sweep { from { transform: translateX(-101%); } to { transform: translateX(240%); } }
@keyframes sweep-rtl { from { transform: translateX(101%) scaleX(-1); } to { transform: translateX(-240%) scaleX(-1); } }
.story-photo:hover img { transform: scale(1.03); }

/* Composition rows tick in after the panel */
html.js .facts-panel tbody tr { opacity: 0; transform: translateX(-14px); transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out); transition-delay: calc(250ms + var(--i) * 110ms); }
html.js[dir='rtl'] .facts-panel tbody tr { transform: translateX(14px); }
html.js .facts-panel.in tbody tr { opacity: 1; transform: none; }

/* Genuine note: the red rule draws down when it appears */
.note--genuine { position: relative; border-inline-start-color: transparent; }
.note--genuine::before { content: ''; position: absolute; inset-block: 0; inset-inline-start: -4px; width: 4px; background: var(--red); transform-origin: top; }
html.js .note--genuine[data-reveal]::before { transform: scaleY(0); transition: transform 1s var(--ease) 0.2s; }
html.js .note--genuine[data-reveal].in::before { transform: none; }

@media (prefers-reduced-motion: reduce) {
  .aura i, .hero-photo img, .wordmark, .figure .c, .chip[aria-current='true'] { animation: none !important; }
  html.js [data-reveal], html.js .story-photo[data-reveal], html.js .facts-panel tbody tr { opacity: 1; transform: none; clip-path: none; transition: none; }
  html.js .story-photo[data-reveal] img { transform: none; }
  .story-photo::after { display: none; }
  html.js .note--genuine[data-reveal]::before { transform: none; }
  .progress { display: none; }
}
