/* =====================================================================
   hudhud — shared stylesheet
   ===================================================================== */

/* variables & reset */
:root {
  --paper: #f4ede0;
  --paper-2: #ebe2d1;
  --paper-3: #ddd0b8;
  --ink: #1a1814;
  --ink-2: #3d3a32;
  --ink-3: #6b6557;
  --ink-4: #9c9482;
  --line: rgba(26, 24, 20, 0.1);
  --line-2: rgba(26, 24, 20, 0.18);
  --forest: #3d5a3d;
  --forest-deep: #2a3f2a;
  --forest-soft: #6b8a6b;
  --terra: #c87b4a;
  --terra-soft: #e0a373;
  --serif: 'Newsreader', 'Iowan Old Style', Charter, Georgia, serif;
  --sans: 'IBM Plex Sans', system-ui, -apple-system, sans-serif;
  --mono: 'JetBrains Mono', 'SF Mono', Menlo, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* base typography */
.serif { font-family: var(--serif); font-weight: 400; letter-spacing: -0.018em; }
.mono  { font-family: var(--mono); }
.cap   { font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.16em; font-size: 11px; color: var(--ink-3); }
a { color: inherit; }
.container { max-width: 1240px; margin: 0 auto; padding: 0 32px; }

/* nav */
nav.top {
  position: sticky; top: 0; z-index: 50;
  padding: 18px 0;
  background: rgba(244, 237, 224, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
nav.top .row   { display: flex; align-items: center; justify-content: space-between; }
nav.top .brand { display: flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: 13px; letter-spacing: 0.18em; text-transform: uppercase; text-decoration: none; color: var(--ink); }
nav.top .brand .dot { width: 8px; height: 8px; border-radius: 4px; background: var(--forest); }
nav.top ul  { display: flex; gap: 28px; list-style: none; padding: 0; margin: 0; font-size: 14px; }
nav.top a   { text-decoration: none; color: var(--ink-2); transition: color 0.15s; }
nav.top a:hover { color: var(--forest); }
nav.top .cta { padding: 8px 18px; border-radius: 24px; background: var(--ink); color: var(--paper); text-decoration: none; font-size: 13px; font-weight: 500; }

/* buttons */
.btn-primary {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 16px 26px; border-radius: 32px;
  background: var(--ink); color: var(--paper);
  text-decoration: none; font-weight: 500; font-size: 15px;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 12px 28px rgba(26,24,20,0.18);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 16px 36px rgba(26,24,20,0.24); }
.btn-secondary {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 16px 22px; border-radius: 32px;
  background: transparent; color: var(--ink-2);
  border: 1px solid var(--line-2);
  text-decoration: none; font-weight: 500; font-size: 15px;
}

/* section utilities */
.rule        { height: 1px; background: var(--line); margin: 0; }
.section-tag { display: flex; align-items: baseline; gap: 14px; margin-bottom: 28px; }
.section-tag .num { font-family: var(--mono); font-size: 13px; color: var(--ink-3); letter-spacing: 0.1em; }
.section-tag h2   { font-family: var(--serif); font-weight: 400; font-size: clamp(32px, 4.5vw, 56px); line-height: 1; margin: 0; letter-spacing: -0.02em; }
.section-tag h2 em { font-style: italic; color: var(--forest); }

/* striped placeholder backgrounds */
.stripes-warm {
  background:
    repeating-linear-gradient(135deg, rgba(0,0,0,0.04) 0 6px, rgba(0,0,0,0.0) 6px 12px),
    linear-gradient(180deg, var(--paper-3), var(--paper-2));
}
.stripes-forest {
  background:
    repeating-linear-gradient(135deg, rgba(255,255,255,0.04) 0 6px, transparent 6px 12px),
    linear-gradient(135deg, var(--forest), var(--forest-deep));
}
.stripes-terra {
  background:
    repeating-linear-gradient(135deg, rgba(0,0,0,0.04) 0 6px, transparent 6px 12px),
    linear-gradient(180deg, var(--terra-soft), var(--terra));
}

/* hero */
.hero { padding: 90px 0 80px; position: relative; overflow: hidden; }
.hero .grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 80px; align-items: center; }
.hero h1 {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(56px, 9vw, 128px);
  line-height: 0.92; letter-spacing: -0.03em;
  margin: 24px 0 28px;
  text-wrap: balance;
}
.hero h1 em { font-style: italic; color: var(--forest); }
.hero p.lede { font-size: 19px; line-height: 1.55; color: var(--ink-2); max-width: 480px; margin: 0 0 36px; text-wrap: pretty; }
.hero .ctas  { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }

/* phone frame */
.phone-frame {
  width: 360px; height: 780px;
  border-radius: 44px; overflow: hidden;
  background: #000; position: relative;
  box-shadow: 0 0 0 10px #1a1814, 0 60px 120px rgba(26,24,20,0.35), 0 0 80px rgba(61,90,61,0.1);
  margin: 0 auto;
  transform: rotate(-2deg);
}
.phone-frame .island {
  position: absolute; top: 11px; left: 50%; transform: translateX(-50%);
  width: 110px; height: 32px; border-radius: 22px; background: #000; z-index: 50;
}
.phone-frame .home-indicator {
  position: absolute; bottom: 6px; left: 50%; transform: translateX(-50%);
  width: 124px; height: 5px; border-radius: 100px; background: rgba(0,0,0,0.3);
}
.phone-screen {
  width: 100%; height: 100%; background: var(--paper);
  position: relative; padding-top: 52px; overflow: hidden;
}

/* floating chips */
.chip {
  position: absolute; padding: 10px 16px; border-radius: 18px;
  background: var(--paper); border: 1px solid var(--line);
  box-shadow: 0 12px 28px rgba(26,24,20,0.08);
  font-size: 13px; font-weight: 500;
  display: flex; align-items: center; gap: 10px;
}
.chip .dot { width: 8px; height: 8px; border-radius: 4px; background: var(--forest); }

/* features */
.features { padding: 100px 0; border-top: 1px solid var(--line); }
.features .grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 60px; margin-top: 60px; }
.feat { display: flex; flex-direction: column; gap: 14px; }
.feat .num { font-family: var(--mono); font-size: 12px; letter-spacing: 0.18em; color: var(--ink-3); }
.feat h3 { font-family: var(--serif); font-weight: 400; font-size: 26px; margin: 0; line-height: 1.15; letter-spacing: -0.015em; }
.feat h3 em { font-style: italic; color: var(--forest); }
.feat p  { color: var(--ink-2); margin: 0; line-height: 1.55; }
.feat .ill { aspect-ratio: 4/3; border-radius: 16px; margin-bottom: 8px; overflow: hidden; position: relative; }

/* stat band */
.stat-band {
  background: var(--ink); color: var(--paper);
  padding: 100px 0;
  background-image: radial-gradient(circle at 80% 20%, rgba(200,123,74,0.18), transparent 60%),
                    radial-gradient(circle at 10% 80%, rgba(61,90,61,0.2), transparent 50%);
}
.stat-band .grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: 80px; align-items: center; }
.stat-band .big  {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(120px, 18vw, 260px); line-height: 0.85;
  letter-spacing: -0.04em; color: var(--paper);
  margin: 0;
}
.stat-band .big em { font-style: italic; color: var(--terra-soft); }
.stat-band .copy h3 { font-family: var(--serif); font-weight: 400; font-size: 36px; line-height: 1.1; margin: 0 0 16px; letter-spacing: -0.02em; }
.stat-band .copy p  { color: rgba(244,237,224,0.7); font-size: 17px; max-width: 460px; line-height: 1.6; }
.stat-band .breakdown { margin-top: 28px; display: flex; flex-direction: column; gap: 12px; max-width: 460px; }
.stat-band .bd-row { display: flex; align-items: center; gap: 14px; }
.stat-band .bd-row .n   { font-family: var(--serif); font-size: 26px; width: 50px; }
.stat-band .bd-row .lbl { flex: 1; font-size: 13px; color: rgba(244,237,224,0.75); }
.stat-band .bd-row .bar { flex: 2; height: 6px; border-radius: 3px; background: rgba(255,255,255,0.1); overflow: hidden; }
.stat-band .bd-row .bar > div { height: 100%; border-radius: 3px; }

