:root {
  --bg: #f7f8fb;
  --bg-alt: #eef1f7;
  --surface: #ffffff;
  --text: #0f172a;
  --muted: #475569;
  --border: #e2e8f0;
  --accent: #0e7490;
  --accent-2: #4f46e5;
  --accent-soft: rgba(14, 116, 144, 0.1);
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(15, 23, 42, 0.06);
  --radius: 14px;
  --max: 1120px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Fraunces", Georgia, serif;
}

[data-theme="dark"] {
  --bg: #0b1120;
  --bg-alt: #0f172a;
  --surface: #131c31;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --border: #1e293b;
  --accent: #22d3ee;
  --accent-2: #818cf8;
  --accent-soft: rgba(34, 211, 238, 0.12);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  transition: background 0.25s ease, color 0.25s ease;
}

img { max-width: 100%; display: block; }

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

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

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(180%) blur(12px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid var(--border);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.2rem;
  color: var(--text);
}
.brand span { color: var(--accent); }
.brand:hover { text-decoration: none; }

.nav { display: flex; align-items: center; gap: 4px; }
.nav a {
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 8px;
}
.nav a:hover, .nav a.active { color: var(--text); background: var(--accent-soft); text-decoration: none; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  margin-left: 6px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}
.icon-btn svg { width: 18px; height: 18px; }
.icon-sun { display: none; }
[data-theme="dark"] .icon-sun { display: block; }
[data-theme="dark"] .icon-moon { display: none; }

.menu-btn { display: none; }

/* Hero */
.hero { padding: 88px 0 72px; position: relative; overflow: hidden; }
.hero::before {
  content: "";
  position: absolute;
  inset: -40% -10% auto auto;
  width: 640px;
  height: 640px;
  background: radial-gradient(circle, var(--accent-soft), transparent 65%);
  pointer-events: none;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 56px;
  align-items: center;
  position: relative;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 6px 12px;
  border-radius: 999px;
}
.eyebrow .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }

h1, h2, h3 { line-height: 1.2; margin: 0 0 0.5em; }
h1 {
  font-family: var(--font-display);
  font-size: clamp(2.3rem, 4.6vw, 3.6rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-top: 20px;
}
h1 .grad {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.lead { font-size: 1.15rem; color: var(--muted); max-width: 40em; }

.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.97rem;
  border: 1px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: #fff; box-shadow: var(--shadow); }
[data-theme="dark"] .btn-primary { color: #0b1120; }
.btn-ghost { border-color: var(--border); color: var(--text); background: var(--surface); }

.portrait { position: relative; justify-self: center; }
.portrait img {
  width: 100%;
  max-width: 380px;
  height: auto;
  aspect-ratio: 560 / 682;
  object-fit: cover;
  border-radius: 24px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.portrait::after {
  content: "";
  position: absolute;
  inset: 18px -18px -18px 18px;
  border-radius: 24px;
  border: 2px solid var(--accent);
  opacity: 0.35;
  z-index: -1;
}
.portrait-badge {
  position: absolute;
  left: -24px;
  bottom: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 14px;
  box-shadow: var(--shadow);
  font-size: 0.85rem;
  line-height: 1.35;
}
.portrait-badge strong { display: block; font-size: 1rem; }

/* Stats */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 56px;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.stat b {
  display: block;
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--accent);
  line-height: 1.1;
}
.stat span { color: var(--muted); font-size: 0.92rem; }

/* Sections */
section { padding: 80px 0; }
section.alt { background: var(--bg-alt); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-head { max-width: 720px; margin-bottom: 40px; }
.section-head h2 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  font-weight: 600;
  letter-spacing: -0.01em;
}
.section-head p { color: var(--muted); margin: 0; }
.kicker {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}

.grid { display: grid; gap: 20px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }
.card h3 { font-size: 1.12rem; font-weight: 650; }
.card p { color: var(--muted); margin: 0 0 12px; font-size: 0.97rem; }
.card ul { margin: 0; padding-left: 18px; color: var(--muted); font-size: 0.93rem; }
.card li { margin: 4px 0; }

.card-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
  margin-bottom: 16px;
}
.card-icon svg { width: 22px; height: 22px; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.tag {
  font-size: 0.78rem;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  color: var(--muted);
}

/* Engagement steps */
.steps { counter-reset: step; }
.step { position: relative; padding-top: 56px; }
.step::before {
  counter-increment: step;
  content: "0" counter(step);
  position: absolute;
  top: 22px;
  left: 26px;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--accent);
}
.step .dur { font-size: 0.82rem; font-weight: 600; color: var(--accent-2); text-transform: uppercase; letter-spacing: 0.06em; }

/* Timeline */
.timeline { position: relative; margin-left: 8px; }
.timeline::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--border);
}
.tl-item { position: relative; padding: 0 0 36px 32px; }
.tl-item::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 6px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--surface);
  border: 3px solid var(--accent);
}
.tl-item:last-child { padding-bottom: 0; }
.tl-meta { font-size: 0.88rem; color: var(--muted); font-weight: 500; }
.tl-item h3 { font-size: 1.1rem; margin: 2px 0 4px; }
.tl-item .org { color: var(--accent); font-weight: 600; font-size: 0.97rem; }
.tl-item ul { margin: 10px 0 0; padding-left: 18px; color: var(--muted); font-size: 0.95rem; }
.tl-item li { margin: 4px 0; }

