/* Skilark — Japandi-Pastoral Watercolor Theme */
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}

:root {
  /* Foundation */
  --cream: #FAF6F0;
  --warm-white: #FFFDF8;
  --ink: #3B3632;
  --stone: #8B8178;
  --pebble: #C4BAB0;

  /* Accents */
  --sage: #7C9A82;
  --sage-light: #E8F0E9;
  --blossom: #D4A0A0;
  --blossom-light: #F5E8E8;
  --sky: #8BAEC4;
  --golden: #C9A96E;
  --earth: #A68B6B;
  --clay: #C4836A;

  /* Semantic */
  --positive: #7C9A82;
  --positive-bg: #E8F0E9;
  --negative: #C47A7A;
  --negative-bg: #F5E8E8;

  /* System */
  --radius: 12px;
  --radius-sm: 8px;
  --radius-pill: 100px;
  --shadow-card: 0 1px 3px rgba(59, 54, 50, 0.04), 0 4px 12px rgba(59, 54, 50, 0.03);

  /* Typography */
  --font-heading: 'DM Serif Display', Georgia, serif;
  --font-body: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
  font-family: var(--font-body);
  background: var(--cream);
  color: var(--ink);
  line-height: 1.6;
}

/* Paper grain texture overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-size: 256px 256px;
}

/* Subtle warm vignette */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  background: radial-gradient(
    ellipse at center,
    transparent 50%,
    rgba(200, 180, 160, 0.06) 100%
  );
}

/* Focus */
*:focus-visible {
  outline: 2px solid var(--sage);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ─── Navigation ─── */
nav {
  background: var(--warm-white);
  border-bottom: 1px solid var(--pebble);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  position: relative;
  z-index: 10;
}
nav .brand {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  color: var(--golden);
  text-decoration: none;
  letter-spacing: 0.01em;
  margin-right: auto;
}
nav a {
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--stone);
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 2px solid transparent;
  transition: color 0.2s ease-out, border-color 0.2s ease-out;
}
nav a:hover { color: var(--ink); }
nav a.active {
  color: var(--sage);
  border-bottom-color: var(--sage);
  font-weight: 500;
}

/* ─── Layout ─── */
.container { max-width: 1080px; margin: 0 auto; padding: 24px; }
h1 {
  font-family: var(--font-heading);
  font-size: 1.875rem;
  color: var(--ink);
  line-height: 1.2;
  margin-bottom: 1rem;
}

/* ─── Page header with decorative rule ─── */
.page-header {
  padding: 48px 0 24px;
}
.page-header h1 {
  margin-bottom: 8px;
}
.page-header::after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, var(--sage), var(--blossom));
  border-radius: 2px;
  margin-top: 16px;
  opacity: 0.6;
}

/* ─── Hero illustration ─── */
.hero-illustration {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 32px 24px 0;
}
.hero-illustration svg {
  width: 100%;
  height: auto;
  display: block;
}

/* ─── Page intro text ─── */
.page-intro {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 1.125rem;
  color: var(--stone);
  line-height: 1.6;
  margin-bottom: 32px;
  max-width: 75ch;
}

/* ─── Stat cards ─── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}
.stat-card {
  background: var(--warm-white);
  border: 1px solid var(--pebble);
  border-top: 3px solid var(--sage);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-card);
  transition: transform 0.2s ease-out, box-shadow 0.2s ease-out;
}
.stat-card:nth-child(2) { border-top-color: var(--sky); }
.stat-card:nth-child(3) { border-top-color: var(--golden); }
.stat-card:nth-child(4) { border-top-color: var(--blossom); }
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(59, 54, 50, 0.06);
}
.stat-card .label {
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--stone);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}
.stat-card .value {
  font-family: var(--font-heading);
  font-size: 2rem;
  color: var(--ink);
  line-height: 1.1;
}
.stat-card .subtitle {
  font-size: 0.8125rem;
  color: var(--stone);
  margin-top: 4px;
}

/* ─── Chart cards ─── */
.charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}
.chart-card {
  background: var(--warm-white);
  border: 1px solid var(--pebble);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-card);
}
.chart-card h2 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  color: var(--ink);
  margin-bottom: 16px;
}

/* ─── Tables ─── */
.table-card {
  background: var(--warm-white);
  border: 1px solid var(--pebble);
  border-radius: var(--radius);
  padding: 24px;
  overflow-x: auto;
  box-shadow: var(--shadow-card);
}
.table-card h2 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  color: var(--ink);
  margin-bottom: 16px;
}
table { width: 100%; border-collapse: collapse; }
th {
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--stone);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-align: left;
  padding: 10px 12px;
  border-bottom: 2px solid var(--pebble);
}
td {
  font-size: 0.9rem;
  color: var(--ink);
  padding: 10px 12px;
  border-bottom: 1px solid rgba(196, 186, 176, 0.4);
}
tbody tr:nth-child(even) {
  background: rgba(250, 246, 240, 0.5);
}
tbody tr:hover {
  background: var(--sage-light);
}

/* Clickable skill rows */
tr[data-skill] {
  cursor: pointer;
  transition: background 0.15s ease;
}
tr[data-skill].selected {
  background: var(--sage-light);
  font-weight: 500;
}

