/* ==========================================================================
   SHADI LAUNDRY · one wash cycle
   Tokens, type, layout primitives, header, buttons, cursor, loader, HUD, hero
   ========================================================================== */
:root {
  /* ground: the page colour follows the cycle (set by app.js) */
  --ground: #EEF3F9;
  --card: #FFFFFF;
  --ink: #121735;
  --ink-2: #4A5072;
  --ink-3: #737996;
  --navy: #24308A;
  --navy-d: #141C55;
  --night: #0F1647;
  --red: #D0202F;          /* the one accent: act here */
  --red-d: #A8141F;
  --red-on-dark: #FF5A67;
  --water: #3A9AD9;
  --wa: #1A8347;
  --chrome: #C8CDD8;
  --line: rgba(18, 23, 53, .14);
  --line-2: rgba(18, 23, 53, .08);

  --display: 'Unbounded', 'Alexandria', system-ui, sans-serif;
  --body: 'Onest', 'Alexandria', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Martian Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;

  /* motion: water flows, pressed things snap */
  --flow: cubic-bezier(.65, 0, .35, 1);
  --set: cubic-bezier(.19, 1, .22, 1);
  --snap: cubic-bezier(.3, 0, 0, 1);

  --r-stage: 28px;
  --r-card: 22px;
  --pad: clamp(16px, 4vw, 56px);
}
:lang(ar) {
  --display: 'Alexandria', 'Unbounded', system-ui, sans-serif;
  --body: 'IBM Plex Sans Arabic', 'Alexandria', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html.js:not(.lenis) { scroll-behavior: smooth; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-stopped { overflow: hidden; }
body {
  margin: 0; background: var(--ground); color: var(--ink);
  font: 400 1.0625rem/1.6 var(--body); overflow-x: clip;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
:lang(ar) body { line-height: 1.85; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; }
h1, h2, h3, p, dl, dd, figure { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
::selection { background: var(--red); color: #fff; }
:focus-visible { outline: 3px solid var(--water); outline-offset: 3px; border-radius: 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: fixed; top: 10px; inset-inline-start: -999px; z-index: 200; background: var(--navy); color: #fff; padding: 10px 16px; border-radius: 10px; }
.skip:focus { inset-inline-start: 10px; }
.wrap { width: min(1280px, 100% - 2 * var(--pad)); margin-inline: auto; }
.ic { width: 1.15em; height: 1.15em; flex: none; }
[dir=rtl] .ic--dir { transform: scaleX(-1); }

/* ---------- type ---------- */
.h1, .h2, .panel__name, .foot__big { font-family: var(--display); color: var(--ink); }
.h1 { font-weight: 700; font-size: clamp(2.3rem, 4.6vw, 4.6rem); line-height: 1.02; letter-spacing: -.04em; }
.h2 { font-weight: 600; font-size: clamp(1.85rem, 3.5vw, 3.3rem); line-height: 1.06; letter-spacing: -.035em; }
.ln { display: block; }
.ln--accent { color: var(--red); }
:lang(ar) .h1, :lang(ar) .h2, :lang(ar) .panel__name, :lang(ar) .foot__big { letter-spacing: 0; line-height: 1.3; }
:lang(ar) .h1 { font-weight: 800; }
:lang(ar) .h2 { font-weight: 700; }
.sub { color: var(--ink-2); font-size: 1.125rem; max-width: 36em; margin-top: 22px; }
.label {
  display: flex; align-items: center; gap: 12px; margin-bottom: 22px;
  font: 500 .7rem/1 var(--mono); letter-spacing: .2em; text-transform: uppercase; color: var(--ink);
}
.label__n { color: var(--red); }
.label__rule { width: 40px; height: 1px; background: currentColor; opacity: .5; }
.label__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--red); }
:lang(ar) .label { font: 600 .92rem/1 var(--body); letter-spacing: 0; }
.hint { font: 500 .66rem/1.4 var(--mono); letter-spacing: .18em; text-transform: uppercase; color: var(--ink-3); }
:lang(ar) .hint { font: 500 .85rem/1.4 var(--body); letter-spacing: 0; }
.head { max-width: 780px; margin-bottom: clamp(40px, 6vw, 72px); }

/* ---------- buttons & links ---------- */
.btn {
  --h: 54px;
  display: inline-flex; align-items: center; gap: 14px; height: var(--h);
  padding-inline: 24px 6px; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--red); color: #fff; text-decoration: none; white-space: nowrap;
  font: 600 .74rem/1 var(--mono); letter-spacing: .14em; text-transform: uppercase;
  box-shadow: 0 14px 30px -14px rgba(208, 32, 47, .8);
  transition: background .2s var(--snap), transform .2s var(--snap), box-shadow .2s var(--snap);
}
:lang(ar) .btn { font: 700 .98rem/1 var(--body); letter-spacing: 0; }
.btn:hover { background: var(--red-d); transform: translateY(-2px); }
.btn__dot { width: calc(var(--h) - 12px); height: calc(var(--h) - 12px); border-radius: 50%; background: var(--night); display: grid; place-items: center; transition: transform .35s var(--set); }
.btn:hover .btn__dot { transform: translateX(3px) rotate(-45deg); }
[dir=rtl] .btn:hover .btn__dot { transform: translateX(-3px) rotate(45deg); }
.btn--sm { --h: 44px; padding-inline: 18px 5px; }
.btn--sm .btn__dot { width: 34px; height: 34px; }
.btn--ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--line); box-shadow: none; padding-inline: 18px; }
.btn--ghost:hover { background: var(--card); border-color: var(--ink); }
.btn--wide { width: 100%; justify-content: space-between; }
.link {
  display: inline-flex; align-items: center; gap: 8px; background: none; border: 0; cursor: pointer; padding: 6px 0;
  font-weight: 600; text-decoration: none; color: var(--ink);
  background-image: linear-gradient(currentColor, currentColor); background-size: 0 1.5px; background-repeat: no-repeat; background-position: 0 100%;
  transition: background-size .35s var(--set);
}
[dir=rtl] .link { background-position: 100% 100%; }
.link:hover { background-size: 100% 1.5px; }
.link--wa { color: var(--wa); }

/* ---------- header ---------- */
.top { position: fixed; inset: 0 0 auto; z-index: 60; transition: color .3s, background .3s, box-shadow .3s; }
.top__in { display: flex; align-items: center; gap: 28px; height: 78px; }
.top.is-scrolled { background: color-mix(in srgb, var(--ground) 82%, transparent); backdrop-filter: blur(14px) saturate(1.3); -webkit-backdrop-filter: blur(14px) saturate(1.3); box-shadow: 0 1px 0 var(--line-2); }
.top.on-dark { color: #EEF1FF; background: rgba(15, 22, 71, .72); box-shadow: 0 1px 0 rgba(255, 255, 255, .08); }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; margin-inline-end: auto; }
.brand img { width: 46px; filter: drop-shadow(0 4px 8px rgba(18, 23, 53, .18)); transition: transform .5s var(--set); }
.brand:hover img { transform: rotate(-8deg) scale(1.05); }
.brand__name { display: flex; flex-direction: column; line-height: 1.1; }
.brand__name b { font: 700 1rem/1.1 var(--display); letter-spacing: -.02em; }
.brand__name small { font: 600 .82rem/1.2 'Alexandria', var(--body); color: var(--red); }
:lang(ar) .brand__name small { font: 600 .72rem/1.2 'Unbounded', sans-serif; letter-spacing: 0; }
.on-dark .brand__name small { color: var(--red-on-dark); }
.nav { display: flex; align-items: center; gap: 26px; }
.nav > a { font: 500 .68rem/1 var(--mono); letter-spacing: .18em; text-transform: uppercase; text-decoration: none; padding: 8px 0; position: relative; }
:lang(ar) .nav > a { font: 600 .95rem/1 var(--body); letter-spacing: 0; }
.nav > a::after { content: ""; position: absolute; inset: auto 0 2px; height: 1.5px; background: var(--red); transform: scaleX(0); transform-origin: var(--o, left); transition: transform .35s var(--set); }
[dir=rtl] .nav > a::after { --o: right; }
.nav > a:hover::after { transform: none; }
.langs { display: flex; gap: 2px; padding: 3px; border-radius: 999px; border: 1px solid var(--line); }
.on-dark .langs { border-color: rgba(255, 255, 255, .2); }
.langs a { padding: 5px 10px; border-radius: 999px; text-decoration: none; font-size: .78rem; font-weight: 600; opacity: .7; }
.langs a[aria-current] { background: var(--ink); color: var(--ground); opacity: 1; }
.on-dark .langs a[aria-current] { background: #fff; color: var(--night); }
.burger { display: none; width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); cursor: pointer; position: relative; }
.burger i { position: absolute; left: 14px; right: 14px; height: 1.6px; background: var(--ink); transition: transform .35s var(--set); }
.burger i:nth-of-type(1) { top: 18px; } .burger i:nth-of-type(2) { top: 26px; }
.burger[aria-expanded=true] i:nth-of-type(1) { transform: translateY(4px) rotate(45deg); }
.burger[aria-expanded=true] i:nth-of-type(2) { transform: translateY(-4px) rotate(-45deg); }

/* ---------- cursor (fine pointers only) ---------- */
.cursor { display: none; }
@media (hover: hover) and (pointer: fine) {
  .js .cursor { display: block; position: fixed; inset: 0 auto auto 0; z-index: 300; pointer-events: none; }
  .cursor__dot { position: absolute; width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%; background: var(--red); }
  .cursor__ring {
    position: absolute; width: 36px; height: 36px; margin: -18px 0 0 -18px; border-radius: 50%;
    border: 1.5px solid rgba(36, 48, 138, .45);
    background: radial-gradient(circle at 32% 28%, rgba(255, 255, 255, .85), rgba(255, 255, 255, 0) 30%), radial-gradient(circle, rgba(58, 154, 217, .06), rgba(58, 154, 217, .14));
    display: grid; place-items: center; transition: width .35s var(--set), height .35s var(--set), margin .35s var(--set), background .35s, border-color .35s;
  }
  .cursor__label { font: 600 .58rem/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: #fff; opacity: 0; transition: opacity .2s; white-space: nowrap; }
  .cursor.is-active .cursor__ring { width: 84px; height: 84px; margin: -42px 0 0 -42px; background: var(--red); border-color: var(--red); }
  .cursor.is-active .cursor__label { opacity: 1; }
  .cursor.is-active .cursor__dot { opacity: 0; }
  .cursor.is-hidden { opacity: 0; }
}

/* ---------- loader: the door closes, the drum fills ---------- */
.loader { display: none; }
.js .loader { position: fixed; inset: 0; z-index: 250; display: grid; place-items: center; background: var(--ground); }
.loader__door {
  width: 150px; height: 150px; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 50% 60%, #fff, #E5ECF5);
  box-shadow: 0 0 0 10px #E3E7EE, 0 0 0 12px var(--chrome), 0 30px 60px -20px rgba(18, 23, 53, .4);
}
.loader__door img { width: 86px; }

/* ---------- HUD: the machine display ---------- */
.hud {
  position: fixed; inset-inline-start: 20px; bottom: 20px; z-index: 50;
  display: flex; align-items: center; gap: 12px; padding: 8px 18px 8px 8px; border-radius: 999px;
  background: color-mix(in srgb, var(--card) 84%, transparent); border: 1px solid var(--line-2);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 14px 30px -18px rgba(18, 23, 53, .5);
  transition: transform .5s var(--set), opacity .5s, background .3s, color .3s;
}
[dir=rtl] .hud { padding: 8px 8px 8px 18px; }
.hud.is-dark { background: rgba(15, 22, 71, .8); color: #EEF1FF; border-color: rgba(255, 255, 255, .12); }
.hud.is-away { transform: translateY(14px); opacity: .0; }
.hud__dial { width: 44px; height: 44px; }
.hud__ring { fill: none; stroke: currentColor; stroke-opacity: .22; stroke-width: 1.5; }
.hud__tick { fill: currentColor; opacity: .3; }
.hud__tick.is-on { fill: var(--red); opacity: 1; }
.hud__needle { stroke: var(--red); stroke-width: 2.2; stroke-linecap: round; transform-origin: 22px 22px; transition: transform .8s var(--set); }
.hud__txt { display: flex; flex-direction: column; gap: 4px; }
.hud__txt b { font: 600 .66rem/1 var(--mono); letter-spacing: .2em; text-transform: uppercase; }
.hud__txt > span { font: 400 .62rem/1 var(--mono); letter-spacing: .08em; opacity: .7; }
:lang(ar) .hud__txt b { font: 700 .85rem/1 var(--body); letter-spacing: 0; }
:lang(ar) .hud__txt > span { font: 500 .75rem/1 var(--body); letter-spacing: 0; }
.hud__txt em { font-style: normal; }
.hud__txt em.is-open { color: var(--wa); opacity: 1; }
.hud.is-dark .hud__txt em.is-open { color: #5BD891; }

/* ---------- status chip ---------- */
.status { display: inline-flex; align-items: center; gap: 10px; margin-top: 26px; padding: 9px 16px; border-radius: 999px; background: color-mix(in srgb, var(--card) 70%, transparent); border: 1px solid var(--line-2); font: 500 .72rem/1 var(--mono); letter-spacing: .08em; }
:lang(ar) .status { font: 500 .92rem/1 var(--body); letter-spacing: 0; }
.status b { font-weight: 600; }
.status span { color: var(--ink-3); }
.status__dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ink-3); }
.status.is-open .status__dot { background: #22A35A; box-shadow: 0 0 0 0 rgba(34, 163, 90, .5); animation: ping 2s infinite; }
.status.is-open b { color: var(--wa); }
.status.is-closed .status__dot { background: var(--red); }
.status.is-closed b { color: var(--red-d); }
.status--lg { font-size: .8rem; padding: 12px 20px; }
@keyframes ping { 70% { box-shadow: 0 0 0 10px rgba(34, 163, 90, 0); } 100% { box-shadow: 0 0 0 0 rgba(34, 163, 90, 0); } }

/* ---------- hero ---------- */
.hero { position: relative; min-height: 100svh; display: grid; align-items: center; padding: 120px 0 110px; }
.hero__in { display: grid; grid-template-columns: 1.02fr .98fr; gap: clamp(32px, 5vw, 80px); align-items: center; }
.hero__sub { margin-top: 28px; max-width: 33em; color: var(--ink-2); font-size: 1.12rem; }
.hero__cta { display: flex; flex-wrap: wrap; align-items: center; gap: 18px 28px; margin-top: 30px; }
.hero__drum { display: grid; justify-items: center; gap: 18px; }
.drum { position: relative; width: min(100%, 600px); aspect-ratio: 1; touch-action: pan-y; }
.drum__cv { position: absolute; inset: 0; width: 100%; height: 100%; }
.drum__fallback { display: none; }
.no-js .drum__fallback { display: block; width: 86%; margin: 7%; aspect-ratio: 1; object-fit: cover; object-position: 50% 22%; border-radius: 50%; border: 18px solid #E3E7EE; }
.hint--touch { display: none; }
@media (hover: none) { .hint--fine { display: none; } .hint--touch { display: block; } }
.scrollcue { position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%); display: grid; justify-items: center; gap: 10px; font: 500 .62rem/1 var(--mono); letter-spacing: .2em; text-transform: uppercase; color: var(--ink-3); }
:lang(ar) .scrollcue { font: 500 .82rem/1 var(--body); letter-spacing: 0; }
.scrollcue i { width: 1px; height: 40px; background: linear-gradient(var(--ink-3) 50%, transparent 50%) 0 0/1px 200%; animation: cue 1.8s var(--flow) infinite; }
@keyframes cue { from { background-position: 0 -40px; } to { background-position: 0 40px; } }

/* ---------- marquee ---------- */
.marquee { overflow: hidden; border-block: 1px solid var(--line); padding: 22px 0; direction: ltr; }
.marquee__track { display: flex; width: max-content; animation: marquee 60s linear infinite; }
.marquee span { display: flex; align-items: center; gap: 22px; padding-inline-end: 22px; }
.marquee b { font: 500 clamp(1.2rem, 2.2vw, 1.9rem)/1 var(--display); letter-spacing: -.02em; white-space: nowrap; }
.marquee b:nth-child(4n+3) { font-family: 'Alexandria', var(--display); font-weight: 600; letter-spacing: 0; }
.marquee i { font-style: normal; color: var(--ink-3); }
.marquee .sep { color: var(--red); font-size: 1.2rem; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- reveal states (JS adds motion; without JS everything is visible) ---------- */
.js .fade { opacity: 0; transform: translateY(18px); }
.js .fade.is-in { opacity: 1; transform: none; transition: opacity 1.1s var(--set), transform 1.1s var(--set); }

/* ---------- mobile dock ---------- */
.dock { display: none; }

@media (max-width: 1080px) {
  .nav { position: fixed; inset: 78px 12px auto; flex-direction: column; align-items: stretch; gap: 0; padding: 10px 22px 22px; border-radius: 24px; background: var(--card); color: var(--ink); box-shadow: 0 30px 60px -30px rgba(18, 23, 53, .5); opacity: 0; visibility: hidden; transform: translateY(-10px); transition: opacity .25s, transform .35s var(--set), visibility .25s; }
  .nav.is-open { opacity: 1; visibility: visible; transform: none; }
  .nav > a { padding: 18px 0; border-bottom: 1px solid var(--line-2); font-size: .78rem; }
  :lang(ar) .nav > a { font-size: 1.05rem; }
  .nav > a::after { display: none; }
  .nav .langs { margin-top: 16px; align-self: flex-start; border-color: var(--line); }
  .nav .langs a[aria-current] { background: var(--ink); color: #fff; }
  .burger { display: block; }
  .on-dark .burger { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .2); }
  .on-dark .burger i { background: #fff; }
  .hero__in { grid-template-columns: 1fr; }
  .hero { padding-top: 110px; }
  .drum { width: min(100%, 520px); }
  .scrollcue { display: none; }
}
@media (max-width: 760px) {
  body { font-size: 1rem; padding-bottom: 78px; }
  .top__cta { display: none; }
  .top__in { height: 68px; }
  .nav { inset: 68px 10px auto; }
  .hud { display: none; }
  .hero { min-height: 0; padding: 96px 0 56px; }
  .hero__cta .btn { width: 100%; justify-content: space-between; }
  .dock {
    display: grid; grid-template-columns: 1fr 1.5fr; gap: 8px; position: fixed; inset: auto 0 0; z-index: 70;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--card) 88%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid var(--line-2);
  }
  .dock a { display: flex; align-items: center; justify-content: center; gap: 8px; height: 50px; border-radius: 999px; text-decoration: none; font-weight: 700; border: 1.5px solid var(--line); background: var(--card); }
  .dock .dock__wa { background: var(--wa); border-color: var(--wa); color: #fff; }
}

@media (prefers-reduced-motion: reduce) {
  html.js { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .js .fade { opacity: 1; transform: none; }
  .marquee__track { animation: none; }
}

/* ---------- hero: the machine front ---------- */
.machine {
  width: min(100%, 540px); padding: 16px 20px 26px; border-radius: 34px;
  background: linear-gradient(180deg, #FCFDFE 0%, #F1F3F7 55%, #E8EBF0 100%);
  box-shadow: inset 0 1px 0 #fff, inset 0 -2px 0 rgba(18, 23, 53, .05), 0 0 0 1px rgba(18, 23, 53, .06), 0 60px 90px -50px rgba(18, 23, 53, .55), 0 20px 30px -24px rgba(18, 23, 53, .25);
}
.machine__panel {
  display: flex; align-items: center; gap: 14px; height: 54px; padding: 0 12px 0 14px; margin-bottom: 14px; border-radius: 16px;
  background: linear-gradient(180deg, #EEF1F5, #E3E7ED); box-shadow: inset 0 1px 2px rgba(18, 23, 53, .1), 0 1px 0 #fff;
}
.machine__brand { display: flex; align-items: center; gap: 8px; font: 600 .6rem/1 var(--mono); letter-spacing: .28em; color: #6A7088; }
.machine__brand img { width: 22px; filter: grayscale(.2) drop-shadow(0 1px 1px rgba(18, 23, 53, .2)); }
.machine__btns { display: flex; gap: 8px; margin-inline-start: auto; }
.machine__btns i { width: 12px; height: 12px; border-radius: 50%; background: linear-gradient(180deg, #FDFDFE, #D9DEE6); box-shadow: 0 1px 2px rgba(18, 23, 53, .3), inset 0 -1px 1px rgba(18, 23, 53, .1); }
.machine__lcd {
  display: flex; align-items: baseline; gap: 8px; padding: 7px 12px; border-radius: 8px; min-width: 112px; justify-content: center;
  background: linear-gradient(180deg, #0B1220, #121B30); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06), inset 0 4px 10px rgba(0, 0, 0, .5);
  color: #8FD8FF; text-shadow: 0 0 8px rgba(110, 200, 255, .55);
}
.machine__lcd b { font: 500 1rem/1 var(--mono); letter-spacing: .06em; }
.machine__lcd small { font: 500 .5rem/1 var(--mono); letter-spacing: .2em; text-transform: uppercase; opacity: .8; }
:lang(ar) .machine__lcd small { font: 600 .7rem/1 var(--body); letter-spacing: 0; }
.machine__lcd.is-closed { color: #FFB86B; text-shadow: 0 0 8px rgba(255, 170, 80, .5); }
.machine__knob { position: relative; width: 36px; height: 36px; border-radius: 50%; background: radial-gradient(circle at 38% 32%, #FFFFFF, #E3E7EE 55%, #BFC6D2); box-shadow: 0 3px 6px rgba(18, 23, 53, .25), inset 0 -2px 3px rgba(18, 23, 53, .12), 0 0 0 3px #E9ECF1; }
.machine__knob::after { content: ""; position: absolute; left: 50%; top: 5px; width: 2px; height: 9px; margin-left: -1px; border-radius: 2px; background: #6A7088; transform-origin: 1px 13px; transform: rotate(-40deg); }
.machine .drum { width: 100%; }
@media (max-width: 760px) { .machine { padding: 12px 14px 18px; border-radius: 26px; } .machine__panel { height: 46px; } .machine__brand { letter-spacing: .18em; } }
