:root {
  color-scheme: dark;
  --bg: #101521;
  --bg-soft: #182033;
  --surface: rgba(24, 32, 51, 0.72);
  --surface-strong: rgba(31, 41, 64, 0.88);
  --text: #edf2f7;
  --text-muted: #a8b3c7;
  --accent: #7c3aed;
  --accent-hover: #a78bfa;
  --border: rgba(168, 179, 199, 0.18);
  --shadow: rgba(4, 8, 20, 0.34);
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #f6f7fb;
  --bg-soft: #e9edf5;
  --surface: rgba(255, 255, 255, 0.76);
  --surface-strong: rgba(255, 255, 255, 0.92);
  --text: #142033;
  --text-muted: #5f6f86;
  --accent: #5b5bd6;
  --accent-hover: #4338ca;
  --border: rgba(95, 111, 134, 0.18);
  --shadow: rgba(20, 32, 51, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background:
    radial-gradient(circle at 20% 12%, rgba(124, 58, 237, 0.26), transparent 32rem),
    radial-gradient(circle at 82% 28%, rgba(56, 189, 248, 0.18), transparent 30rem),
    linear-gradient(135deg, var(--bg-soft), var(--bg));
}

body {
  min-height: 100vh;
  margin: 0;
  display: flex;
  flex-direction: column;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  text-autospace: normal;
}

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

.page-shell {
  width: min(1120px, 100%);
  min-height: calc(100vh - 73px);
  margin: 0 auto;
  padding: 5rem 1.25rem 3rem;
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: center;
}

.hero {
  max-width: 680px;
  margin-bottom: 2.5rem;
}

.eyebrow {
  margin: 0 0 0.75rem;
  color: var(--accent-hover);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(2.3rem, 7vw, 4.6rem);
  line-height: 1;
}

.subtitle {
  max-width: 520px;
  margin: 1rem 0 0;
  color: var(--text-muted);
  font-size: 1.08rem;
  line-height: 1.7;
}

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

.card {
  min-height: 168px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
  align-items: start;
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 18px 42px var(--shadow);
  backdrop-filter: blur(18px);
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease,
    box-shadow 180ms ease;
}

.card::before {
  content: "";
  grid-column: 1 / -1;
  width: 2.5rem;
  height: 0.25rem;
  border-radius: 999px;
  background: var(--card-accent, var(--accent));
}

.card:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--card-accent, var(--accent)) 70%, var(--border));
  background: var(--surface-strong);
  box-shadow: 0 24px 54px var(--shadow);
}

.card:focus-visible,
.theme-toggle:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 68%, white);
  outline-offset: 4px;
}

.card-icon {
  display: grid;
  width: 3rem;
  height: 3rem;
  place-items: center;
  border-radius: 8px;
  background: color-mix(in srgb, var(--card-accent, var(--accent)) 18%, transparent);
  font-size: 1.8rem;
}

.card-body {
  display: grid;
  gap: 0.55rem;
}

.card-title {
  font-size: 1.18rem;
  font-weight: 750;
}

.card-description {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.65;
}

.theme-toggle {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 10;
  width: 2.75rem;
  height: 2.75rem;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--text);
  box-shadow: 0 14px 34px var(--shadow);
  cursor: pointer;
  backdrop-filter: blur(16px);
}

.theme-toggle span {
  font-size: 1.15rem;
  line-height: 1;
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 1rem;
  color: var(--text-muted);
  text-align: center;
  font-size: 0.92rem;
}

