/* ============================================================
   SATWISE — Editorial design system
   Navy / Gold / Cream palette
   Georgia serif display + system sans body
   ============================================================ */

:root {
  /* Brand palette */
  --navy: #0B1F3A;
  --navy-deep: #051427;
  --navy-soft: #1A3150;
  --gold: #E8B84A;
  --gold-deep: #BA7517;
  --gold-soft: #FAEEDA;
  --cream: #F5F1E8;
  --cream-warm: #EDE6D3;
  --cream-deep: #E0D5BC;
  --paper: #FAF8F2;

  /* Functional */
  --ink: #0B1F3A;
  --ink-muted: #5F5E5A;
  --ink-light: #8A8A82;
  --rule: #D4C9AE;
  --green: #1D9E75;
  --red: #A32D2D;

  /* Typography */
  --font-serif: 'Georgia', 'Times New Roman', 'Cambria', serif;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;

  /* Spacing */
  --max-width: 1180px;
  --gutter: 24px;
}

/* ============================================================
   Reset & base
   ============================================================ */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 18px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; height: auto; display: block; }
svg { display: block; }

a {
  color: var(--navy);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 0.15s ease;
}
a:hover { color: var(--gold-deep); }

button { font: inherit; cursor: pointer; }

/* ============================================================
   Typography
   ============================================================ */

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--ink);
}

h1 { font-size: clamp(2.5rem, 6vw, 5rem); }
h2 { font-size: clamp(2rem, 4vw, 3.25rem); }
h3 { font-size: clamp(1.5rem, 2.5vw, 2.125rem); }
h4 { font-size: 1.375rem; }

p { margin: 0 0 1.25em; }
p:last-child { margin-bottom: 0; }

.lede {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(1.25rem, 2.2vw, 1.625rem);
  line-height: 1.4;
  color: var(--ink-muted);
}

.eyebrow {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-deep);
  margin: 0 0 1rem;
}

.eyebrow.on-dark { color: var(--gold); }

/* Drop cap for first paragraph in body sections */
.dropcap::first-letter {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 4.5em;
  float: left;
  line-height: 0.85;
  margin: 0.05em 0.08em 0 -0.05em;
  color: var(--gold-deep);
}

