:root {
  color-scheme: light;
  --bg: #f7f7f4;
  --surface: #ffffff;
  --text: #222222;
  --muted: #5f6368;
  --line: #dddddd;
  --accent: #2f5f70;
  --accent-soft: #eef5f7;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    Arial, Helvetica, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.7;
}

a {
  color: var(--accent);
  text-underline-offset: 0.2em;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--line);
  background: rgba(247, 247, 244, 0.94);
  padding: 1rem max(1rem, calc((100vw - 920px) / 2));
  backdrop-filter: blur(12px);
}

.brand {
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  justify-content: flex-end;
}

.nav a {
  color: var(--muted);
  font-size: 0.96rem;
  text-decoration: none;
}

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

main {
  width: min(920px, calc(100% - 2rem));
  margin: 0 auto;
}

.intro {
  padding: 4rem 0 3rem;
}

.home-intro {
  padding-bottom: 2rem;
}

h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0.8rem;
  font-size: clamp(2.8rem, 9vw, 5rem);
  line-height: 1;
}

h2 {
  margin-bottom: 1.1rem;
  font-size: clamp(1.9rem, 5vw, 2.7rem);
  line-height: 1.1;
}

h3 {
  margin: 1.5rem 0 0.75rem;
  font-size: 1.24rem;
}

h4 {
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
  line-height: 1.3;
}

.quote {
  color: var(--accent);
  font-size: 1.2rem;
  font-weight: 700;
}

.section {
  border-top: 1px solid var(--line);
  padding: 3.5rem 0;
}

.first-section {
  padding-top: 0;
  border-top: 0;
}

.section p,
.section li {
  max-width: 74ch;
}

ul {
  display: grid;
  gap: 0.6rem;
  margin-top: 0;
  padding-left: 1.35rem;
}

.publication-list {
  margin-bottom: 1.5rem;
}

.card-grid,
.note-groups,
.home-grid {
  display: grid;
  gap: 1rem;
}

.card-grid,
.home-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.note-groups {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 1.5rem;
}

.card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 1.1rem;
  box-shadow: 0 10px 28px rgba(34, 34, 34, 0.06);
}

.page-card {
  display: block;
  color: inherit;
  text-decoration: none;
}

.page-card h2,
.page-card h3 {
  margin-top: 0;
}

.card p:last-child,
.card ul:last-child {
  margin-bottom: 0;
}

.card-label {
  margin-bottom: 0.5rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.single-card {
  max-width: 74ch;
}

.note-card h2,
.note-card h3 {
  margin-top: 0;
  font-size: 1.45rem;
}

.note-card ul {
  gap: 0.5rem;
}

.single-grid {
  grid-template-columns: minmax(0, 1fr);
  max-width: 40rem;
}

.lede {
  max-width: 48rem;
  color: var(--muted);
  font-size: 1.08rem;
}

.guide-layout {
  display: grid;
  grid-template-columns: minmax(12rem, 0.34fr) minmax(0, 1fr);
  gap: 2rem;
  align-items: start;
}

.toc {
  position: sticky;
  top: 5.5rem;
  display: grid;
  gap: 0.55rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 1rem;
}

.toc h2 {
  margin-bottom: 0.25rem;
  font-size: 1.1rem;
}

.toc a {
  color: var(--muted);
  font-size: 0.92rem;
  text-decoration: none;
}

.toc a:hover {
  color: var(--accent);
}

.guide h2 {
  margin-top: 3rem;
  font-size: clamp(1.55rem, 3vw, 2.2rem);
}

.guide h2:first-child {
  margin-top: 0;
}

.guide h3 {
  margin-top: 2rem;
}

.wide-figure {
  margin: 1.25rem 0 2rem;
}

.wide-figure img {
  display: block;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.contact-section {
  padding-bottom: 5rem;
}

.site-footer {
  width: min(920px, calc(100% - 2rem));
  margin: 0 auto;
  border-top: 1px solid var(--line);
  padding: 1.25rem 0 2rem;
  color: var(--muted);
  font-size: 0.94rem;
}

@media (max-width: 720px) {
  body {
    font-size: 16px;
  }

  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav {
    justify-content: flex-start;
  }

  .intro {
    padding-top: 2.5rem;
  }

  .card-grid,
  .note-groups,
  .home-grid,
  .guide-layout {
    grid-template-columns: 1fr;
  }

  .toc {
    position: static;
  }
}
