/* ─────────────────────────────────────────────────────────────
   Palm USD : shared subpage styles
   Premium dark dev-web, restrained green, tight typography
   ───────────────────────────────────────────────────────────── */

:root {
  /* True near-black scale. Insets warmed to desert-night palette. */
  --ink:               #000000;
  --ink-2:             #0A0A0A;
  --ink-3:             #1A1410;   /* dune-shadow : warm inset bg */
  --ink-4:             #221A14;   /* dune-2       : deeper warm inset */
  --ink-5:             #1C1C1C;

  /* Hairlines / borders on dark : sharp, never glowing */
  --line:              rgba(255,255,255,0.06);
  --line-2:            rgba(255,255,255,0.10);
  --line-3:            rgba(255,255,255,0.16);
  --line-bright:       rgba(255,255,255,0.24);

  /* Cream / paper / bone */
  --bone:              #F5F0E8;
  --bone-2:            #EDE7DA;
  --bone-3:            #E0DAC8;
  --paper:             #FAF7F0;

  /* Text on dark */
  --text-d-1:          #F5F0E8;   /* primary */
  --text-d-2:          #C8C8C8;   /* body */
  --text-d-3:          #8A8A8A;   /* muted */
  --text-d-4:          #5C5C5C;   /* faint */

  /* Text on light */
  --text-l-1:          #0A0A0A;
  --text-l-2:          #3A3F4A;
  --text-l-3:          #6B7080;

  /* Accent : restrained palm sage */
  --accent:            #3F6B4A;
  --accent-bright:     #4F8059;
  --accent-bg:         rgba(63,107,74,0.10);
  --accent-line:       rgba(63,107,74,0.30);

  /* Warm neutral : brass tone */
  --warm:              #B8945A;
  --warm-2:            #A88450;
  --warm-bg:           rgba(184,148,90,0.10);

  /* Status : ok / warn / down, used for bars, dots, and uptime % */
  --status-ok:         var(--accent-bright);
  --status-warn:       var(--warm);
  --status-down:       #D13636;

  /* Brass : restraint accent on hairlines + small marks */
  --brass:             #B8945A;
  --brass-line:        rgba(184,148,90,0.40);
  --brass-line-soft:   rgba(184,148,90,0.20);
  --brass-line-faint:  rgba(184,148,90,0.10);

  /* Legacy aliases (existing pages still reference these) */
  --black:             var(--ink-2);
  --off-black:         var(--ink-3);
  --dark-surface:      var(--ink-4);
  --charcoal:          var(--ink-5);
  --grey-900:          #2A2A2A;
  --grey-700:          var(--text-d-4);
  --grey-500:          var(--text-d-3);
  --grey-300:          var(--text-d-2);
  --grey-100:          #E8E8E8;
  --white:             #FFFFFF;
  --cream:             var(--bone);
  --cream-dim:         var(--bone-2);
  --saudi-green:       var(--accent);
  --saudi-green-light: var(--accent-bright);
  --saudi-green-dim:   #28432F;   /* darker palm shade */
  --gold:              var(--warm);
  --gold-light:        #D9B97A;   /* lighter brass shade */

  /* Type : Source Serif 4 (display, italic ems) + Inter (body) + JetBrains Mono. */
  --font-display:       'Source Serif 4', 'Source Serif Pro', Georgia, 'Times New Roman', serif;
  --font-display-serif: var(--font-display);
  --font-body:          'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-mono:         'JetBrains Mono', ui-monospace, 'SF Mono', monospace;

  /* Radii : tighter, premium */
  --r-sm:              4px;
  --r-md:              8px;
  --r-lg:              12px;
  --r-xl:              16px;
  --r-pill:            9999px;

  /* Layout : fixed-nav clearance.
     --nav-h        : the nav's actual rendered height. Use when an element needs to clear the nav exactly (e.g. a sticky sub-bar).
     --nav-clear    : nav height + 24px tight breathing room. Use as top padding on the first content block of a page when you want minimum graceful spacing below the nav (functional ledger / dense data).
     For full hero sections that need more air (marketing pages with big H1s), keep using the existing 140-168px values per page; those are intentional and do not need to migrate. */
  --nav-h:             72px;   /* matches natural rendered height: padding 18×2 + cta-pill 35 + 1px border */
  --nav-clear:         calc(var(--nav-h) + 24px);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { min-height: 100vh; }

body {
  font-family: var(--font-body);
  background: var(--ink);
  color: var(--text-d-1);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'cv11', 'ss01';
  letter-spacing: -0.005em;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}
/* Sticky footer : on short-content pages, push the footer to the viewport bottom instead of letting it float mid-page. The fixed nav is out of flex flow so it doesn't disturb this. Body bg matches the dark page bg, so any gap between content end and footer is seamless. */
body > footer { margin-top: auto; }

::selection { background: var(--brass); color: var(--ink); }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--ink); }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.16); }

