/* HopStop — landing page styles
   Design goals: simple, readable, responsive, no external dependencies.
   Uses CSS custom properties and respects the visitor's colour scheme. */

:root {
  --bg: #fefdfb;
  --bg-muted: #f8f5ef;
  --surface: #ffffff;
  --border: #ece4d7;
  --text: #2e1e12;
  --text-muted: #6f5d4c;
  --brand: #4a2f1c;
  --brand-strong: #40291a;
  --brand-contrast: #faf6ef;
  --accent: #a4442c;
  --shadow: 0 1px 2px rgba(64, 41, 26, 0.08), 0 10px 26px rgba(64, 41, 26, 0.08);
  /* Hard, blur-less offset shadow — echoes the logo's pixel drop-shadow. */
  --shadow-hard: 3px 3px 0 var(--accent);
  --radius: 4px;
  --maxw: 1080px;
  --font-pixel: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1c1108;
    --bg-muted: #241811;
    --surface: #241811;
    --border: #3a2a1d;
    --text: #f1e5d6;
    --text-muted: #c3ac95;
    --brand: #d9a066;
    --brand-strong: #e6b57e;
    --brand-contrast: #1c1108;
    --accent: #d8785c;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 12px 30px rgba(0, 0, 0, 0.4);
  }
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  /* Belt-and-braces: never allow sideways scroll from an overflowing block. */
  overflow-x: clip;
}

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: 20px;
}

/* Accessibility helper */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--brand);
  color: var(--brand-contrast);
  padding: 10px 16px;
  border-radius: 0 0 8px 0;
  z-index: 10;
}
.skip-link:focus {
  left: 0;
}

a {
  color: var(--brand-strong);
}

/* Header / nav */
.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(8px);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--border);
}
.nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 20px;
  min-height: 64px;
  padding: 44px 0 24px;
}
.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: var(--text);
}
.brand__logo {
  height: 30px;
  width: auto;
  display: block;
}
.nav__links {
  display: flex;
  gap: 22px;
  list-style: none;
  margin: 0;
  padding: 0;
  margin-left: auto;
}
.nav__links a {
  text-decoration: none;
  color: var(--text-muted);
  font-weight: 500;
}
.nav__links a:hover {
  color: var(--text);
}
.nav__cta {
  margin-left: 8px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 16px;
  font-size: 0.92rem;
  border-radius: var(--radius);
  font-weight: 700;
  text-decoration: none;
  border: 2px solid var(--brand);
  transition: transform 0.05s ease, box-shadow 0.05s ease,
    background-color 0.2s ease, border-color 0.2s ease;
  cursor: pointer;
}
.btn--primary {
  background: var(--brand);
  color: var(--brand-contrast);
  box-shadow: var(--shadow-hard);
}
.btn--primary:hover {
  background: var(--brand-strong);
  border-color: var(--brand-strong);
}
/* Press the button "into" its offset shadow — a small retro tactile cue. */
.btn--primary:active {
  transform: translate(3px, 3px);
  box-shadow: 0 0 0 var(--accent);
}
.btn--ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn--ghost:hover {
  background: var(--bg-muted);
  border-color: var(--brand);
}
.btn--ghost:active {
  transform: translateY(1px);
}

/* Hero */
.hero {
  padding: clamp(56px, 10vw, 120px) 0 clamp(40px, 8vw, 88px);
  background: radial-gradient(
      1200px 500px at 70% -10%,
      color-mix(in srgb, var(--brand) 14%, transparent),
      transparent 60%
    ),
    var(--bg);
}
.hero__inner {
  max-width: 720px;
}
.eyebrow {
  font-family: var(--font-pixel);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent);
  margin: 0 0 12px;
}
.hero__title {
  font-size: clamp(2.2rem, 6vw, 3.6rem);
  line-height: 1.1;
  margin: 0 0 16px;
  letter-spacing: -0.02em;
}
.hero__lede {
  font-size: clamp(1.05rem, 2.4vw, 1.25rem);
  color: var(--text-muted);
  margin: 0 0 28px;
}
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* Sections */
.section {
  padding: clamp(48px, 8vw, 88px) 0;
}
.section--muted {
  background: var(--bg-muted);
}
.section__title {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  margin: 0 0 8px;
  letter-spacing: -0.01em;
}
.section__lede {
  color: var(--text-muted);
  margin: 0 0 32px;
  max-width: 62ch;
}
.section__subtitle {
  font-size: 1.25rem;
  margin: 44px 0 12px;
  letter-spacing: -0.01em;
}
.section__note {
  color: var(--text-muted);
  margin: 28px 0 0;
  max-width: 70ch;
}

/* Feature cards */
.cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}
.card__icon {
  font-size: 1.75rem;
  margin-bottom: 12px;
}
.card__title {
  margin: 0 0 6px;
  font-size: 1.15rem;
}
.card__body {
  margin: 0;
  color: var(--text-muted);
}

/* Steps */
.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.step {
  padding: 4px 0;
}
.step__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  background: var(--brand);
  color: var(--brand-contrast);
  font-family: var(--font-pixel);
  font-weight: 700;
  margin-bottom: 14px;
  box-shadow: var(--shadow-hard);
}
.step__title {
  margin: 0 0 6px;
  font-size: 1.15rem;
}
.step__body {
  margin: 0;
  color: var(--text-muted);
}

/* About */
.about__body {
  max-width: 62ch;
  font-size: 1.1rem;
  color: var(--text-muted);
}

