:root {
  --bg-base: #f6f2ea;
  --bg-accent-a: rgba(12, 108, 115, 0.14);
  --bg-accent-b: rgba(15, 63, 86, 0.12);
  --bg-end: #ece8dd;
  --paper: rgba(255, 255, 255, 0.7);
  --paper-strong: rgba(255, 255, 255, 0.88);
  --ink: #172033;
  --muted: #53607a;
  --line: rgba(23, 32, 51, 0.12);
  --accent: #0c6c73;
  --accent-deep: #0f3f56;
  --accent-soft: #dcefed;
  --shadow: 0 20px 50px rgba(27, 39, 68, 0.08);
  --button-primary-text: #f6f7f8;
  --toggle-bg: rgba(255, 255, 255, 0.88);
}

:root[data-theme="dark"] {
  --bg-base: #10151f;
  --bg-accent-a: rgba(76, 191, 184, 0.1);
  --bg-accent-b: rgba(71, 116, 189, 0.12);
  --bg-end: #0a0f17;
  --paper: rgba(18, 25, 38, 0.82);
  --paper-strong: rgba(24, 33, 48, 0.94);
  --ink: #ebeff6;
  --muted: #a8b4c8;
  --line: rgba(235, 239, 246, 0.12);
  --accent: #66c7c0;
  --accent-deep: #9ad9d4;
  --accent-soft: rgba(102, 199, 192, 0.16);
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
  --button-primary-text: #071117;
  --toggle-bg: rgba(24, 33, 48, 0.94);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, var(--bg-accent-a), transparent 30%),
    radial-gradient(circle at right 15%, var(--bg-accent-b), transparent 24%),
    linear-gradient(180deg, var(--bg-base) 0%, var(--bg-end) 100%);
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.65;
}

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

p {
  margin: 0;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 600;
  line-height: 1.1;
}

.page-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.home-page .page-shell {
  min-height: 100vh;
  padding: 18px 0 18px;
  display: grid;
  grid-template-rows: auto auto auto;
  overflow: hidden;
}

.hero,
.section,
.footer {
  background: var(--paper);
  backdrop-filter: blur(12px);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.hero {
  padding: 28px;
}

.home-page .minimal-hero {
  min-height: auto;
  display: flex;
  flex-direction: column;
}

.home-page .minimal-hero .hero-grid {
  align-items: center;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.topbar-controls {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand,
.topbar-links,
.button,
.tag,
.metric,
.section-kicker,
.eyebrow,
.panel-label,
.resume-label,
code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

.brand {
  font-size: 0.92rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

.hero-grid {
  display: grid;
  grid-template-columns: 1.7fr 1fr;
  gap: 28px;
  margin-top: 44px;
}

.minimal-grid {
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.95fr);
  align-items: end;
}

.eyebrow,
.section-kicker,
.panel-label,
.resume-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
}

.hero-copy h1 {
  margin-top: 12px;
  font-size: clamp(2.8rem, 6vw, 5.2rem);
  max-width: 12ch;
}

.lead {
  margin-top: 18px;
  max-width: 58ch;
  font-size: 1.05rem;
  color: var(--muted);
}

.lead-compact {
  margin-top: 8px;
  font-size: 1rem;
}

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

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.9rem;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button-primary {
  background: var(--accent-deep);
  color: var(--button-primary-text);
}

.button-secondary {
  background: var(--paper-strong);
  border-color: var(--line);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--toggle-bg);
  color: var(--ink);
  cursor: pointer;
  font-size: 1rem;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.theme-toggle:hover {
  transform: translateY(-1px);
}

.hero-panel,
.card {
  background: var(--paper-strong);
  border: 1px solid var(--line);
  border-radius: 24px;
}

.hero-panel {
  padding: 22px;
}

.minimal-panel {
  display: grid;
  gap: 10px;
}

.panel-text {
  color: var(--ink);
}

.contact-label {
  margin-top: 10px;
}

.contact-stack {
  display: grid;
  gap: 8px;
  color: var(--muted);
}

.footer-label {
  margin: 0;
  color: var(--accent);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.compact-contact-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  align-items: center;
}

.compact-contact-list a,
.compact-contact-list span {
  white-space: nowrap;
}

.focus-list {
  margin: 16px 0 0;
  padding-left: 20px;
  color: var(--muted);
}

.focus-list li + li {
  margin-top: 12px;
}

.section,
.footer {
  margin-top: 24px;
  padding: 28px;
}

.minimal-section {
  padding-top: 24px;
}

.home-page .section,
.home-page .footer {
  background: var(--paper-strong);
}

.home-page main,
.home-page .footer {
  margin-top: 10px;
}

.home-page .hero,
.home-page .section,
.home-page .footer {
  box-shadow: none;
}

.home-page .hero {
  padding: 22px;
}

.home-page .section,
.home-page .footer {
  padding: 22px;
}

.home-page .hero-grid {
  margin-top: 28px;
}

.home-page .hero-copy h1 {
  font-size: clamp(2.4rem, 5vw, 4.3rem);
}

.home-page .hero-actions {
  margin-top: 22px;
  gap: 10px;
}

.home-page .button {
  min-height: 42px;
}

.home-page .card-grid {
  margin-top: 18px;
  gap: 14px;
}

.home-page .card {
  padding: 18px;
}

.home-page .card h3 {
  margin-top: 0;
}

.home-page .footer h2 {
  font-size: 1.8rem;
}

.home-page .footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding-top: 0px;
  padding-bottom: 0px;
}

.home-page .compact-contact-list {
  justify-content: flex-end;
}

.home-page {
  overflow: hidden;
}

.minimal-list-hero {
  padding-bottom: 18px;
}

.minimal-list-section {
  padding-top: 22px;
}

.section-heading {
  max-width: 60ch;
}

.section-heading h2,
.footer h2 {
  margin-top: 10px;
  font-size: clamp(1.9rem, 3vw, 2.8rem);
}

.about-grid,
.split-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 24px;
}

