/* ============================================================
   AKB.TED — portfolio & blog
   Light + dark theme via CSS variables on [data-theme]
   ============================================================ */

:root {
  --accent: #1a1a1a;
  --accent-soft: #f0f0f2;
  --bg: #ffffff;
  --bg-alt: #f6f7f9;
  --surface: #ffffff;
  --text: #17181c;
  --text-soft: #555a66;
  --text-faint: #8a90a0;
  --border: #e6e8ee;
  --shadow: 0 10px 30px rgba(23, 24, 28, 0.06);
  --radius: 14px;
  --max-width: 1200px;
}

html[data-theme="dark"] {
  --accent: #e8eaef;
  --accent-soft: #1d2230;
  --bg: #0b0d13;
  --bg-alt: #10131b;
  --surface: #141824;
  --text: #e6e8f0;
  --text-soft: #a0a6b5;
  --text-faint: #6b7282;
  --border: #232a3a;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  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%; height: auto; }

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

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

.text-center { text-align: center; }

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 16px;
}

.brand {
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: 0.5px;
  color: var(--text);
}
.brand:hover { text-decoration: none; }
.brand-dot { color: var(--accent); }

.site-nav {
  display: flex;
  gap: 28px;
  margin-left: auto;
}

.site-nav a {
  color: var(--text-soft);
  font-size: 0.95rem;
  font-weight: 500;
  padding: 6px 0;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover { color: var(--text); text-decoration: none; }
.site-nav a.active { color: var(--text); border-bottom-color: var(--accent); }

.nav-actions { display: flex; align-items: center; gap: 8px; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text-soft);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}
.icon-btn:hover { color: var(--text); border-color: var(--accent); }
.icon-btn svg { width: 18px; height: 18px; }

.nav-toggle { display: none; }

.icon-moon { display: none; }
html[data-theme="dark"] .icon-sun { display: none; }
html[data-theme="dark"] .icon-moon { display: block; }

/* ---------- Hero ---------- */
.hero {
  padding: 72px 0 48px;
  background:
    radial-gradient(600px 280px at 85% -10%, var(--accent-soft), transparent 70%);
}

.hero-inner {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 48px;
  align-items: center;
}

.hero-photo img {
  width: 220px;
  height: 220px;
  object-fit: cover;
  border-radius: 50%;
  border: 4px solid var(--surface);
  box-shadow: var(--shadow);
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
  margin: 0 0 12px;
}

.hero-name {
  margin: 0 0 16px;
  font-size: 2.6rem;
  line-height: 1.1;
  letter-spacing: -0.5px;
}

.hero-tagline {
  margin: 0 0 24px;
  color: var(--text-soft);
  font-size: 1.08rem;
}

.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }

.hero-links {
  display: flex;
  gap: 24px;
  list-style: none;
  padding: 0;
  margin: 28px 0 0;
  font-size: 0.95rem;
  font-weight: 500;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 12px 22px;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }

.btn-primary {
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 35%, transparent);
}
html[data-theme="dark"] .btn-primary { color: #0b0d13; }
.btn-primary:hover { box-shadow: 0 8px 22px color-mix(in srgb, var(--accent) 45%, transparent); }

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- Sections ---------- */
.section { padding: 56px 0; }
.section + .section { border-top: 1px solid var(--border); }

.section-title {
  font-size: 1.5rem;
  letter-spacing: -0.3px;
  margin: 0 0 24px;
}

.section-title::after {
  content: "";
  display: block;
  width: 42px;
  height: 3px;
  border-radius: 2px;
  background: var(--accent);
  margin-top: 10px;
}

/* ---------- Prose ---------- */
.prose { color: var(--text-soft); }
.prose strong { color: var(--text); }

/* ---------- Chips ---------- */
.chip {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 600;
}
html[data-theme="dark"] .chip { color: #e8eaef; }

.chip-sm { padding: 3px 10px; font-size: 0.75rem; font-weight: 500; }

/* ---------- Timeline ---------- */
.timeline { display: flex; flex-direction: column; gap: 8px; }

.timeline-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 26px;
  box-shadow: var(--shadow);
}

.timeline-item-bg { background: var(--accent-soft); border-color: transparent; }

.timeline-head h3 { margin: 0 0 2px; font-size: 1.12rem; }
.timeline-org { margin: 0; color: var(--accent); font-weight: 600; font-size: 0.92rem; }
.timeline-date { margin: 6px 0 0; font-size: 0.82rem; color: var(--text-faint); }

.timeline-body { margin: 12px 0 0; padding-left: 18px; color: var(--text-soft); }
.timeline-body li { margin-bottom: 6px; }
.timeline-body strong { color: var(--text); }

/* ---------- Publications ---------- */
.publication-list {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 12px;
}
.publication-list li {
  padding: 18px 22px;
  border-left: 3px solid var(--accent);
  background: var(--surface);
  border-radius: 0 var(--radius) var(--radius) 0;
  border: 1px solid var(--border);
  border-left-width: 3px;
  font-weight: 500;
}

.pub-link {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-faint);
  border-bottom: 1px solid var(--border);
  margin-left: 10px;
  white-space: nowrap;
}
.pub-link:hover { color: var(--accent); border-bottom-color: var(--accent); }

