/* Landing page (templates/general/home.html) — first-party, self-contained
   styling so the page never depends on an external CDN/font/icon host that
   the repo's ContentSecurityPolicyMiddleware (default-src 'self') would block.
   Everything below is scoped under `.hp` so it can't leak into the portals. */

.hp {
  --hp-navy: #0F2A30;
  --hp-primary: #001519;
  --hp-green: #006c48;
  --hp-green-deep: #00734d;
  --hp-mint: #8bf8c2;
  --hp-mint-dim: #6edba7;
  --hp-ink: #121c2c;
  --hp-ink-muted: #42484a;
  --hp-bg: #F8F9FA;
  --hp-surface-low: #f0f3ff;
  --hp-surface: #e7eeff;
  --hp-surface-high: #dee8ff;
  --hp-outline: #c2c7c9;
  --hp-navy-dim: #b0cbd3;
  --hp-pos: #008B5E;
  --hp-neg: #E53E3E;
  --hp-white: #ffffff;
  --hp-max: 1200px;
  --hp-pad: clamp(16px, 4vw, 48px);

  font-family: "Inter", var(--font-sans, system-ui), sans-serif;
  color: var(--hp-ink);
  background: var(--hp-bg);
  line-height: 1.5;
  overflow-x: hidden;
}

.hp *,
.hp *::before,
.hp *::after { box-sizing: border-box; }

.hp h1, .hp h2, .hp h3, .hp h4 {
  font-family: "IBM Plex Sans", var(--font-sans, system-ui), sans-serif;
  margin: 0;
  line-height: 1.2;
}
/* Reset only the vertical (block) paragraph margins — the design controls all
   vertical rhythm explicitly. Never zero the inline margins: doing so defeats
   `margin: 0 auto` centering (e.g. the languages lede), the exact bug reported
   on line 43 of the built home.css. */
.hp p { margin-block: 0; }
.hp ul { margin: 0; padding: 0; list-style: none; }
.hp a { text-decoration: none; }

.hp__wrap {
  width: 100%;
  max-width: var(--hp-max);
  margin-inline: auto;
  padding-inline: var(--hp-pad);
}

.hp__icon { width: 1.5em; height: 1.5em; flex: none; fill: currentColor; display: inline-block; }
.hp__icon--sm { width: 1.15em; height: 1.15em; }
.hp__icon--lg { width: 2.5em; height: 2.5em; }

/* ---------- Header ---------- */
.hp-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--hp-white);
  border-bottom: 1px solid var(--hp-outline);
}
.hp-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 14px;
}
/* Pure-CSS (no JS) mobile menu: the hidden checkbox is toggled by the
   `.hp-burger` <label for="hp-menu">, and `:checked ~ .hp-mobile` reveals the
   dropdown. Kept off the CSP's radar (no inline/JS handlers). */
.hp-menu-toggle { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.hp-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--hp-navy);
  font-family: "IBM Plex Sans", var(--font-sans, system-ui), sans-serif;
  font-weight: 700;
  font-size: 22px;
}
.hp-brand .hp__icon { color: var(--hp-green); }
.hp-brand__logo { display: block; height: 72px; width: auto; max-width: 100%; }
.hp-brand__mark { display: block; height: 28px; width: 28px; }
.hp-nav { display: none; gap: 28px; align-items: center; }
.hp-nav a {
  color: var(--hp-ink-muted);
  font-weight: 500;
  padding-bottom: 4px;
  border-bottom: 2px solid transparent;
  transition: color var(--motion-fast, 150ms);
}
.hp-nav a:hover { color: var(--hp-primary); }
.hp-nav a.is-active { color: var(--hp-primary); font-weight: 700; border-bottom-color: var(--hp-primary); }
.hp-header__actions { display: flex; align-items: center; gap: 14px; }
.hp-header__actions .language-switcher { margin: 0; }
.hp-header__actions .language-select { min-width: 0; }
.hp .hidden-sm { display: none; }
@media (min-width: 640px) { .hp .hidden-sm { display: block; } }

/* Desktop language switcher (top bar) — only from the nav breakpoint up; on
   mobile the switcher lives inside the dropdown instead. */
.hp-lang-desktop { display: none; }

