@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,600;9..144,700&family=Manrope:wght@300;400;600;700&display=swap');

:root {
  --ink: #0f1b1f;
  --muted: #52636b;
  --accent: #5fc7d4;
  --accent-deep: #274b55;
  --accent-dark: #1c3941;
  --line: #e4eaed;
  --paper: #fbfcfd;
  --shadow: 0 20px 60px rgba(15, 27, 31, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Manrope', system-ui, sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at top left, #eef7f8 0%, #f7fbfc 45%, #ffffff 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

header.site {
  padding: 28px 6vw 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(12px);
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.brand h1 {
  margin: 0;
  font-size: 1.3rem;
  letter-spacing: -0.02em;
}

.brand span {
  color: var(--muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
}

header.site nav {
  font-size: 0.95rem;
  color: var(--muted);
}

.hero {
  padding: 48px 6vw 32px;
}

.hero h2 {
  font-family: 'Fraunces', serif;
  font-size: clamp(2.2rem, 3.5vw, 3rem);
  margin-bottom: 12px;
}

.hero p {
  color: var(--muted);
  max-width: 720px;
  margin: 0;
  line-height: 1.6;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  padding: 0 6vw 64px;
}

.project-card {
  padding: 24px;
  background: var(--paper);
  border-radius: 18px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 26px 60px rgba(15, 27, 31, 0.16);
}

.project-card h3 {
  margin: 0;
  font-size: 1.2rem;
}

.project-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(95, 199, 212, 0.15);
  color: var(--accent-dark);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.topic-header {
  padding: 42px 6vw 22px;
}

.topic-banner {
  border-radius: 18px;
  padding: 26px 32px;
  color: white;
  background: linear-gradient(120deg, #72d5e0, #2b5964 70%, #1f3d45);
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--shadow);
}

.topic-banner h2 {
  margin: 0;
  font-family: 'Fraunces', serif;
  font-size: clamp(2rem, 3vw, 2.6rem);
}

.topic-meta {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
  color: var(--muted);
  font-size: 0.95rem;
}

.topic-meta .date {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--ink);
}

.topic-layout {
  padding: 20px 6vw 64px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 28px;
}

.tablist {
  display: flex;
  gap: 22px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.tablist button {
  background: none;
  border: none;
  font: inherit;
  color: var(--muted);
  cursor: pointer;
  padding: 8px 0;
  position: relative;
}

.tablist button.active {
  color: var(--ink);
  font-weight: 700;
}

.tablist button.active::after {
  content: '';
  position: absolute;
  bottom: -11px;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: 999px;
  background: var(--ink);
}

.tab-panel {
  padding: 18px 0 0;
  min-height: 260px;
}

.tab-panel .loading,
.sidebar .loading {
  color: var(--muted);
  font-style: italic;
}

.sidebar {
  border-left: 1px solid var(--line);
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.sidebar h4 {
  margin: 0;
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
}

.sidebar .sidebar-link {
  color: #1f6aa5;
  font-size: 0.9rem;
}

footer {
  padding: 28px 6vw 50px;
  color: var(--muted);
  font-size: 0.85rem;
}

@media (max-width: 980px) {
  .topic-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-left: none;
    border-top: 1px solid var(--line);
    padding-left: 0;
    padding-top: 18px;
  }
}

@media (max-width: 600px) {
  header.site {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .tablist {
    flex-wrap: wrap;
  }
}
