/* ============================================================
   THE SIGNAL — Ink Archive on Blueprint Paper
   Operator-grade aesthetic. No templates. No blur.
   ============================================================ */

/* --- Color Tokens --- */
:root {
  /* Ink / Paper */
  --bg: #070A12;            /* ink navy */
  --bg2: #05070D;           /* deeper */
  --panel: #0B0F1A;         /* monolith slab */
  --panel2: #0E1424;        /* hover/raised */
  --rule: #1A2338;          /* grid/rules */
  --rule2: #24304A;         /* stronger rule */

  /* Type */
  --text: #E9EDF6;          /* primary */
  --muted: #AAB4C7;         /* secondary */
  --faint: #6E7891;         /* tertiary */

  /* Signals */
  --active: #22D3C5;        /* teal */
  --verified: #C7A35A;      /* brass */
  --danger: #E06565;

  /* Density */
  --r: 8px;
  --p: 18px;                /* panel padding */
  --gap: 14px;              /* vertical rhythm */
  --lh: 1.25;

  /* Legacy compatibility */
  --color-bg: #070A12;
  --color-surface: #0B0F1A;
  --color-surface-2: #0E1424;
  --color-border: #1A2338;
  --color-divider: #1A2338;
  --color-text: #E9EDF6;
  --color-text-muted: #AAB4C7;
  --color-text-faint: #6E7891;
  --color-gold: #C7A35A;
  --color-primary: #22D3C5;
  --radius-md: 8px;
  --transition-interactive: 180ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* --- Typography --- */
@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,600;9..144,700&family=IBM+Plex+Sans:wght@400;500;600&display=swap');

:root {
  --font-display: 'Fraunces', serif;
  --font-body: 'IBM Plex Sans', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

/* --- Reset --- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: rgba(34, 211, 197, 0.15);
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%; /* Prevent font scaling in landscape */
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px; /* Increased from 15px for better readability */
  line-height: 1.6; /* Increased from 1.45 for better readability */
  position: relative;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Mobile: Even larger for comfort */
@media (max-width: 768px) {
  body {
    font-size: 17px; /* iOS/Android comfort size */
    line-height: 1.65;
  }
}

/* Global Link Styling */
a {
  color: var(--active);
  text-decoration: none;
  transition: color 180ms ease;
}

a:hover {
  color: #1fb8af;
}

a:visited {
  color: var(--active);
}

/* Blueprint grid + noise underlay */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    repeating-linear-gradient(0deg, transparent, transparent 23px, var(--rule) 23px, var(--rule) 24px),
    repeating-linear-gradient(90deg, transparent, transparent 23px, var(--rule) 23px, var(--rule) 24px),
    radial-gradient(circle, rgba(34, 211, 197, 0.02) 1px, transparent 1px);
  background-size: 24px 24px, 24px 24px, 50px 50px;
  background-position: 0 0, 0 0, 0 0;
  opacity: 0.06;
  pointer-events: none;
  z-index: 0;
}

main, header, footer, .site-header {
  position: relative;
  z-index: 1;
}

/* --- Typography Scales --- */
h1 {
  font-family: var(--font-display);
  font-size: 48px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: var(--gap);
  color: var(--text);
}

h2 {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: var(--gap);
  color: var(--text);
}

h3 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: calc(var(--gap) / 2);
  color: var(--text);
}

p {
  margin-bottom: var(--gap);
  color: var(--muted);
}

/* --- Section Label --- */
.section-label {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: calc(var(--gap) / 2);
}

