/* CostPerTon.com - Optimized Styles */
/* Performance-first: System fonts, minimal rules, no external dependencies */

:root {
  --color-primary: #1a365d;
  --color-primary-light: #2c5282;
  --color-accent: #dd6b20;
  --color-accent-hover: #c05621;
  --color-success: #276749;
  --color-bg: #f7fafc;
  --color-bg-alt: #edf2f7;
  --color-text: #1a202c;
  --color-text-muted: #4a5568;
  --color-border: #e2e8f0;
  --color-white: #ffffff;
  --font-stack: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.1);
  --radius: 8px;
  --max-width: 1200px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-stack);
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}

/* Layout */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 20px; }
.section { padding: 60px 0; }
.section--alt { background: var(--color-white); }

/* Typography */
h1, h2, h3, h4 { font-weight: 700; line-height: 1.2; color: var(--color-primary); }
h1 { font-size: clamp(2rem, 5vw, 3rem); }
h2 { font-size: clamp(1.5rem, 4vw, 2.25rem); margin-bottom: 1rem; }
h3 { font-size: 1.25rem; margin-bottom: 0.5rem; }
p { margin-bottom: 1rem; }
a { color: var(--color-primary-light); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--color-accent); }

/* Header */
.header {
  background: var(--color-primary);
  color: var(--color-white);
  padding: 16px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-md);
}
.header__inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; }
.header__logo { font-size: 1.5rem; font-weight: 800; color: var(--color-white); display: flex; align-items: center; gap: 8px; }
.header__logo span { color: var(--color-accent); }
.nav { display: flex; gap: 8px; flex-wrap: wrap; }
.nav a {
  color: rgba(255,255,255,0.9);
  padding: 8px 16px;
  border-radius: var(--radius);
  font-weight: 500;
  font-size: 0.9rem;
  transition: all 0.2s;
}
.nav a:hover, .nav a.active { background: rgba(255,255,255,0.15); color: var(--color-white); }

/* Hero */
.hero {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
  color: var(--color-white);
  padding: 80px 0;
  text-align: center;
}
.hero h1 { color: var(--color-white); margin-bottom: 1rem; }
.hero p { font-size: 1.25rem; opacity: 0.9; max-width: 600px; margin: 0 auto 2rem; }

/* Calculator */
.calculator {
  background: var(--color-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 32px;
  max-width: 600px;
  margin: -40px auto 0;
  position: relative;
}
.calc__title { text-align: center; margin-bottom: 24px; font-size: 1.1rem; color: var(--color-text-muted); }
.calc__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 24px; }
.calc__group { display: flex; flex-direction: column; }
.calc__label { font-weight: 600; margin-bottom: 6px; font-size: 0.9rem; color: var(--color-text-muted); }
.calc__input {
  padding: 14px 16px;
  border: 2px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 1.1rem;
  font-family: var(--font-mono);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.calc__input:focus { outline: none; border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(26,54,93,0.1); }
.calc__input::placeholder { color: #a0aec0; }

/* Toggle */
.toggle { display: flex; justify-content: center; margin-bottom: 24px; background: var(--color-bg-alt); border-radius: var(--radius); padding: 4px; }
.toggle__btn {
  flex: 1;
  padding: 12px 20px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--color-text-muted);
  border-radius: 6px;
  transition: all 0.2s;
}
.toggle__btn.active { background: var(--color-white); color: var(--color-primary); box-shadow: var(--shadow-sm); }
.toggle__btn:hover:not(.active) { color: var(--color-text); }

/* Result */
.calc__result {
  text-align: center;
  padding: 24px;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
  border-radius: var(--radius);
  color: var(--color-white);
}
.calc__result-label { font-size: 0.9rem; opacity: 0.9; margin-bottom: 8px; }
.calc__result-value { font-size: 2.5rem; font-weight: 800; font-family: var(--font-mono); }
.calc__result-unit { font-size: 1rem; opacity: 0.8; margin-top: 4px; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  background: var(--color-accent);
  color: var(--color-white);
  border: none;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s;
}
.btn:hover { background: var(--color-accent-hover); transform: translateY(-1px); }
.btn--outline { background: transparent; border: 2px solid var(--color-primary); color: var(--color-primary); }
.btn--outline:hover { background: var(--color-primary); color: var(--color-white); }

/* Cards */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; margin-top: 40px; }
.card {
  background: var(--color-white);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-md);
  transition: transform 0.2s, box-shadow 0.2s;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.card__icon { font-size: 2rem; margin-bottom: 12px; }
