/* Marjan Traders — site styles
   Tokens follow the brand guidelines (Anthracite, Marjan Violet, White, Lilac; Archivo + Inter).
   Spacing on an 8px grid; two radii only (4px controls, 12px panels); borders instead of shadows. */

:root {
  --ink: #1E1C1F;
  --ink-2: #29262B;
  --ink-line: #3A363D;
  --violet: #6E36FE;
  --violet-press: #5A22E8;
  --lilac: #A88BFF;
  --white: #FFFFFF;
  --paper: #F4F3F7;
  --line: #E2E0E8;
  --text: #1E1C1F;
  --text-2: #57525C;
  --text-on-dark: #F4F3F7;
  --text-on-dark-2: #ADA7B4;

  --gain: #6E36FE;
  --loss: #D93A40;
  --gain-dark: #8A5CFF;
  --loss-dark: #F2555A;

  --font-display: 'Archivo', 'Inter', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --r-sm: 4px;
  --r-lg: 12px;
  --s1: 8px; --s2: 16px; --s3: 24px; --s4: 32px; --s5: 48px; --s6: 64px; --s7: 96px; --s8: 128px;
  --wrap: 1200px;
  --gutter: 24px;
  --header-h: 72px;
}

:lang(ar) {
  --font-display: 'IBM Plex Sans Arabic', 'Archivo', system-ui, sans-serif;
  --font-body: 'IBM Plex Sans Arabic', 'Inter', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + var(--s2)); }
body {
  margin: 0;
  background: var(--white);
  color: var(--text);
  font: 400 1rem/1.6 var(--font-body);
  font-feature-settings: 'cv11', 'ss01';
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
:lang(ar) body, body:lang(ar) { line-height: 1.75; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--font-display); margin: 0; font-weight: 800; letter-spacing: -0.015em; }
:lang(ar) :is(h1, h2, h3) { letter-spacing: 0; font-weight: 700; }
p { margin: 0 0 var(--s2); }
.num { font-variant-numeric: tabular-nums; unicode-bidi: plaintext; }
.muted { color: var(--text-2); }
.is-loss { color: var(--loss); }
abbr[title] { text-decoration: underline dotted; text-underline-offset: 3px; cursor: help; }

:focus-visible { outline: 2px solid var(--violet); outline-offset: 3px; border-radius: 2px; }
.hero :focus-visible, .site-header :focus-visible, .access :focus-visible, .site-footer :focus-visible { outline-color: var(--lilac); }

.wrap { width: 100%; max-width: calc(var(--wrap) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }
.narrow { max-width: calc(760px + 2 * var(--gutter)); }

.skip { position: absolute; inset-inline-start: var(--s2); top: -100px; z-index: 100; background: var(--white); color: var(--ink); padding: var(--s1) var(--s2); border-radius: var(--r-sm); }
.skip:focus { top: var(--s2); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 var(--s3);
  border: 1px solid transparent; border-radius: var(--r-sm);
  font: 600 0.9375rem/1 var(--font-body); text-decoration: none; white-space: nowrap;
  cursor: pointer; transition: background-color .15s, border-color .15s, color .15s;
}
.btn-lg { min-height: 52px; padding: 0 var(--s4); font-size: 1rem; }
.btn-primary { background: var(--violet); color: var(--white); }
.btn-primary:hover { background: var(--violet-press); }
.btn-ghost { border-color: var(--ink-line); color: var(--text-on-dark); }
.btn-ghost:hover { border-color: var(--text-on-dark-2); }
.btn[disabled] { opacity: .6; cursor: progress; }
.link-btn { background: none; border: 0; padding: var(--s1) 0; font: 500 0.875rem var(--font-body); color: var(--text-2); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.link-btn:hover { color: var(--text); }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--ink); color: var(--text-on-dark); border-bottom: 1px solid var(--ink-line); }
.header-row { display: flex; align-items: center; gap: var(--s3); min-height: var(--header-h); }
.header-logo { flex: none; text-decoration: none; }
.logo { display: inline-flex; align-items: center; gap: 6px; height: 36px; }
.logo-mark { height: 100%; width: auto; fill: var(--violet); }
.logo-word { height: 100%; width: auto; }
.nav { display: flex; align-items: center; gap: var(--s3); margin-inline-start: auto; }
.nav ul { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; }
.nav-links { gap: var(--s3); }
.nav-links a { font-size: 0.9375rem; font-weight: 500; text-decoration: none; color: var(--text-on-dark-2); padding: var(--s1) 0; }
.nav-links a:hover { color: var(--white); }
.lang-switch { gap: 2px; padding-inline-start: var(--s3); border-inline-start: 1px solid var(--ink-line); }
.lang-switch a { display: inline-flex; align-items: center; min-height: 32px; padding: 0 var(--s1); font-size: 0.8125rem; font-weight: 600; text-decoration: none; color: var(--text-on-dark-2); border-radius: var(--r-sm); }
.lang-switch a:hover { color: var(--white); }
.lang-switch a[aria-current] { color: var(--white); background: var(--ink-2); }
.nav-toggle { display: none; }

