:root {
  --paper: #f3f6f2;
  --ink: #232b29;
  --accent: #147a72;
  --accent-soft: #d2eae4;
  --paper-deep: color-mix(in srgb, var(--accent-soft) 70%, var(--paper));
  --muted: color-mix(in srgb, var(--ink) 70%, var(--paper));
  --line: color-mix(in srgb, var(--ink) 20%, var(--paper));
  --accent-hover: color-mix(in srgb, var(--accent) 82%, var(--ink));
  --radius-soft: 0.55rem;
  --radius-pill: 999px;
  --max-width: 76rem;
  --narrow-width: 48rem;
  --heading-font: "Sora", ui-sans-serif, system-ui, sans-serif;
  --body-font: "Ubuntu", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --paper: #16211f;
  --ink: #e4ebe7;
  --accent: #65c7bb;
  --accent-soft: #223e39;
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --paper: #16211f;
    --ink: #e4ebe7;
    --accent: #65c7bb;
    --accent-soft: #223e39;
    color-scheme: dark;
  }
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 6rem;
}

html:has(.home-page) {
  scroll-padding-top: 0;
  scroll-snap-type: y mandatory;
  overscroll-behavior-y: none;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body-font);
  font-size: 1rem;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  transition: background-color 180ms ease, color 180ms ease;
}

body::before {
  position: fixed;
  z-index: -1;
  inset: 0;
  background-image: radial-gradient(circle, color-mix(in srgb, var(--accent) 45%, transparent) 1px, transparent 1.3px);
  background-size: 22px 22px;
  opacity: 0.3;
  content: "";
  pointer-events: none;
}

::selection {
  background: var(--accent);
  color: var(--paper);
}

a {
  color: inherit;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.2em;
}

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

a:focus-visible,
button:focus-visible {
  border-radius: 0.35rem;
  outline: 3px solid var(--accent-hover);
  outline-offset: 4px;
}

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

h1,
h2,
h3 {
  font-family: var(--heading-font);
  font-weight: 400;
  line-height: 1.06;
  letter-spacing: -0.035em;
}

h1 {
  max-width: 13ch;
  margin-bottom: 1.5rem;
  font-size: clamp(2.8rem, 6.5vw, 5.8rem);
}

h2 {
  max-width: 18ch;
  margin-bottom: 1rem;
  font-size: clamp(2rem, 4vw, 3.5rem);
}

h3 {
  margin-bottom: 0.75rem;
  font-size: clamp(1.4rem, 2.4vw, 1.9rem);
}

em {
  color: var(--accent);
  font-weight: inherit;
}

.shell {
  width: min(calc(100% - 3rem), var(--max-width));
  margin-inline: auto;
}

.narrow {
  width: min(calc(100% - 3rem), var(--narrow-width));
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.7rem 1rem;
  border-radius: var(--radius-soft);
  background: var(--ink);
  color: var(--paper);
  transform: translateY(-160%);
}

.skip-link:focus {
  color: var(--paper);
  transform: translateY(0);
}

.site-header {
  position: sticky;
  z-index: 10;
  top: 0;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  box-shadow: 0 0.4rem 1.5rem color-mix(in srgb, var(--ink) 10%, transparent);
}

.header-inner,
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.header-inner {
  min-height: 4.75rem;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-decoration: none;
  text-transform: uppercase;
}

.wordmark-mark {
  display: grid;
  width: 2.1rem;
  height: 2.1rem;
  place-items: center;
  color: var(--accent);
}

.wordmark-mark svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.wordmark-mark circle {
  fill: currentColor;
  stroke: none;
}

.nav-list {
  display: flex;
  gap: clamp(1rem, 3vw, 2.5rem);
  padding: 0;
  margin: 0;
  list-style: none;
}

.nav-list a {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-decoration: none;
  text-transform: uppercase;
}

.nav-list li {
  display: flex;
  align-items: center;
}

.home-page .site-header {
  position: fixed;
  right: 0;
  left: 0;
  pointer-events: none;
}

.home-page .site-header .wordmark,
.home-page .site-header .theme-toggle,
.home-page .section-nav {
  pointer-events: auto;
}

.section-nav {
  position: fixed;
  z-index: 20;
  top: 50%;
  right: clamp(0.75rem, 2vw, 2rem);
  padding: 0.75rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-soft);
  background: var(--paper);
  box-shadow: 0 0.4rem 1.5rem color-mix(in srgb, var(--ink) 10%, transparent);
  transform: translateY(-50%);
}

