/* CanItRun / lingeragent.org — Design System v2 */
:root {
  --bg: #0c0e12;
  --surface: #12151b;
  --surface-card: #161a22;
  --surface-elevated: #1c212c;
  --surface-hover: #222836;
  --border: rgba(255, 255, 255, 0.08);
  --border-subtle: rgba(255, 255, 255, 0.05);
  --border-active: rgba(6, 182, 212, 0.4);
  --text: #f3f4f6;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --accent: #06b6d4;
  --accent-hover: #22d3ee;
  --accent-glow: rgba(6, 182, 212, 0.25);
  --accent-surface: rgba(6, 182, 212, 0.08);
  --success: #22c55e;
  --success-glow: rgba(34, 197, 94, 0.25);
  --success-surface: rgba(34, 197, 94, 0.1);
  --warning: #f59e0b;
  --warning-glow: rgba(245, 158, 11, 0.25);
  --warning-surface: rgba(245, 158, 11, 0.1);
  --danger: #ef4444;
  --danger-glow: rgba(239, 68, 68, 0.25);
  --danger-surface: rgba(239, 68, 68, 0.1);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-full: 9999px;
  --max-width: 1120px;
  --article-max-width: 760px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Inter", "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --header-height: 64px;
}

* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Links */
a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius-md);
}

/* Layout Containers */
.container {
  width: min(100% - 2rem, var(--max-width));
  margin: 0 auto;
}

.article-container {
  width: min(100% - 2rem, var(--article-max-width));
  margin: 0 auto;
}

/* Header & Sticky Top Nav */
header.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(12, 14, 18, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  height: var(--header-height);
  display: flex;
  align-items: center;
}

nav.main-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text);
  text-decoration: none !important;
  letter-spacing: -0.02em;
}

.brand-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
  display: inline-block;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links li {
  position: relative;
}

.nav-link {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  min-height: 44px;
}

.nav-link:hover,
.nav-link:focus {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  text-decoration: none;
}

.nav-link[aria-current="page"] {
  color: var(--accent);
  background: var(--accent-surface);
}

.nav-btn-highlight {
  background: rgba(6, 182, 212, 0.12);
  color: var(--accent) !important;
  border: 1px solid rgba(6, 182, 212, 0.25);
}

.nav-btn-highlight:hover {
  background: rgba(6, 182, 212, 0.2) !important;
  border-color: var(--accent);
}

/* Dropdown Menu */
.has-dropdown {
  position: relative;
}

.dropdown-trigger {
  cursor: pointer;
  background: transparent;
  border: none;
  font-family: inherit;
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 200px;
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.5rem;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.6);
  z-index: 110;
  list-style: none;
  margin: 0.25rem 0 0 0;
}

.has-dropdown:hover .dropdown-menu,
.has-dropdown:focus-within .dropdown-menu {
  display: block;
}

.dropdown-menu li {
  width: 100%;
}

.dropdown-item {
  display: block;
  padding: 0.6rem 0.85rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  transition: background 0.15s, color 0.15s;
  min-height: 40px;
  line-height: 1.4;
}

.dropdown-item:hover {
  color: var(--text);
  background: var(--surface-hover);
  text-decoration: none;
}

/* Mobile Nav Toggle */
.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
}

/* Typography Hierarchy */
h1, h2, h3, h4, h5, h6 {
  color: var(--text);
  font-weight: 700;
  line-height: 1.25;
  margin-top: 0;
}

h1 {
  font-size: clamp(2.25rem, 4.5vw, 3.25rem);
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
}

h2 {
  font-size: clamp(1.5rem, 3vw, 1.95rem);
  letter-spacing: -0.02em;
  margin-top: 2.5rem;
  margin-bottom: 0.85rem;
}

h3 {
  font-size: 1.25rem;
  letter-spacing: -0.01em;
  margin-top: 1.75rem;
  margin-bottom: 0.5rem;
}

.lead {
  font-size: 1.125rem;
  line-height: 1.7;
  color: var(--text-muted);
  max-width: 720px;
}

p {
  margin-top: 0;
  margin-bottom: 1.25rem;
}

/* Hero Section with Backdrop Glow & Subtle Grid */
.hero-section {
  position: relative;
  padding: 4rem 0 3rem 0;
  background-image: 
    radial-gradient(circle at 50% -10%, rgba(6, 182, 212, 0.16), transparent 70%),
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 100% 100%, 36px 36px, 36px 36px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 2.5rem;
}

.hero-content {
  max-width: 780px;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(6, 182, 212, 0.1);
  border: 1px solid rgba(6, 182, 212, 0.25);
  border-radius: var(--radius-full);
  padding: 0.25rem 0.85rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 1.25rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.hero-title strong {
  color: var(--accent);
  font-weight: 800;
  background: linear-gradient(135deg, #06b6d4 0%, #22d3ee 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Cards */
.card {
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.45);
  margin-bottom: 1.5rem;
  position: relative;
}

.card h2, .card h3 {
  margin-top: 0;
}

.card-link {
  display: block;
  color: inherit;
  text-decoration: none !important;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.card-link:hover {
  transform: translateY(-2px);
  border-color: var(--border-active);
  box-shadow: 0 8px 25px -4px rgba(6, 182, 212, 0.15);
}

.card-link h3 {
  color: var(--text);
  transition: color 0.15s ease;
}

.card-link:hover h3 {
  color: var(--accent);
}

/* Buttons */
.button,
button.primary,
button:not(.secondary):not(.quiz-btn):not(.dropdown-trigger):not(.nav-toggle) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: var(--accent);
  color: #080a0e;
  font-weight: 600;
  font-size: 0.9375rem;
  padding: 0.75rem 1.4rem;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  min-height: 44px;
  text-decoration: none !important;
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
  font-family: inherit;
}

.button:hover,
button.primary:hover,
button:not(.secondary):not(.quiz-btn):not(.dropdown-trigger):not(.nav-toggle):hover {
  background: var(--accent-hover);
  box-shadow: 0 0 16px var(--accent-glow);
  color: #080a0e;
}

.button.secondary,
button.secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: none;
}

.button.secondary:hover,
button.secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.18);
  color: var(--text);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