/* Hamburger button (mobile/tablet only) */
.hp-burger {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 11px 9px;
  cursor: pointer;
  flex: none;
}
.hp-burger span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--hp-navy);
  border-radius: 2px;
  transition: transform var(--motion-fast, 150ms), opacity var(--motion-fast, 150ms);
}
.hp-menu-toggle:checked ~ .hp-header__inner .hp-burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hp-menu-toggle:checked ~ .hp-header__inner .hp-burger span:nth-child(2) { opacity: 0; }
.hp-menu-toggle:checked ~ .hp-header__inner .hp-burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile dropdown panel */
.hp-mobile { display: none; background: var(--hp-white); border-top: 1px solid var(--hp-outline); box-shadow: var(--shadow-md, 0 8px 24px rgba(0,0,0,0.12)); }
.hp-menu-toggle:checked ~ .hp-mobile { display: block; }
.hp-mobile__nav { display: flex; flex-direction: column; padding-block: 8px; }
.hp-mobile__nav a {
  padding: 14px 4px;
  color: var(--hp-ink-muted);
  font-weight: 600;
  border-bottom: 1px solid var(--hp-surface-low);
}
.hp-mobile__nav a:hover { color: var(--hp-primary); }
.hp-mobile__lang { padding: 16px 4px 20px; }
.hp-mobile__lang .language-switcher { margin: 0; }
.hp-mobile__lang .language-select,
.hp-mobile__lang .select-widget { width: 100%; max-width: 320px; }

.hp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-weight: 700;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform var(--motion-fast, 150ms), background var(--motion-fast, 150ms), color var(--motion-fast, 150ms), opacity var(--motion-fast, 150ms);
}
.hp-btn:active { transform: scale(0.97); }
.hp-btn--login { background: var(--hp-navy); color: var(--hp-white); padding: 9px 22px; }
.hp-btn--login:hover { opacity: 0.9; }
.hp-btn--primary { background: var(--hp-green); color: var(--hp-white); padding: 15px 30px; font-size: 18px; }
.hp-btn--primary:hover { background: var(--hp-green-deep); }
.hp-btn--outline { border-color: var(--hp-navy); color: var(--hp-navy); padding: 13px 30px; font-size: 18px; }
.hp-btn--outline:hover { background: var(--hp-navy); color: var(--hp-white); }
.hp-btn--light { background: var(--hp-white); color: var(--hp-navy); padding: 15px 30px; }
.hp-btn--light:hover { background: var(--hp-mint); }
.hp-btn--cta { background: var(--hp-green); color: var(--hp-white); padding: 18px 40px; font-size: 18px; box-shadow: var(--shadow-lg, 0 12px 32px rgba(0,0,0,0.18)); }
.hp-btn--cta:hover { background: var(--hp-mint); color: var(--hp-navy); }

/* ---------- Hero ---------- */
.hp-hero { background: var(--hp-bg); padding-block: clamp(40px, 8vw, 80px); }
.hp-hero__grid { display: grid; grid-template-columns: 1fr; gap: 40px; align-items: center; }
.hp-hero__copy { display: flex; flex-direction: column; gap: 28px; }
.hp-eyebrow {
  align-self: start;
  background: var(--hp-navy);
  color: var(--hp-white);
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.hp-hero h1 { font-size: clamp(30px, 5vw, 44px); color: var(--hp-navy); font-weight: 700; line-height: 1.15; }
.hp-hero h1 span { color: var(--hp-green); }
.hp-hero__lede { font-size: 18px; color: var(--hp-ink-muted); max-width: 34rem; line-height: 1.6; }
.hp-hero__ctas { display: flex; flex-wrap: wrap; gap: 16px; padding-top: 8px; }

.hp-hero__visual { position: relative; display: none; }
.hp-showcase {
  position: relative;
  background: var(--hp-white);
  border: 1px solid var(--hp-outline);
  border-radius: 12px;
  padding: 8px;
  box-shadow: var(--shadow-lg, 0 24px 48px rgba(15,42,48,0.25));
  transform: rotate(2deg);
  overflow: hidden;
}
.hp-showcase__panel {
  display: block;
  width: 100%;
  height: 460px;
  border-radius: 8px;
  object-fit: cover;
}
.hp-showcase__badge {
  position: absolute;
  left: 24px; right: 24px; bottom: 24px;
  background: var(--hp-green);
  color: var(--hp-white);
  padding: 22px;
  display: flex;
  align-items: center;
  gap: 16px;
  border-radius: 4px;
}
.hp-showcase__badge strong { font-family: "IBM Plex Sans", var(--font-sans, system-ui); font-size: 18px; }
.hp-showcase__badge span { font-size: 14px; opacity: 0.9; }

/* ---------- Section scaffolding ---------- */
.hp-section { padding-block: clamp(48px, 8vw, 96px); }
.hp-section--low { background: var(--hp-surface-low); }
.hp-section--white { background: var(--hp-white); }
.hp-section--band { background: var(--hp-surface-high); border-block: 1px solid var(--hp-outline); }
.hp-section__head { text-align: center; margin-bottom: 56px; }
.hp-section__head h2 { font-size: clamp(26px, 4vw, 32px); color: var(--hp-navy); margin-bottom: 16px; }
.hp-rule { width: 96px; height: 4px; background: var(--hp-green); margin: 0 auto; }
[dir="rtl"] .hp-showcase { transform: rotate(-2deg); }

/* ---------- Bento pillars ---------- */
.hp-bento { display: grid; grid-template-columns: 1fr; gap: 24px; scroll-margin-top: 96px; }
.hp-card {
  background: var(--hp-white);
  border: 1px solid var(--hp-outline);
  padding: 32px;
  height: 100%;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
}
.hp-card:hover { transform: translateY(-4px); box-shadow: 0 12px 24px rgba(15, 42, 48, 0.10); }
.hp-card__icon {
  width: 48px; height: 48px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--hp-surface);
  color: var(--hp-primary);
  margin-bottom: 24px;
}
.hp-card__icon .hp__icon { width: 26px; height: 26px; transition: transform 0.3s ease; }
.hp-card:hover .hp-card__icon .hp__icon { transform: scale(1.1) rotate(5deg); }
.hp-card h3 { font-size: 22px; color: var(--hp-navy); margin-bottom: 12px; }
.hp-card p { color: var(--hp-ink-muted); font-size: 14px; margin-bottom: 24px; }
.hp-card li { display: flex; align-items: center; gap: 8px; font-size: 14px; margin-bottom: 12px; }
.hp-card li:last-child { margin-bottom: 0; }
.hp-card li .hp__icon { color: var(--hp-green); }

