/* ==========================================================================
   Fluxis Studio — layout.css
   Header, overlay menu, hero, page headers, footer
   ========================================================================== */

/* ------------------------------ Header --------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  padding-block: 0.9rem;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 2px solid transparent;
  transition: border-color 0.3s var(--ease), padding 0.3s var(--ease),
              background-color 0.3s var(--ease);
}

.site-header.is-stuck {
  border-bottom-color: var(--line);
  padding-block: 0.55rem;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
}

/* Wordmark */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  flex: none;
}

.brand__mark {
  width: 38px;
  height: 38px;
  flex: none;
  transition: transform 0.5s var(--ease);
}
.brand:hover .brand__mark { transform: rotate(-14deg) scale(1.05); }

/* The mark inverts with the theme so the tile always reads against the page. */
.brand__mark .mark-bg { fill: #14110E; }
.brand__mark .mark-bar { stroke: #FBF7F0; }
[data-theme="dark"] .brand__mark .mark-bg { fill: #F3F3F5; }
[data-theme="dark"] .brand__mark .mark-bar { stroke: #0D0D0F; }

/* The footer is an inverted panel in both themes, so its mark always uses the
   inverted foreground as the tile and the panel colour as the bar. */
.site-footer .brand__mark .mark-bg { fill: var(--inv-fg); }
.site-footer .brand__mark .mark-bar { stroke: var(--inv-bg); }

.brand__text {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.brand__name {
  font-family: var(--display);
  font-size: 1.22rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.brand__sub {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-top: 3px;
}

/* Desktop nav */
.nav {
  display: none;
  align-items: center;
  gap: 0.15rem;
  padding: 0.3rem;
  border: 1.5px solid var(--line-soft);
  border-radius: 999px;
  background: color-mix(in srgb, var(--card) 70%, transparent);
}

@media (min-width: 1040px) { .nav { display: flex; } }

.nav__link {
  position: relative;
  padding: 0.55em 1em;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink-2);
  transition: color 0.22s var(--ease), background-color 0.22s var(--ease);
}

.nav__link:hover { color: var(--ink); background: var(--paper-2); }

.nav__link[aria-current="page"] {
  color: var(--paper);
  background: var(--ink);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex: none;
}

/* Theme toggle */
.theme-toggle {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1.5px solid var(--line);
  border-radius: 50%;
  background: var(--card);
  color: var(--ink);
  transition: transform 0.3s var(--ease), background-color 0.25s var(--ease);
}
.theme-toggle:hover { transform: rotate(18deg); background: var(--amber); color: var(--on-amber); }
.theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-moon { display: block; }

.header-cta { display: none; }
@media (min-width: 680px) { .header-cta { display: inline-flex; } }

/* Burger */
.burger {
  width: 46px;
  height: 42px;
  display: grid;
  place-items: center;
  gap: 5px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: var(--card);
}
@media (min-width: 1040px) { .burger { display: none; } }

.burger span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--ink);
  transition: transform 0.3s var(--ease), opacity 0.2s var(--ease);
}
.burger span:nth-child(2) { width: 12px; justify-self: start; margin-left: 14px; }

/* ------------------------------ Overlay menu ---------------------------- */
.menu {
  position: fixed;
  inset: 0;
  z-index: 140;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: var(--paper);
  clip-path: circle(0% at calc(100% - 46px) 40px);
  transition: clip-path 0.72s var(--ease-out);
  visibility: hidden;
}

.menu.is-open {
  clip-path: circle(150% at calc(100% - 46px) 40px);
  visibility: visible;
}

.menu__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.15rem var(--gutter);
  border-bottom: 2px solid var(--line);
}

.menu__close {
  width: 46px; height: 46px;
  display: grid; place-items: center;
  border: 2px solid var(--line);
  border-radius: 50%;
  background: var(--card);
  transition: transform 0.3s var(--ease), background-color 0.25s var(--ease);
}
.menu__close:hover { transform: rotate(90deg); background: var(--vermilion); color: var(--on-verm); }

.menu__body {
  display: grid;
  align-content: center;
  padding: clamp(1.5rem, 5vw, 3rem) var(--gutter);
  overflow-y: auto;
}

.menu__list { display: grid; }

.menu__item { border-bottom: 1px solid var(--line-soft); }

.menu__link {
  display: flex;
  align-items: baseline;
  gap: clamp(0.8rem, 3vw, 2rem);
  padding: clamp(0.55rem, 1.6vw, 0.9rem) 0;
  font-family: var(--display);
  font-size: clamp(2rem, 8vw, 3.6rem);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.03em;
  transition: color 0.25s var(--ease), padding-left 0.35s var(--ease);
}

.menu__link:hover { color: var(--verm-solid); padding-left: 0.6rem; }

.menu__link[aria-current="page"] { color: var(--verm-solid); }

.menu__idx {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--ink-3);
  flex: none;
}

.menu__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem var(--gutter);
  border-top: 2px solid var(--line);
  font-size: 0.875rem;
}

/* ------------------------------ Hero ------------------------------------ */
.hero {
  position: relative;
  padding-top: clamp(2.5rem, 6vw, 5rem);
  padding-bottom: 0;
  overflow: hidden;
}

.hero__grid {
  display: grid;
  gap: clamp(2.5rem, 5vw, 4rem);
  align-items: center;
}

@media (min-width: 1000px) {
  .hero__grid {
    grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
    gap: clamp(2rem, 4vw, 3.5rem);
  }
}

.hero__copy { display: grid; gap: 1.6rem; justify-items: start; }

.hero__title { margin-top: 0.2rem; }

.hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.75rem;
  padding-top: 0.4rem;
}

.hero__metric { display: grid; gap: 0.15rem; }

