:root {
  --ink: #f7f5ef;
  --muted: #9ba1b4;
  --paper: #090b12;
  --panel: #111522;
  --line: rgba(255,255,255,.12);
  --orange: #ff6b2c;
  --yellow: #ffd166;
  --green: #55e6a5;
  --radius: 28px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 86% 6%, rgba(255,107,44,.2), transparent 25rem),
    linear-gradient(180deg, #090b12 0%, #0b0e17 60%, #080a10 100%);
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  min-height: 100vh;
}

button, a { font: inherit; }
a { color: inherit; }

.site-header {
  width: min(1240px, calc(100% - 40px));
  margin: 0 auto;
  height: 92px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.brand { display: inline-flex; gap: 12px; align-items: center; text-decoration: none; font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.brand img { width: 42px; height: 42px; object-fit: contain; }
.header-note { color: var(--muted); font-size: 14px; display: flex; align-items: center; gap: 9px; }
.live-dot { width: 8px; height: 8px; background: var(--green); border-radius: 50%; box-shadow: 0 0 14px var(--green); }

main { width: min(1240px, calc(100% - 40px)); margin: 0 auto; }
.intro { padding: 100px 0 64px; }
.eyebrow { color: var(--orange); font: 700 13px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .14em; margin: 0 0 22px; }
h1 { max-width: 940px; margin: 0; font-size: clamp(48px, 8vw, 106px); line-height: .96; letter-spacing: -.07em; }
h1 span { color: transparent; -webkit-text-stroke: 1px rgba(247,245,239,.72); }
.lede { max-width: 590px; margin: 36px 0 0; color: var(--muted); font-size: 18px; line-height: 1.75; }
.toolbar { margin-top: 48px; display: flex; gap: 10px; flex-wrap: wrap; }
.filter { cursor: pointer; color: var(--muted); border: 1px solid var(--line); background: rgba(255,255,255,.03); border-radius: 999px; padding: 11px 17px; transition: .2s ease; }
.filter b { font-size: 12px; margin-left: 8px; color: #626a80; }
.filter:hover, .filter:focus-visible { color: white; border-color: rgba(255,255,255,.3); transform: translateY(-1px); }
.filter.is-active { color: #16100a; background: var(--yellow); border-color: var(--yellow); }
.filter.is-active b { color: rgba(22,16,10,.55); }

.gallery { display: grid; grid-template-columns: repeat(12, 1fr); gap: 20px; padding-bottom: 120px; }
.project-card {
  grid-column: span 4;
  min-width: 0;
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--line);
  cursor: pointer;
  text-align: left;
  padding: 0;
  color: inherit;
  isolation: isolate;
  transform: translateY(18px);
  opacity: 0;
  animation: reveal .58s cubic-bezier(.2,.7,.2,1) forwards;
  animation-delay: calc(var(--i) * 70ms);
}
.project-card:nth-child(1), .project-card:nth-child(5) { grid-column: span 8; }
.project-card[hidden] { display: none; }
.project-image { aspect-ratio: 4 / 3; overflow: hidden; background: #151927; }
.project-image img { width: 100%; height: 100%; object-fit: cover; object-position: top center; display: block; transition: transform .55s cubic-bezier(.2,.7,.2,1); }
.project-card:nth-child(1) .project-image, .project-card:nth-child(5) .project-image { aspect-ratio: 3 / 2; }
.project-card:hover .project-image img, .project-card:focus-visible .project-image img { transform: scale(1.035); }
.project-card:focus-visible { outline: 2px solid var(--yellow); outline-offset: 4px; }
.project-meta { position: relative; z-index: 2; min-height: 118px; padding: 20px 24px 22px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 18px; background: var(--panel); }
.project-meta > div { min-width: 0; }
.project-index { color: var(--orange); font: 700 12px/1 ui-monospace, monospace; letter-spacing: .08em; }
.project-title { display: block; max-width: 100%; margin: 12px 0 0; color: #fff; font-size: clamp(22px, 2vw, 31px); line-height: 1.2; letter-spacing: -.04em; white-space: normal; word-break: break-word; overflow-wrap: anywhere; }
.project-tag { margin-top: 10px; color: var(--muted); font-size: 14px; }
.open-mark { width: 46px; height: 46px; border-radius: 50%; background: rgba(255,255,255,.08); display: grid; place-items: center; font-size: 22px; transition: .2s ease; }
.project-card:hover .open-mark { background: var(--orange); transform: rotate(8deg); }

footer { border-top: 1px solid var(--line); width: min(1240px, calc(100% - 40px)); margin: 0 auto; padding: 54px 0 70px; display: grid; grid-template-columns: 1fr 2fr auto; gap: 28px; align-items: center; color: var(--muted); }
.footer-brand { color: var(--ink); font-size: 22px; font-weight: 800; }
footer p { margin: 0; }
footer a { text-decoration: none; color: var(--yellow); }

.detail-dialog { width: min(980px, calc(100% - 32px)); max-height: min(86vh, 820px); padding: 0; border: 1px solid rgba(255,255,255,.16); border-radius: 30px; color: var(--ink); background: #0f1320; overflow: hidden; box-shadow: 0 40px 120px rgba(0,0,0,.7); }
.detail-dialog::backdrop { background: rgba(3,4,8,.82); backdrop-filter: blur(10px); }
.detail-dialog[open] { display: grid; grid-template-columns: minmax(300px, .9fr) 1.1fr; }
.dialog-visual { min-height: 560px; background: #080a10; overflow: hidden; }
.dialog-visual img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.dialog-copy { padding: 72px 58px; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; }
.dialog-kicker { color: var(--orange); font: 700 13px/1.2 ui-monospace, monospace; letter-spacing: .12em; }
.dialog-copy h2 { margin: 18px 0; font-size: clamp(36px, 5vw, 62px); line-height: 1.04; letter-spacing: -.06em; }
.dialog-copy > p:not(.dialog-kicker) { color: var(--muted); line-height: 1.8; font-size: 17px; }
.primary-action { margin-top: 30px; display: inline-flex; align-items: center; justify-content: space-between; gap: 38px; min-width: 220px; padding: 16px 20px; border-radius: 999px; text-decoration: none; background: var(--yellow); color: #171108; font-weight: 800; }
.dialog-close { position: absolute; top: 16px; right: 16px; z-index: 2; width: 42px; height: 42px; border: 0; border-radius: 50%; color: white; background: rgba(0,0,0,.52); cursor: pointer; font-size: 28px; line-height: 1; }

@keyframes reveal { to { transform: translateY(0); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; } .project-card { opacity: 1; transform: none; } }

@media (max-width: 920px) {
  .intro { padding-top: 70px; }
  .project-card, .project-card:nth-child(1), .project-card:nth-child(5) { grid-column: 1 / -1; }
  .project-image, .project-card:nth-child(1) .project-image, .project-card:nth-child(5) .project-image { aspect-ratio: 4 / 3; }
  .project-meta { min-height: 114px; }
  .detail-dialog[open] { grid-template-columns: 1fr; overflow-y: auto; }
  .dialog-visual { min-height: 340px; max-height: 46vh; }
  .dialog-copy { padding: 38px 28px 44px; }
  footer { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .site-header, main, footer { width: min(100% - 24px, 1240px); }
  .site-header { height: 74px; }
  .brand img { width: 36px; height: 36px; }
  .header-note { font-size: 0; }
  .intro { padding: 58px 0 42px; }
  h1 { font-size: clamp(46px, 15vw, 70px); }
  .lede { font-size: 16px; margin-top: 28px; }
  .toolbar { margin-top: 34px; }
  .gallery { gap: 14px; padding-bottom: 76px; }
  .project-card, .project-card:nth-child(1), .project-card:nth-child(5) { border-radius: 22px; }
  .project-image, .project-card:nth-child(1) .project-image, .project-card:nth-child(5) .project-image { aspect-ratio: 5 / 4; }
  .project-meta { min-height: 106px; padding: 16px 18px 18px; grid-template-columns: minmax(0, 1fr) 42px; gap: 14px; }
  .project-title { font-size: 22px; line-height: 1.25; }
  .open-mark { width: 42px; height: 42px; }
}
