:root {
  color-scheme: dark;
  --black: #05090d;
  --surface: #080e13;
  --surface-raised: #0c141b;
  --white: #e2e6e3;
  --gray-10: rgba(226, 230, 227, .1);
  --gray-20: rgba(226, 230, 227, .2);
  --gray-50: rgba(226, 230, 227, .5);
  --gray-65: rgba(226, 230, 227, .65);
  --cyan: #25d7e8;
  --violet: #a99aff;
  --accent: var(--cyan);
  --page-pad: clamp(24px, 4vw, 64px);
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 28px; }
body {
  min-width: 320px;
  background: var(--black);
  color: var(--white);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
body::selection { color: var(--black); background: var(--cyan); }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
svg { display: block; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 5px; }

.skip-link {
  position: fixed;
  z-index: 100;
  top: 12px;
  left: 12px;
  padding: 8px 14px;
  color: var(--black);
  background: var(--cyan);
  transform: translateY(-160%);
  transition: transform 160ms ease;
}
.skip-link:focus { transform: translateY(0); }

.site-header {
  min-height: 76px;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 var(--page-pad);
  border-bottom: 1px solid var(--gray-10);
  background: var(--black);
}
.brand { display: inline-flex; align-items: center; gap: 12px; }
.brand-mark { width: 31px; height: 28px; color: var(--cyan); }
.brand span { font-size: 18px; font-weight: 750; letter-spacing: .16em; }
.header-rule { width: 1px; height: 24px; background: var(--gray-20); }
.header-title {
  color: var(--gray-65);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .13em;
}
.header-title span { margin: 0 8px; color: var(--gray-20); }
.header-meta {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--gray-65);
  font-size: 12px;
  letter-spacing: .04em;
}
.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 12px rgba(37, 215, 232, .45);
}

.page-shell {
  width: min(1680px, 100%);
  margin: 0 auto;
  padding: 64px var(--page-pad) 112px;
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  gap: clamp(40px, 5vw, 88px);
}
.intro-sticky { position: sticky; top: 40px; }
.eyebrow {
  margin-bottom: 24px;
  color: var(--cyan);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .18em;
}
.intro h1 {
  max-width: 360px;
  font-size: clamp(36px, 3.4vw, 54px);
  font-weight: 630;
  line-height: 1.22;
  letter-spacing: -.045em;
}
.intro h1 span { color: var(--gray-50); }
.lede {
  max-width: 310px;
  margin-top: 24px;
  color: var(--gray-65);
  font-size: 14px;
  line-height: 1.9;
}
.tech-index { margin-top: 48px; border-top: 1px solid var(--gray-20); }
.index-link {
  --index-accent: var(--cyan);
  position: relative;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 12px;
  padding: 20px 0;
  border-bottom: 1px solid var(--gray-10);
  transition: border-color 160ms ease, color 160ms ease;
}
.index-link--pl { --index-accent: var(--violet); }
.index-link::before {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 0;
  height: 1px;
  background: var(--index-accent);
  transition: width 180ms ease;
}
.index-link:hover::before,
.index-link.is-active::before { width: 100%; }
.index-number {
  align-self: start;
  padding-top: 2px;
  color: var(--gray-50);
  font-family: var(--font-mono);
  font-size: 10px;
}
.index-copy { min-width: 0; }
.index-copy strong { display: block; font-size: 14px; font-weight: 560; letter-spacing: .01em; }
.index-copy small {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  color: var(--gray-50);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: .08em;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.index-arrow { color: var(--gray-50); font-size: 16px; transition: color 160ms ease, transform 160ms ease; }
.index-link:hover .index-arrow,
.index-link.is-active .index-arrow { color: var(--index-accent); transform: translate(2px, 2px); }
.index-link.is-active .index-number { color: var(--index-accent); }
.intro-note { margin-top: 40px; }
.intro-note > span { color: var(--gray-50); font-family: var(--font-mono); font-size: 9px; letter-spacing: .12em; }
.intro-note p { max-width: 280px; margin-top: 8px; color: var(--gray-50); font-size: 12px; }

.projects { min-width: 0; }
.project-section {
  --project-accent: var(--cyan);
  --project-glow: rgba(37, 215, 232, .15);
  scroll-margin-top: 32px;
}
.project-section + .project-section { margin-top: clamp(80px, 10vw, 144px); }
.project-section--pl { --project-accent: var(--violet); --project-glow: rgba(169, 154, 255, .15); }
.project-link { display: block; }
.project-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .12em;
}
.project-id { color: var(--project-accent); }
.project-type { display: inline-flex; align-items: center; gap: 8px; color: var(--gray-50); }
.project-type i { width: 5px; height: 5px; border-radius: 50%; background: var(--project-accent); }
.preview-frame {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background: var(--surface-raised);
  border: 1px solid var(--gray-10);
}
.preview-frame::after {
  content: "";
  position: absolute;
  z-index: 3;
  inset: 0;
  border: 1px solid transparent;
  pointer-events: none;
  transition: border-color 180ms ease;
}
.preview-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 180ms ease, filter 180ms ease;
}
.preview-shade {
  position: absolute;
  z-index: 1;
  inset: 0;
  background: linear-gradient(180deg, transparent 36%, rgba(3, 7, 10, .18) 54%, rgba(3, 7, 10, .94) 100%);
  pointer-events: none;
}
.preview-caption { position: absolute; z-index: 2; left: clamp(22px, 3.5vw, 48px); bottom: clamp(24px, 4vw, 48px); }
.preview-caption p {
  margin-bottom: 10px;
  color: var(--project-accent);
  font-family: var(--font-mono);
  font-size: clamp(8px, .75vw, 11px);
  letter-spacing: .16em;
}
.preview-caption h2 {
  font-size: clamp(28px, 3.4vw, 52px);
  font-weight: 610;
  line-height: 1.15;
  letter-spacing: -.04em;
}
.preview-caption > span { display: block; margin-top: 10px; color: var(--gray-65); font-size: clamp(12px, 1.2vw, 15px); }
.open-indicator {
  position: absolute;
  z-index: 2;
  right: clamp(22px, 3.5vw, 48px);
  bottom: clamp(24px, 4vw, 48px);
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid var(--gray-20);
  border-radius: 50%;
  color: var(--white);
  transition: color 160ms ease, border-color 160ms ease, background-color 160ms ease;
}
.open-indicator svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.4; }
.project-details {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 32px;
  align-items: start;
  padding: 24px 0;
  border-bottom: 1px solid var(--gray-20);
}
.project-description { max-width: 660px; color: var(--gray-65); font-size: 13px; line-height: 1.9; }
.signal-chain { display: flex; align-items: center; gap: 0; list-style: none; white-space: nowrap; }
.signal-chain li { display: flex; align-items: center; color: var(--gray-65); font-size: 11px; }
.signal-chain li:not(:last-child)::after {
  content: "";
  width: 22px;
  height: 1px;
  margin: 0 9px;
  background: var(--gray-20);
}
.project-link:hover .preview-frame img { transform: scale(1.012); filter: brightness(1.06); }
.project-link:hover .preview-frame::after { border-color: var(--project-accent); }
.project-link:hover .open-indicator { color: var(--black); border-color: var(--project-accent); background: var(--project-accent); }
.project-link:hover .preview-caption h2 { color: var(--project-accent); }
.preview-caption h2 { transition: color 160ms ease; }