a { color: inherit; }

/* ─── NAV ─────────────────────────────────────────── */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 32px;
  transition: border-color 0.3s;
  border-bottom: 1px solid transparent;
}
/* Backdrop-filter lives on a pseudo-element, not on .nav itself.
   Otherwise .nav becomes a containing block for its position:fixed
   descendants (e.g. the .nav-links mobile drawer) and clips them
   to the nav bar height. */
.nav::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  transition: background 0.3s, backdrop-filter 0.3s, -webkit-backdrop-filter 0.3s;
}
.nav.scrolled::before {
  background: rgba(0,0,0,0.72);
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
}
.nav.scrolled {
  border-bottom-color: var(--line);
}

.nav-brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 600; font-size: 13.5px;
  letter-spacing: -0.005em;
  color: var(--bone);
  text-decoration: none;
  transition: opacity 0.2s;
}
.nav-brand:hover { opacity: 0.85; }
.nav-brand-glyph {
  width: 28px; height: 28px; border-radius: 8px;
  background: var(--bone); color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center;
  padding: 4px; overflow: hidden;
  /* fallback if favicon img fails */
  font-family: var(--font-display);
  font-style: italic; font-weight: 600; font-size: 14px;
}
.nav-brand-glyph img { width: 100%; height: 100%; object-fit: contain; display: block; }

.nav-links { display: flex; gap: 30px; align-items: center; }
.nav-links a {
  color: var(--text-d-3);
  text-decoration: none;
  font-size: 13px; font-weight: 500;
  transition: color 0.2s;
  position: relative;
  padding: 4px 0;
}
.nav-links a:hover { color: var(--text-d-1); }
.nav-links a.active { color: var(--text-d-1); }
.nav-links a.active::after {
  content: ''; position: absolute; bottom: -4px; left: 0; right: 0;
  height: 1px; background: var(--accent);
}

.nav-right { display: flex; align-items: center; gap: 16px; }

/* Mobile hamburger : hidden on desktop, shown via media query */
.nav-toggle {
  display: none;
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: 12px;
  flex-direction: column;
  gap: 5px;
  z-index: 110;
  min-width: 44px; min-height: 44px;
  align-items: center; justify-content: center;
}
.nav-toggle span {
  display: block;
  width: 22px; height: 2px;
  background: var(--bone);
  border-radius: 2px;
  transition: transform 0.25s cubic-bezier(.4,0,.2,1), opacity 0.2s;
  transform-origin: center;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.cta-pill {
  padding: 8px 16px;
  border-radius: var(--r-pill);
  background: var(--bone);
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: -0.005em;
  border: none; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; gap: 6px;
  transition: transform 0.2s, background 0.2s, color 0.2s;
}
.cta-pill:hover {
  transform: translateY(-1px);
  background: #FFFFFF;
}

/* ─── PAGE HERO ─────────────────────────────────────── */
.page-hero {
  position: relative;
  padding: 160px 32px 88px;
  overflow: hidden;
  background: var(--ink);
  border-bottom: 1px solid var(--line);
}
.page-hero::before {
  content: ''; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse at 30% 50%, black 18%, transparent 68%);
  -webkit-mask-image: radial-gradient(ellipse at 30% 50%, black 18%, transparent 68%);
  pointer-events: none;
}
.page-hero-glow {
  position: absolute; right: -8%; top: -16%;
  width: 620px; height: 620px;
  background: radial-gradient(circle, rgba(245,240,232,0.04), transparent 70%);
  filter: blur(36px); pointer-events: none;
}
.page-hero-inner { position: relative; max-width: 1320px; margin: 0 auto; z-index: 2; }

.crumb {
  font-family: var(--font-mono);
  font-size: 10.5px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--text-d-3);
  margin-bottom: 22px;
  display: inline-flex; align-items: center; gap: 12px;
  animation: fadeInUp 0.7s both;
}
.crumb::before { content: ''; width: 28px; height: 1px; background: var(--text-d-4); }

.page-hero h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.6rem, 6.6vw, 5.6rem);
  line-height: 1.0;
  letter-spacing: -0.035em;
  color: var(--bone);
  max-width: 18ch;
  animation: fadeInUp 0.9s 0.1s both;
}
.page-hero h1 em {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  color: var(--text-d-2);
}

.page-hero .lede {
  margin-top: 28px; max-width: 580px;
  font-size: 17px; line-height: 1.55;
  color: var(--text-d-2);
  animation: fadeInUp 0.9s 0.25s both;
}

/* ─── SECTION ─────────────────────────────────────── */
.section { padding: 96px 32px; position: relative; }
.section.light { background: var(--bone); color: var(--ink-2); }
.section.dark { background: var(--ink); color: var(--text-d-1); }
.section-wrap { max-width: 1320px; margin: 0 auto; }