.hero__metric-num {
  font-family: var(--display);
  font-size: clamp(1.75rem, 3vw, 2.35rem);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.hero__metric-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* Decorative blob behind hero art */
.hero__art { position: relative; }

.hero__blob {
  position: absolute;
  inset: -12% -8% -6% -10%;
  z-index: 0;
  background: radial-gradient(
    60% 55% at 62% 38%,
    color-mix(in srgb, var(--amber) 42%, transparent),
    transparent 70%
  );
  filter: blur(6px);
  pointer-events: none;
}

/* At full strength this amber wash tints the whole dark hero warm. */
[data-theme="dark"] .hero__blob { opacity: 0.28; }

/* ------------------------------ Page header ----------------------------- */
.page-head {
  position: relative;
  padding-block: clamp(3rem, 7vw, 5.75rem) clamp(2.5rem, 5vw, 4rem);
  border-bottom: 2px solid var(--line);
  overflow: hidden;
}

.page-head__grid {
  display: grid;
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: end;
}

@media (min-width: 920px) {
  .page-head__grid { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
}

.page-head__title { margin-top: 1rem; }

/* Breadcrumbs */
.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-3);
}
.crumbs a:hover { color: var(--verm-solid); }
.crumbs li { display: flex; align-items: center; gap: 0.5rem; }
.crumbs li + li::before { content: "/"; color: var(--line-soft); }
.crumbs [aria-current="page"] { color: var(--ink); }

/* Decorative ring grid used on page heads */
.deco-rings {
  position: absolute;
  right: -60px;
  top: -40px;
  width: 340px;
  opacity: 0.5;
  pointer-events: none;
  z-index: -1;
}

/* ------------------------------ Footer ---------------------------------- */
/* The footer is an inverted panel in both themes, so every colour inside it
   reads from the --inv-* tokens rather than the page-level ink/paper pair.
   Those global tokens swap places between themes, which is what previously
   left the footer with dark text on a dark panel. */
.site-footer {
  background: var(--inv-bg);
  color: var(--inv-fg);
  border-top: 2px solid var(--inv-bg);
}

.site-footer h1,
.site-footer h2,
.site-footer h3,
.site-footer h4 { color: var(--inv-fg); }

.site-footer p,
.site-footer .lead,
.site-footer .prose-muted { color: var(--inv-fg-2); }

.site-footer .eyebrow { color: var(--inv-fg-3); }
.site-footer .eyebrow::before { background: var(--vermilion); }

.site-footer .tlink { color: var(--inv-fg); }
.site-footer .tlink:hover { color: var(--amber); }

.site-footer .brand__name { color: var(--inv-fg); }
.site-footer .brand__sub { color: var(--inv-fg-3); }

.site-footer .badge {
  background: transparent;
  border-color: var(--inv-line);
  color: var(--inv-fg);
}

.footer-cta {
  padding-block: clamp(3.5rem, 8vw, 6.5rem);
  border-bottom: 1px solid var(--inv-line);
}

.footer-cta__grid { display: grid; gap: 2rem; align-items: center; }

@media (min-width: 900px) {
  .footer-cta__grid { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); }
  .footer-cta__aside { justify-self: end; }
}

.footer-cta h2 { color: var(--inv-fg); }

.footer-main {
  padding-block: clamp(2.5rem, 5vw, 4rem);
  display: grid;
  gap: 2.75rem;
}

@media (min-width: 860px) {
  .footer-main {
    grid-template-columns: minmax(0, 1.5fr) repeat(3, minmax(0, 1fr));
    gap: 2rem;
  }
}

.footer-brand { display: grid; gap: 1.1rem; align-content: start; }

.footer-brand p {
  color: var(--inv-fg-2);
  max-width: 34ch;
  font-size: 0.925rem;
}

.footer-col h3 {
  font-family: var(--sans);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--inv-fg-3);
  margin-bottom: 1rem;
}

.footer-col ul { display: grid; gap: 0.6rem; }

.footer-col a {
  font-size: 0.925rem;
  color: var(--inv-fg-2);
  transition: color 0.2s var(--ease), transform 0.2s var(--ease);
  display: inline-block;
}
.footer-col a:hover { color: var(--amber); transform: translateX(3px); }

/* Giant outlined wordmark */
.footer-word {
  padding-bottom: clamp(1rem, 3vw, 2rem);
  overflow: hidden;
}

.footer-word svg { width: 100%; height: auto; display: block; }

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1.35rem;
  border-top: 1px solid var(--inv-line);
  font-size: 0.82rem;
  color: var(--inv-fg-3);
}

.footer-bottom a:hover { color: var(--amber); }

.socials { display: flex; gap: 0.5rem; }

.socials a {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border: 1.5px solid var(--inv-line);
  border-radius: 50%;
  color: var(--inv-fg);
  transition: background-color 0.24s var(--ease), color 0.24s var(--ease),
              transform 0.24s var(--ease), border-color 0.24s var(--ease);
}
.socials a:hover {
  background: var(--amber);
  border-color: var(--amber);
  color: var(--on-amber);
  transform: translateY(-3px);
}

/* Back to top */
.to-top {
  position: fixed;
  right: clamp(1rem, 3vw, 2rem);
  bottom: clamp(1rem, 3vw, 2rem);
  z-index: 95;
  width: 50px; height: 50px;
  display: grid; place-items: center;
  border: 2px solid var(--line);
  border-radius: 50%;
  background: var(--card);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  opacity: 0;
  pointer-events: none;
  transform: translateY(14px) scale(0.85);
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease),
              background-color 0.25s var(--ease);
}
.to-top.is-on { opacity: 1; pointer-events: auto; transform: none; }
.to-top:hover { background: var(--vermilion); color: var(--on-verm); }
