:root {
  --bg: #f4f7f4;
  --surface: #fcfdf9;
  --surface-strong: #e8eee9;
  --text: #1e2428;
  --muted: #687176;
  --line: #dfd8cb;
  --accent: #315c50;
  --accent-strong: #193d36;
  --accent-soft: #dfeae5;
  --warm: #b86d3c;
  --shadow: 0 24px 70px rgba(50, 47, 40, 0.13);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #171a1a;
  --surface: #222625;
  --surface-strong: #2b302f;
  --text: #f3efe7;
  --muted: #b2b9b5;
  --line: #3b403f;
  --accent: #8cc0ae;
  --accent-strong: #d5f0e4;
  --accent-soft: #263934;
  --warm: #d99a62;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.26);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  overflow-x: hidden;
  background:
    linear-gradient(135deg, rgba(49, 92, 80, 0.08), transparent 46%),
    linear-gradient(180deg, var(--bg), var(--surface-strong));
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

.site-shell {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 84px;
  gap: 24px;
}

.brand,
.nav-links,
.hero-actions {
  display: flex;
  align-items: center;
}

.brand {
  gap: 12px;
  font-weight: 800;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--accent-strong);
  box-shadow: 0 10px 30px rgba(25, 61, 54, 0.08);
}

.nav-links {
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 78%, transparent);
  backdrop-filter: blur(14px);
}

.nav-links a {
  min-width: 58px;
  padding: 9px 14px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  text-align: center;
}

.nav-links a:hover {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.62fr);
  align-items: stretch;
  gap: 24px;
  min-height: calc(100vh - 118px);
  padding: 30px 0 72px;
}

.profile-panel,
.post-card {
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  box-shadow: var(--shadow);
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 560px;
  padding: clamp(28px, 6vw, 64px) clamp(4px, 4vw, 28px);
}

.eyebrow,
.panel-kicker,
.post-meta {
  margin: 0;
  color: var(--warm);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  max-width: 820px;
  margin: 16px 0 0;
  font-family: "Noto Serif SC", serif;
  font-size: clamp(42px, 6vw, 74px);
  line-height: 1.06;
  letter-spacing: 0;
}

.hero-intro {
  max-width: 660px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.85;
}

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

.button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--accent-strong);
  border-radius: 999px;
  padding: 0 20px;
  font-weight: 800;
}

.button.primary {
  background: var(--accent-strong);
  color: var(--surface);
}

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

.profile-panel {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 32px;
  min-height: 560px;
  padding: 28px;
  border-radius: 8px;
}

.portrait {
  display: grid;
  min-height: 260px;
  place-items: center;
  border-radius: 6px;
  background:
    linear-gradient(135deg, rgba(49, 92, 80, 0.92), rgba(184, 109, 60, 0.82)),
    url("https://images.unsplash.com/photo-1499750310107-5fef28a66643?auto=format&fit=crop&w=900&q=80");
  background-position: center;
  background-size: cover;
  overflow: hidden;
}

.portrait-inner {
  display: grid;
  width: 96px;
  height: 96px;
  place-items: center;
  border: 1px solid rgba(255, 253, 248, 0.52);
  border-radius: 50%;
  background: rgba(255, 253, 248, 0.18);
  color: #fffdf8;
  font-size: 42px;
  font-weight: 800;
  backdrop-filter: blur(10px);
}

.section-heading h2,
.feature-band h2,
.about-strip h2 {
  margin: 10px 0 0;
  font-family: "Noto Serif SC", serif;
  font-size: clamp(28px, 3vw, 40px);
  line-height: 1.25;
  letter-spacing: 0;
}

.profile-panel h2 {
  margin: 10px 0 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: clamp(30px, 3.1vw, 42px);
  line-height: 1.14;
  letter-spacing: 0;
}

.profile-panel p,
.post-card p,
.project-row p,
.about-strip p {
  color: var(--muted);
  line-height: 1.75;
}

.section-grid {
  display: grid;
  grid-template-columns: 0.38fr 1fr;
  gap: 24px;
  padding: 0 0 28px;
}

.section-heading {
  padding-top: 18px;
}

.post-list {
  display: grid;
  gap: 14px;
}

.post-card {
  display: grid;
  grid-template-columns: minmax(0, 0.68fr) minmax(220px, 0.32fr);
  gap: 24px;
  align-items: start;
  padding: 24px;
  border-radius: 8px;
}

.post-card h3,
.project-row h3 {
  margin: 8px 0 0;
  font-size: 22px;
  line-height: 1.35;
  letter-spacing: 0;
}

.post-card p {
  margin: 0;
}

.feature-band {
  margin: 44px 0 24px;
  padding: 34px 0;
}

.project-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin-top: 28px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.project-row a {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 210px;
  padding: 22px;
  background: var(--surface);
  transition:
    background-color 160ms ease,
    transform 160ms ease;
}

.project-row a:hover {
  background: var(--accent-soft);
  transform: translateY(-2px);
}

.project-row span {
  color: var(--warm);
  font-weight: 800;
}

.project-row strong {
  margin-top: 18px;
  color: var(--accent-strong);
  font-size: 14px;
}

.about-strip {
  display: grid;
  grid-template-columns: 0.42fr 1fr;
  gap: 28px;
  align-items: start;
  margin: 0 0 56px;
  padding: 34px 0;
}

.about-strip > p {
  margin: 0;
  font-size: 17px;
}

.theme-toggle {
  position: fixed;
  right: 20px;
  bottom: 20px;
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
  cursor: pointer;
}

.theme-toggle:hover {
  border-color: var(--accent);
}

@media (max-width: 880px) {
  .site-shell {
    width: min(100% - 28px, 720px);
  }

  .topbar,
  .section-grid,
  .about-strip {
    grid-template-columns: 1fr;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
    padding: 18px 0 8px;
  }

  .nav-links {
    align-self: center;
    width: calc(100% - 20px);
    justify-content: space-between;
    min-width: 0;
    overflow: hidden;
  }

  .nav-links a {
    flex: 1;
    min-width: 0;
    padding-right: 8px;
    padding-left: 8px;
    font-size: 13px;
  }

  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding-top: 18px;
  }

  .hero-copy,
  .profile-panel {
    min-height: auto;
  }

  .post-card,
  .project-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .site-shell {
    width: min(calc(100% - 56px), 420px);
  }

  .hero-copy,
  .profile-panel,
  .feature-band,
  .about-strip {
    padding: 22px;
  }

  h1 {
    max-width: 9em;
    font-size: clamp(30px, 8.2vw, 32px);
    line-height: 1.12;
    word-break: break-all;
  }

  .hero-intro {
    max-width: 19em;
    font-size: 16px;
  }

  .button {
    width: 100%;
  }

  .theme-toggle {
    right: 14px;
    bottom: 14px;
  }
}