/* --- Header --- */
.site-header {
  background: var(--panel);
  border-bottom: 1px solid var(--rule);
  padding: var(--p);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-left a {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
}

.logo {
  width: 28px;
  height: 28px;
  stroke: currentColor;
  stroke-width: 1.5;
  color: var(--verified);
}

.header-title {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 24px;
}

nav ul {
  list-style: none;
  display: flex;
  gap: 24px;
}

nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color 180ms ease;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

nav a:hover,
nav a.active {
  color: var(--active);
}

button[data-theme-toggle] {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 12px;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 180ms ease;
  -webkit-tap-highlight-color: transparent;
}

button[data-theme-toggle]:hover {
  color: var(--text);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  padding: 12px;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}

/* Mobile nav */
.mobile-nav {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh; /* Dynamic viewport height for mobile browsers */
  background: var(--panel);
  z-index: 200;
  flex-direction: column;
  padding: var(--p);
  gap: var(--gap);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.mobile-nav.active {
  display: flex;
}

.mobile-nav-close {
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  align-self: flex-end;
  padding: 12px;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}

.mobile-nav a {
  color: var(--muted);
  text-decoration: none;
  padding: 16px 0;
  border-bottom: 1px solid var(--rule);
  font-size: 16px;
  min-height: 44px;
  display: flex;
  align-items: center;
  -webkit-tap-highlight-color: transparent;
}

.mobile-nav a.active {
  color: var(--active);
}

/* --- Main Content --- */
main {
  max-width: 1200px;
  margin: 0 auto;
  padding: calc(var(--p) * 2) var(--p);
}

/* --- Hero Section --- */
.hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--p);
  margin-bottom: calc(var(--p) * 3);
  padding-bottom: calc(var(--p) * 2);
  border-bottom: 1px solid var(--rule);
}

.hero-inner {
  display: contents;
}

.hero-left h1 {
  margin-bottom: var(--gap);
}

.hero-left p {
  max-width: 60ch;
  color: var(--muted);
}

.hero-right {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

.system-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
}

.stat-item {
  padding: var(--p);
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: var(--r);
}

.stat-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 4px;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: var(--active);
}

/* --- Dossier Cards --- */
.dossier-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: var(--p);
  margin-bottom: calc(var(--p) * 2);
}

.dossier-card,
.build-card {
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: var(--r);
  overflow: hidden;
  transition: all 180ms ease;
  text-decoration: none;
  color: inherit;
  display: block;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.dossier-card:hover,
.build-card:hover,
.dossier-card:active,
.build-card:active {
  background: var(--panel2);
  border-color: var(--active);
  transform: translateY(-2px);
}

.dossier-header,
.build-card-header {
  padding: var(--p);
  border-bottom: 1px solid var(--rule);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.dossier-number {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.15em;
  color: var(--faint);
  text-transform: uppercase;
}

.dossier-title,
.build-card-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
}

.status-chip,
.build-card-status {
  padding: 4px 12px;
  background: transparent;
  border: 1px solid var(--rule2);
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--verified);
}

.status-chip.active,
.build-card-status.active {
  background: var(--active);
  color: var(--bg);
  border-color: var(--active);
}

.dossier-body {
  padding: var(--p);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--p);
}

.dossier-section {
  display: flex;
  flex-direction: column;
  gap: calc(var(--gap) / 2);
}

.dossier-section-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
}

.dossier-section-content {
  font-size: 14px;
  line-height: 1.4;
  color: var(--muted);
}

.dossier-footer {
  padding: var(--p);
  border-top: 1px solid var(--rule);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--faint);
  font-style: italic;
}

/* --- Margin Log --- */
.margin-log {
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: var(--r);
  padding: var(--p);
  max-height: 240px;
  overflow-y: auto;
  margin-top: calc(var(--p) * 2);
}

.margin-log-entry {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--faint);
  padding: 6px 0;
  border-bottom: 1px solid var(--rule);
  line-height: 1.4;
}

.margin-log-entry:last-child {
  border-bottom: none;
}

.margin-log-entry .timestamp {
  color: var(--active);
  font-weight: 600;
}

/* --- Archive Cards --- */
.archive-section {
  max-width: var(--page);
  margin: 0 auto;
  padding: calc(var(--p) * 2) var(--p);
}

.archive-inner {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

.archive-card {
  display: block;
  padding: calc(var(--p) * 1.5);
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: var(--r);
  text-decoration: none;
  transition: all 180ms ease;
}

.archive-card:hover {
  border-color: var(--active);
  background: var(--panel2);
  transform: translateY(-2px);
}

.archive-card-week {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--active);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.archive-card-date {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  margin-bottom: var(--gap);
}

.archive-card-title {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
  line-height: 1.3;
}

.archive-card-quote {
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--muted);
  font-style: italic;
  margin-bottom: var(--gap);
}