/* ============================================================
   Layout primitives
   ============================================================ */

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.container-narrow {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

section { padding: clamp(4rem, 9vw, 7rem) 0; }

/* Hairline dividers — editorial detail */
hr.rule {
  border: none;
  border-top: 1px solid var(--rule);
  margin: 0;
  height: 0;
}

hr.rule-thick {
  border: none;
  border-top: 3px solid var(--ink);
  margin: 2rem 0;
  height: 0;
}

hr.rule-gold {
  border: none;
  border-top: 1px solid var(--gold);
  margin: 1.5rem 0;
  height: 0;
}

/* ============================================================
   Header / nav
   ============================================================ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: rgba(250, 248, 242, 0.92);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem var(--gutter);
  max-width: var(--max-width);
  margin: 0 auto;
}

.site-header__brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--ink);
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: -0.01em;
}

.site-header__brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--navy);
  display: grid;
  place-items: center;
  color: var(--gold);
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 700;
}

.site-header__nav {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 3vw, 2.5rem);
}

.site-header__nav a {
  text-decoration: none;
  font-size: 0.95rem;
  color: var(--ink-muted);
  font-weight: 500;
  transition: color 0.15s ease;
}

.site-header__nav a:hover,
.site-header__nav a[aria-current="page"] {
  color: var(--ink);
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--navy);
  color: var(--cream) !important;
  padding: 0.6rem 1.1rem;
  border-radius: 999px;
  text-decoration: none !important;
  font-size: 0.9rem !important;
  font-weight: 600 !important;
  transition: background 0.2s ease, transform 0.15s ease;
}

.nav-cta:hover {
  background: var(--gold-deep);
  transform: translateY(-1px);
}

@media (max-width: 720px) {
  .site-header__nav { gap: 1rem; }
  .site-header__nav a:not(.nav-cta) { display: none; }
}

/* ============================================================
   Buttons
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 1.75rem;
  border-radius: 999px;
  text-decoration: none !important;
  font-weight: 600;
  font-size: 1rem;
  border: none;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
  letter-spacing: 0.01em;
}

.btn-primary {
  background: var(--gold);
  color: var(--navy);
  box-shadow: 0 4px 0 var(--gold-deep), 0 8px 24px rgba(11, 31, 58, 0.12);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 0 var(--gold-deep), 0 12px 32px rgba(11, 31, 58, 0.18);
  color: var(--navy);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 0 var(--gold-deep), 0 4px 12px rgba(11, 31, 58, 0.1);
}

.btn-secondary {
  background: transparent;
  color: var(--navy);
  border: 1.5px solid var(--navy);
}

.btn-secondary:hover {
  background: var(--navy);
  color: var(--cream);
}

.btn-on-dark {
  background: var(--gold);
  color: var(--navy);
  box-shadow: 0 4px 0 var(--gold-deep);
}

/* ============================================================
   Footer
   ============================================================ */

.site-footer {
  background: var(--navy);
  color: var(--cream);
  padding: 4rem 0 2rem;
  margin-top: 0;
}

/* When final-cta is the last section before footer, ensure no gap */
.final-cta + .site-footer,
section.section-navy + .site-footer {
  margin-top: 0;
}

/* Prevent body background bleeding through section gaps */
main { display: block; }
section + section { margin: 0; }

.site-footer a {
  color: var(--cream);
  text-decoration-color: rgba(245, 241, 232, 0.3);
}

.site-footer a:hover { color: var(--gold); }

.site-footer__top {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid rgba(245, 241, 232, 0.15);
}

@media (max-width: 720px) {
  .site-footer__top {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }
}

.site-footer__brand {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.site-footer__tag {
  font-family: var(--font-serif);
  font-style: italic;
  color: rgba(245, 241, 232, 0.7);
  max-width: 28ch;
}

.site-footer__col h4 {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1rem;
}

.site-footer__col ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  font-size: 0.95rem;
}

.site-footer__bottom {
  padding-top: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.85rem;
  color: rgba(245, 241, 232, 0.55);
}

.site-footer__bottom address {
  font-style: normal;
}

/* ============================================================
   Reusable section components
   ============================================================ */

.section-cream { background: var(--cream); }
.section-navy { background: var(--navy); color: var(--cream); }
.section-paper { background: var(--paper); }

.section-navy h1, .section-navy h2, .section-navy h3, .section-navy h4 { color: var(--cream); }
.section-navy .lede { color: rgba(245, 241, 232, 0.8); }

.section-header {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 4rem;
}

.section-header.left {
  text-align: left;
  margin-left: 0;
}

/* ============================================================
   Animations (CSS-only stagger reveal)
   ============================================================ */

@keyframes fade-up {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.reveal {
  animation: fade-up 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) backwards;
}

.reveal-1 { animation-delay: 0.05s; }
.reveal-2 { animation-delay: 0.18s; }
.reveal-3 { animation-delay: 0.32s; }
.reveal-4 { animation-delay: 0.48s; }
.reveal-5 { animation-delay: 0.66s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ============================================================
   Print
   ============================================================ */

@media print {
  .site-header, .site-footer, .nav-cta { display: none; }
  body { background: white; color: black; }
  a { color: inherit; text-decoration: underline; }
}

/* ============================================================
   Page hero (used on subpages: how-it-works, privacy, terms, support)
   ============================================================ */

.page-hero {
  padding: clamp(3rem, 6vw, 5rem) 0 clamp(2rem, 4vw, 3.5rem);
  background:
    radial-gradient(ellipse at top right, rgba(232, 184, 74, 0.08), transparent 50%),
    var(--paper);
  border-bottom: 1px solid var(--rule);
  position: relative;
}

.page-hero__inner {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 var(--gutter);
  text-align: center;
}

.page-hero__title {
  font-size: clamp(2.5rem, 5vw, 4rem);
  line-height: 1;
  margin-bottom: 1rem;
}

.page-hero__title em {
  color: var(--gold-deep);
  font-style: italic;
}

.page-hero__subtitle {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(1.125rem, 1.8vw, 1.375rem);
  line-height: 1.4;
  color: var(--ink-muted);
  margin-bottom: 0;
}

.page-hero__meta {
  display: inline-block;
  margin-top: 1.5rem;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-light);
}

/* ============================================================
   Long-form prose (legal pages, support content)
   ============================================================ */

.prose {
  max-width: 720px;
  margin: 0 auto;
  padding: clamp(2rem, 5vw, 4rem) var(--gutter);
}

.prose h2 {
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  margin: 2.5rem 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--rule);
}

