:root {
  color-scheme: dark;
  --ink: #f2f6f7;
  --muted: #9fadb5;
  --faint: #6e7b83;
  --base: #091015;
  --surface: rgba(19, 30, 37, 0.52);
  --surface-strong: rgba(23, 36, 44, 0.72);
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(255, 255, 255, 0.22);
  --mint: #71e0bb;
  --coral: #ff9378;
  --blue: #9bc3ff;
  --amber: #f2c96d;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.38);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 104px;
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  background: var(--base);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  line-height: 1.65;
}

body::before {
  content: "";
  position: fixed;
  z-index: -3;
  inset: 0;
  background:
    linear-gradient(115deg, rgba(39, 105, 95, 0.4) 0%, transparent 34%),
    linear-gradient(245deg, rgba(114, 57, 59, 0.33) 0%, transparent 36%),
    linear-gradient(165deg, #0a1117 18%, #102028 55%, #10171d 100%);
}

.page-backdrop {
  position: fixed;
  z-index: -2;
  inset: 0;
  pointer-events: none;
  opacity: 0.5;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(to bottom, black, transparent 82%);
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.site-header,
.hero,
.section,
.contact-section,
.site-footer {
  width: min(1180px, calc(100% - 40px));
  margin-right: auto;
  margin-left: auto;
}

.site-header {
  position: sticky;
  z-index: 20;
  top: 14px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 62px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(11, 19, 24, 0.48);
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.16);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  transition: background 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.site-header.is-scrolled {
  border-color: var(--line-strong);
  background: rgba(11, 19, 24, 0.78);
  box-shadow: 0 18px 52px rgba(0, 0, 0, 0.28);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: max-content;
  font-weight: 760;
}

.brand img {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.site-nav a,
.header-link {
  padding: 8px 13px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 0.9rem;
  transition: color 160ms ease, background 160ms ease;
}

.site-nav a:hover,
.site-nav a:focus-visible,
.site-nav a[aria-current="true"] {
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
}

.header-link {
  justify-self: end;
  border: 1px solid var(--line);
  color: var(--ink);
}

.header-link:hover,
.header-link:focus-visible {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.08);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, 0.92fr);
  gap: 42px 58px;
  align-items: center;
  min-height: calc(100svh - 76px);
  padding: 116px 0 52px;
}

.hero-copy {
  max-width: 680px;
}

.identity-line {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
  color: var(--muted);
  font: 700 0.78rem/1.2 "Cascadia Code", Consolas, monospace;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 0 5px rgba(113, 224, 187, 0.12), 0 0 22px rgba(113, 224, 187, 0.72);
}

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

h1 {
  margin-bottom: 26px;
  font-size: clamp(4.5rem, 10vw, 8.6rem);
  line-height: 0.78;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(2.5rem, 5vw, 4.6rem);
  line-height: 0.96;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 14px;
  font-size: clamp(1.35rem, 2vw, 1.8rem);
  line-height: 1.18;
  letter-spacing: 0;
}

.role {
  margin-bottom: 12px;
  color: var(--ink);
  font-size: clamp(1.15rem, 2vw, 1.45rem);
  font-weight: 650;
}

.lead {
  max-width: 54ch;
  margin-bottom: 30px;
  color: var(--muted);
  font-size: 1.05rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 11px 20px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-weight: 750;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

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

.button-primary {
  border-color: rgba(113, 224, 187, 0.5);
  background: var(--mint);
  box-shadow: 0 16px 34px rgba(50, 155, 126, 0.22);
  color: #07110e;
}

.button-quiet {
  background: rgba(255, 255, 255, 0.055);
  backdrop-filter: blur(16px);
}

.glass-panel,
.glass-strip {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.025) 46%),
    var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(28px) saturate(155%);
  -webkit-backdrop-filter: blur(28px) saturate(155%);
}

.glass-panel::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(360px circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, 0.12), transparent 62%);
  transition: opacity 180ms ease;
}

.glass-panel:hover::before {
  opacity: 1;
}

.glass-panel > * {
  position: relative;
  z-index: 1;
}

.current-panel {
  align-self: center;
  overflow: hidden;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  padding: 17px 20px;
  border-bottom: 1px solid var(--line);
  color: var(--faint);
  font: 700 0.7rem/1.2 "Cascadia Code", Consolas, monospace;
}