/* showcase */
.showcase { padding: 100px 0; }
.showcase .row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 80px; align-items: center;
  padding: 60px 0;
}
.showcase .row.reverse > .text { order: 2; }
.showcase .row .text h3 {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(36px, 5vw, 64px); line-height: 1; letter-spacing: -0.025em;
  margin: 16px 0 18px;
}
.showcase .row .text h3 em { font-style: italic; color: var(--forest); }
.showcase .row .text p  { color: var(--ink-2); font-size: 17px; line-height: 1.6; max-width: 480px; }
.showcase .row .text ul { list-style: none; padding: 0; margin: 22px 0 0; display: flex; flex-direction: column; gap: 10px; }
.showcase .row .text li { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--ink-2); }
.showcase .row .text li::before { content: '·'; color: var(--forest); font-weight: 700; font-size: 24px; line-height: 0; }
.showcase .row .visual {
  aspect-ratio: 5/4; border-radius: 24px; padding: 40px;
  display: grid; place-items: center; position: relative; overflow: hidden;
  border: 1px solid var(--line);
}

/* quotes */
.quotes { padding: 100px 0; background: var(--paper-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.quotes .grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; margin-top: 40px; }
.quote {
  padding: 30px; background: var(--paper); border-radius: 20px;
  border: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 18px;
}
.quote blockquote {
  margin: 0; font-family: var(--serif); font-style: italic;
  font-size: 19px; line-height: 1.45; color: var(--ink); letter-spacing: -0.005em;
}
.quote .who { display: flex; align-items: center; gap: 12px; padding-top: 14px; border-top: 1px solid var(--line); }
.quote .who .avatar { width: 36px; height: 36px; border-radius: 18px; background: var(--paper-3); flex-shrink: 0; display: grid; place-items: center; font-size: 18px; }
.quote .who .name { font-size: 13px; font-weight: 500; }
.quote .who .meta { font-family: var(--mono); font-size: 10px; color: var(--ink-3); letter-spacing: 0.1em; text-transform: uppercase; }

/* faq */
.faq { padding: 100px 0; }
.faq .list    { display: flex; flex-direction: column; margin-top: 40px; border-top: 1px solid var(--line); }
.faq details  { border-bottom: 1px solid var(--line); padding: 22px 0; }
.faq summary  {
  font-family: var(--serif); font-size: 22px; cursor: pointer; list-style: none;
  display: flex; justify-content: space-between; align-items: center; gap: 24px;
  letter-spacing: -0.01em;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; font-family: var(--mono); font-size: 22px; color: var(--ink-3); transition: transform 0.2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { color: var(--ink-2); margin: 14px 0 0; max-width: 720px; line-height: 1.6; }

/* final cta */
.final-cta { padding: 140px 0; text-align: center; background: var(--paper-2); border-top: 1px solid var(--line); }
.final-cta h2 {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(56px, 8vw, 110px); line-height: 0.95; letter-spacing: -0.03em;
  margin: 0 0 28px; text-wrap: balance;
}
.final-cta h2 em { font-style: italic; color: var(--forest); }
.final-cta p     { color: var(--ink-2); font-size: 18px; max-width: 540px; margin: 0 auto 36px; }
.final-cta .ctas { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* page header (legal pages) */
.page-header { padding: 80px 0 60px; border-bottom: 1px solid var(--line); }
.page-header .inner { max-width: 720px; }
.page-header h1 {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(48px, 7vw, 88px);
  line-height: 0.95; letter-spacing: -0.03em;
  margin: 20px 0 24px;
}
.page-header h1 em { font-style: italic; color: var(--forest); }
.page-header .lede { font-size: 18px; color: var(--ink-2); line-height: 1.6; margin: 0; max-width: 560px; }
.page-header .meta { margin-top: 24px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.15em; color: var(--ink-3); text-transform: uppercase; }

/* prose (legal pages) */
.prose { max-width: 720px; padding: 72px 0 120px; }
.prose section { margin-bottom: 60px; }
.prose h2 {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(26px, 3vw, 34px); letter-spacing: -0.015em;
  margin: 0 0 16px; line-height: 1.1;
}
.prose h2 em { font-style: italic; color: var(--forest); }
.prose p { color: var(--ink-2); line-height: 1.7; margin: 0 0 16px; font-size: 16px; }
.prose p:last-child { margin-bottom: 0; }
.prose ul { list-style: none; padding: 0; margin: 0 0 16px; display: flex; flex-direction: column; gap: 10px; }
.prose li { display: flex; align-items: flex-start; gap: 10px; color: var(--ink-2); font-size: 16px; line-height: 1.6; }
.prose li::before { content: '·'; color: var(--forest); font-weight: 700; font-size: 24px; line-height: 1; flex-shrink: 0; margin-top: -2px; }
.prose a       { color: var(--forest); text-decoration: underline; text-underline-offset: 3px; }
.prose a:hover { color: var(--forest-deep); }

/* callout (legal pages) */
.callout {
  background: var(--paper-2); border: 1px solid var(--line-2);
  border-radius: 16px; padding: 28px 32px; margin-bottom: 60px;
}
.callout p {
  font-family: var(--serif); font-style: italic;
  font-size: 20px; line-height: 1.45; color: var(--ink);
  margin: 0;
}
.s-rule { height: 1px; background: var(--line); margin: 0 0 60px; }

/* footer */
footer { padding: 50px 0 60px; background: var(--ink); color: rgba(244,237,224,0.75); }
footer .grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 40px; margin-bottom: 50px; }
footer h4 { font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: rgba(244,237,224,0.5); margin: 0 0 16px; font-weight: 500; }
footer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
footer a { color: rgba(244,237,224,0.75); text-decoration: none; transition: color 0.15s; }
footer a:hover { color: var(--paper); }
footer .brand    { font-family: var(--serif); font-size: 28px; letter-spacing: -0.02em; }
footer .brand em { font-style: italic; color: #a4c89a; }
footer .colophon { font-size: 13px; color: rgba(244,237,224,0.5); max-width: 320px; line-height: 1.5; margin-top: 12px; }
footer .legal    { display: flex; justify-content: space-between; align-items: center; padding-top: 30px; border-top: 1px solid rgba(255,255,255,0.1); font-size: 12px; color: rgba(244,237,224,0.4); font-family: var(--mono); letter-spacing: 0.1em; text-transform: uppercase; }

/* Dark mode — auto-detected from system preference */
@media (prefers-color-scheme: dark) {
  :root {
    --paper:   #1c1a16;
    --paper-2: #232019;
    --paper-3: #2d2920;
    --ink:   #f0e8d8;
    --ink-2: #c6bca9;
    --ink-3: #8a7e6e;
    --ink-4: #5c5448;
    --line:   rgba(240, 232, 216, 0.1);
    --line-2: rgba(240, 232, 216, 0.18);
    --forest:      #6ba06b;
    --forest-deep: #4a7a4a;
    --forest-soft: #8abf8a;
  }

  /* Nav: swap hardcoded rgba bg */
  nav.top {
    background: rgba(28, 26, 22, 0.88);
  }

  /* Stat-band is always dark — keep it dark and restore explicit text colors
     because --paper (used for color/big) swaps to dark in dark mode */
  .stat-band {
    background: #0f0d09;
    background-image:
      radial-gradient(circle at 80% 20%, rgba(200,123,74,0.18), transparent 60%),
      radial-gradient(circle at 10% 80%, rgba(61,90,61,0.2), transparent 50%);
    color: #f4ede0;
  }
  .stat-band .big     { color: #f4ede0; }
  .stat-band .big em  { color: var(--terra-soft); }

  /* Footer is always dark — same reason */
  footer {
    background: #0f0d09;
    color: rgba(244, 237, 224, 0.75);
  }
}

/* =====================================================================
   Language toggle button
   ===================================================================== */
.lang-btn {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  font-weight: 500;
  color: var(--ink-2);
  background: transparent;
  border: 1px solid var(--line-2);
  border-radius: 6px;
  padding: 5px 11px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  line-height: 1;
  flex-shrink: 0;
}
.lang-btn:hover { color: var(--forest); border-color: var(--forest); }

/* =====================================================================
   RTL / Arabic language support
   ===================================================================== */

/* Arabic font stack */
[lang="ar"] {
  --serif: 'Amiri', 'Scheherazade New', Georgia, serif;
  --sans:  'IBM Plex Sans Arabic', 'Segoe UI', Arial, sans-serif;
  --mono:  'IBM Plex Sans Arabic', 'Segoe UI', Arial, sans-serif;
}

/* Remove letter-spacing everywhere — it breaks Arabic connected letters */
[dir="rtl"] * { letter-spacing: 0 !important; }

/* .cap uses text-transform: uppercase — Arabic ignores it, but also remove
   the tracking that's set inline throughout the HTML */
[dir="rtl"] .cap { text-transform: none; }

/* Arabic <em> in headings: Arabic fonts have no true italic; use color only */
[lang="ar"] h1 em,
[lang="ar"] h2 em,
[lang="ar"] h3 em,
[lang="ar"] .section-tag h2 em,
[lang="ar"] .feat h3 em,
[lang="ar"] .final-cta h2 em,
[lang="ar"] .page-header h1 em,
[lang="ar"] .prose h2 em {
  font-style: normal;
}

/* Showcase reverse rows: RTL grid already mirrors columns, cancel the LTR flip */
[dir="rtl"] .showcase .row.reverse > .text { order: 0; }

/* FAQ toggle indicator sits at the logical end — works automatically with RTL,
   but keep the + character (no arrow needed) */
[dir="rtl"] .faq summary::after { content: '+'; }

/* lang-btn label is Latin even in AR mode — keep tracking off */
[lang="ar"] .lang-btn { letter-spacing: 0 !important; }

/* Nav arrow in cta: translated string handles the ← direction in AR,
   but ensure the button doesn't clip on long Arabic text */
[dir="rtl"] nav.top .cta { white-space: nowrap; }

/* Stat-band .big number stays LTR regardless of page direction */
.stat-band .big { direction: ltr; unicode-bidi: isolate; }

/* responsive */
@media (max-width: 900px) {
  .hero .grid, .stat-band .grid, .showcase .row, .features .grid3, .quotes .grid, footer .grid {
    grid-template-columns: 1fr !important; gap: 40px !important;
  }
  .showcase .row.reverse > .text { order: 0; }
  footer .grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  nav.top ul { display: none; }
}
@media (max-width: 600px) {
  .container { padding: 0 20px; }
  footer .grid { grid-template-columns: 1fr; }
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