.card__title { font-size: 1.1rem; margin-bottom: 8px; }
.card__text { color: var(--color-text-muted); font-size: 0.95rem; }

/* Tables */
.table-wrapper { overflow-x: auto; margin: 24px 0; }
table { width: 100%; border-collapse: collapse; background: var(--color-white); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-md); }
th, td { padding: 14px 16px; text-align: left; border-bottom: 1px solid var(--color-border); }
th { background: var(--color-primary); color: var(--color-white); font-weight: 600; font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.5px; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--color-bg); }
.price-range { font-family: var(--font-mono); font-weight: 600; color: var(--color-success); white-space: nowrap; }
.table-note { font-size: 0.85rem; color: var(--color-text-muted); }

/* Category Tabs */
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.tab {
  padding: 10px 20px;
  background: var(--color-bg-alt);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--color-text-muted);
  transition: all 0.2s;
}
.tab:hover { background: var(--color-border); }
.tab.active { background: var(--color-primary); color: var(--color-white); }

/* Glossary */
.glossary-list { display: grid; gap: 20px; }
.glossary-item {
  background: var(--color-white);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  border-left: 4px solid var(--color-primary);
}
.glossary-item h3 { color: var(--color-primary); margin-bottom: 12px; }
.glossary-item p { margin-bottom: 12px; }
.glossary-meta { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--color-border); }
.glossary-meta div { flex: 1; min-width: 200px; }
.glossary-meta strong { display: block; font-size: 0.8rem; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; }
.glossary-meta span { font-size: 0.95rem; }

/* Footer */
.footer { background: var(--color-primary); color: rgba(255,255,255,0.9); padding: 48px 0 24px; margin-top: 60px; }
.footer__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 40px; margin-bottom: 40px; }
.footer__col h4 { color: var(--color-white); font-size: 1rem; margin-bottom: 16px; }
.footer__col ul { list-style: none; }
.footer__col li { margin-bottom: 8px; }
.footer__col a { color: rgba(255,255,255,0.8); font-size: 0.9rem; }
.footer__col a:hover { color: var(--color-white); }
.footer__col p { font-size: 0.9rem; line-height: 1.7; }
.footer__bottom { padding-top: 24px; border-top: 1px solid rgba(255,255,255,0.1); text-align: center; font-size: 0.85rem; opacity: 0.8; }

/* Page Header */
.page-header { background: var(--color-primary); color: var(--color-white); padding: 60px 0; text-align: center; }
.page-header h1 { color: var(--color-white); margin-bottom: 0.5rem; }
.page-header p { opacity: 0.9; max-width: 600px; margin: 0 auto; }

/* Content */
.content { max-width: 800px; margin: 0 auto; }
.content h2 { margin-top: 2rem; }
.content ul, .content ol { margin-left: 1.5rem; margin-bottom: 1rem; }
.content li { margin-bottom: 0.5rem; }

/* Utility */
.text-center { text-align: center; }
.mt-2 { margin-top: 2rem; }
.mb-2 { margin-bottom: 2rem; }
.verified-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--color-bg-alt);
  padding: 8px 16px;
  border-radius: 50px;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-bottom: 24px;
}
.verified-badge::before { content: "✓"; color: var(--color-success); font-weight: bold; }

/* Search */
.search-box {
  max-width: 400px;
  margin: 0 auto 32px;
}
.search-input {
  width: 100%;
  padding: 14px 20px;
  border: 2px solid var(--color-border);
  border-radius: 50px;
  font-size: 1rem;
  transition: all 0.2s;
}
.search-input:focus { outline: none; border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(26,54,93,0.1); }

/* Mobile */
@media (max-width: 768px) {
  .calc__grid { grid-template-columns: 1fr; }
  .header__inner { justify-content: center; text-align: center; }
  .nav { justify-content: center; }
  .hero { padding: 60px 0; }
  .calculator { margin: -20px 16px 0; padding: 24px; }
  .section { padding: 40px 0; }
  th, td { padding: 10px 12px; font-size: 0.9rem; }
}

/* Print */
@media print {
  .header, .footer, .nav, .btn, .toggle { display: none; }
  body { background: white; }
  .calculator, .card, table { box-shadow: none; border: 1px solid #ddd; }
}