/* Forms */
.field {
  margin-bottom: 1.25rem;
}

label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.45rem;
  letter-spacing: -0.01em;
}

input[type="text"],
input[type="email"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  background: #0f131a;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9375rem;
  min-height: 44px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

/* Grids */
.grid {
  display: grid;
  gap: 1.5rem;
}

.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

/* Tables */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin: 1.25rem 0;
  background: var(--surface);
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-variant-numeric: tabular-nums;
  font-size: 0.9375rem;
}

thead th {
  background: #11151d;
  color: var(--text-muted);
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 2;
}

tbody td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text);
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.02);
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.04);
}

/* Verdict Badges & Result Blocks */
.result-block {
  padding: 1.5rem 1.75rem;
  border-radius: var(--radius-lg);
  margin: 1.5rem 0;
  border: 1px solid;
}

.result-block h2 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0;
  margin-bottom: 0.75rem;
  font-size: 1.6rem;
}

.result-block.good {
  background: var(--success-surface);
  border-color: rgba(34, 197, 94, 0.35);
}

.result-block.borderline {
  background: var(--warning-surface);
  border-color: rgba(245, 158, 11, 0.35);
}

.result-block.cant {
  background: var(--danger-surface);
  border-color: rgba(239, 68, 68, 0.35);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-success {
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
  border: 1px solid rgba(74, 222, 128, 0.4);
}

.badge-warning {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.4);
}

.badge-danger {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border: 1px solid rgba(248, 113, 113, 0.4);
}

/* Callout Boxes */
.callout {
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius-md);
  margin: 1.5rem 0;
  border-left: 4px solid var(--accent);
  background: var(--surface-card);
}

.callout p:last-child {
  margin-bottom: 0;
}

.callout-info {
  border-left-color: var(--accent);
  background: var(--accent-surface);
}

.callout-warning {
  border-left-color: var(--warning);
  background: var(--warning-surface);
}

.callout-danger {
  border-left-color: var(--danger);
  background: var(--danger-surface);
}

.callout-success {
  border-left-color: var(--success);
  background: var(--success-surface);
}

/* FAQ Details & Summary */
details.faq-item {
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 0.85rem;
  overflow: hidden;
  transition: border-color 0.15s ease;
}

details.faq-item summary {
  padding: 1.15rem 1.25rem;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text);
  min-height: 44px;
}

details.faq-item summary::-webkit-details-marker {
  display: none;
}

details.faq-item summary::after {
  content: "+";
  font-size: 1.25rem;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

details.faq-item[open] summary::after {
  content: "−";
  color: var(--accent);
}

details.faq-item[open] summary {
  border-bottom: 1px solid var(--border-subtle);
  color: var(--accent);
}

details.faq-item .faq-body {
  padding: 1.15rem 1.25rem;
  color: var(--text-muted);
  font-size: 0.9375rem;
  line-height: 1.7;
}

details.faq-item .faq-body p:last-child {
  margin-bottom: 0;
}

/* Code & Pre */
pre {
  background: #080a0e;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.15rem 1.35rem;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: #e2e8f0;
  line-height: 1.6;
}

code {
  font-family: var(--font-mono);
  background: rgba(255, 255, 255, 0.08);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.875em;
  color: var(--accent);
}

pre code {
  background: transparent;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

/* Figures & Captions */
figure {
  margin: 1.75rem 0;
}

figure img {
  border: 1px solid var(--border);
}

figcaption {
  font-size: 0.8125rem;
  color: var(--text-dim);
  text-align: center;
  margin-top: 0.6rem;
}

/* Notes & Disclosures */
.note {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.disclosure {
  font-size: 0.8125rem;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.85rem;
  margin-bottom: 1rem;
}

/* Utility classes */
.hidden {
  display: none !important;
}

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

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

.section-spacing {
  margin-top: 3.5rem;
  margin-bottom: 3.5rem;
}

/* Footer */
footer.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 2.75rem 1rem 2.25rem 1rem;
  margin-top: 5rem;
  color: var(--text-muted);
  font-size: 0.875rem;
  text-align: center;
}

.footer-content {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  align-items: center;
}

.footer-meta {
  line-height: 1.65;
}

.footer-line {
  margin: 0.2rem 0;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
}

.footer-links a {
  color: var(--text-muted);
  font-size: 0.875rem;
}

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

/* Responsive collapse under 760px */
@media (max-width: 760px) {
  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr;
  }

  .nav-toggle {
    display: flex;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 1rem;
    gap: 0.5rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.8);
  }

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

  .nav-links li {
    width: 100%;
  }

  .nav-link {
    width: 100%;
    padding: 0.75rem 1rem;
  }

  .dropdown-menu {
    position: static;
    display: none;
    background: var(--surface-card);
    border: 1px solid var(--border);
    margin-top: 0.25rem;
    box-shadow: none;
  }

  .has-dropdown.mobile-open .dropdown-menu {
    display: block;
  }

  .hero-section {
    padding: 2.5rem 0 2rem 0;
  }

  .result-block h2 {
    flex-direction: column;
    align-items: flex-start;
  }

  .actions {
    flex-direction: column;
  }

  .button, button {
    width: 100%;
  }
}
