/* Race Internet — institutional site */

:root {
  --ink: #07110c;
  --ink-soft: #12201a;
  --panel: #0d1a14;
  --line: rgba(125, 255, 179, 0.14);
  --mist: #c8e6d4;
  --foam: #f2fbf5;
  --muted: #8fb39d;
  --green: #1f9b63;
  --green-bright: #3dd68c;
  --green-deep: #0f5c3a;
  --accent: #b8f26e;
  --danger: #ff7a6e;
  --radius: 14px;
  --shell: min(1120px, calc(100% - 2.5rem));
  --font-display: "Syne", "Avenir Next", "Segoe UI", sans-serif;
  --font-body: "Plus Jakarta Sans", "Avenir Next", "Segoe UI", sans-serif;
  --shadow-soft: 0 24px 60px rgba(0, 0, 0, 0.35);
  --header-h: 4.25rem;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--foam);
  background:
    radial-gradient(1200px 700px at 85% -10%, rgba(61, 214, 140, 0.16), transparent 55%),
    radial-gradient(900px 600px at -10% 20%, rgba(184, 242, 110, 0.08), transparent 50%),
    linear-gradient(180deg, #050b08 0%, var(--ink) 40%, #08140f 100%);
  background-attachment: fixed;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.35;
  background-image:
    linear-gradient(rgba(125, 255, 179, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(125, 255, 179, 0.04) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(ellipse at center, black 20%, transparent 75%);
  z-index: 0;
  animation: grid-drift 28s linear infinite;
}

@keyframes grid-drift {
  from { background-position: 0 0, 0 0; }
  to { background-position: 72px 36px, 36px 72px; }
}

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

a {
  color: var(--green-bright);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--accent);
}

h1,
h2,
h3,
.brand-lockup-text,
.logo-text,
.footer-brand {
  font-family: var(--font-display);
  letter-spacing: -0.03em;
  line-height: 1.08;
}

h1 {
  margin: 0;
  font-size: clamp(2.4rem, 6vw, 4.4rem);
  font-weight: 800;
}

h2 {
  margin: 0 0 1rem;
  font-size: clamp(1.8rem, 3.5vw, 2.75rem);
  font-weight: 700;
}

h3 {
  margin: 0 0 0.55rem;
  font-size: 1.35rem;
  font-weight: 700;
}

p {
  margin: 0 0 1rem;
}

p:last-child {
  margin-bottom: 0;
}

.shell {
  width: var(--shell);
  margin-inline: auto;
  position: relative;
  z-index: 1;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 100;
  padding: 0.75rem 1rem;
  background: var(--accent);
  color: var(--ink);
  font-weight: 700;
  border-radius: 999px;
}

.skip-link:focus {
  top: 1rem;
}

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  background: rgba(7, 17, 12, 0.72);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease, background 0.3s ease;
}

.site-header.is-scrolled {
  border-bottom-color: var(--line);
  background: rgba(7, 17, 12, 0.9);
}

.header-inner {
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--foam);
  text-decoration: none;
  font-weight: 700;
}

.logo:hover {
  color: var(--foam);
}

.logo-mark {
  display: block;
  width: auto;
  height: 2.35rem;
  object-fit: contain;
  flex-shrink: 0;
}

.logo-text {
  font-size: 1.05rem;
}

.nav {
  display: flex;
  align-items: center;
  gap: 1.35rem;
}

.nav a {
  color: var(--mist);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
}

.nav a:hover,
.nav a[aria-current="page"] {
  color: var(--foam);
}

.nav-cta {
  padding: 0.55rem 0.95rem;
  border: 1px solid rgba(61, 214, 140, 0.35);
  border-radius: 999px;
  color: var(--green-bright) !important;
}

.nav-cta:hover {
  border-color: var(--green-bright);
  background: rgba(61, 214, 140, 0.08);
}

.nav-toggle {
  display: none;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid var(--line);
  border-radius: 0.7rem;
  background: transparent;
  color: var(--foam);
  cursor: pointer;
  position: relative;
}

.nav-toggle span:not(.sr-only) {
  position: absolute;
  inset: 50% auto auto 50%;
  width: 1.1rem;
  height: 2px;
  background: currentColor;
  transform: translate(-50%, -50%);
  box-shadow: 0 -6px 0 currentColor, 0 6px 0 currentColor;
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 3rem;
  padding: 0.75rem 1.35rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-family: var(--font-body);
  font-size: 0.98rem;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.25s ease, background 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background: linear-gradient(120deg, var(--green-bright), var(--accent));
  color: var(--ink);
}

.btn-primary:hover {
  color: var(--ink);
  filter: brightness(1.05);
}

