/* AL QOBA AL ZAHBIA — prismatic light through obsidian.
   Marketing pages (home, contact, company) run on the brand's near-black navy with
   one near-white ink; authority comes from scale, never weight. Colour belongs to
   the brand artwork alone — the interface stays monochrome. Legal pages keep the
   light reading theme. No shadows anywhere: hairlines and scale carry structure. */

@font-face { font-family: 'Inter'; font-weight: 300; font-style: normal; font-display: swap; src: url('/fonts/inter-300.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 400; font-style: normal; font-display: swap; src: url('/fonts/inter-400.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 600; font-style: normal; font-display: swap; src: url('/fonts/inter-600.woff2') format('woff2'); }
@font-face { font-family: 'Plex Arabic'; font-weight: 300; font-style: normal; font-display: swap; src: url('/fonts/plex-arabic-300.woff2') format('woff2'); }
@font-face { font-family: 'Plex Arabic'; font-weight: 400; font-style: normal; font-display: swap; src: url('/fonts/plex-arabic-400.woff2') format('woff2'); }
@font-face { font-family: 'Plex Arabic'; font-weight: 600; font-style: normal; font-display: swap; src: url('/fonts/plex-arabic-600.woff2') format('woff2'); }

:root {
  /* Palette — the navy is sampled from the brand artwork so media meets canvas seamlessly */
  --bone: #fffdf9;
  --void: #02091f;
  --void-2: #050d24;
  --ash: #26304a;
  --fog: #8fa0bd;
  --brand-gold: #f2b229;
  --brand-blue: #2a7fff;
  --brand-violet: #7a3cff;

  /* Semantic — light reading theme (legal pages) */
  --canvas: var(--bone);
  --ink: #101010;
  --ink-muted: #5d6874;
  --hairline: #dedcd7;
  --band: var(--void);
  --band-ink: var(--bone);
  --field: rgba(16, 16, 16, 0.5);

  --font: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  /* Scale: 136 / 105 display, 56 / 36 / 33 headings, 22 / 20 / 18 body, 15 caption */
  --text-caption: 15px;
  --text-body-sm: 18px;
  --text-body: 20px;
  --text-body-lg: 22px;
  --text-heading-sm: clamp(24px, 3.1vw, 33px);
  --text-heading: clamp(26px, 3.6vw, 36px);
  --text-heading-lg: clamp(34px, 5vw, 56px);
  --text-display-sm: clamp(42px, 7.6vw, 105px);
  --text-display: clamp(50px, 9.6vw, 136px);
  --tracking-display: -0.02em;
  --tracking-heading: -0.01em;

  --max: 1440px;
  --measure: 46ch;
  --gutter: clamp(20px, 4vw, 64px);
  --section: clamp(76px, 9vw, 108px);
  --pill: 9999px;

  --ease: cubic-bezier(0.52, 0.01, 0, 1);
  --dur: 0.5s;
  --dur-lg: 1s;
  --header-h: 72px;
}

/* Dark marketing theme */
:root[data-theme='dark'] {
  --canvas: var(--void);
  --ink: var(--bone);
  --ink-muted: var(--fog);
  --hairline: var(--ash);
  --band: var(--void-2);
  --field: rgba(255, 253, 249, 0.34);
}

html[dir='rtl'] {
  --font: 'Plex Arabic', 'Inter', ui-sans-serif, system-ui, sans-serif;
  /* Arabic sets taller and joined: pull the display scale in, open the leading. */
  --text-display: clamp(38px, 7.4vw, 104px);
  --text-display-sm: clamp(32px, 6vw, 84px);
  --text-heading-lg: clamp(28px, 4.2vw, 48px);
  --tracking-display: 0;
  --tracking-heading: 0;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; background: var(--canvas); }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font: 400 var(--text-body-sm) / 1.55 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
p { margin: 0 0 1em; }
h1, h2, h3, h4 { margin: 0; font-weight: 400; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--ink); color: var(--canvas); }
:focus-visible { outline: 1px solid currentColor; outline-offset: 4px; }

.skip { position: absolute; inset-inline-start: 16px; top: -60px; z-index: 100; background: var(--ink); color: var(--canvas); padding: 10px 20px; }
.skip:focus { top: 12px; }

