/* ============================================================
   AMARIMA — shared styles

   Two register-worlds live in this file:

   1. The HOMEPAGE (body.home) is the dark-first Riflebird world —
      deep velvet canvas with a live flock, teal/violet iridescence.
      That world is defined by the default tokens in :root.

   2. THE INNER PAGES (body:not(.home) — about / research / contact
      and any report) use a DAY-INSPIRED theme — warm cream ground
      with dark type and a whisper of the day-stage sky at the
      edges. Readable first. Cohesive with the homepage's day (§1)
      palette: the cyan top / cream mid / red bottom you see during
      the opening flock stage.

   The two worlds share type tokens, the teal accent (brand color,
   logo dot), the site header / footer scaffolding — just with
   different ink + surface colors.
   ============================================================ */

:root {
  /* DEFAULT (dark / Riflebird) TOKENS — used by body.home.
     The homepage's inline stylesheet mostly overrides these for
     the stages; these values still serve the header, footer, and
     any legacy dark contexts. */
  --velvet:          #0C0C10;
  --velvet-surface:  #0F1018;
  --velvet-card:     #111319;

  --filtered:        #ECF2F0;
  --reflected:       #B8D8D0;
  --muted:           rgba(184, 216, 208, 0.55);
  --faint:           rgba(184, 216, 208, 0.24);

  --teal-flash:      #20B8A0;
  --deep-teal:       #187080;
  --shifting-violet: #7848B0;
  --deep-purple:     #4828A0;

  --border:          rgba(32, 184, 160, 0.10);
  --border-strong:   rgba(32, 184, 160, 0.30);
  --glow-teal:       rgba(32, 184, 160, 0.18);
  --glow-violet:     rgba(120, 72, 176, 0.16);

  --bg-deep:         #0C0C10;
  --bg-surface:      #0F1018;
  --bg-card:         #111319;
  --text-primary:    #ECF2F0;
  --text-body:       rgba(184, 216, 208, 0.82);
  --text-muted:      rgba(184, 216, 208, 0.45);
  --text-faint:      rgba(184, 216, 208, 0.22);
  --accent-blue:     #20B8A0;
  --accent-glow:     #7848B0;
  --accent-warm:     #20B8A0;
  --border-warm:     rgba(32, 184, 160, 0.15);

  --serif: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --sans:  'Helvetica Neue', Helvetica, Arial, sans-serif;

  /* Type scale */
  --type-display:    clamp(56px, 13vw, 180px);
  --type-headline:   clamp(32px, 6vw, 84px);
  --type-body:       16px;
  --type-label:      14px;
  --type-caption:    11px;

  --fw-light:        300;
  --fw-regular:      400;
  --fw-medium:       500;

  --ls-display:     -0.02em;
  --ls-headline:    -0.015em;
  --ls-normal:       0;
  --ls-caption:      0.22em;
  --ls-atmospheric:  0.4em;

  --lh-display:  0.9;
  --lh-headline: 1.1;
  --lh-body:     1.6;
  --lh-caption:  1.4;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html {
  /* Default to the inner-page grey (§1 day-sky mid band #E3E3E3).
     The homepage's inline stylesheet overrides this to #0C0C10 via
     `html, body.home { background: ... }`, so the dark hero still
     reads dark in safe-area / overscroll regions. */
  background: #E3E3E3;
  color: var(--text-primary);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  font-size: 16px;
  line-height: 1.7;
  letter-spacing: 0.015em;
  background: var(--bg-deep);
  color: var(--text-body);
  min-height: 100vh;
  overflow-x: clip;
}

/* ============================================================
   INNER PAGES — "day-stage" theme
   ============================================================
   The background IS the §1 day sky, laid flat across the
   document: solid cyan at the very top of the page, grey
   through the middle (the §1 mid band #E3E3E3), solid red
   at the very bottom. The cyan and red are anchored to the
   actual top/bottom of the document (position: absolute on
   body::before / body::after), not fixed to viewport — so
   once the reader has scrolled 60vh down the page, the cyan
   is gone; only grey. Same at the bottom.

   Two-color accent system stays from the previous (rose)
   iteration:
     --teal-flash  (literal)  logo dot + section-head marker
     --accent-blue (rose)     links, CTAs, callouts, hover glow
   Ink is the day-masthead near-black #1A1020.              */
body:not(.home) {
  /* Position relative so ::before / ::after absolute bands
     anchor to the document, not the viewport. */
  position: relative;

  /* Day-sky grey — the §1 mid band becomes the reading ground */
  --bg-deep:         #E3E3E3;
  --bg-surface:      #D8D8D8;
  --bg-card:         #D0D0D0;

  /* Near-black ink — from the §1 masthead */
  --text-primary:    #1A1020;
  --text-body:       rgba(26, 16, 32, 0.80);
  --text-muted:      rgba(26, 16, 32, 0.52);
  --text-faint:      rgba(26, 16, 32, 0.30);

  /* Teal stays as a literal brand color for the dot markers */
  --teal-flash:      #20B8A0;
  --deep-teal:       #147A6B;
  --shifting-violet: #7848B0;
  --deep-purple:     #4828A0;

  /* Rose accent for everything interactive */
  --accent-blue:     #D73A5C;
  --accent-glow:     #A82943;
  --accent-warm:     #D73A5C;
  --border-warm:     rgba(215, 58, 92, 0.26);

  --border:          rgba(26, 16, 32, 0.14);
  --border-strong:   rgba(215, 58, 92, 0.42);
  --glow-teal:       rgba(215, 58, 92, 0.24);
  --glow-violet:     rgba(120, 72, 176, 0.18);
}

body:not(.home) {
  background: var(--bg-deep);
  color: var(--text-primary);
  /* Sticky footer: main grows to fill, footer pins to document bottom */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
body:not(.home) main { flex: 1 0 auto; }
body:not(.home) > .site-footer { flex-shrink: 0; }

/* Mint-cyan gradient at the top of inner pages — mimics the
   homepage §1 day-sky cyan-to-grey fade. Anchored to the ACTUAL
   top of the document (position: absolute), so scrolling past it
   leaves it behind. The footer carries a solid dusty-rose below. */
body:not(.home)::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 60vh;
  pointer-events: none;
  z-index: 0;
  background:
    linear-gradient(180deg,
      #A6E3DC 0%,
      rgba(166, 227, 220, 0.7) 30%,
      rgba(166, 227, 220, 0.3) 65%,
      transparent 100%);
}

/* Ensure main + footer render ABOVE the gradient bands.
   The site-header is already position:fixed z:100 (main.css
   defaults) so it's above everything naturally. */
body:not(.home) main,
body:not(.home) > .site-footer {
  position: relative;
  z-index: 1;
}

/* Typography */
h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  line-height: 1.15;
}

