/* ==========================================================================
   Stride landing page — styles.css
   Design system: clean, minimal, modern YC startup aesthetic. Mobile-first.

   HOW TO READ THIS FILE (order matches the page roughly top → bottom):
   1. :root tokens          — colors, radii, shadows, fonts, motion, dividers
   2. Reset + base          — box model, html/body, links, [hidden]
   3. Layout primitives     — .container, .section, .section-rule <hr>
   4. Header + nav          — sticky glass bar, wordmark, .nav__link
   5. Buttons               — .btn variants, loading spinner
   6. Hero                  — headline + CTAs
   7. Section heads         — .eyebrow, .section__title, .section__sub
   8. Cards                 — “For candidates” three-up grid
   9. Form + chips          — .panel, inputs, honeypot, success state
   10. Founders + story     — two-column founders; story intro + profile columns
   11. Footer               — compact bar, centered legal
   12. Reveal + a11y       — .reveal / .is-visible, prefers-reduced-motion

   main.js pairs: .header.is-scrolled | .reveal + IntersectionObserver
   ========================================================================== */

/* ---------- 1. Design tokens (CSS variables) ---------- */
:root {
  /* Brand + neutrals */
  --color-primary: #0f84ff;
  --color-primary-600: #0a6fd9;
  --color-primary-700: #085ab0;
  --color-secondary: #f0f7ff;
  --color-surface: #ffffff;

  --color-ink: #0a0a0a;
  --color-muted: #6b7280;
  --color-muted-2: #9ca3af;

  --color-bg: #ffffff;
  --color-bg-soft: #f6f7f9;
  --color-border: #e7e8ec;
  --color-border-strong: #d4d6dd;

  --color-error: #d12d2d;

  /* Corners + elevation */
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-pill: 999px;

  --shadow-xs: 0 1px 2px rgba(10, 10, 10, 0.04);
  --shadow-sm: 0 1px 3px rgba(10, 10, 10, 0.06), 0 1px 2px rgba(10, 10, 10, 0.04);
  --shadow-md: 0 4px 16px rgba(10, 10, 10, 0.06), 0 1px 3px rgba(10, 10, 10, 0.04);
  --shadow-lg: 0 12px 40px rgba(10, 60, 140, 0.08), 0 2px 6px rgba(10, 10, 10, 0.05);
  --shadow-focus: 0 0 0 4px rgba(15, 132, 255, 0.18);

  /* Max content width; .container--narrow used under the form */
  --container: 1180px;
  --container-narrow: 720px;

  /* Headlines vs body (loaded from Google Fonts in index.html <head>) */
  --font-display: "Space Grotesk", ui-sans-serif, system-ui, -apple-system,
    "Segoe UI", Roboto, sans-serif;
  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI",
    Roboto, sans-serif;

  /* Easing curves for hovers / reveals */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);

  /* <hr class="section-rule"> — horizontal triple-line dividers between sections */
  --section-rule-height: 7px;
  --section-rule-gradient: linear-gradient(
    to bottom,
    rgba(15, 132, 255, 0.16) 0,
    rgba(15, 132, 255, 0.16) 1.5px,
    transparent 1.5px,
    transparent 2.75px,
    rgba(15, 132, 255, 0.22) 2.75px,
    rgba(15, 132, 255, 0.22) 4.25px,
    transparent 4.25px,
    transparent 5.5px,
    rgba(15, 132, 255, 0.16) 5.5px,
    rgba(15, 132, 255, 0.16) 7px
  );
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* Offset anchor targets so sticky header (~80px + safe area) does not cover titles */
  scroll-padding-top: calc(92px + env(safe-area-inset-top, 0px));
  min-height: 100%;
  /* Overscroll / bounce: match header tint so no harsh strip above the bar */
  background-color: var(--color-secondary);
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-ink);
  background-color: transparent;
  min-height: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  position: relative;
}

.header,
main,
.footer {
  position: relative;
}

main {
  background-color: var(--color-surface);
}

/* Visual separator: not a semantic rule — purely decorative (aria-hidden in HTML). */
.section-rule {
  display: block;
  /* Match .container content width: full width minus side padding, capped by container max-width */
  width: calc(100% - 48px);
  max-width: calc(var(--container) - 48px);
  height: var(--section-rule-height);
  margin-left: auto;
  margin-right: auto;
  margin-top: 0;
  margin-bottom: 0;
  border: 0;
  padding: 0;
  color: transparent;
  background: var(--section-rule-gradient);
  background-repeat: no-repeat;
  background-size: 100% var(--section-rule-height);
  border-radius: 999px;
  opacity: 0.85;
}

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

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

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