.wrap { width: 100%; max-width: calc(var(--max) + var(--gutter) * 2); margin-inline: auto; padding-inline: var(--gutter); }
.label { font-size: 15px; line-height: 1.2; letter-spacing: 0.02em; text-transform: uppercase; color: var(--ink-muted); }
html[dir='rtl'] .label { letter-spacing: 0; }
.muted { color: var(--ink-muted); }

/* ---------- Header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; height: var(--header-h); z-index: 50;
  border-bottom: 1px solid transparent;
  transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.site-header.stuck { background: color-mix(in srgb, var(--canvas) 90%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-bottom-color: var(--hairline); }
.site-header.over-dark { color: var(--bone); }
.site-header .wrap { height: 100%; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 20px; max-width: none; }

.brand { display: inline-flex; align-items: center; gap: 12px; min-width: 0; }
.brand .logo { height: 40px; width: auto; transition: transform var(--dur-lg) var(--ease); }
.brand:hover .logo { transform: rotate(-8deg) scale(1.04); }
.brand .wordmark { font-size: 14px; line-height: 1.15; letter-spacing: 0.04em; text-transform: uppercase; white-space: nowrap; }
.brand .wordmark span { display: block; color: var(--ink-muted); font-size: 11px; letter-spacing: 0.16em; }

.nav { justify-self: end; display: flex; align-items: center; gap: 36px; font-size: 14px; letter-spacing: 0.02em; text-transform: uppercase; }
html[dir='rtl'] .nav { letter-spacing: 0; font-size: 15px; }
.nav a { transition: color var(--dur) var(--ease); }
.nav a:hover, .nav a[aria-current='page'] { color: var(--ink-muted); }
.nav .contact-cta { border: 1px solid currentColor; border-radius: 5px; padding: 9px 15px; }
.nav .contact-cta:hover { background: var(--ink); color: var(--canvas); }
.site-header.over-dark .nav .contact-cta:hover { background: var(--bone); color: var(--void); }
.lang { justify-self: center; display: flex; gap: 14px; font-size: 14px; letter-spacing: 0.02em; }
.lang a { opacity: 0.5; transition: opacity var(--dur) var(--ease); }
.lang a[aria-current='true'], .lang a:hover { opacity: 1; }
.lang a[lang='ar'] { font-family: 'Plex Arabic', var(--font); font-size: 15px; letter-spacing: 0; }
.menu-toggle { display: none; justify-self: end; background: none; border: 0; padding: 8px 0; cursor: pointer; font-size: 14px; letter-spacing: 0.02em; text-transform: uppercase; }

@media (max-width: 980px) {
  .nav { display: none; }
  .menu-toggle { display: block; }
  .brand .wordmark span { display: none; }
}

.menu-panel {
  position: fixed; inset: 0; z-index: 60; background: var(--void); color: var(--bone);
  padding: calc(var(--header-h) + 40px) var(--gutter) 40px; display: flex; flex-direction: column; gap: 4px;
  transform: translateY(-101%); transition: transform var(--dur-lg) var(--ease); visibility: hidden;
}
.menu-panel.open { transform: none; visibility: visible; }
.menu-panel a { font-size: clamp(32px, 8.5vw, 68px); line-height: 1.12; letter-spacing: var(--tracking-display); transition: color var(--dur) var(--ease); }
.menu-panel a:hover { color: var(--fog); }
.menu-panel .close { position: absolute; top: 24px; inset-inline-end: var(--gutter); background: none; border: 0; color: inherit; font-size: 14px; letter-spacing: 0.02em; text-transform: uppercase; cursor: pointer; }
.menu-panel .panel-foot { margin-top: auto; color: var(--fog); font-size: 15px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px; padding: 14px 24px; border: 1px solid currentColor;
  border-radius: 0; background: transparent; color: inherit; font-size: 15px; letter-spacing: 0.02em;
  text-transform: uppercase; cursor: pointer; white-space: nowrap; position: relative; isolation: isolate;
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
/* The fill is a fixed colour, never currentColor: the label changes colour on
   hover, so a currentColor fill would match the text and hide it. */