h1 { font-size: clamp(36px, 6vw, 64px); }
h2 { font-size: clamp(28px, 4vw, 44px); }
h3 { font-size: clamp(20px, 2.5vw, 28px); }

p { color: var(--text-body); }

a {
  color: var(--accent-blue);
  text-decoration: none;
  transition: color 0.3s ease, opacity 0.3s ease;
}
a:hover { color: var(--accent-glow); }

.label {
  font-size: 10px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* Container */
.wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem;
  position: relative;
  z-index: 1;
}
.wrap-narrow {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 2rem;
  position: relative;
  z-index: 1;
}

/* ============================================================
   Site header
   ============================================================ */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  padding: 1.5rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 100;
  background: transparent;
  border: none;
  mix-blend-mode: difference;
  opacity: 0;
  animation: fadeInHeader 1.2s ease 0.35s forwards;
}
@keyframes fadeInHeader {
  to { opacity: 1; }
}
/* Inner pages: header sits transparent over the mint-cyan
   gradient band (body::before). No mix-blend-mode — dark text
   reads cleanly against the pastel cyan top. */
body:not(.home) .site-header {
  background: transparent;
  mix-blend-mode: normal;
}
body:not(.home) .site-header .logo { color: #1A1020; }
body:not(.home) .site-header .logo .logo-sub { opacity: 0.55; }
body:not(.home) .site-nav a { color: rgba(26, 16, 32, 0.65); }
body:not(.home) .site-nav a.current { color: #1A1020; }
body:not(.home) .site-nav a:hover { color: #147A6B; }
/* Logo — unified across home and inner pages: 14px uppercase
   tracked, weight 500. AMARIMA in primary text color; "Research"
   in a lighter weight / muted tone via .logo-sub so the wordmark
   reads as a two-tier title. Matches the homepage pattern Vitor
   approved. */
.site-header .logo {
  font-family: var(--sans);
  font-size: var(--type-label);     /* 14px */
  letter-spacing: var(--ls-caption); /* 0.22em */
  text-transform: uppercase;
  font-weight: var(--fw-medium);     /* 500 */
  color: #F4F7F2;
  text-decoration: none;
}
.site-header .logo .logo-sub {
  font-weight: var(--fw-regular);   /* 400 */
  opacity: 0.65;
  margin-left: 0.15em;
}
.site-header .logo .dot {
  display: inline-block;
  width: 6px; height: 6px;
  background: var(--teal-flash);
  border-radius: 50%;
  margin-right: 0.8em;
  vertical-align: middle;
  box-shadow: 0 0 12px rgba(32, 184, 160, 0.7);
}

/* Nav — same tracked-caption register as the logo, slightly
   smaller. Matches the homepage pattern. */
.site-nav {
  display: flex;
  gap: 2rem;
  font-size: var(--type-caption);    /* 11px */
  letter-spacing: var(--ls-caption); /* 0.22em */
  text-transform: uppercase;
}
.site-nav a {
  color: rgba(244, 247, 242, 0.85);
  text-decoration: none;
  transition: color 0.3s ease;
}
.site-nav a.current { color: #F4F7F2; }
.site-nav a:hover { color: #20B8A0; }

.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  letter-spacing: 4px;
}

@media (max-width: 720px) {
  .site-nav { display: none; }
  .mobile-menu-toggle { display: block; }
  .site-nav.open {
    display: flex;
    position: fixed;
    inset: 0;
    background: var(--bg-deep);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 3rem;
    z-index: 200;
    font-size: 16px;
  }
  /* Close control wired in js/mobile-nav.js. ESC, overlay click,
     and any link click all dismiss the overlay. Visual × marker
     sits top-right as affordance. */
  .site-nav.open::before {
    content: '×';
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 32px;
    line-height: 1;
    color: var(--text-primary);
    pointer-events: none;
  }
}

/* ============================================================
   Site footer — UNIFIED across all pages
   ============================================================
   Dark (night) register on every page, regardless of body
   class. On inner pages this sits below the red bottom-band
   gradient, so the visible arc reads: grey reading → red
   wash → dark footer. Cinematic continuation of the homepage's
   day→night story.
*/
.site-footer {
  background: #000000;
  color: rgba(232, 216, 245, 0.55);
  padding: 2.5rem 2rem 2.25rem;
  border-top: 1px solid rgba(232, 216, 245, 0.08);
  position: relative;
  z-index: 1;
}
/* Inner pages: footer carries the SOLID dusty-rose bottom band —
   no gradient. Near-black text for contrast. */
body:not(.home) .site-footer {
  background: #E6B7B7;
  color: rgba(26, 16, 32, 0.72);
  border-top-color: rgba(26, 16, 32, 0.18);
}
body:not(.home) .site-footer .brand { color: #1A1020; }
body:not(.home) .site-footer .parent-note { color: rgba(26, 16, 32, 0.72); }
body:not(.home) .site-footer .parent-sub { color: rgba(26, 16, 32, 0.88); }
body:not(.home) .site-footer .footer-founder { color: rgba(26, 16, 32, 0.92); }
body:not(.home) .site-footer .founder-label { color: rgba(26, 16, 32, 0.55); }
body:not(.home) .site-footer .footer-email { color: #1A1020; }
body:not(.home) .site-footer .footer-email:hover {
  color: rgba(26, 16, 32, 0.7);
  border-bottom-color: rgba(26, 16, 32, 0.7);
}
body:not(.home) .site-footer .contact-cta {
  color: #1A1020;
  border-color: rgba(26, 16, 32, 0.45);
}
body:not(.home) .site-footer .contact-cta:hover {
  background: rgba(26, 16, 32, 0.08);
  border-color: #1A1020;
  color: #1A1020;
  box-shadow: none;
}
.site-footer .wrap {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 2rem;
}
.site-footer .brand-stack {
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
}
.site-footer .brand-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.site-footer .brand {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #E8D8F5;
  line-height: 1;
}
.site-footer .parent-note {
  font-size: 13px;
  font-weight: 300;
  line-height: 1.4;
  letter-spacing: 0.01em;
  color: rgba(232, 216, 245, 0.62);
  margin: 0;
  text-transform: none;
}
.site-footer .parent-sub {
  color: rgba(232, 216, 245, 0.82);
  font-style: normal;
  font-size: 14px;
  font-weight: 400;
}
.site-footer .footer-founder {
  margin: 0;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0.01em;
  color: rgba(232, 216, 245, 0.92);
  line-height: 1.3;
  text-transform: none;
}
/* Founder label stacks ABOVE the name on its own line — clearer
   label→value hierarchy than the inline prefix it used to be. */
.site-footer .founder-label {
  display: block;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: rgba(232, 216, 245, 0.5);
  margin: 0 0 0.35rem;
  line-height: 1;
}
.site-footer .footer-email {
  font-size: 14px;
  font-weight: 400;
  color: rgba(232, 216, 245, 0.92);
  letter-spacing: 0.01em;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
  transition: color 0.3s ease, border-color 0.3s ease;
}
.site-footer .footer-email:hover {
  color: #B88CFF;
  border-bottom-color: #B88CFF;
}

/* CTA pill — matches §4 night pill-cta */
.site-footer .contact-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 2.4rem;
  background: transparent;
  color: #E8D8F5;
  border: 1px solid rgba(232, 216, 245, 0.5);
  font-size: var(--type-caption);
  letter-spacing: var(--ls-caption);
  text-transform: uppercase;
  border-radius: 100px;
  text-decoration: none;
  transition: all 0.4s ease;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.site-footer .contact-cta:hover {
  background: rgba(176, 140, 240, 0.15);
  border-color: #B88CFF;
  color: #F4F7F2;
  box-shadow: 0 0 48px rgba(176, 140, 240, 0.35);
}