.archive-card-cta {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--active);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* --- Page Hero --- */
.page-hero {
  padding: calc(var(--p) * 3) var(--p) calc(var(--p) * 2);
  text-align: center;
  border-bottom: 1px solid var(--rule);
}

.page-hero-inner {
  max-width: 700px;
  margin: 0 auto;
}

.page-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 600;
  color: var(--text);
  margin-bottom: var(--gap);
}

.page-hero p {
  font-size: 17px;
  color: var(--muted);
  line-height: 1.7;
}

.accent-text {
  color: var(--active);
}

/* --- Dim text --- */
.dim {
  opacity: 0.5;
}

/* --- Share Strips --- */
.share-strip,
.dispatch-share-strip,
.reaction-share-strip {
  display: flex;
  align-items: center;
  gap: var(--gap);
  padding: var(--p) 0;
  border-top: 1px solid var(--rule);
  margin-top: var(--gap);
}

.share-strip-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.share-strip-buttons {
  display: flex;
  gap: 12px;
}

.share-strip-buttons a,
.share-strip-buttons button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--panel);
  border: 1px solid var(--rule);
  color: var(--muted);
  text-decoration: none;
  transition: all 180ms ease;
  cursor: pointer;
}

.share-strip-buttons a:hover,
.share-strip-buttons button:hover {
  border-color: var(--active);
  color: var(--active);
  background: var(--panel2);
}

/* --- Tweet Card --- */
.tweet-card {
  display: block;
  width: 100%;
  padding: calc(var(--p) * 1.5);
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: var(--r);
  text-align: left;
  cursor: pointer;
  transition: all 180ms ease;
  margin: var(--gap) 0;
  font-family: inherit;
  color: var(--text);
}

.tweet-card:hover {
  border-color: var(--active);
  background: var(--panel2);
}

.tweet-card blockquote {
  margin: 0;
  font-family: var(--font-display);
  font-size: 18px;
  font-style: italic;
  line-height: 1.5;
  color: var(--text);
}

.tweet-card cite {
  display: block;
  margin-top: var(--gap);
  font-family: var(--font-mono);
  font-size: 12px;
  font-style: normal;
  color: var(--muted);
}

/* --- Mono Label --- */
.mono-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

/* --- Status Chips --- */
.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-radius: 3px;
  background: rgba(34, 211, 197, 0.1);
  color: var(--active);
  border: 1px solid rgba(34, 211, 197, 0.2);
}

.status-chip.active::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--active);
  animation: pulse-dot 2s ease-in-out infinite;
}

/* --- Footer --- */
footer {
  background: var(--panel);
  border-top: 1px solid var(--rule);
  padding: calc(var(--p) * 2) var(--p);
  margin-top: calc(var(--p) * 3);
}

.site-footer {
  background: var(--panel);
  border-top: 1px solid var(--rule);
  padding: calc(var(--p) * 2) var(--p);
  margin-top: calc(var(--p) * 3);
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--p);
}

.footer-col h4 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  margin-bottom: calc(var(--gap) / 2);
  color: var(--text);
}

.footer-col ul {
  list-style: none;
}

.footer-col a {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  display: block;
  padding: 6px 0;
  transition: color 180ms ease;
}

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

.footer-bottom {
  max-width: 1200px;
  margin: calc(var(--p) * 2) auto 0;
  padding-top: var(--p);
  border-top: 1px solid var(--rule);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--faint);
  flex-wrap: wrap;
  gap: var(--gap);
}

.footer-bottom-left {
  display: flex;
  gap: calc(var(--gap) * 2);
  flex-wrap: wrap;
}

.netlify-badge {
  display: flex;
  align-items: center;
  opacity: 0.7;
  transition: opacity 180ms ease;
}

.netlify-badge:hover {
  opacity: 1;
}

.netlify-badge img {
  height: 20px;
  width: auto;
}

/* --- Contact Button --- */
.contact-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: var(--active);
  color: var(--bg);
  border: none;
  border-radius: var(--r);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 180ms ease;
  margin-top: 8px;
  min-height: 44px;
  -webkit-tap-highlight-color: transparent;
}