@media (max-width: 1080px) {
  .nav-links { gap: var(--s2); }
  .nav-links a { font-size: 0.875rem; }
}
@media (max-width: 960px) {
  :root { --header-h: 64px; }
  .logo { height: 30px; }
  .nav-toggle {
    display: inline-flex; align-items: center; gap: var(--s1); margin-inline-start: auto;
    min-height: 44px; padding: 0 var(--s2); background: none; color: var(--white);
    border: 1px solid var(--ink-line); border-radius: var(--r-sm); font: 600 0.875rem var(--font-body); cursor: pointer;
  }
  .nav-toggle-bars, .nav-toggle-bars::before { display: block; width: 16px; height: 2px; background: currentColor; position: relative; }
  .nav-toggle-bars::before { content: ''; position: absolute; top: 5px; }
  .nav-toggle-bars { top: -2px; }
  .nav {
    display: none; position: absolute; inset-inline: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: var(--s3);
    padding: var(--s3) var(--gutter) var(--s4); background: var(--ink); border-bottom: 1px solid var(--ink-line);
  }
  .nav.is-open { display: flex; }
  .nav-links { flex-direction: column; align-items: stretch; gap: 0; }
  .nav-links a { display: block; padding: var(--s2) 0; font-size: 1.0625rem; border-bottom: 1px solid var(--ink-line); color: var(--text-on-dark); }
  .lang-switch { border: 0; padding: 0; gap: var(--s1); }
  .lang-switch a { min-height: 44px; padding: 0 var(--s2); border: 1px solid var(--ink-line); }
  .nav-cta { min-height: 52px; }
}

/* ---------- Hero ---------- */
.hero { background: var(--ink); color: var(--text-on-dark); padding: var(--s7) 0 var(--s6); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: var(--s6); align-items: end; }
.hero h1 {
  font-size: clamp(2.75rem, 1.6rem + 4.6vw, 5.25rem);
  line-height: 0.98; font-stretch: 112%; letter-spacing: -0.03em; max-width: 12ch;
  color: var(--white);
}
:lang(ar) .hero h1 { font-size: clamp(2.5rem, 1.6rem + 3.6vw, 4.25rem); line-height: 1.2; letter-spacing: 0; max-width: 14ch; }
.hero-lead { max-width: 56ch; margin: var(--s4) 0 var(--s5); font-size: 1.125rem; color: var(--text-on-dark-2); }
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--s2); }