@media (max-width: 820px) {
  .page-shell {
    justify-content: flex-start;
    padding-top: 5.5rem;
  }

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

  .card {
    min-height: 132px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* Personal site */
html {
  scroll-behavior: smooth;
}

body {
  background:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px),
    var(--bg);
  background-size: 72px 72px;
  background-position: center top;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(circle at 18% 8%, rgba(124, 58, 237, 0.2), transparent 30rem),
    radial-gradient(circle at 86% 32%, rgba(56, 189, 248, 0.12), transparent 28rem),
    linear-gradient(to bottom, transparent 55%, var(--bg) 92%);
}

.site-header {
  width: min(1180px, calc(100% - 2.5rem));
  min-height: 76px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  border-bottom: 1px solid var(--border);
}

.wordmark {
  width: fit-content;
  font-size: 1.1rem;
  font-weight: 900;
  letter-spacing: -0.04em;
}

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

.site-header nav {
  display: flex;
  gap: 1.75rem;
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 650;
}

.site-header nav a,
.section-heading > a,
.about-copy a {
  transition: color 160ms ease;
}

.site-header nav a:hover,
.section-heading > a:hover,
.about-copy a:hover {
  color: var(--accent-hover);
}

.site-header .theme-toggle {
  position: static;
  justify-self: end;
  width: 2.4rem;
  height: 2.4rem;
  box-shadow: none;
  background: transparent;
}

.personal-shell {
  width: min(1180px, calc(100% - 2.5rem));
  margin: 0 auto;
}

.intro {
  min-height: calc(100vh - 76px);
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(260px, 0.65fr);
  gap: clamp(3rem, 8vw, 8rem);
  align-items: center;
  padding: 5rem 0 7rem;
}

.intro-copy {
  max-width: 790px;
}

.status {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  margin: 0 0 1.5rem;
  color: var(--text-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.76rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.status span {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 5px rgba(34, 197, 94, 0.12);
}

.intro h1 {
  max-width: 820px;
  margin: 0;
  font-size: clamp(3.2rem, 8vw, 7.1rem);
  line-height: 0.97;
  letter-spacing: -0.075em;
}

.intro h1 em {
  color: var(--accent-hover);
  font-style: normal;
}

.intro-text {
  max-width: 650px;
  margin: 2rem 0 0;
  color: var(--text-muted);
  font-size: clamp(1rem, 2vw, 1.15rem);
  line-height: 1.85;
}

.intro-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2.2rem;
}

.button {
  min-height: 46px;
  display: inline-flex;
  gap: 1.5rem;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  font-size: 0.9rem;
  font-weight: 700;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.button.primary {
  border-color: var(--text);
  background: var(--text);
  color: var(--bg);
}

.button:hover {
  transform: translateY(-2px);
  border-color: var(--accent-hover);
}

.intro-note {
  align-self: end;
  margin-bottom: 1rem;
  padding: 1.4rem;
  border-top: 1px solid var(--text-muted);
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 76%, transparent);
}

.note-label,
.section-kicker {
  color: var(--accent-hover);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.intro-note p {
  margin: 1rem 0 1.5rem;
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.7;
}

.stack-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.stack-list span,
.project-meta span {
  padding: 0.32rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.68rem;
}

.section {
  padding: 7rem 0;
  border-top: 1px solid var(--border);
}

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  align-items: end;
  margin-bottom: 2.5rem;
}

.section-kicker {
  margin: 0 0 0.75rem;
}

.section h2,
.about-section h2 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 1.05;
  letter-spacing: -0.055em;
}

.section-heading > a,
.section-heading > p {
  margin: 0 0 0.35rem;
  color: var(--text-muted);
  font-size: 0.86rem;
}

.projects-list {
  border-top: 1px solid var(--border);
}

.project-card {
  display: grid;
  grid-template-columns: 4.5rem 1fr;
  gap: 1rem;
  padding: 1.65rem 0;
  border-bottom: 1px solid var(--border);
  transition: padding 180ms ease, background 180ms ease;
}

.project-card:hover {
  padding-right: 1rem;
  padding-left: 1rem;
  background: var(--surface);
}

.project-index {
  padding-top: 0.25rem;
  color: var(--text-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.75rem;
}

.project-content,
.project-topline {
  display: flex;
}

.project-content {
  flex-direction: column;
  gap: 0.75rem;
}

.project-topline {
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
}

.project-topline strong {
  font-size: clamp(1.2rem, 3vw, 1.75rem);
  letter-spacing: -0.035em;
}

.project-arrow {
  color: var(--text-muted);
  font-size: 1.25rem;
  transition: transform 160ms ease, color 160ms ease;
}

.project-card:hover .project-arrow {
  transform: translate(2px, -2px);
  color: var(--accent-hover);
}

.project-description {
  max-width: 680px;
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.65;
}

.project-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tools-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.tools-grid .card {
  min-height: 205px;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  border-radius: 4px;
  box-shadow: none;
  backdrop-filter: none;
}

.tools-grid .card::before {
  display: none;
}

.tools-grid .card-icon {
  border-radius: 4px;
  font-size: 1.4rem;
}

.tools-grid .card-title {
  letter-spacing: -0.025em;
}

.tools-grid .card:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 42px var(--shadow);
}

.about-section {
  padding: 8rem 0;
  border-top: 1px solid var(--border);
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: start;
}

.about-copy {
  max-width: 520px;
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.85;
}

.about-copy p:first-child {
  margin-top: 0;
}

.about-copy a {
  display: inline-block;
  margin-top: 1rem;
  color: var(--text);
  font-weight: 700;
}

.personal-footer {
  width: min(1180px, calc(100% - 2.5rem));
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-right: 0;
  padding-left: 0;
  text-align: left;
}

@media (max-width: 900px) {
  .intro {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .intro-note {
    max-width: 520px;
    margin: 0;
  }

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

@media (max-width: 640px) {
  body {
    background-size: 48px 48px;
  }

  .site-header,
  .personal-shell,
  .personal-footer {
    width: min(100% - 1.5rem, 1180px);
  }

  .site-header {
    grid-template-columns: 1fr auto;
  }

  .site-header nav {
    display: none;
  }

  .intro {
    min-height: auto;
    padding: 5rem 0;
  }

  .intro h1 {
    font-size: clamp(3rem, 15vw, 4.5rem);
  }

  .section,
  .about-section {
    padding: 5rem 0;
  }

  .section-heading {
    align-items: start;
  }

  .section-heading > p {
    display: none;
  }

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

  .tools-grid,
  .about-grid {
    grid-template-columns: 1fr;
  }

  .tools-grid .card {
    min-height: 150px;
  }

  .personal-footer {
    flex-direction: column;
  }
}