.contact-btn:hover {
  background: #1fb8af;
  transform: translateY(-2px);
}

.contact-btn svg {
  width: 16px;
  height: 16px;
}

.contact-email {
  display: block;
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
  font-family: var(--font-mono);
  text-decoration: none;
  transition: color 180ms ease;
}

.contact-email:hover {
  color: var(--active);
}

/* --- Utility Classes --- */
.text-muted {
  color: var(--muted);
}

.text-sm {
  font-size: 14px;
}

.mb-3 {
  margin-bottom: 12px;
}

/* --- Contact Modal --- */
.contact-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  transition: opacity 300ms ease;
}

.contact-modal.active {
  display: flex;
  opacity: 1;
}

.contact-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(7, 10, 18, 0.9);
  backdrop-filter: blur(4px);
  cursor: pointer;
}

.contact-modal-content {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: var(--r);
  padding: calc(var(--p) * 2);
  max-width: 540px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: modalSlideIn 300ms ease-out;
}

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

.contact-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 8px;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 180ms ease;
  -webkit-tap-highlight-color: transparent;
}

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

.contact-modal-title {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.contact-modal-subtitle {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 24px;
}

/* --- Contact Form --- */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

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

.form-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.form-group input,
.form-group textarea {
  padding: 12px 16px;
  background: var(--bg2);
  border: 1px solid var(--rule);
  border-radius: var(--r);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  transition: border-color 180ms ease;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--active);
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
  line-height: 1.5;
}

.contact-form-footer {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
}

.contact-submit-btn {
  width: 100%;
  padding: 14px 24px;
  background: var(--active);
  color: var(--bg);
  border: none;
  border-radius: var(--r);
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 180ms ease;
  position: relative;
  min-height: 48px;
}

.contact-submit-btn:hover:not(:disabled) {
  background: #1fb8af;
  transform: translateY(-2px);
}

.contact-submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.contact-submit-btn .submit-loading {
  display: none;
}

.contact-submit-btn.loading .submit-text {
  display: none;
}

.contact-submit-btn.loading .submit-loading {
  display: inline;
}

.contact-response-time {
  text-align: center;
  font-size: 12px;
  color: var(--faint);
  font-style: italic;
}

/* --- Success/Error States --- */
.contact-success,
.contact-error {
  text-align: center;
  padding: 24px 0;
}

.success-icon {
  color: var(--active);
  margin: 0 auto 16px;
}

.error-icon {
  color: var(--danger);
  margin: 0 auto 16px;
}

.contact-success h4,
.contact-error h4 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
}

.contact-success p,
.contact-error p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 20px;
}

.contact-close-btn,
.contact-retry-btn {
  padding: 12px 32px;
  background: var(--panel2);
  color: var(--text);
  border: 1px solid var(--rule);
  border-radius: var(--r);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 180ms ease;
  min-height: 44px;
}

.contact-close-btn:hover,
.contact-retry-btn:hover {
  background: var(--panel);
  border-color: var(--active);
}

.contact-email-fallback {
  display: inline-block;
  margin-bottom: 16px;
  color: var(--active);
  font-family: var(--font-mono);
  font-size: 14px;
  text-decoration: none;
  transition: color 180ms ease;
}

.contact-email-fallback:hover {
  color: #1fb8af;
}

