/* ── Reset & Base ─────────────────────────────────────────── */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* earth palette */
  --soil:       #2C2416;
  --bark:       #4A3728;
  --field:      #5C7A3A;
  --field-dark: #4A6530;
  --straw:      #D4C9A8;
  --cream:      #F5F0E8;
  --parchment:  #FAF8F4;
  --white:      #FFFFFF;
  --ink:        #1A1A1A;
  --pencil:     #6B6B6B;
  --rule:       #D1C9B8;

  /* type */
  --font-body:  'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono:  'JetBrains Mono', 'SF Mono', 'Consolas', monospace;

  /* spacing */
  --space-xs:  0.5rem;
  --space-sm:  1rem;
  --space-md:  1.5rem;
  --space-lg:  3rem;
  --space-xl:  5rem;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--parchment);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--field);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ── Utility ─────────────────────────────────────────────── */
.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}

/* ── Nav ─────────────────────────────────────────────────── */
nav {
  border-bottom: 2px solid var(--ink);
  padding: var(--space-sm) 0;
  background: var(--parchment);
  position: sticky;
  top: 0;
  z-index: 100;
}

nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.02em;
}

.nav-brand:hover {
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: var(--space-md);
  list-style: none;
}

.nav-links a {
  color: var(--ink);
  font-size: 0.875rem;
  font-weight: 500;
  padding: var(--space-xs) 0;
  border-bottom: 2px solid transparent;
  transition: border-color 0.15s;
}

.nav-links a:hover {
  text-decoration: none;
  border-bottom-color: var(--field);
}

/* ── Hero ────────────────────────────────────────────────── */
.hero {
  padding: var(--space-xl) 0;
  border-bottom: 1px solid var(--rule);
}

.hero h1 {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--ink);
  max-width: 600px;
}

.hero .subtitle {
  font-size: 1.125rem;
  color: var(--pencil);
  margin-top: var(--space-sm);
  max-width: 520px;
  line-height: 1.5;
}

.hero-cta {
  display: flex;
  gap: var(--space-sm);
  margin-top: var(--space-lg);
  flex-wrap: wrap;
}

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  font-family: var(--font-body);
  border: 2px solid var(--ink);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.btn-primary {
  background: var(--ink);
  color: var(--parchment);
}

.btn-primary:hover {
  background: var(--bark);
  border-color: var(--bark);
  text-decoration: none;
}

.btn-secondary {
  background: transparent;
  color: var(--ink);
}

.btn-secondary:hover {
  background: var(--cream);
  text-decoration: none;
}

/* ── Regulation ticker ───────────────────────────────────── */
.deadlines {
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--rule);
  background: var(--cream);
  overflow: visible;
}

.deadlines .container {
  display: flex;
  gap: var(--space-lg);
  flex-wrap: wrap;
}

.deadline-item {
  display: flex;
  align-items: baseline;
  gap: var(--space-xs);
  white-space: nowrap;
  font-size: 0.8125rem;
}

.deadline-label {
  font-weight: 700;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--field-dark);
  border: 1px solid var(--field-dark);
  padding: 0.125rem 0.375rem;
}

.deadline-date {
  color: var(--pencil);
}

/* ── Sections ────────────────────────────────────────────── */
section {
  padding: var(--space-xl) 0;
  border-bottom: 1px solid var(--rule);
}

section:last-of-type {
  border-bottom: none;
}

.section-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--field-dark);
  margin-bottom: var(--space-xs);
}

section h2 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-md);
}

/* ── Feature grid ────────────────────────────────────────── */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-md);
  margin-top: var(--space-md);
}

.feature-card {
  border: 1px solid var(--rule);
  padding: var(--space-md);
  background: var(--white);
}

.feature-card h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: var(--space-xs);
}

.feature-card p {
  font-size: 0.875rem;
  color: var(--pencil);
  line-height: 1.5;
}

.feature-icon {
  font-size: 1.25rem;
  margin-bottom: var(--space-xs);
  display: block;
}

/* ── How it works ────────────────────────────────────────── */
.steps {
  counter-reset: step;
  margin-top: var(--space-md);
}

.step {
  display: flex;
  gap: var(--space-md);
  padding: var(--space-md) 0;
  border-bottom: 1px dashed var(--rule);
}

