/* ==========================================================================
   RackTide landing page: hero
   Fonts: Antonio (display), Inter (body). Loaded from Google Fonts in index.html.
   ========================================================================== */

:root {
  --bg: #0a0f15;
  --blue: #2fb0f1;          /* matches the logo chevrons */
  --blue-bright: #5cc4f8;
  --blue-ink: #04202f;      /* text on blue buttons */
  --text: #e9eef4;
  --muted: #b3bfcc;

  --font-display: 'Antonio', 'Arial Narrow', Impact, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;

  /* One grid cell. The canvas snaps its grid to the stat boxes, which are
     exactly one cell each, so this single value drives the whole hero. */
  --cell: clamp(180px, 22vw, 250px);
  --gutter: clamp(20px, 3.4vw, 48px);

  /* One size for every main section title (hero, story, numbers) */
  --title-size: clamp(46px, 7.4vw, 92px);
  --title-leading: 0.98;
  --title-tracking: 0.025em;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a:focus-visible {
  outline: 2px solid var(--blue-bright);
  outline-offset: 3px;
}

/* --------------------------------------------------------------------------
   Announcement bar (above the hero)
   -------------------------------------------------------------------------- */
.announce {
  position: relative;
  z-index: 4;
  background: var(--blue);
  color: var(--blue-ink);
}

.announce__text {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0;
  padding: 10px var(--gutter);
  font: 500 13px / 1.4 var(--font-body);
  text-align: center;
}

.announce__text strong { font-weight: 600; }

.announce__date { white-space: nowrap; }

.announce__icon {
  flex: none;
  width: 15px;
  height: 15px;
}

/* --------------------------------------------------------------------------
   Hero shell
   -------------------------------------------------------------------------- */
.hero {
  /* Room under the stats so a hovered stat's glow isn't clipped, and space
     for the grid to fade out before the next section. */
  --hero-fade: clamp(180px, 20vw, 280px);
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
  padding-bottom: clamp(40px, 4.5vw, 64px);
  overflow: hidden;
  background: var(--bg);
}

.hero__grid {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  /* Fade the animated grid into the plain background along the bottom edge,
     so the hero melts into the next section instead of stopping on a line. */
  -webkit-mask-image: linear-gradient(to bottom, #000 0, #000 calc(100% - var(--hero-fade)), transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0, #000 calc(100% - var(--hero-fade)), transparent 100%);
}

.hero > :not(.hero__grid) {
  position: relative;
  z-index: 1;
}

/* Header stacks above the headline so the phone menu can hang over it */
.hero > .hero__header { z-index: 3; }

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
.hero__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px 24px;
  padding: 26px var(--gutter);
}

.logo {
  display: inline-flex;
  line-height: 0;
}

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

.hero__actions {
  position: relative; /* fallback anchor for the phone menu on small screens */
  display: flex;
  align-items: center;
  gap: 14px;
  margin-left: auto;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  border-radius: 4px;
  font: 600 12px/1 var(--font-body);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.25s ease, box-shadow 0.25s ease, color 0.25s ease, transform 0.25s ease;
}

.btn--primary {
  padding: 0 22px;
  background: var(--blue);
  color: var(--blue-ink);
}

.btn--primary:hover {
  background: var(--blue-bright);
  box-shadow: 0 0 26px rgba(47, 176, 241, 0.45);
}

.btn--icon {
  width: 38px;
  padding: 0;
  border: 1.5px solid var(--blue);
  color: var(--blue);
  background: transparent;
  cursor: pointer;
  font: inherit;
}

.btn--icon[aria-expanded="true"] {
  background: var(--blue);
  color: var(--blue-ink);
  box-shadow: 0 0 22px rgba(47, 176, 241, 0.45);
}

.btn--icon svg {
  width: 16px;
  height: 16px;
}

.btn--icon:hover {
  background: rgba(47, 176, 241, 0.12);
  color: var(--blue-bright);
  box-shadow: 0 0 20px rgba(47, 176, 241, 0.35);
}

/* Phone menu: small popover under the call button */
.phone { position: relative; }

.phone-menu {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  min-width: 260px;
  padding: 10px;
  border-radius: 10px;
  background: rgba(13, 19, 26, 0.96);
  border: 1px solid rgba(47, 176, 241, 0.35);
  box-shadow:
    0 0 0 1px rgba(47, 176, 241, 0.08),
    0 0 28px rgba(47, 176, 241, 0.18),
    0 24px 48px -20px rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  transform: translateY(-8px) scale(0.98);
  /* --caret-right is set by site.js so the caret points at the phone button */
  --caret-right: 13px;
  transform-origin: calc(100% - var(--caret-right) - 5px) top;
  transition: opacity 0.22s ease, transform 0.26s cubic-bezier(0.2, 0.8, 0.2, 1);
  z-index: 5;
}

.phone-menu[hidden] { display: none; }

.phone-menu.is-open {
  opacity: 1;
  transform: none;
}

/* Caret pointing up at the button */
.phone-menu::before {
  content: '';
  position: absolute;
  top: -6px;
  right: var(--caret-right);
  width: 10px;
  height: 10px;
  background: rgba(13, 19, 26, 0.96);
  border-left: 1px solid rgba(47, 176, 241, 0.35);
  border-top: 1px solid rgba(47, 176, 241, 0.35);
  transform: rotate(45deg);
}

.phone-menu__title {
  margin: 4px 8px 8px;
  font: 600 11px / 1 var(--font-body);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8fa3b8;
}

.phone-menu__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 10px 10px 8px;
  border-radius: 7px;
  color: var(--text);
  text-decoration: none;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.phone-menu__item + .phone-menu__item { margin-top: 2px; }

.phone-menu__item:hover,
.phone-menu__item:focus-visible {
  background: rgba(47, 176, 241, 0.12);
  outline: none;
}

.phone-menu__flag {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 6px;
  border: 1px solid rgba(47, 176, 241, 0.4);
  background: rgba(47, 176, 241, 0.08);
  font: 700 11px / 1 var(--font-body);
  letter-spacing: 0.06em;
  color: var(--blue-bright);
}

.phone-menu__text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.phone-menu__label {
  font: 600 13px / 1.2 var(--font-body);
  color: #ffffff;
}

.phone-menu__number {
  font: 400 13px / 1.2 var(--font-body);
  color: #b3bfcc;
  transition: color 0.2s ease;
  white-space: nowrap;
}

.phone-menu__go {
  flex: none;
  width: 16px;
  height: 16px;
  margin-left: auto;
  color: var(--blue);
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 0.2s ease, transform 0.25s ease;
}

.phone-menu__item:hover .phone-menu__number,
.phone-menu__item:focus-visible .phone-menu__number { color: var(--blue-bright); }

.phone-menu__item:hover .phone-menu__go,
.phone-menu__item:focus-visible .phone-menu__go {
  opacity: 1;
  transform: none;
}

/* --------------------------------------------------------------------------
   Headline
   -------------------------------------------------------------------------- */
.hero__body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px var(--gutter) 48px;
}

