:root {
  --bg: #fbfbfb;
  --surface: rgba(0, 0, 0, 0.03);
  --text: #171717;
  --muted: rgba(23, 23, 23, 0.72);
  --border: rgba(23, 23, 23, 0.12);
  --shadow: rgba(0, 0, 0, 0.12);

  --accent: #ff4d2e;
  --accent-soft: rgba(255, 77, 46, 0.18);
  --link: #3e8fb8;

  --font-sans: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-serif: "IBM Plex Serif", ui-serif, Georgia, "Times New Roman", serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

  --content-max: 72ch;
  --radius: 18px;
  --footer-offset: 72px;
}

[data-theme="dark"] {
  --bg: #0d0f12;
  --surface: rgba(255, 255, 255, 0.06);
  --text: #f2f4f7;
  --muted: rgba(242, 244, 247, 0.72);
  --border: rgba(242, 244, 247, 0.16);
  --shadow: rgba(0, 0, 0, 0.5);

  --accent: #ffb454;
  --accent-soft: rgba(255, 180, 84, 0.18);
  --link: #8fd3ec;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
}

.skip-link {
  position: absolute;
  left: -999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
  width: auto;
  height: auto;
  padding: 0.5rem 0.75rem;
  border-radius: 999px;
  background: var(--surface);
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  z-index: 999;
}

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

.site {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.main {
  flex: 1 0 auto;
  width: 100%;
  padding: 0 1rem var(--footer-offset);
  display: flex;
  justify-content: center;
}

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

a:hover,
a:focus-visible {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.prose a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--link) 55%, transparent);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.16em;
}

.prose a:hover,
.prose a:focus-visible {
  color: var(--accent);
  text-decoration-color: currentColor;
  text-decoration-thickness: 2px;
}

.header {
  border-bottom: 0;
  padding: 0.6rem 1rem;
}

.nav {
  max-width: min(90vw, var(--content-max));
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.nav-home {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
  text-decoration: none;
  position: relative;
  padding: 0.25rem 0.1rem;
  border-radius: 12px;
}

.nav-home:hover,
.nav-home:focus-visible {
  background: var(--surface);
  text-decoration: none;
}

.nav-link {
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  position: relative;
  padding: 0.25rem 0.1rem;
}

.nav-link.is-active {
  color: var(--text);
}

.nav-link.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.35rem;
  height: 2px;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--accent), transparent);
}

.nav-home.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.35rem;
  height: 2px;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--accent), transparent);
}

