/* ============================================================
   MARINOX GROUP — GLOBAL STYLESHEET
   ============================================================ */


/* ── TOKENS ───────────────────────────────────────────── */
:root {
  /* Surfaces */
  --void:  #03080c;
  --deep:  #060e15;
  --navy:  #081420;
  --teal:  #0b2030;

  /* Foreground */
  --text:  #e8f0f3;            /* canonical headline / strong text */
  --heading: #e8f0f3;          /* alias for venture/section heading colour (Fix 6.1) */
  --prose: #c8d8de;            /* default body */
  --muted: #8aabba;            /* labels, secondary UI */

  /* Prose-on-dark alphas (calm reading scale) */
  --prose-strong: rgba(200, 216, 222, 0.88);
  --prose-body:   rgba(200, 216, 222, 0.82);   /* audit anchor */
  --prose-dim:    rgba(200, 216, 222, 0.62);

  /* Hairlines */
  --acc-line:    rgba(62, 207, 207, 0.08);     /* faint cyan rule (~41 uses) */
  --rule:        rgba(200, 216, 222, 0.10);
  --rule-strong: rgba(200, 216, 222, 0.18);

  /* Brand */
  --acc:       #3ecfcf;
  --c-mariix:  #3ecfcf;        /* Destination — cyan */
  --c-marvex:  #d4a832;        /* Foundation — gold */
  --c-oceion:  #9b6fc9;        /* Digital — purple */

  /* Type */
  --fd: 'Cormorant Garamond', serif;
  --fb: 'DM Sans', sans-serif;

  /* Layout */
  --nav-h: 72px;
  --ease:  cubic-bezier(0.25, 0.46, 0.45, 0.94);

  /* Responsive — canonical breakpoint scale (Fix 5.2 / Phase 5)
     New code SHOULD use these tokens via @media. The migration
     of the existing 38 hardcoded breakpoints is post-launch work
     — see marinox-breakpoint-migration.md for the per-file plan.
     Note: CSS custom properties cannot be used inside @media
     queries directly; reference these values literally and keep
     the tokens here as the documented source of truth. */
  --bp-sm: 600px;        /* small mobile / phone portrait */
  --bp-md: 900px;        /* tablet portrait / large phone landscape */
  --bp-lg: 1020px;       /* small desktop / tablet landscape */
  --bp-xl: 1280px;       /* large desktop (aspirational — no current usage) */
}

/* ── RESET ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--fb);
  background: var(--void);
  color: var(--prose);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; border: none; background: none; font-family: var(--fb); }

/* ── FOCUS VISIBLE — global accessible focus ring ────────── */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--acc);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ── NAVIGATION ─────────────────────────────────────────── */
#nav {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex; align-items: center;
  padding: 0 3rem;
  transition: background 0.4s var(--ease), backdrop-filter 0.4s var(--ease);
}
#nav.nav-scrolled {
  background: rgba(3,8,12,0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--acc-line);
}
.nav-logo {
  display: flex; align-items: center; gap: 0.75rem;
  flex-shrink: 0;
}
.nav-logo-text {
  font-family: var(--fb);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
.nav-logo-text span { color: var(--acc); }
.nav-links {
  display: flex; align-items: center; gap: 2.5rem;
  margin-left: auto;
  list-style: none;
}
.nav-links a {
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.3s;
  position: relative;
  padding-bottom: 2px;
}
.nav-links a::after {
  content: '';
  position: absolute; bottom: 0; left: 0;
  width: 0; height: 1px;
  background: var(--acc);
  transition: width 0.3s var(--ease);
}
.nav-links a:hover,
.nav-links a.active { color: var(--prose); }
.nav-links a:hover::after,
.nav-links a.active::after { width: 100%; }
.nav-cta {
  margin-left: 2rem;
  padding: 0.55rem 1.4rem;
  border: 1px solid rgba(62,207,207,0.4);
  border-radius: 2px;
  font-family: var(--fb);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--acc);
  transition: all 0.3s var(--ease);
}
.nav-cta:hover {
  background: rgba(62,207,207,0.1);
  border-color: var(--acc);
}
.nav-hamburger {
  display: none;
  margin-left: auto;
  flex-direction: column; gap: 5px;
  width: 28px; cursor: pointer;
}
.nav-hamburger span {
  display: block; height: 1.5px;
  background: var(--prose);
  transition: all 0.3s var(--ease);
}
.nav-hamburger.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* Mobile Drawer */
.nav-drawer {
  position: fixed; top: 0; right: 0;
  width: 100%; height: 100vh;
  background: var(--deep);
  z-index: 99;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 2.5rem;
  transform: translateX(100%);
  transition: transform 0.5s var(--ease);
}
.nav-drawer.open { transform: translateX(0); }
.nav-drawer a {
  font-family: var(--fd);
  font-size: 2.2rem;
  font-weight: 300;
  color: var(--prose);
  letter-spacing: 0.04em;
  transition: color 0.3s;
}
.nav-drawer a:hover { color: var(--acc); }
.drawer-close {
  position: absolute; top: 1.5rem; right: 1.5rem;
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(62,207,207,0.3);
  display: flex; align-items: center; justify-content: center;
  color: var(--prose);
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.3s;
}
.drawer-close:hover {
  background: rgba(62,207,207,0.1);
  border-color: var(--acc);
}

