/* Base for versions that set "base": true in version.json. The build puts it before the version's site.css.
   A version sets the variables below and styles its own home page; product pages, the order form, questions and
   legal pages come from here. Logical properties (inline/block) so Arabic mirrors without extra rules. */

:root {
  --bg: #fff;
  --surface: #f4f2ef;    /* behind photos */
  --ink: #161616;
  --muted: #5e5a56;
  --line: rgba(0, 0, 0, 0.12);
  --accent: #161616;     /* primary buttons */
  --accent-ink: #fff;
  --accent-hover: #333;
  --display: Georgia, serif;
  --body: system-ui, sans-serif;
  --display-weight: 500;
  --display-case: none;
  --display-track: 0;
  --radius: 0px;         /* photos, cards */
  --btn-radius: 999px;
  --gutter: clamp(16px, 5vw, 64px);
  --max: 1360px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
section[id] { scroll-margin-top: 80px; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 1.0625rem/1.6 var(--body); -webkit-font-smoothing: antialiased; }
:lang(ar) body, body:lang(ar) { line-height: 1.8; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
p { margin: 0 0 1em; }
h1, h2, h3 { font-family: var(--display); font-weight: var(--display-weight); text-transform: var(--display-case); letter-spacing: var(--display-track); line-height: 1.05; margin: 0 0 0.4em; }
:lang(ar) :is(h1, h2, h3) { text-transform: none; letter-spacing: 0; line-height: 1.35; }
h2 { font-size: clamp(1.9rem, 3.6vw, 3rem); }
h3 { font-size: 1.2rem; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.icon { width: 20px; height: 20px; fill: currentColor; flex: none; }
.wrap { max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.muted { color: var(--muted); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 0 28px;
  border: 0; border-radius: var(--btn-radius); background: var(--accent); color: var(--accent-ink);
  font: 600 1rem/1.2 var(--body); text-decoration: none; cursor: pointer;
  transition: background-color .15s var(--ease), transform .1s var(--ease);
}
.btn:hover { background: var(--accent-hover); }
.btn:active { transform: scale(0.98); }
.link { font-weight: 600; text-underline-offset: 6px; }

/* shared chrome (topBar, siteFooter, productCard, careProse, stepsProse in kit.mjs) */
.bar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 32px; padding: 16px var(--gutter); background: var(--bg); }
.bar .logo { font: var(--display-weight) 1.5rem/1 var(--display); text-decoration: none; direction: ltr; }
.bar .menu { display: flex; gap: 24px; font-size: 0.92rem; }
.bar .menu a { text-decoration: none; color: var(--muted); }
.bar .menu a:hover { color: var(--ink); }
.bar .langs { margin-inline-start: auto; }
.site-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 24px; max-width: var(--max); margin: 0 auto; padding: 48px var(--gutter); border-top: 1px solid var(--line); }
.site-foot .logo { font: var(--display-weight) 1.3rem/1 var(--display); direction: ltr; }
.site-foot nav { display: flex; gap: 20px; }
.site-foot p { margin: 0; margin-inline-start: auto; color: var(--muted); font-size: 0.9rem; }
.card-row { display: flex; justify-content: space-between; gap: 12px; margin-top: 14px; }
.card-row .card-name { margin: 0; }
.prose p, .steps-prose li { color: var(--muted); }
.prose b, .steps-prose b { color: var(--ink); font-weight: 600; margin-inline-end: 4px; }
.steps-prose { list-style: none; padding: 0; margin: 0 0 28px; counter-reset: s; }
.steps-prose li { counter-increment: s; margin-bottom: 8px; }
.steps-prose li::before { content: counter(s) ". "; color: var(--ink); font-variant-numeric: tabular-nums; }

/* language links (versions place them) */
.langs { display: flex; gap: 4px; font-size: 0.85rem; }
.langs a, .langs .lang-on { padding: 4px 8px; text-decoration: none; color: var(--muted); }
.langs .lang-on { color: var(--ink); font-weight: 600; }
.langs a:hover { color: var(--ink); }

/* product cards (versions can restyle) */
.grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px 20px; }
.card a { display: block; text-decoration: none; }
.card-img { position: relative; display: block; aspect-ratio: 3 / 4; background: var(--surface); border-radius: var(--radius); overflow: hidden; }
.card-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity .35s var(--ease); }
.card-img img + img { opacity: 0; }
.card a:hover .card-img img + img { opacity: 1; }
.card-name { display: block; margin-top: 14px; font-weight: 600; }
.card-meta { display: flex; align-items: center; gap: 10px; margin-top: 2px; color: var(--muted); font-size: 0.95rem; }
.dots { display: inline-flex; gap: 4px; }
.dots i { width: 12px; height: 12px; border-radius: 50%; border: 1px solid var(--line); }