/* CTA */
.cta {
  padding: clamp(48px, 8vw, 88px) 0;
  background: linear-gradient(
    180deg,
    var(--bg) 0%,
    color-mix(in srgb, var(--brand) 10%, var(--bg)) 100%
  );
}
.cta__inner {
  text-align: center;
  max-width: 620px;
}
.cta__title {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  margin: 0 0 10px;
}
.cta__body {
  color: var(--text-muted);
  margin: 0 0 24px;
}
.cta__note {
  color: var(--text-muted);
  margin: 18px 0 0;
  font-size: 0.95rem;
}

/* Stats band */
.stats {
  border-block: 1px solid var(--border);
  background: var(--bg-muted);
  padding: clamp(28px, 5vw, 44px) 0;
}
.stats__grid {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.stat {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.stat__value {
  font-family: var(--font-pixel);
  font-size: clamp(1.4rem, 3.3vw, 1.85rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
}
.stat__label {
  color: var(--text-muted);
  font-size: 0.98rem;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 28px 0;
  background: var(--bg);
}
.footer__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: center;
  justify-content: space-between;
}
.footer__brand {
  margin: 0;
}
.footer__logo {
  height: 22px;
  width: auto;
  display: block;
}
.footer__tagline {
  font-family: var(--font-pixel);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
  color: var(--accent);
  margin: 8px 0 0;
}
.footer__meta {
  color: var(--text-muted);
  margin: 0;
  font-size: 0.9rem;
}

/* Full-bleed photo bands */
.photo {
  margin: 0;
}
.photo__img {
  display: block;
  width: 100%;
  height: clamp(260px, 42vw, 480px);
  object-fit: cover;
}
.photo__caption {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--bg-muted);
  padding: 10px 0;
}
.photo__caption .container {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.photo__caption a {
  color: var(--text-muted);
}

/* Inline figures inside sections */
.figure {
  margin: 32px 0 0;
}
.figure__img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.figure figcaption {
  margin-top: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* History timeline */
.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0;
}
.timeline__item {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 18px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.timeline__item:last-child {
  border-bottom: none;
}
.timeline__year {
  font-family: var(--font-pixel);
  font-weight: 700;
  color: var(--accent);
  font-size: 0.95rem;
  line-height: 1.7;
}
.timeline__body {
  margin: 0;
  color: var(--text-muted);
}
.timeline__body strong {
  color: var(--text);
}
@media (max-width: 560px) {
  .timeline__item {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}

/* Method cards: what has been tried */
.methods {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.method {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 8px;
  align-content: start;
}
.method__title {
  margin: 0;
  font-size: 1.05rem;
}
.method__body {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}
.method__verdict {
  margin: 4px 0 0;
  font-family: var(--font-pixel);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent);
}

/* Numbered fact rows (why now / tailwinds) */
.facts {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.fact {
  border-left: 3px solid var(--accent);
  padding-left: 16px;
}
.fact__title {
  margin: 0 0 6px;
  font-size: 1.05rem;
}
.fact__body {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Two-column anchor-project layout */
.split {
  display: grid;
  gap: 32px;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  align-items: start;
}
.split h3 {
  margin: 0 0 8px;
  font-size: 1.15rem;
}
.split p {
  margin: 0 0 14px;
  color: var(--text-muted);
}
.split ul {
  margin: 0;
  padding-left: 20px;
  color: var(--text-muted);
}
.split li {
  margin-bottom: 8px;
}

/* Sources / footnote strip */
.sources {
  margin-top: 40px;
  border-top: 1px solid var(--border);
  padding-top: 16px;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.sources p {
  margin: 0 0 4px;
}
.sources a {
  color: var(--text-muted);
}

/* Apply modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal[hidden] {
  display: none;
}
.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(30, 18, 10, 0.55);
  backdrop-filter: blur(2px);
}
.modal__dialog {
  position: relative;
  width: 100%;
  max-width: 440px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  background: var(--surface);
  border: 2px solid var(--brand);
  border-radius: var(--radius);
  box-shadow: 6px 6px 0 var(--accent);
  padding: 28px 26px;
}
.modal__close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 34px;
  height: 34px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.6rem;
  line-height: 1;
  border-radius: var(--radius);
  cursor: pointer;
}
.modal__close:hover {
  background: var(--bg-muted);
  color: var(--text);
}
.modal__title {
  margin: 0 0 6px;
  font-size: 1.4rem;
}
.modal__intro {
  margin: 0 0 20px;
  color: var(--text-muted);
}
.modal__form {
  display: grid;
  gap: 14px;
}
/* Honeypot — off-screen, not shown to real users. */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}
.field {
  display: grid;
  gap: 6px;
}
.field__label {
  font-family: var(--font-pixel);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
}
.field input {
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  width: 100%;
}
.field input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}
.modal__submit {
  margin-top: 6px;
  width: 100%;
}
.modal__status {
  margin: 4px 0 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  min-height: 1.2em;
}
.modal__status.is-success {
  color: #2e7d46;
}
.modal__status.is-error {
  color: var(--accent);
}

/* Mid widths: drop the section links onto their own row below the brand. */
@media (max-width: 899px) {
  .nav {
    padding: 30px 0 16px;
  }
  .nav__links {
    order: 3;
    flex-basis: 100%;
    margin-left: 0;
    gap: 8px 18px;
    flex-wrap: wrap;
  }
  .nav__cta {
    margin-left: auto;
  }
}

/* Small screens: shrink the brand and CTA so the top row always fits. */
@media (max-width: 480px) {
  .nav {
    gap: 10px 12px;
  }
  .brand__logo {
    height: 22px;
  }
  .nav__cta {
    padding: 8px 12px;
    font-size: 0.82rem;
  }
  .nav__links {
    font-size: 0.92rem;
  }
}