/* ============================================================
   FIX 3.1 (Phase 3) — VENTURES SUBMENU
   Hybrid hover dropdown · 150ms close delay · C2 venture
   color bars (hover/focus only) · indented mobile drawer.
   ============================================================ */
.nav-has-submenu { position: relative; }
.nav-has-submenu > a {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}
.nav-submenu-arrow {
  width: 7px; height: 7px;
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  opacity: 0.55;
  transition: transform 0.25s var(--ease), opacity 0.25s ease;
  margin-left: 0.1rem;
}
.nav-has-submenu:hover .nav-submenu-arrow,
.nav-has-submenu:focus-within .nav-submenu-arrow,
.nav-has-submenu.is-open .nav-submenu-arrow {
  opacity: 1;
  transform: rotate(225deg) translateY(2px);
}

.nav-submenu {
  position: absolute;
  top: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  min-width: 200px;
  background: rgba(6,14,21,0.97);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(62,207,207,0.16);
  border-top: 1px solid rgba(62,207,207,0.5);
  border-radius: 2px;
  padding: 0.6rem 0;
  list-style: none;
  margin: 0;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.22s var(--ease), transform 0.28s var(--ease), visibility 0.22s;
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
}
.nav-has-submenu:hover .nav-submenu,
.nav-has-submenu:focus-within .nav-submenu,
.nav-has-submenu.is-open .nav-submenu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}
/* Invisible bridge between parent link and submenu so cursor can travel
   between them without triggering the close timer. */
.nav-submenu::before {
  content: '';
  position: absolute;
  top: -12px; left: 0; right: 0;
  height: 12px;
}
.nav-submenu li { margin: 0; }
.nav-submenu a {
  display: block;
  padding: 0.7rem 1.6rem 0.7rem 1.4rem;
  font-family: var(--fb);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  position: relative;
  transition: color 0.25s ease, padding-left 0.25s var(--ease);
}
/* Override the underlining ::after used on top-level nav links */
.nav-submenu a::after { display: none; }

/* C2 — venture color bars on hover/focus only */
.nav-submenu a::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 2px;
  height: 0;
  background: var(--sub-acc, var(--acc));
  transform: translateY(-50%);
  transition: height 0.22s var(--ease);
  opacity: 0;
}
.nav-submenu a:hover,
.nav-submenu a:focus-visible,
.nav-submenu a.active {
  color: var(--text);
  padding-left: 1.7rem;
}
.nav-submenu a:hover::before,
.nav-submenu a:focus-visible::before,
.nav-submenu a.active::before {
  height: 1.6rem;
  opacity: 1;
}
.nav-submenu a[data-venture="marvex"] { --sub-acc: var(--c-marvex); }
.nav-submenu a[data-venture="mariix"] { --sub-acc: var(--c-mariix); }
.nav-submenu a[data-venture="oceion"] { --sub-acc: var(--c-oceion); }

/* ── Mobile drawer sub-section (indented sub-items) ── */
.nav-drawer-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
}
.nav-drawer-section > a { margin-bottom: 0.2rem; }
.nav-drawer-subitems {
  list-style: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 0 0;
  margin: 0;
}
.nav-drawer-subitems a {
  font-size: 1.35rem;
  color: var(--muted);
  letter-spacing: 0.06em;
  position: relative;
  padding-left: 1rem;
  transition: color 0.3s;
}
.nav-drawer-subitems a::before {
  content: '·';
  position: absolute;
  left: 0;
  color: var(--c-mariix);
  opacity: 0.6;
  transition: opacity 0.25s ease;
}
.nav-drawer-subitems a[data-venture="marvex"]::before { color: var(--c-marvex); }
.nav-drawer-subitems a[data-venture="oceion"]::before { color: var(--c-oceion); }
.nav-drawer-subitems a:hover,
.nav-drawer-subitems a.active { color: var(--text); }
.nav-drawer-subitems a:hover::before,
.nav-drawer-subitems a.active::before { opacity: 1; }

