/* ============================================================
   Thymulin Chemical — Steampunk Industrial Design System
   Palette: dark-navy ground (#0E1626), brass/copper accents
   Typography: Cinzel (labels) + Zilla Slab (heads) + Inter (body) + JetBrains Mono (code/stats)
   ============================================================ */

/* --- Variables --- */
:root {
  --primary: #CD7F32;
  --primary-50: #F4E3CB;
  --primary-900: #5B3D17;
  --secondary: #B87333;
  --accent: #9DB4C0;
  --neutral-50: #ECE3D2;
  --neutral-200: #3A4151;
  --neutral-500: #8A8474;
  --neutral-900: #0A1019;
  --bg: #0E1626;
  --surface: #16202E;
  --surface-2: #1C2638;
  --text: #ECE3D2;
  --text-muted: #B6A988;
  --metal-brass: #D89C4A;
  --metal-copper: #C8884A;
  --metal-dark: #4A3C28;
  --success: #7FB069;
  --warning: #D89C4A;
  --danger: #E06A52;
  --max-width: 70rem;
  --container-px: clamp(1rem, 3vw, 2rem);
  --font-heading: 'Cinzel', 'Trajan Pro', Georgia, serif;
  --font-display: 'Zilla Slab', 'Roboto Slab', Georgia, serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', monospace;
  --radius-btn: 3px;
  --radius-card: 4px;
  --reading-col: 44rem;
  --hero-col: 46rem;
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 100%; scroll-behavior: smooth; }
body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; height: auto; }
a { color: var(--metal-brass); text-decoration: none; transition: color 200ms ease-out; }
a:hover { color: var(--primary-50); }
ul, ol { list-style: none; }

/* --- Container --- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--container-px);
}

/* --- Typography --- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.12;
  color: var(--text);
}
h1 { font-size: clamp(2.1rem, 4.2vw, 3.4rem); }
h2 { font-size: clamp(1.5rem, 2.8vw, 2.2rem); margin-bottom: 1rem; }
h3 { font-size: 1.375rem; margin-bottom: 0.75rem; }
h4 { font-size: 1.125rem; margin-bottom: 0.5rem; }
p { margin-bottom: 1.25rem; }
p:last-child { margin-bottom: 0; }
strong { font-weight: 600; color: var(--text); }

/* Eyebrow / Cinzel label */
.eyebrow {
  font-family: var(--font-heading);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: var(--metal-brass);
  text-transform: uppercase;
}

/* Nameplate component */
.nameplate {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.375rem 0.75rem;
  border-top: 1px solid var(--primary);
  border-bottom: 1px solid var(--primary);
  position: relative;
  margin-bottom: 1.5rem;
}
.nameplate::before,
.nameplate::after {
  content: '';
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--metal-brass);
  flex-shrink: 0;
}

/* Small text */
small, .small { font-size: 0.875rem; color: var(--text-muted); }

/* Lead text */
.lead {
  font-size: 1.1875rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Mono / code */
code, .mono {
  font-family: var(--font-mono);
  font-size: 0.9375rem;
  color: var(--metal-brass);
  background: var(--surface-2);
  border-left: 1px solid rgba(205, 127, 50, 0.4);
  padding: 0.125rem 0.4rem;
  border-radius: 2px;
}
pre {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  background: var(--surface-2);
  border-left: 2px solid var(--primary);
  padding: 1rem 1.25rem;
  border-radius: 2px;
  overflow-x: auto;
  margin-bottom: 1.25rem;
  color: var(--metal-brass);
}

/* Section rules */
.section-rule {
  border: none;
  border-top: 1px solid rgba(205, 127, 50, 0.25);
  margin-block: 2.5rem;
}

/* --- Header --- */
.site-header {
  background: var(--bg);
  border-bottom: 1px solid var(--neutral-200);
  position: sticky;
  top: 0;
  z-index: 100;
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 3.5rem;
  gap: 1.5rem;
}
.site-brand {
  font-family: var(--font-heading);
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--metal-brass);
  text-transform: uppercase;
  white-space: nowrap;
  transition: color 200ms ease-out;
}
.site-brand:hover { color: var(--primary-50); }