.section-eyebrow {
  font-family: var(--font-mono);
  font-size: 10.5px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--text-d-3);
  margin-bottom: 18px;
  display: inline-flex; align-items: center; gap: 12px;
}
.section-eyebrow::before {
  content: ''; width: 36px; height: 1px; background: var(--brass); opacity: 0.7;
}
.section.light .section-eyebrow { color: var(--text-l-3); }
.section.light .section-eyebrow::before { background: var(--brass); opacity: 0.55; }

/* ─── BRASS RULE : reusable hairline above any block ─── */
.brass-rule { width: 60px; height: 1px; background: var(--brass); opacity: 0.7; margin-bottom: 18px; }
.brass-rule.full { width: 100%; opacity: 0.35; }
.brass-rule.short { width: 28px; }

.section-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.1rem, 4.4vw, 3.6rem);
  line-height: 1.05;
  letter-spacing: -0.028em;
  max-width: 18ch;
  margin-bottom: 32px;
  color: inherit;
}
.section-title em {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
}
.section.dark .section-title em { color: var(--bone); opacity: 0.85; }
.section.light .section-title em { color: var(--text-l-2); }

/* ─── CTA BAND ─────────────────────────────────────── */
.cta-band {
  position: relative;
  background: var(--ink);
  color: var(--text-d-1);
  padding: 112px 32px;
  text-align: center;
  overflow: hidden;
  border-top: 1px solid var(--line);
}
.cta-band::before {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 800px 420px at 50% 50%, rgba(245,240,232,0.05), transparent 70%);
  pointer-events: none;
}
.cta-band-inner { position: relative; max-width: 760px; margin: 0 auto; z-index: 2; }
.cta-band h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.1rem, 5vw, 4rem);
  line-height: 1.04; letter-spacing: -0.028em;
  margin-bottom: 22px;
  color: var(--bone);
}
.cta-band h2 em {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  color: var(--text-d-2);
}
.cta-band p {
  font-size: 17px; color: var(--text-d-2);
  max-width: 480px; margin: 0 auto 32px;
  line-height: 1.55;
}

/* ─── BUTTONS ─────────────────────────────────────── */
.btn-primary,
.btn-primary-green {
  background: var(--bone);
  color: var(--ink);
  padding: 13px 22px;
  border-radius: var(--r-pill);
  border: none;
  font-size: 13.5px; font-weight: 600;
  letter-spacing: -0.005em;
  cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; gap: 8px;
  transition: transform 0.2s, background 0.2s, box-shadow 0.25s;
}
.btn-primary:hover,
.btn-primary-green:hover {
  transform: translateY(-1px);
  background: #FFFFFF;
}
.btn-primary.is-disabled,
.btn-primary-green.is-disabled,
.btn-ghost.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: auto;
}
.btn-primary.is-disabled:hover,
.btn-primary-green.is-disabled:hover,
.btn-ghost.is-disabled:hover {
  transform: none;
  background: var(--bone);
}
/* True green primary, used sparingly (one per page max) */
.btn-primary-accent {
  background: var(--accent);
  color: var(--bone);
  padding: 13px 22px;
  border-radius: var(--r-pill);
  border: none;
  font-size: 13.5px; font-weight: 600;
  cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; gap: 8px;
  transition: transform 0.2s, background 0.2s, box-shadow 0.25s;
  box-shadow: 0 8px 24px -10px rgba(15,138,79,0.5);
}
.btn-primary-accent:hover {
  transform: translateY(-1px);
  background: var(--accent-bright);
  box-shadow: 0 14px 30px -8px rgba(15,138,79,0.6);
}

.btn-ghost {
  background: transparent;
  color: var(--text-d-2);
  padding: 13px 20px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line-2);
  font-size: 13.5px; font-weight: 500;
  cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; gap: 8px;
  transition: all 0.2s;
}
.btn-ghost:hover {
  border-color: var(--line-bright);
  color: var(--text-d-1);
  background: rgba(255,255,255,0.03);
}
.btn-ghost-accent {
  border-color: rgba(15,138,79,0.45);
  color: var(--accent-bright);
}
.btn-ghost-accent:hover {
  border-color: var(--accent-bright);
  color: var(--accent-bright);
  background: rgba(15,138,79,0.06);
}

