@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400&family=Inter:wght@300;400;500;600&display=swap');

:root {
  --blue:       #1A56DB;
  --blue-dark:  #1141B0;
  --blue-deep:  #080F1D;
  --green:      #B9E8C9;
  --green-mid:  #6BC98A;
  --green-dark: #2D7A4F;
  --text:       #0F172A;
  --text-2:     #334155;
  --text-3:     #64748B;
  --bg:         #FFFFFF;
  --bg-2:       #F8FAFC;
  --border:     #E2E8F0;
  --max-w:      1200px;
}

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

html { font-size: 16px; -webkit-font-smoothing: antialiased; scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

/* ── NAV ── */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

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

.nav-logo {
  font-family: 'Playfair Display', serif;
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--blue);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.nav-logo span {
  color: var(--green-dark);
}

.nav-links {
  display: flex;
  gap: 2.5rem;
  list-style: none;
}

.nav-links a {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
  text-decoration: none;
  transition: color 0.2s;
}

.nav-links a:hover { color: var(--blue); }

/* ── HERO ── */
.hero {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 5rem 2rem 4rem;
  border-bottom: 1px solid var(--border);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: end;
}

.hero-left {}

.hero-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--green-dark);
  margin-bottom: 1.25rem;
}

.hero-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2.25rem, 4vw, 3.5rem);
  font-weight: 700;
  line-height: 1.1;
  color: var(--text);
  letter-spacing: -0.025em;
}

.hero-title em {
  font-style: italic;
  color: var(--blue);
}

.hero-right {
  padding-bottom: 0.5rem;
}

.hero-desc {
  font-size: 1.0625rem;
  color: var(--text-3);
  line-height: 1.75;
  max-width: 440px;
}

.hero-meta {
  margin-top: 2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.hero-count {
  font-size: 2rem;
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  color: var(--blue);
  line-height: 1;
}

.hero-count-label {
  font-size: 0.8125rem;
  color: var(--text-3);
  line-height: 1.4;
}

/* ── GRID ── */
.articles-section {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 2rem 6rem;
}

.section-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 2.5rem 0 0;
  margin-bottom: 0;
  border-bottom: 2px solid var(--text);
  padding-bottom: 0.875rem;
}

.section-bar-title {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text);
}

.articles-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-left: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

/* ── CARD ── */
.card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  border-right: 1px solid var(--border);
  border-top: 1px solid var(--border);
  transition: background 0.18s;
  cursor: pointer;
}

.card:hover { background: var(--bg-2); }

.card-illustration {
  width: 100%;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  display: block;
  flex-shrink: 0;
}

.card-illustration svg {
  width: 100%;
  height: 100%;
  display: block;
  transition: transform 0.4s ease;
}

.card:hover .card-illustration svg {
  transform: scale(1.02);
}

.card-body {
  padding: 1.75rem 1.75rem 2rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-meta-top {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.875rem;
}

.card-tag {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--blue);
}

.card-meta-date {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
}

.card-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.3125rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text);
  letter-spacing: -0.01em;
  margin-bottom: 0.875rem;
  transition: color 0.2s;
}

.card:hover .card-title { color: var(--blue); }

.card-excerpt {
  font-size: 0.9375rem;
  color: var(--text-3);
  line-height: 1.7;
  flex: 1;
  margin-bottom: 1.5rem;
}

.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border);
  padding-top: 1rem;
  margin-top: auto;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-3);
  letter-spacing: 0.04em;
}

.card-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--green-mid);
  flex-shrink: 0;
}

/* ── PLACEHOLDER PAGE ── */
.page-empty {
  max-width: 640px;
  margin: 9rem auto;
  padding: 0 2rem;
  text-align: center;
}

.page-empty-label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 1.25rem;
}

.page-empty-title {
  font-family: 'Playfair Display', serif;
  font-size: 2.75rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
  margin-bottom: 1.5rem;
}

.page-empty-desc {
  font-size: 1.0625rem;
  color: var(--text-3);
  line-height: 1.75;
  margin-bottom: 2.5rem;
}

.page-empty-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
  border: 1px solid var(--border);
  padding: 0.4rem 1.1rem;
  border-radius: 2rem;
}

/* ── FOOTER ── */
footer {
  border-top: 1px solid var(--border);
  padding: 2.5rem 2rem;
}

.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-logo {
  font-family: 'Playfair Display', serif;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-3);
}

