:root {
  --bg: #282828;
  --surface: #32302f;
  --surface-soft: #2d2b2a;
  --text: #b8ad98;
  --muted: #988f80;
  --faint: #7d7569;
  --heading: #c0b6a4;
  --line: #504945;
  --blue: #83a598;
  --cyan: #8ec07c;
  --purple: #b16286;
  --green: #b8bb26;
  --amber: #d79921;
  --glow: rgb(215 153 33 / 8%);
  --link-decoration: rgb(131 165 152 / 45%);
  --wordmark-hover: #f2e5bc;
  --serif: Georgia, "Times New Roman", serif;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color-scheme: dark;
}

[data-theme="tokyo-night"] {
  --bg: #24283b;
  --surface: #1f2335;
  --surface-soft: #1a1b2e;
  --text: #8088b0;
  --muted: #565f89;
  --faint: #3b4261;
  --heading: #7aa2f7;
  --line: #2f3549;
  --blue: #7aa2f7;
  --cyan: #7dcfff;
  --purple: #bb9af7;
  --green: #9ece6a;
  --amber: #e0af68;
  --glow: rgb(122 162 247 / 10%);
  --link-decoration: rgb(122 162 247 / 45%);
  --wordmark-hover: #a8c4ff;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 75% -15%, var(--glow), transparent 32rem),
    var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.65;
}

a {
  color: var(--blue);
  text-decoration-color: var(--link-decoration);
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--cyan);
  text-decoration-color: currentColor;
}

.shell {
  width: min(100% - 2.5rem, 70rem);
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  z-index: 10;
  top: 0.5rem;
  left: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: var(--text);
  color: var(--bg);
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: none;
}

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

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

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

.wordmark {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
}

.wordmark:hover {
  color: var(--wordmark-hover);
}

.wordmark-mark {
  color: var(--green);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.nav-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.nav-list a {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-decoration: none;
  text-transform: uppercase;
}

.nav-list a:hover,
.nav-list a[aria-current="page"] {
  color: var(--cyan);
}

.theme-toggle {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 10rem;
  background: var(--surface-soft);
  color: var(--muted);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
  border-color: var(--blue);
  color: var(--cyan);
}

.theme-swatch {
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--green) 50%, var(--blue) 50%);
}

.hero {
  max-width: 58rem;
  padding: 8rem 0 7rem;
}

.eyebrow {
  margin: 0 0 0.7rem;
  color: var(--green);
  font-size: 0.76rem;
  font-weight: 750;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  color: var(--heading);
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.12;
}

.hero h1 {
  max-width: 55rem;
  margin: 0;
  font-size: clamp(3rem, 8vw, 6.4rem);
  letter-spacing: -0.055em;
}

.hero h1 em {
  color: var(--purple);
  font-weight: 400;
}

.hero-copy {
  max-width: 43rem;
  margin: 2rem 0 0;
  color: var(--muted);
  font-family: var(--serif);
  font-size: clamp(1.15rem, 2vw, 1.45rem);
}

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

.button {
  display: inline-block;
  padding: 0.62rem 1rem;
  border: 1px solid var(--blue);
  border-radius: 0.2rem;
  background: var(--blue);
  color: var(--bg);
  font-size: 0.86rem;
  font-weight: 750;
  text-decoration: none;
}

.button:hover {
  background: var(--cyan);
  color: var(--bg);
}

.button-secondary {
  background: transparent;
  color: var(--blue);
}

.text-link {
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
}

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

.section-heading {
  margin-bottom: 1.5rem;
}

.section-heading h2,
.topic-callout h2 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3rem);
}

.writing-list {
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
  list-style: none;
}

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

.writing-list article {
  display: grid;
  grid-template-columns: 11rem minmax(0, 1fr);
  gap: 2rem;
  padding: 1.8rem 0;
}

.list-date {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  color: var(--muted);
  font-size: 0.78rem;
}