.btn-ghost {
  border-color: rgba(200, 230, 212, 0.28);
  color: var(--foam);
  background: rgba(255, 255, 255, 0.03);
}

.btn-ghost:hover {
  color: var(--foam);
  border-color: rgba(125, 255, 179, 0.55);
  background: rgba(61, 214, 140, 0.08);
}

.text-link {
  display: inline-flex;
  margin-top: 0.5rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--green-bright);
}

.text-link::after {
  content: " →";
}

/* Hero */

.hero {
  position: relative;
  min-height: calc(100svh - var(--header-h));
  display: grid;
  align-items: center;
  overflow: clip;
  isolation: isolate;
}

.hero-visual {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-atmosphere {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 55% at 70% 35%, rgba(31, 155, 99, 0.38), transparent 60%),
    radial-gradient(ellipse 50% 40% at 20% 80%, rgba(184, 242, 110, 0.12), transparent 55%),
    linear-gradient(160deg, #06110c 0%, #0a1c14 45%, #050b08 100%);
  animation: atmosphere-pulse 10s ease-in-out infinite alternate;
}

@keyframes atmosphere-pulse {
  from { filter: saturate(1) brightness(1); }
  to { filter: saturate(1.15) brightness(1.08); }
}

.hero-signal {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.9;
}

.signal-grid path {
  stroke-dasharray: 12 10;
  animation: signal-flow 18s linear infinite;
}

.signal-grid path:nth-child(2) {
  animation-duration: 22s;
  animation-direction: reverse;
}

.signal-grid path:nth-child(3) {
  animation-duration: 26s;
}

@keyframes signal-flow {
  from { stroke-dashoffset: 0; }
  to { stroke-dashoffset: -220; }
}

.signal-nodes circle {
  animation: node-pulse 3.6s ease-in-out infinite;
}

.signal-nodes circle:nth-child(2) { animation-delay: 0.4s; }
.signal-nodes circle:nth-child(3) { animation-delay: 0.8s; }
.signal-nodes circle:nth-child(4) { animation-delay: 1.2s; }
.signal-nodes circle:nth-child(5) { animation-delay: 1.6s; }

@keyframes node-pulse {
  0%, 100% { opacity: 0.35; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.35); }
}

.hero-copy {
  position: relative;
  z-index: 1;
  padding: clamp(1.5rem, 5vh, 3.5rem) 0;
  max-width: 44rem;
  margin-left: max(calc((100% - var(--shell)) / 2), 1.25rem);
  margin-right: auto;
  width: min(44rem, calc(100% - 2.5rem));
}

.hero-copy h1 {
  font-size: clamp(1.85rem, 4.4vw, 3.15rem);
  max-width: 20ch;
  margin-bottom: 1rem;
}

.hero-copy .hero-lead {
  margin-bottom: 0;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin: 0 0 1rem;
}

.brand-lockup-mark {
  display: block;
  width: auto;
  height: clamp(4.5rem, 12vw, 6.5rem);
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 12px 28px rgba(0, 0, 0, 0.35));
}

.brand-lockup-text {
  margin: 0;
  font-size: clamp(1.35rem, 2.6vw, 1.85rem);
  font-weight: 800;
  color: var(--accent);
}

.hero-lead,
.page-lead,
.lede {
  font-size: clamp(1.05rem, 1.5vw, 1.2rem);
  color: var(--mist);
  max-width: 38rem;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 1.35rem;
}

html.js:not(.reduce-motion) .hero-copy .brand-lockup,
html.js:not(.reduce-motion) .hero-copy h1,
html.js:not(.reduce-motion) .hero-copy .hero-lead,
html.js:not(.reduce-motion) .hero-copy .hero-cta {
  opacity: 0;
  transform: translateY(18px);
  animation: rise-in 0.9s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

html.js:not(.reduce-motion) .hero-copy .brand-lockup {
  animation-delay: 0s;
}

html.js:not(.reduce-motion) .hero-copy h1 { animation-delay: 0.12s; }
html.js:not(.reduce-motion) .hero-copy .hero-lead { animation-delay: 0.24s; }
html.js:not(.reduce-motion) .hero-copy .hero-cta { animation-delay: 0.36s; }

@keyframes rise-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Page hero (inner pages) */

.page-hero {
  padding: clamp(3rem, 8vh, 5rem) 0 1rem;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(31, 155, 99, 0.12), transparent 70%);
}

.page-hero-inner {
  max-width: 40rem;
}

.page-lead {
  margin-top: 1rem;
}

/* Sections */

.section {
  padding: clamp(3.5rem, 9vh, 6rem) 0;
  position: relative;
  z-index: 1;
}