.btn::before { content: ''; position: absolute; inset: 0; z-index: -1; background: var(--btn-fill, var(--ink)); transform: scaleY(0); transform-origin: bottom; transition: transform var(--dur) var(--ease); }
.btn:hover { color: var(--btn-ink, var(--canvas)); border-color: var(--btn-fill, var(--ink)); }
.btn:hover::before { transform: scaleY(1); }
.btn:hover > * { color: inherit; }
.btn .arrow { transition: transform var(--dur) var(--ease); }
.btn:hover .arrow { transform: translateX(5px); }
html[dir='rtl'] .btn .arrow { transform: scaleX(-1); }
html[dir='rtl'] .btn:hover .arrow { transform: scaleX(-1) translateX(5px); }
.btn[disabled] { opacity: 0.45; cursor: progress; }
.btn.ghost { border-color: color-mix(in srgb, currentColor 45%, transparent); }

.text-link { border-bottom: 1px solid color-mix(in srgb, currentColor 40%, transparent); transition: border-color var(--dur) var(--ease), color var(--dur) var(--ease); }
.text-link:hover { border-bottom-color: currentColor; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0; list-style: none; }
.tag { border: 1px solid color-mix(in srgb, currentColor 28%, transparent); border-radius: var(--pill); padding: 5px 14px; font-size: 15px; color: var(--ink-muted); }

