:root {
  --bg: #080b0a;
  --card: #101614;
  --card-hover: #151d1a;
  --text: #e8efe9;
  --text-muted: #9fb0a5;
  --muted: #9fb0a5;
  --accent: #3ddc84;
  --accent-glow: rgba(61, 220, 132, 0.15);
  --accent-dark: #2cb56a;
  --line: #1e2a25;
  --line-light: #283932;
  --danger: #fb7185;
  --warning: #facc15;
  --radius: 12px;
  --radius-sm: 8px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.7 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  -webkit-font-smoothing: antialiased;
}

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

a:hover {
  color: #6ee7a8;
  text-decoration: underline;
}

/* Header & Navigation */
header.site {
  border-bottom: 1px solid var(--line);
  background: rgba(16, 22, 20, 0.85);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 100;
}

header.site .wrap {
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 16px 24px;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
}

.brand {
  font-weight: 800;
  letter-spacing: .08em;
  color: var(--text);
  text-decoration: none;
  font-size: 1.15rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand:hover {
  text-decoration: none;
  color: var(--accent);
}

.brand-badge {
  background: var(--accent-glow);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid rgba(61, 220, 132, 0.3);
  letter-spacing: normal;
}

nav {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

nav a {
  text-decoration: none;
  color: var(--muted);
  font-size: 14.5px;
  font-weight: 500;
  transition: color 0.15s ease;
}

nav a:hover, nav a.active {
  color: var(--accent);
  text-decoration: none;
}

.nav-cta {
  background: var(--accent);
  color: #04120a !important;
  font-weight: 700 !important;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  transition: transform 0.15s, background 0.15s;
}

.nav-cta:hover {
  background: #4ae390;
  transform: translateY(-1px);
  text-decoration: none !important;
}

/* Layout */
main {
  max-width: 820px;
  margin: 0 auto;
  padding: 36px 20px 64px;
}

main.wide {
  max-width: 1040px;
}

/* Typography */
h1 {
  font-size: 2.25rem;
  line-height: 1.25;
  margin: 0.2em 0 0.4em;
  color: #f7faf7;
  letter-spacing: -0.02em;
}

h2 {
  margin-top: 2.2em;
  margin-bottom: 0.6em;
  font-size: 1.5rem;
  color: #edf5ee;
  letter-spacing: -0.01em;
  border-bottom: 1px solid rgba(30, 42, 37, 0.6);
  padding-bottom: 8px;
}

h3 {
  margin-top: 1.6em;
  margin-bottom: 0.4em;
  font-size: 1.2rem;
  color: #e0eae2;
}

p {
  margin: 0 0 1.2em;
  color: #cfdcd2;
}

li {
  color: #cfdcd2;
  margin-bottom: 0.5em;
}

.meta {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* Breadcrumbs */
.breadcrumbs {
  font-size: 13.5px;
  color: var(--muted);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.breadcrumbs a {
  color: var(--muted);
  text-decoration: none;
}

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

.breadcrumbs span.sep {
  color: var(--line-light);
}

/* Cards & Containers */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin: 18px 0;
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
}

.card:hover {
  background: var(--card-hover);
  border-color: var(--line-light);
}

.card.featured {
  border-color: rgba(61, 220, 132, 0.4);
  background: linear-gradient(180deg, rgba(61, 220, 132, 0.05) 0%, rgba(16, 22, 20, 1) 100%);
}

.card h2 {
  margin-top: 0;
  border-bottom: none;
  padding-bottom: 0;
}

/* Badges & Tags */
.badge {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--accent-glow);
  color: var(--accent);
  border: 1px solid rgba(61, 220, 132, 0.3);
  margin-bottom: 10px;
}

.badge-blue {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.3);
}

.badge-purple {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border-color: rgba(168, 85, 247, 0.3);
}

.badge-amber {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.3);
}

/* Callouts & Quotes */
.callout {
  background: rgba(16, 22, 20, 0.9);
  border-left: 4px solid var(--accent);
  border-top: 1px solid var(--line);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 18px 20px;
  margin: 24px 0;
}

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

.callout-title {
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 6px;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
}

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

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: #04120a;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 700;
  font-size: 14.5px;
  transition: transform 0.15s, background 0.15s;
  cursor: pointer;
  border: none;
}

.btn:hover {
  background: #4ae390;
  transform: translateY(-1px);
  text-decoration: none;
  color: #04120a;
}

