:root {
  --ink: #0c1d3a;
  --ink-soft: #4d5b71;
  --blue: #176bff;
  --green: #20a66a;
  --yellow: #f4b740;
  --coral: #ef5e4e;
  --canvas: #f7f7f2;
  --paper: #ffffff;
  --line: #d9dee7;
  --muted: #7d8899;
  --header-height: 78px;
  --preview-accent: #176bff;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  background: var(--canvas);
  color: var(--ink);
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  letter-spacing: 0;
  text-rendering: optimizeLegibility;
}

body.is-filtering .project-row {
  transition-duration: 160ms;
}

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

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

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

button {
  font: inherit;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 10px 14px;
  transform: translateY(-180%);
  border: 1px solid var(--ink);
  border-radius: 4px;
  background: var(--paper);
  font-size: 14px;
  font-weight: 800;
}

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

.site-header {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: 220px 1fr 220px;
  align-items: center;
  height: var(--header-height);
  padding: 0 clamp(20px, 4vw, 68px);
  border-bottom: 1px solid transparent;
  background: rgba(247, 247, 242, 0.82);
  backdrop-filter: blur(14px);
  transition: background-color 180ms ease, border-color 180ms ease;
}

.site-header.is-solid {
  border-color: rgba(12, 29, 58, 0.12);
  background: rgba(255, 255, 255, 0.94);
}

.brand-link {
  display: inline-flex;
  align-items: center;
  width: 198px;
}

.brand-link img {
  width: auto;
  max-width: 100%;
  height: 50px;
  object-fit: contain;
  object-position: left center;
}

.header-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(24px, 4vw, 58px);
  font-size: 13px;
  font-weight: 700;
}

.header-nav a {
  position: relative;
  padding: 8px 0;
}

.header-nav a::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 2px;
  transform: scaleX(0);
  transform-origin: right center;
  background: var(--blue);
  content: "";
  transition: transform 180ms ease;
}

.header-nav a:hover::after,
.header-nav a:focus-visible::after {
  transform: scaleX(1);
  transform-origin: left center;
}

.header-action {
  display: inline-flex;
  align-items: center;
  justify-self: end;
  gap: 12px;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--ink);
  border-radius: 4px;
  background: var(--paper);
  font-size: 13px;
  font-weight: 800;
  transition: background-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.header-action:hover {
  transform: translateY(-2px);
  background: var(--ink);
  color: #fff;
}

.hero-story {
  position: relative;
  height: 245vh;
  min-height: 1620px;
  background: var(--canvas);
}

.hero-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  min-height: 640px;
  overflow: hidden;
  background: var(--canvas);
}

.hero-sticky::before,
.hero-sticky::after {
  position: absolute;
  z-index: 1;
  pointer-events: none;
  content: "";
}

.hero-sticky::before {
  top: 18%;
  right: 0;
  left: 0;
  border-top: 1px solid rgba(12, 29, 58, 0.08);
}

.hero-sticky::after {
  top: 0;
  bottom: 0;
  left: 36%;
  border-left: 1px solid rgba(12, 29, 58, 0.08);
}

.hero-stage {
  position: absolute;
  inset: var(--header-height) 0 0;
  z-index: 2;
  perspective: 1500px;
  transform-style: preserve-3d;
  pointer-events: none;
}

.screen-panel {
  position: absolute;
  top: 50%;
  left: 50%;
  width: clamp(190px, 18vw, 290px);
  aspect-ratio: 390 / 844;
  margin: 0;
  overflow: hidden;
  border: 7px solid #fff;
  border-radius: 8px;
  background: #e8edf3;
  box-shadow: 0 32px 70px rgba(12, 29, 58, 0.2);
  transform-origin: center center;
  translate: var(--tilt-x, 0) var(--tilt-y, 0);
  transition: translate 700ms cubic-bezier(0.2, 0.75, 0.2, 1);
  will-change: transform;
}

.screen-panel img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.screen-panel-1 {
  transform: translate3d(-690px, -46%, -140px) rotateY(18deg) rotateZ(-7deg);
}

.screen-panel-2 {
  transform: translate3d(-445px, -55%, -55px) rotateY(12deg) rotateZ(-3deg);
}

