:root {
  color-scheme: light;
  --bg: #fbfbf8;
  --surface: #ffffff;
  --surface-soft: #f3f7f4;
  --ink: #202124;
  --muted: #62666d;
  --line: #e6e3dc;
  --accent: #2563eb;
  --accent-strong: #1d4ed8;
  --shadow: 0 10px 28px rgba(32, 33, 36, 0.06);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

main {
  max-width: 1120px;
  margin: 0 auto;
}

a {
  color: inherit;
}

code,
pre {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  max-width: 1120px;
  margin: 0 auto;
  padding: 18px clamp(18px, 4vw, 32px);
  background: rgba(251, 251, 248, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  font-size: 0.85rem;
  letter-spacing: 0;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  color: var(--muted);
  font-size: 0.95rem;
}

.nav a {
  border-bottom: 2px solid transparent;
  text-decoration: none;
}

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

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.6fr);
  gap: clamp(28px, 6vw, 80px);
  min-height: calc(100vh - 76px);
  align-items: center;
  padding: clamp(56px, 8vw, 112px) clamp(18px, 6vw, 84px) 48px;
  background:
    linear-gradient(120deg, rgba(15, 118, 110, 0.1), transparent 38%),
    linear-gradient(320deg, rgba(180, 35, 90, 0.08), transparent 34%),
    var(--bg);
}

.hero-copy {
  max-width: 920px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  line-height: 1.08;
  margin: 0;
}

h1 {
  max-width: 950px;
  font-size: clamp(2.2rem, 5vw, 4.2rem);
}

h2 {
  font-size: clamp(1.35rem, 2.5vw, 2rem);
}

h3 {
  font-size: 1.2rem;
}

.hero-copy p:not(.eyebrow),
.section-heading p {
  max-width: 760px;
  color: var(--muted);
  font-size: 1.08rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 750;
  text-decoration: none;
}

.button.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: white;
}

.hero-panel {
  display: grid;
  gap: 14px;
}

.hero-panel > div,
.project-card,
.hosting-card,
.resume-block,
.post-card,
.post-viewer {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.hero-panel > div {
  padding: 22px;
}

.metric {
  display: block;
  color: var(--accent-strong);
  font-size: 2rem;
  font-weight: 850;
  line-height: 1;
}

.section {
  padding: clamp(36px, 6vw, 72px) clamp(18px, 4vw, 32px);
  border-top: 1px solid var(--line);
}

.page-hero {
  padding: clamp(38px, 7vw, 78px) clamp(18px, 4vw, 32px) clamp(22px, 5vw, 48px);
}

.page-hero h1 {
  max-width: 980px;
  font-size: clamp(2.2rem, 5vw, 4rem);
}

.page-hero p:not(.eyebrow) {
  max-width: 760px;
  color: var(--muted);
  font-size: 1.08rem;
}

.section-heading {
  margin-bottom: 28px;
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.preview-card {
  display: grid;
  gap: 14px;
  min-height: 260px;
  align-content: end;
  padding: clamp(22px, 4vw, 36px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  text-decoration: none;
}

.preview-card h2 {
  font-size: clamp(1.7rem, 3vw, 2.8rem);
}

.preview-card p:not(.eyebrow) {
  color: var(--muted);
  margin: 0;
}

.project-grid,
.hosting-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.project-card,
.hosting-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 22px;
}

.project-card p,
.hosting-card p,
.post-card p,
.resume-block p {
  color: var(--muted);
  margin: 0;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 9px;
  background: var(--surface-soft);
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 750;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: auto;
}

.card-actions a {
  color: var(--accent-strong);
  font-weight: 800;
  text-decoration: none;
}

.split {
  display: grid;
  grid-template-columns: minmax(220px, 0.34fr) minmax(0, 1fr);
  gap: clamp(24px, 5vw, 72px);
  align-items: start;
}

.sticky-heading {
  position: sticky;
  top: 96px;
}

.resume-content {
  display: grid;
  gap: 16px;
}

.resume-block {
  padding: 20px;
}

.markdown-page h1 {
  font-size: clamp(2rem, 4vw, 3.6rem);
}

.markdown-page h2 {
  margin-top: 1.4em;
  padding-top: 0.8em;
  border-top: 1px solid var(--line);
  font-size: clamp(1.4rem, 2.4vw, 2rem);
}

.markdown-page h3 {
  margin-top: 1.2em;
}

.resume-block ul {
  padding-left: 20px;
}

.writing-shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.filters {
  position: sticky;
  top: 96px;
  display: grid;
  gap: 10px;
}

.filter-button,
select {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}

.filter-button {
  cursor: pointer;
  text-align: left;
  padding: 8px 12px;
}

.filter-button.active {
  border-color: var(--accent);
  background: var(--accent);
  color: white;
}

.filters label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.9rem;
}

.post-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.post-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
}