.live-panel { border: 1px solid var(--ink-line); border-radius: var(--r-lg); padding: var(--s3); background: var(--ink-2); }
.live-head h2 { display: flex; align-items: center; gap: var(--s1); font: 600 0.875rem/1.4 var(--font-body); letter-spacing: 0; color: var(--text-on-dark-2); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #3DD68C; flex: none; }
.live-panel.is-stale .live-dot { background: var(--text-on-dark-2); }
.live-list { margin: var(--s2) 0 0; }
.live-row { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s2); padding: 12px 0; border-top: 1px solid var(--ink-line); }
.live-row:first-child { border-top: 0; }
.live-row dt { font-size: 0.875rem; color: var(--text-on-dark-2); }
.live-row dd { margin: 0; font-weight: 600; color: var(--white); text-align: end; }
.live-row-main dd { font-family: var(--font-display); font-size: 1.375rem; font-weight: 700; }
.live-row dd.is-loss { color: var(--loss-dark); }
.sym { font-variant-numeric: tabular-nums; }
.side { display: inline-block; padding: 2px var(--s1); border-radius: var(--r-sm); font: 600 0.8125rem/1.5 var(--font-body); letter-spacing: 0; vertical-align: middle; }
.side-buy { background: rgba(110, 54, 254, .14); color: var(--violet); }
.side-sell { background: rgba(217, 58, 64, .12); color: var(--loss); }
.hero .side-buy { background: rgba(138, 92, 255, .2); color: #C2ADFF; }
.hero .side-sell { background: rgba(242, 85, 90, .18); color: #FF9A9D; }
.live-row-main { display: block; }
.live-row-main dd { text-align: start; margin-top: 4px; }
.live-row-main .price { font-size: 1.75rem; }
.live-row-main .chg { font: 600 0.9375rem var(--font-body); color: var(--text-on-dark-2); margin-inline-start: 4px; }
.live-row-main .chg.is-loss { color: var(--loss-dark); }
.live-row-main .chg.is-gain { color: #C2ADFF; }
.live-range { display: block; margin-top: 2px; font: 400 0.8125rem/1.4 var(--font-body); color: var(--text-on-dark-2); }
.live-spark-wrap { margin: var(--s1) 0 0; padding-top: var(--s2); border-top: 1px solid var(--ink-line); }
.live-spark-wrap figcaption { font-size: 0.75rem; color: var(--text-on-dark-2); margin-top: 4px; }
.live-spark { height: 40px; }
.live-spark svg { width: 100%; height: 100%; overflow: visible; }
.live-foot { margin: var(--s1) 0 0; font-size: 0.8125rem; color: var(--text-on-dark-2); }
.live-stale { margin: var(--s1) 0 0; font-size: 0.8125rem; color: #FFB86B; }

.strip { margin-top: var(--s6); margin-bottom: 0; }
.strip-plot { position: relative; height: clamp(120px, 18vw, 220px); }
.strip-svg { width: 100%; height: 100%; }
.strip-gain { fill: var(--gain-dark); }
.strip-loss { fill: var(--loss-dark); }
.strip-last { fill: var(--lilac); }
.strip-svg polygon { transition: opacity .1s; }
.strip-plot.is-hover .strip-svg polygon { opacity: .45; }
.strip-plot.is-hover .strip-svg polygon.is-active { opacity: 1; }
.strip figcaption { margin-top: var(--s2); font-size: 0.8125rem; color: var(--text-on-dark-2); max-width: 72ch; }
.strip-tip, .chart-tip {
  position: absolute; z-index: 5; pointer-events: none; transform: translate(-50%, calc(-100% - 12px));
  padding: var(--s1) 12px; border-radius: var(--r-sm); white-space: nowrap;
  background: var(--white); color: var(--ink); border: 1px solid var(--line);
  font: 500 0.8125rem/1.45 var(--font-body);
}
.strip-tip strong, .chart-tip strong { display: block; font-weight: 600; font-variant-numeric: tabular-nums; }

.facts { display: grid; grid-template-columns: repeat(4, 1fr); margin: var(--s5) 0 0; border-top: 1px solid var(--ink-line); }
.facts > div { padding: var(--s3) var(--s3) 0 0; }
.facts > div + div { padding-inline-start: var(--s3); border-inline-start: 1px solid var(--ink-line); }
.facts dt { font-size: 0.875rem; color: var(--text-on-dark-2); }
.facts dd { margin: var(--s1) 0 0; font: 700 clamp(1.5rem, 1rem + 1.6vw, 2.25rem)/1.1 var(--font-display); font-stretch: 105%; color: var(--white); }
.facts dd.is-loss { color: var(--loss-dark); }

/* ---------- Sections ---------- */
.section { padding: var(--s8) 0; }
.section h2 { font-size: clamp(2rem, 1.4rem + 2vw, 3rem); line-height: 1.08; font-stretch: 106%; }
:lang(ar) .section h2 { line-height: 1.3; }
.section-head { max-width: 720px; margin-bottom: var(--s6); }
.section-head p { margin: var(--s2) 0 0; font-size: 1.125rem; color: var(--text-2); }
.two-col { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: var(--s6); align-items: start; }
.prose h2 { margin-bottom: var(--s3); }
.prose p { max-width: 62ch; font-size: 1.0625rem; color: var(--text-2); }

/* How it works */
.how { background: var(--paper); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s4); }
.step { padding-top: var(--s3); border-top: 2px solid var(--ink); }
.step-num { display: block; font: 800 1rem/1 var(--font-display); color: var(--violet); margin-bottom: var(--s2); }
.step h3 { font-size: 1.5rem; line-height: 1.2; margin-bottom: var(--s1); }
.step p { color: var(--text-2); margin: 0; max-width: 34ch; }

/* Results */
.chart-card { border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s3); }
.chart-bar { display: flex; justify-content: space-between; align-items: center; gap: var(--s2); flex-wrap: wrap; margin-bottom: var(--s3); }
.tabs { display: inline-flex; padding: 4px; gap: 4px; background: var(--paper); border-radius: var(--r-sm); }
.tabs button {
  min-height: 36px; padding: 0 var(--s2); border: 0; border-radius: var(--r-sm); background: transparent;
  font: 600 0.875rem var(--font-body); color: var(--text-2); cursor: pointer;
}
.tabs button[aria-selected="true"] { background: var(--white); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.chart-title { font: 600 0.9375rem/1.4 var(--font-body); letter-spacing: 0; color: var(--text-2); margin-bottom: var(--s2); }
.chart { position: relative; height: 320px; direction: ltr; }
.chart svg { width: 100%; height: 100%; overflow: visible; }
.chart-loading { display: grid; place-items: center; height: 100%; color: var(--text-2); font-size: 0.875rem; background: var(--paper); border-radius: var(--r-sm); }
.chart .axis text { font: 500 11px var(--font-body); fill: var(--text-2); font-variant-numeric: tabular-nums; }
.chart .grid line { stroke: var(--line); stroke-width: 1; }
.chart .zero { stroke: #B9B4C0; stroke-width: 1; }
.chart .bar-gain { fill: var(--gain); }
.chart .bar-loss { fill: var(--loss); }
.chart .bar.is-dim { opacity: .35; }
.chart .hit { fill: transparent; cursor: crosshair; }
.chart-table { margin-top: var(--s3); max-height: 360px; overflow: auto; border-top: 1px solid var(--line); }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); margin: var(--s5) 0; border-top: 1px solid var(--line); }
.stats > div { padding: var(--s3) var(--s3) var(--s3) 0; border-bottom: 1px solid var(--line); }
.stats > div:not(:nth-child(4n + 1)) { padding-inline-start: var(--s3); border-inline-start: 1px solid var(--line); }
.stats dt { font-size: 0.875rem; color: var(--text-2); }
.stats dd { margin: 4px 0 0; font: 700 1.5rem/1.2 var(--font-display); }
.stats .of { font-size: 1rem; font-weight: 600; color: var(--text-2); }

.results-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--s6); align-items: start; }
.results-grid h3 { font-size: 1.375rem; margin-bottom: var(--s2); }
.log-title { margin-top: var(--s5); }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
.data-table th, .data-table td { padding: 12px var(--s1); text-align: start; border-bottom: 1px solid var(--line); }
.data-table thead th { font-size: 0.8125rem; font-weight: 600; color: var(--text-2); padding-top: 0; }
.data-table tbody th { font-weight: 500; }
.data-table .num { text-align: end; font-variant-numeric: tabular-nums; }
.data-table td.empty, .empty { color: var(--text-2); font-size: 0.9375rem; }
.source-note { margin: var(--s5) 0 0; font-size: 0.8125rem; color: var(--text-2); max-width: 90ch; }

