:root {
  --page-bg: #f6f1ed;
  --card-bg: #ffffff;
  --topbar: #102a35;
  --accent: #e97862;
  --muted: #526873;
  --max-w: 1200px;
  --ink: #20343a;
  --line: #eadfd9;
  --shadow: 0 12px 32px rgba(16, 42, 53, .075);
}

html { scroll-behavior: smooth; }
body {
  color: var(--ink) !important;
  background: radial-gradient(ellipse at 12% 0%, #f4e5dd 0, transparent 34%), #f8f5f2 !important;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif !important;
  line-height: 1.65;
}
header.topbar {
  background: linear-gradient(105deg, #102a35, #174554) !important;
  padding: 12px clamp(16px, 4vw, 48px) !important;
  box-shadow: 0 8px 24px rgba(12, 35, 44, .18) !important;
  border-bottom: 1px solid rgba(255,255,255,.12);
}
.brand { gap: 13px !important; }
.brand .logo, .logo {
  border-radius: 11px !important;
  box-shadow: 0 2px 10px rgba(0,0,0,.16);
}
nav.main-nav { gap: 5px !important; }
nav.main-nav a {
  color: #e3f1f0 !important;
  padding: 8px 11px !important;
  border-radius: 8px !important;
  transition: background .18s ease, color .18s ease;
}
nav.main-nav a:hover, nav.main-nav a:focus-visible {
  background: rgba(255,255,255,.12) !important;
  color: #fff !important;
}
nav.main-nav a.active {
  background: rgba(255,255,255,.12);
  box-shadow: inset 0 -2px 0 #f28a73 !important;
}
main.container { width: min(100% - 36px, var(--max-w)) !important; margin: 36px auto !important; padding: 0 !important; }
h1, h2, .hero h1, .card-content h2 { color: var(--accent) !important; letter-spacing: -.025em; }
h1 { font-size: clamp(1.85rem, 3vw, 2.45rem) !important; line-height: 1.2; }
h2 { font-size: 1.45rem; }
.hero, .page-head, .card, .theme, .sidebar, .feed, .gallery-card, main.container > section.card {
  background: rgba(255,255,255,.94) !important;
  border: 1px solid var(--line) !important;
  border-radius: 16px !important;
  box-shadow: var(--shadow);
}
.hero, .page-head { padding: clamp(20px, 3vw, 34px) !important; }
.hero { border-top: 4px solid #e97862 !important; }
.card, .theme, .sidebar, .feed { padding: 20px !important; }
.grid .card, .project, .gallery-card { transition: transform .2s ease, box-shadow .2s ease; }
.grid .card:hover, .project:hover { transform: translateY(-3px); box-shadow: 0 16px 34px rgba(16,42,53,.12); }
.gallery-card { overflow: hidden; }
.gallery-card img { background: #f4ece7 !important; }
.avatar { border-radius: 12px !important; overflow: hidden; background: #f4e9e3 !important; }
.pill { background: #fff0eb !important; border: 1px solid #f2d1c7 !important; color: #9c4c3e; }
a { color: #087e83; }
a:hover { color: #075f65; }
.meta .links a, .social a { border: 1px solid #f0d9d0 !important; border-radius: 9px !important; color: #9c4c3e; }
.meta .links a:hover, .social a:hover { background: #fff0eb !important; }
footer, .site-footer { color: #687d85 !important; border-top: 1px solid var(--line); padding-top: 18px !important; }
@media (max-width: 900px) {
  header.topbar { flex-wrap: wrap; }
  nav.main-nav { flex-wrap: wrap; }
  main.container { width: min(100% - 28px, var(--max-w)) !important; margin: 24px auto !important; }
}
@media (max-width: 600px) {
  header.topbar { padding: 10px 14px !important; }
  nav.main-nav { width: 100%; justify-content: flex-start; }
  nav.main-nav a { font-size: .88rem; padding: 7px 9px !important; }
  .hero, .page-head { padding: 19px !important; }
  .grid .card { flex-direction: column; }
  .avatar { width: 112px !important; height: 112px !important; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}

/* Page-by-page hierarchy refinements */
.container > header:not(.topbar), .container > .page-head {
  margin-bottom: 24px;
}
.container > header:not(.topbar) {
  padding: 24px 28px;
  border-left: 4px solid var(--accent);
  border-radius: 0 14px 14px 0;
  background: linear-gradient(110deg, #fff 0%, #fff 72%, #fbefea 100%);
}
.lead { color: var(--muted) !important; font-size: 1.06rem; max-width: 72ch; }
.hero { padding: clamp(24px, 4vw, 44px) !important; gap: clamp(22px, 4vw, 48px) !important; }
.hero > div:first-child { align-self: center; }
.hero > div:first-child > p { max-width: 64ch; }
.hero h1 { max-width: 18ch; }
.hero .card { align-self: stretch; }
.css-slider img { border-radius: 11px !important; }
.updates { align-items: start; }
.feed ul { padding-left: 1.25rem; }
.feed li { padding: 0 0 12px 4px; }
.feed li::marker { color: var(--accent); }
.social a { padding: 8px !important; }

.grid { gap: 20px !important; }
.grid .card { min-width: 0; align-items: center !important; padding: 20px !important; }
.avatar { width: 148px !important; height: 148px !important; }
.meta { min-width: 0; }
.meta h3 { color: #193744; line-height: 1.25; }
.meta .roles { color: var(--accent) !important; font-size: .95rem !important; font-weight: 700; }
.meta p { font-size: .97rem !important; }
.meta > a { overflow-wrap: anywhere; }
.container > section[style*="margin-top"] { margin-top: 26px !important; padding: 22px 26px; border-left: 3px solid #e8b0a2; background: rgba(255,255,255,.65); border-radius: 0 12px 12px 0; }
.container > section[style*="margin-top"] h2 { margin-top: 0; }

.themes { gap: 18px !important; }
.theme { border-top: 3px solid #e8b0a2 !important; padding: 22px !important; }
.theme h3 { color: #193744; font-size: 1.12rem; }
.theme p { font-size: .96rem !important; line-height: 1.7; }
.methods { gap: 9px !important; margin: 22px 0 30px !important; }
.projects { display: block !important; }
.project-list { gap: 18px !important; }
.project-list > h2 { margin-bottom: 2px; }
.project {
  align-items: flex-start !important;
  padding: 22px !important;
  border: 1px solid var(--line) !important;
  border-left: 3px solid #e8b0a2 !important;
  border-radius: 14px !important;
  background: #fff !important;
  box-shadow: var(--shadow);
}
.project video { width: min(36%, 370px) !important; min-width: 240px; border-radius: 10px; background: #172a32; }
.project h4 { margin: 0 0 8px; color: #193744; font-size: 1.14rem; }
.project p { margin: 0; color: var(--muted); font-size: .95rem; line-height: 1.72; }
.tools-section { margin-top: 32px; padding: 24px; background: rgba(255,255,255,.72); border: 1px solid var(--line); border-radius: 16px; }
.tools-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.tool-block { padding: 18px; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.tool-block > p:first-child { margin-top: 0; color: #193744; }
.tool-block ul { margin-bottom: 0; color: var(--muted); }

.container > section:not(.grid):not(.gallery):not(.themes):not(.project-list):not(.tools-section) { margin-top: 28px; }
.container > section:not(.grid):not(.gallery):not(.themes):not(.project-list):not(.tools-section) > h2 {
  margin: 0 0 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.container > section > h3 { margin: 18px 0 8px; color: #193744; font-size: 1.05rem; }
.pub-list { margin: 0; padding: 0; list-style: none; counter-reset: none; }
.pub-item { margin: 0 0 10px !important; padding: 16px 18px; background: #fff; border: 1px solid var(--line); border-radius: 11px; color: var(--muted); font-size: .97rem; line-height: 1.7; }
.pub-item strong { color: #243b43 !important; }
.pub-item a { font-weight: 600; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.pub-list:not([start]) .pub-item { margin-bottom: 10px !important; }
.container > section > .pub-list + h3 { margin-top: 24px; }
.gallery { gap: 26px !important; }
.gallery-card { box-shadow: 0 12px 30px rgba(16,42,53,.08) !important; }
.gallery-card img { max-height: 560px !important; }
.card-content { padding: 20px !important; }
.event-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.event-meta span { padding: 4px 9px; background: #fff0eb; border-radius: 999px; color: #81554b; }

@media (max-width: 900px) {
  .themes { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .tools-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .project video { width: 34% !important; min-width: 210px; }
}
@media (max-width: 650px) {
  .container > header:not(.topbar) { padding: 19px; }
  .grid .card { flex-direction: row !important; align-items: flex-start !important; }
  .avatar { width: 88px !important; height: 88px !important; }
  .meta h3 { font-size: 1.15rem !important; }
  .meta p { font-size: .9rem !important; }
  .themes, .tools-grid { grid-template-columns: 1fr !important; }
  .project { flex-direction: column; }
  .project video { width: 100% !important; min-width: 0; max-height: 300px; }
  .pub-item { padding: 13px 14px; font-size: .92rem; }
  .container > section[style*="margin-top"] { padding: 18px; }
}