.prose h3 {
  font-size: 1.25rem;
  font-family: var(--font-serif);
  margin: 1.75rem 0 0.75rem;
}

.prose h2:first-child,
.prose h3:first-child { margin-top: 0; }

.prose p,
.prose ul,
.prose ol {
  margin: 0 0 1rem;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--ink);
}

.prose ul, .prose ol {
  padding-left: 1.5rem;
}

.prose li { margin-bottom: 0.4rem; }

.prose strong { color: var(--ink); font-weight: 600; }

.prose a {
  color: var(--gold-deep);
  text-decoration-thickness: 1px;
}

.prose .toc {
  background: var(--cream);
  border-left: 3px solid var(--gold);
  border-radius: 4px;
  padding: 1.5rem 1.5rem 1.5rem 2rem;
  margin: 2rem 0 3rem;
  font-size: 0.95rem;
}

.prose .toc h4 {
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-deep);
  margin: 0 0 1rem;
}

.prose .toc ol {
  margin: 0;
  padding-left: 1.25rem;
}

.prose .toc li { margin-bottom: 0.4rem; }

.prose .toc a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px dotted transparent;
}

.prose .toc a:hover {
  border-bottom-color: var(--gold-deep);
  color: var(--gold-deep);
}

.prose .placeholder-note {
  background: rgba(232, 184, 74, 0.12);
  border: 1px dashed var(--gold-deep);
  border-radius: 6px;
  padding: 1.25rem;
  margin: 1.5rem 0;
  font-size: 0.9rem;
  color: var(--gold-deep);
}

/* ============================================================
   FAQ (used on support page)
   ============================================================ */

.faq {
  max-width: 720px;
  margin: 0 auto;
}

.faq__item {
  border-top: 1px solid var(--rule);
  padding: 1.5rem 0;
}

.faq__item:last-child { border-bottom: 1px solid var(--rule); }

.faq__q {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.25rem;
  line-height: 1.3;
  margin: 0 0 0.75rem;
  color: var(--ink);
}

.faq__a {
  color: var(--ink-muted);
  font-size: 1rem;
  line-height: 1.6;
  margin: 0;
}

.faq__a a {
  color: var(--gold-deep);
}

/* ============================================================
   Contact card (support page)
   ============================================================ */

.contact-card {
  max-width: 720px;
  margin: 4rem auto 0;
  padding: 2.5rem;
  background: var(--cream);
  border: 1px solid var(--rule);
  border-radius: 16px;
  text-align: center;
}

.contact-card__title {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--ink);
}

.contact-card__email {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  color: var(--gold-deep);
  text-decoration: none;
  font-weight: 700;
  display: inline-block;
  margin: 1rem 0;
}

.contact-card__email:hover {
  text-decoration: underline;
}

.contact-card__note {
  font-size: 0.9rem;
  color: var(--ink-muted);
  margin: 0.5rem 0 0;
}

/* ============================================================
   Legal-doc final-cta variant (smaller, for subpages)
   ============================================================ */

.subpage-cta {
  background: var(--navy);
  color: var(--cream);
  text-align: center;
  padding: clamp(3rem, 6vw, 5rem) 0;
}

.subpage-cta__title {
  color: var(--cream);
  font-size: clamp(1.875rem, 3.5vw, 2.5rem);
  margin-bottom: 1.25rem;
}

.subpage-cta__title em {
  color: var(--gold);
  font-style: italic;
}

.subpage-cta__sub {
  font-family: var(--font-serif);
  font-style: italic;
  color: rgba(245, 241, 232, 0.75);
  font-size: 1.05rem;
  margin-bottom: 2rem;
}