/* product page + ad page */
.pdp { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 72px); align-items: start; max-width: var(--max); margin: 0 auto; padding: 32px var(--gutter) clamp(56px, 8vw, 112px); }
.frames { display: none; grid-template-columns: 1fr 1fr; gap: 8px; }
.frames.on { display: grid; }
.frames figure { margin: 0; background: var(--surface); aspect-ratio: 3 / 4; overflow: hidden; border-radius: var(--radius); }
.frames figure:first-child { grid-column: 1 / -1; aspect-ratio: 4 / 5; }
.frames img { width: 100%; height: 100%; object-fit: cover; }
.pdp-info { position: sticky; top: 96px; }
.pdp-info h1 { font-size: clamp(2.2rem, 4vw, 3.4rem); }
.pdp-info > h2 { font-size: 1.3rem; margin-top: 40px; }
.pdp-info .price { font-size: 1.3rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.tagline { color: var(--muted); font-size: 1.15rem; margin-bottom: 28px; }
.desc { color: var(--muted); }
.back { display: inline-block; font-size: 0.9rem; color: var(--muted); margin-bottom: 20px; text-underline-offset: 4px; }
.points { list-style: none; padding: 0; margin: 0 0 28px; display: grid; gap: 8px; }
.points li { position: relative; padding-inline-start: 24px; }
.points li::before { content: ""; position: absolute; inset-inline-start: 0; top: 0.55em; width: 12px; height: 6px; border-inline-start: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); }
.features { list-style: none; padding: 0; margin: 0; }
.features li { padding-block: 12px; border-top: 1px solid var(--line); }

.buy fieldset { border: 0; padding: 0; margin: 0 0 24px; }
.buy legend { font-weight: 600; margin-bottom: 12px; padding: 0; }
.buy legend span { font-weight: 400; color: var(--muted); margin-inline-start: 8px; }
.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch, .size { position: relative; cursor: pointer; }
.swatch input, .size input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.swatch { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border: 1px solid var(--line); border-radius: var(--btn-radius); font-weight: 600; font-size: 0.95rem; background: var(--bg); transition: border-color .15s var(--ease); }
.swatch:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.dot { width: 16px; height: 16px; border-radius: 50%; border: 1px solid var(--line); flex: none; }
.size span { display: grid; place-items: center; min-width: 56px; height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: min(var(--btn-radius), 8px); font-weight: 600; background: var(--bg); transition: background-color .15s var(--ease), color .15s var(--ease); }
.size input:checked + span { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.swatch:has(input:focus-visible), .size input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 3px; }
.hint { font-size: 0.9rem; color: var(--muted); margin: 12px 0 0; }
.btn-order { width: 100%; }

/* good to know: prose notes with run-in headings, two columns on wide screens */
.notes { max-width: var(--max); margin: 0 auto; padding: clamp(56px, 8vw, 112px) var(--gutter); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 24px clamp(32px, 6vw, 96px); border-top: 1px solid var(--line); }
.notes h2 { margin: 0; }
.notes-text { columns: 2 280px; column-gap: 48px; }
.notes-text p { break-inside: avoid; margin: 0 0 20px; color: var(--muted); }
.notes-text b { color: var(--ink); font-weight: 600; margin-inline-end: 4px; }

/* motion (motion.js adds html.motion; without it, or with reduced motion, everything shows in place) */
video[data-film] { display: block; width: 100%; height: auto; object-fit: cover; background: var(--surface); }
.motion [data-reveal] { opacity: 0; translate: 0 28px; transition: opacity .9s var(--ease), translate .9s var(--ease); }
.motion [data-reveal].in { opacity: 1; translate: 0 0; }

/* legal + 404 */
.legal { max-width: 760px; margin: 0 auto; padding: clamp(40px, 7vw, 88px) var(--gutter); }
.legal h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); }
.legal h2 { font-size: 1.4rem; margin-top: 1.6em; }
.notfound > div { padding-block: 24px; border-bottom: 1px solid var(--line); }

@media (max-width: 900px) {
  .bar .menu { display: none; }
  .notes { grid-template-columns: 1fr; }
  .grid { grid-template-columns: 1fr 1fr; gap: 32px 12px; }
  .pdp { grid-template-columns: 1fr; padding-inline: 0; padding-top: 0; }
  .pdp-info { position: static; padding-inline: var(--gutter); }
  .frames.on { grid-auto-flow: column; grid-auto-columns: 86%; grid-template-columns: none; overflow-x: auto; scroll-snap-type: x mandatory; gap: 4px; }
  .frames figure, .frames figure:first-child { grid-column: auto; aspect-ratio: 4 / 5; scroll-snap-align: start; border-radius: 0; }
  .ad { padding-bottom: 88px; }
  .ad .btn-order { position: fixed; inset-inline: 12px; bottom: 12px; width: auto; z-index: 15; box-shadow: 0 8px 24px -8px rgba(0, 0, 0, 0.45); }
}
@media (max-width: 560px) {
  .grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .card-img img, .swatch, .size span { transition: none; }
}