/* ---------- Hero ---------- */
.hero {
  position: relative; min-height: 100svh; display: flex; align-items: center; overflow: hidden;
  background: var(--void); color: var(--bone); isolation: isolate; padding-top: var(--header-h);
}
.hero-art {
  position: absolute; z-index: 0; inset-block: 0; inset-inline-end: 0; width: min(76vw, 1100px);
  background: url('/brand/hero.avif') center right / cover no-repeat, var(--void);
  /* The artwork's own navy matches --void, and the mask dissolves the seam. */
  -webkit-mask-image: linear-gradient(to left, #000 42%, transparent 96%);
  mask-image: linear-gradient(to left, #000 42%, transparent 96%);
  will-change: transform;
}
html[dir='rtl'] .hero-art { background-position: center left; -webkit-mask-image: linear-gradient(to right, #000 42%, transparent 96%); mask-image: linear-gradient(to right, #000 42%, transparent 96%); }
.hero-art.no-avif { background-image: url('/brand/hero.webp'); }
.hero::after {
  content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(to top, var(--void) 2%, transparent 40%),
              linear-gradient(to right, var(--void) 18%, rgba(2, 9, 31, 0.35) 55%, transparent 80%);
}
html[dir='rtl'] .hero::after { background: linear-gradient(to top, var(--void) 2%, transparent 40%), linear-gradient(to left, var(--void) 18%, rgba(2, 9, 31, 0.35) 55%, transparent 80%); }
.hero .wrap { position: relative; z-index: 2; }
.hero-inner { max-width: min(100%, 860px); }
.hero-eyebrow { display: inline-flex; align-items: center; gap: 12px; margin-bottom: clamp(20px, 3.4vw, 40px); color: var(--bone); }
.hero-eyebrow .dot { width: 7px; height: 7px; border-radius: var(--pill); background: var(--brand-gold); animation: pulse 6.65s var(--ease) infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; transform: none; } 50% { opacity: 0.3; transform: scale(0.7); } }

.display { font-size: var(--text-display); line-height: 1; letter-spacing: var(--tracking-display); font-weight: 400; }
html[dir='rtl'] .display { line-height: 1.18; }
.display .line { display: block; overflow: hidden; padding-bottom: 0.07em; }
.display .line > span { display: inline-block; }
.hero-lead { max-width: var(--measure); margin-top: clamp(22px, 3vw, 36px); font-size: var(--text-body-lg); line-height: 1.5; color: color-mix(in srgb, var(--bone) 78%, transparent); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: clamp(26px, 3.6vw, 44px); }

.scroll-cue {
  position: absolute; z-index: 2; inset-inline-end: var(--gutter); bottom: 30px; display: flex; align-items: center; gap: 12px;
  font-size: 14px; letter-spacing: 0.02em; text-transform: uppercase; color: color-mix(in srgb, var(--bone) 66%, transparent);
}
.scroll-cue .rule { width: 64px; height: 1px; background: currentColor; transform-origin: left; animation: sweep 3.2s var(--ease) infinite; }
html[dir='rtl'] .scroll-cue .rule { transform-origin: right; }
@keyframes sweep { 0%, 100% { transform: scaleX(0.2); opacity: 0.35; } 50% { transform: scaleX(1); opacity: 1; } }
@media (max-height: 780px), (max-width: 760px) { .scroll-cue { display: none; } }

/* Page hero (contact, company, legal) */
.page-hero { position: relative; overflow: hidden; padding: calc(var(--header-h) + clamp(64px, 10vw, 140px)) 0 clamp(40px, 6vw, 72px); border-bottom: 1px solid var(--hairline); }
.page-hero h1 { font-size: var(--text-heading-lg); line-height: 1.13; letter-spacing: var(--tracking-heading); margin-top: 18px; }
.page-hero .lede { max-width: var(--measure); margin-top: 22px; color: var(--ink-muted); font-size: var(--text-body); line-height: 1.5; }
.page-hero .mark {
  position: absolute; inset-block: -10%; inset-inline-end: clamp(-60px, -4vw, 0px); width: min(40%, 380px);
  background: url('/brand/logo.webp') center / contain no-repeat; opacity: 0.16; pointer-events: none;
  animation: float 18s ease-in-out infinite;
}
@keyframes float { 0%, 100% { transform: translateY(0) rotate(0deg); } 50% { transform: translateY(-18px) rotate(4deg); } }
@media (max-width: 860px) { .page-hero .mark { display: none; } }

/* ---------- Sections ---------- */
.section { padding-block: var(--section); position: relative; }
.section + .section { padding-top: 0; }
.band { background: var(--band); color: var(--band-ink); border-block: 1px solid var(--hairline); }
.band + .section, .section + .band { padding-top: var(--section); }
:root:not([data-theme='dark']) .band { --ink: var(--bone); --ink-muted: var(--fog); --hairline: var(--ash); color: var(--bone); }

.section-head { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: 28px; margin-bottom: clamp(36px, 5vw, 64px); }
@media (max-width: 860px) { .section-head { grid-template-columns: minmax(0, 1fr); gap: 16px; } }

.statement { font-size: var(--text-heading-lg); line-height: 1.13; letter-spacing: var(--tracking-heading); max-width: 22ch; }
.statement em { font-style: normal; color: var(--ink-muted); }
.copy { font-size: var(--text-body); line-height: 1.55; max-width: var(--measure); color: var(--ink-muted); }
.copy strong, .copy em { color: var(--ink); font-style: normal; font-weight: 400; }
.announce-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: clamp(26px, 3.6vw, 44px); }

/* Services rows */
.rows { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--hairline); }
.row { position: relative; display: grid; grid-template-columns: 72px minmax(0, 5fr) minmax(0, 6fr); gap: 28px; padding: clamp(26px, 3.2vw, 42px) 0; border-bottom: 1px solid var(--hairline); isolation: isolate; }
.row::before { content: ''; position: absolute; inset-inline: -2vw; inset-block: 0; z-index: -1; background: color-mix(in srgb, var(--ink) 6%, transparent); opacity: 0; transition: opacity var(--dur) var(--ease); }
.row:hover::before { opacity: 1; }
.row .num { font-size: 15px; color: var(--ink-muted); padding-top: 10px; font-variant-numeric: tabular-nums; }
.row h3 { font-size: var(--text-heading-sm); line-height: 1.2; letter-spacing: var(--tracking-heading); transition: transform var(--dur) var(--ease); }
.row:hover h3 { transform: translateX(8px); }
html[dir='rtl'] .row:hover h3 { transform: translateX(-8px); }
.row p { color: var(--ink-muted); font-size: var(--text-body-sm); margin-bottom: 16px; }
@media (max-width: 860px) {
  .row { grid-template-columns: 48px minmax(0, 1fr); }
  .row .body { grid-column: 2; }
}

/* Approach steps */
.steps { list-style: none; margin: clamp(36px, 5vw, 64px) 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--hairline); }
.step { padding: 28px 28px 0 0; border-inline-end: 1px solid var(--hairline); }
html[dir='rtl'] .step { padding: 28px 0 0 28px; }
.step:last-child { border-inline-end: 0; }
.step .label { display: block; margin-bottom: 36px; }
.step h3 { font-size: var(--text-heading-sm); margin-bottom: 12px; letter-spacing: var(--tracking-heading); }
.step p { color: var(--ink-muted); font-size: var(--text-body-sm); }
@media (max-width: 900px) {
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .step:nth-child(2n) { border-inline-end: 0; }
  .step:nth-child(n+3) { border-top: 1px solid var(--hairline); }
}
@media (max-width: 560px) {
  .steps { grid-template-columns: minmax(0, 1fr); }
  .step { border-inline-end: 0; border-top: 1px solid var(--hairline); padding-inline: 0; padding-bottom: 18px; }
  .step:first-child { border-top: 0; }
}