.site-footer {
  min-height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px var(--page-pad);
  border-top: 1px solid var(--gray-10);
  color: var(--gray-50);
  font-size: 11px;
}
.site-footer a { flex: none; transition: color 160ms ease; }
.site-footer a:hover { color: var(--cyan); }
.site-footer a span { margin-left: 8px; }

@media (max-width: 1100px) {
  .page-shell { grid-template-columns: 250px minmax(0, 1fr); gap: 36px; padding-top: 48px; }
  .project-details { grid-template-columns: 1fr; gap: 16px; }
  .preview-caption h2 { font-size: clamp(28px, 4.3vw, 44px); }
  .open-indicator { width: 40px; height: 40px; }
}

@media (max-width: 760px) {
  html { scroll-padding-top: 18px; }
  .site-header { min-height: 64px; gap: 14px; }
  .brand { gap: 8px; }
  .brand-mark { width: 25px; height: 23px; }
  .brand span { font-size: 15px; }
  .header-rule, .header-title { display: none; }
  .header-meta { font-size: 10px; }
  .page-shell { display: block; padding-top: 40px; padding-bottom: 72px; }
  .intro-sticky { position: static; }
  .eyebrow { margin-bottom: 16px; }
  .intro h1 { font-size: clamp(36px, 10.5vw, 48px); }
  .lede { max-width: 520px; margin-top: 18px; }
  .tech-index { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 32px; }
  .index-link { grid-template-columns: 22px minmax(0, 1fr); gap: 7px; padding: 16px 0; }
  .index-arrow { display: none; }
  .index-copy strong { font-size: 12px; }
  .index-copy small { font-size: 7px; letter-spacing: .03em; }
  .intro-note { display: none; }
  .projects { margin-top: 56px; }
  .project-section + .project-section { margin-top: 72px; }
  .preview-frame { aspect-ratio: 4 / 3; }
  .preview-caption { left: 20px; right: 20px; bottom: 22px; }
  .preview-caption h2 { font-size: clamp(27px, 8vw, 36px); }
  .preview-caption > span { margin-top: 7px; font-size: 11px; }
  .open-indicator { top: 16px; right: 16px; bottom: auto; width: 36px; height: 36px; background: rgba(5, 9, 13, .5); }
  .open-indicator svg { width: 16px; height: 16px; }
  .project-details { padding: 20px 0; }
  .project-description { font-size: 12px; }
  .signal-chain { width: 100%; }
  .signal-chain li { font-size: 10px; }
  .signal-chain li:not(:last-child)::after { width: 14px; margin: 0 7px; }
  .site-footer { align-items: flex-start; font-size: 10px; }
  .site-footer p { max-width: 440px; }
}

@media (max-width: 390px) {
  .header-meta span:last-child { font-size: 0; }
  .header-meta span:last-child::after { content: "02 TECH"; font-size: 10px; }
  .tech-index { gap: 12px; }
  .index-copy small { display: none; }
  .project-type { font-size: 8px; letter-spacing: .04em; }
  .preview-caption > span { max-width: 220px; }
  .site-footer { flex-direction: column; gap: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .project-link:hover .preview-frame img { transform: none; }
}