/* ---------- CTA ---------- */
.section-cta { padding-bottom: 48px; }

.cta-line { text-align: center; }
.cta-line h2 { margin: 0 0 4px; font-size: 1.05rem; letter-spacing: -0.2px; }
.cta-line p { margin: 0 0 12px; color: var(--text-soft); font-size: 0.82rem; }

/* ---------- Blog list ---------- */
.page-title { font-size: 2.2rem; letter-spacing: -0.5px; margin: 8px 0 12px; }
.page-lede { color: var(--text-soft); margin: 0 0 36px; max-width: 620px; }

.post-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.post-list-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 0;
  border-bottom: 1px solid var(--border);
}
.post-list-item:first-child { border-top: 1px solid var(--border); }

.post-list-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
}
.post-list-title:hover { color: var(--accent); text-decoration: none; }

.post-list-date {
  flex-shrink: 0;
  color: var(--text-faint);
  font-size: 0.85rem;
}

.empty-state { color: var(--text-faint); }

/* ---------- Post page ---------- */
.post { max-width: var(--max-width); padding: 48px 24px 64px; }

.post-title { font-size: 2.1rem; line-height: 1.25; letter-spacing: -0.5px; margin: 8px 0 12px; }

.post-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--text-faint);
  font-size: 0.85rem;
  margin-bottom: 32px;
}

.post-body { border-top: 1px solid var(--border); padding-top: 28px; }

.post-body h2 { margin-top: 40px; font-size: 1.4rem; letter-spacing: -0.3px; }
.post-body h3 { margin-top: 32px; font-size: 1.15rem; }
.post-body p { color: var(--text-soft); }
.post-body ul, .post-body ol { color: var(--text-soft); }
.post-body blockquote {
  margin: 24px 0;
  padding: 16px 22px;
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  border-radius: 0 10px 10px 0;
}
.post-body blockquote p { margin: 0; color: var(--text); }
.post-body code {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px 6px;
  font-size: 0.9em;
}
.post-body table { border-collapse: collapse; width: 100%; margin: 24px 0; font-size: 0.92rem; }
.post-body th, .post-body td { border: 1px solid var(--border); padding: 10px 14px; text-align: left; }
.post-body th { background: var(--bg-alt); }

.post-nav {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 48px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
  font-weight: 500;
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-alt);
  padding: 40px 0;
  text-align: center;
}

.footer-tag { margin: 0 0 16px; color: var(--text-soft); }

.footer-links {
  display: flex;
  justify-content: center;
  gap: 28px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  font-weight: 500;
  font-size: 0.95rem;
}

.footer-copy { margin: 0; color: var(--text-faint); font-size: 0.82rem; }

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.5s ease, transform 0.5s ease; }
.reveal.in-view { opacity: 1; transform: translateY(0); }

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  body { font-size: 16px; }

  .hero { padding-top: 48px; }
  .hero-inner { grid-template-columns: 1fr; text-align: center; gap: 28px; }
  .hero-photo img { width: 170px; height: 170px; }
  .hero-cta { justify-content: center; }
  .hero-links { justify-content: center; }
  .hero-name { font-size: 2.1rem; }

  .section { padding: 40px 0; }

  .site-nav {
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 8px 24px 16px;
    display: none;
  }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 12px 0; border-bottom: 1px solid var(--border); }
  .site-nav a.active { border-bottom-color: var(--border); }

  .nav-toggle { display: inline-flex; }

  .post-list-item { flex-direction: column; gap: 4px; padding: 18px 0; }

  .post-title { font-size: 1.7rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; transition: none; }
}