.section-nav .nav-list {
  min-width: 8.5rem;
  align-items: flex-end;
  flex-direction: column;
  gap: 0.45rem;
}

.section-nav .nav-list a {
  display: flex;
  min-width: 100%;
  min-height: 2rem;
  align-items: center;
  justify-content: flex-end;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 400;
  line-height: 1;
  opacity: 0.7;
  transform-origin: right center;
  transition: color 280ms ease, font-size 280ms ease, font-weight 280ms ease, opacity 280ms ease, transform 280ms ease;
}

.section-nav .nav-list a:hover {
  color: var(--accent);
  opacity: 1;
}

.section-nav a[aria-current="true"] {
  color: var(--accent);
  font-size: 0.95rem;
  font-weight: 800;
  opacity: 1;
  transform: scale(1.04);
}

.theme-toggle {
  display: grid;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0.45rem;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}

.theme-toggle:hover {
  background: var(--paper-deep);
  color: var(--accent-hover);
}

.theme-icon {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  grid-area: 1 / 1;
}

.theme-icon-sun,
:root[data-theme="dark"] .theme-icon-moon {
  display: none;
}

:root[data-theme="dark"] .theme-icon-sun {
  display: block;
}

.hero {
  display: grid;
  min-height: 0;
  padding-block: clamp(4.5rem, 8vw, 7rem);
  align-items: center;
  grid-template-columns: minmax(0, 1.35fr) minmax(17rem, 0.75fr);
  gap: clamp(3rem, 7vw, 6rem);
}

.home-page .snap-section {
  height: 100svh;
  min-height: 100svh;
  max-height: 100svh;
  padding-right: clamp(10.25rem, 16vw, 13rem);
  overflow: hidden;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.kicker,
.writing-meta {
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

#hero-title {
  max-width: 20ch;
  font-size: clamp(2rem, min(4vw, 7svh), 3.6rem);
}

.hero-deck,
.post-deck {
  max-width: 38rem;
  color: var(--muted);
  font-family: var(--body-font);
  font-size: clamp(1.1rem, 1.8vw, 1.35rem);
  line-height: 1.45;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-top: 1.75rem;
}

.button {
  display: inline-flex;
  min-height: 3rem;
  padding: 0.75rem 1.15rem;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--accent);
  border-radius: var(--radius-pill);
  text-decoration: none;
}

.button-primary {
  background: transparent;
  color: var(--ink);
}

.button-primary:hover {
  background: var(--paper-deep);
  color: var(--ink);
}

.text-link {
  font-weight: 700;
  text-decoration-color: var(--line);
}

.constellation {
  width: 100%;
  max-width: 30rem;
  justify-self: center;
  color: var(--accent);
  background: radial-gradient(ellipse, color-mix(in srgb, var(--accent) 7%, transparent), transparent 68%);
}

.constellation-sky {
  display: block;
  width: 100%;
  max-height: 58svh;
  overflow: visible;
}

.constellation-links {
  fill: none;
  stroke: currentColor;
  stroke-width: 0.65;
  opacity: 0.14;
}

.constellation-rays {
  pointer-events: none;
  fill: currentColor;
  stroke: currentColor;
}

.constellation-star {
  fill: currentColor;
  stroke: currentColor;
}

.constellation-star-core {
  transition: opacity 200ms ease;
}

.constellation-star:hover .constellation-star-core {
  opacity: 1;
  filter: drop-shadow(0 0 5px currentColor);
}

.constellation-hit {
  fill: transparent;
  stroke: none;
  pointer-events: all;
}

.capability-list,
.project-details {
  margin: 0;
}

.capability-list > div {
  display: flex;
  padding-block: 0.7rem;
  justify-content: space-between;
  gap: 1rem;
  border-top: 1px solid var(--line);
}

.capability-list dt,
.project-details dt {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.capability-list dd,
.project-details dd {
  margin: 0;
}

.section {
  padding-block: clamp(4.5rem, 8vw, 7rem);
  border-top: 1px solid var(--line);
}

.section-heading {
  display: grid;
  margin-bottom: clamp(2.75rem, 6vw, 4.5rem);
  grid-template-columns: minmax(3rem, 0.22fr) minmax(0, 2fr);
  gap: 2rem;
}

.section-marker {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.5rem;
  color: var(--accent);
}

.section-number {
  margin: 0;
  color: var(--accent);
  font-family: var(--body-font);
  font-size: 1.25rem;
}

.section-icon {
  width: 3.25rem;
  height: 3.25rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.6;
}

.section-heading h2 {
  font-weight: 500;
}

.section-intro {
  max-width: 40rem;
  color: var(--muted);
  font-size: 1.1rem;
}

.project-list {
  margin-left: calc(15% + 2rem);
}

.project-card {
  padding: clamp(1.5rem, 4vw, 2.75rem) 0;
  border-top: 1px solid var(--line);
}

.project-card:last-child {
  border-bottom: 1px solid var(--line);
}

.project-header,
.project-footer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2rem;
}

