:root {
  --bg: #0F1523;
  --bg-subtle: #141C2E;
  --bg-mid: #1C2840;
  --ink: #E8ECF4;
  --ink-mid: #8896AA;
  --ink-soft: #4D5E7A;
  --border: #1C2840;
  --border-mid: #253150;
  --accent: #3D55D8;
  --accent-dim: rgba(61, 85, 216, 0.15);
  --accent-hover: #4A62E0;
  --accent-secondary: #7A3EFF;
  --ink-on-dark: #E8ECF4;
  --ink-mid-on-dark: #8896AA;
  --dark-section: #080D18;
  --dark-surface: #0C1220;
  --dark-raised: #111B2E;
  --white: #FFFFFF;
  --font-display: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', monospace;
}

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

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

body {
  font-family: var(--font-display);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--accent);
  color: var(--white);
}

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

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

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

.container-wide {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* NAV */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 1.25rem 0;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  transition: all 0.3s ease;
}

.nav.scrolled {
  padding: 0.9rem 0;
  box-shadow: 0 1px 12px rgba(14, 21, 37, 0.07);
}

.logo-svg {
  width: 28px;
  height: 28px;
  display: inline-block;
  flex-shrink: 0;
}

.nav-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
}

.nav-logo {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  justify-self: start;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
  justify-self: center;
}

.nav-links a {
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-soft);
  transition: color 0.2s;
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width 0.25s;
}

.nav-links a:hover {
  color: var(--ink);
}

.nav-links a:hover::after {
  width: 100%;
}

.nav-cta {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.6rem 1.25rem;
  background: var(--accent);
  color: var(--white);
  border: 1px solid var(--accent);
  transition: all 0.2s;
  cursor: pointer;
  justify-self: end;
  display: inline-block;
}

.nav-cta:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 5px;
}

.nav-toggle span {
  width: 22px;
  height: 1.5px;
  background: var(--ink);
  transition: all 0.25s;
}

/* HERO */
.hero {
  padding: 9rem 0 7rem;
  background-color: var(--bg);
  background-image: radial-gradient(var(--border) 1px, transparent 1px);
  background-size: 28px 28px;
  position: relative;
}

.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(15, 21, 35, 0) 60%, var(--bg) 100%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
}

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.hero-eyebrow::before {
  content: '';
  width: 32px;
  height: 1px;
  background: var(--accent);
}

.hero-title {
  font-size: clamp(3rem, 8vw, 7rem);
  font-weight: 800;
  line-height: 0.97;
  letter-spacing: -0.03em;
  color: var(--ink);
  margin-bottom: 2.5rem;
}

.hero-title .line {
  display: block;
  overflow: hidden;
  padding-bottom: 0.1em;
  margin-bottom: -0.1em;
}

.hero-title .line span {
  display: inline-block;
  transform: translateY(100%);
  animation: revealLine 0.75s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.hero-title .line:nth-child(2) span { animation-delay: 0.1s; }
.hero-title .line:nth-child(3) span { animation-delay: 0.2s; }
.hero-title .line:nth-child(4) span { animation-delay: 0.3s; }
.hero-title .line:nth-child(5) span { animation-delay: 0.4s; }

.hero-title .accent-word {
  color: var(--accent);
}

@keyframes revealLine {
  to { transform: translateY(0); }
}

.hero-sub {
  font-size: 1.1rem;
  color: var(--ink-mid);
  max-width: 560px;
  line-height: 1.75;
  margin-bottom: 3rem;
  opacity: 0;
  animation: fadeUp 0.7s 0.55s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

.hero-actions {
  display: flex;
  gap: 1rem;
  opacity: 0;
  animation: fadeUp 0.7s 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.9rem 1.75rem;
  background: var(--accent);
  color: var(--white);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid var(--accent);
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font-display);
}

.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.9rem 1.75rem;
  background: none;
  color: var(--ink-mid);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid var(--border-mid);
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font-display);
}

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* SECTION SHARED */
.section {
  padding: 7rem 0;
}

.section-subtle {
  background: var(--bg-subtle);
}

.section-dark {
  background: var(--dark-section);
  color: var(--ink-on-dark);
}

.section-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.section-eyebrow::before {
  content: '';
  width: 24px;
  height: 1px;
  background: var(--accent);
}

