/* ==========================================================================
 *  Fonts — Saira (self-hosted)
 *  ========================================================================== */

@font-face {
  font-family: 'Saira';
  src: url('../fonts/saira-v23-latin-regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Saira';
  src: url('../fonts/saira-v23-latin-500.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Saira';
  src: url('../fonts/saira-v23-latin-700.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Saira';
  src: url('../fonts/saira-v23-latin-900.woff2') format('woff2');
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}


/* ==========================================================================
 *  Reset
 *  ========================================================================== */

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

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

img {
  display: block;
  max-width: 100%;
}

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

button {
  font: inherit;
  border: none;
  background: none;
  cursor: pointer;
}


/* ==========================================================================
 *  Design tokens
 *  ========================================================================== */

:root {
  /* colors — sampled directly from the ECResports logo */
  --color-bg:            #0d1520;  /* page / navbar background */
  --color-surface:       #0c192b;  /* hover / active surface */
  --color-navy:          #013674;  /* primary brand blue */
  --color-blue:          #7fabde;  /* accent blue — hover, highlights */
  --color-black:         #100e0e;  /* near-black, deep contrast */
  --color-white:         #ffffff;
  --color-text-muted:    rgba(255, 255, 255, 0.68);

  /* type */
  --font-display: 'Saira', sans-serif;

  /* layout */
  --navbar-height: 76px;
  --edge-padding: clamp(1.25rem, 4vw, 3rem);

  /* motion */
  --transition-fast: 0.18s ease;
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --transition-fast: 0s;
  }
}


/* ==========================================================================
 *  Base
 *  ========================================================================== */

body {
  font-family: var(--font-display);
  background-color: var(--color-bg);
  color: var(--color-white);
  min-height: 100vh;
}

/* Visible keyboard focus everywhere */
a:focus-visible,
label:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--color-blue);
  outline-offset: 3px;
}


/* ==========================================================================
 *  Navbar
 *  ========================================================================== */

.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
  height: var(--navbar-height);
  background-color: var(--color-bg);
  border-bottom: 1px solid rgba(127, 171, 222, 0.15);
}

.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 100%;
  padding: 0 var(--edge-padding);
}

/* --- Logo -------------------------------------------------------------- */

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
}

.nav-logo img {
  width: 40px;
  height: 40px;
}

.nav-logo span {
  font-size: 1.45rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
}

.nav-logo span em {
  font-style: normal;
  font-weight: 500;
  color: var(--color-blue);
}

/* --- Links --------------------------------------------------------------
 *  Fills the remaining space between the logo and the nav-toggle, with
 *  links spread evenly across it — this is the "use the whole bar,
 *  uniform spacing" behavior.
 *  ------------------------------------------------------------------- */

.nav-links {
  display: flex;
  align-items: center;
  justify-content: space-evenly;
  flex: 1;
  height: 100%;
  margin: 0 2rem;
}

.nav-links a {
  position: relative;
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  padding: 0.5rem 0;
  transition: color var(--transition-fast);
}

.nav-links a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  background-color: var(--color-blue);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition-fast);
}

.nav-links a:hover,
.nav-links a:focus-visible {
  color: var(--color-white);
}

.nav-links a:hover::after,
.nav-links a:focus-visible::after {
  transform: scaleX(1);
}

/* --- CTA button ---------------------------------------------------------
 *  Pinned to the right, stays visible at every screen size — the hamburger
 *  only ever collapses the nav links, never this.
 *  ------------------------------------------------------------------- */

.nav-cta {
  flex-shrink: 0;
  display: inline-block;
  background-color: var(--color-blue);
  color: var(--color-black);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.6rem 1.5rem;
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
  transition: background-color var(--transition-fast), transform var(--transition-fast);
}

.nav-cta:hover,
.nav-cta:focus-visible {
  background-color: var(--color-white);
  transform: translateY(-1px);
}


/* --- Mobile toggle (checkbox hack — no JS) ------------------------------ */

.nav-toggle-input {
  display: none;
}

.nav-toggle-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  cursor: pointer;
}

.nav-toggle-btn span {
  display: block;
  width: 26px;
  height: 2px;
  background-color: var(--color-white);
  border-radius: 1px;
  transition: transform var(--transition-fast), opacity var(--transition-fast);
}


/* ==========================================================================
 *  Responsive — mobile navbar
 *  ========================================================================== */

@media (max-width: 768px) {
  .nav-links {
    position: absolute;
    top: var(--navbar-height);
    left: 0;
    right: 0;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    gap: 0;
    margin: 0;
    background-color: var(--color-bg);
    border-bottom: 1px solid rgba(127, 171, 222, 0.15);

    /* collapsed state */
    max-height: 0;
    overflow: hidden;
    visibility: hidden;
    transition: max-height var(--transition-fast), visibility var(--transition-fast);
  }

  .nav-links a {
    padding: 1.1rem var(--edge-padding);
    width: 100%;
  }

  .nav-links a::after {
    display: none; /* underline hover doesn't make sense in a stacked mobile list */
  }

  .nav-links a:hover,
  .nav-links a:focus-visible {
    background-color: var(--color-surface);
  }

  .nav-toggle-btn {
    display: flex;
    margin-left: 1.25rem;
  }

  /* expanded state, driven by the checkbox */
  .nav-toggle-input:checked ~ .nav-links {
    max-height: 60vh;
    visibility: visible;
  }

  .nav-toggle-input:checked ~ .nav-toggle-btn span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .nav-toggle-input:checked ~ .nav-toggle-btn span:nth-child(2) {
    opacity: 0;
  }

  .nav-toggle-input:checked ~ .nav-toggle-btn span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }
}