.footer-copy {
  font-size: 0.8rem;
  color: var(--text-3);
}

/* ── ARTICLE PAGE ── */
.article-hero {
  width: 100%;
  height: clamp(280px, 40vw, 460px);
  overflow: hidden;
}

.article-hero svg {
  width: 100%;
  height: 100%;
  display: block;
}

.article-wrapper {
  max-width: 720px;
  margin: 0 auto;
  padding: 3.5rem 2rem 6rem;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-3);
  text-decoration: none;
  margin-bottom: 2.5rem;
  transition: color 0.2s;
}

.back-link:hover { color: var(--blue); }

.back-link svg { flex-shrink: 0; }

.github-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: var(--text-3);
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.375rem 0.875rem;
  margin-top: 1.25rem;
  margin-bottom: 1.75rem;
  transition: border-color 0.2s, color 0.2s;
}

.github-link:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.github-link svg { flex-shrink: 0; }

.ui-preview {
  margin: 2.75rem 0;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(26, 86, 219, 0.18);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

.ui-preview svg {
  display: block;
  width: 100%;
  height: auto;
}

.ui-preview-label {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 0.5rem;
}

.download-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--blue);
  background: rgba(26, 86, 219, 0.06);
  border: 1px solid rgba(26, 86, 219, 0.3);
  border-radius: 6px;
  padding: 0.5rem 1rem;
  margin-top: 2rem;
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s;
}

.download-link:hover {
  background: rgba(26, 86, 219, 0.12);
  border-color: var(--blue);
}

.article-tag {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 1rem;
}

.article-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.875rem, 4vw, 2.75rem);
  font-weight: 700;
  line-height: 1.15;
  color: var(--text);
  letter-spacing: -0.025em;
  margin-bottom: 1.5rem;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.875rem;
  color: var(--text-3);
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2.5rem;
}

.article-body {
  font-size: 1.0625rem;
  line-height: 1.82;
  color: var(--text-2);
}

.article-body p { margin-bottom: 1.625rem; }

.article-body h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.625rem;
  font-weight: 600;
  color: var(--text);
  margin: 3rem 0 1rem;
  letter-spacing: -0.015em;
}

.article-body h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text);
  margin: 2.25rem 0 0.75rem;
}

.article-body pre {
  background: var(--blue-deep);
  border-radius: 3px;
  padding: 1.5rem 1.75rem;
  overflow-x: auto;
  margin: 2rem 0;
  border-left: 3px solid var(--blue);
}

.article-body pre code {
  font-family: 'IBM Plex Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 0.875rem;
  color: var(--green);
  line-height: 1.7;
  background: none;
  padding: 0;
}

.article-body p code {
  font-family: 'IBM Plex Mono', 'Fira Code', monospace;
  font-size: 0.875em;
  background: var(--bg-2);
  border: 1px solid var(--border);
  padding: 0.1em 0.4em;
  border-radius: 3px;
  color: var(--blue-dark);
}

.article-body blockquote {
  border-left: 3px solid var(--blue);
  padding: 0.25rem 0 0.25rem 1.5rem;
  margin: 2rem 0;
  font-style: italic;
  color: var(--text-3);
  font-family: 'Playfair Display', serif;
  font-size: 1.125rem;
  line-height: 1.7;
}

.article-body a {
  color: var(--blue);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.article-body ul,
.article-body ol {
  margin: 0.5rem 0 1.625rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.article-body li {
  font-size: 1.0625rem;
  line-height: 1.75;
  color: var(--text-2);
  padding-left: 0.25rem;
}

/* ── ABOUT PAGE ── */
.about-wrapper {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 5rem 2rem 6rem;
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 5rem;
  align-items: start;
}

.about-photo-wrap {
  position: sticky;
  top: 5rem;
}

.about-photo {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
  display: block;
  filter: grayscale(15%);
}

.about-photo-placeholder {
  width: 100%;
  aspect-ratio: 3/4;
  background: var(--bg-2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
  font-size: 0.875rem;
}

.about-content {}

.about-name {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2rem, 3.5vw, 3rem);
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.025em;
  line-height: 1.1;
  margin-bottom: 0.5rem;
}

.about-role {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--blue);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 2.5rem;
}

.about-body {
  font-size: 1.0625rem;
  line-height: 1.82;
  color: var(--text-2);
}

.about-body p { margin-bottom: 1.5rem; }

.about-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.5rem 0;
}

