/* ============================================================
   AUTOFLOW SYSTEMS — Shared Stylesheet
   Used on every page. Page-specific styles live in public/css/<page>.css
   ============================================================ */

/* ── DESIGN TOKENS ─────────────────────────────────────────── */
:root {
  --blue: #0a4fa6;
  --blue-dark: #062f6e;
  --blue-mid: #1565c0;
  --accent: #f59e0b;
  --accent-light: #fcd34d;
  --white: #ffffff;
  --light: #f0f4fb;
  --gray: #556274; /* slightly darker for readable body text (WCAG AA) */
  --dark: #0b1628;

  --nav-height: 68px;
  --section-pad-y: clamp(3.5rem, 7vw, 6rem);
  --section-pad-x: 5%;
  --radius-card: 12px;
  --radius-card-lg: 16px;
  --shadow-soft: 0 4px 16px rgba(0, 0, 0, 0.05);
  --shadow-hover: 0 12px 32px rgba(10, 79, 166, 0.12);
}

/* ── RESET ─────────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Barlow", sans-serif;
  color: var(--dark);
  background: #fff;
  overflow-x: hidden;
  line-height: 1.5;
}

img {
  max-width: 100%;
  height: auto; /* keep proportions when width/height attributes are set */
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ── NAVIGATION ────────────────────────────────────────────── */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--section-pad-x);
  height: var(--nav-height);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
}

.nav-logo {
  flex-shrink: 0;
}

.logo-img {
  height: 30px;
  width: auto;
  display: block;
}

.nav-links {
  display: flex;
  gap: 0.25rem;
  list-style: none;
  align-items: center;
}

.nav-links a {
  color: var(--gray);
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  padding: 0.42rem 0.95rem;
  border-radius: 50px;
  transition:
    background 0.18s ease,
    color 0.18s ease;
}

.nav-links a:hover,
.nav-links a.active-link {
  background: var(--light);
  color: var(--blue);
}

.nav-cta {
  background: var(--accent) !important;
  color: var(--dark) !important;
  padding: 0.5rem 1.3rem !important;
  border-radius: 50px !important;
  font-weight: 700 !important;
  font-size: 0.85rem !important;
  letter-spacing: 0.3px;
  transition:
    background 0.2s,
    transform 0.15s !important;
  margin-left: 0.35rem;
}

.nav-cta:hover {
  background: var(--accent-light) !important;
  transform: translateY(-2px) !important;
}

/* Dropdown — desktop */
.nav-dropdown {
  position: relative;
}

.nav-dropdown > a::after {
  content: "▾";
  margin-left: 4px;
  font-size: 0.7rem;
  opacity: 0.7;
}

.nav-dropdown .dropdown-menu {
  position: absolute;
  top: calc(100% - 2px);
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  min-width: 200px;
  padding: 18px 0 6px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.25s ease,
    transform 0.25s ease,
    visibility 0.25s;
  list-style: none;
  margin: 0;
}

.nav-dropdown:hover .dropdown-menu,
.nav-dropdown:focus-within .dropdown-menu,
.nav-dropdown.open .dropdown-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: all;
  transform: translateX(-50%) translateY(0);
}

.dropdown-menu li a {
  display: block;
  padding: 11px 20px;
  margin: 2px 6px;
  border-radius: 50px;
  color: var(--gray);
  font-size: 0.86rem;
  font-weight: 600;
  white-space: nowrap;
  letter-spacing: 0.3px;
  transition:
    background 0.15s,
    color 0.15s;
}

.dropdown-menu li a:hover {
  background: var(--light);
  color: var(--blue);
}

/* Hamburger (hidden on desktop) */
.hamburger {
  display: none;
  cursor: pointer;
  background: none;
  border: none;
  padding: 9px;
  min-width: 44px;
  min-height: 44px;
  margin-right: -9px;
  z-index: 1100;
  position: relative;
}

