/* ==========================================================================
   FLYBYGRAVITY : The framework for brand attraction
   Premium academic dark theme. Single stylesheet, no dependencies.
   ========================================================================== */

:root {
  --navy:    #07111F;  /* Deep Space Navy : dominant background */
  --blue:    #0D2A4D;  /* Gravity Blue : panels and cards */
  --cyan:    #38D5C8;  /* Signal Cyan : motion lines, highlights, links */
  --ice:     #EEF7F8;  /* Soft Ice : primary text */
  --steel:   #8FA3AD;  /* Muted Steel : secondary text */
  --gold:    #D6A84F;  /* Orbit Gold : trust and authority points, sparing */
  --violet:  #4D3A78;  /* Field Violet : atmospheric depth */

  --blue-2:  #102E54;
  --line:    rgba(143, 163, 173, 0.18);
  --line-2:  rgba(143, 163, 173, 0.30);
  --ice-dim: rgba(238, 247, 248, 0.78);

  --font-head: "Playfair Display", Georgia, "Times New Roman", serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --maxw: 1140px;
  --radius: 10px;
  --pad: clamp(1.25rem, 4vw, 2rem);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--navy);
  color: var(--ice);
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.7;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.01em;
  margin: 0 0 0.6em;
  color: var(--ice);
}

p { margin: 0 0 1.1rem; color: var(--ice-dim); }
p:last-child { margin-bottom: 0; }

a { color: var(--cyan); text-decoration: none; transition: color .18s ease; }
a:hover { color: #6fe6db; }

strong { color: var(--ice); font-weight: 600; }

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

ul, ol { color: var(--ice-dim); }

::selection { background: rgba(56, 213, 200, 0.28); color: var(--ice); }

/* ---- Layout helpers ---- */

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

.section { padding-block: clamp(3.5rem, 8vw, 6rem); position: relative; }
.section--tight { padding-block: clamp(2.5rem, 6vw, 4rem); }
.section--panel { background: linear-gradient(180deg, rgba(13, 42, 77, 0.55), rgba(13, 42, 77, 0.18)); border-block: 1px solid var(--line); }

.eyebrow {
  font-family: var(--font-body);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--cyan);
  margin: 0 0 1rem;
}
.eyebrow--gold { color: var(--gold); }

.lede { font-size: 1.2rem; color: var(--ice); max-width: 62ch; }

.section-title { font-size: clamp(1.7rem, 4vw, 2.5rem); max-width: 22ch; }

.measure { max-width: 68ch; }

/* ---- Skip link ---- */
.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 200;
  background: var(--cyan); color: var(--navy); padding: 0.7rem 1.1rem;
  border-radius: 0 0 8px 0; font-weight: 600;
}
.skip-link:focus { left: 0; }

/* ---- Focus ---- */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ==========================================================================
   HEADER
   ========================================================================== */

.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(7, 17, 31, 0.82);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  max-width: var(--maxw); margin-inline: auto; padding: 0.85rem var(--pad);
  display: flex; align-items: center; gap: 1.5rem;
}

.brand { display: inline-flex; align-items: center; gap: 0.6rem; flex-shrink: 0; }
.brand:hover { color: var(--ice); }
.brand-mark { width: 30px; height: 30px; flex-shrink: 0; }
.brand-text {
  font-family: var(--font-body);
  font-weight: 700;
  letter-spacing: 0.16em;
  font-size: 0.95rem;
  color: var(--ice);
}
.brand-text b { color: var(--cyan); font-weight: 700; }

.primary-nav { display: flex; gap: 1.6rem; margin-left: auto; }
.primary-nav a {
  color: var(--steel); font-size: 0.92rem; font-weight: 500; font-family: var(--font-body);
  padding-block: 0.4rem; position: relative;
}
.primary-nav a:hover, .primary-nav a[aria-current="page"] { color: var(--ice); }
.primary-nav a[aria-current="page"]::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px;
  background: var(--cyan); border-radius: 2px;
}

