:root {
  color-scheme: light;
  --bg: #f8f9fb;
  --header: #ffffff;
  --panel: #ffffff;
  --panel-soft: #f1f5f9;
  --project-panel: #e0f2fe;
  --text: #111111;
  --heading: #0f172a;
  --muted: #334155;
  --soft-muted: #475569;
  --line: #e2e8f0;
  --project-line: #bae6fd;
  --accent: #3b82f6;
  --accent-link: #2563eb;
  --button: #0f172a;
  --button-hover: #1e293b;
  --footer: #171717;
  --shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
}

:root.dark {
  color-scheme: dark;
  --bg: #1a1a1a;
  --header: #1a1a1a;
  --panel: #1f2733;
  --panel-soft: #2e333a;
  --project-panel: #1f2733;
  --text: #e5e7eb;
  --heading: #f8fafc;
  --muted: #cbd5e1;
  --soft-muted: #94a3b8;
  --line: #2a2a2a;
  --project-line: #2a2a2a;
  --accent: #14b8a6;
  --accent-link: #38bdf8;
  --button: #3b82f6;
  --button-hover: #2563eb;
  --footer: #1a1a1a;
  --shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-width: 320px;
  min-height: 100%;
}

html {
  background: var(--bg);
  transition: background-color 300ms linear;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  transition: background-color 300ms ease, color 300ms ease;
}

a {
  color: inherit;
}

code {
  padding: 0.12rem 0.32rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-soft);
  color: var(--heading);
  font-size: 0.92em;
}

.site-header {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 10;
  min-height: 50px;
  background: var(--header);
  color: var(--text);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.13);
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  min-height: 58px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0.45rem clamp(1rem, 4vw, 2.5rem);
}

.brand {
  display: inline-flex;
  align-items: center;
  min-height: 2.6rem;
  padding: 0.45rem 0.75rem;
  border-radius: 8px;
  color: var(--text);
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
}

.brand:hover,
.nav-link:hover,
.theme-toggle:hover {
  background: rgba(148, 163, 184, 0.13);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  min-height: 2.5rem;
  padding: 0.45rem 0.75rem;
  border-radius: 8px;
  color: var(--text);
  font-size: 0.98rem;
  font-weight: 650;
  text-decoration: none;
}

.theme-toggle {
  display: inline-grid;
  width: 2.5rem;
  height: 2.5rem;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

.theme-toggle svg {
  grid-area: 1 / 1;
  width: 1.35rem;
  height: 1.35rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.icon-moon {
  display: none;
}

.dark .icon-sun {
  display: none;
}

.dark .icon-moon {
  display: block;
}

.page-shell {
  width: min(100%, 1180px);
  margin: 0 auto;
  padding: 0 clamp(1rem, 4vw, 2.5rem) 4rem;
}

.hero {
  display: grid;
  justify-items: center;
  padding-top: 8rem;
  text-align: center;
}

.avatar {
  width: 8rem;
  height: 8rem;
  object-fit: cover;
  border: 4px solid var(--accent);
  border-radius: 999px;
  box-shadow: var(--shadow);
}

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

h1 {
  margin: 1.25rem 0 0;
  color: var(--heading);
  font-size: clamp(3rem, 7vw, 5rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0;
}

.subtitle {
  margin: 1.25rem 0 0;
  color: var(--soft-muted);
  font-size: clamp(1.45rem, 4vw, 2.25rem);
  line-height: 1.2;
}

.about-panel {
  margin: 2rem clamp(0rem, 2vw, 2.5rem) 0;
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.about-panel h2,
.portfolio-heading h2,
.detail-section h2 {
  margin-bottom: 1rem;
  color: var(--heading);
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 750;
  line-height: 1.12;
}

.about-panel p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: clamp(1.05rem, 2vw, 1.25rem);
}

.portfolio-heading {
  display: grid;
  justify-items: center;
  gap: 0.35rem;
  margin: 2rem clamp(0rem, 2vw, 2.5rem) 0;
  text-align: center;
}

.portfolio-heading h2 {
  margin-bottom: 0;
  font-size: clamp(2.35rem, 5vw, 3.35rem);
}

.portfolio-heading p {
  margin: 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.8vw, 1.15rem);
  font-weight: 600;
  line-height: 1.45;
  text-align: center;
}

.portfolio-heading a,
.back-link {
  color: var(--accent-link);
  text-decoration: none;
}

.portfolio-heading a:hover,
.back-link:hover {
  text-decoration: underline;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 280px));
  justify-content: center;
  gap: 0.9rem;
  margin: 0.9rem clamp(0rem, 2vw, 2.5rem) 2.25rem;
  align-items: stretch;
}

.project-card {
  display: grid;
  align-content: stretch;
  overflow: hidden;
  min-height: 16rem;
  border: 1px solid var(--project-line);
  border-radius: 12px;
  background: var(--project-panel);
  color: var(--heading);
  box-shadow: var(--shadow);
  text-decoration: none;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.project-card:hover,
.project-card:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 16px 34px rgba(59, 130, 246, 0.18);
  transform: translateY(-2px);
}