.about-signature {
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.about-sig-name,
.about-sig-titles,
.about-sig-link {
  font-family: 'Inter', sans-serif;
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.5;
}

.about-sig-name {
  font-weight: 500;
  color: var(--text);
}

.about-sig-titles {
  color: var(--text-muted);
}

.about-sig-link {
  color: var(--blue);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
  width: fit-content;
}

.about-sig-link:hover {
  border-bottom-color: var(--blue);
}

.about-topics-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 1rem;
}

.about-topics {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.about-topic {
  font-size: 0.8125rem;
  color: var(--text-2);
  border: 1px solid var(--border);
  padding: 0.375rem 0.875rem;
  border-radius: 2px;
  background: var(--bg-2);
}

/* ── REAL IMAGES ── */
.card-illustration img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.card:hover .card-illustration img { transform: scale(1.03); }

.article-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ── FEATURED CARD ── */
.card-featured {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  align-items: stretch;
}

.card-featured .card-illustration {
  aspect-ratio: unset;
  min-height: 420px;
}

.card-featured .card-body {
  padding: 2.5rem 3rem;
  justify-content: center;
}

.card-featured .card-title { font-size: 2rem; margin-bottom: 1.25rem; }
.card-featured .card-excerpt { font-size: 1.0625rem; margin-bottom: 2rem; }

/* ── TABLES ── */
.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  font-size: 0.9rem;
  line-height: 1.5;
}
.article-body th {
  background: var(--bg-2);
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 2px solid var(--border);
  font-weight: 600;
  color: var(--text);
  font-family: 'Inter', sans-serif;
}
.article-body td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-2);
  vertical-align: top;
}
.article-body tr:last-child td { border-bottom: none; }
@media (max-width: 700px) {
  .article-body table { font-size: 0.82rem; }
  .article-body th, .article-body td { padding: 0.6rem 0.6rem; }
}

/* ── HAMBURGER ── */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 4px;
  flex-shrink: 0;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-3);
  border-radius: 2px;
  transition: transform 0.25s, opacity 0.25s;
}

.nav-toggle.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.is-open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-toggle.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── RESPONSIVE ── */
@media (max-width: 1000px) {
  .hero { grid-template-columns: 1fr; gap: 1.5rem; }
  .hero-right { padding-bottom: 0; }
  .hero-desc { max-width: 100%; }
  .about-wrapper { grid-template-columns: 260px 1fr; gap: 3rem; }
}

@media (max-width: 800px) {
  .articles-grid { grid-template-columns: repeat(2, 1fr); }
  .card-featured { grid-template-columns: 1fr; display: flex; flex-direction: column; }
  .card-featured .card-illustration { min-height: 260px; aspect-ratio: 16/9; }
  .card-featured .card-body { padding: 1.75rem; }
  .card-featured .card-title { font-size: 1.5rem; }
  .about-wrapper { grid-template-columns: 1fr; }
  .about-photo-wrap { position: static; max-width: 280px; }
}

@media (max-width: 700px) {
  .nav-toggle { display: flex; }
  .nav-links {
    display: none;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    background: rgba(255,255,255,0.97);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 1rem 1.5rem 1.5rem;
    gap: 0;
  }
  .nav-links.is-open { display: flex; }
  .nav-links li { border-bottom: 1px solid var(--border); }
  .nav-links li:last-child { border-bottom: none; }
  .nav-links a {
    display: block;
    padding: 0.875rem 0;
    font-size: 0.8rem;
    letter-spacing: 0.08em;
  }
}

@media (max-width: 540px) {
  .articles-grid { grid-template-columns: 1fr; }
  .nav-inner { padding: 0 1.25rem; }
  .hero { padding: 3rem 1.25rem 2.5rem; }
  .articles-section { padding-left: 1.25rem; padding-right: 1.25rem; }
  .article-wrapper { padding: 2.5rem 1.25rem 4rem; }
  .footer-inner { flex-direction: column; gap: 0.5rem; text-align: center; }
  .article-body pre { padding: 1.25rem; font-size: 0.8125rem; }
  .article-body pre code { font-size: 0.8125rem; }
  .card-body { padding: 1.25rem 1.25rem 1.5rem; }
  .card-featured .card-body { padding: 1.25rem; }
  .card-featured .card-title { font-size: 1.3125rem; }
  .article-body ul,
  .article-body ol { margin-left: 1rem; }
}