/* ---------- Trust / ledger ---------- */
.hp-trust { background: linear-gradient(135deg, #0F2A30 0%, #001519 100%); color: var(--hp-white); }
.hp-trust__grid { display: grid; grid-template-columns: 1fr; gap: 48px; align-items: center; }
.hp-chip {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(0,108,72,0.2);
  border: 1px solid rgba(0,108,72,0.4);
  color: var(--hp-mint);
  padding: 8px 16px;
  font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  margin-bottom: 28px;
}
.hp-chip .hp__icon { color: var(--hp-mint-dim); }
.hp-trust h2 { font-size: clamp(28px, 4vw, 40px); margin-bottom: 24px; }
.hp-trust__lede { font-size: 18px; color: var(--hp-navy-dim); line-height: 1.6; margin-bottom: 32px; }
.hp-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; margin-bottom: 40px; }
.hp-stat { border-left: 4px solid var(--hp-green); padding-left: 24px; }
[dir="rtl"] .hp-stat { border-left: 0; border-right: 4px solid var(--hp-green); padding-left: 0; padding-right: 24px; }
.hp-stat strong { display: block; font-family: "IBM Plex Sans", var(--font-sans, system-ui); font-size: 24px; }
.hp-stat span { font-size: 14px; color: var(--hp-navy-dim); }

.hp-ledger { background: var(--hp-white); border-radius: 8px; padding: 4px; box-shadow: var(--shadow-lg, 0 24px 48px rgba(0,0,0,0.25)); }
.hp-ledger__inner { background: var(--hp-bg); padding: 24px; color: var(--hp-ink); }
.hp-ledger__top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 28px; gap: 12px; }
.hp-ledger__label { font-size: 12px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--hp-ink-muted); }
.hp-ledger__balance { font-family: "IBM Plex Sans", var(--font-sans, system-ui); font-size: 20px; color: var(--hp-navy); margin-top: 4px; }
.hp-ledger__delta {
  display: inline-flex; align-items: center; gap: 4px;
  background: rgba(0,139,94,0.1); color: var(--hp-pos);
  padding: 4px 10px; border-radius: 4px;
  font-family: var(--font-mono, monospace); font-size: 14px; white-space: nowrap;
}
.hp-ledger__row {
  display: flex; justify-content: space-between; gap: 12px;
  padding-block: 12px;
  border-bottom: 1px solid var(--hp-outline);
  font-family: var(--font-mono, monospace); font-size: 14px;
}
.hp-ledger__row span:first-child { color: var(--hp-ink-muted); }
.hp-pos { color: var(--hp-pos); }
.hp-neg { color: var(--hp-neg); }
.hp-ledger__note {
  margin-top: 28px; padding: 16px;
  background: rgba(15,42,48,0.05);
  border-left: 4px solid var(--hp-navy);
  display: flex; align-items: flex-start; gap: 16px;
  font-size: 14px; font-style: italic;
}
[dir="rtl"] .hp-ledger__note { border-left: 0; border-right: 4px solid var(--hp-navy); }
.hp-ledger__note .hp__icon { color: var(--hp-navy); }