/* The HTML5 hidden attribute must beat layout display rules. */
[hidden] {
  display: none !important;
}

::selection {
  background: rgba(15, 132, 255, 0.18);
  color: var(--color-ink);
}

/* ---------- Layout primitives ---------- */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

.container--narrow {
  max-width: var(--container-narrow);
}

.section {
  padding: 96px 0;
  position: relative;
}

@media (max-width: 720px) {
  .section {
    padding: 64px 0;
  }
}

/*
 * Dividers sit between blocks; gap = padding-bottom above + padding-top below.
 * Slightly less padding only next to .section-rule (rest of section rhythm unchanged).
 */
.hero:has(+ .section-rule) {
  padding-bottom: 80px;
}

.section:has(+ .section-rule) {
  padding-bottom: 80px;
}

.section-rule + .section {
  padding-top: 80px;
}

@media (max-width: 720px) {
  .hero:has(+ .section-rule) {
    padding-bottom: 56px;
  }

  .section:has(+ .section-rule) {
    padding-bottom: 56px;
  }

  .section-rule + .section {
    padding-top: 56px;
  }
}

/* ---------- Header (sticky; .is-scrolled from main.js) ---------- */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  padding-top: env(safe-area-inset-top, 0px);
  background: rgba(240, 247, 255, 0.82);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.header.is-scrolled {
  border-bottom-color: var(--color-border);
  background: rgba(240, 247, 255, 0.94);
}

.header__inner {
  display: flex;
  align-items: center;
  gap: 20px;
  height: 80px;
}

.header .wordmark {
  gap: 10px;
  flex-shrink: 0;
}

.header__cta {
  flex-shrink: 0;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  flex: 1;
  min-width: 0;
}

@media (max-width: 820px) {
  .nav {
    display: none;
  }

  .header__cta {
    margin-left: auto;
  }
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.02em;
  color: var(--color-ink);
}

.wordmark__logo {
  width: auto;
  height: 40px;
  flex-shrink: 0;
  object-fit: contain;
}

.wordmark__text {
  color: var(--color-primary);
}

.nav__link {
  font-size: 15px;
  font-weight: 500;
  color: var(--color-muted);
  transition: color 0.15s ease;
  position: relative;
}

.nav__link:hover {
  color: var(--color-ink);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 600;
  font-family: var(--font-sans);
  letter-spacing: -0.005em;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s var(--ease-out),
    background-color 0.15s ease, color 0.15s ease,
    box-shadow 0.2s ease, border-color 0.15s ease;
  white-space: nowrap;
  user-select: none;
  position: relative;
  text-decoration: none;
}

.btn:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
}

.btn--primary {
  background: var(--color-primary);
  color: #fff;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.15) inset,
    0 1px 2px rgba(8, 90, 176, 0.25);
}

.btn--primary:hover {
  background: var(--color-primary-600);
  transform: translateY(-1px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.18) inset,
    0 6px 18px rgba(15, 132, 255, 0.25);
}

.btn--primary:active {
  transform: translateY(0);
  background: var(--color-primary-700);
}

.btn--ghost {
  background: var(--color-surface);
  color: var(--color-ink);
  border-color: var(--color-border);
  box-shadow: var(--shadow-xs);
}

.btn--ghost:hover {
  border-color: var(--color-ink);
  background: var(--color-bg-soft);
  transform: translateY(-1px);
}

.btn--sm {
  padding: 9px 16px;
  font-size: 14px;
  border-radius: 9px;
}

.btn--block {
  width: 100%;
}

/* .is-loading toggled during form POST — hides label, shows .btn__spinner */
.btn[disabled],
.btn.is-loading {
  cursor: not-allowed;
  opacity: 0.85;
  pointer-events: none;
}

.btn__spinner {
  display: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  animation: spin 0.7s linear infinite;
}

.btn.is-loading .btn__label {
  visibility: hidden;
}

.btn.is-loading .btn__spinner {
  display: inline-block;
  position: absolute;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 88px 0 96px;
  overflow: hidden;
  background: transparent;
}

@media (max-width: 720px) {
  .hero {
    padding: 56px 0 64px;
  }
}