/* Strategy */
.strategy { background: var(--paper); }
.spec { margin: 0; border-top: 2px solid var(--ink); }
.spec > div { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: var(--s2); padding: var(--s2) 0; border-bottom: 1px solid var(--line); }
.spec dt { color: var(--text-2); font-size: 0.9375rem; }
.spec dd { margin: 0; font-weight: 600; }

/* Access */
.access { background: var(--ink); color: var(--text-on-dark); }
.access h2 { color: var(--white); }
.access .prose p { color: var(--text-on-dark-2); }
.seats { padding-top: var(--s2); }
.seats-label { font: 700 1.5rem/1.3 var(--font-display); color: var(--white); margin-bottom: var(--s2); }
.seats-bar { height: 8px; background: var(--ink-line); border-radius: var(--r-sm); overflow: hidden; margin-bottom: var(--s4); }
.seats-bar span { display: block; height: 100%; background: var(--violet); }

/* About */
.about-facts { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s4) var(--s3); margin: 0; padding-top: var(--s1); }
.about-facts > div { display: flex; flex-direction: column-reverse; justify-content: flex-end; gap: 4px; }
.about-facts dd { margin: 0; font: 800 clamp(1.75rem, 1.2rem + 1.4vw, 2.5rem)/1 var(--font-display); font-stretch: 108%; color: var(--violet); white-space: nowrap; }
:lang(ar) .about-facts dd { font-family: 'Archivo', var(--font-display); }
.about-facts dt { color: var(--text-2); font-size: 0.9375rem; }

/* FAQ */
.faq { background: var(--paper); }
.faq h2 { margin-bottom: var(--s5); }
.faq-list { border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  display: flex; justify-content: space-between; align-items: center; gap: var(--s3);
  padding: var(--s3) 0; cursor: pointer; list-style: none;
  font: 600 1.125rem/1.4 var(--font-body);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ''; flex: none; width: 10px; height: 10px; border-inline-end: 2px solid var(--text-2); border-bottom: 2px solid var(--text-2); transform: rotate(45deg) translate(-2px, -2px); transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(-135deg) translate(-2px, -2px); }
.faq details p { margin: 0 0 var(--s3); color: var(--text-2); max-width: 66ch; }

/* Contact form */
.direct-title { font-size: 1.125rem; margin: var(--s5) 0 var(--s2); }
.direct { list-style: none; margin: 0; padding: 0; }
.direct li { display: flex; gap: var(--s2); padding: 12px 0; border-top: 1px solid var(--line); }
.direct li span { min-width: 96px; color: var(--text-2); }
.direct a { font-weight: 600; text-decoration-color: var(--line); text-underline-offset: 3px; }
.direct a:hover { text-decoration-color: currentColor; }