.section-title {
  font-size: clamp(1.85rem, 4vw, 3.25rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: 1.25rem;
}

.section-dark .section-title {
  color: var(--ink-on-dark);
}

.section-desc {
  font-size: 1.05rem;
  color: var(--ink-mid);
  max-width: 560px;
  line-height: 1.7;
}

.section-dark .section-desc {
  color: var(--ink-mid-on-dark);
}

/* RX PRODUCT MARK */
.rx-mark {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.02em;
}

/* PROSE BLOCK */
.prose-block {
  max-width: 720px;
  margin-top: 3rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.prose-block p {
  font-size: 1.05rem;
  color: var(--ink-mid);
  line-height: 1.8;
}

.prose-block code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--bg-mid);
  color: var(--accent);
  padding: 0.15em 0.5em;
  border-radius: 3px;
}

/* PROBLEM BLOCK */
.problem-block {
  max-width: 760px;
}

.problem-title {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 1.5rem;
}

.problem-intro {
  font-size: 1.05rem;
  color: var(--ink-mid);
  line-height: 1.75;
  margin-bottom: 2.75rem;
}

.problem-questions {
  display: flex;
  flex-direction: column;
  gap: 0;
  border-left: 2px solid var(--border);
  padding-left: 2rem;
}

.problem-question {
  font-size: 1rem;
  color: var(--ink);
  line-height: 1.65;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border);
}

.problem-question:last-child {
  border-bottom: none;
}

.problem-arrow {
  font-weight: 700;
  color: var(--accent);
  margin-right: 0.5rem;
  font-family: var(--font-mono);
}

/* INCIDENT GRID */
.incident-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--dark-raised);
  margin-top: 3.5rem;
  border: 1px solid var(--dark-raised);
}

.incident-card {
  padding: 2.75rem 2.25rem;
  background: var(--dark-surface);
  transition: background 0.25s;
  position: relative;
}

.incident-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: transparent;
  transition: background 0.25s;
}

.incident-card:hover {
  background: var(--dark-raised);
}

.incident-card:hover::before {
  background: var(--accent-secondary);
}

.incident-date {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--accent-secondary);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 1.25rem;
}

.incident-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--ink-on-dark);
  margin-bottom: 1rem;
  line-height: 1.3;
}

.incident-desc {
  font-size: 0.9rem;
  color: var(--ink-mid-on-dark);
  line-height: 1.8;
}

/* LEX FEATURES */
.lex-features {
  margin-top: 4rem;
  display: flex;
  flex-direction: column;
}

.lex-feature {
  padding: 3rem 0;
  border-bottom: 1px solid var(--border);
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 4rem;
  align-items: start;
  transition: background 0.2s, padding-left 0.2s;
  border-radius: 0;
}

.lex-feature:first-child {
  border-top: 1px solid var(--border);
}

.lex-feature:hover {
  padding-left: 1rem;
}

.lex-feature-label {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding-top: 0.25rem;
  line-height: 1.5;
}

.lex-feature-title {
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 1rem;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.lex-feature-desc {
  font-size: 0.95rem;
  color: var(--ink-mid);
  line-height: 1.8;
}

.lex-feature-desc code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--bg-mid);
  color: var(--accent);
  padding: 0.15em 0.5em;
  border-radius: 3px;
}

/* CONTACT */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5rem;
  margin-top: 4rem;
}

.contact-info h3 {
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 1.25rem;
  letter-spacing: -0.01em;
}

.contact-info p {
  font-size: 0.95rem;
  color: var(--ink-mid);
  line-height: 1.7;
  margin-bottom: 2rem;
}

.contact-details {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.contact-item {
  display: flex;
  flex-direction: column;
}

.contact-item-label {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 0.2rem;
}

.contact-item-value {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink);
}

.contact-item-value a {
  transition: color 0.2s;
}

