:root {
  --text-black: #000;
  --text-white: #fff;
  --text-primary: #1b1a18;
  --text-lowlight: #77736f;
  --text-accent: #456dff;
  --link-color: #ff7a59;
  --paper-background: #fffbec;
  --paper-background-light: #fffdfa;
  --container-width: 996px;
  --border-radius: 6px;
  --border-radius-small: 4px;
  --shadow-border-standard: 1.5px solid var(--text-black);
  --shadow-border-lowlight: 1.5px solid var(--text-lowlight);
  --shadow-standard: 0 2px 0 rgba(0, 0, 0, 0.92), 0 14px 30px rgba(32, 25, 18, 0.08);
  --shadow-lowlight: 0 2px 0 rgba(119, 115, 111, 0.4);
  --box-background: #fff;
  --padding-standard: 0.75rem 1rem;
  --background-image: linear-gradient(rgba(44,42,39,0.055) 1px, transparent 1px), linear-gradient(90deg, rgba(44,42,39,0.055) 1px, transparent 1px);
  --sans-serif: "Urbanist", sans-serif;
  --monospace: "Sometype Mono", monospace;
  --sidebar-width: 220px;
  --table-border: var(--shadow-border-lowlight);
  --table-divider-color: rgba(69, 109, 255, 0.18);
  --table-header-background: rgba(69, 109, 255, 0.1);
  --table-row-background: rgba(69, 109, 255, 0.035);
  --table-surface: linear-gradient(180deg, rgba(247, 249, 255, 0.96), rgba(255, 255, 255, 0.98));
}

* {
  box-sizing: border-box;
}

body {
  color: var(--text-primary);
  font-family: var(--sans-serif);
  font-optical-sizing: auto;
  font-style: normal;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background-image: var(--background-image);
  background-size: 20px 20px;
}

main p a,
footer a,
.feature-card h2 a,
.item-card h2 a {
  color: var(--text-black);
  font-weight: 600;
  box-shadow: 0 1.5px 0 var(--text-accent);
  text-decoration: none;
  transition: all 120ms ease;
}

main p a:hover,
footer a:hover,
.feature-card h2 a:hover,
.item-card h2 a:hover {
  box-shadow: 0 3.5px 0 var(--link-color);
}

:first-child {
  margin-top: 0;
}

:last-child {
  margin-bottom: 0;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--text-black);
  margin-bottom: 0.25em;
}

code, pre {
  font-family: var(--monospace);
  font-optical-sizing: auto;
  font-style: normal;
}

.container {
  max-width: var(--container-width);
  margin-left: auto;
  margin-right: auto;
}

header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

header .home-link {
  color: var(--text-primary);
  font-weight: 600;
  text-decoration: none;
}

header .home-link:hover {
  color: var(--text-accent);
}

header ul {
  display: flex;
  align-items: center;
  list-style: none;
  gap: 0.5rem;
  margin: 0;
}

main {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

main .container {
  display: flex;
  flex-direction: row;
  gap: 1rem;
  align-items: stretch;
  justify-content: space-between;
  width: 100%;
}

main .sidebar {
  flex: 0 0 var(--sidebar-width);
}

main .sidebar .floating-sidebar {
  position: sticky;
  top: 1rem;
}

header .container,
main .title-meta,
main .content,
main .floating-sidebar {
  border-radius: var(--border-radius);
  border: var(--shadow-border-standard);
  box-shadow: var(--shadow-standard);
  background-color: var(--box-background);
  min-width: 0;
  width: 100%;
  padding: var(--padding-standard);
}

main .talk-workshop,
main .note,
main .warning,
main .success,
main .tip,
main .code-block {
  border-radius: var(--border-radius);
  border: var(--shadow-border-lowlight);
  box-shadow: var(--shadow-lowlight);
  background-color: var(--box-background);
  min-width: 0;
  width: 100%;
  padding: var(--padding-standard);
}

main .talk-workshop,
main .note,
main .code-block {
  background: var(--paper-background);
}

main .note :is(h2, h3, h4, h5, h6) {
  display: inline-block;
  border-radius: var(--border-radius);
  border: var(--shadow-border-standard);
  box-shadow: var(--shadow-standard);
  background: var(--text-accent);
  color: var(--text-white);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.05rem 0.25rem;
}

main .talk-workshop .heading-link::before {
  display: none;
}

main .talk-workshop :is(h2, h3, h4, h5, h6) + p {
  margin-top: 0.25rem;
}

main .note-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0;
}

main .note-meta > * {
  margin: 0 !important;
}

main .note-meta + :is(h2, h3, h4, h5, h6) {
  margin-top: 0;
}

main .code-block {
  overflow-x: auto;
}

main .title-meta h1:has(+ .lead) {
  margin-bottom: 0.25rem;
}

main .title-meta .lead {
  color: var(--text-primary);
  font-size: 1rem;
  margin-top: 0;
  margin-bottom: 0.25rem;
}

main .title-meta ul {
  display: flex;
  align-items: center;
  list-style: none;
  font-size: 0.875rem;
  gap: 1rem;
  margin: 0;
  padding: 0;
}

main .title-meta ul:not(:last-child) {
  margin-bottom: 0.25rem;
}

main .title-meta ul li {
  position: relative;
}