/* v28 "Index": off-white paper, Instrument Sans set large, IBM Plex Mono for colour and price. */
:root {
  --bg: #F0EEE9; --surface: #E3E0D9; --ink: #141413; --muted: #5C5A55; --line: rgba(20, 20, 19, 0.16);
  --accent: #141413; --accent-ink: #F0EEE9; --accent-hover: #33332F;
  --display: "Instrument Sans", system-ui, sans-serif; --body: "Instrument Sans", system-ui, sans-serif; --mono: "IBM Plex Mono", ui-monospace, monospace;
  --display-weight: 500; --btn-radius: 0px; --max: 1480px;
}
:lang(ar) { --display: "IBM Plex Sans Arabic", sans-serif; --body: "IBM Plex Sans Arabic", sans-serif; --mono: "IBM Plex Sans Arabic", sans-serif; }
@font-face { font-family: "Instrument Sans"; src: url("/assets/fonts/instrument.woff2") format("woff2"); font-weight: 400 600; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("/assets/fonts/plexmono.woff2") format("woff2"); font-weight: 400 500; font-display: swap; }
@font-face { font-family: "IBM Plex Sans Arabic"; src: url("/assets/fonts/plexar-regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
h1, h2 { letter-spacing: -0.035em; }
:lang(ar) :is(h1, h2) { letter-spacing: 0; }

.intro { display: grid; grid-template-columns: 2fr 1fr; gap: 32px; align-items: end; max-width: var(--max); margin: 0 auto; padding: clamp(40px, 7vw, 104px) var(--gutter) clamp(32px, 5vw, 64px); }
.intro h1 { font-size: clamp(3.4rem, 10vw, 10rem); line-height: 0.88; margin: 0; }
.intro p { color: var(--muted); margin: 0; }

.index { position: relative; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.index h2 { font: 400 0.85rem/1 var(--mono); color: var(--muted); padding-bottom: 12px; border-bottom: 1px solid var(--ink); margin: 0; }
.index ol { list-style: none; margin: 0; padding: 0; }
.index a { display: grid; grid-template-columns: 1fr auto auto; gap: 32px; align-items: baseline; padding-block: 18px; border-bottom: 1px solid var(--line); text-decoration: none; }
.line-name { font: 500 clamp(1.8rem, 4.4vw, 4rem)/1 var(--display); letter-spacing: -0.03em; transition: translate .4s var(--ease), color .3s; }
.line-colour, .index .price { font: 400 0.95rem/1 var(--mono); color: var(--muted); display: inline-flex; align-items: center; gap: 8px; margin: 0; }
.line-colour i { width: 12px; height: 12px; border-radius: 50%; }
.index a:hover .line-name { translate: 16px 0; }
:dir(rtl) .index a:hover .line-name { translate: -16px 0; }
.index ol:has(a:hover) a:not(:hover) .line-name { color: #9C9890; }

/* the preview: one photo per line, shown at the cursor (--mx, --my from motion.js) while its line is pointed at */
.peek { display: none; }
@media (hover: hover) and (pointer: fine) {
  .peek { display: block; position: absolute; z-index: 2; inset-inline-start: 0; top: 0; width: clamp(180px, 16vw, 260px); aspect-ratio: 2 / 3; pointer-events: none; opacity: 0; scale: 0.92; translate: calc(var(--mx, 70vw) + 24px) calc(var(--my, 0px) - 50%); transition: opacity .25s, scale .35s var(--ease); }
  :dir(rtl) .peek { inset-inline-start: auto; left: 0; }
  .peek img { width: 100%; height: 100%; object-fit: cover; border-radius: 2px; box-shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.35); }
  .index li a:hover .peek { opacity: 1; scale: 1; }
  .index li { position: static; }
}

.screen { max-width: var(--max); margin: clamp(80px, 11vw, 160px) auto 0; padding-inline: var(--gutter); }
.screen video { aspect-ratio: 16 / 9; }

.service { display: grid; grid-template-columns: 1.4fr 1fr; gap: clamp(32px, 6vw, 96px); max-width: var(--max); margin: 0 auto; padding: clamp(80px, 11vw, 160px) var(--gutter) clamp(40px, 5vw, 64px); }
.service h2 { font-size: clamp(1.8rem, 3vw, 2.6rem); }
.service h3 { font: 600 1rem/1.4 var(--body); }

@media (hover: none), (pointer: coarse) {
  .index a { grid-template-columns: 96px 1fr; grid-template-rows: auto auto; gap: 4px 16px; }
  .peek { display: block; grid-row: 1 / 3; grid-column: 1; aspect-ratio: 2 / 3; }
  .peek img { width: 100%; height: 100%; object-fit: cover; }
  .line-name { grid-column: 2; font-size: 1.6rem; }
  .line-colour { grid-column: 2; }
  .index .price { display: none; }
}
@media (max-width: 900px) {
  .intro, .service { grid-template-columns: 1fr; }
}