.header-cta { flex-shrink: 0; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--font-body); font-weight: 600; font-size: 0.92rem;
  padding: 0.7rem 1.3rem; border-radius: 8px; cursor: pointer;
  border: 1px solid transparent; transition: transform .15s ease, background .18s ease, border-color .18s ease, color .18s ease;
  white-space: nowrap; line-height: 1;
}
.btn-cta { background: var(--cyan); color: var(--navy); }
.btn-cta:hover { background: #5fe2d6; color: var(--navy); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--ice); border-color: var(--line-2); }
.btn-ghost:hover { border-color: var(--cyan); color: var(--cyan); transform: translateY(-1px); }
.btn-lg { padding: 0.95rem 1.7rem; font-size: 1rem; }

/* Hamburger */
.nav-toggle {
  display: none; margin-left: auto; width: 44px; height: 44px; padding: 10px;
  background: transparent; border: 1px solid var(--line-2); border-radius: 8px;
  flex-direction: column; justify-content: center; gap: 5px; cursor: pointer;
}
.nav-toggle span { display: block; height: 2px; width: 100%; background: var(--ice); border-radius: 2px; transition: .2s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile nav */
.mobile-nav {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(7, 17, 31, 0.97);
  backdrop-filter: blur(8px);
  padding: 6rem var(--pad) 2rem;
  overflow-y: auto;
}
.mobile-nav[hidden] { display: none; }
.mobile-nav nav { display: flex; flex-direction: column; gap: 0.4rem; max-width: 420px; margin-inline: auto; }
.mobile-nav nav a {
  color: var(--ice); font-family: var(--font-head); font-size: 1.5rem; font-weight: 600;
  padding: 0.7rem 0; border-bottom: 1px solid var(--line);
}
.mobile-nav .btn { margin-top: 1.5rem; justify-content: center; font-family: var(--font-body); font-size: 1rem; }

/* ==========================================================================
   HERO
   ========================================================================== */

.hero { position: relative; padding-block: clamp(3.5rem, 9vw, 7rem); overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(60% 55% at 72% 28%, rgba(77, 58, 120, 0.30), transparent 70%),
    radial-gradient(45% 45% at 18% 80%, rgba(13, 42, 77, 0.55), transparent 75%);
}
.hero-grid {
  display: grid; grid-template-columns: 1.05fr 0.95fr; gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}
.hero h1 { font-size: clamp(2.4rem, 6.5vw, 4.1rem); margin-bottom: 0.5em; }
.hero .lede { margin-bottom: 1.6rem; }
.hero-support {
  font-family: var(--font-head); font-style: italic; font-size: 1.15rem;
  color: var(--cyan); margin: 1.8rem 0 0; padding-left: 1.1rem;
  border-left: 2px solid var(--cyan);
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 2rem; }
.hero-art { position: relative; }

/* ==========================================================================
   GRIDS + CARDS
   ========================================================================== */

.grid { display: grid; gap: 1.5rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }

.card {
  background: linear-gradient(180deg, rgba(13, 42, 77, 0.6), rgba(13, 42, 77, 0.28));
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: clamp(1.4rem, 3vw, 1.9rem);
}
.card h3 { font-size: 1.4rem; margin-bottom: 0.5rem; }
.card .card-index {
  font-family: var(--font-body); font-weight: 700; font-size: 0.8rem; letter-spacing: 0.15em;
  color: var(--cyan); display: block; margin-bottom: 0.6rem;
}
.card--gold { border-color: rgba(214, 168, 79, 0.4); }
.card--gold .card-index { color: var(--gold); }

/* Split: text + art */
.split {
  display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}
.split--reverse .split-art { order: -1; }

/* Numbered factor list */
.factors { display: grid; gap: 1.1rem; counter-reset: f; }
.factor {
  display: grid; grid-template-columns: auto 1fr; gap: 1.1rem; align-items: start;
  padding: 1.3rem 1.5rem; border: 1px solid var(--line); border-radius: var(--radius);
  background: rgba(13, 42, 77, 0.32);
}
.factor-num {
  font-family: var(--font-head); font-size: 1.5rem; font-weight: 600;
  color: var(--gold); line-height: 1; min-width: 1.4ch;
}
.factor h3 { font-size: 1.25rem; margin-bottom: 0.3rem; }
.factor p { margin: 0; }

/* Definition callout */
.definition {
  border: 1px solid rgba(56, 213, 200, 0.35);
  border-left: 3px solid var(--cyan);
  background: rgba(56, 213, 200, 0.06);
  border-radius: var(--radius);
  padding: clamp(1.5rem, 4vw, 2.2rem);
}
.definition p { font-family: var(--font-head); font-size: clamp(1.2rem, 2.6vw, 1.55rem); color: var(--ice); line-height: 1.45; font-style: italic; }

/* Thesis band */
.thesis {
  text-align: center; padding-block: clamp(3rem, 7vw, 5rem);
  background: radial-gradient(70% 120% at 50% 0%, rgba(77, 58, 120, 0.28), transparent 70%);
  border-block: 1px solid var(--line);
}
.thesis p { font-family: var(--font-head); font-size: clamp(1.6rem, 4.5vw, 2.6rem); color: var(--ice); max-width: 18ch; margin-inline: auto; line-height: 1.2; }
.thesis p b { color: var(--cyan); font-weight: 600; }

/* Comparison rows */
.compare { display: grid; gap: 1.25rem; }
.compare-row {
  display: grid; grid-template-columns: 12rem 1fr; gap: 1.5rem; align-items: baseline;
  padding-bottom: 1.25rem; border-bottom: 1px solid var(--line);
}
.compare-row:last-child { border-bottom: 0; }
.compare-term { font-family: var(--font-head); font-size: 1.3rem; color: var(--ice); }
.compare-term span { display: block; font-family: var(--font-body); font-size: 0.78rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--steel); margin-top: 0.2rem; font-weight: 600; }

/* CTA band */
.cta-band {
  text-align: center;
  background: linear-gradient(180deg, rgba(13, 42, 77, 0.7), rgba(7, 17, 31, 0.2));
  border: 1px solid var(--line); border-radius: 14px;
  padding: clamp(2.5rem, 6vw, 4rem);
}
.cta-band h2 { font-size: clamp(1.8rem, 4.5vw, 2.7rem); }
.cta-band .actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 1rem; margin-top: 1.8rem; }

