@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400&display=swap');

:root {
  --canvas: #f7f7f4;
  --canvas-soft: #fafaf7;
  --surface-card: #ffffff;
  --surface-strong: #e6e5e0;
  --ink: #26251e;
  --body: #5a5852;
  --muted: #807d72;
  --muted-soft: #a09c92;
  --hairline: #e6e5e0;
  --hairline-soft: #efeee8;
  --hairline-strong: #cfcdc4;
  --primary: #f54e00;
  --primary-active: #d04200;
  --on-primary: #ffffff;
  --success: #1f8a65;
  --error: #cf2d56;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  background: var(--canvas);
  color: var(--body);
  font-family: 'Inter', system-ui, 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--ink); text-decoration: none; }
a:hover { color: var(--primary); }

img { max-width: 100%; height: auto; display: block; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* ─── TYPOGRAPHY ─── */
h1, h2, h3, h4 {
  color: var(--ink);
  font-weight: 400;
  line-height: 1.2;
}
h1 { font-size: 48px; letter-spacing: -1.2px; }
h2 { font-size: 36px; letter-spacing: -0.72px; }
h3 { font-size: 26px; letter-spacing: -0.325px; }
h4 { font-size: 22px; letter-spacing: -0.11px; }

.display-mega { font-size: 72px; font-weight: 400; letter-spacing: -2.16px; line-height: 1.1; color: var(--ink); }
.display-lg   { font-size: 36px; font-weight: 400; letter-spacing: -0.72px; line-height: 1.2; color: var(--ink); }
.display-md   { font-size: 26px; font-weight: 400; letter-spacing: -0.325px; line-height: 1.25; color: var(--ink); }
.display-sm   { font-size: 22px; font-weight: 400; letter-spacing: -0.11px; line-height: 1.3; color: var(--ink); }

.title-md { font-size: 18px; font-weight: 600; line-height: 1.4; color: var(--ink); }
.title-sm { font-size: 16px; font-weight: 600; line-height: 1.4; color: var(--ink); }

.body-md { font-size: 16px; font-weight: 400; line-height: 1.5; color: var(--body); }
.body-sm { font-size: 14px; font-weight: 400; line-height: 1.5; color: var(--body); }

.caption { font-size: 13px; font-weight: 400; line-height: 1.4; color: var(--muted); }
.label-upper { font-size: 11px; font-weight: 600; letter-spacing: 0.88px; text-transform: uppercase; color: var(--muted); }

code, pre {
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 13px;
  background: var(--surface-card);
  border: 1px solid var(--hairline);
  border-radius: 6px;
  padding: 2px 6px;
  color: var(--ink);
}

/* ─── TOP NAV ─── */
.site-header {
  background: var(--canvas);
  border-bottom: 1px solid var(--hairline);
  position: sticky;
  top: 0;
  z-index: 100;
  height: 64px;
}

.site-header .container {
  display: flex;
  align-items: center;
  height: 64px;
  gap: 32px;
}

.site-logo {
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.3px;
  flex-shrink: 0;
}

.site-logo span { color: var(--primary); }

.site-nav {
  display: flex;
  align-items: center;
  gap: 24px;
  list-style: none;
  flex: 1;
}

.site-nav a {
  font-size: 14px;
  font-weight: 500;
  color: var(--body);
  line-height: 1.4;
  transition: color 0.15s;
}
.site-nav a:hover, .site-nav a.active { color: var(--ink); }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--ink);
}

.nav-toggle .bar {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--ink);
  margin: 5px 0;
  transition: all 0.2s;
}

/* ─── BUTTONS ─── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  border-radius: 8px;
  padding: 10px 18px;
  height: 40px;
  cursor: pointer;
  border: none;
  transition: background 0.15s;
  text-decoration: none;
}

.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-primary:hover { background: var(--primary-active); color: var(--on-primary); }

.btn-secondary {
  background: var(--surface-card);
  color: var(--ink);
  border: 1px solid var(--hairline-strong);
}
.btn-secondary:hover { background: var(--canvas-soft); color: var(--ink); }

.btn-dark { background: var(--ink); color: var(--canvas); height: 44px; padding: 12px 20px; }
.btn-dark:hover { background: #3a3930; color: var(--canvas); }

/* ─── BADGE ─── */
.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.88px;
  text-transform: uppercase;
  background: var(--surface-strong);
  color: var(--ink);
  border-radius: 9999px;
  padding: 4px 10px;
}

