:root {
  --bg: #f5f4ef;
  --panel: rgba(255, 255, 255, 0.86);
  --panel-strong: #ffffff;
  --text: #16202b;
  --muted: #52606d;
  --line: rgba(22, 32, 43, 0.12);
  --accent: #0f766e;
  --accent-strong: #115e59;
  --shadow: 0 24px 60px rgba(15, 23, 42, 0.10);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Aptos", "Segoe UI Variable", "Segoe UI", "Helvetica Neue", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(15, 118, 110, 0.14), transparent 34%),
    radial-gradient(circle at top right, rgba(251, 191, 36, 0.18), transparent 28%),
    linear-gradient(180deg, #f9f8f3 0%, var(--bg) 100%);
  line-height: 1.65;
}

a {
  color: var(--accent-strong);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.site-shell {
  width: min(980px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 56px;
}

.site-header,
.page-content,
.site-footer {
  backdrop-filter: blur(14px);
}

.site-header {
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  position: sticky;
  top: 18px;
  z-index: 10;
}

.brand {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text);
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.site-nav a {
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--muted);
}

.site-nav a:hover {
  background: rgba(15, 118, 110, 0.09);
  color: var(--text);
  text-decoration: none;
}

.page-content {
  margin-top: 22px;
  padding: 42px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 4px);
  box-shadow: var(--shadow);
}

.hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  align-items: stretch;
  margin-bottom: 28px;
}

.hero-card,
.info-card,
.callout,
.code-block,
.table-wrap,
.figure-card {
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
}

.hero-card,
.info-card,
.callout,
.figure-card {
  padding: 24px;
}

.info-card,
.callout,
.figure-card {
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
}

.hero-card h1 {
  max-width: 14ch;
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.10);
  color: var(--accent-strong);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  line-height: 1.15;
  letter-spacing: -0.02em;
}

h1 {
  margin: 16px 0 14px;
  font-size: clamp(2.4rem, 4vw, 4rem);
}

h2 {
  margin-top: 42px;
  font-size: clamp(1.65rem, 2.8vw, 2.3rem);
}

h3 {
  margin-top: 28px;
  font-size: 1.25rem;
}

p,
li {
  color: var(--muted);
}

strong {
  color: var(--text);
}

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

.info-card h3,
.callout h3,
.figure-card h3 {
  margin-top: 0;
}

.algorithm-card {
  background: var(--panel-strong);
  border: 1px solid rgba(15, 118, 110, 0.18);
  border-radius: 18px;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
  padding: 24px;
  border-color: rgba(15, 118, 110, 0.18);
}

.algorithm-card h3 a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.16em;
}

.algorithm-card h3 a:hover {
  color: var(--accent-strong);
}

.algorithm-link-note {
  margin-top: 10px;
  font-size: 0.96rem;
  color: var(--accent-strong);
  font-weight: 600;
}

.learn-more-link {
  display: inline-flex;
  margin-top: 10px;
  font-weight: 700;
}

.callout {
  border-left: 5px solid var(--accent);
  padding-left: 18px;
}

.table-wrap {
  overflow-x: auto;
  margin: 18px 0;
  padding: 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
  background: var(--panel-strong);
  border-radius: 18px;
  overflow: hidden;
}

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--text);
  background: rgba(15, 118, 110, 0.08);
}

tbody tr:nth-child(even) {
  background: rgba(15, 23, 42, 0.025);
}

code,
pre {
  font-family: "Cascadia Code", "Cascadia Mono", Consolas, monospace;
}

code {
  padding: 0.12rem 0.35rem;
  border-radius: 0.45rem;
  background: rgba(15, 23, 42, 0.06);
  color: var(--text);
}

pre {
  margin: 0;
  padding: 18px 20px;
  overflow-x: auto;
  background: #111827;
  color: #e5eef7;
  border-radius: 18px;
}

pre code {
  padding: 0;
  background: transparent;
  color: inherit;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 16px;
}

.figure-card img {
  margin-top: 12px;
}

.page-content ul {
  padding-left: 20px;
}

.page-content section + section,
.page-content div + section,
.page-content section + div {
  margin-top: 22px;
}

.site-footer {
  margin-top: 18px;
  padding: 20px 24px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
}

@media (max-width: 860px) {
  .site-header {
    position: static;
    align-items: flex-start;
    flex-direction: column;
  }

  .page-content {
    padding: 28px 20px;
  }

  .hero-card h1 {
    max-width: none;
  }
}