/* Two-tier ecosystem CTA band */
.cta-band--eco .cta-sub { color: var(--steel); font-size: 0.95rem; margin-top: 1.4rem; max-width: 52ch; margin-inline: auto; }

/* Page hero (interior pages) */
.page-hero { padding-block: clamp(3rem, 7vw, 5rem) clamp(1.5rem, 4vw, 2.5rem); position: relative; }
.page-hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(50% 60% at 80% 20%, rgba(77, 58, 120, 0.22), transparent 70%);
}
.page-hero h1 { font-size: clamp(2.1rem, 5.5vw, 3.4rem); max-width: 18ch; }
.breadcrumbs { font-size: 0.82rem; color: var(--steel); margin-bottom: 1rem; }
.breadcrumbs a { color: var(--steel); }
.breadcrumbs a:hover { color: var(--cyan); }
.breadcrumbs span { margin-inline: 0.4rem; opacity: 0.5; }

/* Prose blocks for article pages */
.prose h2 { font-size: clamp(1.5rem, 3.5vw, 2.1rem); margin-top: 2.6rem; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-size: 1.3rem; margin-top: 1.8rem; }
.prose ul { padding-left: 1.2rem; }
.prose li { margin-bottom: 0.5rem; }
.section-num {
  font-family: var(--font-body); font-size: 0.8rem; font-weight: 700; letter-spacing: 0.18em;
  color: var(--gold); display: block; margin-bottom: 0.3rem;
}

/* ==========================================================================
   PRINCIPLES : complete-system components
   ========================================================================== */

/* Expanded principle blocks */
.principles-deep { display: grid; gap: 0; }
.principle {
  padding: clamp(1.6rem, 3.5vw, 2.4rem) 0;
  border-bottom: 1px solid var(--line);
}
.principle:first-child { padding-top: 0; }
.principle:last-child { border-bottom: 0; padding-bottom: 0; }
.principle-head { display: flex; align-items: baseline; gap: 1.1rem; margin-bottom: 0.9rem; }
.principle-num {
  font-family: var(--font-head); font-size: clamp(1.6rem, 4vw, 2.2rem); font-weight: 600;
  color: var(--gold); line-height: 1; min-width: 1.6ch;
}
.principle-head h3 { margin: 0; font-size: clamp(1.35rem, 3vw, 1.7rem); }
.principle p { max-width: 66ch; }
.principle-takeaway {
  font-family: var(--font-head); font-style: italic; font-size: 1.1rem;
  color: var(--cyan); margin: 0.4rem 0 0; padding-left: 1rem;
  border-left: 2px solid var(--cyan); max-width: 66ch;
}

/* Journey table : phase-by-phase, push approach vs brand gravity */
.journey {
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  margin-top: 2.5rem;
}
.journey-row { display: grid; grid-template-columns: 0.85fr 1fr 1.25fr; }
.journey-row + .journey-row { border-top: 1px solid var(--line); }
.journey-head { background: rgba(13, 42, 77, 0.55); }
.journey-cell { padding: 1.05rem 1.25rem; }
.journey-cell + .journey-cell { border-left: 1px solid var(--line); }
.journey-head .journey-cell {
  font-family: var(--font-body); font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--steel);
}
.journey-phase { font-family: var(--font-head); font-size: 1.08rem; color: var(--ice); }
.journey-old { color: var(--steel); font-size: 0.94rem; }
.journey-new { color: var(--ice-dim); font-size: 0.94rem; }
.journey-row:nth-child(even of :not(.journey-head)) { background: rgba(13, 42, 77, 0.16); }