.hero__inner {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero__copy {
  width: 100%;
  max-width: 50rem;
  margin: 0 auto;
  text-align: center;
}

.hero__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(36px, 6.4vw, 72px);
  line-height: 1.08;
  letter-spacing: -0.035em;
  margin: 0 0 22px;
  color: var(--color-ink);
}

.hero__sub {
  font-size: clamp(16px, 1.6vw, 19px);
  line-height: 1.55;
  color: var(--color-muted);
  margin: 0 0 36px;
}

.hero__ctas {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

/* ---------- Section heads ---------- */
.section__head {
  max-width: 720px;
  margin: 0 0 56px;
}

.section__head--center {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.eyebrow {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-primary);
  margin-bottom: 14px;
}

@media (min-width: 721px) {
  .eyebrow {
    font-size: 14px;
    letter-spacing: 0.11em;
  }
}

.section__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(30px, 4vw, 44px);
  line-height: 1.1;
  letter-spacing: -0.025em;
  margin: 0 0 16px;
  color: var(--color-ink);
}

.section__sub {
  font-size: 17px;
  line-height: 1.55;
  color: var(--color-muted);
  margin: 0;
  max-width: 56ch;
}

.section__head--center .section__sub {
  margin-left: auto;
  margin-right: auto;
}

/* ---------- Cards (candidates) ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

@media (max-width: 880px) {
  .cards {
    grid-template-columns: 1fr;
  }
}

.card {
  position: relative;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 28px 26px 30px;
  transition: border-color 0.2s ease, transform 0.2s var(--ease-out),
    box-shadow 0.25s ease;
}

.card:hover {
  border-color: var(--color-border-strong);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.card__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--color-secondary);
  color: var(--color-primary);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 22px;
}

.card__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 19px;
  letter-spacing: -0.015em;
  margin: 0 0 10px;
  color: var(--color-ink);
}

.card__body {
  font-size: 15px;
  line-height: 1.6;
  color: var(--color-muted);
  margin: 0;
}

/* ---------- Form panel (#intake-form + #success-state swap) ---------- */
.panel {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: 32px;
  box-shadow: var(--shadow-lg);
  position: relative;
}

@media (max-width: 540px) {
  .panel {
    padding: 24px 20px;
    border-radius: 16px;
  }
}

.form {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.label {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-ink);
  letter-spacing: -0.005em;
}

.hint {
  /* Pull toward the label above (only hint on the page; keeps chips spacing via .field gap) */
  margin: -7px 0 0;
  font-size: 12px;
  color: var(--color-muted);
}

.input {
  width: 100%;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 11px 13px;
  font-size: 14px;
  color: var(--color-ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease,
    background 0.15s ease;
}

.input::placeholder {
  color: var(--color-muted-2);
}

.input:hover {
  border-color: var(--color-border-strong);
}

.input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: var(--shadow-focus);
}

.input.has-error {
  border-color: var(--color-error);
}

.input.has-error:focus {
  box-shadow: 0 0 0 4px rgba(209, 45, 45, 0.18);
}

.error {
  margin: 0;
  font-size: 13px;
  color: var(--color-error);
  min-height: 0;
  transition: min-height 0.15s ease;
}

.error:not(:empty) {
  min-height: 16px;
}

.form-error {
  margin: 0;
  font-size: 14px;
  color: var(--color-error);
  text-align: center;
}

/* Chips: checkbox or radio, visually hidden; :has() for checked style */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 8px 13px;
  border-radius: var(--radius-pill);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  font-size: 13px;
  font-weight: 500;
  color: var(--color-ink);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease,
    color 0.15s ease, transform 0.15s var(--ease-out);
  user-select: none;
}

.chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 1px;
  height: 1px;
}

.chip:hover {
  border-color: var(--color-border-strong);
  transform: translateY(-1px);
}

.chip:has(input:focus-visible) {
  box-shadow: var(--shadow-focus);
  border-color: var(--color-primary);
}