.hamburger span {
  display: block;
  width: 26px;
  height: 2.5px;
  background: var(--blue-dark);
  margin: 5px 0;
  border-radius: 2px;
  transition:
    transform 0.3s,
    opacity 0.2s,
    background 0.3s;
  transform-origin: center;
}

.hamburger.is-open span:nth-child(1) {
  transform: translateY(7.5px) rotate(45deg);
  background: #fff;
}

.hamburger.is-open span:nth-child(2) {
  opacity: 0;
}

.hamburger.is-open span:nth-child(3) {
  transform: translateY(-7.5px) rotate(-45deg);
  background: #fff;
}

/* ── SECTIONS — shared utility classes ─────────────────────── */
section {
  padding: var(--section-pad-y) var(--section-pad-x);
}

.section-tag {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--blue-mid);
  margin-bottom: 0.75rem;
  display: inline-block;
}

.section-title {
  font-family: "Barlow Condensed", sans-serif;
  font-size: clamp(1.9rem, 4.5vw, 2.8rem);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--dark);
  line-height: 1.1;
}

.section-title .accent {
  color: var(--blue);
}

.divider {
  width: 50px;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), transparent);
  border-radius: 2px;
  margin: 1rem 0 2rem;
}

/* ── BUTTONS ───────────────────────────────────────────────── */
.btn-primary {
  background: var(--accent);
  color: var(--dark);
  padding: 0.85rem 2rem;
  border-radius: 4px;
  font-weight: 700;
  font-size: 0.95rem;
  display: inline-block;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.4);
  cursor: pointer;
  border: none;
  font-family: inherit;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(245, 158, 11, 0.5);
}

.btn-outline {
  background: transparent;
  color: #fff;
  padding: 0.85rem 2rem;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.95rem;
  display: inline-block;
  border: 1.5px solid rgba(255, 255, 255, 0.4);
  transition:
    border-color 0.2s,
    background 0.2s;
}

.btn-outline:hover {
  border-color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

/* ── PAGE HERO (for history.html and board.html) ───────────── */
.page-hero {
  min-height: 44vh;
  background: linear-gradient(
    135deg,
    var(--blue-dark) 0%,
    var(--blue) 60%,
    #1a6fcf 100%
  );
  position: relative;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding-top: var(--nav-height);
}

.page-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse 80% 60% at 70% 40%,
    rgba(255, 255, 255, 0.05) 0%,
    transparent 70%
  );
  pointer-events: none;
}

.page-hero-content {
  position: relative;
  z-index: 2;
  padding: 3rem var(--section-pad-x) 5rem;
  max-width: 760px;
}

.page-hero-content .section-tag {
  color: var(--accent-light);
}

.page-hero-content h1 {
  font-family: "Barlow Condensed", sans-serif;
  font-size: clamp(2.5rem, 6vw, 5rem);
  font-weight: 800;
  line-height: 1.05;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 0.75rem 0 1.25rem;
}

.page-hero-content h1 span {
  color: var(--accent);
}

.page-hero-content p {
  font-size: clamp(0.95rem, 1.5vw, 1.05rem);
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.7;
  max-width: 560px;
}

.page-hero .waves {
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  z-index: 2;
}

.page-hero .waves svg {
  display: block;
  width: 100%;
  height: 70px;
}

/* ── CTA BAND (shared between pages) ───────────────────────── */
.cta-band {
  background: linear-gradient(135deg, var(--blue-dark), var(--blue));
  padding: 4rem var(--section-pad-x);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}

.cta-band h2 {
  font-family: "Barlow Condensed", sans-serif;
  font-size: clamp(1.6rem, 3.5vw, 2.6rem);
  font-weight: 800;
  text-transform: uppercase;
  color: #fff;
  line-height: 1.15;
  letter-spacing: 0.5px;
  max-width: 560px;
}

.cta-band h2 span {
  color: var(--accent);
}

.cta-band p {
  color: rgba(255, 255, 255, 0.65);
  margin-top: 0.5rem;
  font-size: 0.95rem;
}