/* ─── Skill detail panel ─── */
.skill-detail {
  background: var(--warm-white);
  border: 1px solid var(--pebble);
  border-radius: var(--radius);
  padding: 24px;
  margin-top: 24px;
  box-shadow: var(--shadow-card);
}
.skill-detail h2 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  color: var(--ink);
  margin-bottom: 16px;
}

/* ─── Badges ─── */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  white-space: nowrap;
  background: var(--sage-light);
  color: var(--sage);
}

/* ─── Delta badges ─── */
.delta {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  margin-left: 8px;
}
.delta.positive { color: #5A7E60; background: var(--positive-bg); }
.delta.negative { color: var(--negative); background: var(--negative-bg); }
.delta.neutral { color: var(--stone); background: #F0ECE6; }

/* ─── Role tabs ─── */
.role-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.role-tab {
  font-family: var(--font-body);
  padding: 8px 16px;
  border: 1px solid var(--pebble);
  border-radius: var(--radius-pill);
  background: var(--warm-white);
  color: var(--stone);
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 400;
  transition: all 0.2s ease-out;
}
.role-tab:hover {
  color: var(--sage);
  border-color: var(--sage);
  background: var(--sage-light);
}
.role-tab.active {
  background: var(--sage);
  color: var(--warm-white);
  border-color: var(--sage);
  font-weight: 500;
}
.role-tab .tab-count {
  font-size: 0.75rem;
  opacity: 0.7;
  margin-left: 4px;
}

/* ─── Trend columns ─── */
.trend-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 32px;
}

/* ─── Analyst take ─── */
.analyst-take {
  background: var(--warm-white);
  border: 1px solid var(--pebble);
  border-left: 3px solid var(--sage);
  border-radius: 4px 12px 12px 4px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-card);
}
.analyst-take .take-meta {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--sage);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 12px;
}
.analyst-take p {
  margin-bottom: 12px;
  line-height: 1.7;
  color: var(--ink);
}

/* ─── Empty state ─── */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--stone);
  font-size: 0.95rem;
  font-style: italic;
}

/* ─── Placeholder page ─── */
.placeholder {
  text-align: center;
  padding: 4rem 1rem;
}
.placeholder h2 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--ink);
}
.placeholder p { color: var(--stone); }

/* ─── Footer ─── */
footer {
  text-align: center;
  padding: 32px 24px;
  color: var(--stone);
  font-size: 0.8125rem;
  margin-top: 48px;
  position: relative;
}
footer::before {
  content: '';
  display: block;
  width: 80px;
  height: 2px;
  background: linear-gradient(90deg, var(--sage), var(--blossom));
  border-radius: 1px;
  margin: 0 auto 24px;
  opacity: 0.5;
}
.footer-links {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 12px;
}
.footer-links a {
  color: var(--stone);
  text-decoration: none;
  font-size: 0.8125rem;
  font-weight: 400;
  transition: color 0.2s ease-out;
}
.footer-links a:hover { color: var(--sage); }
.footer-tagline {
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 0.875rem;
  color: var(--stone);
  margin-bottom: 8px;
}

/* ─── Prose content (legal pages) ─── */
.prose {
  max-width: 68ch;
  line-height: 1.8;
  font-size: 0.95rem;
  color: var(--ink);
}
.prose h2 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  color: var(--ink);
  margin-top: 40px;
  margin-bottom: 12px;
}
.prose p { margin-bottom: 16px; }
.prose ul {
  margin-bottom: 16px;
  padding-left: 24px;
}
.prose li { margin-bottom: 6px; }
.prose li::marker { color: var(--sage); }
.prose a {
  color: var(--sage);
  text-decoration: none;
  border-bottom: 1px solid rgba(124, 154, 130, 0.3);
  transition: border-color 0.2s ease-out;
}
.prose a:hover { border-bottom-color: var(--sage); }
.prose strong { font-weight: 600; color: var(--ink); }

/* ─── Entrance animations ─── */
@media (prefers-reduced-motion: no-preference) {
  .stat-card, .chart-card, .table-card {
    opacity: 0;
    transform: translateY(8px);
    animation: gentle-rise 0.5s ease-out forwards;
  }
  .stat-card:nth-child(1) { animation-delay: 0.05s; }
  .stat-card:nth-child(2) { animation-delay: 0.1s; }
  .stat-card:nth-child(3) { animation-delay: 0.15s; }
  .stat-card:nth-child(4) { animation-delay: 0.2s; }
  .chart-card { animation-delay: 0.25s; }
  .table-card { animation-delay: 0.3s; }
}
@keyframes gentle-rise {
  to { opacity: 1; transform: translateY(0); }
}

/* ─── Responsive ─── */
@media (max-width: 860px) {
  .charts-grid { grid-template-columns: 1fr; }
  .trend-columns { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .container { padding: 16px; }
  nav {
    gap: 16px;
    padding: 12px 16px;
    overflow-x: auto;
    flex-wrap: nowrap;
  }
  nav .brand { flex-shrink: 0; margin-right: 16px; }
  nav a { flex-shrink: 0; white-space: nowrap; }
  .stat-card .value { font-size: 1.75rem; }
}
@media (max-width: 480px) {
  .hero-illustration { display: none; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}