.theme-toggle {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  border-radius: 999px;
  width: 34px;
  height: 34px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.theme-toggle:hover {
  background: var(--surface);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.theme-icon {
  display: none;
}

[data-theme="light"] .theme-icon--moon {
  display: block;
}

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

.footer {
  border-top: 1px solid var(--border);
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  background: var(--bg);
  padding: 0.6rem 1rem calc(0.6rem + env(safe-area-inset-bottom));
}

.footer-inner {
  max-width: min(90vw, var(--content-max));
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.footer-copy {
  color: var(--muted);
  font-size: 0.9rem;
}

.social {
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
}

.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  color: var(--muted);
}

.social-link:hover,
.social-link:focus-visible {
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
}

.hero {
  width: 100%;
  max-width: var(--content-max);
  padding: 2.3rem 0 2.7rem;
  display: grid;
  place-items: center;
}

.hero-card {
  width: 100%;
  max-width: 44rem;
  padding: 1.95rem 1.35rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: radial-gradient(circle at 18% 20%, var(--accent-soft), transparent 60%),
    radial-gradient(circle at 85% 30%, rgba(0, 0, 0, 0.04), transparent 55%);
}

[data-theme="dark"] .hero-card {
  background: radial-gradient(circle at 18% 20%, var(--accent-soft), transparent 60%),
    radial-gradient(circle at 85% 30%, rgba(255, 255, 255, 0.04), transparent 55%);
}

.hero-avatar {
  display: flex;
  justify-content: center;
  margin-bottom: 0.8rem;
}

.hero-avatar img {
  width: 160px;
  height: 160px;
  border-radius: 999px;
  object-fit: cover;
  border: 1px solid var(--border);
  box-shadow: 0 10px 30px var(--shadow);
}

.hero-title {
  font-family: var(--font-serif);
  margin: 0;
  text-align: center;
  letter-spacing: -0.02em;
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
}

.hero-title::after {
  content: " ✦";
  color: var(--accent);
}

.hero-card > .hero-tagline {
  margin: 0 auto 0.55rem;
  text-align: center;
  color: var(--text);
  max-width: 44ch;
  font-size: 1rem;
  opacity: 0.9;
}

.hero-card > .hero-title + .hero-tagline {
  margin-top: 0.75rem;
}

.hero-card > .hero-tagline:last-of-type {
  margin-bottom: 1.85rem;
}

.hero-card > .hero-tagline--work {
  max-width: none;
  font-size: 1.05rem;
  color: var(--text);
  opacity: 0.9;
  margin-bottom: 0.9rem;
}

.hero-topics {
  margin: 0;
  display: grid;
  gap: 0.95rem;
}

.hero-topic-group--work {
  width: fit-content;
  max-width: 100%;
  justify-self: center;
}

.hero-kicker {
  margin: 0 0 0.6rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.chips-stack {
  display: grid;
  gap: 0.4rem;
}

.chips-stack--hero {
  justify-items: center;
}

.chips--hero {
  justify-content: center;
}

.chips--topics {
  justify-content: flex-start;
  margin: 0.75rem 0 0.9rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.28rem 0.56rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.84rem;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.chip:hover,
.chip:focus-visible {
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  transform: translateY(-1px);
}

.chip.is-active {
  color: var(--text);
  border-color: transparent;
  background: radial-gradient(circle at 30% 30%, var(--accent-soft), transparent 65%), var(--surface);
}

.chip--static {
  cursor: default;
}

.chip--static:hover,
.chip--static:focus-visible {
  background: transparent;
  color: var(--muted);
  transform: none;
}

.page,
.post,
.posts {
  width: 100%;
  max-width: var(--content-max);
  padding: 2rem 0 3rem;
}

.page-header,
.post-header {
  margin-bottom: 1.5rem;
}

.page-title,
.post-title {
  font-family: var(--font-serif);
  margin: 0 0 0.5rem;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.post-title {
  font-size: clamp(2rem, 4vw, 2.75rem);
}

.page-subtitle {
  margin: 0;
  color: var(--muted);
}

.page-subtitle--lede {
  color: var(--text);
  font-family: var(--font-serif);
  font-size: 1.3rem;
  letter-spacing: -0.02em;
  line-height: 1.35;
  opacity: 0.9;
  max-width: 60ch;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.post-meta__sep {
  opacity: 0.6;
}

.post-topic {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.85rem;
  line-height: 1.4;
}

.post-topic:hover,
.post-topic:focus-visible {
  color: var(--text);
  background: var(--surface);
  text-decoration: none;
}

.post-topic--static {
  cursor: default;
}

.post-topic--static:hover,
.post-topic--static:focus-visible {
  color: var(--muted);
  background: transparent;
}

.post-list {
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
}

.post-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.1rem;
  background: rgba(255, 255, 255, 0.02);
}

.post-card__title {
  margin: 0 0 0.4rem;
  font-family: var(--font-serif);
  letter-spacing: -0.01em;
  font-size: 1.65rem;
  line-height: 1.16;
}

.post-card__excerpt {
  margin: 0.75rem 0 0.9rem;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.post-card__more {
  color: var(--accent);
  font-weight: 600;
}

.prose {
  font-size: 1.05rem;
  overflow-wrap: break-word;
}

.prose img,
.prose video {
  max-width: 100%;
  height: auto;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.prose th,
.prose td {
  border: 1px solid var(--border);
  padding: 0.5rem 0.6rem;
}

.prose th {
  text-align: left;
  background: var(--surface);
}

.prose h1,
.prose h2,
.prose h3,
.prose h4 {
  font-family: var(--font-serif);
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  letter-spacing: -0.01em;
}

.prose h1 {
  font-size: clamp(1.5rem, 2.6vw, 1.9rem);
  line-height: 1.25;
}

.prose > h1:first-child {
  margin-top: 0;
}

.prose p {
  margin: 0 0 1.1rem;
}

.prose strong {
  font-weight: 650;
}

.prose strong em,
.prose em strong {
  font-style: italic;
  font-weight: 600;
  color: color-mix(in srgb, var(--text) 88%, var(--accent) 12%);
}

.prose code {
  font-family: var(--font-mono);
  font-size: 0.95em;
  padding: 0.15em 0.35em;
  border-radius: 0.4em;
  background: var(--surface);
  border: 1px solid var(--border);
}

.prose pre {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 1rem;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
}

.prose pre code {
  background: transparent;
  border: 0;
  padding: 0;
}

.prose blockquote {
  margin: 1.25rem 0;
  padding: 0.9rem 1rem;
  border-left: 3px solid var(--accent);
  background: var(--surface);
  border-radius: 12px;
  color: var(--muted);
  font-size: 0.95rem;
}

.prose ul,
.prose ol {
  margin: 0 0 1.1rem 1.25rem;
  padding: 0;
}

.prose li::marker {
  color: var(--accent);
}

.about-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
  align-items: start;
  margin: 1.25rem 0 1.6rem;
}

.about-column h3 {
  margin: 0 0 0.6rem;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}

@media (max-width: 720px) {
  .about-columns {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 540px) {
  :root {
    --footer-offset: 128px;
  }

  .nav {
    gap: 0.5rem;
  }

  .nav-link {
    font-size: 0.95rem;
  }

  .nav-home {
    font-size: 0.95rem;
  }

  .theme-toggle {
    width: 34px;
    height: 34px;
  }

  .hero {
    padding: 2.1rem 0 2.5rem;
  }

  .hero-card {
    padding: 1.75rem 1.1rem;
  }

  .hero-avatar img {
    width: 144px;
    height: 144px;
  }

  .page,
  .post,
  .posts {
    padding: 1.6rem 0 2.4rem;
  }

  .post-card {
    padding: 1.1rem 1rem;
  }

  .prose {
    font-size: 1rem;
  }

  .page-subtitle--lede {
    font-size: 1.15rem;
  }

  .footer-inner {
    flex-wrap: wrap;
    justify-content: center;
  }

  .footer-copy {
    width: 100%;
    text-align: center;
  }
}