main .title-meta .metadata li + li::before {
  content: "·";
  position: absolute;
  left: -0.5rem;
  color: #5e574f;
  transform: translateX(-50%);
}

main .toc :is(ol, ul) {
  margin: 0;
  font-family: var(--monospace);
  padding-left: 1.25rem;
  list-style: none;
}

main .toc :is(ol, ul) a {
  font-family: var(--sans-serif);
  color: var(--text-primary);
  text-decoration: none;
}

main .toc :is(ol, ul) a:hover {
  color: var(--text-accent);
}

main .toc summary {
  position: relative;
}

main .toc summary::marker {
  content: "";
}

main .toc summary::before {
  content: "▸";
  color: var(--text-primary);
  position: absolute;
  left: -0.625rem;
  top: 0;
  transform: translateX(-50%);
  font-size: 1.5rem;
  line-height: 1;
}

main .toc summary[open]::before {
  content: "▾";
}

main .heading-link {
  text-decoration: none;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: inherit;
}

main .heading-link::before {
  content: "//";
  color: rgba(69,109,255,0.8);
  font-size: 0.78em;
  font-family: var(--monospace);
  font-weight: 800;
  letter-spacing: -0.08em;
}

main .heading-link::after {
  content: "#";
  color: rgba(92,124,255,0.6);
  opacity: 0;
  transition: opacity 120ms ease;
  font-family: var(--monospace);
}

main .heading-link:hover::after {
  opacity: 1;
}

header nav a,
main .pill-label {
  display: inline-block;
  padding: 0.1rem 0.65rem;
  border-radius: var(--border-radius-small);
  border: var(--shadow-border-lowlight);
  box-shadow: var(--shadow-lowlight);
  background: #fff;
  color: var(--text-primary);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
}

main .pill-label:not(a) {
  cursor: default;
}

header nav a:hover,
main a.pill-label:hover,
main a.pill-label.cta:hover {
  background: var(--link-color);
  color: var(--text-white);
}

main a.pill-label.cta {
  background: var(--text-accent);
  color: var(--text-white);
}

main .pill-label.lowlight {
  opacity: 0.6;
}

main .pill-label.lowlight:hover {
  opacity: 1;
}

main table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.92rem;
  overflow: hidden;
  border: var(--table-border);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lowlight);
  background: var(--table-surface);
}

main :is(th, td) {
  text-align: left;
  vertical-align: top;
  padding: 0.7rem 0.75rem;
  border-top: 1px solid var(--table-divider-color);
}

main tr:first-child :is(th, td) {
  border-top: 0;
}

main th {
  font-weight: 800;
  color: var(--text-primary);
  background: var(--table-header-background);
}

main tbody tr:nth-child(even) td {
  background: var(--table-row-background);
}

main :not(pre) > code {
  border-radius: var(--border-radius-small);
  background: rgba(69, 109, 255, 0.1);
  padding: 0.1rem 0.25rem;
  font-size: 0.95em;
}

footer .container {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 0.25rem;
  padding-bottom: 0.5rem;
  gap: 1rem;
  font-size: 0.875rem;
}

footer ul {
  display: flex;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 1rem;
}

@media (max-width: 800px) {
  main .container {
    flex-direction: column;
  }

  main .sidebar {
    order: -1;
    width: 100%;
  }
}

main .items-section + .items-section {
  margin-top: 1rem;
}

main .section-label,
main .item-year {
  margin: 0;
  font-family: var(--monospace);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #8a5f16;
}

main .section-label {
  margin-bottom: 0.75rem;
}

main .item-year {
  text-align: right;
}

main .feature-card,
main .item-card {
  position: relative;
  border-radius: var(--border-radius);
  border: var(--shadow-border-lowlight);
  box-shadow: var(--shadow-lowlight);
  padding: 1rem 1rem 1.1rem;
}

main .feature-list {
  display: grid;
  gap: 0.9rem;
}

main .feature-card {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(255, 252, 245, 0.85), rgba(255, 255, 255, 0.98));
}

main .feature-body {
  position: relative;
  z-index: 1;
  padding-right: 5.5rem;
}

main .feature-card h2,
main .item-card h2 {
  margin-top: 0;
  margin-bottom: 0.45rem;
  font-size: clamp(1.45rem, 2vw, 2.3rem);
  line-height: 1.15;
}

main .item-card h2 {
  font-size: clamp(1.2rem, 1.6vw, 1.8rem);
}

main .feature-card h2 a,
main .item-card h2 a {
  color: var(--text-black);
  text-decoration: none;
}

main .item-description {
  margin: 0;
  font-size: 1.02rem;
}

main .item-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.1rem;
}

main .project-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

main .post-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.9rem;
}

main .item-card {
  display: block;
  min-height: 100%;
  padding-right: 5.5rem;
  color: inherit;
  text-decoration: none;
  background: var(--paper-background-light);
  transition: transform 140ms ease, box-shadow 140ms ease;
}

main .feature-card .item-year,
main .item-card .item-year {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 1;
}

main .feature-card .item-year {
  top: 0;
  right: 0;
}

main .content-note {
  margin-top: 1rem;
  margin-bottom: 0.15rem;
  text-align: center;
  color: var(--text-lowlight);
  font-size: 0.92rem;
}

@media (max-width: 800px) {
  main .feature-card {
    min-height: 0;
  }

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