.badge-green { background: #d4edda; color: #1a5e2b; }
.badge-orange { background: #fde8dc; color: #b83600; }

/* ─── HERO ─── */
.hero-band {
  padding: 80px 0 64px;
  background: var(--canvas);
}

.hero-band .badge { margin-bottom: 20px; }
.hero-band h1 { margin-bottom: 20px; max-width: 720px; }
.hero-band .hero-sub {
  font-size: 18px;
  color: var(--body);
  max-width: 560px;
  margin-bottom: 36px;
  line-height: 1.5;
}

.hero-image {
  margin-top: 56px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--hairline);
}
.hero-image img { width: 100%; height: 420px; object-fit: cover; }

/* ─── SECTIONS ─── */
.section { padding: 80px 0; }
.section-sm { padding: 48px 0; }
.section-alt { background: var(--canvas-soft); }

.section-header { margin-bottom: 40px; }
.section-header .label-upper { margin-bottom: 12px; }
.section-header h2 { margin-bottom: 12px; }
.section-header p { color: var(--body); max-width: 560px; }

/* ─── ARTICLE GRID ─── */
.article-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.article-card {
  background: var(--surface-card);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  overflow: hidden;
  transition: border-color 0.15s;
}
.article-card:hover { border-color: var(--hairline-strong); }

.article-card-img { height: 200px; overflow: hidden; }
.article-card-img img { width: 100%; height: 100%; object-fit: cover; }

.article-card-body { padding: 20px; }
.article-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.article-card-meta time { font-size: 13px; color: var(--muted); }

.article-card-body h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 8px;
  line-height: 1.3;
}
.article-card-body p { font-size: 14px; color: var(--body); line-height: 1.5; }

.article-card-body a.read-link {
  display: inline-block;
  margin-top: 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--primary);
  letter-spacing: 0.2px;
}

/* ─── FEATURE CARDS ─── */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.feature-card {
  background: var(--surface-card);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  padding: 24px;
}

.feature-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--canvas-soft);
  border: 1px solid var(--hairline);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  font-size: 18px;
}

.feature-card h3 { font-size: 18px; font-weight: 600; margin-bottom: 8px; }
.feature-card p { font-size: 14px; color: var(--body); line-height: 1.5; }

/* ─── ARTICLE PAGE ─── */
.article-page { padding: 64px 0; }
.article-layout { display: grid; grid-template-columns: 1fr 320px; gap: 48px; align-items: start; }

.article-header { margin-bottom: 32px; }
.article-header .label-upper { margin-bottom: 12px; }
.article-header h1 { font-size: 40px; letter-spacing: -1px; margin-bottom: 16px; line-height: 1.15; }
.article-header .article-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--muted);
  font-size: 13px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--hairline);
}

.article-cover {
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 36px;
  border: 1px solid var(--hairline);
}
.article-cover img { width: 100%; height: 380px; object-fit: cover; }

.article-body h2 { font-size: 26px; margin: 36px 0 14px; color: var(--ink); }
.article-body h3 { font-size: 20px; font-weight: 600; margin: 28px 0 10px; color: var(--ink); }
.article-body p { font-size: 16px; color: var(--body); line-height: 1.6; margin-bottom: 18px; }
.article-body ul, .article-body ol { margin: 0 0 18px 24px; }
.article-body li { font-size: 16px; color: var(--body); line-height: 1.6; margin-bottom: 6px; }

.article-body .info-box {
  background: var(--surface-card);
  border: 1px solid var(--hairline);
  border-left: 3px solid var(--primary);
  border-radius: 8px;
  padding: 20px;
  margin: 28px 0;
}
.article-body .info-box p { margin: 0; font-size: 15px; }

.article-body figure { margin: 32px 0; }
.article-body figure img { border-radius: 8px; border: 1px solid var(--hairline); width: 100%; }
.article-body figcaption { font-size: 12px; color: var(--muted); margin-top: 8px; }

/* ─── SIDEBAR ─── */
.article-sidebar { position: sticky; top: 80px; }

.sidebar-card {
  background: var(--surface-card);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
}
.sidebar-card h4 { font-size: 14px; font-weight: 600; color: var(--ink); margin-bottom: 14px; letter-spacing: 0.2px; }

.toc-list { list-style: none; }
.toc-list li { border-bottom: 1px solid var(--hairline-soft); }
.toc-list li:last-child { border: none; }
.toc-list a {
  display: block;
  padding: 8px 0;
  font-size: 13px;
  color: var(--body);
}
.toc-list a:hover { color: var(--ink); }

.related-list { list-style: none; }
.related-list li { border-bottom: 1px solid var(--hairline-soft); }
.related-list li:last-child { border: none; }
.related-list a {
  display: block;
  padding: 8px 0;
  font-size: 13px;
  color: var(--body);
  line-height: 1.4;
}
.related-list a:hover { color: var(--ink); }

/* ─── CONTACT FORM ─── */
.contact-section { padding: 80px 0; background: var(--canvas-soft); }
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: start; }
.contact-info h2 { margin-bottom: 16px; }
.contact-info p { color: var(--body); margin-bottom: 24px; line-height: 1.6; }

.contact-form-card {
  background: var(--surface-card);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  padding: 32px;
}

