:root {
  --bg: #f6f3ed;
  --surface: #ffffff;
  --surface-soft: #f1ebe0;
  --surface-muted: #ece5d8;
  --ink: #1f2432;
  --muted: #62697a;
  --line: #d9d2c4;
  --accent: #202636;
  --shadow: 0 18px 44px rgba(23, 29, 41, 0.08);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --max-width: 1120px;
  --max-width-wide: 1280px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(180deg, #fbfaf7 0%, var(--bg) 100%);
  color: var(--ink);
  font-family: "Space Grotesk", "Trebuchet MS", sans-serif;
  line-height: 1.6;
}

img,
video {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

code {
  font-family: "SFMono-Regular", "Menlo", monospace;
}

.page-shell {
  width: min(calc(100% - 2rem), var(--max-width));
  margin: 0 auto;
  padding: 1.25rem 0 3rem;
}

.page-shell-wide {
  width: min(calc(100% - 2rem), var(--max-width-wide));
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.site-brand {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.site-nav a,
.social-list a,
.back-link {
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

.hero-panel {
  padding: clamp(1.3rem, 4vw, 2.5rem);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr);
  gap: 1.6rem;
  align-items: start;
}

.eyebrow {
  margin: 0 0 0.7rem;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.nameplate,
.section-title,
.sidebar-project-title,
.launch-title,
.readme-content h1,
.readme-content h2,
.readme-content h3,
.readme-content h4 {
  font-family: "Source Serif 4", Georgia, serif;
  font-weight: 600;
  letter-spacing: -0.05em;
}

.nameplate {
  margin: 0;
  font-size: clamp(4.4rem, 14vw, 7.5rem);
  line-height: 0.86;
}

.hero-role {
  margin: 0.9rem 0 0;
  max-width: 22ch;
  color: var(--ink);
  font-size: clamp(1.12rem, 3vw, 1.55rem);
  font-weight: 700;
}

.lede,
.profile-location,
.section-copy,
.project-summary,
.readme-content p,
.readme-content li,
.sidebar-note,
.panel-empty,
.result-summary,
.social-list,
.profile-meta p:not(.profile-name) {
  color: var(--muted);
}

.lede {
  margin: 1rem 0 0;
  max-width: 60ch;
  font-size: 1.04rem;
}

.site-nav,
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.95rem;
  padding: 0.8rem 1.18rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    border-color 180ms ease,
    background 180ms ease;
}

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

.button-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.button-secondary {
  background: var(--surface-soft);
}

.social-list {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  list-style: none;
  padding: 0;
  margin: 1.2rem 0 0;
}

.profile-card {
  padding: 1.1rem;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.profile-top {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
  align-items: center;
}

.avatar {
  width: 110px;
  height: 110px;
  border-radius: 24px;
  flex-shrink: 0;
}

.avatar-image {
  object-fit: cover;
}

.avatar-fallback {
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #fff;
  font-size: 2rem;
  font-weight: 700;
}

.profile-name {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--ink);
}

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

.fact-chip,
.metric-card {
  padding: 0.88rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.fact-chip dt,
.metric-label {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.fact-chip dd,
.metric-value {
  margin: 0.35rem 0 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.25;
}

.chip-row {
  margin-top: 1rem;
}

.chip {
  padding: 0.58rem 0.92rem;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 0.92rem;
  font-weight: 700;
}

.home-projects {
  margin-top: 1.85rem;
}

.section-copy-block {
  margin-bottom: 1rem;
}

.section-title {
  margin: 0;
  font-size: clamp(2.6rem, 8vw, 4.2rem);
  line-height: 0.95;
}

.section-copy {
  margin: 0.75rem 0 0;
  max-width: 54ch;
  font-size: 1.02rem;
}

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

.launch-card {
  min-height: 240px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  color: var(--ink);
  text-decoration: none;
  box-shadow: 0 8px 20px rgba(23, 29, 41, 0.04);
  transition:
    transform 220ms ease,
    box-shadow 220ms ease,
    background 220ms ease,
    border-color 220ms ease;
}

.launch-card:hover,
.launch-card:focus-visible {
  transform: translateY(-8px);
  box-shadow: 0 18px 38px rgba(23, 29, 41, 0.1);
  background: var(--surface);
  border-color: #cfc5b5;
}

.launch-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.launch-kind {
  display: inline-flex;
  align-items: center;
  min-height: 2.1rem;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 0.9rem;
  font-weight: 700;
}

.launch-arrow {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.launch-title {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 0.96;
}

.launch-summary {
  margin: auto 0 0;
  max-width: 26ch;
  color: var(--muted);
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transform: translateY(12px);
  transition:
    opacity 220ms ease,
    transform 220ms ease,
    max-height 220ms ease,
    margin-top 220ms ease;
}

.launch-card:hover .launch-summary,
.launch-card:focus-visible .launch-summary {
  opacity: 1;
  max-height: 8rem;
  margin-top: 1rem;
  transform: translateY(0);
}

.project-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.78fr);
  gap: 1.25rem;
  align-items: start;
}

.readme-column,
.sidebar-card {
  padding: 1.45rem;
}

.project-back-link {
  margin: 0 0 1rem;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.github-readme-card {
  padding: 0;
  overflow: hidden;
}

.readme-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.45rem;
  border-bottom: 1px solid var(--line);
  background: #fbfaf7;
}

.readme-toolbar-label,
.readme-toolbar-link {
  font-size: 0.92rem;
  font-weight: 700;
}

.sidebar-project-title {
  margin: 0;
  font-size: clamp(2.7rem, 7vw, 4.4rem);
  line-height: 0.92;
}

.project-summary {
  margin: 0.9rem 0 0;
  max-width: 60ch;
  font-size: 1.03rem;
}

.readme-content {
  display: grid;
  gap: 0.95rem;
  padding: 1.45rem;
}

.readme-content h1,
.readme-content h2,
.readme-content h3,
.readme-content h4 {
  margin: 0;
}

.readme-content h1 {
  font-size: clamp(2.2rem, 6vw, 3.5rem);
  padding-bottom: 0.55rem;
  border-bottom: 1px solid var(--line);
}

.readme-content h2 {
  font-size: clamp(1.7rem, 4vw, 2.45rem);
}

.readme-content h3 {
  font-size: 1.3rem;
}

.readme-content h4 {
  font-size: 1.08rem;
}

.readme-content p,
.readme-content ul {
  margin: 0;
}

.readme-content a {
  color: #1d4ed8;
}

.readme-content code {
  padding: 0.1rem 0.35rem;
  border-radius: 8px;
  background: var(--surface-soft);
  font-size: 0.92em;
}

.readme-content ul {
  padding-left: 1.2rem;
}

.readme-inline-gallery,
.readme-inline-block {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  align-items: flex-start;
}

.readme-figure,
.preview-figure {
  margin: 0;
  display: grid;
  gap: 0.45rem;
}

.readme-figure img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: #fff;
}

.preview-figure img,
.artifact-card img,
.artifact-card video {
  width: 100%;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: #fff;
}

.preview-figure figcaption,
.artifact-label {
  color: var(--muted);
  font-size: 0.88rem;
}

.sidebar-stack {
  position: sticky;
  top: 1rem;
  display: grid;
  gap: 1rem;
}

.preview-gallery,
.artifact-strip {
  display: grid;
  gap: 0.8rem;
}

.fact-grid,
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.sidebar-actions {
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
}

.sidebar-note,
.panel-empty,
.result-summary {
  margin: 0.9rem 0 0;
}

.result-panel {
  display: grid;
  gap: 0.95rem;
}

.result-title {
  margin: 0;
  font-size: 1.12rem;
  font-weight: 700;
}

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

.site-footnote {
  margin: 1.4rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

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

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

  .sidebar-stack {
    position: static;
  }
}

@media (max-width: 900px) {
  .hero-grid,
  .launch-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .page-shell,
  .page-shell-wide {
    width: min(calc(100% - 1rem), var(--max-width-wide));
    padding: 1rem 0 2rem;
  }

  .hero-panel,
  .readme-column,
  .sidebar-card {
    padding: 1.2rem;
  }

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

  .profile-top,
  .fact-grid,
  .metrics-grid,
  .artifact-strip,
  .quick-facts {
    grid-template-columns: 1fr;
  }

  .launch-summary {
    opacity: 1;
    max-height: 10rem;
    margin-top: 1rem;
    transform: none;
  }

  .launch-card {
    min-height: 0;
  }

  .avatar {
    width: 92px;
    height: 92px;
  }
}