/* --- Utility Classes --- */
.mono-label {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.accent-text {
  color: var(--active);
}

.verified-text {
  color: var(--verified);
}

/* --- Animations --- */
@keyframes snap-route {
  0% {
    stroke-dashoffset: 100;
    opacity: 0.3;
  }
  100% {
    stroke-dashoffset: 0;
    opacity: 1;
  }
}

.snap-active {
  animation: snap-route 600ms ease-out forwards;
}

/* --- Responsive --- */

/* Tablet and below */
@media (max-width: 1024px) {
  .hero {
    grid-template-columns: 1fr;
  }
}

/* Mobile and below */
@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }

  nav {
    display: none;
  }

  .header-right {
    gap: 8px;
  }

  .site-header {
    padding: 12px 16px;
  }

  main {
    padding: calc(var(--p) * 2) 20px; /* Increased padding from 16px */
  }

  .hero {
    grid-template-columns: 1fr;
    gap: calc(var(--p) * 1.5);
  }

  .dossier-grid {
    grid-template-columns: 1fr;
    gap: calc(var(--gap) * 1.5);
  }

  .dossier-body {
    grid-template-columns: 1fr;
  }

  .system-stats {
    grid-template-columns: 1fr 1fr;
  }

  h1 {
    font-size: 36px;
    line-height: 1.2;
  }

  h2 {
    font-size: 24px;
    line-height: 1.3;
  }

  p {
    font-size: 17px;
    line-height: 1.7;
  }

  .footer-inner {
    grid-template-columns: 1fr;
    gap: calc(var(--gap) * 2);
  }

  .footer-bottom {
    flex-direction: column;
    gap: var(--gap);
    text-align: center;
  }

  .footer-bottom-left {
    flex-direction: column;
    gap: var(--gap);
  }

  .contact-btn {
    width: 100%;
    justify-content: center;
    min-height: 48px; /* Ensure good touch target */
    font-size: 15px;
  }

  .contact-modal-content {
    padding: var(--p);
    margin: 0 16px; /* Increased from 12px */
  }

  .contact-modal-title {
    font-size: 24px;
  }

  .subscribe-form {
    flex-direction: column;
    gap: 12px;
  }

  .subscribe-form button {
    width: 100%;
  }
}

/* Small phones */
@media (max-width: 480px) {
  h1 {
    font-size: 28px;
  }

  h2 {
    font-size: 20px;
  }

  .system-stats {
    grid-template-columns: 1fr;
  }

  .stat-value {
    font-size: 20px;
  }

  main {
    padding: calc(var(--p) * 1.5) 16px;
  }
}

/* Touch Device Improvements */
@media (hover: none) and (pointer: coarse) {
  /* Ensure all interactive elements are at least 44x44px */
  button,
  a,
  input[type="submit"],
  input[type="button"],
  .nav-toggle,
  [data-theme-toggle],
  .contact-btn,
  .dossier-card {
    min-height: 44px;
    min-width: 44px;
  }

  /* Better tap feedback */
  button:active,
  a:active,
  .dossier-card:active,
  .contact-btn:active {
    opacity: 0.7;
    transform: scale(0.98);
  }

  /* Remove hover states on touch devices */
  button:hover,
  a:hover {
    opacity: 1;
  }

  /* Larger form inputs on touch devices */
  input,
  textarea,
  select {
    min-height: 48px;
    font-size: 16px; /* Prevents zoom on iOS */
  }

  /* Better spacing for touch */
  nav a {
    padding: 12px 8px;
  }
}

/* --- Legacy Support --- */
.value-section,
.latest-issue,
.subscribe-section,
.social-proof,
.properties-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: calc(var(--p) * 2) var(--p);
}

.value-grid,
.properties-inner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--p);
}

.value-card {
  padding: var(--p);
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: var(--r);
}

.value-card-icon {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: var(--verified);
  display: block;
  margin-bottom: 8px;
}

.latest-card {
  display: block;
  padding: var(--p);
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: var(--r);
  text-decoration: none;
  color: inherit;
  transition: all 180ms ease;
}

.latest-card:hover {
  background: var(--panel2);
  border-color: var(--active);
}

.subscribe-form {
  display: flex;
  gap: 8px;
  margin: var(--gap) 0;
}

.subscribe-form input {
  flex: 1;
  padding: 12px 16px;
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: var(--r);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px; /* Prevent iOS auto-zoom */
}

.subscribe-form button {
  padding: 12px 24px;
  background: var(--active);
  border: none;
  border-radius: var(--r);
  color: var(--bg);
  font-weight: 600;
  cursor: pointer;
  transition: all 180ms ease;
}

.subscribe-form button:hover {
  background: #1fb8af;
}

.properties-inner a {
  display: block;
  padding: var(--p);
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: var(--r);
  color: var(--text);
  text-decoration: none;
  transition: all 180ms ease;
}

.properties-inner a:hover {
  background: var(--panel2);
  border-color: var(--active);
  color: var(--active);
}