/* page.html uses dark variant */
.cta-band--dark {
  background: var(--dark);
}

/* ── FOOTER (shared markup) ────────────────────────────────── */
.footer-wrapper {
  width: 100%;
  background: var(--light);
  position: relative;
  display: flex;
  flex-direction: column;
}

.editorial {
  display: block;
  width: 100%;
  height: 100px;
  min-height: 80px;
  margin: 0;
  padding: 0;
  background: var(--light);
}

.parallax > use {
  animation: move-forever 12s linear infinite;
}

.parallax > use:nth-child(1) {
  animation-delay: -2s;
  fill: rgba(69, 121, 226, 0.7);
}

.parallax > use:nth-child(2) {
  animation-delay: -2s;
  animation-duration: 5s;
  fill: rgba(52, 97, 193, 0.5);
}

.parallax > use:nth-child(3) {
  animation-delay: -4s;
  animation-duration: 3s;
  fill: var(--dark);
}

.footer-wrapper > .content {
  background: var(--dark);
  padding: 3.5rem var(--section-pad-x) 2rem;
  color: rgba(255, 255, 255, 0.7);
  font-family: "Barlow", sans-serif;
  margin-top: -1px;
  text-align: left;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1.5fr 1.5fr;
  gap: 3rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 1.75rem;
}

.footer-brand .logo-img,
.footer-logo-wrap .logo-img {
  height: 34px;
  /* white logo: the blue one is nearly invisible on the dark footer */
  filter: brightness(0) invert(1);
  margin-bottom: 1rem;
}

.footer-logo-wrap {
  margin-bottom: 0.75rem;
}

.footer-brand p {
  font-size: 0.95rem;
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.7);
}

.footer-col h3 {
  font-family: "Barlow Condensed", sans-serif;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #fff;
  margin-bottom: 1.25rem;
}

.footer-col ul {
  list-style: none;
}

.footer-col li {
  margin-bottom: 0;
}

.footer-col a {
  padding: 9px 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.9rem;
  transition:
    color 0.25s,
    padding 0.25s;
  display: inline-block;
}

.footer-col a:hover {
  color: var(--accent);
  padding-left: 4px;
}

.footer-col p {
  font-size: 0.9rem;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.7);
}

.footer-col p a {
  color: var(--accent);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.62);
}

/* ── ANIMATIONS ────────────────────────────────────────────── */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.4);
    opacity: 0.6;
  }
}

