/* ============================================================
   HiveMind Landing Page — Base styles & components
   Depends on css/tokens.css (load tokens.css first).
   ============================================================ */

/* ---- Self-hosted fonts (no external requests) ---- */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../assets/fonts/inter-400.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../assets/fonts/inter-500.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../assets/fonts/inter-600.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("../assets/fonts/inter-800.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 900;
  font-display: swap;
  src: url("../assets/fonts/inter-900.woff2") format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../assets/fonts/jetbrains-mono-400.woff2") format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../assets/fonts/jetbrains-mono-500.woff2") format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../assets/fonts/jetbrains-mono-700.woff2") format("woff2");
}

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

* {
  margin: 0;
}

html {
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  font-weight: 400;
  line-height: var(--lh-body);
  color: var(--offwhite);
  background-color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img,
picture,
svg,
video {
  display: block;
  max-width: 100%;
  height: auto;
}

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

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

ul,
ol {
  list-style: none;
  padding: 0;
}

/* ---- Headings & prose ---- */
h1,
h2,
h3,
h4 {
  font-family: var(--font-sans);
  line-height: var(--lh-heading);
  font-weight: 800;
}

h1,
h2,
h3 {
  text-wrap: balance;
  letter-spacing: var(--tracking-display);
}

h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); font-weight: 600; }
h4 { font-size: var(--fs-h4); font-weight: 600; }

p {
  text-wrap: pretty;
}

/* Constrain long-form reading measure */
.prose {
  max-width: var(--prose);
}

/* Hero display size — larger than a standard H1 */
.display {
  font-size: var(--fs-display);
  font-weight: 900;
  letter-spacing: var(--tracking-display);
}

/* ---- Layout ---- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2rem);
}

/* Generous vertical rhythm — one idea per fold */
.section {
  padding-block: var(--section-pad);
}

/* ---- The single mono kicker (hero only — used at most once page-wide) ---- */
.eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--fs-eyebrow);
  font-weight: 500;
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--hive-300);
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  padding: 0.75rem 1.5rem;
  border: 1px solid transparent;
  border-radius: var(--radius-button);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

/* Primary — teal fill. Text is --white (not --offwhite): off-white on
   --hive-500 computes ~4.44:1 and fails WCAG 4.5:1; --white is ~5.04:1. */
.btn--primary {
  background-color: var(--hive-500);
  color: var(--white);
}

.btn--primary:hover,
.btn--primary:focus-visible {
  background-color: var(--hive-700);
  box-shadow: var(--glow-teal);
}

/* Secondary — bordered, off-white text on the dark ground */
.btn--secondary {
  background-color: transparent;
  color: var(--offwhite);
  border-color: var(--line-dark);
}

.btn--secondary:hover,
.btn--secondary:focus-visible {
  border-color: var(--hive-300);
  color: var(--white);
}

/* ---- Rules ---- */
hr {
  border: 0;
  border-top: 1px solid var(--line-dark);
}

/* ---- Skip link (keyboard/screen-reader) ---- */
.skip-link {
  position: absolute;
  left: var(--space-md);
  top: -3rem;
  z-index: var(--z-toast);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-button);
  background-color: var(--hive-500);
  color: var(--white);
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: var(--space-md);
}

/* ---- Site header / primary nav (baseline layout; branded lockup = HM-435) ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: var(--z-nav);
  background-color: color-mix(in srgb, var(--ink) 88%, transparent);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line-dark);
}

.site-header nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-lg);
  flex-wrap: wrap;
  padding-block: var(--space-md);
}

.lockup {
  display: inline-flex;
  align-items: baseline;
  gap: var(--space-2xs);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.lockup__parent { color: var(--hive-500); }
.lockup__sep { color: var(--line-dark); font-weight: 400; }
.lockup__division { color: var(--offwhite); }

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-lg);
  font-size: var(--fs-sm);
  color: var(--muted-dark);
}

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

/* ---- Footer (baseline; Clickt lockup + Ember dot = HM-435) ---- */
.site-footer {
  border-top: 1px solid var(--line-dark);
  padding-block: var(--space-2xl);
  color: var(--muted-dark);
  font-size: var(--fs-sm);
}

/* ---- Focus visibility (keyboard) ---- */
:focus-visible {
  outline: 2px solid var(--hive-300);
  outline-offset: 2px;
}

/* ---- Motion: content-first, reduced-motion safe ---- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