.repo-line {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  min-height: 94px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  transition: background 160ms ease, padding-left 160ms ease;
}

.repo-line:last-child {
  border-bottom: 0;
}

.repo-line:hover,
.repo-line:focus-visible {
  padding-left: 25px;
  background: rgba(255, 255, 255, 0.065);
}

.repo-index {
  color: var(--faint);
  font: 700 0.72rem/1 "Cascadia Code", Consolas, monospace;
}

.repo-line strong,
.repo-line small {
  display: block;
}

.repo-line strong {
  margin-bottom: 3px;
  font-size: 0.98rem;
}

.repo-line small {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.82rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.repo-mark {
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--blue);
  font: 700 0.66rem/1.1 "Cascadia Code", Consolas, monospace;
}

.hero-stats {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: hidden;
}

.hero-stats div {
  padding: 20px 24px;
  border-right: 1px solid var(--line);
}

.hero-stats div:last-child {
  border-right: 0;
}

.hero-stats strong,
.hero-stats span {
  display: block;
}

.hero-stats strong {
  margin-bottom: 2px;
  font-size: 1.45rem;
}

.hero-stats span {
  color: var(--muted);
  font-size: 0.8rem;
}

.section {
  padding: 112px 0;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 42px;
}

.section-heading > p {
  max-width: 36ch;
  margin-bottom: 0;
  color: var(--muted);
  text-align: right;
}

.eyebrow {
  margin-bottom: 12px;
  color: var(--mint);
  font: 750 0.74rem/1.2 "Cascadia Code", Consolas, monospace;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.project-card {
  display: flex;
  flex-direction: column;
  min-height: 390px;
  padding: 26px;
  overflow: hidden;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.project-card:hover {
  z-index: 2;
  transform: translateY(-5px);
  border-color: var(--line-strong);
  box-shadow: 0 34px 90px rgba(0, 0, 0, 0.46);
}

.project-featured {
  grid-column: 1 / -1;
  min-height: 420px;
  background:
    linear-gradient(120deg, rgba(80, 180, 151, 0.2), transparent 48%),
    linear-gradient(300deg, rgba(115, 153, 207, 0.15), transparent 45%),
    var(--surface-strong);
}

.card-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 58px;
  color: var(--faint);
  font: 700 0.7rem/1.2 "Cascadia Code", Consolas, monospace;
}

.status,
.tag-row span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--muted);
  font: 700 0.68rem/1.1 "Cascadia Code", Consolas, monospace;
}

.status-active {
  border-color: rgba(113, 224, 187, 0.26);
  background: rgba(113, 224, 187, 0.08);
  color: var(--mint);
}

.status-wip {
  border-color: rgba(242, 201, 109, 0.28);
  color: var(--amber);
}

.status-done {
  border-color: rgba(155, 195, 255, 0.28);
  color: var(--blue);
}

.project-card h3 {
  max-width: 22ch;
}

.project-card p {
  max-width: 60ch;
  margin-bottom: 24px;
  color: var(--muted);
}

.project-body {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(250px, 0.7fr);
  gap: 48px;
}

.fact-list {
  margin: 4px 0 26px;
  padding: 0;
  list-style: none;
}

.fact-list li {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: auto;
  margin-bottom: 24px;
}

.project-link {
  align-self: flex-start;
  margin-top: auto;
  padding-bottom: 3px;
  border-bottom: 1px solid rgba(113, 224, 187, 0.52);
  color: var(--mint);
  font-size: 0.9rem;
  font-weight: 760;
}

.project-link:hover,
.project-link:focus-visible {
  border-color: var(--mint);
  color: #a4f0d7;
}

.archive {
  display: grid;
  grid-template-columns: 0.72fr 1fr 1fr;
  gap: 0;
  margin-top: 18px;
  overflow: hidden;
}

.archive > div,
.archive > a {
  min-width: 0;
  padding: 24px;
}

.archive > a {
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-left: 1px solid var(--line);
  transition: background 160ms ease;
}

.archive > a:hover,
.archive > a:focus-visible {
  background: rgba(255, 255, 255, 0.06);
}

.archive h3,
.archive .eyebrow {
  margin-bottom: 0;
}

.archive a span,
.archive a small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.archive a span {
  margin-bottom: 4px;
  font-weight: 700;
}

