/* =========================================================
   Etqan styles
   Brand colours sampled from the supplied identity image (docs/PLAN.md).

   System rules
   - Shape: interactive controls (buttons, segmented controls, tabs, tags) are pills.
     Cards and panels use --r-lg. Images, inputs and inner panels use --r.
     Viewer thumbnails use --r-xs.
   - Layers: header 50, skip link 100. The slide viewer is a <dialog> in the top layer.
   - Motion: transform and opacity only, custom ease-out curves, and every
     movement is removed under prefers-reduced-motion.
   - Theme: light and dark follow the system setting. The maroon brand blocks
     (hero, Signature plan, rescue card, footer) stay maroon in both.
   - No letter-spacing on Arabic text: it breaks the joined script.
   ========================================================= */

/* IBM Plex Sans Arabic (SIL OFL 1.1, /fonts/OFL.txt), self-hosted: Arabic and Latin subsets, 400/600/700 */
@font-face { font-family: "IBM Plex Sans Arabic"; font-style: normal; font-weight: 400; font-display: swap; src: url(/fonts/plex-arabic-400-arabic.woff2) format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC7, U+10EC9-10EEE, U+10EF0-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1; }
@font-face { font-family: "IBM Plex Sans Arabic"; font-style: normal; font-weight: 400; font-display: swap; src: url(/fonts/plex-arabic-400-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, 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 Sans Arabic"; font-style: normal; font-weight: 600; font-display: swap; src: url(/fonts/plex-arabic-600-arabic.woff2) format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC7, U+10EC9-10EEE, U+10EF0-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1; }
@font-face { font-family: "IBM Plex Sans Arabic"; font-style: normal; font-weight: 600; font-display: swap; src: url(/fonts/plex-arabic-600-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, 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 Sans Arabic"; font-style: normal; font-weight: 700; font-display: swap; src: url(/fonts/plex-arabic-700-arabic.woff2) format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC7, U+10EC9-10EEE, U+10EF0-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1; }
@font-face { font-family: "IBM Plex Sans Arabic"; font-style: normal; font-weight: 700; font-display: swap; src: url(/fonts/plex-arabic-700-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  color-scheme: light;

  /* brand: identical in both themes */
  --maroon: #3D0A11;
  --maroon-deep: #2B070C;
  --maroon-2: #69121B;
  --maroon-line: #5A1A22;
  --red: #A6222E;
  --ivory: #F8F3EF;
  --on-maroon-2: #D9C4BE;

  /* theme */
  --bg: #FCFAF8;
  --bg-alt: #F8F3EF;
  --surface: #FFFFFF;
  --surface-2: #FCFAF8;
  --surface-3: #F1E9E4;
  --line: #E6DCD5;
  --line-strong: #CDBFB7;
  --text: #1A100E;
  --text-2: #5E4D47;
  --text-3: #7E6B64;
  --accent-text: #A6222E;
  --danger: #B3202C;
  --danger-bg: #FFF5F5;
  --focus: #C2343F;
  --ring: 0 0 0 4px rgb(166 34 46 / .14);
  --btn-bg: var(--maroon);
  --btn-fg: var(--ivory);
  --btn-bg-hover: var(--maroon-2);
  --brand-line: var(--maroon);
  --step-bg: var(--maroon);
  --switch-on: var(--maroon);
  --shadow-rgb: 61 10 17;
  --shadow-md: 0 1px 2px rgb(var(--shadow-rgb) / .05), 0 18px 40px -22px rgb(var(--shadow-rgb) / .28);
  --shadow-lg: 0 2px 6px rgb(var(--shadow-rgb) / .05), 0 40px 80px -44px rgb(var(--shadow-rgb) / .5);

  --font: "IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);

  --r-xs: 6px;
  --r: 12px;
  --r-lg: 22px;
  --pill: 999px;
  --wrap: 1160px;
  --gutter: 16px;
  --header-h: 64px;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #110A0A;
    --bg-alt: #170E0F;
    --surface: #1E1415;
    --surface-2: #160E0F;
    --surface-3: #2A1C1D;
    --line: #36262A;
    --line-strong: #4D383B;
    --text: #F5EDE9;
    --text-2: #C2B1AB;
    --text-3: #A08F89;
    --accent-text: #F0959C;
    --danger: #FF9AA1;
    --danger-bg: #2B1316;
    --focus: #FF7F89;
    --ring: 0 0 0 4px rgb(255 127 137 / .2);
    --btn-bg: var(--ivory);
    --btn-fg: var(--maroon);
    --btn-bg-hover: #FFFFFF;
    --brand-line: #8A2833;
    --step-bg: var(--maroon-2);
    --switch-on: var(--red);
    --shadow-rgb: 0 0 0;
  }
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
  background: var(--bg);
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.8;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3 { margin: 0; font-weight: 700; line-height: 1.3; text-wrap: balance; }
p { margin: 0; }
a { color: inherit; }
button, input, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ico { width: 1.2em; height: 1.2em; flex: none; fill: currentColor; }
.num, [data-price], #s-total, #s-base, #s-vo, .viewer-count { font-variant-numeric: tabular-nums; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
@media (min-width: 700px) { :root { --gutter: 28px; } }

.skip {
  position: absolute; inset-inline-start: 12px; top: -64px; z-index: 100;
  padding: 10px 16px; border-radius: var(--pill);
  background: var(--text); color: var(--bg); text-decoration: none; font-weight: 600;
}
.skip:focus { top: 12px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 24px; border-radius: var(--pill);
  border: 1.5px solid transparent;
  font-weight: 600; font-size: 16px; line-height: 1.2; text-decoration: none; white-space: nowrap;
  cursor: pointer; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent;
  transition: transform 160ms var(--ease-out), background-color 200ms ease, border-color 200ms ease, color 200ms ease;
}
.btn:active { transform: scale(.97); }
.btn .ico { width: 22px; height: 22px; }
.btn-sm { min-height: 40px; padding: 0 18px; font-size: 15px; }
.btn-lg { min-height: 56px; padding: 0 28px; font-size: 17px; }
.btn-block { width: 100%; }
.btn-light { background: var(--ivory); color: var(--maroon); }
.btn-ghost { border-color: rgb(248 243 239 / .34); color: var(--ivory); }
.btn-primary { background: var(--btn-bg); color: var(--btn-fg); }
.btn-outline { background: var(--surface); border-color: var(--line-strong); color: var(--text); }
.btn[aria-disabled="true"] { opacity: .6; cursor: default; }
.btn[aria-disabled="true"]:active { transform: none; }
@media (hover: hover) and (pointer: fine) {
  .btn-light:hover { background: #FFFFFF; }
  .btn-ghost:hover { border-color: var(--ivory); background: rgb(248 243 239 / .06); }
  .btn-primary:hover { background: var(--btn-bg-hover); }
  .btn-outline:hover { border-color: var(--text); }
  .btn[aria-disabled="true"]:hover { background: var(--ivory); }
}

/* ---------- header (translucent brand material) ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  padding-top: env(safe-area-inset-top);
  color: var(--ivory);
  background: rgb(61 10 17 / .86);
  -webkit-backdrop-filter: saturate(160%) blur(18px);
  backdrop-filter: saturate(160%) blur(18px);
  box-shadow: inset 0 -1px 0 rgb(248 243 239 / .08);
}
@media (prefers-reduced-transparency: reduce) {
  .site-header { background: var(--maroon); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
.header-inner { display: flex; align-items: center; gap: 24px; height: var(--header-h); }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.brand img { border-radius: 10px; }
.brand-name { font-weight: 700; font-size: 20px; line-height: 1; }
.brand-latin { margin-inline-start: 4px; font-weight: 600; font-size: 13px; letter-spacing: .06em; opacity: .62; }
.nav { display: none; gap: 28px; margin-inline-start: auto; font-size: 15px; }
.nav a { text-decoration: none; opacity: .8; transition: opacity 200ms ease; }
.header-inner > .btn { margin-inline-start: auto; }
@media (hover: hover) and (pointer: fine) { .nav a:hover { opacity: 1; } }
@media (min-width: 900px) {
  .nav { display: flex; }
  .header-inner > .btn { margin-inline-start: 8px; }
}

/* ---------- hero ---------- */
.hero {
  position: relative; isolation: isolate; overflow: hidden; overflow: clip;
  padding: 36px 0 60px;
  background: var(--maroon); color: var(--ivory);
}
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(55% 65% at 22% 50%, rgb(166 34 46 / .22), transparent 70%);
}
/* a faint slide-layout grid behind the deck: decoration only */
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(rgb(248 243 239 / .05) 1px, transparent 1px),
    linear-gradient(90deg, rgb(248 243 239 / .05) 1px, transparent 1px);
  background-size: 56px 56px; background-position: center;
  -webkit-mask-image: radial-gradient(60% 70% at 26% 52%, #000 10%, transparent 72%);
  mask-image: radial-gradient(60% 70% at 26% 52%, #000 10%, transparent 72%);
}
@media (max-width: 959px) {
  .hero::after {
    -webkit-mask-image: radial-gradient(90% 45% at 50% 82%, #000 10%, transparent 75%);
    mask-image: radial-gradient(90% 45% at 50% 82%, #000 10%, transparent 75%);
  }
}
.hero-grid { display: grid; gap: 40px; align-items: center; }
.eyebrow { margin-bottom: 12px; font-size: 15px; font-weight: 600; color: var(--on-maroon-2); }
.hero h1 { font-size: clamp(40px, 3vw + 20px, 64px); line-height: 1.18; }
.lead { margin-top: 18px; max-width: 31em; font-size: 18px; line-height: 1.85; color: #EADBD6; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.hero-cta .btn { flex: 1 1 150px; }
.hero-facts {
  display: flex; flex-wrap: wrap; gap: 10px 22px;
  list-style: none; margin: 28px 0 0; padding: 0;
  font-size: 15px; line-height: 1.5; color: var(--on-maroon-2);
}
.hero-facts li { display: inline-flex; align-items: center; gap: 8px; }
.hero-facts .ico { width: 20px; height: 20px; color: #F2A7AD; }
.hero-facts a {
  color: var(--ivory); text-decoration: underline;
  text-decoration-color: rgb(248 243 239 / .38); text-underline-offset: 6px;
  transition: text-decoration-color 200ms ease;
}
@media (hover: hover) and (pointer: fine) { .hero-facts a:hover { text-decoration-color: var(--ivory); } }
.hero-visual { margin: 0; }
.hero-visual figcaption { margin-top: 18px; font-size: 14px; line-height: 1.7; color: var(--on-maroon-2); }

/* deck fan: three real covers, the front one opens the viewer.
   The back cards fan toward the headline so their artwork side shows, not clipped titles. */
.fan { position: relative; aspect-ratio: 16 / 11; }
.fan-card {
  position: absolute; bottom: 0; inset-inline-end: 0;
  width: 86%; aspect-ratio: 16 / 9; margin: 0; padding: 0; border: 0;
  border-radius: var(--r); overflow: hidden; background: #0F1B2D;
  box-shadow: 0 0 0 1px rgb(248 243 239 / .1), 0 28px 56px -28px rgb(0 0 0 / .7);
  transition: transform 600ms var(--ease-out);
}
.fan-card img { width: 100%; height: 100%; object-fit: cover; }
.fan-back2 { transform: translate(15%, -22%) rotate(7deg); }
.fan-back1 { z-index: 1; transform: translate(7.5%, -11%) rotate(3.5deg); }
.fan-front { z-index: 2; cursor: zoom-in; -webkit-tap-highlight-color: transparent; }
.fan-front:active { transform: scale(.98); transition-duration: 160ms; }
@media (hover: hover) and (pointer: fine) {
  .fan:hover .fan-front { transform: translateY(-6px); }
  .fan:hover .fan-back1 { transform: translate(10%, -13%) rotate(4.5deg); }
  .fan:hover .fan-back2 { transform: translate(20%, -26%) rotate(9deg); }
}
@media (min-width: 960px) {
  .hero { display: grid; align-items: center; min-height: min(800px, calc(100svh - var(--header-h))); padding: 64px 0 88px; }
  .hero-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr); gap: 56px; }
  .hero-cta .btn { flex: 0 0 auto; }
}

/* entrance: copy rises in order, the deck fans out from a stack */
@media (prefers-reduced-motion: no-preference) {
  .hero-copy > * { animation: rise 800ms var(--ease-out) backwards; }
  .hero-copy > :nth-child(2) { animation-delay: 70ms; }
  .hero-copy > :nth-child(3) { animation-delay: 140ms; }
  .hero-copy > :nth-child(4) { animation-delay: 210ms; }
  .hero-copy > :nth-child(5) { animation-delay: 280ms; }
  .hero-visual { animation: rise 900ms var(--ease-out) 120ms backwards; }
  .fan-back1 { animation: unstack 1000ms var(--ease-out) 380ms backwards; }
  .fan-back2 { animation: unstack 1000ms var(--ease-out) 440ms backwards; }
}
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
@keyframes unstack { from { transform: none; } }

/* ---------- sections ---------- */
.section { padding: 72px 0; }
.section-alt { background: var(--bg-alt); }
@media (min-width: 900px) { .section { padding: 112px 0; } }
.section-head { max-width: 720px; margin-bottom: 32px; }
@media (min-width: 900px) { .section-head { margin-bottom: 48px; } }
.section h2 { font-size: clamp(28px, 1.8vw + 21px, 44px); }
.section-sub { margin-top: 14px; max-width: 40em; font-size: 18px; color: var(--text-2); }
.note { margin-top: 20px; font-size: 14px; line-height: 1.7; color: var(--text-3); }

/* scroll reveal (JS adds .is-in once; content stays visible without JS) */
.js .reveal {
  opacity: 0; transform: translateY(20px);
  transition: opacity 700ms var(--ease-out), transform 700ms var(--ease-out);
  transition-delay: var(--delay, 0ms);
}
.js .reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js .reveal { transform: none; transition: opacity 300ms ease; }
}

/* ---------- segmented controls (sliding thumb) ---------- */
.seg {
  position: relative; display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  padding: 4px; border-radius: var(--pill);
  background: var(--surface-3); box-shadow: inset 0 0 0 1px var(--line);
}
.seg-thumb {
  position: absolute; top: 4px; bottom: 4px; inset-inline-start: 4px;
  width: calc((100% - 8px) / var(--n, 2));
  border-radius: var(--pill); background: var(--surface);
  box-shadow: 0 1px 2px rgb(var(--shadow-rgb) / .14), 0 3px 10px -3px rgb(var(--shadow-rgb) / .16);
  transform: translateX(calc(var(--i, 0) * -100%));
  transition: transform 320ms var(--ease-out);
}
.seg button {
  position: relative; z-index: 1;
  min-height: 40px; padding: 0 18px; border: 0; border-radius: var(--pill); background: transparent;
  font-weight: 600; font-size: 15px; color: var(--text-2); cursor: pointer;
  -webkit-tap-highlight-color: transparent; transition: color 200ms ease, opacity 120ms ease;
}
.seg button:active { opacity: .7; }
.seg button[aria-checked="true"] { color: var(--text); }
.seg-wide { display: grid; width: 100%; }
.seg-wide button { padding: 0 8px; }
.seg-dark { background: rgb(255 255 255 / .08); box-shadow: inset 0 0 0 1px rgb(255 255 255 / .1); }
.seg-dark .seg-thumb { background: var(--ivory); }
.seg-dark button { color: #CDBCB6; }
.seg-dark button[aria-checked="true"] { color: var(--maroon); }
@media (prefers-reduced-motion: reduce) { .seg-thumb { transition: none; } }

/* ---------- topic tabs ---------- */
.gallery-controls { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; margin-bottom: 24px; }
.gallery-controls .tabs { align-self: stretch; }
@media (min-width: 900px) { .gallery-controls { flex-direction: row; align-items: center; justify-content: space-between; } }
.tabs {
  display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none;
  margin-inline: calc(var(--gutter) * -1); padding: 2px var(--gutter);
}
.tabs::-webkit-scrollbar { display: none; }
@media (min-width: 900px) { .tabs { margin: 0; padding: 2px 0; } }
.tab {
  flex: none; min-height: 44px; padding: 0 18px; border-radius: var(--pill);
  border: 1.5px solid var(--line); background: var(--surface);
  font-weight: 600; font-size: 15px; color: var(--text); cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: background-color 200ms ease, border-color 200ms ease, color 200ms ease, transform 160ms var(--ease-out);
}
.tab:active { transform: scale(.97); }
.tab[aria-selected="true"] { background: var(--text); border-color: var(--text); color: var(--bg); }
@media (hover: hover) and (pointer: fine) { .tab:not([aria-selected="true"]):hover { border-color: var(--line-strong); } }

/* ---------- gallery (bento: the cover leads, the rest follow) ---------- */
.gallery { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.gallery > :first-child, .gallery > :nth-child(6) { grid-column: 1 / -1; }
@media (min-width: 900px) {
  .gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
  .gallery > :first-child { grid-column: span 2; grid-row: span 2; aspect-ratio: auto; }
  .gallery > :nth-child(6) { grid-column: auto; }
}
.slide-btn {
  position: relative; display: block; width: 100%; margin: 0; padding: 0; border: 0;
  aspect-ratio: 16 / 9; border-radius: var(--r); overflow: hidden;
  background: var(--surface-3); box-shadow: 0 0 0 1px var(--line);
  cursor: zoom-in; -webkit-tap-highlight-color: transparent;
  transition: transform 300ms var(--ease-out), box-shadow 300ms ease;
}
.slide-btn img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 400ms ease; }
.slide-btn img.is-loaded { opacity: 1; }
.slide-btn:active { transform: scale(.98); transition-duration: 160ms; }
@media (hover: hover) and (pointer: fine) {
  .slide-btn:hover { transform: translateY(-3px); box-shadow: 0 0 0 1px var(--line-strong), var(--shadow-md); }
}
.deck-meta {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px;
  margin-top: 16px; font-size: 15px; color: var(--text-2);
}
.deck-meta strong { font-weight: 600; color: var(--text); }

/* ---------- compare ---------- */
.compare { display: grid; gap: 18px; grid-template-areas: "seg" "stage" "notes"; }
.compare-seg { grid-area: seg; max-width: 520px; }
.compare-stage {
  grid-area: stage; position: relative; aspect-ratio: 16 / 9;
  border-radius: var(--r); overflow: hidden; background: var(--surface);
  box-shadow: 0 0 0 1px var(--line), var(--shadow-lg);
}
.compare-stage img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; filter: blur(6px);
  transition: opacity 300ms ease, filter 300ms ease;
}
.compare-stage img.is-prev { z-index: 1; opacity: 1; filter: none; transition: none; }
.compare-stage img.is-active { z-index: 2; opacity: 1; filter: none; }
.compare-notes { grid-area: notes; }
.compare-note h3 { font-size: 21px; }
.compare-note p { margin-top: 6px; color: var(--text-2); }
.compare-note ul { list-style: none; display: grid; gap: 10px; margin: 16px 0 0; padding: 0; }
.compare-note li { display: flex; align-items: flex-start; gap: 10px; line-height: 1.7; }
.compare-note li .ico { width: 18px; height: 18px; margin-top: .28em; color: var(--accent-text); }
.compare-note[data-v="before"] li .ico { color: var(--text-3); }
@media (prefers-reduced-motion: no-preference) {
  .compare-note:not([hidden]) { animation: fade-up 320ms var(--ease-out); }
}
@media (prefers-reduced-motion: reduce) { .compare-stage img { filter: none; } }
@keyframes fade-up { from { opacity: 0; transform: translateY(6px); } }
@media (min-width: 900px) {
  .compare {
    grid-template-columns: minmax(250px, 1fr) minmax(0, 2.15fr);
    grid-template-rows: auto 1fr;
    grid-template-areas: "seg stage" "notes stage";
    gap: 28px 44px; align-items: start;
  }
  .compare-notes { padding-top: 8px; }
}

/* ---------- pricing ---------- */
.plans { display: grid; gap: 16px; }
@media (min-width: 760px) { .plans { grid-template-columns: 1fr 1fr; gap: 20px; } }
.plan {
  position: relative; display: flex; flex-direction: column;
  padding: 28px; border-radius: var(--r-lg);
  background: var(--surface); box-shadow: 0 0 0 1px var(--line);
}
@media (min-width: 900px) { .plan { padding: 36px; } }
.plan h3 { font-size: 26px; }
.plan-for { margin-top: 4px; color: var(--text-2); }
.plan-price { display: flex; align-items: baseline; gap: 8px; margin-top: 28px; font-size: 18px; font-weight: 600; }
.plan-price .num { font-size: 60px; font-weight: 700; line-height: 1; }
.plan-slides { margin-top: 8px; font-size: 15px; color: var(--text-2); }
.plan-list {
  flex: 1; display: grid; align-content: start; gap: 12px;
  list-style: none; margin: 24px 0 28px; padding: 22px 0 0; border-top: 1px solid var(--line);
}
.plan-list li { display: flex; align-items: flex-start; gap: 10px; line-height: 1.65; }
.plan-list .ico { width: 18px; height: 18px; margin-top: .25em; color: var(--accent-text); }
.plan-sig { background: var(--maroon); color: var(--ivory); box-shadow: 0 0 0 1px var(--maroon), var(--shadow-lg); }
.plan-sig .plan-for, .plan-sig .plan-slides { color: var(--on-maroon-2); }
.plan-sig .plan-list { border-color: var(--maroon-line); }
.plan-sig .plan-list .ico { color: #F2A7AD; }
.plan-tag {
  position: absolute; top: 30px; inset-inline-end: 28px;
  padding: 7px 12px; border-radius: var(--pill);
  font-size: 13px; font-weight: 600; line-height: 1.2; background: var(--red); color: #FFFFFF;
}
@media (min-width: 900px) { .plan-tag { top: 38px; inset-inline-end: 36px; } }
.slides-rule {
  margin-top: 20px; padding: 18px 22px; border-radius: var(--r);
  background: var(--bg-alt); font-size: 15px; line-height: 1.85; color: var(--text-2);
}
.slides-rule strong { color: var(--text); }

/* ---------- voice-over add-on ---------- */
.addon {
  display: grid; gap: 18px 20px; align-items: center;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "visual visual" "copy price";
  margin-top: 20px; padding: 22px; border-radius: var(--r-lg);
  background: var(--surface); box-shadow: 0 0 0 1px var(--line);
}
.addon-visual {
  grid-area: visual; display: flex; align-items: center; gap: 16px;
  height: 72px; padding: 0 18px; border-radius: var(--r);
  background: var(--maroon); color: #F2A7AD;
}
.addon-mic {
  display: grid; place-items: center; flex: none; width: 42px; height: 42px; border-radius: 50%;
  background: var(--red); color: #FFFFFF;
}
.addon-mic .ico { width: 21px; height: 21px; }
.wave { flex: 1; display: flex; align-items: center; justify-content: space-between; gap: 4px; height: 40px; }
.wave i { flex: 1; max-width: 5px; height: 100%; border-radius: 3px; background: currentColor; transform: scaleY(var(--h)); }
.addon-copy { grid-area: copy; }
.addon-kicker { font-size: 14px; font-weight: 600; color: var(--accent-text); }
.addon h3 { margin-top: 2px; font-size: 22px; }
.addon-copy p:last-child { margin-top: 6px; color: var(--text-2); }
.addon-price {
  grid-area: price; align-self: end; display: flex; align-items: baseline; gap: 6px;
  font-size: 16px; font-weight: 600; white-space: nowrap;
}
.addon-price .num { font-size: 42px; font-weight: 700; line-height: 1; }
.addon-plus { font-size: 26px; font-weight: 700; line-height: 1; color: var(--accent-text); }
@media (min-width: 760px) {
  .addon {
    grid-template-columns: minmax(200px, .75fr) minmax(0, 1.6fr) auto;
    grid-template-areas: "visual copy price";
    gap: 32px; padding: 28px 32px;
  }
  .addon-visual { height: 104px; }
  .addon-price { align-self: center; }
}
/* the waveform draws itself once when the card scrolls in */
@media (prefers-reduced-motion: no-preference) {
  .js .addon.is-in .wave i { animation: bar 900ms var(--ease-out) backwards; }
  .js .addon.is-in .wave i:nth-child(3n+2) { animation-delay: 70ms; }
  .js .addon.is-in .wave i:nth-child(3n) { animation-delay: 140ms; }
}
@keyframes bar { from { transform: scaleY(.12); } }

/* ---------- pick a topic for me ---------- */
.pick {
  position: relative; isolation: isolate; overflow: hidden;
  display: grid; gap: 28px; padding: 26px; border-radius: var(--r-lg);
  background: var(--surface); box-shadow: 0 0 0 1px var(--line), var(--shadow-md);
}
.pick::before {
  content: ""; position: absolute; z-index: -1; pointer-events: none;
  width: 70%; aspect-ratio: 1; inset-inline-end: -20%; bottom: -45%;
  background: radial-gradient(closest-side, rgb(166 34 46 / .13), transparent);
}
.pick h2 { font-size: clamp(27px, 1.7vw + 20px, 42px); }
.pick-copy p { margin-top: 12px; max-width: 30em; font-size: 18px; color: var(--text-2); }
.pick-copy .btn { margin-top: 26px; }
.pick-steps { display: grid; gap: 10px; list-style: none; margin: 0; padding: 0; }
.pick-steps li {
  display: grid; grid-template-columns: 48px minmax(0, 1fr); align-items: center; gap: 14px;
  padding: 14px 16px; border-radius: var(--r);
  background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line);
}
.pick-ico {
  display: grid; place-items: center; width: 48px; height: 48px; border-radius: var(--r);
  background: var(--maroon); color: var(--ivory); box-shadow: inset 0 0 0 1px var(--brand-line);
}
.pick-ico .ico { width: 24px; height: 24px; }
.pick-steps strong { display: block; font-size: 17px; line-height: 1.5; }
.pick-steps p { font-size: 15px; line-height: 1.6; color: var(--text-2); }
@media (min-width: 900px) {
  .pick { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: center; gap: 56px; padding: 52px; }
}
@media (prefers-reduced-motion: no-preference) {
  .js .pick .pick-steps li { opacity: 0; transform: translateY(12px); transition: opacity 600ms var(--ease-out), transform 600ms var(--ease-out); }
  .js .pick.is-in .pick-steps li { opacity: 1; transform: none; }
  .js .pick.is-in .pick-steps li:nth-child(1) { transition-delay: 160ms; }
  .js .pick.is-in .pick-steps li:nth-child(2) { transition-delay: 240ms; }
  .js .pick.is-in .pick-steps li:nth-child(3) { transition-delay: 320ms; }
}

/* ---------- order ---------- */
.order-grid { display: grid; gap: 40px; }
@media (min-width: 960px) {
  .order-grid { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 72px; align-items: start; }
  .how { position: sticky; top: calc(var(--header-h) + 40px); }
}
.how h2 { font-size: clamp(28px, 1.8vw + 21px, 44px); }
.steps { list-style: none; margin: 32px 0 0; padding: 0; }
.steps li { position: relative; display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 16px; padding-bottom: 26px; }
.steps li:last-child { padding-bottom: 0; }
.steps li:not(:last-child)::before {
  content: ""; position: absolute; top: 44px; bottom: 8px; inset-inline-start: 17px;
  width: 2px; border-radius: 2px; background: var(--line);
}
.step-n {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
  background: var(--step-bg); color: var(--ivory); font-weight: 700; font-size: 15px;
}
.steps strong { display: block; margin-top: 3px; font-size: 18px; line-height: 1.5; }
.steps p { margin-top: 4px; font-size: 15.5px; line-height: 1.8; color: var(--text-2); }

.order-form {
  display: grid; gap: 22px; padding: 22px; border-radius: var(--r-lg);
  background: var(--surface); box-shadow: 0 0 0 1px var(--line), var(--shadow-md);
}
@media (min-width: 700px) { .order-form { padding: 36px; } }
.field { display: grid; gap: 8px; min-width: 0; margin: 0; padding: 0; border: 0; }
.field label, .field legend, .field-label { padding: 0; font-weight: 600; font-size: 15px; }
@media (prefers-reduced-motion: no-preference) { .appear { animation: fade-up 300ms var(--ease-out); } }
.field-row { display: grid; gap: 22px; }
@media (min-width: 560px) { .field-row { grid-template-columns: 1fr 1fr; } }
input[type="text"], input[type="email"], input[type="number"], input[type="date"], textarea {
  width: 100%; min-width: 0; min-height: 52px; padding: 12px 15px;
  border-radius: var(--r); border: 1.5px solid var(--line); background: var(--surface-2);
  font-size: 16px; /* 16px keeps iOS from zooming */ line-height: 1.5; color: var(--text);
  -webkit-appearance: none; appearance: none;
  transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}
textarea { min-height: 180px; resize: vertical; line-height: 1.8; }
input:focus, textarea:focus { outline: none; border-color: var(--text); background: var(--surface); box-shadow: var(--ring); }
input::placeholder, textarea::placeholder { color: var(--text-3); opacity: 1; }
[aria-invalid="true"] { border-color: var(--danger) !important; background: var(--danger-bg) !important; }
.hint { font-size: 14px; line-height: 1.7; color: var(--text-3); }
.err { font-size: 14px; font-weight: 600; line-height: 1.6; color: var(--danger); }
.err:empty { display: none; }
@media (prefers-reduced-motion: no-preference) { .err:not(:empty) { animation: fade-up 220ms var(--ease-out); } }

/* date: Chrome draws its empty Arabic placeholder with broken letters, so we show our own */
.date-wrap { position: relative; }
input[type="date"] { display: block; text-align: start; }
input[type="date"]::-webkit-date-and-time-value { text-align: start; }
input[type="date"]::-webkit-calendar-picker-indicator { opacity: .65; cursor: pointer; }
.date-wrap.is-empty input:not(:focus)::-webkit-datetime-edit { color: transparent; }
.date-ph {
  position: absolute; top: 50%; inset-inline-start: 16.5px; transform: translateY(-50%);
  font-size: 16px; color: var(--text-3); pointer-events: none;
}
.date-wrap:not(.is-empty) .date-ph, .date-wrap:focus-within .date-ph { display: none; }

.pkg-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pkg { position: relative; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.pkg input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.pkg-box {
  position: relative; display: grid; align-content: center; gap: 2px; min-height: 76px; padding: 14px 16px;
  border-radius: var(--r); border: 1.5px solid var(--line); background: var(--surface-2);
  transition: background-color 200ms ease, border-color 200ms ease, color 200ms ease, transform 160ms var(--ease-out);
}
.pkg:active .pkg-box { transform: scale(.98); }
.pkg-name { font-weight: 700; font-size: 17px; }
.pkg-price { font-size: 14px; color: var(--text-2); }
.pkg-check {
  position: absolute; top: 14px; inset-inline-end: 14px; width: 18px; height: 18px;
  opacity: 0; transform: scale(.6); transition: opacity 200ms ease, transform 260ms var(--ease-out);
}
.pkg input:checked + .pkg-box { background: var(--maroon); border-color: var(--brand-line); color: var(--ivory); }
.pkg input:checked + .pkg-box .pkg-price { color: var(--on-maroon-2); }
.pkg input:checked + .pkg-box .pkg-check { opacity: 1; transform: none; }
.pkg input:focus-visible + .pkg-box { outline: 3px solid var(--focus); outline-offset: 2px; }

.stepper { display: grid; grid-template-columns: 52px minmax(0, 1fr) 52px; gap: 6px; }
.stepper input { text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; -moz-appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper-btn {
  display: grid; place-items: center; min-height: 52px; border-radius: var(--r);
  border: 1.5px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer;
  -webkit-tap-highlight-color: transparent; transition: transform 160ms var(--ease-out), border-color 160ms ease;
}
.stepper-btn .ico { width: 20px; height: 20px; }
.stepper-btn:active { transform: scale(.94); }
.stepper-btn:disabled { opacity: .38; cursor: default; transform: none; }
@media (hover: hover) and (pointer: fine) { .stepper-btn:not(:disabled):hover { border-color: var(--text); } }

/* voice-over switch: the whole card is the hit area */
.toggle { position: relative; display: block; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.toggle input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.toggle-box {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 14px;
  padding: 14px 16px; border-radius: var(--r); border: 1.5px solid var(--line); background: var(--surface-2);
  transition: border-color 200ms ease, background-color 200ms ease, transform 160ms var(--ease-out);
}
.toggle:active .toggle-box { transform: scale(.99); }
.toggle-ico {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  background: var(--surface-3); color: var(--accent-text);
  transition: background-color 200ms ease, color 200ms ease;
}
.toggle-ico .ico { width: 20px; height: 20px; }
.toggle-text { display: grid; line-height: 1.5; }
.toggle-text strong { font-size: 16px; }
.toggle-text span { font-size: 14px; color: var(--text-2); }
.toggle-price { font-size: 15px; font-weight: 700; white-space: nowrap; }
.switch {
  position: relative; width: 46px; height: 28px; border-radius: var(--pill);
  background: var(--line-strong); transition: background-color 200ms ease;
}
.switch::after {
  content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 22px; height: 22px; border-radius: 50%;
  background: #FFFFFF; box-shadow: 0 1px 3px rgb(0 0 0 / .25);
  transition: transform 260ms var(--ease-out);
}
.toggle input:checked + .toggle-box { border-color: var(--brand-line); background: var(--surface); }
.toggle input:checked + .toggle-box .toggle-ico { background: var(--switch-on); color: #FFFFFF; }
.toggle input:checked + .toggle-box .switch { background: var(--switch-on); }
.toggle input:checked + .toggle-box .switch::after { transform: translateX(-18px); } /* RTL: on = knob at the left */
.toggle input:focus-visible + .toggle-box { outline: 3px solid var(--focus); outline-offset: 2px; }
@media (max-width: 420px) {
  .toggle-ico { display: none; }
  .toggle-box { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "text switch" "price switch"; gap: 4px 14px; }
  .toggle-text { grid-area: text; }
  .toggle-price { grid-area: price; justify-self: start; color: var(--accent-text); }
  .switch { grid-area: switch; }
}

.summary { display: grid; gap: 8px; padding: 16px 18px; border-radius: var(--r); background: var(--bg-alt); font-size: 15px; }
.summary-row { display: flex; justify-content: space-between; gap: 12px; }
.summary-row span { color: var(--text-2); }
.summary-row strong { display: inline-block; }
.summary-total { margin-top: 4px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 17px; }
.summary-total span { font-weight: 600; color: var(--text); }
.summary-note { font-size: 14px; font-weight: 600; line-height: 1.7; color: var(--accent-text); }
.bump { animation: bump 280ms var(--ease-out); }
@keyframes bump { from { opacity: .3; transform: translateY(4px); } }
.form-foot { margin-top: -8px; text-align: center; font-size: 14px; line-height: 1.75; color: var(--text-2); }
.form-foot strong { color: var(--text); }

.result {
  display: grid; gap: 12px; padding: 20px; border-radius: var(--r);
  border: 1.5px solid var(--brand-line); background: var(--surface);
}
@media (prefers-reduced-motion: no-preference) { .result:not([hidden]) { animation: rise 420ms var(--ease-out); } }
.result:focus { outline: none; }
.result h3 { font-size: 19px; }
.result p { font-size: 15px; line-height: 1.85; color: var(--text-2); }
.result-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.result-actions .btn { flex: 1 1 200px; }
.result-preview summary { cursor: pointer; font-size: 14px; color: var(--text-2); }
.result-preview pre {
  margin: 10px 0 0; padding: 14px; border-radius: var(--r);
  background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line);
  white-space: pre-wrap; word-break: break-word; font-family: var(--font); font-size: 14px; line-height: 1.75;
}

/* ---------- rescue ---------- */
.rescue {
  display: grid; gap: 32px; align-items: center;
  padding: 28px; border-radius: var(--r-lg); overflow: hidden;
  background: var(--maroon); color: var(--ivory);
}
.rescue h2 { font-size: clamp(26px, 1.4vw + 20px, 38px); }
.rescue p { margin-top: 10px; max-width: 34em; color: var(--on-maroon-2); }
.rescue .btn { margin-top: 24px; }
.rescue-visual { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 10px; margin: 0; }
.rv { display: grid; gap: 8px; justify-items: center; font-size: 14px; font-weight: 600; color: var(--on-maroon-2); }
.rv img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 8px; background: var(--maroon-deep); box-shadow: 0 0 0 1px rgb(248 243 239 / .12), 0 16px 32px -18px rgb(0 0 0 / .6); }
.rv-arrow { width: 22px; height: 22px; margin-bottom: 30px; color: var(--on-maroon-2); }
.rescue-visual figcaption { grid-column: 1 / -1; font-size: 13px; color: var(--on-maroon-2); opacity: .8; }
@media (min-width: 860px) {
  .rescue { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 48px; padding: 48px; }
}

/* ---------- faq ---------- */
.faq-grid { display: grid; gap: 0; }
@media (min-width: 900px) {
  .faq-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.9fr); gap: 64px; align-items: start; }
  .faq-head { position: sticky; top: calc(var(--header-h) + 40px); }
}
.faq { display: grid; gap: 10px; }
.faq details { border-radius: var(--r); background: var(--surface); box-shadow: 0 0 0 1px var(--line); }
.faq summary {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px 20px; border-radius: var(--r);
  list-style: none; cursor: pointer; font-weight: 600; font-size: 17px; line-height: 1.6;
  -webkit-tap-highlight-color: transparent;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary .ico { width: 20px; height: 20px; color: var(--text-3); transition: transform 300ms var(--ease-out); }
.faq details[open] summary .ico { transform: rotate(180deg); }
.faq-a { padding: 0 20px 20px; }
.faq-a p { max-width: 46em; line-height: 1.9; color: var(--text-2); }
@media (prefers-reduced-motion: no-preference) {
  .faq details[open] .faq-a { animation: fade-up 300ms var(--ease-out); }
}

/* ---------- footer ---------- */
.site-footer {
  padding: 36px 0 calc(36px + env(safe-area-inset-bottom));
  background: var(--maroon-deep); color: var(--on-maroon-2); font-size: 14px;
}
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; }
.footer-inner .brand { margin-inline-end: auto; }
.brand-footer { color: var(--ivory); }
.footer-nav { display: flex; flex-wrap: wrap; gap: 6px 22px; font-size: 15px; }
.footer-nav a { color: var(--ivory); text-decoration: none; opacity: .82; transition: opacity 200ms ease; }
@media (hover: hover) and (pointer: fine) { .footer-nav a:hover { opacity: 1; } }
.footer-meta { flex-basis: 100%; padding-top: 18px; margin-top: 6px; border-top: 1px solid rgb(248 243 239 / .1); }

/* ---------- slide viewer ---------- */
body.no-scroll { overflow: hidden; }
.viewer {
  position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0; overflow: hidden;
  display: none; flex-direction: column;
  background: rgb(14 8 8); color: var(--ivory);
}
.viewer[open] { display: flex; }
.viewer::backdrop { background: transparent; }
/* phones: title + close on the first row, the tier switch under them; wider: one row */
.viewer-top {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px;
  grid-template-areas: "head close" "seg seg";
  padding: calc(12px + env(safe-area-inset-top)) 16px 12px;
}
.viewer-head { grid-area: head; min-width: 0; }
.viewer-tools { display: contents; }
.viewer-tools .seg { grid-area: seg; display: grid; width: 100%; }
#viewer-close { grid-area: close; }
@media (min-width: 640px) {
  .viewer-top { grid-template-columns: minmax(0, 1fr) auto auto; grid-template-areas: "head seg close"; }
  .viewer-tools .seg { width: auto; }
}
.viewer-title { font-weight: 600; font-size: 16px; line-height: 1.4; }
.viewer-sub { font-size: 13px; color: #A8928B; }
.viewer-tools .seg button { min-height: 36px; padding: 0 14px; font-size: 14px; }
.icon-btn {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid rgb(255 255 255 / .16); background: rgb(255 255 255 / .06); color: var(--ivory);
  cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: background-color 200ms ease, transform 160ms var(--ease-out), opacity 200ms ease;
}
.icon-btn .ico { width: 20px; height: 20px; }
.icon-btn:active { transform: scale(.92); }
.icon-btn:disabled { opacity: .28; cursor: default; transform: none; }
@media (hover: hover) and (pointer: fine) { .icon-btn:not(:disabled):hover { background: rgb(255 255 255 / .14); } }

.viewer-stage {
  position: relative; flex: 1; min-height: 0; overflow: hidden;
  touch-action: pan-y; touch-action: pan-y pinch-zoom; cursor: grab;
}
.viewer-stage.is-dragging { cursor: grabbing; }
.viewer.is-flipping .viewer-stage { z-index: 1; overflow: visible; }
.viewer-track { display: flex; height: 100%; will-change: transform; }
.viewer-slide {
  flex: 0 0 100%; min-width: 0; height: 100%;
  display: grid; place-items: center; padding: 8px 12px;
  container-type: size;
}
.viewer-slide img {
  width: min(100cqw, 100cqh * 16 / 9); height: auto; aspect-ratio: 16 / 9;
  border-radius: 10px; background: #241A19;
  user-select: none; -webkit-user-select: none; -webkit-user-drag: none; -webkit-touch-callout: none;
}
.viewer-bottom { display: flex; align-items: center; justify-content: center; gap: 24px; padding: 8px 16px; }
.viewer-count { min-width: 64px; text-align: center; direction: ltr; font-size: 14px; color: #CDBCB6; }
.viewer-thumbs {
  display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none;
  padding: 8px 16px calc(14px + env(safe-area-inset-bottom));
}
.viewer-thumbs::-webkit-scrollbar { display: none; }
.viewer-thumbs::before, .viewer-thumbs::after { content: ""; margin: auto; }
.viewer-thumbs button {
  flex: none; width: 96px; aspect-ratio: 16 / 9; padding: 0; overflow: hidden; cursor: pointer;
  border-radius: var(--r-xs); border: 2px solid transparent; background: #2A1F1D;
  opacity: .5; transition: opacity 200ms ease, border-color 200ms ease, transform 160ms var(--ease-out);
  -webkit-tap-highlight-color: transparent;
}
.viewer-thumbs button:active { transform: scale(.95); }
.viewer-thumbs button[aria-current="true"] { border-color: var(--ivory); opacity: 1; }
.viewer-thumbs img { width: 100%; height: 100%; object-fit: cover; }
@media (min-width: 900px) {
  .viewer-top { padding: 18px 28px; }
  .viewer-slide { padding: 8px 96px; }
  .viewer-thumbs button { width: 120px; }
}
@media (max-height: 520px) { .viewer-thumbs { display: none; } }