.hero__title {
  margin: 0;
  font: 700 var(--title-size) / var(--title-leading) var(--font-display);
  letter-spacing: var(--title-tracking);
  text-transform: uppercase;
  text-align: center;
  color: var(--text);
  text-shadow: 0 2px 40px rgba(0, 0, 0, 0.55);
}

.hero__title span { display: block; }

/* --------------------------------------------------------------------------
   Stats row. Each .stat is exactly one grid cell; the canvas aligns to it.
   -------------------------------------------------------------------------- */
.stats {
  list-style: none;
  margin: 0 auto;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, var(--cell));
}

.stat {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: var(--cell);
  aspect-ratio: 1 / 1;
  padding: 24px;
  text-align: center;
  text-decoration: none;
  color: inherit;
  outline-offset: -6px;
}

.stat__value {
  font: 700 clamp(26px, 2.4vw, 34px) / 1 var(--font-display);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text);
  transition: color 0.35s ease, text-shadow 0.35s ease;
}

.stat__label {
  max-width: 19ch;
  font: 400 13px / 1.45 var(--font-body);
  color: var(--muted);
  transition: color 0.35s ease;
}

/* Footnote marker on a stat, and the footnote under the row */
.stat__mark,
.stats__note > span { color: var(--blue-bright); }

.stat__mark { margin-left: 1px; }