.lead-form { border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s4); }
.hp { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.field { margin-bottom: var(--s3); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2); align-items: end; }
.field label { display: block; font-size: 0.875rem; font-weight: 600; margin-bottom: 6px; }
.opt { font-weight: 400; color: var(--text-2); }
.field input, .field select, .field textarea {
  width: 100%; min-height: 48px; padding: 12px; border: 1px solid #CFCBD6; border-radius: var(--r-sm);
  background: var(--white); color: var(--text); font: 400 1rem/1.4 var(--font-body);
}
.field textarea { resize: vertical; min-height: 112px; }
.field select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--text-2) 50%), linear-gradient(135deg, var(--text-2) 50%, transparent 50%); background-position: calc(100% - 20px) 21px, calc(100% - 15px) 21px; background-size: 5px 5px; background-repeat: no-repeat; padding-inline-end: 40px; }
[dir="rtl"] .field select { background-position: 15px 21px, 20px 21px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--violet); outline-offset: -1px; border-color: var(--violet); }
.field [aria-invalid="true"], .check [aria-invalid="true"] { border-color: var(--loss); }
.field-error { margin: 6px 0 0; font-size: 0.8125rem; color: var(--loss); }
.check { display: grid; grid-template-columns: 20px 1fr; gap: 12px; align-items: start; margin-bottom: var(--s2); font-size: 0.9375rem; color: var(--text-2); }
.check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--violet); }
.check .field-error { grid-column: 2; margin: 0; }
.check a { color: var(--text); }
.lead-form .btn { width: 100%; margin-top: var(--s2); }
.form-status { margin-bottom: var(--s3); padding: 12px var(--s2); border-radius: var(--r-sm); font-size: 0.9375rem; font-weight: 500; }
.form-status.is-ok { background: #EEE8FF; color: #3D1A9E; }
.form-status.is-error { background: #FDECEC; color: #9E1C21; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: var(--text-on-dark-2); padding: var(--s7) 0 var(--s4); font-size: 0.875rem; }
.footer-top { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: var(--s6); padding-bottom: var(--s5); border-bottom: 1px solid var(--ink-line); }
.footer-brand .logo { height: 32px; margin-bottom: var(--s3); }
.footer-brand address { font-style: normal; margin-bottom: var(--s1); }
.footer-mail { color: var(--text-on-dark); }
.footer-risk h2 { font: 600 0.9375rem/1.4 var(--font-body); color: var(--text-on-dark); margin-bottom: var(--s1); letter-spacing: 0; }
.footer-risk p { margin: 0; max-width: 80ch; line-height: 1.65; }
.footer-bottom { display: flex; justify-content: space-between; gap: var(--s2); flex-wrap: wrap; padding-top: var(--s3); }
.footer-bottom p { margin: 0; }
.footer-bottom ul { list-style: none; display: flex; flex-wrap: wrap; gap: var(--s1) var(--s3); margin: 0; padding: 0; }
.footer-bottom a { color: var(--text-on-dark-2); }
.footer-bottom a:hover { color: var(--white); }

/* ---------- Document pages ---------- */
.doc { padding: var(--s7) 0 var(--s8); }
.doc h1 { font-size: clamp(2rem, 1.4rem + 2vw, 3rem); line-height: 1.1; margin: var(--s2) 0 var(--s5); }
.back { font-size: 0.9375rem; color: var(--text-2); }
.doc-body h2 { font-size: 1.375rem; margin: var(--s5) 0 var(--s2); }
.doc-body p { max-width: 68ch; font-size: 1.0625rem; color: var(--text-2); }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero { padding: var(--s6) 0 var(--s5); }
  .hero-grid { grid-template-columns: 1fr; gap: var(--s5); }
  .live-panel { max-width: 480px; }
  .two-col, .results-grid, .footer-top { grid-template-columns: 1fr; gap: var(--s5); }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stats > div:not(:nth-child(4n + 1)) { padding-inline-start: 0; border-inline-start: 0; }
  .stats > div:nth-child(2n) { padding-inline-start: var(--s3); border-inline-start: 1px solid var(--line); }
  .section { padding: var(--s7) 0; }
}
@media (max-width: 720px) {
  :root { --gutter: 16px; }
  .facts { grid-template-columns: 1fr 1fr; }
  .facts > div { padding: var(--s2) var(--s2) var(--s2) 0; border-bottom: 1px solid var(--ink-line); }
  .facts > div + div { padding-inline-start: 0; border-inline-start: 0; }
  .facts > div:nth-child(2n) { padding-inline-start: var(--s2); border-inline-start: 1px solid var(--ink-line); }
  .steps { grid-template-columns: 1fr; gap: var(--s4); }
  .section { padding: var(--s6) 0; }
  .section-head { margin-bottom: var(--s4); }
  .chart-card { padding: var(--s2); }
  .chart { height: 240px; }
  .stats dd { font-size: 1.25rem; }
  .field-row { grid-template-columns: 1fr; gap: 0; }
  .lead-form { padding: var(--s3) var(--s2); }
  .hero-actions .btn { flex: 1 1 100%; }
  .footer-bottom { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

@media print {
  .site-header, .lead-form, .live-panel, .nav-toggle { display: none; }
  .hero, .access, .site-footer { background: none; color: #000; }
}

/* ---------- Additions: admission, drawdowns, notes, team, factsheet ---------- */
.btn-quiet { min-height: 40px; padding: 0 var(--s2); border-color: var(--ink-line); color: var(--text-on-dark); }
.btn-quiet:hover { border-color: var(--text-on-dark-2); }
.btn-outline { border-color: var(--ink); color: var(--ink); }
.btn-outline:hover { background: var(--ink); color: var(--white); }
.text-link { font-weight: 600; color: var(--violet); text-underline-offset: 3px; }
.source-note a { color: inherit; }

.drawdowns { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--s6); align-items: start; margin-bottom: var(--s6); padding: var(--s4); background: var(--paper); border-radius: var(--r-lg); }
.drawdowns h3 { font-size: 1.375rem; margin-bottom: var(--s1); }
.drawdowns-head p { color: var(--text-2); margin-bottom: var(--s2); }
.drawdowns .data-table th, .drawdowns .data-table td { border-color: var(--line); }

.factsheet { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); flex-wrap: wrap; margin-top: var(--s6); padding: var(--s3) 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.factsheet h3 { font-size: 1.125rem; margin-bottom: 4px; }
.factsheet p { margin: 0; color: var(--text-2); }

.role-title { font-size: 1.25rem; margin: var(--s4) 0 var(--s1); }

.path-title { font-size: 1.125rem; color: var(--white); margin: var(--s4) 0 var(--s2); }
.path { list-style: none; margin: 0; padding: 0; }
.path li { display: grid; grid-template-columns: 32px 1fr; gap: var(--s2); padding: var(--s2) 0; border-top: 1px solid var(--ink-line); }
.path-num { display: grid; place-items: center; width: 28px; height: 28px; border: 1px solid var(--ink-line); border-radius: 50%; font: 700 0.8125rem var(--font-display); color: var(--lilac); }
.path h4 { margin: 2px 0 4px; font: 600 1rem/1.4 var(--font-body); color: var(--white); }
.path p { margin: 0; color: var(--text-on-dark-2); font-size: 0.9375rem; }
.access .seats { padding: var(--s4); border: 1px solid var(--ink-line); border-radius: var(--r-lg); background: var(--ink-2); }
.seats-title { font: 600 0.875rem/1.4 var(--font-body); color: var(--text-on-dark-2); margin-bottom: var(--s2); letter-spacing: 0; }
.seats .seats-bar { margin-bottom: var(--s2); }
.seats-note { font-size: 0.875rem; color: var(--text-on-dark-2); }
.seats-stats { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2); align-items: end; margin: var(--s3) 0; padding-top: var(--s3); border-top: 1px solid var(--ink-line); }
.seats-stats dt { font-size: 0.8125rem; color: var(--text-on-dark-2); }
.seats-stats dd { margin: 4px 0 0; font: 700 1.375rem/1.2 var(--font-display); color: var(--white); }
.access .seats .btn { width: 100%; }

.notes-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: var(--s4); }
.note { padding-top: var(--s3); border-top: 2px solid var(--ink); max-width: 72ch; }
.note-date { font-size: 0.8125rem; color: var(--text-2); margin-bottom: var(--s1); }
.note h3 { font-size: 1.25rem; line-height: 1.3; margin-bottom: var(--s1); }
.note p { color: var(--text-2); }

.team { background: var(--paper); }
.team-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--s4); }
.team-list img { width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; border-radius: var(--r-lg); margin-bottom: var(--s2); filter: grayscale(1); }
.team-list h3 { font-size: 1.125rem; }
.team-list p { margin: 4px 0 0; color: var(--text-2); }