/* ─── FOOTER ─────────────────────────────────────── */
footer {
  background: var(--ink);
  color: var(--text-d-3);
  padding: 64px 32px 36px;
  border-top: 1px solid var(--line);
}
.footer-inner {
  max-width: 1320px; margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1.4fr;
  gap: 48px;
}
.footer-brand-col p {
  font-size: 13px; line-height: 1.65;
  max-width: 320px; margin-top: 14px;
  color: var(--text-d-3);
}
.footer-col h4 {
  font-family: var(--font-mono);
  font-size: 10px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--text-d-4);
  margin-bottom: 16px;
  font-weight: 500;
}
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 9px; }
.footer-col a {
  color: var(--text-d-2); text-decoration: none;
  font-size: 13px;
  transition: color 0.2s;
}
.footer-col a:hover { color: var(--text-d-1); }
.footer-social-row { display: flex; gap: 10px; align-items: center; }
.footer-social-row a {
  width: 44px; height: 44px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.02);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-d-2);
  transition: color 0.25s, border-color 0.25s, background 0.25s, transform 0.2s;
}
.footer-social-row a:hover {
  color: var(--text-d-1);
  border-color: var(--brass-line);
  background: rgba(255,255,255,0.05);
  transform: translateY(-1px);
}
.footer-social-row a svg { width: 15px; height: 15px; fill: currentColor; }
.footer-peg {
  margin-top: 24px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-d-3);
}
.footer-bottom {
  max-width: 1320px; margin: 48px auto 0;
  padding-top: 26px; border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 18px;
  font-size: 11.5px;
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
  color: var(--text-d-4);
}
.footer-bottom .nowrap { white-space: nowrap; }

/* ─── REVEAL ─────────────────────────────────────── */
.reveal {
  opacity: 0; transform: translateY(20px);
  transition: opacity 0.8s cubic-bezier(.2,.7,.1,1), transform 0.8s cubic-bezier(.2,.7,.1,1);
}
.reveal.in { opacity: 1; transform: translateY(0); }
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ─── PULSE (live indicator only, restrained) ─── */
.pulse-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent-bright);
  box-shadow: 0 0 0 0 rgba(15,138,79,0.6);
  animation: pulse 2.4s infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(15,138,79,0.55); }
  70%  { box-shadow: 0 0 0 7px rgba(15,138,79,0); }
  100% { box-shadow: 0 0 0 0 rgba(15,138,79,0); }
}

/* ─── RESPONSIVE ─────────────────────────────────────── */
@media (max-width: 980px) {
  /* Hamburger : shown, drawer from right */
  .nav-toggle { display: inline-flex; }
  .nav-links {
    display: flex;
    position: fixed; inset: 0;
    background: var(--ink);
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0;
    padding: 96px 28px 40px;
    transform: translateX(100%);
    transition: transform 0.32s cubic-bezier(.4,0,.2,1);
    z-index: 95;
    overflow-y: auto;
  }
  .nav-links a {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 400;
    color: var(--bone);
    padding: 18px 0;
    padding-left: 14px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    border-left: 2px solid transparent;
  }
  .nav-links a::after { display: none; }
  .nav-links a.active { color: var(--bone); border-left-color: var(--accent-bright); }
  .nav.nav-mobile-open .nav-links { transform: translateX(0); }
  body.nav-lock { overflow: hidden; }

  .nav { padding: 14px 18px; }
  :root { --nav-h: 64px; }  /* mobile nav: padding 14×2 + cta-pill 35 + 1px border */
  .page-hero { padding: 130px 18px 56px; }
  .section { padding: 64px 18px; }
  .cta-band { padding: 64px 18px; }
  .footer-inner { grid-template-columns: 1fr 1fr; gap: 36px; }
  .footer-social { grid-column: 1 / -1; padding-top: 24px; margin-top: 8px; border-top: 1px solid var(--line); }
}
@media (max-width: 560px) {
  /* Keep "Get PUSD" pill visible on mobile, just smaller so brand + pill + hamburger fit. */
  .nav-right .cta-pill { padding: 8px 14px; font-size: 12px; }
  .nav-right .cta-pill .arrow { display: none; }
  .footer-inner { grid-template-columns: 1fr; gap: 28px; }
  .footer-social { padding-top: 0; margin-top: 0; border-top: none; }
  .footer-bottom { flex-direction: column; gap: 8px; }
  /* CTA band actions: when paired into a flex row via .cta-actions, stack with stretch instead of centered wrap. */
  .cta-band .cta-actions { flex-direction: column; align-items: stretch; }
  .cta-band .cta-actions > a { justify-content: center; }
  /* Center page-hero stack at handheld widths so the mono breadcrumb has
     a column to sit on. The eyebrow + H1 + lede center-stack reads as a
     poster, which is the right register at this size. The brass hairline
     prefix on .crumb is suppressed (mid-row line + center column reads
     awkward); the section marker is enough. */
  .page-hero { text-align: center; }
  .page-hero-inner { display: flex; flex-direction: column; align-items: center; }
  .crumb { display: flex; justify-content: center; }
  .crumb::before { display: none; }
  .page-hero h1, .page-hero .lede { max-width: none; margin-left: auto; margin-right: auto; }
}
