/* Theme tokens */
:root {
  --bg: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --link: #2563eb;
  --border: #e5e7eb;
  --accent: #3b82f6;
  --surface: #ffffff;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 1px 3px rgba(16, 24, 40, 0.1);
  --radius: 12px;
  --container: 820px;
}

[data-theme="dark"] {
  --bg: #0b1220;
  --text: #e5e7eb;
  --muted: #9aa4b2;
  --link: #60a5fa;
  --border: #1f2a37;
  --accent: #93c5fd;
  --surface: #0f172a;
  --shadow: 0 0 0 1px rgba(148, 163, 184, 0.08), 0 8px 24px rgba(2, 6, 23, 0.6);
}

html, body {
  padding: 0;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  line-height: 1.6;
}

.container {
  max-width: var(--container);
  padding: 24px 16px 64px;
  margin: 0 auto;
}

/* Nav */
.site-nav { border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; backdrop-filter: saturate(160%) blur(6px); background: linear-gradient( to bottom, color-mix(in srgb, var(--bg) 86%, transparent), color-mix(in srgb, var(--bg) 98%, transparent) ); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; }
.nav-left, .nav-right { display: flex; align-items: center; gap: 16px; }
.site-nav a { color: var(--text); text-decoration: none; font-weight: 600; opacity: 0.92; }
.site-nav a:hover { color: var(--accent); }
.theme-toggle { appearance: none; border: 1px solid var(--border); background: var(--surface); color: var(--text); padding: 6px 10px; border-radius: 999px; cursor: pointer; box-shadow: var(--shadow); }
.theme-toggle:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }

/* Typography */
h1, h2, h3 {
  line-height: 1.25;
  margin: 1.5rem 0 0.75rem;
}

h1 { font-size: clamp(1.8rem, 2.5vw + 1.2rem, 2.4rem); }
h2 { font-size: clamp(1.25rem, 1.2vw + 1rem, 1.5rem); }
h3 { font-size: 1.1rem; }

p { margin: 0.75rem 0; }

em { color: var(--muted); }

a { color: var(--link); }
a:hover { text-decoration: underline; }

hr { border: none; border-top: 1px solid var(--border); margin: 1.5rem 0; }

/* Lists */
ul { padding-left: 1.2rem; }
li { margin: 0.4rem 0; }

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.5rem 0 1rem;
}

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

thead th {
  font-size: 0.95rem;
}

/* Hero */
.hero { padding: 28px 0 6px; margin-bottom: 10px; }
.hero h1 { font-size: clamp(2.1rem, 2.5vw + 1.6rem, 2.8rem); margin-bottom: 6px; letter-spacing: -0.02em; }
.hero .tagline { color: var(--muted); margin: 0.25rem 0 0.5rem; }
.contact { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.contact li { display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); box-shadow: var(--shadow); }
.contact a { text-decoration: none; color: inherit; }

/* Sections as cards */
.section { padding: 18px 16px; margin: 16px 0; background: radial-gradient(1200px 30% at 50% -10%, color-mix(in srgb, var(--accent) 8%, transparent), transparent), var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.section > h2 { margin-top: 0; position: relative; }
.section > h2::after { content: ""; display: block; height: 3px; width: 56px; margin-top: 6px; border-radius: 2px; background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 40%, transparent)); }
.role + .role { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--border); }

/* Grid */
.grid { display: grid; gap: 12px; }
.two-col { grid-template-columns: 1fr 1fr; }

/* Ribbon carousel */
.ribbon { position: relative; margin: 10px 0 18px; }
.ribbon-viewport { overflow: hidden; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; border-radius: calc(var(--radius) - 2px); border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow); }
.ribbon-track { display: flex; gap: 0; transform: translateZ(0); }
.ribbon-card { flex: 0 0 auto; min-width: 100%; scroll-snap-align: start; padding: 20px 18px; min-height: 140px; display: flex; flex-direction: column; justify-content: center; }
.ribbon-card h3 { margin: 0 0 6px; }
.ribbon-card p { margin: 0; color: var(--muted); }

.ribbon-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); color: var(--text); border: 1px solid var(--border); box-shadow: var(--shadow); cursor: pointer; }
.ribbon-nav.left { left: -6px; }
.ribbon-nav.right { right: -6px; }
.ribbon-nav:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }
.ribbon-nav:disabled { opacity: 0.5; cursor: not-allowed; }

/* Edge fade */
.ribbon::before, .ribbon::after { content: ""; position: absolute; top: 0; bottom: 0; width: 28px; pointer-events: none; }
.ribbon::before { left: 0; background: linear-gradient(90deg, var(--bg), transparent); }
.ribbon::after { right: 0; background: linear-gradient(-90deg, var(--bg), transparent); }

/* Responsive tweaks */
@media (max-width: 720px) {
  .two-col { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  th, td { padding: 8px 10px; }
}
