@charset "UTF-8";

:root {
  color-scheme: light;
  --background: #f6f8f6;
  --surface: #ffffff;
  --text: #172b22;
  --muted: #3e5347;
  --subtle: #516558;
  --accent: #14634e;
  --accent-soft: #e8f1eb;
  --border: #d2ded5;
  --hover-border: #839f8c;
  --control-border: #85988b;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --background: #111917;
    --surface: #19241f;
    --text: #f1f6f3;
    --muted: #d0dbd5;
    --subtle: #b6c5bc;
    --accent: #a3dfc9;
    --accent-soft: #233a2e;
    --border: #3b5144;
    --hover-border: #8eb49c;
    --control-border: #789381;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --background: #111917;
  --surface: #19241f;
  --text: #f1f6f3;
  --muted: #d0dbd5;
  --subtle: #b6c5bc;
  --accent: #a3dfc9;
  --accent-soft: #233a2e;
  --border: #3b5144;
  --hover-border: #8eb49c;
  --control-border: #789381;
}

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

html {
  scroll-padding-top: 28px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--background);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: inherit;
  text-decoration: none;
  text-underline-offset: 5px;
}

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

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

button {
  font: inherit;
}

[hidden] {
  display: none !important;
}

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

.container {
  width: min(100% - 64px, 1180px);
  margin-inline: auto;
}

.accent {
  color: var(--accent);
}

.skip-link {
  position: fixed;
  z-index: 10;
  top: 12px;
  left: 16px;
  padding: 10px 18px;
  border-radius: 5px;
  color: var(--background);
  background: var(--accent);
  transform: translateY(-160%);
}

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

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

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

.wordmark {
  font-size: 24px;
  font-weight: 650;
  letter-spacing: -1px;
}

.wordmark span {
  color: var(--accent);
}

.header-actions,
.profile-links {
  display: flex;
  align-items: center;
}

.header-actions {
  gap: 28px;
}

.profile-links {
  gap: 26px;
  color: var(--muted);
  font-size: 14px;
}

.profile-links a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 6px;
}

.theme-toggle {
  display: inline-flex;
  min-width: 106px;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 7px 12px;
  border: 1px solid var(--control-border);
  border-radius: 7px;
  color: var(--text);
  background: var(--surface);
  font-size: 13px;
  cursor: pointer;
}

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

.theme-icon {
  display: none;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

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

.intro {
  padding-block: 49px 42px;
}

h1 {
  font-size: clamp(42px, 4.8vw, 60px);
  font-weight: 650;
  letter-spacing: -2.2px;
  line-height: 1.15;
}

.intro-lead {
  max-width: 850px;
  margin-top: 15px;
  font-size: 23px;
  font-weight: 450;
  letter-spacing: -0.4px;
  line-height: 1.5;
}

.intro-copy {
  max-width: 890px;
  margin-top: 15px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.8;
}

.skills {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin: 20px 0 0;
  padding: 0;
  color: var(--subtle);
  font-size: 14px;
  list-style: none;
}

.skills li + li::before {
  margin-inline: 13px;
  color: var(--subtle);
  content: "·";
}

h2 {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.55px;
  line-height: 1.35;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
}

.subtle-link {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  font-size: 14px;
}

.subtle-link:hover {
  text-decoration: underline;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.project-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 24px 24px 16px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface);
}

.project-card:hover {
  border-color: var(--hover-border);
}

.project-category {
  margin-bottom: 8px;
  color: var(--subtle);
  font-size: 13px;
  line-height: 1.5;
}

.project-card h3 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.55px;
  line-height: 1.35;
}

.project-description {
  max-width: 65ch;
  margin-top: 13px;
  color: var(--muted);
  font-size: 15.5px;
  line-height: 1.8;
}

.project-tech {
  margin-block: 20px 17px;
  color: var(--subtle);
  font-size: 13px;
  line-height: 1.8;
}

.project-tech span {
  margin-inline: 4px;
}

.project-links {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.project-links a {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  gap: 6px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 500;
}

.project-links a:hover,
.email-link:hover {
  text-decoration: underline;
}

.background-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-top: 32px;
}

.background-panel {
  min-width: 0;
  padding: 26px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface);
}

.background-panel h2 {
  margin-bottom: 25px;
}

.entry + .entry {
  margin-top: 23px;
  padding-top: 23px;
  border-top: 1px solid var(--border);
}

.entry-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 16px;
}

.entry h3 {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.25px;
  line-height: 1.5;
}

.entry-date {
  color: var(--subtle);
  font-size: 13px;
  line-height: 1.7;
}

