/* ==========================================================================
   AURIX — layout.css
   Header + nav, hero, section rhythm, footer, background effects.
   ========================================================================== */

/* ============================================================== HEADER === */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 120;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: transparent;
  transition: background-color var(--t-med) var(--ease),
              border-color var(--t-med) var(--ease);
  border-bottom: 1px solid transparent;
}
/* .is-stuck is toggled by js/include.js once the page is scrolled */
.site-header.is-stuck {
  background: var(--glass);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border-bottom-color: var(--glass-border);
  box-shadow: 0 10px 30px -22px rgba(29, 56, 110, 0.5);
}

.header-inner {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
  display: flex;
  align-items: center;
  gap: 16px;
}

/* ------------------------------------------------------------------ logo */
.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.24rem;
  letter-spacing: -0.04em;
  margin-right: auto;
}
.logo img { width: 32px; height: 32px; }
.logo span { line-height: 1; }

/* ------------------------------------------------------------ desktop nav */
.nav { display: none; }

@media (min-width: 900px) {
  .nav { display: flex; align-items: center; gap: 4px; }
  .nav a {
    position: relative;
    padding: 9px 14px;
    border-radius: var(--r-pill);
    font-size: 0.94rem;
    color: var(--muted);
    transition: color var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease);
  }
  .nav a:hover { color: var(--text); background: rgba(255, 255, 255, 0.55); }
  .nav a[aria-current="page"] { color: var(--accent-text); background: var(--accent-soft); font-weight: 600; }
  html[data-theme="dark"] .nav a:hover { background: var(--card-2); }
}

/* ------------------------------------------------------------ header tools */
.header-tools { display: flex; align-items: center; gap: 8px; }

/* theme toggle */
.theme-toggle {
  width: 40px; height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: box-shadow var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.theme-toggle:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.theme-toggle svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; }
/* Show one icon per theme */
.theme-toggle .icon-moon { display: none; }
html[data-theme="light"] .theme-toggle .icon-sun  { display: none; }
html[data-theme="light"] .theme-toggle .icon-moon { display: block; }

/* The header CTA is hidden on small screens (it lives in the menu instead).
   Scoped to .site-header so it beats the .btn display rule in components.css,
   which is loaded after this file. */
.site-header .header-cta { display: none; }
@media (min-width: 900px) { .site-header .header-cta { display: inline-flex; } }

/* ------------------------------------------------------------- hamburger */
.nav-toggle {
  width: 40px; height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}
@media (min-width: 900px) { .nav-toggle { display: none; } }

.nav-toggle .bars { position: relative; width: 18px; height: 12px; }
.nav-toggle .bars i {
  position: absolute;
  left: 0; right: 0;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform var(--t-med) var(--ease), opacity var(--t-fast) var(--ease);
}
.nav-toggle .bars i:nth-child(1) { top: 0; }
.nav-toggle .bars i:nth-child(2) { top: 5px; }
.nav-toggle .bars i:nth-child(3) { top: 10px; }
.nav-toggle[aria-expanded="true"] .bars i:nth-child(1) { transform: translateY(5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .bars i:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .bars i:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }

/* --------------------------------------------------- mobile overlay menu */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 115;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: calc(var(--header-h) + 24px) var(--gutter) 40px;
  /* Frosted rather than solid, so the sky stays visible behind the menu. */
  background: var(--glass);
  -webkit-backdrop-filter: blur(34px) saturate(170%);
  backdrop-filter: blur(34px) saturate(170%);
  /* hidden by default, no pointer events so it cannot trap taps */
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity var(--t-med) var(--ease), transform var(--t-med) var(--ease), visibility var(--t-med);
}
.mobile-menu.is-open { opacity: 1; visibility: visible; transform: none; }
@media (min-width: 900px) { .mobile-menu { display: none; } }

.mobile-menu__aurora {
  position: absolute;
  inset: -20% -30% auto -30%;
  height: 70vh;
  background: radial-gradient(45% 50% at 50% 40%, rgba(59,123,247,.34), rgba(255,176,138,.18) 55%, transparent 75%);
  filter: blur(40px);
  pointer-events: none;
}
.mobile-menu ul { position: relative; display: grid; gap: 4px; }
.mobile-menu a {
  display: block;
  padding: 14px 16px;
  border-radius: var(--r-md);
  font-size: 1.7rem;
  font-weight: 350;
  letter-spacing: -0.035em;
}
.mobile-menu a[aria-current="page"] { color: var(--accent-text); }
.mobile-menu__foot {
  position: relative;
  margin-top: 28px;
  display: grid;
  gap: 12px;
}

/* ================================================================ MAIN === */
main { display: block; }

.section {
  position: relative;
  padding-block: clamp(56px, 9vw, 112px);
}
.section--tight { padding-block: clamp(40px, 6vw, 72px); }
/* A "sub" section is a wide pane of frosted glass across the page, not a
   different background colour — the sky underneath never changes. */
