/* =========================================================
   Aefir Labs — site styles
   Brand palette adopted from the existing Nera/Aefir identity:
     light green  #CFED97
     dark navy    #022B3B
     off-white    #F7F6F3
   Type: Space Grotesk (display) + Inter (text)
   ========================================================= */

:root {
  --navy:        #022B3B;
  --navy-800:    #0a3a4d;
  --navy-600:    #1d5063;
  --green:       #CFED97;
  --green-soft:  #E3F3C4;
  --green-deep:  #A9D96B;
  --cream:       #F7F6F3;
  --white:       #FFFFFF;
  --ink:         #10242d;
  --muted:       #5c6b70;
  --line:        #e7e5df;

  --radius-lg: 32px;
  --radius-md: 20px;
  --radius-sm: 12px;
  --radius-pill: 999px;

  --shadow-sm: 0 2px 10px rgba(2, 43, 59, 0.06);
  --shadow-md: 0 18px 50px rgba(2, 43, 59, 0.10);

  --maxw: 1200px;
  --gutter: clamp(20px, 5vw, 56px);

  --font-display: "Space Grotesk", "Helvetica Neue", Arial, sans-serif;
  --font-text: "Inter", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-text);
  color: var(--ink);
  background: var(--cream);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--navy);
  line-height: 1.08;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 0.4em;
}

h1 { font-size: clamp(2.4rem, 5.4vw, 4.4rem); }
h2 { font-size: clamp(1.9rem, 3.6vw, 3rem); }
h3 { font-size: clamp(1.25rem, 2vw, 1.6rem); }

p { margin: 0 0 1rem; }

a { color: var(--navy); text-decoration: none; }

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

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

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--navy-600);
  margin-bottom: 1rem;
}
.eyebrow::before {
  content: "";
  width: 22px; height: 2px;
  background: var(--green-deep);
  display: inline-block;
}

.lead { font-size: clamp(1.05rem, 1.5vw, 1.3rem); color: var(--muted); max-width: 62ch; }

.muted { color: var(--muted); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 26px;
  border-radius: var(--radius-pill);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.98rem;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: transform .18s ease, background .18s ease, color .18s ease, box-shadow .18s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--navy); color: var(--white); }
.btn-primary:hover { background: var(--navy-800); box-shadow: var(--shadow-md); }
.btn-ghost { background: transparent; color: var(--navy); border-color: rgba(2,43,59,.22); }
.btn-ghost:hover { border-color: var(--navy); background: var(--white); }
.btn-green { background: var(--green); color: var(--navy); }
.btn-green:hover { background: var(--green-deep); }
.btn .arrow { transition: transform .18s ease; }
.btn:hover .arrow { transform: translateX(3px); }

.textlink {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--navy);
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.textlink .arrow { transition: transform .18s ease; }
.textlink:hover .arrow { transform: translateX(4px); }

/* =========================================================
   Header / nav
   ========================================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  /* NOTE: no backdrop-filter here — a filtering ancestor clips absolutely
     positioned descendants (the nav dropdowns) in Safari/Chrome. */
  background: rgba(247, 246, 243, 0.96);
  border-bottom: 1px solid rgba(2,43,59,.06);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 76px;
}
.brand { display: inline-flex; align-items: center; gap: 12px; }
.brand svg { height: 34px; width: auto; display: block; }

.nav-menu {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--white);
  padding: 6px;
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-sm);
}
.nav-menu a {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.94rem;
  color: var(--navy);
  padding: 9px 16px;
  border-radius: var(--radius-pill);
  transition: background .15s ease, color .15s ease;
  white-space: nowrap;
}
.nav-menu > .nav-item > a { display: inline-flex; align-items: center; gap: 5px; }
.nav-menu a:hover { background: var(--green-soft); }
.nav-menu a.active { background: var(--navy); color: var(--white); }
.nav-menu .caret { opacity: .55; transition: transform .18s ease; }
.nav-item:hover > a .caret { transform: rotate(180deg); }