.status {
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  white-space: nowrap;
  text-transform: uppercase;
}

.project-question {
  max-width: 46rem;
  margin-block: 1rem 2rem;
  font-family: var(--body-font);
  font-size: 1.25rem;
}

.project-details {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1.25rem, 3vw, 2.5rem);
}

.project-details dt {
  margin-bottom: 0.45rem;
}

.project-details dd {
  color: var(--muted);
  font-size: 0.92rem;
}

.project-footer {
  margin-top: 1.75rem;
}

.tag-list,
.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0;
  margin: 0;
  list-style: none;
}

.tag-list li {
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-pill);
  background: var(--paper-deep);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.project-links a {
  font-size: 0.85rem;
  font-weight: 700;
}

.side-project-grid {
  display: grid;
  margin-left: calc(15% + 2rem);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.side-project-card {
  min-height: 16rem;
  padding: clamp(1.5rem, 4vw, 2.75rem);
}

.side-project-card + .side-project-card {
  border-left: 1px solid var(--line);
}

.side-project-card p:last-child {
  max-width: 32rem;
  margin-bottom: 0;
  color: var(--muted);
}

.writing-list {
  border-top: 1px solid var(--line);
}

.writing-item {
  display: grid;
  padding-block: 2.25rem;
  border-bottom: 1px solid var(--line);
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2rem;
}

.writing-item h3 {
  margin-bottom: 0.65rem;
}

.writing-item h3,
.archive-item h2,
.post-header h1 {
  font-weight: 500;
}

.writing-item h3 a,
.archive-item h2 a {
  text-decoration: none;
}

.writing-item p:not(.writing-meta),
.archive-item > p:not(.writing-meta) {
  max-width: 42rem;
  margin-bottom: 0;
  color: var(--muted);
}

.read-time {
  padding-top: 2rem;
  color: var(--muted);
  font-size: 0.8rem;
  white-space: nowrap;
}

.section-action {
  margin-top: 2rem;
  text-align: right;
}

.about-contact-grid {
  display: grid;
  margin-left: calc(15% + 2rem);
  grid-template-columns: minmax(0, 1.35fr) minmax(17rem, 0.65fr);
  gap: clamp(3rem, 8vw, 7rem);
  align-items: start;
}

.about-details {
  display: grid;
  gap: clamp(2rem, 5vw, 3.5rem);
}

.about-copy {
  font-family: var(--body-font);
  font-size: clamp(1.1rem, 1.5vw, 1.3rem);
}

.about-copy p:last-child {
  margin-bottom: 0;
}

.capability-list > div {
  display: grid;
  grid-template-columns: 0.45fr 1fr;
}

.profile-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-soft);
  background: color-mix(in srgb, var(--paper) 88%, var(--accent-soft));
}

.profile-photo {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  border-bottom: 1px solid var(--line);
  object-fit: cover;
}

.profile-identity {
  display: grid;
  padding: 1rem 1.15rem;
  gap: 0.15rem;
}

.profile-identity strong {
  font-family: var(--heading-font);
  font-weight: 600;
}

.profile-identity span {
  color: var(--muted);
  font-size: 0.82rem;
}

.social-links {
  display: grid;
  border-top: 1px solid var(--line);
}

.social-links a {
  display: grid;
  padding: 0.8rem 1rem;
  align-items: center;
  border-bottom: 1px solid var(--line);
  grid-template-columns: 1.5rem minmax(0, 1fr) auto;
  gap: 0.75rem;
  text-decoration: none;
}

.social-links a:last-child {
  border-bottom: 0;
}

.social-links a:hover {
  background: var(--accent-soft);
}

.social-links svg {
  width: 1.15rem;
  height: 1.15rem;
  stroke-width: 1.8;
}

.social-icon {
  width: 1.15rem;
  height: 1.15rem;
  background: var(--accent);
  mask-position: center;
  mask-repeat: no-repeat;
  mask-size: contain;
  -webkit-mask-position: center;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-size: contain;
}

