:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --surface-soft: #f0fdfa;
  --ink: #101828;
  --muted: #5b6472;
  --line: #e4e7ec;
  --accent: #0f766e;
  --accent-soft: #ccfbf1;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 8px 24px rgba(16, 24, 40, 0.05);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--ink);
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: #fff;
  padding: 10px 16px;
  z-index: 10;
}

.skip:focus {
  left: 16px;
  top: 16px;
}

.site-header {
  width: min(1040px, calc(100% - 40px));
  margin: 0 auto;
  padding: 22px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-mark {
  width: 30px;
  height: 30px;
  color: var(--accent);
}

.nav {
  display: flex;
  gap: 22px;
}

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

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

main {
  width: min(1040px, calc(100% - 40px));
  margin: 0 auto;
}

.hero {
  padding: 92px 0 76px;
  max-width: 860px;
}

.eyebrow {
  margin: 0 0 18px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(2.6rem, 7vw, 4.9rem);
  line-height: 1.02;
  letter-spacing: -0.055em;
  font-weight: 750;
}

.lede {
  max-width: 620px;
  margin: 26px 0 0;
  color: var(--muted);
  font-size: clamp(1.05rem, 2vw, 1.25rem);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 20px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  transition: transform 160ms ease, background 160ms ease, color 160ms ease;
}

.button:hover {
  background: #115e59;
  color: #fff;
  transform: translateY(-1px);
}

.button.ghost {
  background: transparent;
  color: var(--accent);
}

.button.ghost:hover {
  background: var(--surface-soft);
  color: var(--ink);
}

.meta {
  margin: 26px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

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

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

h2 {
  margin: 0;
  font-size: clamp(1.5rem, 3vw, 2rem);
  letter-spacing: -0.03em;
}

.text-link {
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
}

.cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.card {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: border-color 160ms ease, transform 160ms ease;
}

.card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.tag {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.card h3 {
  margin: 0 0 8px;
  font-size: 1.12rem;
  line-height: 1.35;
  letter-spacing: -0.02em;
}

.card h3 a {
  color: var(--ink);
  text-decoration: none;
}

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

.card p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(240px, 0.6fr);
  gap: 48px;
  align-items: start;
}

.about p {
  max-width: 640px;
  color: var(--muted);
}

.facts {
  margin: 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}

.facts div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.facts div:last-child {
  border-bottom: 0;
}

.facts dt {
  color: var(--muted);
  font-size: 0.86rem;
}

.facts dd {
  margin: 0;
  font-size: 0.86rem;
  font-weight: 600;
  text-align: right;
}

.site-footer {
  width: min(1040px, calc(100% - 40px));
  margin: 24px auto 0;
  padding: 24px 0 40px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  font-size: 0.84rem;
}

.site-footer p {
  margin: 0;
}

/* Notes page */

.page-head {
  padding: 72px 0 40px;
  max-width: 760px;
}

.page-head h1 {
  font-size: clamp(2.2rem, 5vw, 3.6rem);
}

.page-head p {
  color: var(--muted);
}

.article {
  padding: 36px 0;
  border-top: 1px solid var(--line);
  max-width: 760px;
}

.article h2 {
  margin-bottom: 6px;
}

.article .date {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 0.84rem;
}

.article p {
  color: var(--muted);
}

.article p:first-of-type {
  color: var(--ink);
  font-size: 1.06rem;
}

.article code {
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--surface-soft);
  color: var(--accent);
  font-size: 0.9em;
}

.back {
  display: inline-block;
  margin-top: 24px;
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
}

/* 404 */

.not-found {
  min-height: 55vh;
  display: grid;
  place-content: center;
  text-align: center;
  padding: 80px 0;
}

.not-found h1 {
  font-size: clamp(3rem, 10vw, 6rem);
}

.not-found p {
  color: var(--muted);
}

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

  .site-header {
    padding: 18px 0;
  }

  .hero {
    padding: 64px 0 52px;
  }

  .cards {
    grid-template-columns: 1fr;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .site-footer {
    flex-direction: column;
    gap: 6px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition: none !important;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1220;
    --surface: #111a2c;
    --surface-soft: #0f2a2a;
    --ink: #e5e7eb;
    --muted: #94a3b8;
    --line: #1e293b;
    --accent: #2dd4bf;
    --accent-soft: #134e4a;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 32px rgba(0, 0, 0, 0.25);
  }

  .button {
    color: #052e2b;
  }

  .button:hover {
    background: #5eead4;
    color: #052e2b;
  }

  .button.ghost {
    color: var(--accent);
  }

  .button.ghost:hover {
    background: var(--surface-soft);
    color: var(--ink);
  }
}