.list-date span {
  color: var(--faint);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.writing-list h2 {
  margin: 0;
  font-size: clamp(1.35rem, 3vw, 1.8rem);
}

.writing-list h2 a {
  color: var(--heading);
  text-decoration: none;
}

.writing-list h2 a:hover {
  color: var(--cyan);
}

.writing-list p {
  max-width: 45rem;
  margin: 0.45rem 0 0;
  color: var(--muted);
}

.topic-callout {
  display: grid;
  grid-template-columns: 1.2fr 1fr auto;
  align-items: center;
  gap: 2.5rem;
  margin: 2rem 0 6rem;
  padding: 2.5rem;
  border: 1px solid var(--line);
  background: var(--surface-soft);
}

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

.page-header,
.post-header {
  max-width: 52rem;
  padding: 6.5rem 0 3.5rem;
}

.page-header h1,
.post-header h1 {
  margin: 0;
  font-size: clamp(3rem, 8vw, 5rem);
  letter-spacing: -0.045em;
}

.page-header > p:last-child,
.dek {
  max-width: 44rem;
  margin: 1.2rem 0 0;
  color: var(--muted);
  font-family: var(--serif);
  font-size: 1.25rem;
}

.post {
  max-width: 48rem;
  margin-inline: auto;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.4rem;
  margin-top: 1.5rem;
  color: var(--faint);
  font-size: 0.82rem;
}

.post-meta a {
  color: var(--muted);
}

.prose {
  color: var(--text);
  font-family: var(--serif);
  font-size: clamp(1.08rem, 2vw, 1.22rem);
  line-height: 1.82;
}

.prose h1,
.prose h2,
.prose h3 {
  margin-top: 2.5em;
}

.prose a {
  text-decoration-thickness: 1px;
}

.prose blockquote {
  margin-inline: 0;
  padding-left: 1.4rem;
  border-left: 2px solid var(--purple);
  color: var(--muted);
}

.prose code {
  padding: 0.1em 0.3em;
  background: var(--surface);
  color: var(--cyan);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.84em;
}

.page {
  max-width: 48rem;
  min-height: 60vh;
  padding: 4rem 0 6rem;
}

.page h1 {
  margin-top: 0;
  font-size: clamp(3rem, 8vw, 5rem);
}

.post-topics {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 4rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  font-size: 0.8rem;
}

.post-topics span {
  color: var(--muted);
  font-weight: 700;
}

.post-topics a {
  padding: 0.1rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 10rem;
  text-decoration: none;
}

.after-post {
  display: flex;
  justify-content: space-between;
  max-width: 48rem;
  margin: 4rem auto 6rem;
  padding: 1.5rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-size: 0.86rem;
  font-weight: 700;
}

.topic-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin: 0 0 6rem;
  padding: 0;
  list-style: none;
}

.topic-grid a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  min-height: 5rem;
  padding: 1.2rem;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--text);
  font-family: var(--serif);
  font-size: 1.25rem;
  text-decoration: none;
}

.topic-grid a:hover {
  border-color: var(--blue);
  color: var(--cyan);
}

.topic-grid small {
  color: var(--faint);
  font-family: var(--sans);
  font-size: 0.72rem;
}

.site-footer {
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 0.8rem;
}

.footer-inner {
  min-height: 6rem;
}

.footer-inner a {
  color: var(--muted);
}

@media (max-width: 760px) {
  .header-inner {
    display: block;
    padding-block: 1.2rem;
  }

  .header-actions {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.8rem;
    margin-top: 1rem;
  }

  .hero {
    padding: 5rem 0;
  }

  .writing-list article,
  .topic-callout {
    grid-template-columns: 1fr;
    gap: 0.7rem;
  }

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

@media (max-width: 480px) {
  .shell {
    width: min(100% - 1.5rem, 70rem);
  }

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

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

  .footer-inner {
    justify-content: center;
    gap: 0;
  }
}