.social-icon-github {
  mask-image: url("https://cdn.jsdelivr.net/npm/bootstrap-icons@1.13.1/icons/github.svg");
  -webkit-mask-image: url("https://cdn.jsdelivr.net/npm/bootstrap-icons@1.13.1/icons/github.svg");
}

.social-icon-linkedin {
  mask-image: url("https://cdn.jsdelivr.net/npm/bootstrap-icons@1.13.1/icons/linkedin.svg");
  -webkit-mask-image: url("https://cdn.jsdelivr.net/npm/bootstrap-icons@1.13.1/icons/linkedin.svg");
}

.social-icon-telegram {
  mask-image: url("https://cdn.jsdelivr.net/npm/bootstrap-icons@1.13.1/icons/telegram.svg");
  -webkit-mask-image: url("https://cdn.jsdelivr.net/npm/bootstrap-icons@1.13.1/icons/telegram.svg");
}

.social-links a > span:nth-child(2) {
  display: grid;
  min-width: 0;
}

.social-links small {
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.social-links strong {
  overflow: hidden;
  font-size: 0.86rem;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-footer {
  padding-block: 2rem;
  color: var(--muted);
  font-size: 0.75rem;
}

.site-footer p {
  margin: 0;
}

.home-page .site-footer {
  display: none;
}

.home-page .hero {
  padding-block: 6rem 2rem;
}

.home-page .section {
  display: flex;
  padding-block: max(6rem, 7svh) clamp(2rem, 5svh, 4rem);
  flex-direction: column;
  justify-content: center;
}

.home-page .section-heading {
  margin-bottom: clamp(1rem, 2.5svh, 2rem);
}

.home-page .section-heading h2 {
  font-size: clamp(1.9rem, 3.5vw, 3rem);
}

.home-page .section-intro {
  margin-bottom: 0;
  font-size: clamp(0.9rem, 1.5vw, 1.05rem);
}

.home-page .project-list,
.home-page .side-project-grid,
.home-page .writing-list {
  display: grid;
  min-height: 0;
  margin-left: calc(15% + 2rem);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-soft);
  grid-auto-columns: minmax(0, 1fr);
  grid-auto-flow: column;
}

.home-page .project-card,
.home-page .side-project-card,
.home-page .writing-item {
  min-width: 0;
  padding: clamp(1rem, 2.2vw, 1.6rem);
  border: 0;
}

.home-page .project-card + .project-card,
.home-page .side-project-card + .side-project-card,
.home-page .writing-item + .writing-item {
  border-left: 1px solid var(--line);
}

.home-page .project-card:last-child,
.home-page .writing-item {
  border-bottom: 0;
}

.home-page .project-header {
  display: block;
}

.home-page .project-header .status {
  display: inline-flex;
  margin-bottom: 0.75rem;
}

.home-page .project-card h3 a,
.home-page .side-project-card h3 a {
  text-decoration: none;
}

.home-page .project-question {
  display: -webkit-box;
  margin-block: 0.6rem 1rem;
  overflow: hidden;
  font-size: clamp(1rem, 1.5vw, 1.15rem);
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.home-page .project-details {
  grid-template-columns: 1fr;
  gap: 0.65rem;
}

.home-page .project-details dd {
  display: -webkit-box;
  overflow: hidden;
  font-size: clamp(0.76rem, 1vw, 0.88rem);
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.home-page .project-footer {
  margin-top: 1rem;
}

.home-page .side-project-card {
  min-height: 0;
}

.home-page .side-project-card .project-links {
  margin-top: 1rem;
}

.home-page .writing-item {
  grid-template-columns: 1fr;
  grid-template-rows: 1fr auto;
}

.home-page .writing-item p:not(.writing-meta) {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

.home-page .read-time {
  padding-top: 1rem;
}

.home-page .section-action {
  margin: clamp(0.75rem, 2svh, 1.25rem) 0 0;
}

.page-hero,
.post-header,
.not-found {
  padding-block: clamp(4rem, 8vw, 6rem);
}

.page-hero h1,
.post-header h1,
.not-found h1 {
  font-size: clamp(2.7rem, 6vw, 4.6rem);
}

.archive {
  padding-bottom: 7rem;
}

.archive-item {
  padding-block: 2.75rem;
  border-top: 1px solid var(--line);
}

.archive-item:last-child {
  border-bottom: 1px solid var(--line);
}

.archive-item h2 {
  margin-bottom: 0.75rem;
  font-size: clamp(1.6rem, 3.2vw, 2.3rem);
}

.archive-item .text-link {
  display: inline-block;
  margin-top: 1.25rem;
}

.post-header {
  border-bottom: 1px solid var(--line);
}

.back-link {
  display: inline-block;
  margin-bottom: 4rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.post-meta {
  display: flex;
  gap: 0.5rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.prose {
  padding-block: clamp(3.5rem, 8vw, 6rem);
  font-family: var(--body-font);
  font-size: clamp(1.08rem, 2vw, 1.22rem);
}

.prose > * {
  max-width: 40rem;
  margin-inline: auto;
}

.prose h2 {
  margin-top: 3.5rem;
  font-size: clamp(1.8rem, 4vw, 2.5rem);
}

.prose blockquote {
  padding: 1rem 1.25rem;
  border-radius: 0 var(--radius-soft) var(--radius-soft) 0;
  border-left: 3px solid var(--accent);
  background: var(--paper-deep);
  color: var(--muted);
}

.prose blockquote p:last-child,
.prose li:last-child {
  margin-bottom: 0;
}

.not-found {
  min-height: 70vh;
}

.not-found p:not(.section-number) {
  margin-bottom: 2rem;
  color: var(--muted);
}

@media (max-width: 52rem) {
  .hero {
    min-height: auto;
    grid-template-columns: 1fr;
  }

  .constellation {
    max-width: 24rem;
  }

  .project-list,
  .about-contact-grid,
  .side-project-grid {
    margin-left: 0;
  }

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

  .project-details {
    gap: 1.5rem;
  }



  .home-page .project-list,
  .home-page .side-project-grid,
  .home-page .writing-list,
  .home-page .about-contact-grid {
    margin-left: 0;
    overflow: hidden;
  }

  .home-page .project-list,
  .home-page .side-project-grid,
  .home-page .writing-list {
    grid-template-columns: none;
    grid-auto-columns: minmax(0, 1fr);
    grid-auto-flow: column;
  }

  .home-page .about-contact-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
  }

  .home-page .project-details {
    display: none;
  }

}

@media (max-width: 38rem) {
  .shell,
  .narrow {
    width: min(calc(100% - 2rem), var(--max-width));
  }

  .header-inner {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.5rem;
    padding-block: 0.8rem;
  }

  .home-page .header-inner {
    align-items: center;
    flex-direction: row;
    padding-block: 0.8rem;
  }

  .site-header:not(:has(.section-nav)) .nav-list {
    width: 100%;
    justify-content: space-between;
    gap: 0.45rem;
  }

  .site-header:not(:has(.section-nav)) .header-inner {
    position: relative;
  }

  .site-header:not(:has(.section-nav)) .theme-toggle {
    position: absolute;
    top: 0.8rem;
    right: 0;
  }

  .site-header:not(:has(.section-nav)) .nav-list a {
    font-size: 0.72rem;
  }

  .section-nav {
    right: 0.4rem;
  }

  .section-nav .nav-list {
    min-width: 6.25rem;
  }

  .section-nav .nav-list a {
    min-height: 1.75rem;
    font-size: 0.58rem;
  }

  .section-nav a[aria-current="true"] {
    font-size: 0.72rem;
  }

  .home-page .snap-section {
    padding-right: 8.5rem;
  }

  .home-page .section-heading {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .home-page .section-marker {
    display: block;
  }

  .home-page .section-icon {
    display: none;
  }

  .hero-actions,
  .project-header,
  .project-footer,
  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
  }

  .section-heading {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .section-marker {
    flex-direction: row;
    align-items: center;
    gap: 1rem;
  }

  .section-icon {
    width: 2.5rem;
    height: 2.5rem;
  }

  .writing-item {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .read-time {
    padding-top: 1rem;
  }

  .about-contact-grid,
  .home-page .about-contact-grid {
    grid-template-columns: 1fr;
  }

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

  .side-project-card + .side-project-card {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .home-page .side-project-card + .side-project-card {
    border-top: 0;
    border-left: 1px solid var(--line);
  }

  .site-footer p:last-child {
    margin-top: 0.4rem;
  }
}

@media (max-height: 44rem) {
  .home-page .section {
    padding-block: 6rem 1.25rem;
  }

  .home-page .section-heading {
    margin-bottom: 0.75rem;
  }

  .home-page .section-icon {
    display: none;
  }

  .home-page .section-heading h2 {
    margin-bottom: 0.4rem;
    font-size: clamp(1.65rem, 4.5svh, 2.35rem);
  }

  .home-page .section-intro,
  .home-page .about-copy,
  .home-page .side-project-card p:last-child {
    font-size: 0.86rem;
    line-height: 1.35;
  }

  .home-page .project-question {
    -webkit-line-clamp: 2;
  }

  .home-page .project-details dd {
    -webkit-line-clamp: 1;
  }
}

@media (max-width: 52rem) and (orientation: portrait) {
  html:has(.home-page) {
    scroll-behavior: auto;
    scroll-padding-top: 7.5rem;
    scroll-snap-type: none;
    overscroll-behavior-y: auto;
  }

  .home-page .site-header {
    position: sticky;
    pointer-events: auto;
  }

  .home-page .header-inner {
    display: grid;
    min-height: 0;
    padding-block: 0.65rem 0.5rem;
    align-items: center;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.45rem 1rem;
  }

  .home-page .wordmark {
    grid-column: 1;
    grid-row: 1;
  }

  .home-page .theme-toggle {
    grid-column: 2;
    grid-row: 1;
  }

  .home-page .section-nav {
    position: static;
    width: 100%;
    padding: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    transform: none;
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .home-page .section-nav .nav-list {
    width: 100%;
    min-width: 0;
    align-items: center;
    justify-content: space-between;
    flex-direction: row;
    gap: 0.35rem;
  }

  .home-page .section-nav .nav-list a {
    min-width: 0;
    min-height: 1.65rem;
    color: var(--muted);
    font-size: clamp(0.52rem, 2.2vw, 0.66rem);
    font-weight: 400;
    letter-spacing: 0.035em;
    opacity: 0.72;
    transform: none;
    transition: none;
  }

  .home-page .section-nav a[aria-current="true"] {
    color: var(--accent);
    font-size: clamp(0.52rem, 2.2vw, 0.66rem);
    font-weight: 700;
    opacity: 1;
    text-decoration: underline;
    text-decoration-color: var(--accent);
    text-decoration-thickness: 0.12rem;
    text-underline-offset: 0.32rem;
    transform: none;
  }

  .home-page .snap-section {
    width: min(calc(100% - 2rem), var(--max-width));
    height: auto;
    min-height: 0;
    max-height: none;
    padding-right: 0;
    overflow: visible;
    scroll-snap-align: none;
  }

  .home-page .hero {
    padding-block: clamp(3rem, 10vw, 5rem);
    grid-template-columns: 1fr;
  }

  .home-page .constellation {
    max-width: 22rem;
  }

  .home-page .section {
    display: block;
    padding-block: clamp(3.5rem, 12vw, 5rem);
  }

  .home-page .section-heading {
    grid-template-columns: auto minmax(0, 1fr);
    margin-bottom: 2rem;
  }

  .home-page .section-icon {
    display: block;
  }

  .home-page .project-list,
  .home-page .side-project-grid,
  .home-page .writing-list,
  .home-page .about-contact-grid {
    display: grid;
    margin-left: 0;
    overflow: visible;
    border-radius: var(--radius-soft);
    grid-template-columns: 1fr;
    grid-auto-columns: auto;
    grid-auto-flow: row;
  }

  .home-page .project-card,
  .home-page .side-project-card,
  .home-page .writing-item {
    padding: 1.35rem;
  }

  .home-page .project-card + .project-card,
  .home-page .side-project-card + .side-project-card,
  .home-page .writing-item + .writing-item {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .home-page .project-details {
    display: grid;
    grid-template-columns: 1fr;
  }

  .home-page .project-question,
  .home-page .project-details dd,
  .home-page .writing-item p:not(.writing-meta) {
    display: block;
    overflow: visible;
    -webkit-line-clamp: unset;
  }

  .home-page .about-contact-grid {
    gap: 2rem;
  }

  .home-page .site-footer {
    display: block;
  }
}

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

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

@media print {
  :root {
    --paper: #fff;
    --ink: #111;
    --accent: #147a72;
    --accent-soft: #d2eae4;
    color-scheme: light;
  }

  .site-header,
  .site-footer,
  .hero-actions {
    display: none;
  }

  body {
    background: var(--paper);
  }

  .section,
  .post-header {
    break-inside: avoid;
  }
}

@media (max-width: 52rem) and (orientation: landscape) {
  .home-page .hero {
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.75fr);
    gap: 1.5rem;
  }
}