.step:last-child {
  border-bottom: none;
}

.step::before {
  counter-increment: step;
  content: counter(step);
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--field);
  flex-shrink: 0;
  width: 2rem;
  line-height: 1.3;
}

.step h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.step p {
  font-size: 0.875rem;
  color: var(--pencil);
}

/* ── Code sample ─────────────────────────────────────────── */
.code-block {
  background: var(--soil);
  color: var(--straw);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  line-height: 1.7;
  padding: var(--space-md);
  overflow-x: auto;
  border: 1px solid var(--ink);
  margin-top: var(--space-md);
}

.code-block .comment {
  color: #8B8B6B;
}

.code-block .string {
  color: #A8C97A;
}

.code-block .key {
  color: #D4C9A8;
}

/* ── Jurisdictions ───────────────────────────────────────── */
.jurisdiction-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-sm);
  margin-top: var(--space-md);
}

.jurisdiction-item {
  border: 1px solid var(--rule);
  padding: var(--space-sm) var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  background: var(--white);
}

.jurisdiction-flag {
  font-size: 1.25rem;
}

.jurisdiction-info {
  flex: 1;
}

.jurisdiction-name {
  font-weight: 700;
  font-size: 0.875rem;
}

.jurisdiction-reg {
  font-size: 0.75rem;
  color: var(--pencil);
  font-family: var(--font-mono);
}

.jurisdiction-upcoming {
  border-style: dashed;
}

.jurisdiction-upcoming .jurisdiction-name,
.jurisdiction-upcoming .jurisdiction-flag {
  color: var(--pencil);
}

.deadline-active .deadline-label {
  background: var(--field);
  color: var(--white);
  border-color: var(--field);
}

.deadline-active .deadline-date {
  font-weight: 600;
  color: var(--ink);
}

.deadline-upcoming .deadline-label {
  border-style: dashed;
  color: var(--pencil);
  border-color: var(--pencil);
}

.deadline-upcoming .deadline-date {
  color: var(--rule);
}

/* ── CSS tooltips ─────────────────────────────────────────── */
[data-tip] {
  position: relative;
  cursor: default;
}

[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  left: 50%;
  top: 100%;
  transform: translateX(-50%);
  margin-top: 0.5rem;
  padding: 0.375rem 0.625rem;
  background: var(--ink);
  color: var(--parchment);
  font-size: 0.6875rem;
  font-weight: 400;
  line-height: 1.4;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 10;
}

[data-tip]:hover::after {
  opacity: 1;
}

/* ── Footer ──────────────────────────────────────────────── */
footer {
  border-top: 2px solid var(--ink);
  padding: var(--space-lg) 0;
  font-size: 0.8125rem;
  color: var(--pencil);
}

footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

footer a {
  color: var(--pencil);
}

footer a:hover {
  color: var(--ink);
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 640px) {
  .hero {
    padding: var(--space-lg) 0;
  }

  .hero h1 {
    font-size: 1.75rem;
  }

  .hero .subtitle {
    font-size: 1rem;
  }

  .hero-cta {
    margin-top: var(--space-md);
  }

  .btn {
    width: 100%;
    text-align: center;
  }

  /* Nav: stack brand above links */
  nav .container {
    flex-direction: column;
    gap: var(--space-xs);
  }

  .nav-links {
    gap: var(--space-sm);
  }

  .nav-links a {
    font-size: 0.8125rem;
  }

  /* Ticker: 2-column grid instead of row */
  .deadlines .container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-sm);
  }

  /* Sections */
  section {
    padding: var(--space-lg) 0;
  }

  section h2 {
    font-size: 1.375rem;
  }

  .feature-grid {
    grid-template-columns: 1fr;
  }

  .step {
    flex-direction: column;
    gap: var(--space-xs);
  }

  /* Code block: smaller text on mobile */
  .code-block {
    font-size: 0.6875rem;
    padding: var(--space-sm);
  }

  /* Jurisdictions: single column */
  .jurisdiction-list {
    grid-template-columns: 1fr;
  }

  /* Tooltips: left-align to prevent overflow */
  [data-tip]::after {
    left: 0;
    transform: none;
    white-space: normal;
    max-width: 220px;
  }

  footer .container {
    flex-direction: column;
    text-align: center;
  }
}