.site-nav ul {
  display: flex;
  gap: 0;
  align-items: center;
}
.site-nav a {
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  padding: 0.5rem 0.75rem;
  position: relative;
  transition: color 200ms ease-out;
}
.site-nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0.75rem;
  right: 0.75rem;
  height: 1px;
  background: var(--metal-brass);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 200ms ease-out;
}
.site-nav a:hover { color: var(--metal-brass); }
.site-nav a:hover::after { transform: scaleX(1); }

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--neutral-200);
  color: var(--text-muted);
  padding: 0.375rem 0.625rem;
  cursor: pointer;
  border-radius: var(--radius-btn);
  font-size: 1.125rem;
  line-height: 1;
  transition: color 200ms ease-out, border-color 200ms ease-out;
}
.nav-toggle:hover { color: var(--metal-brass); border-color: var(--metal-brass); }

/* --- Buttons --- */
.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.9375rem;
  padding: 0.8125rem 1.5rem;
  border-radius: var(--radius-btn);
  cursor: pointer;
  border: none;
  line-height: 1;
  transition: background-color 200ms ease-out, color 200ms ease-out;
  text-decoration: none;
}
.btn-primary {
  background: var(--primary);
  color: var(--bg);
  box-shadow: 1px 1px 0 var(--secondary);
}
.btn-primary:hover { background: var(--metal-brass); color: var(--bg); }
.btn-secondary {
  background: transparent;
  color: var(--metal-brass);
  border: 1px solid var(--primary);
}
.btn-secondary:hover { background: rgba(205, 127, 50, 0.06); color: var(--primary-50); border-color: var(--metal-brass); }

/* --- Hero --- */
.hero {
  padding-block: clamp(3rem, 6vw, 5rem);
}
.hero-inner {
  max-width: var(--hero-col);
}
.hero h1 {
  margin-bottom: 1.25rem;
  font-size: clamp(2.1rem, 4.2vw, 3.4rem);
}
.hero .lead { margin-bottom: 2rem; max-width: var(--reading-col); }

/* Gauge strip */
.gauge-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}
.gauge-tile {
  background: var(--surface);
  border: 1px solid rgba(205, 127, 50, 0.35);
  border-radius: var(--radius-card);
  padding: 1rem;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.4) inset;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.gauge-label {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--metal-brass);
  text-transform: uppercase;
}
.gauge-value {
  font-family: var(--font-mono);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 600;
  color: var(--metal-brass);
  line-height: 1;
}
.gauge-value.danger { color: var(--danger); }
.gauge-gloss {
  font-family: var(--font-body);
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Hero rule */
.hero-rule {
  border: none;
  border-top: 1px solid rgba(205, 127, 50, 0.35);
  margin-top: 2.5rem;
}

/* Hero image figure */
.hero-figure {
  margin-top: 2.5rem;
  border-radius: var(--radius-card);
  overflow: hidden;
  border: 1px solid var(--neutral-200);
}
.hero-figure img { width: 100%; }

/* --- Main content --- */
main { padding-block: clamp(2rem, 4vw, 3.5rem); }

/* Reading column */
.reading-body {
  max-width: var(--reading-col);
}

/* Sections */
.content-section {
  margin-bottom: 3rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid rgba(58, 65, 81, 0.6);
}
.content-section:last-of-type {
  border-bottom: none;
}

/* Section kicker (nameplate variant) */
.section-kicker {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: var(--metal-brass);
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.875rem;
}
.section-kicker::before {
  content: '';
  display: block;
  width: 2rem;
  height: 1px;
  background: var(--primary);
}

/* --- Cards --- */
.card {
  background: var(--surface);
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-card);
  padding: 1.5rem;
  position: relative;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.4) inset;
}
/* Riveted top corners */
.card-riveted::before,
.card-riveted::after {
  content: '';
  position: absolute;
  top: 0.625rem;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--secondary);
}
.card-riveted::before { left: 0.625rem; }
.card-riveted::after { right: 0.625rem; }

/* --- Callouts --- */
.callout {
  background: var(--surface-2);
  border-left: 4px solid var(--primary);
  padding: 1rem 1.25rem;
  border-radius: 0 var(--radius-card) var(--radius-card) 0;
  margin-bottom: 1.5rem;
}
.callout .callout-label {
  font-family: var(--font-heading);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: var(--metal-brass);
  text-transform: uppercase;
  margin-bottom: 0.375rem;
}
.callout-danger { border-left-color: var(--danger); }
.callout-danger .callout-label { color: var(--danger); }