.field-invite { padding-bottom: var(--s3); border-bottom: 1px solid var(--line); }
.footer-risk .footer-legal { margin-top: var(--s2); font-size: 0.8125rem; }

@media (max-width: 960px) {
  .drawdowns { grid-template-columns: 1fr; gap: var(--s3); padding: var(--s3); }
}

/* ---------- Members area ---------- */
.lead-text { font-size: 1.125rem; color: var(--text-2); max-width: 62ch; }
.member-login { max-width: 420px; margin: var(--s4) 0 var(--s3); padding: var(--s4); border: 1px solid var(--line); border-radius: var(--r-lg); }
.member-login .btn { width: 100%; }
.member-block { margin-top: var(--s6); padding-top: var(--s4); border-top: 2px solid var(--ink); }
.member-block h2 { font-size: 1.5rem; margin-bottom: var(--s2); }
.guide { margin: 0; padding-inline-start: var(--s3); }
.guide li { margin-bottom: var(--s2); padding-inline-start: var(--s1); color: var(--text-2); max-width: 68ch; }
.guide strong { color: var(--text); }
.sheet-list { list-style: none; margin: var(--s2) 0 0; padding: 0; }
.sheet-list li { display: flex; justify-content: space-between; gap: var(--s2); padding: 12px 0; border-top: 1px solid var(--line); }
.sheet-list li:last-child { border-bottom: 1px solid var(--line); }
.sheet-list a { font-weight: 600; color: var(--violet); }
.member-note { margin-top: var(--s3); }
.member-logout { margin-top: var(--s6); }