/* ── TYPOGRAPHY ─────────────────────────────────────────── */
.eyebrow {
  font-family: var(--fb);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--acc);
  display: block;
  margin-bottom: 1.2rem;
}
h1, h2, h3, h4 {
  font-family: var(--fd);
  font-weight: 300;
  line-height: 1.1;
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(3rem, 7vw, 6.5rem); }
h2 { font-size: clamp(2.2rem, 4.5vw, 4rem); }
h3 { font-size: clamp(1.5rem, 2.5vw, 2.2rem); }
h4 { font-size: 1.3rem; }
h1 em, h2 em, h3 em, h4 em { color: var(--acc); font-style: italic; }
p {
  font-family: var(--fb);
  color: var(--prose);
  line-height: 1.75;
  font-size: 0.95rem;
}
.pull-quote {
  position: relative;
  font-family: var(--fd);
  font-size: clamp(1.2rem, 2vw, 1.6rem);
  font-style: italic;
  font-weight: 300;
  color: var(--prose);
  line-height: 1.5;
  padding-left: 2rem;
}
.pull-quote::before {
  content: '"';
  position: absolute;
  top: -1.5rem; left: -1rem;
  font-size: 6rem;
  font-family: var(--fd);
  color: rgba(62,207,207,0.1);
  line-height: 1;
}

/* ── LAYOUT HELPERS ─────────────────────────────────────── */
.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 3rem;
}
.section {
  padding: 8rem 0;
}
.section--alt { background: var(--navy); }

/* ── BUTTONS ────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 0.6rem;
  font-family: var(--fb);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 0.9rem 2rem;
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.3s var(--ease);
  position: relative; overflow: hidden;
}
.btn::before {
  content: '';
  position: absolute; inset: 0;
  background: var(--acc);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s var(--ease);
  z-index: 0;
}
.btn:hover::before { transform: scaleX(1); }
.btn span { position: relative; z-index: 1; }
.btn-primary {
  background: var(--acc);
  color: var(--void);
}
.btn-primary::before { background: rgba(255,255,255,0.15); }
.btn-ghost {
  background: transparent;
  color: var(--acc);
  border: 1px solid rgba(62,207,207,0.4);
}
.btn-ghost:hover { color: var(--void); }
.btn-ghost::before { background: var(--acc); }

/* ── CARDS ──────────────────────────────────────────────── */
.card {
  background: rgba(11,32,48,0.6);
  border: 1px solid rgba(62,207,207,0.08);
  border-radius: 4px;
  padding: 2.5rem;
  backdrop-filter: blur(10px);
  transition: all 0.4s var(--ease);
}
.card:hover {
  border-color: rgba(62,207,207,0.25);
  transform: translateY(-4px);
  box-shadow: 0 24px 48px rgba(0,0,0,0.3);
}

/* ── HERO COMMON ────────────────────────────────────────── */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex; align-items: center;
  overflow: hidden;
  padding-top: var(--nav-h);
}
.hero-content { position: relative; z-index: 2; }
.hero-bg {
  position: absolute; inset: 0;
  z-index: 0;
}

/* ── FOOTER ─────────────────────────────────────────────── */
#footer {
  background: var(--void);
  border-top: 1px solid var(--acc-line);
  padding: 4.5rem 0 2rem;
  min-height: 280px; /* reserved so JS footer injection doesn't shift layout */
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: grid;
  grid-template-columns: 1.1fr 2fr;
  gap: 4rem;
  align-items: start;
}

/* ── Identity block (logo + wordmark + tagline) ──────────── */
.footer-identity { min-width: 0; }

.footer-logo {
  display: flex;
  align-items: flex-start;
  gap: 1.1rem;
}
.footer-logo-icon {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  display: block;
  opacity: 0.9;
}
.footer-logo-icon svg { width: 100%; height: 100%; display: block; }

.footer-logo-text {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding-top: 0.25rem;
}
.footer-logo-name {
  font-family: var(--fb);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: rgba(232, 240, 243, 0.92);
}
.footer-logo-name span { color: var(--acc); }

.footer-logo-tagline {
  font-family: var(--fd);
  font-style: italic;
  font-weight: 400;
  font-size: 0.92rem;
  line-height: 1.45;
  color: rgba(62, 207, 207, 0.82);
  max-width: 280px;
}