/* --- Citation markers --- */
sup a[data-citation] {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--metal-brass);
  border-bottom: 1px dotted var(--metal-brass);
  text-decoration: none;
  transition: color 200ms ease-out;
}
sup a[data-citation]:hover { color: var(--primary-50); }

/* --- Tables --- */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
  margin-bottom: 1.5rem;
}
.data-table th {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--metal-brass);
  background: var(--surface-2);
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--neutral-200);
  text-align: left;
}
.data-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(58, 65, 81, 0.5);
  color: var(--text);
  vertical-align: top;
}
.data-table tr:nth-child(even) td { background: var(--surface); }
.data-table tr:nth-child(odd) td { background: var(--surface-2); }
.data-table tr:last-child td { border-bottom: none; }

/* --- References list --- */
.references-list {
  list-style: none;
  counter-reset: ref-counter;
  padding: 0;
}
.references-list li {
  counter-increment: ref-counter;
  display: flex;
  gap: 1rem;
  padding: 1rem;
  border-bottom: 1px solid rgba(58, 65, 81, 0.5);
  font-size: 0.9375rem;
  line-height: 1.6;
}
.references-list li:last-child { border-bottom: none; }
.references-list li::before {
  content: counter(ref-counter);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--metal-brass);
  background: var(--surface-2);
  border: 1px solid rgba(205, 127, 50, 0.3);
  min-width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 2px;
  flex-shrink: 0;
  margin-top: 0.125rem;
}
.references-list li a {
  color: var(--metal-brass);
}
.references-list li a:hover { color: var(--primary-50); }

/* Ref link arrow */
.ref-arrow {
  margin-left: 0.375rem;
  font-size: 0.875rem;
  opacity: 0.8;
}

/* --- FAQ accordion --- */
.faq-list { display: flex; flex-direction: column; gap: 0.75rem; }
.faq-item {
  background: var(--surface);
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-card);
  overflow: hidden;
}
.faq-question {
  width: 100%;
  background: none;
  border: none;
  text-align: left;
  padding: 1.125rem 1.5rem;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  transition: color 200ms ease-out;
}
.faq-question:hover { color: var(--metal-brass); }
.faq-icon {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  color: var(--metal-brass);
  transition: transform 200ms ease-out;
  flex-shrink: 0;
}
.faq-item[open] .faq-icon { transform: rotate(45deg); }
.faq-answer {
  padding: 0 1.5rem 1.25rem;
  color: var(--text-muted);
  font-size: 0.9375rem;
  line-height: 1.7;
  border-top: 1px solid rgba(58, 65, 81, 0.5);
}
.faq-answer p { margin-bottom: 0.75rem; }
.faq-answer p:last-child { margin-bottom: 0; }

/* --- Contact form --- */
.contact-form { max-width: 36rem; }
.form-group { margin-bottom: 1.25rem; }
.form-label {
  display: block;
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--metal-brass);
  margin-bottom: 0.5rem;
}
.form-input,
.form-select,
.form-textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-btn);
  padding: 0.75rem 1rem;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  transition: border-color 200ms ease-out;
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--primary);
}
.form-textarea { min-height: 8rem; resize: vertical; }
.form-select option { background: var(--surface); color: var(--text); }

/* --- Footer --- */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--neutral-200);
  padding-block: 3rem;
  margin-top: 4rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2.5rem 2rem;
  margin-bottom: 2rem;
}
.footer-brand-col .site-brand-footer {
  font-family: var(--font-heading);
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--metal-brass);
  text-transform: uppercase;
  display: block;
  margin-bottom: 0.875rem;
}
.footer-tagline {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.6;
}
.footer-col-heading {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--metal-brass);
  margin-bottom: 0.875rem;
}
.footer-links { display: flex; flex-direction: column; gap: 0.5rem; }
.footer-links a {
  font-size: 0.875rem;
  color: var(--text-muted);
  transition: color 200ms ease-out;
}
.footer-links a:hover { color: var(--metal-brass); }
.footer-bottom {
  border-top: 1px solid var(--neutral-200);
  padding-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  align-items: flex-start;
}
.footer-disclaimer {
  font-size: 0.875rem;
  color: var(--text-muted);
  max-width: 36rem;
  font-style: italic;
}
.footer-copyright {
  font-size: 0.8125rem;
  color: var(--neutral-500);
  white-space: nowrap;
}