/* hover dropdowns exposing each page's sub-sections */
.nav-item { position: relative; display: inline-flex; }
.dropdown {
  display: block;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  padding-top: 14px;               /* transparent bridge so hover doesn't drop */
  min-width: 260px;
  opacity: 0; visibility: hidden;
  transition: opacity .16s ease, transform .16s ease;
  z-index: 70;
}
.dropdown-inner {
  display: block;                  /* it's a <span>; block so its bg paints as one panel */
  background: var(--white);
  border-radius: 18px;
  box-shadow: var(--shadow-md);
  padding: 8px;
  border: 1px solid rgba(2,43,59,.05);
}
.nav-item:hover .dropdown,
.nav-item:focus-within .dropdown {
  opacity: 1; visibility: visible;
  transform: translateX(-50%) translateY(0);
}
.dropdown a {
  display: block;
  padding: 10px 14px;
  border-radius: 12px;
  font-family: var(--font-text);
  font-weight: 500;
  font-size: .9rem;
  color: var(--navy);
  white-space: nowrap;
}
.dropdown a:hover { background: var(--green-soft); }

.nav-cta { display: inline-flex; align-items: center; gap: 12px; }

.nav-toggle {
  display: none;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  width: 46px; height: 46px;
  cursor: pointer;
  align-items: center; justify-content: center;
}
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
  content: ""; display: block; width: 20px; height: 2px; background: var(--navy);
  position: relative; transition: .2s;
}
.nav-toggle span::before { position: absolute; top: -6px; }
.nav-toggle span::after  { position: absolute; top: 6px; }

/* =========================================================
   Section rhythm
   ========================================================= */
section { position: relative; }
[id] { scroll-margin-top: 100px; }   /* keep anchor targets clear of the sticky header */
.section { padding-block: clamp(56px, 8vw, 110px); }
.section-tight { padding-block: clamp(40px, 5vw, 72px); }
.section-head { max-width: 70ch; margin-bottom: clamp(28px, 4vw, 52px); }
.section-head.center { margin-inline: auto; text-align: center; }

/* signature "tab" panel — the notched rounded panel from the identity */
.panel {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.tab-tag {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--green);
  color: var(--navy);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: .82rem;
  letter-spacing: .04em;
  padding: 8px 16px 8px 14px;
  border-radius: 12px 12px 12px 0;
}

/* =========================================================
   Hero
   ========================================================= */
.hero { padding-top: clamp(20px, 3vw, 40px); }
.hero-panel {
  position: relative;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(20px, 3vw, 40px);
  background: var(--green);
  border-radius: var(--radius-lg);
  padding: clamp(28px, 4vw, 64px);
  overflow: hidden;
}
.hero-copy { align-self: center; }
.hero-copy h1 { margin-bottom: 18px; }
.hero-copy .lead { color: var(--navy-800); opacity: .9; }
.hero-actions { display: flex; align-items: center; gap: 18px; margin-top: 30px; flex-wrap: wrap; }
.hero-visual {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  aspect-ratio: 1040 / 1333;
  align-self: center;
  box-shadow: var(--shadow-md);
}
.hero-visual img { width: 100%; height: 100%; object-fit: cover; }

/* Full-bleed sky hero (home) */
.hero-full {
  position: relative;
  min-height: clamp(520px, 78vh, 780px);
  display: flex;
  align-items: center;
  overflow: hidden;
  isolation: isolate;
}
.hero-full-bg {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center 45%;
  z-index: -2;
}
.hero-full::after {
  content: "";
  position: absolute; inset: 0;
  background:
    linear-gradient(90deg, rgba(2,43,59,.82) 0%, rgba(2,43,59,.55) 40%, rgba(2,43,59,.12) 72%, rgba(2,43,59,0) 100%),
    linear-gradient(0deg, rgba(2,43,59,.40) 0%, rgba(2,43,59,0) 45%);
  z-index: -1;
}
.hero-full-copy { max-width: 60ch; color: var(--white); padding: clamp(36px, 6vw, 72px) 0; }
.hero-full-copy h1 { color: var(--white); margin-bottom: 18px; }
.hero-full-copy .lead { color: rgba(255,255,255,.90); max-width: 56ch; }
.textlink-light { color: var(--white); }
.textlink-light:hover { color: var(--green); }

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 22px;
}
.stat { background: var(--white); border-radius: var(--radius-md); padding: 22px 24px; box-shadow: var(--shadow-sm); }
.stat .num { font-family: var(--font-display); font-weight: 600; font-size: clamp(1.7rem, 3vw, 2.4rem); color: var(--navy); }
.stat .lbl { font-size: .9rem; color: var(--muted); }

/* =========================================================
   Cards / grids
   ========================================================= */
.grid { display: grid; gap: clamp(18px, 2.4vw, 28px); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }

.card {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: clamp(24px, 2.4vw, 34px);
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(2,43,59,.04);
  transition: transform .2s ease, box-shadow .2s ease;
  height: 100%;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.card .icon {
  width: 52px; height: 52px; border-radius: 14px;
  background: var(--green-soft); color: var(--navy);
  display: grid; place-items: center; margin-bottom: 18px;
}
.card .icon svg { width: 26px; height: 26px; }
.card h3 { margin-bottom: 10px; }
.card p { color: var(--muted); margin-bottom: 16px; }
.card .num-badge {
  font-family: var(--font-display); font-weight: 600; color: var(--green-deep);
  font-size: .9rem; letter-spacing: .1em;
}

/* audience cards (For Who) */
.audience {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  min-height: 360px;
  display: flex;
  align-items: flex-end;
  color: var(--white);
  box-shadow: var(--shadow-sm);
}
.audience img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.audience::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(2,43,59,0) 25%, rgba(2,43,59,.85) 100%);
}
.audience .audience-body { position: relative; z-index: 2; padding: clamp(24px, 3vw, 38px); }
.audience h3 { color: var(--white); }
.audience p { color: rgba(255,255,255,.86); margin-bottom: 0; }

/* alternating feature rows */
.feature {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
}
.feature + .feature { margin-top: clamp(48px, 7vw, 96px); }
.feature .feature-media {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  aspect-ratio: 4/3;
}
.feature .feature-media img { width: 100%; height: 100%; object-fit: cover; }
.feature.reverse .feature-media { order: -1; }
.checklist { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 12px; }
.checklist li { position: relative; padding-left: 34px; color: var(--ink); }
.checklist li::before {
  content: ""; position: absolute; left: 0; top: 3px;
  width: 22px; height: 22px; border-radius: 7px; background: var(--green);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23022B3B' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: center;
}

/* =========================================================
   Vision / manifesto band
   ========================================================= */
.vision {
  background: var(--navy);
  color: var(--cream);
  border-radius: var(--radius-lg);
  padding: clamp(36px, 6vw, 88px);
}
.vision h2 { color: var(--white); max-width: 20ch; }
.vision .big {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.5rem, 3vw, 2.4rem);
  line-height: 1.25;
  color: var(--white);
  letter-spacing: -0.01em;
  max-width: 24ch;
}
.vision .big em { color: var(--green); font-style: normal; }
.vision p { color: rgba(247,246,243,.75); }

/* =========================================================
   Cases
   ========================================================= */
.case {
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
}
.case + .case { margin-top: clamp(24px, 3vw, 40px); }
.case.reverse { grid-template-columns: 1.1fr 0.9fr; }
.case.reverse .case-media { order: 2; }
.case-media { position: relative; min-height: 320px; }
.case-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.case-body { padding: clamp(28px, 3.4vw, 52px); }
.case-metrics { display: flex; gap: 28px; flex-wrap: wrap; margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--line); }
.case-metric .num { font-family: var(--font-display); font-weight: 600; font-size: 1.8rem; color: var(--navy); }
.case-metric .lbl { font-size: .82rem; color: var(--muted); }

/* =========================================================
   News
   ========================================================= */