.contact-item-value a:hover {
  color: var(--accent);
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group label {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 0.5rem;
}

.form-group input,
.form-group textarea {
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  background: var(--bg);
  font-family: var(--font-display);
  font-size: 0.95rem;
  color: var(--ink);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  border-radius: 0;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.form-group textarea {
  resize: vertical;
  min-height: 100px;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--ink-soft);
}

.form-response {
  font-size: 0.85rem;
  padding: 0.75rem 0;
  display: none;
}

.form-response.success {
  color: var(--accent);
  display: block;
}

.form-response.error {
  color: var(--accent-secondary);
  display: block;
}

/* FOOTER */
.footer {
  padding: 4rem 0 2rem;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 4rem;
}

.footer-brand {
  max-width: 280px;
}

.footer-brand .nav-logo {
  margin-bottom: 1rem;
  color: var(--ink);
}

.footer-brand p {
  font-size: 0.85rem;
  color: var(--ink-soft);
  line-height: 1.7;
}

.footer-col h4 {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 1.25rem;
}

.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-col a {
  font-size: 0.875rem;
  color: var(--ink-mid);
  transition: color 0.2s;
}

.footer-col a:hover {
  color: var(--accent);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.footer-bottom p {
  font-size: 0.75rem;
  color: var(--ink-soft);
}

.footer-bottom-links {
  display: flex;
  gap: 2rem;
}

.footer-bottom-links a {
  font-size: 0.75rem;
  color: var(--ink-soft);
  transition: color 0.2s;
}

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

/* DIAGNOSTIC MODAL */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(14, 21, 37, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--bg);
  padding: 3rem;
  max-width: 460px;
  width: 90%;
  position: relative;
  border: 1px solid var(--border);
  box-shadow: 0 24px 64px rgba(14, 21, 37, 0.12);
}

.modal-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: none;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  color: var(--ink-soft);
  transition: color 0.2s;
}

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

.modal h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.5rem;
}

.modal p {
  font-size: 0.875rem;
  color: var(--ink-mid);
  margin-bottom: 2rem;
  line-height: 1.6;
}

/* PAGE HEADER (for sub-pages) */
.page-header {
  padding: 9rem 0 4rem;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border);
}

.page-header h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: 1rem;
}

.page-header p {
  font-size: 1.05rem;
  color: var(--ink-mid);
  max-width: 560px;
  line-height: 1.7;
}

.legal-content {
  padding: 4rem 0 6rem;
}

.legal-content h2 {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--ink);
  margin-top: 3rem;
  margin-bottom: 1rem;
}

.legal-content h3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ink);
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.legal-content p {
  font-size: 0.95rem;
  color: var(--ink-mid);
  line-height: 1.8;
  margin-bottom: 1rem;
  max-width: 720px;
}

.legal-content ul {
  margin-left: 1.5rem;
  margin-bottom: 1rem;
}

.legal-content li {
  font-size: 0.95rem;
  color: var(--ink-mid);
  line-height: 1.8;
  margin-bottom: 0.5rem;
}

/* SCROLL ANIMATIONS */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* RESPONSIVE - tablet */
@media (max-width: 1024px) {
  .incident-grid {
    grid-template-columns: 1fr;
  }

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

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }
}

/* RESPONSIVE - mobile */
@media (max-width: 768px) {
  .nav-inner {
    grid-template-columns: 1fr 1fr;
  }

  .nav-cta {
    display: none;
  }

  .nav-links {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    z-index: 999;
    justify-self: unset;
    border-right: none;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a {
    font-size: 1.1rem;
    color: var(--ink);
  }

  .nav-toggle {
    display: flex;
    z-index: 1001;
    justify-self: end;
  }

  .nav-toggle.open span:nth-child(1) {
    transform: rotate(45deg) translate(4px, 4px);
  }

  .nav-toggle.open span:nth-child(2) {
    opacity: 0;
  }

  .nav-toggle.open span:nth-child(3) {
    transform: rotate(-45deg) translate(4px, -4px);
  }

  .hero {
    padding: 7rem 0 5rem;
  }

  .hero-title {
    font-size: clamp(2.4rem, 10vw, 4rem);
    line-height: 1;
  }

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

  .hero-actions {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .btn-primary,
  .btn-secondary {
    width: 100%;
    text-align: center;
    justify-content: center;
  }

  .section {
    padding: 5rem 0;
  }

  .section-title {
    font-size: clamp(1.75rem, 6vw, 2.25rem);
  }

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

  .incident-card {
    padding: 2rem 1.5rem;
  }

  .lex-feature {
    grid-template-columns: 1fr;
    gap: 0.75rem;
    padding: 2.5rem 0;
  }

  .lex-feature:hover {
    padding-left: 0;
  }

  .lex-feature-title {
    font-size: 1.2rem;
  }

  .problem-questions {
    padding-left: 1.25rem;
  }

  .prose-block p {
    font-size: 1rem;
  }

  .contact-grid {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

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

  .footer-bottom {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
}