/* ---------- Investor / region ---------- */
.hp-split { display: flex; flex-direction: column; gap: 48px; align-items: center; }
.hp-split__media {
  display: block;
  width: 100%; height: 320px; border-radius: 16px;
  object-fit: cover;
  box-shadow: var(--shadow-md, 0 8px 24px rgba(0,0,0,0.15));
}
.hp-split__body { width: 100%; }
.hp-split__body h2 { font-size: clamp(26px, 4vw, 32px); color: var(--hp-navy); margin-bottom: 24px; }
.hp-split__lede { font-size: 18px; color: var(--hp-ink-muted); line-height: 1.6; margin-bottom: 32px; }
.hp-metrics { display: grid; grid-template-columns: 1fr; gap: 24px; }
.hp-metric { padding: 24px; background: var(--hp-bg); border: 1px solid var(--hp-outline); }
.hp-metric .hp__icon { color: var(--hp-green); margin-bottom: 8px; }
.hp-metric strong { display: block; font-family: "IBM Plex Sans", var(--font-sans, system-ui); font-size: 20px; color: var(--hp-navy); margin-bottom: 4px; }
.hp-metric span { font-size: 14px; color: var(--hp-ink-muted); }

/* ---------- Language band ---------- */
.hp-langs { text-align: center; }
.hp-langs h2 { font-size: clamp(26px, 4vw, 32px); color: var(--hp-navy); margin-bottom: 16px; }
.hp-langs .hp-langs__lede { font-size: 18px; color: var(--hp-ink-muted); max-width: 42rem; margin: 0 auto 48px; line-height: 1.6; text-align: center; text-wrap: balance; }
.hp-langs__list { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: center; gap: 32px 48px; }
.hp-lang { display: flex; flex-direction: column; align-items: center; gap: 16px; width: 96px; text-align: center; }
.hp-lang__disc {
  width: 64px; height: 64px; border-radius: 50%;
  border: 2px solid var(--hp-outline);
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  transition: border-color var(--motion-fast, 150ms), transform var(--motion-fast, 150ms);
}
.hp-lang__flag {
  font-size: 44px; line-height: 1;
  transform: scale(1.7);
  filter: saturate(1.05);
}
.hp-lang:hover .hp-lang__disc { border-color: var(--hp-green); transform: translateY(-2px); }
.hp-lang span { font-size: 12px; font-weight: 700; letter-spacing: 0.05em; }

/* ---------- Final CTA ---------- */
.hp-cta__box {
  background: var(--hp-navy);
  color: var(--hp-white);
  padding: clamp(32px, 6vw, 80px);
  display: flex; flex-direction: column; gap: 40px;
  align-items: center; justify-content: space-between;
}
.hp-cta__box h2 { font-size: clamp(28px, 4vw, 40px); margin-bottom: 24px; }
.hp-cta__copy { max-width: 36rem; }
.hp-cta__copy p { font-size: 18px; color: var(--hp-navy-dim); line-height: 1.6; }
.hp-cta__aside { display: flex; flex-direction: column; gap: 16px; width: 100%; }
.hp-cta__phone { display: flex; align-items: center; gap: 12px; justify-content: center; }
.hp-cta__phone .hp__icon { color: var(--hp-mint-dim); }
.hp-cta__phone span { font-size: 14px; font-weight: 700; }

/* ---------- Footer ---------- */
.hp-footer { background: var(--hp-primary); color: var(--hp-white); border-top: 1px solid #314b51; }
.hp-footer__grid { display: grid; grid-template-columns: 1fr; gap: 32px; padding-block: 48px; }
.hp-footer__brand { display: flex; flex-direction: column; gap: 20px; }
.hp-footer__brand .hp-brand { color: var(--hp-white); }
.hp-footer__brand .hp-brand .hp__icon { color: var(--hp-mint-dim); }
.hp-footer__brand p { color: var(--hp-navy-dim); font-size: 14px; max-width: 22rem; }
.hp-footer__col h4 { font-size: 12px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--hp-white); margin-bottom: 16px; }
.hp-footer__col nav { display: flex; flex-direction: column; gap: 8px; }
.hp-footer__col a { color: var(--hp-navy-dim); font-size: 14px; transition: color var(--motion-fast, 150ms); }
.hp-footer__col a:hover { color: var(--hp-white); text-decoration: underline; }
.hp-secure {
  display: block; background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1); padding: 16px;
  transition: background var(--motion-fast, 150ms);
}
.hp-secure:hover { background: rgba(255,255,255,0.1); }
.hp-secure p { color: var(--hp-navy-dim); font-size: 14px; margin-bottom: 16px; }
.hp-secure__icons { display: flex; gap: 16px; color: var(--hp-mint-dim); }
.hp-footer__bar {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-block: 32px;
  display: flex; flex-direction: column; gap: 16px;
  align-items: center; justify-content: space-between;
}
.hp-footer__trust { display: flex; flex-wrap: wrap; gap: 24px; color: var(--hp-mint); font-weight: 700; font-size: 14px; }
.hp-footer__trust span { display: inline-flex; align-items: center; gap: 8px; }
.hp-footer__copy { color: var(--hp-navy-dim); font-size: 14px; }

