:root {
  color-scheme: dark;
  --bg: #0c1513;
  --surface: #13201d;
  --surface-soft: #182925;
  --text: #f2f1e9;
  --muted: #9baca6;
  --line: rgba(255, 255, 255, 0.12);
  --accent: #d7f06a;
  --warm: #f0a96a;
  --blue: #73b9bd;
  --max-width: 1180px;
  font-family: "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--text);
  background:
    radial-gradient(circle at 80% 0%, rgba(54, 105, 91, 0.28), transparent 32rem),
    var(--bg);
}

a {
  color: inherit;
}

.page-shell {
  width: min(calc(100% - 40px), var(--max-width));
  margin: 0 auto;
}

.site-header {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand img {
  border-radius: 12px;
}

.brand span {
  display: grid;
  gap: 1px;
}

.brand strong {
  font-size: 16px;
  letter-spacing: 0.08em;
}

.brand small {
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.22em;
}

nav {
  display: flex;
}

.site-header nav {
  gap: 28px;
}

.site-header nav a {
  color: var(--muted);
  font-size: 14px;
  text-decoration: none;
  transition: color 160ms ease;
}

.site-header nav a:hover,
.site-header nav a:focus-visible {
  color: var(--text);
}

.projects-hero {
  padding: 34px 0 64px;
}

.projects-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  column-gap: 40px;
  margin-bottom: 26px;
}

.eyebrow,
.project-type {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.eyebrow {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.eyebrow span {
  width: 28px;
  height: 1px;
  background: var(--accent);
}

h1,
h2,
p {
  text-wrap: pretty;
}

h1 {
  margin: 0;
  font-size: clamp(34px, 4.5vw, 54px);
  line-height: 1.08;
  letter-spacing: -0.045em;
}

.projects-heading > p:last-child {
  max-width: 420px;
  margin: 0 0 5px;
  color: var(--muted);
  line-height: 1.7;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.project-card {
  min-height: 420px;
  display: flex;
  flex-direction: column;
  padding: 26px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  transition: border-color 180ms ease, transform 180ms ease;
}

.project-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, 0.25);
}

.sanguo-card {
  background:
    radial-gradient(circle at 90% 0%, rgba(240, 169, 106, 0.18), transparent 44%),
    var(--surface);
}

.weiqi-card {
  background:
    radial-gradient(circle at 90% 0%, rgba(115, 185, 189, 0.2), transparent 44%),
    var(--surface);
}

.card-topline {
  display: flex;
  align-items: start;
  justify-content: space-between;
}

.project-symbol,
.go-symbol {
  width: 58px;
  height: 58px;
  border-radius: 16px;
}

.project-symbol {
  display: grid;
  place-items: center;
  border: 1px solid rgba(240, 169, 106, 0.45);
  color: var(--warm);
  font-family: serif;
  font-size: 30px;
}

.go-symbol {
  position: relative;
  display: block;
  border: 1px solid rgba(115, 185, 189, 0.4);
  background:
    linear-gradient(rgba(115, 185, 189, 0.22) 1px, transparent 1px),
    linear-gradient(90deg, rgba(115, 185, 189, 0.22) 1px, transparent 1px);
  background-position: 7px 7px;
  background-size: 15px 15px;
}

.go-symbol i {
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.go-symbol i:first-child {
  top: 13px;
  left: 13px;
  background: #080b0a;
}

.go-symbol i:last-child {
  right: 11px;
  bottom: 11px;
  background: #f0f1e8;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 11px;
}

.status i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(215, 240, 106, 0.7);
}

.card-content {
  margin-top: 24px;
}

.card-content h2 {
  margin: 8px 0 10px;
  font-size: clamp(25px, 3vw, 32px);
  letter-spacing: -0.035em;
}

.card-content > p:not(.project-type) {
  max-width: 520px;
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.card-content ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.card-content li {
  padding: 6px 9px;
  border-radius: 8px;
  color: #c9d3cf;
  background: rgba(255, 255, 255, 0.055);
  font-size: 12px;
}

.project-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: auto;
  padding-top: 20px;
}

.project-link {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: border-color 160ms ease, background-color 160ms ease;
}

.project-link:hover,
.project-link:focus-visible {
  border-color: rgba(255, 255, 255, 0.34);
}

.project-link.primary-action {
  border-color: var(--accent);
  color: #101713;
  background: var(--accent);
}

.future-section,
.contact-section {
  display: flex;
  align-items: center;
  border-top: 1px solid var(--line);
}

.future-section {
  min-height: 190px;
  justify-content: center;
  gap: 28px;
}

.future-plus {
  width: 62px;
  height: 62px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 50%;
  color: var(--muted);
  font-size: 30px;
  font-weight: 200;
}

.future-section h2,
.contact-section h2 {
  margin: 7px 0;
  font-size: clamp(24px, 3vw, 34px);
  letter-spacing: -0.03em;
}

.future-section p:last-child {
  margin: 0;
  color: var(--muted);
}

.contact-section {
  min-height: 150px;
  justify-content: space-between;
  gap: 32px;
}

.contact-section a,
footer a {
  color: var(--accent);
  text-underline-offset: 3px;
}

.contact-section > a {
  font-size: clamp(18px, 2vw, 24px);
  font-weight: 700;
}

footer {
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

/* Shared by the static 404 page. */
.hero {
  min-height: calc(100vh - 176px);
  display: grid;
  align-items: center;
  padding: 64px 0;
}

.hero h1 {
  margin: 20px 0;
  font-size: clamp(48px, 7vw, 82px);
}

.hero h1 span {
  color: var(--accent);
}

.hero-intro {
  color: var(--muted);
  font-size: 18px;
  line-height: 1.8;
}

.primary-link {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 38px;
  margin-top: 30px;
  padding: 15px 22px;
  border-radius: 999px;
  color: #101713;
  background: var(--accent);
  font-size: 14px;
  font-weight: 750;
  text-decoration: none;
}

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

@media (max-width: 767px) {
  .page-shell {
    width: min(calc(100% - 28px), var(--max-width));
  }

  .site-header {
    min-height: 68px;
  }

  .site-header nav {
    gap: 18px;
  }

  .projects-hero {
    padding: 28px 0 50px;
  }

  .projects-heading {
    display: block;
    margin-bottom: 22px;
  }

  .projects-heading > p:last-child {
    margin-top: 12px;
  }

  .project-grid {
    grid-template-columns: 1fr;
  }

  .project-card {
    min-height: 410px;
    padding: 22px;
    border-radius: 20px;
  }

  .project-actions {
    grid-template-columns: 1fr;
  }

  .project-link {
    padding: 0 14px;
  }

  .future-section {
    min-height: 220px;
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    gap: 18px;
  }

  .contact-section {
    min-height: 170px;
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    gap: 14px;
  }

  footer {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}
