:root {
  color-scheme: light dark;
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-2: #e9edf2;
  --text: #13181f;
  --muted: #586474;
  --line: #cbd3dd;
  --accent: #2456d6;
  --accent-strong: #173ea5;
  --on-accent: #ffffff;
  --radius: 18px;
  --shadow: 0 20px 50px rgba(24, 39, 68, 0.12);
  --max: 1240px;
}

[data-theme="dark"] {
  --bg: #11151a;
  --surface: #181e25;
  --surface-2: #232b35;
  --text: #edf2f7;
  --muted: #aeb8c5;
  --line: #35404d;
  --accent: #7ba2ff;
  --accent-strong: #a8c0ff;
  --on-accent: #0c1428;
  --shadow: 0 22px 56px rgba(0, 0, 0, 0.28);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #11151a;
    --surface: #181e25;
    --surface-2: #232b35;
    --text: #edf2f7;
    --muted: #aeb8c5;
    --line: #35404d;
    --accent: #7ba2ff;
    --accent-strong: #a8c0ff;
    --on-accent: #0c1428;
    --shadow: 0 22px 56px rgba(0, 0, 0, 0.28);
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "SF Pro Display", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
}

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

.skip-link {
  position: fixed;
  left: 16px;
  top: 12px;
  z-index: 20;
  padding: 10px 14px;
  background: var(--text);
  color: var(--bg);
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  min-height: 68px;
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 32px;
  width: min(var(--max), calc(100% - 40px));
  margin: 0 auto;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 78%, transparent);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.brand {
  width: fit-content;
  font-size: 17px;
  font-weight: 760;
  text-decoration: none;
}

nav {
  display: flex;
  align-items: center;
  gap: 26px;
  white-space: nowrap;
}

nav a {
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
}

nav a:hover,
nav a:focus-visible {
  color: var(--text);
}