/* ---------- Weekly letters ---------- */
.latest-week { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: var(--s4); align-items: center; margin-bottom: var(--s6); padding: var(--s3) 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.latest-week h3 { font-size: 1.125rem; margin-bottom: 4px; }
.latest-week p { margin: 0; color: var(--text-2); }
.latest-week dl { display: flex; gap: var(--s4); margin: 0; }
.latest-week dt { font-size: 0.8125rem; color: var(--text-2); }
.latest-week dd { margin: 2px 0 0; font: 700 1.375rem/1.2 var(--font-display); }
.letters-table { margin-top: var(--s4); }
.letters-table th a { font-weight: 600; color: var(--text); }
.week-range { display: block; font-size: 0.8125rem; font-weight: 400; color: var(--text-2); }
.letter-stats { grid-template-columns: repeat(2, 1fr); margin: 0; }
.letter-stats > div:not(:nth-child(4n + 1)) { padding-inline-start: 0; border-inline-start: 0; }
.letter-stats > div:nth-child(2n) { padding-inline-start: var(--s3); border-inline-start: 1px solid var(--line); }
.letter-dateline { color: var(--text-2); font-size: 0.9375rem; }
.letter-body p { color: var(--text); font-size: 1.0625rem; line-height: 1.75; }
.signature { margin-top: var(--s3); font-weight: 600; }
.week-nav { display: flex; justify-content: space-between; gap: var(--s2); flex-wrap: wrap; margin-top: var(--s6); padding-top: var(--s3); border-top: 1px solid var(--line); }
.week-nav a { font-weight: 600; color: var(--violet); }
@media (max-width: 720px) {
  .latest-week { grid-template-columns: 1fr; gap: var(--s2); }
  .letter-stats { grid-template-columns: 1fr; }
  .letter-stats > div:nth-child(2n) { padding-inline-start: 0; border-inline-start: 0; }
}

.archive-note { max-width: 62ch; margin: var(--s3) 0 0; padding-inline-start: var(--s2); border-inline-start: 2px solid var(--line); font-size: 0.9375rem; color: var(--text-2); }
.signature { display: flex; flex-direction: column; gap: 2px; margin-top: var(--s4); font-weight: 400; }
.signature-script { font: 400 2.75rem/1.1 'Mrs Saint Delafield', cursive; color: var(--ink); letter-spacing: 0; }
.signature-caption { font-size: 0.875rem; color: var(--text-2); }
[dir="rtl"] .signature { align-items: flex-start; }
/* Weekly letters: the week's market news, below the letter. */
.week-news-lead { max-width: 64ch; margin: var(--s2) 0 0; font-size: 1.0625rem; line-height: 1.7; color: var(--text); }
.week-news-list { list-style: none; margin: var(--s3) 0 0; padding: 0; border-top: 1px solid var(--line); }
.week-news-list > li { display: grid; grid-template-columns: 11rem minmax(0, 1fr); column-gap: var(--s3); padding: var(--s2) 0; border-bottom: 1px solid var(--line); line-height: 1.6; }
.week-news-day { grid-column: 1; font: 600 0.9375rem/1.6 var(--font-display); color: var(--ink); }
.week-news-text, .week-news-list > li > ul { grid-column: 2; }
.week-news-list > li > .week-news-day:only-child, .week-news-list > li > .week-news-text:first-child { grid-column: 1 / -1; }
.week-news-list > li > .week-news-day + ul { grid-row: 1; }
.week-news-list ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; color: var(--text-2); font-size: 0.9375rem; }
.week-news-list ul li { position: relative; padding-inline-start: var(--s2); }
.week-news-list ul li::before { content: ""; position: absolute; inset-inline-start: 0; top: 0.75em; width: 6px; height: 1px; background: var(--text-2); }
.week-news-text + ul { margin-top: 6px; }
.week-news-sources { margin-top: var(--s3); }
.week-news-sources h3 { font: 600 0.875rem/1.4 var(--font-body); letter-spacing: 0; color: var(--text-2); }
.week-news-sources ul { list-style: none; margin: var(--s1) 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--s1) var(--s3); font-size: 0.875rem; }
.week-news-sources a { font-weight: 600; }
.week-news-sources span { color: var(--text-2); font-size: 0.8125rem; }
@media (max-width: 640px) {
  .week-news-list > li { grid-template-columns: minmax(0, 1fr); }
  .week-news-day, .week-news-text, .week-news-list > li > ul { grid-column: 1; }
  .week-news-list > li > .week-news-day + ul { grid-row: auto; }
}