.post-card .button {
  align-self: flex-start;
  margin-top: 14px;
}

.article-shell {
  max-width: 980px;
  margin: 0 auto;
}

.back-link {
  display: inline-flex;
  margin-bottom: 18px;
  color: var(--accent-strong);
  font-weight: 800;
  text-decoration: none;
}

.post-viewer {
  padding: clamp(18px, 4vw, 38px);
}

.post-viewer h1,
.post-viewer h2,
.post-viewer h3 {
  margin-top: 1.2em;
}

.post-viewer pre {
  overflow-x: auto;
  border-radius: 8px;
  padding: 16px;
  background: #111827;
  color: #e5e7eb;
}

.post-viewer blockquote {
  margin-left: 0;
  padding-left: 16px;
  border-left: 4px solid var(--accent);
  color: var(--muted);
}

.toc {
  margin: 16px 0 26px;
  padding: 14px;
  border-radius: 8px;
  background: var(--surface-soft);
}

.toc a {
  display: inline-flex;
  margin: 4px 12px 4px 0;
  color: var(--accent-strong);
  font-weight: 700;
  text-decoration: none;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  max-width: 1120px;
  margin: 0 auto;
  padding: 28px clamp(18px, 4vw, 32px);
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.profile-hero {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: clamp(26px, 6vw, 58px);
  align-items: start;
  padding: clamp(42px, 8vw, 86px) clamp(18px, 4vw, 32px) clamp(28px, 5vw, 52px);
}

.profile-photo {
  width: min(220px, 54vw);
  aspect-ratio: 1;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  object-fit: cover;
  box-shadow: var(--shadow);
}

.profile-copy h1 {
  margin-bottom: 8px;
  font-size: clamp(2.1rem, 5vw, 4rem);
}

.profile-role,
.profile-location {
  margin: 0;
  color: var(--muted);
}

.profile-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 14px 0 26px;
}

.profile-links a,
.section-row a,
.plain-list a {
  color: var(--accent-strong);
  font-weight: 750;
  text-decoration: none;
}

.home-sections {
  display: grid;
  gap: 28px;
  padding: 0 clamp(18px, 4vw, 32px) clamp(52px, 8vw, 96px);
}

.home-block {
  border-top: 1px solid var(--line);
  padding-top: 22px;
}

.home-block h2 {
  margin-bottom: 14px;
}

.home-block h3 {
  margin-top: 12px;
}

.section-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
}

.plain-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.plain-list li {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 18px;
}

.plain-list span {
  color: var(--muted);
  font-size: 0.92rem;
}

.skills-block ul {
  columns: 2;
}

@media (max-width: 920px) {
  .hero,
  .split,
  .writing-shell,
  .profile-hero {
    grid-template-columns: 1fr;
  }

  .project-grid,
  .hosting-grid,
  .post-list,
  .preview-grid {
    grid-template-columns: 1fr;
  }

  .sticky-heading,
  .filters {
    position: static;
  }

  .plain-list li {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}

@media (max-width: 640px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav {
    width: 100%;
  }

  .footer {
    flex-direction: column;
  }
}