.theme-toggle {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

.theme-toggle:active,
.button:active {
  transform: translateY(1px);
}

.hero {
  min-height: calc(100dvh - 68px);
  width: min(var(--max), calc(100% - 40px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 0.88fr) minmax(480px, 1.12fr);
  align-items: center;
  gap: clamp(40px, 7vw, 96px);
  padding: 56px 0 72px;
}

.eyebrow {
  margin: 0 0 18px;
  color: var(--accent-strong);
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
  font-weight: 760;
  letter-spacing: 0.14em;
}

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

h1 {
  max-width: 10ch;
  margin-bottom: 24px;
  font-size: clamp(48px, 5.6vw, 78px);
  line-height: 1.05;
  letter-spacing: -0.055em;
}

.hero-lead {
  max-width: 19em;
  margin-bottom: 30px;
  color: var(--muted);
  font-size: clamp(17px, 1.45vw, 21px);
}

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

.button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 760;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 160ms ease, background-color 160ms ease, border-color 160ms ease;
}

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

.button-primary:hover {
  background: var(--accent-strong);
}

.button-secondary {
  border-color: var(--line);
  background: var(--surface);
  color: var(--text);
}

.hero-visual {
  margin: 0;
  overflow: hidden;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero-visual img {
  width: 100%;
  aspect-ratio: 8 / 5;
  object-fit: cover;
}

.signal-strip {
  width: min(var(--max), calc(100% - 40px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.signal-strip p {
  margin: 0;
  padding: 18px 14px;
  color: var(--muted);
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
  text-align: center;
}

.signal-strip p + p {
  border-left: 1px solid var(--line);
}

.section {
  width: min(var(--max), calc(100% - 40px));
  margin: 0 auto;
  padding: clamp(92px, 11vw, 150px) 0;
}

.section-heading {
  max-width: 700px;
  margin-bottom: 54px;
}

h2 {
  margin-bottom: 16px;
  font-size: clamp(36px, 4vw, 58px);
  line-height: 1.08;
  letter-spacing: -0.045em;
}

.section-heading p,
.practice-intro p,
.closing p {
  color: var(--muted);
  font-size: 18px;
}

.featured-project {
  display: grid;
  grid-template-columns: minmax(330px, 0.76fr) minmax(0, 1.24fr);
  gap: 38px;
  align-items: center;
  padding: clamp(28px, 4vw, 56px);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.project-index {
  margin-bottom: 8px;
  color: var(--accent-strong);
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 13px;
  font-weight: 760;
}

.project-copy h3,
.system-case h3 {
  margin-bottom: 8px;
  font-size: clamp(28px, 3vw, 42px);
  line-height: 1.1;
  letter-spacing: -0.035em;
}

.project-role {
  color: var(--accent-strong);
  font-weight: 700;
}

.project-copy > p:not(.project-index):not(.project-role),
.system-case > p,
.about-copy p {
  color: var(--muted);
}

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

.metric-grid div {
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.metric-grid dt {
  color: var(--text);
  font-size: 28px;
  font-weight: 780;
  line-height: 1.1;
}

.metric-grid dd {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-list span {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 11px;
}

.project-media {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.project-media img {
  width: 100%;
  height: auto;
}

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

.project-panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.project-panel.offset {
  transform: translateY(56px);
}

.project-panel .project-media {
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
}

.compact {
  padding: 30px;
}

.compact h3 {
  font-size: 28px;
}

.system-case {
  margin-top: 96px;
  display: grid;
  grid-template-columns: minmax(250px, 0.82fr) minmax(320px, 1.18fr);
  gap: 32px 64px;
  align-items: start;
  padding: 46px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.workflow {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
}

.workflow span {
  min-height: 72px;
  display: grid;
  place-items: center;
  padding: 12px;
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--text);
  font-size: 13px;
  font-weight: 720;
  text-align: center;
}

.practice {
  display: grid;
  grid-template-columns: minmax(280px, 0.7fr) minmax(0, 1.3fr);
  gap: 80px;
  border-top: 1px solid var(--line);
}

.practice-intro {
  position: sticky;
  top: 110px;
  align-self: start;
}

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

.practice-list article {
  min-height: 240px;
  padding: 28px;
  border-radius: var(--radius);
  background: var(--surface);
}

.practice-list article:nth-child(2),
.practice-list article:nth-child(3) {
  background: var(--surface-2);
}

.practice-list h3 {
  font-size: 22px;
}

.practice-list p {
  color: var(--muted);
}

.about {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr);
  gap: 80px;
  align-items: center;
}

.about-copy {
  max-width: 720px;
}

.skill-cloud {
  display: flex;
  flex-wrap: wrap;
  align-content: center;
  gap: 10px;
}

.skill-cloud span {
  padding: 11px 14px;
  border-radius: 999px;
  background: var(--surface-2);
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 13px;
}

.closing {
  display: grid;
  justify-items: start;
  border-top: 1px solid var(--line);
}

.closing h2 {
  max-width: 9ch;
}

footer {
  min-height: 96px;
  width: min(var(--max), calc(100% - 40px));
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
}

footer p {
  margin: 0;
}

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

.js .reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 650ms cubic-bezier(0.16, 1, 0.3, 1), transform 650ms cubic-bezier(0.16, 1, 0.3, 1);
}

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

@media (max-width: 900px) {
  .hero,
  .featured-project,
  .practice,
  .about,
  .system-case {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
    padding: 68px 0;
  }

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

  .project-panel.offset {
    transform: none;
  }

  .system-case {
    gap: 18px;
  }

  .practice-intro {
    position: static;
  }
}

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

  nav {
    display: none;
  }

  .hero,
  .section,
  .signal-strip,
  footer {
    width: min(100% - 28px, var(--max));
  }

  .hero {
    gap: 34px;
  }

  h1 {
    font-size: clamp(42px, 14vw, 58px);
  }

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

  .signal-strip p:nth-child(3) {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .signal-strip p:nth-child(4) {
    border-top: 1px solid var(--line);
  }

  .project-pair,
  .practice-list {
    grid-template-columns: 1fr;
  }

  .featured-project {
    padding: 22px;
  }

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

  .about {
    gap: 36px;
  }

  footer {
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: 4px;
  }
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

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

@media (prefers-reduced-transparency: reduce) {
  .site-header {
    background: var(--bg);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}