/* ---------- Illustration: Al Marjan Island ---------- */
.about-grid { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 6fr); grid-template-areas: "prose map" "facts map"; gap: var(--s5) var(--s6); align-items: start; }
.about-grid .prose { grid-area: prose; }
.about-grid .about-facts { grid-area: facts; padding-top: 0; }
.island-figure { grid-area: map; margin: 0; }
.island { width: 100%; height: auto; overflow: hidden; }
.island stop { stop-color: #ECEAF2; }
.island .island-land path { stroke: var(--violet); stroke-width: 2.25; fill: rgba(110, 54, 254, .07); }
.island .island-coast path { stroke: var(--text-2); stroke-width: 1.75; }
.island .island-depth path { stroke: var(--lilac); stroke-width: 1.25; }
.island .depth-1 { opacity: .75; }
.island .depth-2 { opacity: .45; }
.island .depth-3 { opacity: .22; }
.island-figure figcaption { display: grid; gap: 2px; margin-top: var(--s3); padding-top: var(--s2); border-top: 1px solid var(--line); }
.island-name { font: 600 0.9375rem/1.4 var(--font-body); }
.island-coords { font-size: 0.875rem; color: var(--text-2); justify-self: start; }
.island-figure small { margin-top: var(--s1); font-size: 0.75rem; color: var(--text-2); }

.footer-island { margin: var(--s4) 0 0; max-width: 132px; opacity: .8; }
.island-lite .island-land path { stroke: var(--lilac); stroke-width: 5; fill: rgba(168, 139, 255, .1); }
.island-lite stop { stop-color: var(--ink-line); }
.island-lite .island-coast path { stroke: var(--text-on-dark-2); stroke-width: 4; opacity: .5; }
.footer-island figcaption { margin-top: var(--s1); font-size: 0.75rem; color: var(--text-on-dark-2); }

@media (max-width: 960px) {
  .about-grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: "prose" "map" "facts"; gap: var(--s5); }
  .island-figure { max-width: 560px; }
}

/* ---------- Icons ---------- */
.step-top { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--s2); margin-bottom: var(--s2); }
.step-top .step-num { margin-bottom: 0; }
.step-icon { flex: none; width: 56px; height: 56px; margin-top: calc(-1 * var(--s1)); }
.step-icon svg, .form-status-icon svg { display: block; }
.form-status.has-icon { display: flex; align-items: center; gap: 12px; }
.form-status-icon { flex: none; width: 36px; height: 36px; }

/* ---------- Motion: one entrance for the hero, drawings on scroll. Nothing is hidden without it. ---------- */
.live-dot { position: relative; }
.live-dot::after { content: ''; position: absolute; inset: 0; border-radius: 50%; background: inherit; animation: live-ping 2.4s cubic-bezier(0, 0, .2, 1) infinite; }
.live-panel.is-stale .live-dot::after { display: none; }
@keyframes live-ping { 0% { transform: scale(1); opacity: .55; } 70%, 100% { transform: scale(2.8); opacity: 0; } }

@media (prefers-reduced-motion: no-preference) {
  /* Hero: the daily bars unroll from the first trading day to today. */
  .strip-svg { animation: strip-in 1.8s cubic-bezier(.3, 0, .1, 1) .15s both; }
  @keyframes strip-in { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }

  /* The island: coast and islands trace themselves, then the depth lines spread outwards. */
  .js .island-figure path { stroke-dasharray: 1 1; transition: stroke-dashoffset 2.2s cubic-bezier(.45, 0, .15, 1), fill-opacity 1.2s ease 1.5s, opacity 1.2s ease; }
  .js .island-figure .island-coast path { transition-duration: 2.8s; }
  .js .island-figure .island-depth path { stroke-dasharray: none; }
  .js .island-figure .depth-1 { transition-delay: 1.3s; }
  .js .island-figure .depth-2 { transition-delay: 1.65s; }
  .js .island-figure .depth-3 { transition-delay: 2s; }
  .js .island-figure:not(.is-in) path { stroke-dashoffset: 1; }
  .js .island-figure:not(.is-in) .island-land path { fill-opacity: 0; }
  .js .island-figure:not(.is-in) .island-depth path { opacity: 0; }
  .js .island-figure .island-mainland { transition: opacity 1.6s ease .6s; }
  .js .island-figure:not(.is-in) .island-mainland { opacity: 0; }

  /* Seats: the bar fills when it comes into view. */
  .js .seats-bar span { transform-origin: left center; transition: transform 1.4s cubic-bezier(.3, 0, .1, 1) .2s; }
  [dir="rtl"].js .seats-bar span { transform-origin: right center; }
  .js .seats-bar:not(.is-in) span { transform: scaleX(0); }
}