/* Marquee */
.marquee { border-block: 1px solid var(--hairline); padding: 16px 0; overflow: hidden; }
.marquee-track { display: flex; width: max-content; animation: slide 42s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
html[dir='rtl'] .marquee-track { animation-direction: reverse; }
.marquee-track span { display: inline-flex; align-items: center; gap: 44px; padding-inline-end: 44px; font-size: var(--text-heading-sm); letter-spacing: var(--tracking-heading); color: var(--ink-muted); white-space: nowrap; }
.marquee-track span::after { content: ''; width: 6px; height: 6px; border-radius: var(--pill); background: var(--brand-gold); }
@keyframes slide { to { transform: translateX(-50%); } }
html[dir='rtl'] @keyframes slide { to { transform: translateX(50%); } }

/* Product */
.product { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(28px, 5vw, 72px); align-items: center; }
@media (max-width: 900px) { .product { grid-template-columns: minmax(0, 1fr); } }
.product-media { position: relative; border-radius: 15px; overflow: hidden; background: #03081a; aspect-ratio: 4 / 3; display: grid; place-items: center; isolation: isolate; }
.product-media img { width: 44%; height: auto; border-radius: 15px; transition: transform var(--dur-lg) var(--ease); }
.product-media:hover img { transform: scale(1.05); }
.product-media .glow { position: absolute; inset: -25%; z-index: -1; background: conic-gradient(from 200deg, rgba(42,127,255,0.45), rgba(122,60,255,0.45), rgba(242,178,41,0.35), rgba(42,127,255,0.45)); filter: blur(70px); opacity: 0.6; animation: drift 26s linear infinite; }
@keyframes drift { to { transform: rotate(360deg); } }
.product h2 { font-size: var(--text-heading-lg); line-height: 1.13; letter-spacing: var(--tracking-heading); margin: 14px 0 22px; }
.facts { list-style: none; padding: 0; margin: 26px 0 0; border-top: 1px solid var(--hairline); }
.facts li { display: flex; justify-content: space-between; gap: 16px; padding: 13px 0; border-bottom: 1px solid var(--hairline); font-size: var(--text-body-sm); }
.facts li span:first-child { color: var(--ink-muted); }
.facts a { border-bottom: 1px solid color-mix(in srgb, currentColor 40%, transparent); }
.facts a:hover { border-bottom-color: currentColor; }

/* Principles */
.principles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--hairline); }
.principle { padding: 30px 30px 30px 0; border-bottom: 1px solid var(--hairline); }
html[dir='rtl'] .principle { padding: 30px 0 30px 30px; }
.principle:nth-child(odd) { border-inline-end: 1px solid var(--hairline); }
.principle:nth-child(even) { padding-inline-start: 30px; }
.principle h3 { font-size: var(--text-heading-sm); margin-bottom: 10px; letter-spacing: var(--tracking-heading); }
.principle p { color: var(--ink-muted); margin: 0; font-size: var(--text-body-sm); }
@media (max-width: 860px) {
  .principles { grid-template-columns: minmax(0, 1fr); }
  .principle, .principle:nth-child(even) { padding-inline: 0; border-inline-end: 0; }
}

