:root {
  --bg: #071019;
  --bg-elevated: #0b1726;
  --bg-soft: #0c1521;
  --panel: rgba(255, 255, 255, 0.035);
  --panel-strong: rgba(255, 255, 255, 0.05);
  --text: #ebf1f7;
  --muted: #9ca9b8;
  --line: rgba(157, 174, 194, 0.18);
  --line-strong: rgba(157, 174, 194, 0.3);
  --accent: #dff178;
  --accent-soft: #a8b8ff;
  --max-width: 760px;
  --sans: Georgia, "Times New Roman", serif;
  --ui: "Avenir Next", "Segoe UI", sans-serif;
  --mono: "SFMono-Regular", Menlo, Monaco, Consolas, monospace;
  --shadow-soft: 0 16px 48px rgba(0, 0, 0, 0.18);
  --shell-gutter: 32px;
}

html[data-theme="light"] {
  --bg: #f3f6fa;
  --bg-elevated: #ffffff;
  --bg-soft: #eef2f6;
  --panel: rgba(255, 255, 255, 0.92);
  --panel-strong: rgba(255, 255, 255, 0.98);
  --text: #182432;
  --muted: #627181;
  --line: rgba(106, 124, 144, 0.18);
  --line-strong: rgba(106, 124, 144, 0.32);
  --accent: #1d3557;
  --accent-soft: #325d88;
  --shadow-soft: 0 12px 32px rgba(33, 52, 74, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: var(--sans);
  background:
    radial-gradient(circle at top right, rgba(168, 184, 255, 0.08), transparent 28%),
    radial-gradient(circle at top left, rgba(223, 241, 120, 0.05), transparent 22%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-elevated) 48%, var(--bg) 100%);
}

a {
  color: inherit;
}

p {
  margin: 0;
}

.page-shell {
  width: min(calc(100% - var(--shell-gutter)), 980px);
  margin: 0 auto;
  padding: 28px 0 56px;
}

.site-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 14px 24px;
  padding-bottom: 18px;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--line);
  font-family: var(--ui);
}

.header-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 14px 18px;
}

.brand,
.site-nav a,
.hero-links a,
.theme-toggle,
.fact-label,
.item-meta,
.skill-label,
.footer-meta {
  font-family: var(--mono);
  font-size: 0.9rem;
  letter-spacing: 0.01em;
}

.brand {
  text-decoration: none;
  color: var(--accent);
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.site-nav a {
  text-decoration: none;
  color: var(--muted);
}

.site-nav a[aria-current="page"] {
  color: var(--text);
}

.theme-toggle {
  min-width: 78px;
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  transition:
    border-color 180ms ease,
    transform 180ms ease,
    background 180ms ease;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
  transform: translateY(-1px);
  border-color: var(--line-strong);
}

.site-nav a::after {
  content: "·";
  margin-left: 10px;
  color: var(--line-strong);
}

.site-nav a:last-child::after {
  content: "";
  margin: 0;
}

.content-column,
.site-footer {
  width: min(100%, var(--max-width));
}

body[data-page="projects"] .content-column {
  width: 100%;
  max-width: none;
}

.hero,
.section-block,
.site-footer {
  margin: 0 auto 72px;
}

.hero-kicker,
.section-intro,
.site-footer p {
  color: var(--muted);
}

.hero-kicker {
  margin-bottom: 14px;
  font-family: var(--mono);
  font-size: 0.88rem;
  text-transform: lowercase;
}

.hero h1 {
  margin: 0 0 22px;
  max-width: 10.5ch;
  font-size: clamp(3.45rem, 8.8vw, 5.25rem);
  line-height: 0.92;
  letter-spacing: -0.05em;
  font-weight: 600;
}

.hero-compact h1 {
  font-size: clamp(2.9rem, 8vw, 4.4rem);
}

.hero-lead,
.hero-body,
.section-block p,
.resume-frame p,
.site-footer p {
  font-size: 1.15rem;
  line-height: 2;
}

.hero-body,
.section-block p + p {
  margin-top: 26px;
}

.hero-links,
.inline-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  margin-top: 34px;
}

.hero-links a {
  color: var(--accent-soft);
  text-decoration: none;
}

.hero-links a:hover,
.site-nav a:hover,
.site-nav a:focus-visible,
.hero-links a:focus-visible {
  color: var(--text);
}

.section-block h2,
.site-footer h2 {
  margin: 0 0 22px;
  font-family: var(--ui);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.section-intro {
  margin-bottom: 30px;
}

#project-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  width: 100%;
}