.screen-panel-3 {
  transform: translate3d(-38px, -54%, 75px) rotateY(-2deg) rotateZ(0.5deg);
}

.screen-panel-4 {
  transform: translate3d(260px, -52%, -30px) rotateY(-12deg) rotateZ(4deg);
}

.screen-panel-5 {
  transform: translate3d(500px, -47%, -120px) rotateY(-18deg) rotateZ(7deg);
}

.screen-panel-6 {
  transform: translate3d(725px, -42%, -210px) rotateY(-23deg) rotateZ(10deg);
}

.hero-copy {
  position: absolute;
  top: 50%;
  left: clamp(28px, 6vw, 104px);
  z-index: 8;
  width: min(650px, 48vw);
  padding: 28px 42px 30px 0;
  transform: translateY(-45%);
  background: var(--canvas);
}

.hero-kicker,
.section-kicker {
  margin: 0;
  color: var(--green);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.hero-kicker {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.hero-kicker span {
  width: 28px;
  height: 2px;
  background: var(--green);
}

.hero-copy h1 {
  margin: 0;
  font-size: clamp(52px, 5.4vw, 86px);
  line-height: 1.06;
  letter-spacing: 0;
}

.hero-copy h1 em {
  color: var(--blue);
  font-style: normal;
}

.hero-description {
  margin: 25px 0 0;
  color: var(--ink-soft);
  font-size: clamp(15px, 1.4vw, 19px);
  line-height: 1.8;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 34px;
  margin-top: 34px;
}

.primary-action {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 36px;
  min-width: 190px;
  min-height: 56px;
  padding: 0 20px;
  border-radius: 4px;
  background: var(--blue);
  color: #fff;
  font-size: 15px;
  font-weight: 900;
  box-shadow: 0 18px 34px rgba(23, 107, 255, 0.22);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.primary-action:hover {
  transform: translateY(-3px);
  box-shadow: 0 22px 40px rgba(23, 107, 255, 0.28);
}

.scroll-hint {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.scroll-hint i {
  position: relative;
  width: 28px;
  height: 42px;
  border: 1px solid #9aa5b5;
  border-radius: 18px;
}

.scroll-hint i::after {
  position: absolute;
  top: 8px;
  left: 50%;
  width: 3px;
  height: 7px;
  transform: translateX(-50%);
  border-radius: 2px;
  background: var(--blue);
  content: "";
  animation: scroll-dot 1.7s ease-in-out infinite;
}

@keyframes scroll-dot {
  0%, 100% { transform: translate(-50%, 0); opacity: 0.45; }
  50% { transform: translate(-50%, 13px); opacity: 1; }
}

.hero-index {
  position: absolute;
  bottom: 54px;
  left: clamp(28px, 3vw, 54px);
  z-index: 8;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-variant-numeric: tabular-nums;
}

.hero-index strong {
  color: var(--blue);
  font-size: 13px;
}

.hero-index span {
  width: 1px;
  height: 70px;
  background: #aeb7c4;
}

.hero-index small {
  color: var(--muted);
  font-size: 11px;
}

.hero-caption {
  position: absolute;
  right: clamp(24px, 4vw, 70px);
  bottom: 42px;
  z-index: 8;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
}

.hero-caption span {
  color: var(--muted);
  font-size: 11px;
}

.hero-caption strong {
  font-size: 14px;
}

.story-progress {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 9;
  height: 4px;
  background: rgba(12, 29, 58, 0.1);
}

.story-progress-fill {
  display: block;
  width: 100%;
  height: 100%;
  transform: scaleX(0);
  transform-origin: left center;
  background: var(--blue);
}

.signal-strip {
  position: relative;
  z-index: 10;
  overflow: hidden;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  background: var(--yellow);
}

.signal-track {
  display: flex;
  align-items: center;
  gap: 26px;
  width: max-content;
  min-height: 64px;
  padding: 0 14px;
  animation: signal-move 24s linear infinite;
  white-space: nowrap;
}

.signal-track span {
  font-size: 15px;
  font-weight: 900;
}

.signal-track i {
  color: var(--blue);
  font-style: normal;
}

@keyframes signal-move {
  to { transform: translateX(-50%); }
}

.projects-section {
  position: relative;
  z-index: 3;
  padding: 116px 0 132px;
  background: var(--paper);
}

.section-inner {
  width: min(1260px, calc(100% - 48px));
  margin: 0 auto;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 50px;
}

.section-heading h2 {
  margin: 14px 0 0;
  font-size: clamp(42px, 5vw, 72px);
  line-height: 1.06;
}

.section-heading > p {
  max-width: 390px;
  margin: 0 0 6px;
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.8;
}

.filter-bar {
  display: flex;
  gap: 8px;
  margin: 54px 0 36px;
  overflow-x: auto;
  scrollbar-width: none;
}

.filter-bar::-webkit-scrollbar {
  display: none;
}

.filter-button {
  flex: 0 0 auto;
  min-height: 42px;
  padding: 0 17px;
  border: 1px solid #cbd3df;
  border-radius: 4px;
  background: var(--paper);
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease;
}

.filter-button.is-active {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.project-browser {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(360px, 0.88fr);
  gap: clamp(40px, 6vw, 90px);
  align-items: start;
}

.project-list {
  border-top: 1px solid var(--ink);
}

.project-row {
  position: relative;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 92px 30px;
  align-items: center;
  gap: 16px;
  min-height: 94px;
  border-bottom: 1px solid var(--line);
  transition: color 180ms ease, padding 180ms ease, opacity 160ms ease;
}

.project-row::before {
  position: absolute;
  inset: 0;
  z-index: -1;
  transform: scaleX(0);
  transform-origin: right center;
  background: var(--ink);
  content: "";
  transition: transform 240ms cubic-bezier(0.7, 0, 0.2, 1);
}

.project-row:hover,
.project-row:focus-visible,
.project-row.is-active {
  padding-right: 16px;
  padding-left: 16px;
  color: #fff;
}

.project-row:hover::before,
.project-row:focus-visible::before,
.project-row.is-active::before {
  transform: scaleX(1);
  transform-origin: left center;
}

.project-row.is-hidden {
  display: none;
}

.project-number {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.project-row:hover .project-number,
.project-row:focus-visible .project-number,
.project-row.is-active .project-number {
  color: var(--yellow);
}

.project-name {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 5px;
}

.project-name small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.project-row:hover .project-name small,
.project-row:focus-visible .project-name small,
.project-row.is-active .project-name small {
  color: #aebbd1;
}

.project-name strong {
  overflow: hidden;
  font-size: clamp(17px, 1.5vw, 21px);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-category {
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 700;
}

.project-row:hover .project-category,
.project-row:focus-visible .project-category,
.project-row.is-active .project-category {
  color: #d7dfeb;
}

.project-arrow {
  font-size: 20px;
  transition: transform 180ms ease;
}

.project-row:hover .project-arrow,
.project-row:focus-visible .project-arrow,
.project-row.is-active .project-arrow {
  transform: translate(3px, -3px);
}

.project-thumb {
  display: none;
}

.project-preview {
  position: sticky;
  top: calc(var(--header-height) + 28px);
  overflow: hidden;
  border: 1px solid var(--ink);
  border-radius: 8px;
  background: #f0f2f5;
  box-shadow: 18px 18px 0 var(--preview-accent);
  transition: box-shadow 220ms ease;
}

.preview-chrome {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 42px;
  padding: 0 14px;
  border-bottom: 1px solid #cbd2dd;
  background: #fff;
}

.preview-chrome > span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--coral);
}

.preview-chrome > span:nth-child(2) {
  background: var(--yellow);
}

.preview-chrome > span:nth-child(3) {
  background: var(--green);
}

.preview-chrome small {
  margin-left: auto;
  color: var(--muted);
  font-size: 10px;
}

.preview-viewport {
  position: relative;
  height: min(56vh, 540px);
  min-height: 420px;
  overflow: hidden;
  background:
    linear-gradient(rgba(12, 29, 58, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(12, 29, 58, 0.045) 1px, transparent 1px),
    #eef1f5;
  background-size: 24px 24px;
}

.preview-viewport img {
  position: absolute;
  top: 26px;
  left: 50%;
  width: min(54%, 270px);
  max-width: none;
  height: auto;
  transform: translateX(-50%) rotate(1.5deg);
  border: 6px solid #fff;
  border-radius: 7px;
  box-shadow: 0 26px 50px rgba(12, 29, 58, 0.2);
  transition: opacity 150ms ease, transform 260ms ease;
}

.project-preview.is-switching .preview-viewport img {
  opacity: 0;
  transform: translateX(-46%) rotate(4deg) scale(0.96);
}

.preview-copy {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 20px;
  padding: 24px;
  border-top: 1px solid #cbd2dd;
  background: #fff;
}

.preview-copy > span {
  color: var(--preview-accent);
  font-size: 12px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.preview-copy h3 {
  margin: 0;
  font-size: 20px;
}

.preview-copy p {
  margin: 7px 0 0;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.65;
}

.site-footer {
  padding: 22px 0 calc(22px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  background: var(--ink);
  color: #c8d0dd;
}

.footer-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  font-size: 12px;
}

.footer-inner p {
  margin: 0;
}

.footer-inner p:nth-child(2) {
  color: #7f8da3;
  text-align: center;
}

.footer-inner a {
  justify-self: end;
  color: #fff;
}

.filter-button:focus-visible,
.project-row:focus-visible,
.header-action:focus-visible,
.header-nav a:focus-visible,
.primary-action:focus-visible,
.site-footer a:focus-visible {
  outline: 3px solid rgba(23, 107, 255, 0.35);
  outline-offset: 3px;
}

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

  .hero-copy {
    width: 56vw;
  }

  .screen-panel {
    width: clamp(180px, 21vw, 245px);
  }

  .screen-panel-1 { transform: translate3d(-530px, -43%, -140px) rotateY(18deg) rotateZ(-7deg); }
  .screen-panel-2 { transform: translate3d(-340px, -53%, -55px) rotateY(12deg) rotateZ(-3deg); }
  .screen-panel-3 { transform: translate3d(15px, -50%, 75px) rotateY(-2deg) rotateZ(0.5deg); }
  .screen-panel-4 { transform: translate3d(235px, -49%, -30px) rotateY(-12deg) rotateZ(4deg); }
  .screen-panel-5 { transform: translate3d(415px, -44%, -120px) rotateY(-18deg) rotateZ(7deg); }
  .screen-panel-6 { display: none; }

  .project-browser {
    grid-template-columns: minmax(0, 1fr) 390px;
    gap: 44px;
  }
}

@media (max-width: 820px) {
  :root {
    --header-height: 62px;
  }

  .site-header {
    grid-template-columns: 1fr auto;
    padding: 0 16px;
  }

  .brand-link {
    width: 138px;
  }

  .brand-link img {
    height: 38px;
  }

  .header-nav {
    display: none;
  }

  .header-action {
    min-height: 38px;
    padding: 0 11px;
    font-size: 12px;
  }

  .hero-story {
    height: auto;
    min-height: 0;
  }

  .hero-sticky {
    position: relative;
    height: 720px;
    min-height: 0;
  }

  .hero-sticky::before {
    top: 45%;
  }

  .hero-sticky::after {
    left: 50%;
  }

  .hero-stage {
    top: 330px;
    right: 0;
    bottom: auto;
    left: 0;
    height: 360px;
  }

  .screen-panel {
    top: 50%;
    width: 148px;
    min-width: 0;
    max-width: none;
    border-width: 4px;
    box-shadow: 0 18px 38px rgba(12, 29, 58, 0.18);
  }

  .screen-panel-1,
  .screen-panel-5,
  .screen-panel-6 {
    display: none;
  }

  .screen-panel-2 {
    transform: translate3d(-150px, -48%, -45px) rotateY(11deg) rotateZ(-5deg) scale(0.9);
  }

  .screen-panel-3 {
    transform: translate3d(-74px, -51%, 55px) rotateY(0) rotateZ(0);
  }

  .screen-panel-4 {
    transform: translate3d(12px, -47%, -40px) rotateY(-11deg) rotateZ(5deg) scale(0.9);
  }

  .hero-copy {
    top: 104px;
    right: 18px;
    left: 18px;
    width: auto;
    padding: 12px 0 20px;
    transform: none;
  }

  .hero-kicker {
    margin-bottom: 14px;
    font-size: 9px;
  }

  .hero-copy h1 {
    font-size: clamp(38px, 11vw, 48px);
    line-height: 1.08;
  }

  .hero-description {
    max-width: 330px;
    margin-top: 13px;
    font-size: 14px;
  }

  .hero-actions {
    margin-top: 18px;
  }

  .primary-action {
    min-width: 150px;
    min-height: 46px;
    font-size: 13px;
  }

  .scroll-hint {
    display: none;
  }

  .hero-index,
  .hero-caption {
    display: none;
  }

  .story-progress {
    height: 3px;
  }

  .story-progress-fill {
    transform: scaleX(1);
  }

  .signal-track {
    min-height: 56px;
  }

  .projects-section {
    padding: 64px 0 80px;
  }

  .section-inner,
  .footer-inner {
    width: min(100% - 28px, 620px);
  }

  .section-heading {
    display: block;
  }

  .section-heading h2 {
    font-size: 38px;
  }

  .section-heading > p {
    margin-top: 20px;
    font-size: 14px;
  }

  .filter-bar {
    margin: 34px -14px 24px;
    padding: 0 14px;
  }

  .filter-button {
    min-height: 40px;
    padding: 0 14px;
    font-size: 12px;
  }

  .project-browser {
    display: block;
  }

  .project-preview {
    display: none;
  }

  .project-row {
    grid-template-columns: 34px 78px minmax(0, 1fr) 24px;
    gap: 12px;
    min-height: 112px;
    padding: 12px 0;
  }

  .project-row:hover,
  .project-row:focus-visible,
  .project-row.is-active {
    padding: 12px;
  }

  .project-thumb {
    display: block;
    grid-column: 2;
    grid-row: 1;
    width: 78px;
    height: 86px;
    overflow: hidden;
    border-radius: 5px;
    background: #edf1f5;
  }

  .project-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
  }

  .project-name {
    grid-column: 3;
    grid-row: 1;
  }

  .project-category {
    display: none;
  }

  .project-arrow {
    grid-column: 4;
    grid-row: 1;
  }

  .project-number {
    align-self: start;
    padding-top: 5px;
  }

  .project-name strong {
    white-space: normal;
  }

  .footer-inner {
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-align: center;
  }

  .footer-inner a {
    align-self: center;
  }
}

@media (max-width: 380px) {
  .hero-copy {
    top: 94px;
  }

  .hero-copy h1 {
    font-size: 37px;
  }

  .hero-description {
    max-width: 280px;
    font-size: 13px;
  }

  .hero-sticky {
    height: 670px;
  }

  .hero-stage {
    top: 310px;
    height: 330px;
  }

  .screen-panel {
    width: 136px;
  }

  .screen-panel-2 {
    transform: translate3d(-136px, -48%, -45px) rotateY(11deg) rotateZ(-5deg) scale(0.9);
  }

  .screen-panel-3 {
    transform: translate3d(-68px, -51%, 55px) rotateY(0) rotateZ(0);
  }

  .screen-panel-4 {
    transform: translate3d(5px, -47%, -40px) rotateY(-11deg) rotateZ(5deg) scale(0.9);
  }

  .scroll-hint {
    display: none;
  }

  .section-heading h2 {
    font-size: 37px;
  }

  .project-row {
    grid-template-columns: 28px 68px minmax(0, 1fr) 20px;
    gap: 9px;
  }

  .project-thumb {
    width: 68px;
    height: 78px;
  }

  .project-name strong {
    font-size: 16px;
  }
}

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

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

  .hero-story {
    height: 100vh;
    min-height: 640px;
  }

  .screen-panel,
  .hero-copy {
    transform: none;
  }

  .screen-panel {
    opacity: 0.5;
  }

  .screen-panel-3 {
    transform: translate3d(-10%, -50%, 0);
    opacity: 1;
  }
}