.section--sub {
  background: var(--bg-sub);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border-block: 1px solid var(--glass-border);
}

.section-head { max-width: 62ch; margin-bottom: clamp(28px, 4vw, 48px); }
.section-head--center { margin-inline: auto; text-align: center; }

/* ================================================================ HERO === */
.hero {
  position: relative;
  min-height: 100svh;              /* svh avoids the iOS toolbar height jump */
  display: grid;
  align-items: center;
  padding-top: calc(var(--header-h) + 24px);
  padding-bottom: 48px;
  overflow: hidden;
}
.hero__grid {
  position: relative;
  z-index: 2;
  display: grid;
  gap: clamp(24px, 5vw, 48px);
  align-items: center;
}
@media (min-width: 1024px) {
  .hero__grid { grid-template-columns: 1.05fr 0.95fr; }
}
.hero--compact { min-height: 72svh; }

.hero__copy { position: relative; z-index: 2; }
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}

/* ----------------------------------------------------------- aurora glow */
/* Soft blurred gradient behind heroes — the "aurora" look. */
/* Two extra colour fields per hero, on top of the page-wide sky. Kept
   gentle: the sky is already doing most of this work. */
.aurora {
  position: absolute;
  z-index: 0;
  pointer-events: none;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.34;
  background: radial-gradient(circle at 50% 50%, var(--g1) 0%, var(--sky) 45%, transparent 72%);
}
.aurora--a { inset: -22% -10% auto -25%; height: 70vh; }
.aurora--b {
  right: -20%; bottom: -25%;
  width: 70vw; height: 60vh;
  background: radial-gradient(circle at 50% 50%, var(--g3) 0%, rgba(255,201,175,.6) 45%, transparent 72%);
  opacity: 0.3;
}
html[data-theme="dark"] .aurora { opacity: 0.48; filter: blur(60px); }

/* --------------------------------------------- cursor-following glow (PC) */
.cursor-glow {
  position: fixed;
  top: 0; left: 0;
  width: 420px; height: 420px;
  margin: -210px 0 0 -210px;
  z-index: 2;
  pointer-events: none;
  border-radius: 50%;
  opacity: 0;
  background: radial-gradient(circle at 50% 50%, rgba(255,255,255,0.46) 0%, rgba(143,187,242,0.26) 40%, transparent 70%);
  filter: blur(26px);
  transition: opacity 0.4s var(--ease);
  will-change: transform;
}
/* Only ever shown on devices with a real pointer */
@media (hover: hover) and (pointer: fine) {
  .cursor-glow.is-active { opacity: 1; }
}

/* ================================================================ GRIDS == */
.grid { display: grid; gap: 18px; }
.grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; }

@media (min-width: 640px) {
  .grid--2 { grid-template-columns: repeat(2, 1fr); }
  .grid--4 { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 900px) {
  .grid { gap: 22px; }
  .grid--3 { grid-template-columns: repeat(3, 1fr); }
  .grid--4 { grid-template-columns: repeat(4, 1fr); }
}

/* Two-column "media + copy" rows */
.split {
  display: grid;
  gap: clamp(22px, 4vw, 48px);
  align-items: center;
}
@media (min-width: 900px) {
  .split { grid-template-columns: repeat(2, 1fr); }
  .split--reverse > :first-child { order: 2; }
}

/* ============================================================== FOOTER === */
.site-footer {
  position: relative;
  border-top: 1px solid var(--glass-border);
  background: var(--bg-sub);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  padding-block: clamp(40px, 6vw, 64px) 28px;
}
.footer-grid { display: grid; gap: 32px; }
@media (min-width: 768px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; } }

.site-footer h4 {
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 14px;
}
.site-footer nav ul { display: grid; gap: 9px; }
.site-footer nav a { color: var(--muted); transition: color var(--t-fast) var(--ease); }
.site-footer nav a:hover { color: var(--text); }

.footer-bottom {
  margin-top: 34px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: var(--muted);
}
.footer-disclaimer {
  margin-top: 16px;
  font-size: 0.78rem;
  color: var(--muted);
  max-width: 76ch;
  opacity: 0.85;
}

/* The desktop nav list itself (the <nav> wrapper is flex above). */
.nav ul { display: flex; align-items: center; gap: 4px; }

/* ------------------------------------------- mobile + tablet hero order ---
   On narrow screens the 3D object is moved ABOVE the copy and given a fixed
   height, so visitors see it without having to scroll first. */
@media (max-width: 1023px) {
  .hero { padding-top: calc(var(--header-h) + 12px); }
  .hero__grid > .stage {
    order: -1;
    width: 100%;
    height: min(42svh, 360px);
    aspect-ratio: auto;
    max-height: none;
  }
}
