/* ============================================================
   Variables & Reset
   ============================================================ */
:root {
  --color-primary:    #165256;
  --color-accent:     #165256;
  --color-bg:         #ffffff;
  --color-bg-alt:     #f4f4f4;
  --color-bg-deep:    #165256;
  --color-text:       #111111;
  --color-text-light: #ffffff;
  --color-text-muted: #666666;
  --color-card-muted: #cccccc;
  --nav-height:       64px;
  --max-width:        860px;
  --ease:             0.2s ease;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.75;
}

/* ============================================================
   Accessibility
   ============================================================ */
.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  padding: 0.75rem 1.5rem;
  background: var(--color-primary);
  color: #fff;
  z-index: 100;
  font-weight: 600;
}
.skip-link:focus {
  top: 0;
}
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}
.nav-link:focus-visible, .nav-link--cta:focus-visible {
  outline-color: #ffffff;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ============================================================
   Typography
   ============================================================ */
h1, h2, h3 {
  line-height: 1.2;
  font-weight: 700;
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); margin-bottom: 1.25rem; }
h3 { font-size: 1.25rem; font-weight: 600; }

p { margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: opacity var(--ease);
}
a:hover { opacity: 0.8; }

/* ============================================================
   Layout
   ============================================================ */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section {
  padding: 4.5rem 0;
}

.section--alt {
  background: var(--color-bg-alt);
}

/* ============================================================
   Navigation
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-bg-deep);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-height);
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  gap: 1.5rem;
}

.nav-brand {
  color: var(--color-text-light);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
  flex-shrink: 0;
}
.nav-brand:hover {
  opacity: 0.85;
  color: var(--color-text-light);
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 1.5rem;
  align-items: center;
  flex-wrap: nowrap;
}

.nav-link {
  color: var(--color-text-light);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  white-space: nowrap;
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
  transition: color var(--ease), border-color var(--ease);
}
.nav-link:hover {
  color: var(--color-text-light);
  opacity: 1;
  border-bottom-color: var(--color-text-light);
}

/* Waitlist CTA in nav — white filled button with teal text */
.nav-link--cta {
  cursor: pointer;
  background: var(--color-text-light);
  color: var(--color-primary);
  border: 1px solid var(--color-text-light);
  border-radius: 4px;
  padding: 0.3rem 0.85rem;
  font-weight: 600;
  transition: background var(--ease), color var(--ease);
}

.nav-link--cta:hover {
  background: #e5e7eb;
  color: var(--color-primary);
  border-color: #e5e7eb;
  opacity: 1;
}

/* ── Hamburger (hidden on desktop) ── */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 26px;
  height: 20px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 12px 9px;
  flex-shrink: 0;
}

.bar {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--color-text-light);
  border-radius: 2px;
  transition: transform var(--ease), opacity var(--ease);
}

/* Hamburger → X when open */
.hamburger[aria-expanded="true"] .bar:nth-child(1) {
  transform: translateY(9px) rotate(45deg);
}
.hamburger[aria-expanded="true"] .bar:nth-child(2) {
  opacity: 0;
}
.hamburger[aria-expanded="true"] .bar:nth-child(3) {
  transform: translateY(-9px) rotate(-45deg);
}

/* ============================================================
   Above Fold
   ============================================================ */
.above-fold {
  min-height: calc(100vh - var(--nav-height));
  max-height: 800px;
  display: flex;
  flex-direction: column;
}

/* ============================================================
   Hero
   ============================================================ */
.hero {
  background: var(--color-bg);
  color: var(--color-primary);
  flex: 1;
  display: flex;
  align-items: center;
  text-align: center;
  padding: 3rem 0;
  min-height: 280px;
}

.hero .container {
  width: 100%;
}

.hero h1 {
  color: var(--color-primary);
  margin-bottom: 1.25rem;
}

.hero-logo {
  max-width: 600px;
  width: 100%;
  height: auto;
  margin-bottom: 2.5rem;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.hero-sub {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  color: var(--color-primary);
  font-weight: 500;
  max-width: 560px;
  margin: 0 auto 2rem;
  opacity: 0.75;
}

/* Waitlist button — teal on white, inverts on hover */
.btn--waitlist {
  cursor: pointer;
  display: inline-block;
  padding: 0.75rem 2rem;
  background: var(--color-primary);
  color: var(--color-text-light);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.04em;
  border: 2px solid var(--color-primary);
  transition: background var(--ease), color var(--ease);
}

.btn--waitlist:hover {
  background: transparent;
  color: var(--color-primary);
  opacity: 1;
}

/* ============================================================
   Detail Page Hero
   ============================================================ */
.page-hero {
  background: var(--color-primary);
  color: var(--color-text-light);
  padding: 3rem 0 2.5rem;
}

.page-hero h1 {
  color: var(--color-text-light);
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  margin-top: 0.75rem;
}

.back-link {
  display: inline-block;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  transition: color var(--ease);
}

.back-link:hover {
  color: var(--color-text-light);
  opacity: 1;
}

/* ============================================================
   The Problem
   ============================================================ */
.section--problem {
  background: var(--color-primary);
  padding: 3rem 0;
  text-align: center;
}

.problem-statement {
  font-size: clamp(1.15rem, 2.5vw, 1.5rem);
  font-weight: 600;
  color: var(--color-text-light);
  max-width: 700px;
  margin: 0 auto;
  line-height: 1.5;
}

/* ============================================================
   Subsection Titles (How It Works)
   ============================================================ */
.subsection-title {
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-accent);
  margin-top: 2.25rem;
  margin-bottom: 0.75rem;
}