.form-group { margin-bottom: 20px; }
.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 6px;
}
.form-group input,
.form-group textarea {
  width: 100%;
  background: var(--canvas);
  border: 1px solid var(--hairline-strong);
  border-radius: 8px;
  padding: 12px 16px;
  height: 44px;
  font-size: 14px;
  color: var(--ink);
  font-family: inherit;
  transition: border-color 0.15s;
  outline: none;
}
.form-group textarea { height: auto; min-height: 100px; resize: vertical; }
.form-group input:focus,
.form-group textarea:focus { border-color: var(--hairline-strong); box-shadow: 0 0 0 3px rgba(245,78,0,0.08); }

.form-group input::placeholder,
.form-group textarea::placeholder { color: var(--muted-soft); }

.form-message {
  display: none;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  margin-top: 16px;
}
.form-message.success {
  display: block;
  background: #d4edda;
  color: #1a5e2b;
  border: 1px solid #a8d5b5;
}
.form-message.error {
  display: block;
  background: #fde8e8;
  color: #8b1a1a;
  border: 1px solid #f0b8b8;
}

/* ─── BREADCRUMBS ─── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 24px;
}
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--ink); }
.breadcrumb span { color: var(--muted-soft); }

/* ─── COOKIE BANNER ─── */
#cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--surface-card);
  border-top: 1px solid var(--hairline);
  padding: 16px 24px;
  z-index: 1000;
  display: none;
}

.cookie-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.cookie-text { font-size: 14px; color: var(--body); flex: 1; min-width: 280px; }
.cookie-text a { color: var(--primary); text-decoration: underline; }

.cookie-actions { display: flex; gap: 10px; flex-shrink: 0; }

/* ─── FOOTER ─── */
.site-footer {
  background: var(--canvas);
  border-top: 1px solid var(--hairline);
  padding: 64px 0 48px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 48px;
}

.footer-brand .site-logo { margin-bottom: 12px; display: inline-block; }
.footer-brand p { font-size: 14px; color: var(--body); max-width: 240px; line-height: 1.5; }

.footer-col h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 14px;
}
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 8px; }
.footer-col a { font-size: 14px; color: var(--body); }
.footer-col a:hover { color: var(--ink); }

.footer-bottom {
  border-top: 1px solid var(--hairline-soft);
  padding-top: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.footer-bottom p { font-size: 13px; color: var(--muted); }
.footer-disclaimer { font-size: 12px; color: var(--muted-soft); max-width: 600px; line-height: 1.5; }

/* ─── DIVIDER ─── */
.divider { border: none; border-top: 1px solid var(--hairline); margin: 0; }

/* ─── PAGE CONTENT ─── */
.page-hero { padding: 60px 0 40px; border-bottom: 1px solid var(--hairline); margin-bottom: 48px; }
.page-hero h1 { font-size: 40px; margin-bottom: 12px; }
.page-hero p { font-size: 16px; color: var(--body); max-width: 560px; }

.prose h2 { font-size: 24px; margin: 36px 0 12px; color: var(--ink); }
.prose h3 { font-size: 20px; font-weight: 600; margin: 28px 0 10px; color: var(--ink); }
.prose p { margin-bottom: 16px; color: var(--body); line-height: 1.6; }
.prose ul, .prose ol { margin: 0 0 16px 24px; }
.prose li { color: var(--body); line-height: 1.6; margin-bottom: 6px; }

/* ─── STATS ROW ─── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--hairline);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  overflow: hidden;
  margin: 48px 0;
}
.stat-item {
  background: var(--surface-card);
  padding: 28px 24px;
  text-align: center;
}
.stat-item .stat-num { font-size: 36px; font-weight: 400; color: var(--ink); letter-spacing: -0.8px; }
.stat-item .stat-label { font-size: 13px; color: var(--muted); margin-top: 4px; }

/* ─── RESPONSIVE ─── */
@media (max-width: 1024px) {
  .display-mega { font-size: 56px; }
  h1 { font-size: 38px; }
  .article-layout { grid-template-columns: 1fr; }
  .article-sidebar { position: static; }
  .footer-grid { grid-template-columns: 1fr 1fr 1fr; }
}

@media (max-width: 768px) {
  .display-mega { font-size: 36px; letter-spacing: -1px; }
  h1 { font-size: 30px; }
  h2 { font-size: 26px; }

  .nav-toggle { display: block; margin-left: auto; }
  .site-nav {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--canvas);
    border-bottom: 1px solid var(--hairline);
    flex-direction: column;
    padding: 16px 24px;
    gap: 4px;
  }
  .site-nav.open { display: flex; }
  .site-nav li { width: 100%; }
  .site-nav a { padding: 10px 0; display: block; border-bottom: 1px solid var(--hairline-soft); }

  .hero-band { padding: 48px 0 40px; }
  .hero-image img { height: 260px; }

  .article-grid { grid-template-columns: 1fr; }
  .feature-grid { grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .contact-grid { grid-template-columns: 1fr; gap: 32px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 640px) {
  .footer-grid { grid-template-columns: 1fr; }
  .article-header h1 { font-size: 28px; }
  .cookie-inner { flex-direction: column; align-items: flex-start; }
}