/* Closing */
.closing { display: grid; gap: clamp(28px, 4vw, 52px); }
.closing .statement { max-width: 14ch; font-size: var(--text-display-sm); line-height: 1.01; letter-spacing: var(--tracking-display); }
.closing-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px; border-top: 1px solid var(--hairline); padding-top: 26px; }
.closing-grid a { font-size: var(--text-body-sm); overflow-wrap: anywhere; transition: color var(--dur) var(--ease); }
.closing-grid a:hover { color: var(--ink-muted); }
@media (max-width: 860px) { .closing-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .closing-grid { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Contact ---------- */
.contact-layout { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: clamp(40px, 6vw, 88px); }
@media (max-width: 900px) { .contact-layout { grid-template-columns: minmax(0, 1fr); } }
.form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; }
@media (max-width: 620px) { .form { grid-template-columns: minmax(0, 1fr); } }
.field { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field label, .field legend { font-size: 14px; letter-spacing: 0.02em; text-transform: uppercase; color: var(--ink-muted); }
html[dir='rtl'] .field label, html[dir='rtl'] .field legend { letter-spacing: 0; font-size: 15px; }
.field input, .field select, .field textarea {
  width: 100%; border: 0; border-bottom: 1px solid var(--field); border-radius: 0; background: transparent;
  padding: 10px 0; font-size: var(--text-body); outline: none; color: var(--ink);
  transition: border-color var(--dur) var(--ease); -webkit-appearance: none; appearance: none;
}
.field textarea { min-height: 170px; resize: vertical; line-height: 1.5; }
.field select option { color: #101010; }
.field select {
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 10px) 55%, calc(100% - 5px) 55%; background-size: 5px 5px; background-repeat: no-repeat;
  padding-inline-end: 24px; cursor: pointer;
}
html[dir='rtl'] .field select { background-position: 10px 55%, 15px 55%; }
.field input:focus, .field select:focus, .field textarea:focus { border-bottom-color: var(--ink); }
.field [aria-invalid='true'] { border-bottom-color: #ff5a5a; }
.field .err { font-size: 15px; color: #ff7a7a; }
.field .err:empty { display: none; }
.hint, .field .hint { font-size: 15px; color: var(--ink-muted); }
.flush { margin: 0; }

.topics { border: 0; padding: 0; margin: 0; }
.topics .options { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chip { position: relative; }
.field .chip { text-transform: none; letter-spacing: 0; font-size: var(--text-body-sm); color: var(--ink); }
.chip input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.chip span { display: inline-block; border: 1px solid color-mix(in srgb, var(--ink) 32%, transparent); border-radius: var(--pill); padding: 9px 18px; transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease); }
.chip input:checked + span { background: var(--ink); color: var(--canvas); border-color: var(--ink); }
.chip input:focus-visible + span { outline: 1px solid currentColor; outline-offset: 3px; }
.project-only[hidden] { display: none; }

.check { display: flex; gap: 12px; align-items: flex-start; font-size: var(--text-body-sm); color: var(--ink-muted); }
.field .check { text-transform: none; letter-spacing: 0; }
.check input { appearance: none; -webkit-appearance: none; flex: none; width: 20px; height: 20px; border: 1px solid var(--field); border-radius: 0; margin-top: 3px; cursor: pointer; display: grid; place-items: center; }
.check input:checked { background: var(--ink); border-color: var(--ink); }
.check input:checked::after { content: ''; width: 10px; height: 5px; border: solid var(--canvas); border-width: 0 0 2px 2px; transform: rotate(-45deg) translate(1px, -1px); }
.check a { border-bottom: 1px solid currentColor; }
.check a:hover { color: var(--ink); }

.hp { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.form-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 20px; }
.turnstile-slot { min-height: 65px; }
.form-status { grid-column: 1 / -1; font-size: var(--text-body-sm); min-height: 1.5em; }
.form-status.ok { border-inline-start: 1px solid var(--ink); padding-inline-start: 16px; }
.form-status.bad { color: #ff7a7a; }
.form-done { border-top: 1px solid var(--hairline); padding-top: 32px; }
.form-done h2 { font-size: var(--text-heading); line-height: 1.2; margin-bottom: 12px; letter-spacing: var(--tracking-heading); }

.aside-block { border-top: 1px solid var(--hairline); padding-top: 20px; margin-bottom: 40px; }
.aside-block h2 { font-size: 14px; letter-spacing: 0.02em; text-transform: uppercase; color: var(--ink-muted); margin-bottom: 16px; font-weight: 400; }
html[dir='rtl'] .aside-block h2 { letter-spacing: 0; font-size: 15px; }
.addr { list-style: none; margin: 0; padding: 0; }
.addr li { padding: 12px 0; border-bottom: 1px solid var(--hairline); }
.addr li span { display: block; font-size: 15px; color: var(--ink-muted); }
.addr a { font-size: var(--text-body-sm); overflow-wrap: anywhere; transition: color var(--dur) var(--ease); }
.addr a:hover { color: var(--ink-muted); }

/* ---------- Prose / legal ---------- */
.legal { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 8fr); gap: clamp(28px, 5vw, 80px); }
@media (max-width: 900px) { .legal { grid-template-columns: minmax(0, 1fr); } }
.toc { position: sticky; top: calc(var(--header-h) + 24px); align-self: start; font-size: 15px; }
.toc ol { list-style: none; margin: 12px 0 0; padding: 0; counter-reset: toc; }
.toc li { counter-increment: toc; padding: 8px 0; border-bottom: 1px solid var(--hairline); }
.toc li a::before { content: counter(toc, decimal-leading-zero) '  '; color: var(--ink-muted); font-variant-numeric: tabular-nums; }
.toc a:hover { color: var(--ink-muted); }
@media (max-width: 900px) { .toc { position: static; } }
.prose { max-width: 68ch; font-size: var(--text-body-sm); line-height: 1.7; color: var(--ink-muted); }
.prose h2 { font-size: var(--text-heading-sm); line-height: 1.2; color: var(--ink); margin: 52px 0 16px; scroll-margin-top: calc(var(--header-h) + 24px); letter-spacing: var(--tracking-heading); }
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-size: var(--text-body); font-weight: 600; color: var(--ink); margin: 26px 0 8px; }
.prose ul { padding-inline-start: 20px; margin: 0 0 1em; }
.prose li { margin-bottom: 6px; }
.prose a { color: var(--ink); border-bottom: 1px solid color-mix(in srgb, currentColor 40%, transparent); overflow-wrap: anywhere; }
.prose a:hover { border-bottom-color: currentColor; }
.prose strong { color: var(--ink); font-weight: 600; }
.meta-line { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-top: 20px; }

.table-scroll { overflow-x: auto; margin: 16px 0 24px; border-top: 1px solid var(--hairline); }
table.data { width: 100%; border-collapse: collapse; font-size: 15px; min-width: 620px; }
table.data th { text-align: start; font-weight: 400; font-size: 14px; letter-spacing: 0.02em; text-transform: uppercase; color: var(--ink-muted); padding: 12px 12px 12px 0; border-bottom: 1px solid var(--hairline); }
html[dir='rtl'] table.data th { letter-spacing: 0; padding: 12px 0 12px 12px; }
table.data td { padding: 12px 12px 12px 0; border-bottom: 1px solid var(--hairline); vertical-align: top; }
html[dir='rtl'] table.data td { padding: 12px 0 12px 12px; }
table.data code { font-size: 14px; background: color-mix(in srgb, var(--ink) 8%, transparent); padding: 1px 6px; }

.id-card { display: grid; grid-template-columns: 220px minmax(0, 1fr); border-top: 1px solid var(--hairline); margin-bottom: 32px; }
.id-card dt, .id-card dd { margin: 0; padding: 16px 0; border-bottom: 1px solid var(--hairline); font-size: var(--text-body-sm); }
.id-card dt { color: var(--ink-muted); }
.id-card dd { color: var(--ink); }
.id-card a { border-bottom: 1px solid color-mix(in srgb, currentColor 40%, transparent); }
.id-card a:hover { border-bottom-color: currentColor; }
@media (max-width: 620px) { .id-card { grid-template-columns: minmax(0, 1fr); } .id-card dt { border-bottom: 0; padding-bottom: 0; } }

/* ---------- Footer ---------- */
.site-footer { background: var(--canvas); color: var(--ink-muted); border-top: 1px solid var(--hairline); padding: 56px 0 40px; font-size: 15px; line-height: 1.6; }
.site-footer .top { display: grid; grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr)); gap: 28px; }
.site-footer h2 { font-size: 14px; letter-spacing: 0.02em; text-transform: uppercase; color: var(--ink); margin-bottom: 14px; font-weight: 400; }
html[dir='rtl'] .site-footer h2 { letter-spacing: 0; font-size: 15px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-top: 8px; }
.site-footer a { transition: color var(--dur) var(--ease); }
.site-footer a:hover { color: var(--ink); }
.site-footer .legal-name { color: var(--ink); font-size: var(--text-body-sm); margin-bottom: 8px; }
.site-footer .brand-foot { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.site-footer .brand-foot img { height: 44px; width: auto; }
.site-footer .bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-top: 44px; padding-top: 20px; border-top: 1px solid var(--hairline); }
.linkish { background: none; border: 0; padding: 0; cursor: pointer; color: inherit; font: inherit; text-align: start; }
.linkish:hover { color: var(--ink); }
@media (max-width: 860px) { .site-footer .top { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .site-footer .top { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Cookie consent ---------- */
.consent-bar {
  position: fixed; inset-inline: 16px; bottom: 16px; z-index: 80; max-width: 880px; margin-inline: auto;
  background: rgba(2, 9, 31, 0.94); color: var(--bone); border: 1px solid var(--ash); padding: 22px 24px;
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px 24px; align-items: center;
  font-size: 15px; line-height: 1.5;
  transform: translateY(20px); opacity: 0; transition: transform var(--dur-lg) var(--ease), opacity var(--dur) var(--ease);
}
.consent-bar.show { transform: none; opacity: 1; }
.consent-bar[hidden] { display: none; }
.consent-bar p { margin: 0; }
.consent-bar a { border-bottom: 1px solid currentColor; }
.consent-bar .actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.consent-bar .btn { padding: 10px 18px; font-size: 14px; --btn-fill: var(--bone); --btn-ink: var(--void); }
@media (max-width: 760px) {
  .consent-bar { grid-template-columns: minmax(0, 1fr); }
  .consent-bar .actions .btn { flex: 1 1 auto; justify-content: center; }
}

dialog.prefs { border: 1px solid var(--ash); border-radius: 15px; padding: 0; width: min(600px, calc(100vw - 32px)); max-height: calc(100svh - 32px); background: var(--void); color: var(--bone); }
dialog.prefs::backdrop { background: rgba(0, 0, 0, 0.74); }
.prefs-inner { padding: 32px; }
.prefs h2 { font-size: var(--text-heading); line-height: 1.2; margin-bottom: 10px; letter-spacing: var(--tracking-heading); }
.prefs .intro { color: var(--fog); font-size: var(--text-body-sm); }

.pref { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 20px; padding: 20px 0; border-top: 1px solid var(--ash); }
.pref h3 { font-size: var(--text-body); }
.pref p { grid-column: 1; margin: 0; font-size: 15px; color: var(--fog); }
.switch { position: relative; width: 48px; height: 26px; grid-row: 1 / span 2; grid-column: 2; align-self: center; }
.switch input { appearance: none; -webkit-appearance: none; margin: 0; width: 48px; height: 26px; border-radius: var(--pill); border: 1px solid var(--bone); background: transparent; cursor: pointer; transition: background-color var(--dur) var(--ease); }
.switch input::after { content: ''; position: absolute; top: 4px; left: 4px; width: 18px; height: 18px; border-radius: var(--pill); background: var(--bone); transition: transform var(--dur) var(--ease), background-color var(--dur) var(--ease); }
.switch input:checked { background: var(--bone); }
.switch input:checked::after { transform: translateX(22px); background: var(--void); }
.switch input:disabled { opacity: 0.5; cursor: not-allowed; }
.prefs .actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; padding-top: 22px; border-top: 1px solid var(--ash); }
.prefs .btn { padding: 10px 18px; font-size: 14px; --btn-fill: var(--bone); --btn-ink: var(--void); }

/* ---------- 404 ---------- */
.not-found { min-height: 100svh; display: flex; flex-direction: column; justify-content: center; padding-top: var(--header-h); }
.not-found .display { margin-bottom: 26px; }

/* ---------- Motion ---------- */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity var(--dur-lg) var(--ease), transform var(--dur-lg) var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }
.js .display .line > span { transform: translateY(105%); transition: transform var(--dur-lg) var(--ease); }
.js .display.in .line > span { transform: none; }
.js .display.in .line:nth-child(2) > span { transition-delay: 0.1s; }
.js .display.in .line:nth-child(3) > span { transition-delay: 0.2s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  .js .reveal, .js .display .line > span { opacity: 1; transform: none; }
}

@media print {
  .site-header, .consent-bar, .hero-art, .scroll-cue, .marquee { display: none !important; }
  :root { --canvas: #fff; --ink: #000; --ink-muted: #333; --hairline: #ccc; }
  .hero { min-height: 0; background: none; color: #000; }
}