.entry-role {
  margin-top: 5px;
  color: var(--text);
  font-size: 15px;
  line-height: 1.7;
}

.entry-detail {
  margin-top: 10px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.8;
}

.community-section {
  display: grid;
  grid-template-columns: 0.85fr 1.45fr;
  align-items: start;
  gap: 45px;
  margin-top: 32px;
  padding: 30px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--accent-soft);
}

.community-heading h2 {
  max-width: 300px;
}

.community-heading h3 {
  margin-top: 18px;
  font-size: 17px;
  font-weight: 550;
  line-height: 1.6;
}

.community-heading p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 14px;
}

.community-content {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.85;
}

.community-content p + p {
  margin-top: 15px;
}

.site-footer {
  margin-top: 40px;
  border-top: 1px solid var(--border);
}

.footer-contact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  padding-block: 30px;
}

.footer-contact h2 {
  font-size: 22px;
}

.footer-contact p {
  margin-top: 7px;
  color: var(--muted);
  font-size: 15px;
}

.email-link {
  display: inline-flex;
  min-height: 44px;
  flex-shrink: 0;
  align-items: center;
  gap: 10px;
  color: var(--accent);
  font-size: 19px;
  font-weight: 500;
}

.footer-meta {
  display: flex;
  min-height: 74px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid var(--border);
  color: var(--subtle);
  font-size: 13px;
}

.footer-meta a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 8px;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }

  a,
  button,
  .project-card {
    transition: color 150ms ease, background-color 150ms ease, border-color 150ms ease;
  }
}

@media (max-width: 1080px) {
  .project-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .project-card:last-child {
    grid-column: 1 / -1;
  }

  .project-card:last-child .project-description {
    max-width: 80ch;
  }

  .community-section {
    grid-template-columns: 0.85fr 1.4fr;
    gap: 30px;
  }
}

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

  .community-section {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .community-heading h2 {
    max-width: none;
  }

  .community-heading h3 {
    margin-top: 14px;
  }

  .footer-contact {
    align-items: flex-start;
    flex-direction: column;
    gap: 17px;
  }
}

@media (max-width: 660px) {
  .container {
    width: calc(100% - 40px);
  }

  .header-inner {
    min-height: 68px;
    gap: 16px;
  }

  .wordmark {
    font-size: 22px;
  }

  .header-actions {
    gap: 15px;
  }

  .profile-links {
    gap: 15px;
    font-size: 13px;
  }

  .theme-toggle {
    min-width: 94px;
    min-height: 40px;
    gap: 7px;
    padding-inline: 9px;
    font-size: 12px;
  }

  .intro {
    padding-block: 34px 31px;
  }

  h1 {
    font-size: 43px;
    letter-spacing: -1.7px;
  }

  .intro-lead {
    margin-top: 14px;
    font-size: 21px;
    line-height: 1.5;
  }

  .intro-copy {
    margin-top: 14px;
    font-size: 16px;
    line-height: 1.8;
  }

  .skills {
    margin-top: 18px;
    font-size: 13px;
  }

  .skills li + li::before {
    margin-inline: 10px;
  }

  h2 {
    font-size: 23px;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
    margin-bottom: 16px;
  }

  .subtle-link {
    font-size: 14px;
  }

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

  .project-card:last-child {
    grid-column: auto;
  }

  .project-card {
    padding: 22px 22px 14px;
  }

  .project-card h3 {
    font-size: 22px;
  }

  .project-description {
    font-size: 16px;
    line-height: 1.75;
  }

  .project-tech {
    margin-block: 18px 15px;
    font-size: 13px;
  }

  .background-grid {
    gap: 18px;
    margin-top: 26px;
  }

  .background-panel {
    padding: 23px 22px;
  }

  .entry-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  .entry-role {
    margin-top: 7px;
  }

  .entry-detail {
    font-size: 15.5px;
    line-height: 1.8;
  }

  .community-section {
    gap: 20px;
    margin-top: 26px;
    padding: 23px 22px;
  }

  .community-content {
    font-size: 16px;
    line-height: 1.8;
  }

  .site-footer {
    margin-top: 30px;
  }

  .footer-contact {
    padding-block: 26px;
  }

  .footer-meta {
    min-height: 72px;
    gap: 12px;
    font-size: 12px;
  }

  .email-link {
    font-size: 18px;
  }
}

@media (max-width: 380px) {
  .header-actions {
    gap: 13px;
  }

  .profile-links {
    gap: 13px;
  }

  .theme-toggle {
    min-width: 40px;
    padding-inline: 10px;
  }

  #theme-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .project-card,
  .background-panel,
  .community-section {
    padding-inline: 18px;
  }
}