.about-grid p,
.split-section p,
.card p,
.contact-list {
  color: var(--muted);
}

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

.two-col-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.three-col-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.card {
  padding: 22px;
}

.card-topline {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.tag,
.metric {
  font-size: 0.76rem;
  letter-spacing: 0.06em;
}

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

.metric {
  color: var(--muted);
}

.card h3 {
  margin-top: 16px;
  font-size: 1.4rem;
}

.card p {
  margin-top: 12px;
}

.detail-list {
  margin: 14px 0 0;
  padding-left: 20px;
  color: var(--muted);
}

.detail-list li + li {
  margin-top: 10px;
}

.compact-grid .card h3 {
  font-size: 1.2rem;
}

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

.project-detail-card {
  min-height: 100%;
}

.inline-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 18px;
  color: var(--accent-deep);
}

.inline-links a {
  border-bottom: 1px solid rgba(15, 63, 86, 0.24);
}

.resume-card {
  align-self: start;
}

.resume-card code {
  color: var(--accent-deep);
  background: var(--accent-soft);
  padding: 2px 6px;
  border-radius: 6px;
}

.footer {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 20px;
  align-items: end;
}

.contact-list {
  display: grid;
  gap: 10px;
  justify-items: start;
}

.contact-list a:hover,
.topbar-links a:hover,
.inline-links a:hover {
  color: var(--accent-deep);
}

.timeline {
  display: grid;
  gap: 18px;
  margin-top: 24px;
}

.timeline-card p {
  margin-top: 10px;
}

.resume-hero .hero-copy h1 {
  max-width: 13ch;
}

.minimal-hero .hero-copy h1 {
  max-width: none;
  font-size: clamp(3rem, 7vw, 5.4rem);
}

.reading-section .section-heading {
  max-width: 42rem;
}

.reading-copy {
  max-width: 52rem;
  margin-top: 24px;
  color: var(--muted);
}

.reading-copy p + p {
  margin-top: 16px;
}

@media (max-width: 900px) {
  .hero-grid,
  .card-grid,
  .project-detail-stack,
  .about-grid,
  .split-section,
  .footer {
    grid-template-columns: 1fr;
  }

  .hero-copy h1 {
    max-width: none;
  }

  .two-col-grid {
    grid-template-columns: 1fr;
  }

  .three-col-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .page-shell {
    width: min(100% - 20px, 1120px);
    padding-top: 10px;
  }

  .home-page .page-shell {
    min-height: auto;
    display: block;
  }

  .home-page {
    overflow: auto;
  }

  .home-page .footer {
    display: grid;
    justify-content: start;
  }

  .compact-contact-list {
    display: grid;
    justify-items: start;
  }

  .hero,
  .section,
  .footer {
    padding: 20px;
    border-radius: 22px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-links {
    gap: 14px;
  }

  .hero-grid {
    margin-top: 28px;
  }

  .hero-copy h1 {
    font-size: clamp(2.2rem, 13vw, 3.4rem);
  }

  .home-page .minimal-hero {
    min-height: auto;
  }
}
