:root {
  --ink: #111111;
  --dark-grey: #2b2b2b;
  --mid-grey: #858585;
  --paper: #f7f7f4;
  --white: #ffffff;
  --red: #ff3b30;
  --blue: #2563ff;
  --green: #b6ff00;
  --border: #d4d4d4;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { font-family: Arial, Helvetica, sans-serif; background: var(--paper); color: var(--ink); min-height: 100vh; }
a { color: inherit; text-decoration: none; }

/* Site header — matches sebastianszopa.com */
.site-header {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 86px;
  padding: 0 5vw;
  background: var(--paper);
  border-bottom: 3px solid var(--red);
}
.brand { font-size: clamp(1.15rem, 2vw, 1.7rem); font-weight: 800; letter-spacing: -0.07em; white-space: nowrap; }
.brand .first { color: var(--dark-grey); }
.brand .last { color: var(--mid-grey); }
.brand .domain { color: var(--red); }
.site-header nav { display: flex; align-items: center; gap: clamp(0.9rem, 2vw, 2.2rem); text-transform: uppercase; font-size: 0.62rem; font-weight: 700; letter-spacing: 0.12em; }
.site-header nav a { position: relative; padding: 11px 0; white-space: nowrap; }
.site-header nav a::after { position: absolute; right: 100%; bottom: 3px; left: 0; height: 2px; content: ""; background: var(--blue); transition: right 0.25s ease; }
.site-header nav a:hover::after, .site-header nav a.active::after { right: 0; }
.mobile-menu { display: none; border: 0; background: transparent; color: var(--ink); font-size: 1.5rem; cursor: pointer; }
.lang-switch {
  position: absolute;
  z-index: 40;
  top: calc(100% + 10px);
  left: 5vw;
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
}
.lang-switch button {
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--mid-grey);
  font: inherit;
  letter-spacing: inherit;
  cursor: pointer;
  transition: color 0.2s ease;
}
.lang-switch button:hover { color: var(--ink); }
.lang-switch button.active { color: var(--red); }

@media (max-width: 768px) {
  .site-header nav { display: none; }
  .site-header nav.open { display: flex; flex-direction: column; position: absolute; top: 86px; left: 0; right: 0; background: var(--white); padding: 20px 5vw; gap: 12px; border-bottom: 1px solid var(--border); }
  .mobile-menu { display: block; }
}