@media (max-width: 760px) {
  .journey-row { grid-template-columns: 1fr; }
  .journey-cell + .journey-cell { border-left: 0; border-top: 1px solid var(--line); }
  .journey-head { display: none; }
  .journey-cell.journey-old::before { content: "Push approach: "; color: var(--gold); font-weight: 600; }
  .journey-cell.journey-new::before { content: "Under gravity: "; color: var(--cyan); font-weight: 600; }
}

/* ==========================================================================
   FORM
   ========================================================================== */

.form { max-width: 540px; }
.form-row { margin-bottom: 1.2rem; }
.form-row label {
  display: block; font-size: 0.76rem; font-weight: 600; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--steel); margin-bottom: 0.45rem;
}
.form-row input, .form-row textarea {
  width: 100%; padding: 0.8rem 0.95rem; font: inherit; font-size: 1rem;
  background: rgba(7, 17, 31, 0.6); color: var(--ice);
  border: 1px solid var(--line-2); border-radius: 8px;
}
.form-row input::placeholder, .form-row textarea::placeholder { color: rgba(143, 163, 173, 0.6); }
.form-row input:focus, .form-row textarea:focus { border-color: var(--cyan); }
.form-row textarea { resize: vertical; min-height: 120px; }
.form-status { display: none; margin-top: 1rem; font-size: 0.95rem; padding: 0.8rem 1rem; border-radius: 8px; }
.form-status.is-ok { display: block; background: rgba(56, 213, 200, 0.12); color: var(--cyan); border: 1px solid rgba(56, 213, 200, 0.4); }
.form-status.is-err { display: block; background: rgba(214, 168, 79, 0.12); color: var(--gold); border: 1px solid rgba(214, 168, 79, 0.4); }

/* ==========================================================================
   FOOTER
   ========================================================================== */

.site-footer {
  border-top: 1px solid var(--line);
  background: rgba(13, 42, 77, 0.22);
  padding-block: clamp(3rem, 6vw, 4.5rem) 2rem;
}
.footer-inner {
  max-width: var(--maxw); margin-inline: auto; padding-inline: var(--pad);
  display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr 1fr; gap: clamp(1.6rem, 3.5vw, 2.6rem);
}
.footer-brand .brand-text { font-size: 1.05rem; }
.footer-def { font-size: 0.92rem; margin-top: 1rem; color: var(--steel); max-width: 42ch; }
.footer-col h4 {
  font-family: var(--font-body); font-size: 0.74rem; font-weight: 700; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--steel); margin-bottom: 1rem;
}
.footer-col nav, .footer-col .links { display: flex; flex-direction: column; gap: 0.55rem; }
.footer-col a { color: var(--ice-dim); font-size: 0.92rem; }
.footer-col a:hover { color: var(--cyan); }
.footer-eco-item { font-size: 0.88rem; color: var(--steel); margin: 0 0 0.55rem; }
.footer-eco-item a { color: var(--ice); }
.footer-eco-item a:hover { color: var(--cyan); }
.footer-eco-item .footer-eco-current { color: var(--cyan); font-weight: 600; }
.footer-line {
  max-width: var(--maxw); margin: clamp(2.5rem, 5vw, 3.5rem) auto 0; padding: 1.5rem var(--pad) 0;
  border-top: 1px solid var(--line); font-size: 0.85rem; color: var(--steel);
  display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; justify-content: space-between;
}

/* ==========================================================================
   SVG diagram helpers
   ========================================================================== */

.diagram { width: 100%; height: auto; }
.diagram-caption { font-size: 0.85rem; color: var(--steel); text-align: center; margin-top: 1rem; }
.fbg-motion { stroke-dasharray: 7 7; }

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 900px) {
  .primary-nav, .header-cta { display: none; }
  .nav-toggle { display: flex; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-art { order: -1; max-width: 460px; }
  .split { grid-template-columns: 1fr; }
  .split--reverse .split-art { order: 0; }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
  .compare-row { grid-template-columns: 1fr; gap: 0.4rem; }
}

@media (max-width: 560px) {
  body { font-size: 1rem; }
  .footer-inner { grid-template-columns: 1fr; }
  .hero-actions .btn, .cta-band .actions .btn { width: 100%; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}