.chip:has(input:checked) {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

.chip:has(input:checked):hover {
  background: var(--color-primary-600);
  border-color: var(--color-primary-600);
}

.chips.has-error {
  padding: 4px;
  margin: -4px;
  border-radius: var(--radius-md);
  outline: 2px solid var(--color-error);
  outline-offset: 2px;
}

select.input {
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%230f84ff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 40px;
}

/*
 * Honeypot (.hp): off-screen so humans never see it; bots that fill all inputs
 * trigger discard on the server (see candidate-intake.ts).
 */
.hp {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Success state */
.success {
  text-align: center;
  padding: 24px 8px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  animation: rise 0.4s var(--ease-out) both;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.success__check {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--color-secondary);
  color: var(--color-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.success__check svg {
  width: 26px;
  height: 26px;
}

.success__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 22px;
  letter-spacing: -0.015em;
  margin: 0;
}

/* ---------- For founders ---------- */
.founders {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: start;
  position: relative;
}

@media (max-width: 880px) {
  .founders {
    grid-template-columns: 1fr;
    gap: 40px;
  }
}

.founders__copy,
.founders__list {
  position: relative;
  z-index: 1;
}

.founders__lead {
  font-size: 17px;
  line-height: 1.6;
  color: var(--color-muted);
  margin: 0 0 24px;
  max-width: 44ch;
}

/* Mail row in founders block: same layout as .story-profile__linkedin, brand colors. */
.founders__mailto.story-profile__linkedin {
  justify-content: flex-start;
  color: var(--color-primary);
}

.founders__mailto.story-profile__linkedin:hover {
  color: var(--color-primary-700);
}

.founders__mailto.story-profile__linkedin span {
  overflow-wrap: anywhere;
  text-align: left;
}

.founders__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-top: 1px solid var(--color-border);
}

.founders__list li {
  display: flex;
  gap: 18px;
  padding: 22px 4px;
  border-bottom: 1px solid var(--color-border);
}

.founders__step {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--color-secondary);
  color: var(--color-primary);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 13px;
}

.founders__list h4 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 17px;
  letter-spacing: -0.015em;
  margin: 2px 0 6px;
  color: var(--color-ink);
}

.founders__list p {
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--color-muted);
  margin: 0;
}

/* ---------- Our story (intro + two founder columns) ---------- */
.story-intro {
  max-width: 52ch;
  margin: 0 auto;
  text-align: center;
}

.story-intro p {
  margin: 0 0 1rem;
  font-size: 17px;
  line-height: 1.6;
  color: var(--color-muted);
}

.story-intro p:last-child {
  margin-bottom: 0;
}

.story-profiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 32px 40px;
  max-width: 880px;
  margin: 0 auto;
}

@media (max-width: 640px) {
  .story-profiles {
    grid-template-columns: 1fr;
    gap: 36px;
  }
}

.story-profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 28px 22px 30px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  background: var(--color-bg);
  box-shadow: var(--shadow-xs);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.story-profile:hover {
  border-color: var(--color-border-strong);
  box-shadow: var(--shadow-sm);
}

.story-profile__photo {
  width: 112px;
  height: 112px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 0 18px;
  box-shadow: 0 0 0 3px rgba(15, 132, 255, 0.12);
}

.story-profile__body {
  width: 100%;
  max-width: 38ch;
}

.story-profile__name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 19px;
  letter-spacing: -0.02em;
  margin: 0 0 12px;
  color: var(--color-ink);
}

.story-profile__bio {
  margin: 0 0 18px;
  font-size: 15px;
  line-height: 1.58;
  color: var(--color-muted);
  text-align: center;
}

.story-profile__linkedin {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  color: #0a66c2;
  text-decoration: none;
  transition: color 0.15s ease, transform 0.15s var(--ease-out);
}

.story-profile__linkedin:hover {
  color: #004182;
  transform: translateY(-1px);
}

.story-profile__linkedin:focus-visible {
  outline: none;
  border-radius: 6px;
  box-shadow: var(--shadow-focus);
}

.story-profile__linkedin-logo {
  flex-shrink: 0;
  display: block;
}

/* ---------- Footer (match .header surface: soft blue tint + frosted glass) ---------- */
.footer {
  padding: 20px 0 calc(16px + env(safe-area-inset-bottom, 0px));
  border-top: none;
  background: rgba(240, 247, 255, 0.82);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
}

.footer__inner {
  text-align: center;
}

.footer__legal {
  font-size: 13px;
  color: var(--color-muted);
  margin: 0;
  text-align: center;
}

.footer__sep {
  margin: 0 0.35em;
}

.footer__link {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.footer__link:hover {
  color: var(--color-ink);
}

.footer__link:focus-visible {
  outline: none;
  border-radius: 4px;
  box-shadow: var(--shadow-focus);
}

/*
 * ---------- Reveal on scroll ----------
 * main.js adds .reveal then .is-visible when the block enters the viewport.
 */
.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}

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

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .reveal {
    opacity: 1;
    transform: none;
  }
}