.subsection-title:first-of-type {
  margin-top: 1.75rem;
}

/* ============================================================
   Rules List
   ============================================================ */
.rules-list {
  list-style: none;
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  counter-reset: rules;
}

.rules-list li {
  counter-increment: rules;
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  padding: 1.25rem 1.5rem;
  background: var(--color-primary);
  color: var(--color-text-light);
  border-left: 4px solid var(--color-text-light);
}

.rules-list li::before {
  content: counter(rules);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--color-text-light);
  line-height: 1.3;
  flex-shrink: 0;
}

/* ============================================================
   Card Grid (Open Source)
   ============================================================ */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.card--dark {
  background: var(--color-primary);
  border: 1px solid var(--color-primary);
  border-left: 4px solid var(--color-text-light);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.card--dark h3 {
  color: var(--color-text-light);
  margin: 0;
}

.card--dark p {
  color: var(--color-card-muted);
  margin: 0;
  font-size: 0.95rem;
}

/* ============================================================
   CTA Section (Open Source background)
   ============================================================ */
.section--cta {
  background: var(--color-bg-deep);
  color: var(--color-text-light);
}

.section--cta h2 {
  color: var(--color-text-light);
}

/* ============================================================
   Learn More Links
   ============================================================ */
.learn-more {
  display: inline-block;
  margin-top: 1.75rem;
  color: var(--color-accent);
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.03em;
  border-bottom: 1px solid transparent;
  transition: border-color var(--ease);
}

.learn-more:hover {
  border-bottom-color: var(--color-accent);
  opacity: 1;
}

/* On dark (teal) backgrounds, learn-more should be white */
.learn-more--light {
  color: var(--color-text-light);
}

.learn-more--light:hover {
  border-bottom-color: var(--color-text-light);
}

/* ============================================================
   Related Links
   ============================================================ */
.related-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
}

.related-links li a {
  font-weight: 500;
  border-bottom: 1px solid transparent;
  transition: border-color var(--ease);
}

.related-links li a:hover {
  border-bottom-color: var(--color-accent);
  opacity: 1;
}

/* ============================================================
   Feature List (Developers page)
   ============================================================ */
.feature-list {
  margin-top: 1rem;
  padding-left: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.feature-list li {
  line-height: 1.6;
}

/* ============================================================
   CTA Section — Waitlist button on dark background
   ============================================================ */
.section--cta .btn--waitlist {
  background: var(--color-text-light);
  color: var(--color-primary);
  border-color: var(--color-text-light);
}

.section--cta .btn--waitlist:hover {
  background: transparent;
  color: var(--color-text-light);
}

/* CTA container — centered text for sub-page CTA sections */
.cta-center {
  text-align: center;
}

/* CTA sub-text — muted paragraph beneath CTA heading */
.cta-sub {
  color: var(--color-card-muted);
  max-width: 560px;
  margin: 0 auto 2rem;
}

/* Spacing helper — small top margin for inline learn-more links */
.mt-sm {
  margin-top: 1rem;
}

/* ============================================================
   AI Disclosure
   ============================================================ */
.ai-disclosure {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  border-top: 1px solid #e0e0e0;
  padding-top: 0.75rem;
  margin-bottom: 2rem;
}

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  background: var(--color-primary);
  color: var(--color-text-light);
  text-align: center;
  padding: 2rem 0;
  font-size: 0.875rem;
}

/* ============================================================
   Responsive — Mobile Navigation
   ============================================================ */
@media (max-width: 900px) {
  .hamburger {
    display: flex;
  }

  .nav-menu {
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: var(--color-bg-deep);
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
  }

  .nav-menu.is-open {
    max-height: 600px;
    padding: 0.5rem 0;
  }

  .nav-menu li {
    width: 100%;
  }

  .nav-link {
    display: block;
    padding: 0.85rem 1.5rem;
    border-bottom: none;
    border-left: 3px solid transparent;
    font-size: 0.95rem;
    transition: background var(--ease), border-color var(--ease), color var(--ease);
  }

  .nav-link:hover {
    background: rgba(255, 255, 255, 0.08);
    border-left-color: var(--color-text-light);
    color: var(--color-text-light);
  }
}