.section-alt {
  background: linear-gradient(180deg, rgba(18, 32, 26, 0.65), rgba(7, 17, 12, 0.2));
  border-block: 1px solid var(--line);
}

.section-narrow {
  max-width: 40rem;
}

.eyebrow {
  margin: 0 0 0.75rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--green-bright);
}

.focus-intro {
  max-width: 36rem;
  margin-bottom: 2.5rem;
}

.focus-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 2rem 3rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  padding-top: 2rem;
}

.focus-list li {
  border: 0;
  padding: 0;
  background: none;
}

.focus-list p {
  color: var(--muted);
}

.plain-list {
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.85rem;
}

.plain-list li {
  padding-left: 1.25rem;
  position: relative;
  color: var(--mist);
}

.plain-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.65rem;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--green-bright);
}

.section-careers {
  padding-bottom: clamp(4rem, 10vh, 7rem);
}

.careers-band {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 2rem;
  padding: 2rem 0 0;
  border-top: 1px solid var(--line);
}

.careers-band p:not(.eyebrow) {
  color: var(--mist);
  max-width: 34rem;
}

/* Form */

.form-shell {
  max-width: 44rem;
}

.form-intro {
  margin-bottom: 2rem;
}

.interest-form {
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 4px);
  background:
    linear-gradient(160deg, rgba(18, 32, 26, 0.92), rgba(10, 22, 17, 0.88));
  box-shadow: var(--shadow-soft);
}

.interest-form fieldset {
  border: 0;
  margin: 0 0 1.75rem;
  padding: 0;
}

.interest-form legend {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 1rem;
  padding: 0;
}

.field {
  display: grid;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

label {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--mist);
}

.optional {
  font-weight: 500;
  color: var(--muted);
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid rgba(125, 255, 179, 0.18);
  border-radius: 0.8rem;
  background: rgba(5, 11, 8, 0.65);
  color: var(--foam);
  font: inherit;
  padding: 0.8rem 0.95rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--green-bright);
  box-shadow: 0 0 0 3px rgba(61, 214, 140, 0.18);
}

textarea {
  resize: vertical;
  min-height: 6rem;
}

select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--green-bright) 50%),
    linear-gradient(135deg, var(--green-bright) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) calc(50% - 3px),
    calc(100% - 12px) calc(50% - 3px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.form-actions {
  display: grid;
  gap: 0.85rem;
}

.form-note {
  font-size: 0.88rem;
  color: var(--muted);
}

.form-status {
  margin-top: 1rem;
  padding: 0.9rem 1rem;
  border-radius: 0.8rem;
  border: 1px solid rgba(61, 214, 140, 0.35);
  background: rgba(31, 155, 99, 0.15);
  color: var(--mist);
}

.form-status.is-error {
  border-color: rgba(255, 122, 110, 0.45);
  background: rgba(255, 122, 110, 0.12);
}

.field.is-invalid input,
.field.is-invalid select,
.field.is-invalid textarea {
  border-color: var(--danger);
}

/* Footer */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 2rem 0 2.5rem;
  position: relative;
  z-index: 1;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.footer-brand {
  margin: 0 0 0.25rem;
  font-size: 1.1rem;
  font-weight: 700;
}

.footer-meta,
.footer-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.92rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.25rem;
}

.footer-links a:hover {
  color: var(--foam);
}

/* Reveal on scroll */

.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Responsive */

@media (max-width: 860px) {
  .focus-list {
    grid-template-columns: 1fr;
    gap: 1.75rem;
  }

  .careers-band {
    flex-direction: column;
    align-items: start;
  }

  .field-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  :root {
    --shell: min(1120px, calc(100% - 1.5rem));
  }

  .nav-toggle {
    display: inline-block;
  }

  .nav {
    position: absolute;
    top: calc(100% + 0.35rem);
    right: 0.75rem;
    left: 0.75rem;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0.35rem;
    padding: 0.85rem;
    border: 1px solid var(--line);
    border-radius: 1rem;
    background: rgba(8, 18, 13, 0.96);
    box-shadow: var(--shadow-soft);
  }

  .nav.is-open {
    display: flex;
  }

  .nav a {
    padding: 0.75rem 0.85rem;
    border-radius: 0.7rem;
  }

  .nav-cta {
    text-align: center;
  }

  .hero-copy {
    margin-left: auto;
    margin-right: auto;
  }

  .footer-inner {
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  .reveal,
  .hero-copy .brand-lockup,
  .hero-copy h1,
  .hero-copy .hero-lead,
  .hero-copy .hero-cta {
    opacity: 1;
    transform: none;
  }
}