.post {
  background: var(--white);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column;
  transition: transform .2s ease, box-shadow .2s ease;
}
.post:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.post-media { aspect-ratio: 16/10; overflow: hidden; }
.post-media img { width: 100%; height: 100%; object-fit: cover; }
.post-body { padding: 26px 28px 30px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.post .meta { font-size: .82rem; color: var(--muted); font-family: var(--font-display); letter-spacing: .04em; }
.post h3 { margin: 0; }
.tag {
  display: inline-block; font-family: var(--font-display); font-size: .72rem; font-weight: 600;
  letter-spacing: .1em; text-transform: uppercase; color: var(--navy);
  background: var(--green); padding: 5px 12px; border-radius: var(--radius-pill); width: max-content;
}

/* =========================================================
   Team / people
   ========================================================= */
.team-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.member {
  background: var(--white); border-radius: var(--radius-md); overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column;
}
.member .ph {
  position: relative; overflow: hidden;
  aspect-ratio: 1/1; background: var(--green-soft);
  font-family: var(--font-display); font-weight: 600; font-size: 2rem; color: var(--navy);
  display: grid; place-items: center;
}
.member .ph img {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover; object-position: center top;
}
.member .info {
  flex: 1;
  display: flex; flex-direction: column; justify-content: center;
  padding: 18px 20px 22px;
}
.member .info strong { display: block; font-family: var(--font-display); color: var(--navy); }
.member .info span { font-size: .88rem; color: var(--muted); }

/* =========================================================
   Contact
   ========================================================= */
.contact-grid { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: clamp(24px, 4vw, 56px); align-items: start; }
.field { margin-bottom: 16px; }
.field label { display: block; font-family: var(--font-display); font-weight: 500; font-size: .9rem; margin-bottom: 6px; color: var(--navy); }
.field input, .field textarea {
  width: 100%; padding: 13px 16px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  font-family: var(--font-text); font-size: 1rem; background: var(--white); color: var(--ink);
}
.field input:focus, .field textarea:focus { outline: 2px solid var(--green-deep); border-color: transparent; }
.contact-info li { list-style: none; }
.contact-info ul { padding: 0; margin: 0; display: grid; gap: 20px; }
.contact-info .k { font-family: var(--font-display); font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.contact-info .v { font-size: 1.15rem; color: var(--navy); font-family: var(--font-display); }

/* =========================================================
   CTA band
   ========================================================= */
.cta-band {
  background: var(--green);
  border-radius: var(--radius-lg);
  padding: clamp(36px, 5vw, 72px);
  display: flex; align-items: center; justify-content: space-between; gap: 30px; flex-wrap: wrap;
}
.cta-band h2 { max-width: 18ch; margin: 0; }

/* =========================================================
   Page hero (interior pages)
   ========================================================= */
.page-hero { padding-top: clamp(40px, 6vw, 84px); padding-bottom: clamp(20px, 3vw, 36px); }
.page-hero .lead { margin-top: 8px; }

/* =========================================================
   Footer
   ========================================================= */
.site-footer { background: var(--navy); color: var(--cream); margin-top: clamp(48px, 7vw, 96px); }
.footer-top { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 36px; padding-block: clamp(48px, 6vw, 76px); }
.site-footer .brand svg .wordmark { fill: var(--cream); }
.footer-col h4 { color: var(--white); font-size: 1rem; margin-bottom: 16px; }
.footer-col a, .footer-col p { color: rgba(247,246,243,.72); display: block; margin-bottom: 10px; font-size: .95rem; }
.footer-col a:hover { color: var(--green); }
.footer-blurb { color: rgba(247,246,243,.72); max-width: 34ch; margin-top: 18px; }
.footer-bottom { border-top: 1px solid rgba(247,246,243,.12); padding-block: 22px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: .86rem; color: rgba(247,246,243,.6); }

/* =========================================================
   Reveal on scroll
   ========================================================= */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 960px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .team-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-panel { grid-template-columns: 1fr; }
  .feature, .case, .case.reverse, .contact-grid { grid-template-columns: 1fr; }
  .feature.reverse .feature-media { order: 0; }
  .case .case-media, .case.reverse .case-media { order: -1; min-height: 240px; }
  .footer-top { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .nav-menu { display: none; }
  .nav-menu.open {
    display: flex; flex-direction: column; align-items: stretch;
    position: absolute; top: 72px; left: var(--gutter); right: var(--gutter);
    padding: 12px; border-radius: var(--radius-md); gap: 4px;
    max-height: calc(100vh - 96px); overflow-y: auto;
  }
  .nav-menu.open .nav-item { display: block; }
  .nav-menu.open .nav-item > a { padding: 12px 16px; justify-content: space-between; }
  /* submenus render inline and expand on tap */
  .nav-menu.open .dropdown {
    position: static; transform: none; padding-top: 0; min-width: 0;
    opacity: 1; visibility: visible; display: none;
  }
  .nav-menu.open .nav-item.expanded > a .caret { transform: rotate(180deg); }
  .nav-menu.open .nav-item.expanded .dropdown { display: block; }
  .nav-menu.open .dropdown-inner { box-shadow: none; border: 0; background: transparent; padding: 0 0 6px 10px; }
  .nav-menu.open .dropdown a { padding: 9px 14px; font-size: .88rem; color: var(--muted); }
  .nav-toggle { display: inline-flex; }
  .nav-cta .btn { display: none; }
}
@media (max-width: 560px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .hero-stats { grid-template-columns: 1fr; }
  .team-grid { grid-template-columns: 1fr; }
  .cta-band { flex-direction: column; align-items: flex-start; }
}