.stats__note {
  max-width: calc(var(--cell) * 4);
  margin: clamp(20px, 2.4vw, 32px) auto 0;
  padding: 0 var(--gutter);
  font: italic 400 12px / 1.6 var(--font-body);
  color: #8d9aa8;
  text-align: center;
}

.stats__note > span { margin-right: 2px; font-style: normal; }

/* The box that lights up on hover: glowing edges, a faint fill, and four
   bright corner nodes to match the canvas language. */
.stat::before {
  content: '';
  position: absolute;
  inset: 0;
  border: 1px solid rgba(120, 200, 255, 0);
  background: rgba(47, 176, 241, 0);
  box-shadow:
    0 0 0 rgba(47, 176, 241, 0),
    inset 0 0 0 rgba(47, 176, 241, 0);
  transition: border-color 0.35s ease, background-color 0.35s ease, box-shadow 0.35s ease;
  pointer-events: none;
}

.stat::after {
  content: '';
  position: absolute;
  inset: -7px;
  opacity: 0;
  background:
    radial-gradient(circle, rgba(190, 232, 255, 0.95) 0 1.5px, rgba(60, 160, 255, 0.45) 3px, transparent 7px) 0 0 / 14px 14px no-repeat,
    radial-gradient(circle, rgba(190, 232, 255, 0.95) 0 1.5px, rgba(60, 160, 255, 0.45) 3px, transparent 7px) 100% 0 / 14px 14px no-repeat,
    radial-gradient(circle, rgba(190, 232, 255, 0.95) 0 1.5px, rgba(60, 160, 255, 0.45) 3px, transparent 7px) 0 100% / 14px 14px no-repeat,
    radial-gradient(circle, rgba(190, 232, 255, 0.95) 0 1.5px, rgba(60, 160, 255, 0.45) 3px, transparent 7px) 100% 100% / 14px 14px no-repeat;
  transition: opacity 0.35s ease;
  pointer-events: none;
}

.stat:hover::before,
.stat:focus-visible::before {
  border-color: rgba(150, 215, 255, 0.95);
  background: rgba(47, 176, 241, 0.10);
  box-shadow:
    0 0 6px rgba(120, 200, 255, 0.55),
    0 0 40px rgba(47, 176, 241, 0.45),
    inset 0 0 40px rgba(47, 176, 241, 0.22);
}

.stat:hover::after,
.stat:focus-visible::after {
  opacity: 1;
}

.stat:hover .stat__value,
.stat:focus-visible .stat__value {
  color: #ffffff;
  text-shadow: 0 0 18px rgba(120, 200, 255, 0.6);
}

.stat:hover .stat__label,
.stat:focus-visible .stat__label {
  color: #dbe6f0;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 719px) {
  :root { --cell: 50vw; }

  .hero__header { padding: 18px var(--gutter); gap: 12px; }
  .hero__actions { gap: 8px; }
  .logo img { height: 18px; }
  .btn { height: 32px; }
  .btn--primary { padding: 0 10px; font-size: 10px; letter-spacing: 0.02em; }
  .btn--icon { width: 32px; }
  .btn--icon svg { width: 14px; height: 14px; }
  /* Anchor the menu to the whole actions group so it stays on screen */
  .phone { position: static; }
  .phone-menu { min-width: 240px; }

  .hero__body { padding: 24px var(--gutter) 40px; }
  :root { --title-size: clamp(40px, 12vw, 56px); }
  .hero__title span { display: inline; }

  .stats { grid-template-columns: repeat(2, var(--cell)); }
  .stat { padding: 18px; gap: 8px; }
  .stat__value { font-size: 26px; }
  .stat__label { font-size: 12px; }
  .stats__note { font-size: 11px; }

  .announce__text { font-size: 12px; padding-top: 9px; padding-bottom: 9px; }
}

@media (prefers-reduced-motion: reduce) {
  .btn, .stat::before, .stat::after, .stat__value, .stat__label,
  .phone-menu, .phone-menu__item, .phone-menu__go, .phone-menu__number { transition: none; }
}
