/* ============================================
   Minimalist personal site — Apple-inspired
   Edit the variables below to tweak the look.
   ============================================ */

:root {
  --text: #1d1d1f;
  --text-secondary: #6e6e73;
  --bg: #ffffff;
  --bg-alt: #f5f5f7;
  --accent: #0066cc;
  --border: #d2d2d7;
  --nav-bg: rgba(255, 255, 255, 0.72);
  --card-bg: #ffffff;
  --radius: 18px;
  --max-width: 980px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --text: #f5f5f7;
    --text-secondary: #86868b;
    --bg: #000000;
    --bg-alt: #161617;
    --accent: #2997ff;
    --border: #333336;
    --nav-bg: rgba(22, 22, 23, 0.72);
    --card-bg: #1d1d1f;
  }
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue",
    Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---------- Navigation ---------- */

nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--nav-bg);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 22px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-name {
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.nav-links {
  display: flex;
  gap: 28px;
  list-style: none;
}

.nav-links a {
  font-size: 13px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
}

/* ---------- Hero ---------- */

.hero {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 130px 22px 100px;
  text-align: center;
}

.hero h1 {
  font-size: clamp(44px, 8vw, 72px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.07;
}

.hero .tagline {
  margin-top: 18px;
  font-size: clamp(19px, 3vw, 26px);
  font-weight: 400;
  color: var(--text-secondary);
  letter-spacing: -0.01em;
}

.hero .actions {
  margin-top: 34px;
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ---------- Buttons & links ---------- */

.btn {
  display: inline-block;
  padding: 10px 22px;
  border-radius: 980px;
  font-size: 15px;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.btn:hover {
  opacity: 0.85;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-secondary {
  color: var(--accent);
  border: 1px solid var(--accent);
}

a.text-link {
  color: var(--accent);
  text-decoration: none;
}

a.text-link:hover {
  text-decoration: underline;
}

/* ---------- Page sections ---------- */

.page-header {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 90px 22px 30px;
  text-align: center;
}

.page-header h1 {
  font-size: clamp(36px, 6vw, 56px);
  font-weight: 700;
  letter-spacing: -0.03em;
}

.page-header p {
  margin-top: 14px;
  font-size: 19px;
  color: var(--text-secondary);
  max-width: 620px;
  margin-left: auto;
  margin-right: auto;
}

section.band {
  padding: 70px 0;
}

section.band.alt {
  background: var(--bg-alt);
}

.section-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 22px;
}

.section-inner h2 {
  font-size: clamp(28px, 4.5vw, 40px);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.section-inner > p.lede {
  font-size: 18px;
  color: var(--text-secondary);
  max-width: 640px;
  margin-bottom: 36px;
}

/* ---------- Cards ---------- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 32px;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.card .eyebrow {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.card h3 {
  margin-top: 8px;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.card p {
  margin-top: 8px;
  font-size: 15px;
  color: var(--text-secondary);
}

.card .card-link {
  display: inline-block;
  margin-top: 14px;
  font-size: 15px;
  color: var(--accent);
  text-decoration: none;
}

.card .card-link:hover {
  text-decoration: underline;
}

/* ---------- Simple lists (publications, notes) ---------- */

.item-list {
  list-style: none;
  margin-top: 24px;
}

.item-list li {
  padding: 22px 0;
  border-bottom: 1px solid var(--border);
}

.item-list li:last-child {
  border-bottom: none;
}

.item-list .item-title {
  font-size: 17px;
  font-weight: 600;
}

.item-list .item-meta {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* ---------- Footer ---------- */

footer {
  border-top: 1px solid var(--border);
  padding: 34px 22px;
  text-align: center;
  font-size: 13px;
  color: var(--text-secondary);
}

footer a {
  color: var(--text-secondary);
}

/* ---------- News page ---------- */

.news-meta {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 28px;
}

.filter-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}

.filter-pill {
  font-size: 13px;
  padding: 6px 16px;
  border-radius: 980px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.filter-pill:hover {
  border-color: var(--accent);
  color: var(--text);
}

.filter-pill.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.news-item .item-title a {
  color: var(--text);
  text-decoration: none;
}

.news-item .item-title a:hover {
  color: var(--accent);
}

.news-item .item-summary {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 6px;
}

.news-item[hidden] {
  display: none;
}

.news-empty,
.news-loading {
  color: var(--text-secondary);
  font-size: 15px;
  padding: 20px 0;
}

/* ---------- AI Skills feed ---------- */

.subscribe-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 32px;
}

.subscribe-box h2 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.subscribe-box p {
  margin-top: 4px;
  font-size: 15px;
  color: var(--text-secondary);
}

.subscribe-box .btn {
  white-space: nowrap;
}

.post-card {
  background: linear-gradient(165deg, var(--card-bg) 0%, var(--bg-alt) 100%);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 20px;
  padding: 30px 34px;
  margin-bottom: 22px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 10px 28px rgba(0, 0, 0, 0.06);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.post-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06), 0 18px 36px rgba(0, 0, 0, 0.1);
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.day-badge {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  border-radius: 980px;
  padding: 4px 12px;
}

.post-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 12px;
}

.post-body p {
  font-size: 16px;
  margin-bottom: 14px;
}

.post-body p:last-child {
  margin-bottom: 0;
}

.post-footer {
  margin-top: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.post-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.post-tags .filter-pill {
  cursor: default;
  pointer-events: none;
}

.copy-btn {
  font-family: inherit;
  cursor: pointer;
  font-size: 14px;
  padding: 8px 18px;
}

.copy-btn:disabled {
  opacity: 0.7;
  cursor: default;
}

/* ---------- Architecture tutorial ---------- */

.flow {
  position: relative;
  margin-top: 32px;
}

.flow::before {
  content: "";
  position: absolute;
  left: 17px;
  top: 6px;
  bottom: 6px;
  width: 1px;
  background: var(--border);
}

.flow-step {
  position: relative;
  display: flex;
  gap: 22px;
  padding-bottom: 36px;
}

.flow-step:last-child {
  padding-bottom: 0;
}

.flow-num {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  position: relative;
  z-index: 1;
}

.flow-tag {
  display: block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 4px;
}

.flow-body h3 {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.flow-body p {
  margin-top: 8px;
  font-size: 15px;
  color: var(--text-secondary);
}

.flow-body p strong {
  color: var(--text);
}

.note-box {
  border-left: 3px solid var(--accent);
  background: var(--bg-alt);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 18px 22px;
  margin-top: 36px;
}

.note-box p {
  font-size: 15px;
  color: var(--text-secondary);
}

.note-box p strong {
  color: var(--text);
}

.note-box .flow-tag {
  margin-bottom: 6px;
}

.diagram-fig {
  margin: 28px 0 8px;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  background: var(--bg);
}

.diagram-fig img {
  display: block;
  min-width: 480px;
  margin: 0 auto;
}

.diagram-fig img.dark {
  display: none;
}

@media (prefers-color-scheme: dark) {
  .diagram-fig img.light {
    display: none;
  }
  .diagram-fig img.dark {
    display: block;
  }
}

/* ---------- Small screens ---------- */

@media (max-width: 600px) {
  .nav-links {
    gap: 16px;
  }
  .hero {
    padding: 90px 22px 70px;
  }
  .subscribe-box {
    flex-direction: column;
    align-items: flex-start;
  }
  .post-card {
    padding: 24px 20px;
  }
  .flow-step {
    gap: 14px;
  }
}