.archive a small {
  color: var(--muted);
}

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

.stack-card {
  min-height: 310px;
  padding: 26px;
  overflow: hidden;
}

.stack-number {
  display: block;
  margin-bottom: 84px;
  color: var(--coral);
  font: 700 0.78rem/1 "Cascadia Code", Consolas, monospace;
}

.stack-card p {
  margin-bottom: 0;
  color: var(--muted);
}

.contact-section {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 54px;
  margin-top: 60px;
  margin-bottom: 90px;
  padding: 42px;
  overflow: hidden;
}

.contact-copy p:last-child {
  max-width: 36ch;
  margin-top: 24px;
  margin-bottom: 0;
  color: var(--muted);
}

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

.contact-list a {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  min-height: 74px;
  border-bottom: 1px solid var(--line);
  transition: padding-left 160ms ease, color 160ms ease;
}

.contact-list a:hover,
.contact-list a:focus-visible {
  padding-left: 8px;
  color: var(--mint);
}

.contact-list span {
  color: var(--faint);
  font: 700 0.68rem/1.2 "Cascadia Code", Consolas, monospace;
}

.contact-list strong {
  overflow-wrap: anywhere;
  font-size: clamp(0.88rem, 2vw, 1.1rem);
}

.site-footer {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 20px;
  padding: 28px 0 42px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 0.78rem;
}

.site-footer span:nth-child(2) {
  text-align: center;
}

.site-footer a {
  justify-self: end;
  color: var(--muted);
}

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 720ms ease, transform 720ms cubic-bezier(0.2, 0.72, 0.2, 1);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 920px) {
  .site-header {
    grid-template-columns: 1fr auto;
  }

  .site-nav {
    display: none;
  }

  .hero {
    grid-template-columns: 1fr;
    min-height: 0;
    padding-top: 104px;
  }

  .hero-copy {
    max-width: 760px;
  }

  .current-panel {
    width: 100%;
  }

  .project-body,
  .contact-section {
    grid-template-columns: 1fr;
  }

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

  .stack-card {
    min-height: auto;
  }

  .stack-number {
    margin-bottom: 42px;
  }

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

  .archive > div {
    grid-column: 1 / -1;
  }

  .archive > a:first-of-type {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .archive > a:last-child {
    border-top: 1px solid var(--line);
  }
}

@media (max-width: 680px) {
  .site-header,
  .hero,
  .section,
  .contact-section,
  .site-footer {
    width: calc(100% - 24px);
  }

  .site-header {
    top: 8px;
    min-height: 56px;
  }

  .brand img {
    width: 32px;
    height: 32px;
  }

  .header-link {
    padding: 7px 10px;
  }

  .hero {
    gap: 30px;
    padding: 82px 0 44px;
  }

  h1 {
    font-size: clamp(4.15rem, 23vw, 6rem);
  }

  .role {
    font-size: 1.08rem;
  }

  .hero-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .button {
    width: 100%;
  }

  .repo-line {
    grid-template-columns: 28px minmax(0, 1fr);
    min-height: 86px;
    padding: 14px 16px;
  }

  .repo-mark {
    display: none;
  }

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

  .hero-stats div {
    border-bottom: 1px solid var(--line);
    padding: 17px;
  }

  .hero-stats div:nth-child(2) {
    border-right: 0;
  }

  .hero-stats div:nth-child(n + 3) {
    border-bottom: 0;
  }

  .section {
    padding: 80px 0;
  }

  .section-heading {
    align-items: start;
    flex-direction: column;
    margin-bottom: 30px;
  }

  .section-heading > p {
    text-align: left;
  }

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

  .project-featured {
    grid-column: auto;
  }

  .project-card,
  .project-featured {
    min-height: auto;
    padding: 21px;
  }

  .card-topline {
    margin-bottom: 42px;
  }

  .project-body {
    gap: 10px;
  }

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

  .archive > div,
  .archive > a {
    grid-column: auto;
    padding: 20px;
    border-left: 0;
  }

  .archive > a:last-child {
    border-left: 0;
  }

  .contact-section {
    gap: 36px;
    margin-top: 30px;
    margin-bottom: 54px;
    padding: 26px 20px;
  }

  .contact-list a {
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 14px 0;
  }

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

  .site-footer span:nth-child(2) {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