.stack-list {
  display: grid;
  gap: 34px;
}

.list-item {
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.project-card {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, var(--panel-strong), var(--panel));
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.project-card:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-soft);
}

.project-card-image {
  display: block;
  aspect-ratio: 1.28 / 1;
  overflow: hidden;
  background: var(--bg-elevated);
}

.project-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.project-card-body {
  padding: 16px 18px 14px;
}

.project-card-title-link {
  text-decoration: none;
}

.project-card-title {
  margin: 0;
  color: var(--text);
  font-family: var(--ui);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.35;
}

.project-card-tagline {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.55;
  font-style: italic;
}

.project-card-summary {
  margin-top: 14px;
  color: var(--text);
  font-size: 0.86rem;
  line-height: 1.62;
}

.project-card-tags {
  margin-top: 14px;
}

.project-card-footer {
  margin-top: auto;
  padding: 12px 18px 14px;
  border-top: 1px solid var(--line);
}

.project-card-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
}

.project-card-link {
  color: var(--accent-soft);
  text-decoration: none;
  font-family: var(--mono);
  font-size: 0.76rem;
}

.project-card-link code {
  color: inherit;
  background: transparent;
  padding: 0;
  font-family: var(--mono);
  font-size: inherit;
}

.list-item:first-child {
  padding-top: 0;
  border-top: 0;
}

.item-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 18px;
  align-items: baseline;
}

.item-title {
  margin: 0;
  font-size: 1.35rem;
  line-height: 1.45;
  font-weight: 600;
}

.item-meta {
  color: var(--muted);
}

.item-subtitle {
  margin-top: 10px;
  color: var(--muted);
  font-family: var(--ui);
  font-size: 1rem;
}

.item-description {
  margin-top: 18px;
  line-height: 1.95;
}

.tag-row,
.skills-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tag,
.skill-chip,
.fact-pill {
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-family: var(--ui);
  font-size: 0.96rem;
  background: rgba(255, 255, 255, 0.02);
}

.item-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  margin-top: 20px;
}

.item-links a {
  color: var(--accent-soft);
  text-decoration: none;
  font-family: var(--mono);
  font-size: 0.9rem;
}

.item-links a code {
  font-family: var(--mono);
  font-size: 0.9rem;
  color: inherit;
  background: transparent;
  padding: 0;
}

.bullet-list {
  margin: 22px 0 0;
  padding-left: 24px;
}

.bullet-list li {
  margin: 16px 0 0;
  color: var(--muted);
  line-height: 1.95;
}

.skill-group {
  width: 100%;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.skill-group:first-child {
  padding-top: 0;
  border-top: 0;
}

.skill-label {
  margin-bottom: 12px;
  color: var(--accent);
}

.section-header-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 14px 24px;
  align-items: end;
}

.compact-links {
  margin-top: 0;
}

.resume-frame {
  overflow: hidden;
  margin-top: 28px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--bg-soft);
  height: clamp(520px, 78vh, 1120px);
}

.resume-embed {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.site-footer {
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.site-footer-minimal {
  display: block;
}

.footer-email {
  display: inline-block;
  color: var(--accent-soft);
  text-decoration: none;
  font-family: var(--mono);
  font-size: 0.95rem;
}

.footer-meta {
  margin-top: 18px;
  color: var(--muted);
}

.experience-card {
  padding: 26px 28px 28px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.015));
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.16);
}

.experience-card:first-child {
  padding-top: 26px;
  border-top: 1px solid var(--line);
}

.experience-card:first-child {
  border-top: 1px solid var(--line);
}

@media (max-width: 700px) {
  .page-shell {
    --shell-gutter: 22px;
    width: min(calc(100% - var(--shell-gutter)), 980px);
    padding-top: 20px;
  }

  .hero h1 {
    max-width: none;
    font-size: clamp(3rem, 13vw, 4.5rem);
  }

  .hero-lead,
  .hero-body,
  .section-block p,
  .resume-frame p,
  .site-footer p {
    font-size: 1.04rem;
    line-height: 1.8;
  }

  .resume-frame {
    height: clamp(420px, 72vh, 860px);
  }

  .header-actions {
    width: 100%;
    justify-content: space-between;
  }

  .theme-toggle {
    min-width: 72px;
  }
}

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

@media (max-width: 720px) {
  #project-list {
    grid-template-columns: 1fr;
  }
}