.btn-secondary {
  background: #18231e;
  color: var(--text);
  border: 1px solid var(--line);
}

.btn-secondary:hover {
  background: #202d27;
  color: #fff;
  border-color: var(--line-light);
}

/* Tables */
.table-wrap {
  overflow-x: auto;
  margin: 24px 0;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
  background: var(--card);
}

th, td {
  border: 1px solid var(--line);
  padding: 12px 14px;
  text-align: left;
}

th {
  background: #151d1a;
  color: #f0f7f2;
  font-weight: 600;
}

td {
  color: #cfdcd2;
}

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

/* Code */
code {
  background: #18221d;
  padding: 2px 6px;
  border-radius: 4px;
  color: #a3e9be;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 13.5px;
}

/* Author Box */
.author-box {
  display: flex;
  gap: 16px;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin: 36px 0;
}

.author-avatar {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: #1e2c24;
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.2rem;
  border: 2px solid var(--accent);
  flex-shrink: 0;
}

.author-info h4 {
  margin: 0 0 4px;
  font-size: 15px;
  color: var(--text);
}

.author-info p {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

/* Interactive Calculator Components */
.calculator-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin: 28px 0 36px;
}

@media(max-width: 768px) {
  .calculator-container {
    grid-template-columns: 1fr;
  }
}

.calc-panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
}

.calc-panel h3 {
  margin-top: 0;
  margin-bottom: 18px;
  font-size: 18px;
  color: #f7faf7;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  color: #cfdcd2;
  margin-bottom: 6px;
}

.form-group .hint {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

.input-with-symbol {
  position: relative;
  display: flex;
  align-items: center;
}

.input-symbol {
  position: absolute;
  left: 12px;
  color: var(--muted);
  font-size: 14px;
  pointer-events: none;
}

input.calc-input {
  width: 100%;
  background: #080d0a;
  border: 1px solid var(--line-light);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  padding-left: 28px;
  color: #fff;
  font-size: 15px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input.calc-input.no-symbol {
  padding-left: 12px;
}

input.calc-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(61, 220, 132, 0.15);
}

.metric-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 20px;
}

.metric-card {
  background: #090e0b;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}

.metric-card.hero {
  grid-column: 1 / -1;
  background: linear-gradient(180deg, rgba(61, 220, 132, 0.08) 0%, rgba(9, 14, 11, 1) 100%);
  border-color: rgba(61, 220, 132, 0.3);
}

.metric-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}

.metric-value {
  font-size: 24px;
  font-weight: 800;
  color: #f7faf7;
  letter-spacing: -0.02em;
}

.metric-card.hero .metric-value {
  font-size: 30px;
  color: var(--accent);
}

.metric-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

/* Category Filter Tabs on Blog */
.category-nav {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 12px;
  margin: 24px 0 32px;
  border-bottom: 1px solid var(--line);
}

.category-pill {
  white-space: nowrap;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--card);
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 600;
  border: 1px solid var(--line);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
}

.category-pill:hover, .category-pill.active {
  background: var(--accent);
  color: #04120a;
  border-color: var(--accent);
  text-decoration: none;
}

/* Footer */
footer.site {
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
  text-align: center;
  padding: 36px 20px 48px;
  background: #060908;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px 24px;
  margin-bottom: 18px;
}

.footer-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 13.5px;
}

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

/* Responsive tweaks */
@media (max-width: 680px) {
  h1 {
    font-size: 1.8rem;
  }
  header.site .wrap {
    justify-content: center;
    text-align: center;
    gap: 12px;
  }
  nav {
    justify-content: center;
    gap: 12px;
  }
  .metric-grid {
    grid-template-columns: 1fr;
  }
  .author-box {
    flex-direction: column;
    text-align: center;
  }
}

/* GymLedger Logo Styles */
.brand-logo {
  height: auto;
  max-height: 42px;
  width: auto;
  max-width: 165px;
  object-fit: contain;
  display: block;
}
.site-footer-logo {
  max-height: 36px;
  width: auto;
  max-width: 140px;
  object-fit: contain;
  display: inline-block;
  margin-bottom: 12px;
}
.brand-picture {
  display: inline-flex;
  align-items: center;
}
@media (max-width: 480px) {
  .brand-logo {
    max-height: 36px;
    max-width: 130px;
  }
}