/* ── Grouped nav columns ─────────────────────────────────── */
.footer-nav-grouped {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.footer-nav-col { min-width: 0; }

.footer-nav-heading {
  font-family: var(--fb);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: rgba(62, 207, 207, 0.75);
  margin: 0 0 1.2rem;
}

.footer-nav-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.footer-nav-col a {
  font-family: var(--fb);
  font-size: 0.85rem;
  color: rgba(200, 216, 222, 0.72);
  text-decoration: none;
  transition: color 0.25s ease;
}
.footer-nav-col a:hover { color: var(--text); }

/* ── Sub-bar: copyright + legal + social ─────────────────── */
.footer-subbar {
  grid-column: 1 / -1;
  margin-top: 3.5rem;
  padding-top: 1.8rem;
  border-top: 1px solid var(--acc-line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}

.footer-sub-left {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-family: var(--fb);
  font-size: 0.7rem;
  color: rgba(200, 216, 222, 0.55);
  letter-spacing: 0.08em;
}
.footer-sub-left .footer-dot {
  color: rgba(62, 207, 207, 0.4);
  font-size: 0.7rem;
}

.footer-sub-right {
  display: flex;
  align-items: center;
  gap: 1.8rem;
}

.footer-legal {
  display: flex;
  gap: 1.4rem;
  list-style: none;
  padding: 0;
  margin: 0;
}
.footer-legal a {
  font-family: var(--fb);
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(200, 216, 222, 0.55);
  text-decoration: none;
  transition: color 0.25s ease;
}
.footer-legal a:hover { color: var(--acc); }

.footer-social {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(62, 207, 207, 0.25);
  border-radius: 50%;
  color: rgba(200, 216, 222, 0.6);
  transition: color 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}
.footer-social svg {
  width: 13px;
  height: 13px;
  display: block;
}
.footer-social:hover {
  color: var(--acc);
  border-color: var(--acc);
  transform: translateY(-1px);
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 900px) {
  .footer-inner {
    grid-template-columns: 1fr;
    gap: 3rem;
  }
  .footer-nav-grouped {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
  }
  .footer-subbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.5rem;
  }
}
@media (max-width: 600px) {
  .footer-nav-grouped {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .footer-sub-left {
    flex-wrap: wrap;
  }
}

/* ── PAGE HERO ──────────────────────────────────────────── */
.page-hero {
  padding: calc(var(--nav-h) + 5rem) 0 5rem;
  position: relative;
  overflow: hidden;
}
.page-hero::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 60% 70% at 50% 50%, rgba(62,207,207,0.04) 0%, transparent 70%);
}

/* ── DIVIDER ────────────────────────────────────────────── */
.teal-line {
  display: block;
  width: 40px; height: 1px;
  background: var(--acc);
  margin-bottom: 2rem;
}

/* ── REVEAL ANIMATIONS ──────────────────────────────────── */
/*
   Canonical class is .visible (added by main.js).
   .in is supported as an alias for pages running their own
   IntersectionObservers (continuum-mark.js, story.js, ecosystem.js).
   New code should prefer .visible.
*/
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.reveal.visible,
.reveal.in { opacity: 1; transform: translateY(0); }
.reveal-d1 { transition-delay: 0.1s; }
.reveal-d2 { transition-delay: 0.2s; }
.reveal-d3 { transition-delay: 0.3s; }
.reveal-d4 { transition-delay: 0.4s; }

/* ── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 1020px) {
  .nav-links, .nav-cta { display: none; }
  .nav-hamburger { display: flex; }
  .container { padding: 0 1.5rem; }
  #nav { padding: 0 1.5rem; }
  .section { padding: 5rem 0; }
}
@media (max-width: 640px) {
  h1 { font-size: clamp(2.4rem, 10vw, 3.5rem); }
  h2 { font-size: clamp(1.8rem, 6vw, 2.5rem); }
}

/* ── REDUCED MOTION — respect user preference ────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
  .reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  #site-loader { transition: none; }
}


/* ── NAV & FOOTER ICON ── */
.nav-logo-icon {
  width: 36px; height: 36px; display: flex; align-items: center;
  flex-shrink: 0; overflow: hidden;
}
.nav-logo-icon svg { width: 100%; height: 100%; }

/* ── HERO SUB (shared across all hero sections) ── */
.hero-sub {
  font-size: 1rem;
  color: var(--muted);
  margin-bottom: 2.5rem;
  max-width: 520px;
  line-height: 1.8;
}