@keyframes waveMove {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

@keyframes move-forever {
  0% {
    transform: translate(-90px, 0%);
  }
  100% {
    transform: translate(85px, 0%);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Scroll-reveal: only hidden once JS is confirmed running (html.js),
   so content is never invisible if a script fails or is slow. */
.js .reveal {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 0.55s ease,
    transform 0.55s ease;
}

.js .reveal.visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .js .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* Small helpers that replaced inline styles */
.footer-gap {
  margin-top: 0.5rem;
}

/* Visible keyboard focus everywhere */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* Anchor links land below the fixed menu bar */
[id] {
  scroll-margin-top: calc(var(--nav-height) + 12px);
}

/* ── RESPONSIVE — Tablet & below ───────────────────────────── */
@media (max-width: 1024px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
  }
}

/* ── Navigation: full-screen menu on phones AND tablets (≤1024px).
   Between 769px and ~960px the desktop menu did not fit and wrapped. */
@media (max-width: 1024px) {
  .hamburger {
    display: block;
  }

  /* Full-screen overlay mobile menu */
  .nav-links {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(160deg, var(--blue-dark) 0%, var(--blue) 100%);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 0.6rem;
    padding: 0 5%;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition:
      opacity 0.35s ease,
      visibility 0.35s;
    z-index: 1050;
    /* short phones / landscape: let the menu scroll instead of clipping */
    overflow-y: auto;
    padding-top: calc(var(--nav-height) + 1rem);
    padding-bottom: 2rem;
    justify-content: safe center;
  }

  /* Belt and braces: nothing inside a closed menu can receive taps */
  .nav-links:not(.open) * {
    pointer-events: none !important;
  }

  .nav-links.open {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
  }

  .nav-links.open > li {
    opacity: 0;
    transform: translateY(20px);
    animation: slideDown 0.4s ease forwards;
  }

  .nav-links.open > li:nth-child(1) {
    animation-delay: 0.05s;
  }
  .nav-links.open > li:nth-child(2) {
    animation-delay: 0.1s;
  }
  .nav-links.open > li:nth-child(3) {
    animation-delay: 0.15s;
  }
  .nav-links.open > li:nth-child(4) {
    animation-delay: 0.2s;
  }
  .nav-links.open > li:nth-child(5) {
    animation-delay: 0.25s;
  }
  .nav-links.open > li:nth-child(6) {
    animation-delay: 0.3s;
  }
  .nav-links.open > li:nth-child(7) {
    animation-delay: 0.35s;
  }

  .nav-links a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 12px;
    color: #fff;
    font-family: "Barlow Condensed", sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
  }

  .nav-links a:hover,
  .nav-links a.active-link {
    color: var(--accent);
    background: transparent;
  }

  .nav-cta {
    background: var(--accent) !important;
    color: var(--dark) !important;
    padding: 0.85rem 2.25rem !important;
    font-size: 1.1rem !important;
    border-radius: 50px !important;
    margin-top: 0.5rem;
  }

  /* Dropdown becomes inline list */
  .nav-dropdown > a::after {
    display: none;
  }

  .nav-dropdown {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
  }

  /* The sub-menu must follow the full-screen menu's open/closed state.
     (It used to force visibility:visible + pointer-events:all, which left
     invisible but tappable links floating over every page.) */
  .nav-dropdown .dropdown-menu,
  .nav-dropdown:hover .dropdown-menu,
  .nav-dropdown:focus-within .dropdown-menu,
  .nav-dropdown.open .dropdown-menu {
    position: static;
    opacity: 1;
    visibility: inherit;
    pointer-events: inherit;
    background: transparent;
    box-shadow: none;
    padding: 0.5rem 0 0 0;
    padding-inline-start: 0;
    list-style: none;
    margin: 0;
    transform: none;
    text-align: center;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
  }

  .nav-dropdown .dropdown-menu li {
    margin: 0;
  }

  .nav-dropdown .dropdown-menu li a {
    color: rgba(255, 255, 255, 0.85);
    font-size: 1rem;
    font-weight: 500;
    font-family: "Barlow", sans-serif;
    text-transform: none;
    letter-spacing: 0.3px;
    padding: 10px 18px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    margin: 0;
    border-radius: 0;
    text-align: center;
  }

  .nav-dropdown .dropdown-menu li a:hover {
    background: transparent;
    color: var(--accent);
  }

  /* Prevent desktop translateX from shifting the static dropdown on touch */
  .nav-dropdown:hover .dropdown-menu,
  .nav-dropdown:focus-within .dropdown-menu {
    transform: none;
  }

  /* Lock body scroll while menu is open */
  body.menu-open {
    overflow: hidden;
  }

}

@media (max-width: 768px) {
  /* Footer */
  .cta-band {
    padding: 3rem var(--section-pad-x);
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
  }

  .editorial {
    height: 70px;
    min-height: 60px;
  }
}

@media (max-width: 480px) {
  nav {
    padding: 0 4%;
  }

  section {
    padding: var(--section-pad-y) 4%;
  }

  /* Phones: brand and contact full width; the two link lists side by side */
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2rem 1.25rem;
  }

  .footer-grid > :first-child,
  .footer-grid > :last-child {
    grid-column: 1 / -1;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }

  .cta-band {
    padding: 2.5rem 4%;
  }

  .nav-links a {
    font-size: 1.3rem;
  }
}

.nav-logo a {
  display: flex;
  align-items: center;
  min-height: 44px;
}