/* --- Page header (inner pages) --- */
.page-header {
  padding-block: clamp(2rem, 4vw, 3rem);
  border-bottom: 1px solid rgba(205, 127, 50, 0.25);
  margin-bottom: 2.5rem;
}
.page-header h1 {
  max-width: var(--hero-col);
  margin-top: 0.875rem;
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
}
.page-header .lead { max-width: var(--reading-col); margin-top: 0.875rem; }

/* Breadcrumb */
.breadcrumb {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--metal-brass); }
.breadcrumb-sep { opacity: 0.5; }

/* --- Image figures --- */
figure.content-figure {
  margin-block: 2rem;
  border-radius: var(--radius-card);
  overflow: hidden;
  border: 1px solid var(--neutral-200);
}
figure.content-figure img { width: 100%; display: block; }
figure.content-figure figcaption {
  background: var(--surface-2);
  padding: 0.625rem 1rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
  font-style: italic;
}

/* --- 404 page --- */
.error-page {
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-block: 4rem;
}
.error-code {
  font-family: var(--font-mono);
  font-size: clamp(3rem, 8vw, 6rem);
  font-weight: 600;
  color: var(--primary);
  display: block;
  line-height: 1;
  margin-bottom: 1rem;
}
.error-title {
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin-bottom: 0.875rem;
}
.error-body {
  color: var(--text-muted);
  max-width: 30rem;
  margin-inline: auto;
  margin-bottom: 2rem;
}

/* --- Utility classes --- */
.text-brass { color: var(--metal-brass); }
.text-muted { color: var(--text-muted); }
.text-danger { color: var(--danger); }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.hidden { display: none; }

/* Benefit ordered list */
.benefit-list {
  list-style: decimal;
  padding-left: 1.5rem;
  margin-bottom: 1.25rem;
}
.benefit-list li {
  margin-bottom: 1rem;
}
.benefit-list li:last-child {
  margin-bottom: 0;
}

/* Admin bullet list (disc style) */
.admin-list {
  list-style: disc;
  padding-left: 1.5rem;
  margin-bottom: 1.25rem;
}
.admin-list li {
  margin-bottom: 0.75rem;
}

/* Hero figure full-width variant */
.hero-figure-full {
  max-width: var(--max-width);
  margin-inline: auto;
}

/* --- Dosage table wrapper --- */
.table-wrapper { overflow-x: auto; margin-bottom: 1.5rem; }

/* Stat row for dosage page */
.stat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2rem;
}
.stat-chip {
  background: var(--surface);
  border: 1px solid rgba(205, 127, 50, 0.35);
  border-radius: var(--radius-card);
  padding: 0.75rem 1rem;
  min-width: 8rem;
}
.stat-chip .chip-label {
  font-family: var(--font-heading);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--metal-brass);
  margin-bottom: 0.25rem;
}
.stat-chip .chip-value {
  font-family: var(--font-mono);
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text);
}

/* About page texture band */
.texture-band {
  margin-block: 3rem;
  border-radius: var(--radius-card);
  overflow: hidden;
  height: 8rem;
  position: relative;
}
.texture-band img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.6;
}

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

@media (max-width: 768px) {
  .site-nav { display: none; position: absolute; top: 3.5rem; left: 0; right: 0; background: var(--bg); border-bottom: 1px solid var(--neutral-200); padding: 1rem var(--container-px); z-index: 99; }
  .site-nav.is-open { display: block; }
  .site-nav ul { flex-direction: column; gap: 0; }
  .site-nav a { display: block; padding: 0.75rem 0; border-bottom: 1px solid rgba(58, 65, 81, 0.3); }
  .site-nav a::after { display: none; }
  .nav-toggle { display: flex; align-items: center; justify-content: center; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 2rem 1.5rem; }
  .footer-brand-col { grid-column: 1 / -1; }
  .gauge-strip { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; }
  .gauge-strip { grid-template-columns: 1fr 1fr; }
  .footer-bottom { flex-direction: column; gap: 0.75rem; }
}

/* --- Reduced motion --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  html { scroll-behavior: auto; }
}