/* Lists */
.clean-list { list-style: none; padding: 0; margin: 0; }
.clean-list li { padding: 12px 0; border-bottom: 1px solid var(--border); }
.clean-list li:last-child { border-bottom: 0; }
.clean-list .sub { display: block; color: var(--muted); font-size: 0.9rem; }

.pub { font-size: 0.95rem; }
.pub em { color: var(--muted); }

/* Contact */
.contact-card {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 40px;
  align-items: center;
  background: linear-gradient(135deg, var(--accent-soft), transparent 70%), var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 48px;
}
.contact-links { display: grid; gap: 12px; }
.contact-links a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  font-weight: 500;
}
.contact-links a:hover { border-color: var(--accent); text-decoration: none; }
.contact-links svg { width: 20px; height: 20px; color: var(--accent); flex-shrink: 0; }

/* Blog */
.post-list { display: grid; gap: 20px; }
.post-card { display: grid; grid-template-columns: 220px 1fr; gap: 24px; align-items: center; }
.post-card img { border-radius: 10px; aspect-ratio: 16 / 10; object-fit: cover; width: 100%; }
.post-meta { font-size: 0.85rem; color: var(--muted); }

.article { max-width: 760px; margin: 0 auto; padding: 64px 24px 80px; }
.article h1 { font-size: clamp(2rem, 4vw, 2.8rem); }
.article p { margin: 0 0 1.2em; }
.article figure { margin: 36px 0; }
.article figure img { border-radius: 12px; border: 1px solid var(--border); }
.article figcaption { margin-top: 12px; color: var(--muted); font-size: 0.9rem; text-align: center; }

.hitl {
  display: grid;
  grid-template-columns: 1fr auto 1.15fr 1.35fr 1fr;
  align-items: center;
  gap: 12px;
  padding: 28px 22px;
  background:
    radial-gradient(420px 180px at 50% 0%, var(--accent-soft), transparent 70%),
    var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 16px;
}
.hitl-node {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 12px;
  text-align: center;
  box-shadow: var(--shadow);
}
.hitl-node strong { display: block; font-size: 0.95rem; line-height: 1.3; }
.hitl-node span { display: block; margin-top: 2px; color: var(--muted); font-size: 0.8rem; line-height: 1.35; }
.hitl-node-ai { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.hitl-node-human { border-color: var(--accent-2); }
.hitl-ico {
  width: 34px; height: 34px; margin: 0 auto 8px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: var(--accent-soft); color: var(--accent);
}
.hitl-ico svg { width: 18px; height: 18px; }
.hitl-ico-alt { background: color-mix(in srgb, var(--accent-2) 14%, transparent); color: var(--accent-2); }
.hitl-arrow { color: var(--accent); display: grid; place-items: center; }
.hitl-arrow svg { width: 26px; height: 26px; }
.hitl-branch { display: grid; gap: 14px; }
.hitl-route { display: flex; align-items: center; gap: 8px; }
.hitl-pill {
  font-size: 0.75rem; font-weight: 650; letter-spacing: 0.01em;
  padding: 5px 9px; border-radius: 999px; white-space: nowrap;
  background: var(--accent-soft); color: var(--accent);
}
.hitl-pill-alt { background: color-mix(in srgb, var(--accent-2) 14%, transparent); color: var(--accent-2); }
.hitl-route .hitl-node { flex: 1; padding: 10px; }
.hitl-join { display: none; }

@media (max-width: 720px) {
  .hitl { grid-template-columns: 1fr; justify-items: center; padding: 22px 16px; gap: 10px; }
  .hitl-node { width: min(100%, 280px); }
  .hitl-arrow svg { transform: rotate(90deg); }
  .hitl-branch { width: min(100%, 320px); }
  .hitl-route { flex-direction: column; }
  .hitl-join { display: block; color: var(--muted); font-size: 0.8rem; font-weight: 600; text-align: center; }
}
.article .byline { display: flex; align-items: center; gap: 12px; margin: 16px 0 36px; color: var(--muted); font-size: 0.95rem; }
.article .byline img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; object-position: top; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); padding: 32px 0; color: var(--muted); font-size: 0.9rem; }
.site-footer .container { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.site-footer a { color: var(--muted); margin-left: 16px; }
.site-footer a:hover { color: var(--accent); }

/* Reveal */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* Responsive */
@media (max-width: 960px) {
  .hero-grid, .contact-card { grid-template-columns: 1fr; }
  .portrait { order: -1; max-width: 260px; }
  .portrait-badge { left: auto; right: -12px; }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  body { font-size: 16px; }
  section { padding: 60px 0; }
  .hero { padding: 48px 0; }
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .post-card { grid-template-columns: 1fr; }
  .contact-card { padding: 28px; }
  .menu-btn { display: inline-grid; }
  .nav {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    padding: 12px 24px 20px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
  }
  .nav.open { display: flex; }
  .nav .icon-btn { margin: 8px 0 0; }
  .site-footer a { margin: 0 16px 0 0; }
}
