:root {
  --bg: #0b0d0f;
  --panel: #111417;
  --text: #f3f4f6;
  --muted: #8e969f;
  --line: #242a30;
  --accent: #d8ff63;
  --max: 1180px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

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

.shell {
  width: min(calc(100% - 40px), var(--max));
  margin: 0 auto;
}

.topbar {
  min-height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.brand {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  font-weight: 800;
  letter-spacing: -0.04em;
}

nav {
  display: flex;
  gap: 28px;
}

nav a {
  color: var(--muted);
}

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

.hero,
.page-head {
  padding: 112px 0 96px;
}

.eyebrow,
.index,
.note-date {
  color: var(--accent);
  font: 600 12px/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.14em;
}

h1 {
  max-width: 920px;
  margin: 20px 0 28px;
  font-size: clamp(56px, 9vw, 122px);
  line-height: 0.9;
  letter-spacing: -0.065em;
  font-weight: 750;
}

.lead {
  max-width: 730px;
  margin: 0;
  color: var(--muted);
  font-size: clamp(18px, 2vw, 24px);
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.panel {
  min-height: 330px;
  padding: 28px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.panel h2 {
  margin: 42px 0 12px;
  font-size: 28px;
  letter-spacing: -0.03em;
}

.panel p {
  color: var(--muted);
  max-width: 32ch;
}

.stack {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 32px;
}

.stack span {
  padding: 7px 10px;
  border: 1px solid var(--line);
  color: #c8cdd2;
  font: 500 12px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.arrow-link {
  display: inline-block;
  margin-top: 28px;
  color: var(--accent);
}

.notes-list {
  display: grid;
  gap: 14px;
}

.note {
  border: 1px solid var(--line);
  background: var(--panel);
  scroll-margin-top: 24px;
}

.note-summary {
  position: relative;
  display: grid;
  grid-template-columns: 180px 1fr 44px;
  gap: 28px;
  align-items: start;
  padding: 26px 28px;
  cursor: pointer;
  list-style: none;
}

.note-summary::marker {
  content: "";
}

.note-summary::-webkit-details-marker {
  display: none;
}

.note-summary::after {
  content: "+";
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  justify-self: end;
  border: 1px solid var(--line);
  color: var(--accent);
  font: 300 26px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.note[open] > .note-summary::after {
  content: "−";
}

.note-summary:hover .note-heading h2,
.note[open] .note-heading h2 {
  color: var(--accent);
}

.note-meta {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-top: 4px;
}

.note-meta time {
  color: var(--accent);
  font: 600 12px/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.08em;
}

.note-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.note-tags span {
  padding: 5px 7px;
  border: 1px solid var(--line);
  color: var(--muted);
  font: 500 10px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.note-heading h2 {
  margin: 0 0 10px;
  max-width: 800px;
  font-size: clamp(24px, 3vw, 36px);
  line-height: 1.08;
  letter-spacing: -0.035em;
  transition: color 160ms ease;
}

.note-heading p {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  font-size: 16px;
}

.note-summary:hover::after {
  border-color: #4a525b;
}

.note-content {
  max-width: 900px;
  margin-left: 208px;
  padding: 0 28px 56px 0;
}

.note-content section + section {
  margin-top: 44px;
}

.note-content h3 {
  margin: 0 0 14px;
  font-size: 20px;
  letter-spacing: -0.02em;
}

.note-content p {
  margin: 0 0 16px;
  color: #b7bdc4;
  font-size: 16px;
}

.note-content strong {
  color: var(--text);
}

.note-content code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.note-content p code {
  padding: 2px 5px;
  background: #161a1e;
  border: 1px solid var(--line);
  color: #d9dde1;
  font-size: 0.9em;
}

.note-content pre {
  overflow-x: auto;
  margin: 18px 0;
  padding: 18px 20px;
  border: 1px solid var(--line);
  background: #080a0c;
  color: #d7dce1;
  font-size: 13px;
  line-height: 1.7;
}

.note-result {
  display: flex;
  align-items: center;
  gap: 22px;
  margin: 20px 0 24px;
}

.note-result span:not(.result-arrow) {
  min-width: 130px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  font: 600 22px/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.note-result small {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.result-arrow {
  color: var(--accent);
  font-size: 24px;
}

.note-ending {
  margin-top: 28px !important;
  color: var(--text) !important;
  font-weight: 650;
}

footer {
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 14px;
}

@media (max-width: 820px) {
  .shell {
    width: min(calc(100% - 28px), var(--max));
  }

  .hero,
  .page-head {
    padding: 76px 0 68px;
  }

  h1 {
    font-size: clamp(48px, 15vw, 78px);
  }

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

  .panel {
    min-height: 250px;
  }

  .note-summary {
    grid-template-columns: 1fr 40px;
    gap: 18px;
    padding: 22px 20px;
  }

  .note-meta {
    grid-column: 1 / -1;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding-top: 0;
  }

  .note-heading {
    grid-column: 1;
  }

  .note-summary::after {
    grid-column: 2;
    grid-row: 2;
  }

  .note-content {
    margin-left: 0;
    padding: 0 20px 42px;
  }

  .note-result {
    gap: 12px;
  }

  .note-result span:not(.result-arrow) {
    min-width: 0;
    flex: 1;
    font-size: 18px;
  }

  nav {
    gap: 18px;
  }
}