.project-card:focus-visible,
.project-button:focus-visible,
.back-link:focus-visible,
.project-actions a:focus-visible,
.nav-link:focus-visible,
.brand:focus-visible,
.theme-toggle:focus-visible,
.social-links a:focus-visible {
  outline: 3px solid rgba(59, 130, 246, 0.45);
  outline-offset: 3px;
}

.project-card-body {
  display: grid;
  grid-template-rows: auto auto minmax(3.45rem, auto) minmax(4.5rem, 1fr) auto;
  align-content: stretch;
  align-self: stretch;
  gap: 0.48rem;
  height: 100%;
  padding: 0.85rem;
}

.project-topline {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  color: var(--soft-muted);
  font-size: 0.75rem;
  font-weight: 750;
}

.project-card strong {
  color: var(--heading);
  font-size: 1rem;
  line-height: 1.25;
  text-align: center;
}

.summary {
  display: -webkit-box;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.skill-row {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 0.3rem;
  min-height: 4.5rem;
}

.skill-row span {
  display: inline-flex;
  align-items: center;
  min-height: 1.4rem;
  padding: 0.14rem 0.42rem;
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.11);
  color: var(--accent-link);
  font-size: 0.66rem;
  font-weight: 750;
}

.dark .skill-row span {
  border-color: rgba(20, 184, 166, 0.28);
  background: rgba(20, 184, 166, 0.12);
  color: #7dd3fc;
}

.skill-row.large span {
  min-height: 2rem;
  padding-inline: 0.7rem;
  font-size: 0.88rem;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  align-self: end;
  gap: 0.4rem;
  width: fit-content;
  max-width: 100%;
  margin-top: 0.1rem;
  align-items: flex-start;
  justify-content: flex-start;
}

.project-button,
.project-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2rem;
  padding: 0.34rem 0.6rem;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--button);
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  width: auto;
  flex: 0 0 auto;
}

.project-card:hover .project-button:not(.secondary),
.project-actions a:not(.secondary):hover {
  background: var(--button-hover);
}

.project-button.secondary,
.project-actions a.secondary {
  border-color: var(--line);
  background: var(--panel-soft);
  color: var(--heading);
}

.project-button.secondary:hover,
.project-actions a.secondary:hover {
  background: var(--panel);
}

.empty-state {
  max-width: 660px;
  margin: 2.5rem clamp(0rem, 2vw, 2.5rem);
  padding: 1.4rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}

.empty-state p {
  margin-bottom: 0;
  color: var(--muted);
}

.back-link {
  display: inline-flex;
  margin: 6rem 0 1.4rem;
  font-weight: 800;
}

.project-detail {
  display: grid;
  grid-template-columns: minmax(0, 760px);
  justify-content: center;
  margin-bottom: 3rem;
}

.detail-content {
  display: grid;
  gap: 1.2rem;
  align-content: start;
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.detail-content .eyebrow {
  margin: 0;
  color: var(--accent-link);
  font-size: 0.82rem;
  font-weight: 850;
  text-transform: uppercase;
}

.detail-content h1 {
  margin-top: 0;
  font-size: clamp(2rem, 5vw, 3.8rem);
}

.intro-copy {
  max-width: 680px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.04rem;
}

.meta-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 0;
}

.meta-list div {
  min-width: 0;
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-soft);
}

.meta-list dt {
  margin-bottom: 0.35rem;
  color: var(--soft-muted);
  font-size: 0.76rem;
  font-weight: 850;
  text-transform: uppercase;
}

.meta-list dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--heading);
  font-weight: 800;
}

.detail-section {
  display: grid;
  gap: 0.4rem;
}

.detail-section h2 {
  margin-bottom: 0.35rem;
  font-size: 1.35rem;
}

.learned-note {
  margin: 0;
  padding: 1rem;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 0 12px 12px 0;
  background: var(--panel-soft);
  color: var(--muted);
}

.project-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  width: fit-content;
  max-width: 100%;
  align-items: flex-start;
  justify-content: flex-start;
}

.site-footer {
  display: grid;
  justify-items: center;
  gap: 0.8rem;
  padding: 1rem;
  background: var(--footer);
  color: #ffffff;
}

.social-links {
  display: grid;
  grid-auto-flow: column;
  gap: 1rem;
  align-items: center;
}

.social-links a {
  display: grid;
  width: 2rem;
  height: 2rem;
  place-items: center;
  border-radius: 8px;
  color: #ffffff;
}

.social-links a:hover {
  background: rgba(255, 255, 255, 0.1);
}

.social-links svg {
  width: 1.5rem;
  height: 1.5rem;
  fill: currentColor;
}

.site-footer p {
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.92rem;
  text-align: center;
}

@media (max-width: 640px) {
  .navbar {
    padding-inline: 0.6rem;
  }

  .brand,
  .nav-link {
    padding-inline: 0.55rem;
  }

  .hero {
    padding-top: 7.25rem;
  }

  .avatar {
    width: 7rem;
    height: 7rem;
  }

  h1 {
    font-size: 3rem;
  }

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

  .project-card-body,
  .detail-content,
  .about-panel {
    padding: 1.15rem;
  }

  .portfolio-heading p {
    font-size: 1rem;
  }
}