/* ---------- Responsive ---------- */
/* Phones: keep the header compact so logo + login + burger never overflow,
   and tighten the whole page so it reads like a polished mobile site rather
   than a desktop layout squeezed down. */
@media (max-width: 767px) {
  .hp-brand__logo { height: 46px; }
  .hp-header__actions { gap: 8px; }
  .hp-btn--login { padding: 9px 16px; font-size: 14px; }

  /* Hero: center the copy (the visual is hidden here) and give the CTAs
     full-width, comfortable tap targets. */
  .hp-hero { padding-block: 40px 44px; }
  .hp-hero__grid { gap: 32px; }
  .hp-hero__copy { align-items: center; text-align: center; gap: 22px; }
  .hp-hero h1 { font-size: clamp(28px, 8vw, 36px); }
  .hp-hero__lede { font-size: 16px; text-align: center; }
  .hp-hero__ctas { width: 100%; flex-direction: column; gap: 12px; padding-top: 4px; }
  .hp-hero__ctas .hp-btn { width: 100%; padding-block: 15px; }

  /* Section rhythm: a little less air so sections don't feel stretched. */
  .hp-section { padding-block: 48px; }
  .hp-section__head { margin-bottom: 36px; }

  /* Bento cards: slightly tighter padding, keep the lift subtle. */
  .hp-card { padding: 24px; }

  /* Trust / ledger block reads better with justified lede + safe ledger rows. */
  .hp-trust__lede { font-size: 16px; text-align: justify; hyphens: auto; }
  .hp-stats { gap: 18px; }
  .hp-ledger__inner { padding: 18px; }
  .hp-ledger__top { flex-wrap: wrap; }
  .hp-ledger__row { font-size: 13px; gap: 10px; align-items: baseline; }
  .hp-ledger__row span:first-child { min-width: 0; }
  .hp-ledger__row span:last-child { white-space: nowrap; }

  /* Investor split copy justified for a clean edge. */
  .hp-split { gap: 32px; }
  .hp-split__media { height: 240px; }
  .hp-split__lede { font-size: 16px; text-align: justify; hyphens: auto; }

  /* CTA: full-width action button. */
  .hp-cta__box { padding: 32px 24px; gap: 28px; }
  .hp-cta__aside .hp-btn { width: 100%; }

  /* Footer trust bar: stack the three assurances so they don't wrap raggedly. */
  .hp-footer__trust { flex-direction: column; gap: 12px; align-items: flex-start; width: 100%; }
  .hp-footer__copy { text-align: center; width: 100%; }
}
/* Extra-small phones (≤380px): protect the language flag row + long eyebrow. */
@media (max-width: 380px) {
  .hp-langs__list { gap: 24px 28px; }
  .hp-lang { width: 76px; }
  .hp-eyebrow { font-size: 11px; letter-spacing: 0.04em; }
}
@media (min-width: 768px) {
  .hp-nav { display: flex; }
  .hp-lang-desktop { display: block; }
  .hp-burger { display: none; }
  /* Never leave the dropdown open once the inline nav takes over. */
  .hp-mobile,
  .hp-menu-toggle:checked ~ .hp-mobile { display: none; }
  .hp-hero__grid { grid-template-columns: 1fr 1fr; }
  .hp-hero__visual { display: block; }
  .hp-bento { grid-template-columns: repeat(3, 1fr); }
  .hp-split { flex-direction: row; }
  .hp-split__media, .hp-split__body { width: 50%; }
  .hp-metrics { grid-template-columns: 1fr 1fr; }
  .hp-footer__grid { grid-template-columns: 2fr 1fr 1fr 1fr; }
  .hp-footer__bar { flex-direction: row; }
  .hp-cta__box { flex-direction: row; }
  .hp-cta__aside { width: auto; }
}
@media (min-width: 1024px) {
  .hp-trust__grid { grid-template-columns: 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .hp-card, .hp-card__icon .hp__icon { transition: none; }
}