/* Layout */
.container { max-width: 1100px; margin: 0 auto; padding: 40px 24px; }
.nav-row { display: grid; grid-template-columns: 1fr 1fr; align-items: center; margin-bottom: 16px; }
.nav-row a:last-child { text-align: right; }
.nav-row a { font-size: 0.85rem; font-weight: 600; color: var(--ink); }
.nav-row a:hover { color: var(--red); }
.section-intro {
  font-size: 1.0rem; line-height: 1.7; color: var(--dark-grey); font-weight: 500;
  border-left: 4px solid var(--blue); padding: 8px 0 8px 14px; margin-bottom: 22px; max-width: 780px;
}
.header { text-align: center; margin-bottom: 40px; }
.header h1 { font-size: 2rem; font-weight: 800; color: var(--ink); margin-bottom: 8px; letter-spacing: -0.03em; }
.header p { font-size: 1rem; color: var(--mid-grey); }
.badge { display: inline-block; background: var(--ink); color: var(--white); font-size: 0.7rem; font-weight: 700; padding: 2px 8px; border-radius: 2px; margin-left: 8px; text-transform: uppercase; letter-spacing: 0.05em; }
.badge-free { background: var(--red); }
.nav-tabs { display: flex; gap: 12px; justify-content: center; margin-bottom: 32px; flex-wrap: wrap; }
.nav-tabs a { padding: 10px 22px; border-radius: 2px; text-decoration: none; font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; transition: all 0.2s; }
.nav-tabs a.active { background: var(--ink); color: var(--white); }
.nav-tabs a:not(.active) { color: var(--mid-grey); border: 1px solid var(--border); }
.nav-tabs a:not(.active):hover { border-color: var(--ink); color: var(--ink); }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; margin-bottom: 32px; }
.card { background: var(--white); border: 1px solid var(--border); border-radius: 2px; padding: 24px; }
.card h3 { font-size: 1.1rem; font-weight: 800; color: var(--ink); margin-bottom: 4px; }
.card .subtitle { font-size: 0.85rem; color: var(--mid-grey); margin-bottom: 16px; }
.stat { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid #ececec; }
.stat:last-child { border-bottom: none; }
.stat .label { font-size: 0.9rem; color: var(--mid-grey); }
.stat .value { font-size: 1.1rem; font-weight: 700; color: var(--ink); }
.stat .value.up { color: #16a34a; }
.stat .value.down { color: var(--red); }
.chart-container { background: var(--white); border: 1px solid var(--border); border-radius: 2px; padding: 24px; margin-bottom: 24px; }
.chart-container h3 { font-size: 1.1rem; font-weight: 800; color: var(--ink); margin-bottom: 16px; }
.chart-container canvas { width: 100% !important; max-height: 300px; }
.currency-toggle { display: flex; gap: 8px; justify-content: center; margin-bottom: 24px; }
.currency-toggle button { padding: 8px 18px; border-radius: 2px; border: 1px solid var(--border); background: var(--white); color: var(--mid-grey); cursor: pointer; font-size: 0.85rem; font-weight: 700; transition: all 0.2s; }
.currency-toggle button.active { background: var(--ink); color: var(--white); border-color: var(--ink); }
.footer { text-align: center; margin-top: 40px; color: var(--mid-grey); font-size: 0.85rem; }
.login-prompt { text-align: center; padding: 32px; background: var(--white); border: 1px solid var(--border); border-radius: 2px; margin-bottom: 24px; }
.login-prompt p { color: var(--mid-grey); margin-bottom: 16px; }
.login-prompt a { display: inline-block; padding: 12px 28px; background: var(--red); color: var(--white); text-decoration: none; border-radius: 2px; font-weight: 700; font-size: 0.9rem; }
a.back { color: var(--red); text-decoration: none; font-size: 0.9rem; font-weight: 700; display: inline-block; margin-bottom: 24px; }
.loading { text-align: center; padding: 40px; color: var(--mid-grey); }
.error { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; padding: 16px; border-radius: 2px; margin-bottom: 16px; }
.model-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 768px) { .model-compare { grid-template-columns: 1fr; } }

/* Insights panel */
.insights-panel { border-left: 3px solid var(--red); }
.insights-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 16px; }
.insight-card { background: var(--paper); border: 1px solid var(--border); border-radius: 2px; padding: 16px; text-align: center; }
.insight-card.best { border-color: #86efac; }
.insight-card.worst { border-color: #fecaca; }
.insight-card.savings { border-color: #bfdbfe; }
.insight-card.vol-low { border-color: #86efac; }
.insight-card.vol-mid { border-color: #fde68a; }
.insight-card.vol-high { border-color: #fecaca; }
.insight-label { font-size: 0.8rem; color: var(--mid-grey); margin-bottom: 6px; }
.insight-value { font-size: 1.3rem; font-weight: 800; color: var(--ink); }
.insight-card.best .insight-value { color: #16a34a; }
.insight-card.worst .insight-value { color: var(--red); }
.insight-card.savings .insight-value { color: var(--blue); }
.insight-card.vol-low .insight-value { color: #16a34a; }
.insight-card.vol-mid .insight-value { color: #d97706; }
.insight-card.vol-high .insight-value { color: var(--red); }
.insight-sub { font-size: 0.8rem; color: var(--mid-grey); margin-top: 4px; }
.insights-rec { background: var(--paper); border: 1px solid var(--border); border-radius: 2px; padding: 14px; font-size: 0.9rem; color: var(--dark-grey); line-height: 1.6; }
.insights-rec strong { color: var(--ink); }

/* Price-by-days table */
.pdb-table { margin-top: 16px; overflow-x: auto; }
.pdb-data-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; margin: 0; }
.pdb-data-table th { color: var(--mid-grey); font-weight: 700; text-align: right; padding: 10px 12px; border-bottom: 2px solid var(--ink); text-transform: uppercase; font-size: 0.72rem; letter-spacing: 0.06em; background: var(--paper); }
.pdb-data-table th:first-child { text-align: left; }
.pdb-data-table td { color: var(--ink); padding: 8px 12px; border-bottom: 1px solid var(--border); text-align: right; font-variant-numeric: tabular-nums; }
.pdb-data-table td:first-child { text-align: left; font-weight: 700; }
.pdb-data-table tr:hover td { background: #f0f7ff; }
.pdb-data-table tr.pdb-na td { color: #b0b0b0; font-style: italic; font-weight: 400; }
.pdb-data-table .pdb-idx { font-weight: 700; }
.pdb-data-table .pdb-idx-low { color: #16a34a; }
.pdb-data-table .pdb-idx-high { color: #ff3b30; }

/* Category sections */
.cat-section { margin-bottom: 28px; }
.cat-title { font-size: 1.1rem; font-weight: 800; margin-bottom: 12px; padding-left: 12px; border-left: 3px solid var(--ink); text-transform: uppercase; letter-spacing: 0.5px; }
.route-card { transition: transform 0.15s, box-shadow 0.15s; }
.route-card:hover { transform: translateY(-2px); box-shadow: 2px 2px 0 var(--ink); }

/* Login / Request forms */
.login-box, .form-box { background: var(--white); border: 1px solid var(--border); border-radius: 2px; padding: 32px; }
.login-box h2, .form-box h2 { font-size: 1.4rem; font-weight: 800; color: var(--ink); margin-bottom: 24px; text-align: center; }
.form-box .desc { color: var(--mid-grey); font-size: 0.95rem; margin-bottom: 24px; line-height: 1.5; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 0.8rem; color: var(--mid-grey); margin-bottom: 6px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
.form-group input, .form-group textarea { width: 100%; padding: 12px 14px; border-radius: 2px; border: 1px solid var(--border); background: var(--paper); color: var(--ink); font-size: 1rem; }
.form-group textarea { min-height: 80px; resize: vertical; }
.form-group input:focus, .form-group textarea:focus { outline: none; border-color: var(--red); }
.btn { width: 100%; padding: 14px; border: none; border-radius: 2px; background: var(--red); color: #ffffff; font-size: 1rem; font-weight: 700; cursor: pointer; transition: all 0.2s; text-transform: uppercase; letter-spacing: 0.05em; }
.btn:hover { background: var(--ink); }
.error-msg { color: var(--red); font-size: 0.9rem; margin-top: 12px; text-align: center; font-weight: 700; }
.links { text-align: center; margin-top: 16px; font-size: 0.85rem; }
.links a { color: var(--red); text-decoration: none; font-weight: 700; }
.msg { margin-top: 16px; padding: 12px; border-radius: 2px; font-size: 0.9rem; text-align: center; font-weight: 700; }
.msg.ok { background: #f0fdf4; border: 1px solid #86efac; color: #15803d; }
.msg.err { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }

/* Story & Insight Components */
.story-box {
  background: #f0f7ff;
  border-left: 3px solid #2563ff;
  padding: 16px 20px;
  margin-bottom: 32px;
  border-radius: 2px;
  font-size: 0.95rem;
  line-height: 1.6;
  color: #1e40af;
}
.story-box p { margin-bottom: 8px; }
.story-box p:last-child { margin-bottom: 0; }
.story-box strong { color: #111; }
.insight-note {
  background: #f9f9f9;
  border: 1px dashed #d4d4d4;
  padding: 12px;
  margin: 16px 0;
  font-size: 0.85rem;
  color: #5f5f5f;
  font-style: italic;
}

/* Pipeline page */
.section-block { margin-bottom: 32px; }
.section-block .section-header { margin-bottom: 8px; }
.section-block .section-header h3 { font-size: 1.2rem; font-weight: 800; margin-bottom: 8px; }
.arch-diagram { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 16px 0; }
.arch-col { display: flex; flex-direction: column; gap: 6px; }
.arch-box { background: var(--white); border: 1px solid var(--border); padding: 8px 14px; font-size: 0.82rem; font-weight: 600; text-align: center; border-radius: 2px; }
.arch-box small { display: block; font-weight: 400; color: var(--mid-grey); font-size: 0.65rem; }
.arch-box.highlight { background: var(--ink); color: var(--white); border-color: var(--ink); }
.arch-box.highlight small { color: #999; }
.arch-arrow { font-size: 1.2rem; color: var(--mid-grey); font-weight: 700; }
.pipe-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; margin-top: 12px; }
.pipe-table th { text-align: left; padding: 10px 12px; border-bottom: 2px solid var(--ink); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em; }
.pipe-table td { padding: 10px 12px; border-bottom: 1px solid #eee; vertical-align: top; }
.pipe-table .mono { font-family: monospace; font-size: 0.78rem; }
.code-block { background: #1e1e1e; color: #d4d4d4; padding: 16px; border-radius: 4px; overflow-x: auto; font-family: "SF Mono", "Fira Code", monospace; font-size: 0.78rem; line-height: 1.6; margin: 12px 0; }
.code-block code { font-family: inherit; }
