/* ===========================================================
   邓洪洮 · 互动编程作品集
   =========================================================== */

:root {
  --bg:          #0a0d16;
  --bg-soft:     #0e1220;
  --surface:     #131a2a;
  --surface-2:   #1a2338;
  --line:        rgba(255, 255, 255, .09);
  --line-strong: rgba(255, 255, 255, .16);
  --text:        #eef1f8;
  --muted:       #98a2ba;
  --faint:       #66718c;
  --violet:      #9382f8;
  --violet-soft: rgba(147, 130, 248, .14);
  --amber:       #f1ad68;
  --gold:        #f1c96b;
  --gold-soft:   rgba(241, 201, 107, .13);
  --green:       #57d992;
  --green-soft:  rgba(87, 217, 146, .13);
  --radius:      22px;
  --mono: ui-monospace, SFMono-Regular, "Cascadia Code", Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
          "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 84px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
::selection { background: var(--violet); color: #fff; }

/* ---------- ambient light ---------- */
.ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(680px 520px at 78% -6%, rgba(147,130,248,.16), transparent 68%),
    radial-gradient(560px 480px at 4% 42%, rgba(241,173,104,.075), transparent 70%),
    radial-gradient(620px 520px at 92% 88%, rgba(87,217,146,.07), transparent 70%);
}
main, .nav, .footer { position: relative; z-index: 1; }

/* ---------- nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid transparent;
  transition: background .3s ease, border-color .3s ease, backdrop-filter .3s ease;
}
.nav.scrolled {
  background: rgba(10, 13, 22, .82);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-bottom-color: var(--line);
}
.nav-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 18px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand { display: flex; align-items: center; gap: 12px; font-weight: 650; letter-spacing: .01em; }
.brand-mark {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--violet), #6f5ce0);
  color: #fff;
  font: 700 11px/1 var(--mono);
  letter-spacing: .06em;
  box-shadow: 0 6px 20px rgba(147,130,248,.28);
}
.brand-text em { font-style: normal; color: var(--faint); font: 400 12px/1 var(--mono); letter-spacing: .04em; }
.nav-links { display: flex; align-items: center; gap: 34px; font-size: 14px; color: var(--muted); }
.nav-links a { transition: color .2s ease; }
.nav-links a:hover { color: var(--text); }
.nav-cta {
  padding: 9px 18px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--text) !important;
  background: rgba(255,255,255,.04);
  transition: background .2s ease, border-color .2s ease, transform .2s ease;
}
.nav-cta:hover { background: var(--violet-soft); border-color: var(--violet); transform: translateY(-1px); }
.nav-cta span { color: var(--violet); margin-left: 4px; }
.nav-toggle { display: none; background: none; border: 0; padding: 8px; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--text); margin: 5px 0; border-radius: 2px; transition: transform .25s ease; }

/* ---------- shared ---------- */
.section { max-width: 1180px; margin: 0 auto; padding: 110px 32px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font: 500 12px/1 var(--mono);
  letter-spacing: .12em;
  color: var(--muted);
  text-transform: uppercase;
  margin: 0 0 28px;
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--violet); box-shadow: 0 0 0 4px var(--violet-soft); }
.period { color: var(--violet); }
.accent {
  background: linear-gradient(100deg, var(--violet) 10%, #c9a0f5 48%, var(--amber) 92%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 13px 24px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .01em;
  transition: transform .2s ease, background .2s ease, border-color .2s ease, box-shadow .2s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary {
  background: linear-gradient(135deg, var(--violet), #7561e8);
  color: #fff;
  box-shadow: 0 10px 26px rgba(147,130,248,.24);
}
.btn-primary:hover { box-shadow: 0 14px 32px rgba(147,130,248,.36); }
.btn-ghost { border-color: var(--line-strong); color: var(--text); background: rgba(255,255,255,.03); }
.btn-ghost:hover { border-color: var(--violet); background: var(--violet-soft); }
.btn-link { color: var(--muted); padding-left: 6px; padding-right: 6px; }
.btn-link:hover { color: var(--violet); }
.play { font-size: 11px; }

.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; }
.tags li {
  font: 500 11px/1 var(--mono);
  letter-spacing: .03em;
  color: var(--muted);
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255,255,255,.025);
}
.note-label {
  display: block;
  font: 500 11px/1 var(--mono);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 12px;
}

/* ---------- hero ---------- */
.hero { max-width: 1180px; margin: 0 auto; padding: 72px 32px 60px; min-height: 88vh; display: flex; flex-direction: column; justify-content: center; }
.hero-inner { display: grid; grid-template-columns: 1.08fr .92fr; align-items: center; gap: 56px; }
.hero-copy h1 {
  margin: 0 0 26px;
  font-size: clamp(2.9rem, 5.6vw, 5rem);
  line-height: 1.1;
  letter-spacing: -.035em;
  font-weight: 720;
}
.hero-desc { color: var(--muted); font-size: 16px; line-height: 1.95; margin: 0 0 30px; max-width: 520px; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-bottom: 38px; }
.hero-meta span {
  font: 500 11px/1 var(--mono);
  color: var(--faint);
  letter-spacing: .06em;
  padding-left: 14px;
  position: relative;
}
.hero-meta span::before { content: ""; position: absolute; left: 0; top: 4px; width: 5px; height: 5px; border-radius: 50%; background: var(--line-strong); }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-actions .btn span { font-size: 15px; }

.hero-visual { position: relative; height: 520px; display: grid; place-items: center; }
.visual-glow {
  position: absolute; width: 380px; height: 380px; border-radius: 50%;
  background: radial-gradient(circle, rgba(147,130,248,.28), transparent 66%);
  filter: blur(24px);
}
.visual-card {
  position: relative;
  width: 288px; height: 436px;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: 0 30px 70px rgba(0,0,0,.55), 0 0 0 8px rgba(255,255,255,.025);
  transform: rotate(4deg);
  animation: floaty 7s ease-in-out infinite;
}
.visual-card img { width: 100%; height: 100%; object-fit: cover; }
@keyframes floaty { 0%,100% { transform: rotate(4deg) translateY(0); } 50% { transform: rotate(2deg) translateY(-14px); } }
.visual-chip {
  position: absolute;
  font: 600 11px/1 var(--mono);
  letter-spacing: .04em;
  padding: 9px 14px;
  border-radius: 9px;
  background: rgba(19,26,42,.9);
  border: 1px solid var(--line-strong);
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 26px rgba(0,0,0,.35);
}
.chip-a { top: 62px; right: 6px; color: var(--violet); animation: floaty 6s ease-in-out infinite .4s; }
.chip-b { bottom: 74px; left: 0; color: var(--amber); animation: floaty 8s ease-in-out infinite 1s; }
.orbit { position: absolute; border: 1px dashed rgba(255,255,255,.09); border-radius: 50%; }
.orbit-1 { width: 430px; height: 430px; }
.orbit-2 { width: 530px; height: 530px; border-style: solid; border-color: rgba(255,255,255,.035); }

.scroll-hint { margin-top: 56px; display: flex; align-items: center; gap: 14px; font: 500 10px/1 var(--mono); letter-spacing: .22em; color: var(--faint); }
.scroll-hint i { display: block; width: 58px; height: 1px; background: linear-gradient(90deg, var(--faint), transparent); }

/* ---------- section head ---------- */
.section-head { margin-bottom: 56px; }
.section-no { font: 500 11px/1 var(--mono); letter-spacing: .18em; color: var(--violet); margin-bottom: 18px; }
.section-no span { color: var(--faint); margin: 0 6px; }
.section-head h2 { margin: 0 0 14px; font-size: clamp(2rem, 3.6vw, 2.9rem); letter-spacing: -.03em; line-height: 1.2; font-weight: 700; }
.section-head p { margin: 0; color: var(--muted); font-size: 15px; }

/* ---------- work cards ---------- */
.works { padding-top: 40px; }
.work-card {
  display: grid;
  grid-template-columns: .9fr 1.1fr;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 40px;
  transition: border-color .3s ease, transform .3s ease, box-shadow .3s ease;
}
.work-card:hover { border-color: var(--line-strong); box-shadow: 0 24px 60px rgba(0,0,0,.28); }
.work-card.is-reverse { grid-template-columns: 1.1fr .9fr; }
.work-card.is-reverse .work-media { order: 2; }
.work-card.is-reverse .work-body { order: 1; }

.work-media { position: relative; min-height: 560px; background: #0d1220; overflow: hidden; }
.work-media img { width: 100%; height: 100%; object-fit: cover; object-position: center; transition: transform .7s ease; }
.work-card:hover .work-media img { transform: scale(1.035); }
.media-tall img { object-position: center 42%; }
.work-media::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(8,11,20,.28) 0%, transparent 30%, transparent 62%, rgba(8,11,20,.55) 100%);
  pointer-events: none;
}
.work-badge {
  position: absolute; top: 22px; left: 22px; z-index: 2;
  padding: 8px 14px; border-radius: 999px;
  font: 600 11px/1 var(--mono); letter-spacing: .03em;
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,.18);
}
.badge-violet { background: rgba(147,130,248,.22); color: #d6cbff; }
.badge-green  { background: rgba(87,217,146,.18); color: #b7f2d0; border-color: rgba(87,217,146,.3); }
.badge-gold   { background: rgba(241,201,107,.16); color: #f7dfa4; border-color: rgba(241,201,107,.34); }

/* 第三件作品：金 / 星夜的强调色 */
.work-card.is-gold .work-index { color: var(--gold); }
.work-card.is-gold .work-note { border-left-color: var(--gold); }
/* 竖长裁切时把焦点右移，留住月亮与右侧柏树 */
.work-card.is-gold .work-media img { object-position: 82% center; }
.media-corner {
  position: absolute; bottom: 20px; right: 22px; z-index: 2;
  font: 500 10px/1 var(--mono); letter-spacing: .1em; color: rgba(255,255,255,.6);
}

.work-body { padding: 46px 46px 40px; display: flex; flex-direction: column; }
.work-top { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.work-index { font: 700 12px/1 var(--mono); color: var(--violet); letter-spacing: .08em; }
.is-reverse .work-index { color: var(--green); }
.work-rule { flex: 1; height: 1px; background: var(--line); }
.work-cat { font: 500 11px/1 var(--mono); color: var(--faint); letter-spacing: .06em; }
.work-body h3 { margin: 0 0 12px; font-size: clamp(1.7rem, 2.6vw, 2.25rem); letter-spacing: -.025em; font-weight: 700; }
.work-body h3 em { font: 400 14px/1 var(--mono); color: var(--faint); margin-left: 10px; letter-spacing: .02em; }
.work-one { margin: 0 0 30px; color: var(--text); font-size: 16px; opacity: .92; }
.work-note { padding: 22px 24px; background: rgba(255,255,255,.025); border: 1px solid var(--line); border-left: 2px solid var(--violet); border-radius: 0 12px 12px 0; margin-bottom: 26px; }
.is-reverse .work-note { border-left-color: var(--green); }
.work-note p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.9; }
.work-tech { margin-bottom: 30px; }
.work-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 24px; }

.code-details { margin-top: auto; border-top: 1px solid var(--line); padding-top: 18px; }
.code-details summary {
  cursor: pointer; list-style: none;
  font-size: 13px; color: var(--muted);
  display: flex; align-items: center; gap: 8px;
  transition: color .2s ease;
}
.code-details summary::-webkit-details-marker { display: none; }
.code-details summary::before { content: "+"; font: 500 15px/1 var(--mono); color: var(--violet); }
.code-details[open] summary::before { content: "−"; }
.code-details summary:hover { color: var(--text); }
.code-details summary code { font: 500 11px/1 var(--mono); color: var(--faint); }
.code-details pre {
  margin: 18px 0 0; padding: 22px;
  background: #080b14; border: 1px solid var(--line); border-radius: 12px;
  overflow-x: auto; max-height: 380px;
  font: 400 12px/1.85 var(--mono);
  color: #b9c4de;
}
.code-details pre code { font: inherit; }
.details-text { margin: 16px 0 0; font-size: 13px; color: var(--muted); line-height: 1.9; }
.details-text code { font: 500 11px/1 var(--mono); color: var(--amber); background: rgba(241,173,104,.1); padding: 3px 6px; border-radius: 4px; }
.details-text a { color: var(--violet); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- about ---------- */
.about { padding-top: 60px; }
.about-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 22px; }
.about-card, .about-facts {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 36px;
}
.about-card { display: flex; gap: 24px; align-items: flex-start; }
.about-avatar {
  flex: 0 0 72px; width: 72px; height: 72px; border-radius: 18px;
  display: grid; place-items: center;
  font-size: 30px; font-weight: 700;
  background: linear-gradient(135deg, var(--violet), var(--amber));
  color: #0a0d16;
  box-shadow: 0 12px 30px rgba(147,130,248,.22);
}
.about-card h3 { margin: 2px 0 6px; font-size: 1.4rem; letter-spacing: -.02em; }
.about-role { margin: 0 0 16px; font: 500 12px/1 var(--mono); color: var(--violet); letter-spacing: .04em; }
.about-text { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.95; }
.about-facts { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 24px 20px; }
.about-facts div { min-width: 0; }
.about-facts dt { font: 500 10px/1 var(--mono); letter-spacing: .12em; color: var(--faint); text-transform: uppercase; margin-bottom: 8px; }
.about-facts dd { margin: 0; font-size: 14px; color: var(--text); }
.about-facts dd a { color: var(--violet); }
.about-facts dd a:hover { text-decoration: underline; text-underline-offset: 3px; }
.skill-row { margin-top: 24px; padding: 28px 34px; border: 1px dashed var(--line-strong); border-radius: var(--radius); }

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--line); background: linear-gradient(180deg, transparent, rgba(147,130,248,.045)); margin-top: 60px; }
.footer-inner { max-width: 1180px; margin: 0 auto; padding: 90px 32px 34px; }
.footer-cta h2 { margin: 0 0 26px; font-size: clamp(2.2rem, 4.4vw, 3.6rem); line-height: 1.16; letter-spacing: -.035em; font-weight: 720; }
.footer-mail { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; margin: 0 0 28px; }
.footer-mail span { font: 500 11px/1 var(--mono); letter-spacing: .12em; color: var(--faint); text-transform: uppercase; }
.footer-mail a { font-size: 20px; color: var(--text); border-bottom: 1px solid var(--violet); padding-bottom: 3px; }
.footer-mail a:hover { color: var(--violet); }
.footer-mail em { font-style: normal; font-size: 12px; color: var(--amber); }
.footer-links { display: flex; gap: 26px; font-size: 14px; color: var(--muted); }
.footer-links a:hover { color: var(--text); }
.footer-bottom {
  margin-top: 76px; padding-top: 24px; border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px;
  font: 400 11px/1.6 var(--mono); color: var(--faint); letter-spacing: .02em;
}

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 24px; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(4,6,13,.86); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.modal-panel {
  position: relative;
  width: min(1040px, 100%);
  max-height: calc(100vh - 48px);
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 40px 100px rgba(0,0,0,.6);
  animation: pop .28s cubic-bezier(.2,.8,.25,1);
}
@keyframes pop { from { opacity: 0; transform: translateY(16px) scale(.98); } to { opacity: 1; transform: none; } }
.modal-bar { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px 14px 24px; border-bottom: 1px solid var(--line); }
.modal-title { font: 600 13px/1 var(--mono); letter-spacing: .04em; color: var(--text); }
.modal-close { width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--line); background: rgba(255,255,255,.04); color: var(--muted); font-size: 20px; line-height: 1; transition: all .2s ease; }
.modal-close:hover { color: var(--text); background: var(--violet-soft); border-color: var(--violet); }
.modal-stage { flex: 1; min-height: 0; background: #080b14; display: grid; place-items: center; overflow: auto; }
.modal-stage iframe { display: block; width: 100%; height: min(660px, 72vh); border: 0; }
.modal-stage video { display: block; width: 100%; max-height: min(660px, 72vh); background: #000; }
.modal-foot { padding: 12px 20px; font: 400 11px/1.5 var(--mono); color: var(--faint); border-top: 1px solid var(--line); text-align: center; }
body.modal-open { overflow: hidden; }

/* ---------- reveal ---------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s ease, transform .7s cubic-bezier(.2,.8,.25,1); }
.reveal.visible { opacity: 1; transform: none; }

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
  .hero-inner { grid-template-columns: 1fr; gap: 20px; }
  .hero { padding-top: 52px; min-height: auto; }
  .hero-visual { height: 380px; order: -1; }
  .visual-card { width: 210px; height: 318px; }
  .orbit-1 { width: 320px; height: 320px; }
  .orbit-2 { width: 390px; height: 390px; }
  .work-card, .work-card.is-reverse { grid-template-columns: 1fr; }
  .work-card.is-reverse .work-media { order: 0; }
  .work-card.is-reverse .work-body { order: 0; }
  .work-media { min-height: 340px; max-height: 420px; }
  .about-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .nav-inner { padding: 14px 20px; }
  .nav-toggle { display: block; }
  .nav-links {
    position: absolute; top: 100%; left: 0; right: 0;
    display: none; flex-direction: column; align-items: stretch; gap: 0;
    background: rgba(12,16,28,.97); backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--line); padding: 10px 20px 18px;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px 4px; border-bottom: 1px solid var(--line); }
  .nav-cta { text-align: center; border: 1px solid var(--line-strong); margin-top: 10px; }
  .section { padding: 76px 20px; }
  .hero { padding: 40px 20px 40px; }
  .hero-copy h1 { font-size: clamp(2.4rem, 10vw, 3.3rem); }
  .hero-desc { font-size: 15px; }
  .hero-desc br { display: none; }
  .scroll-hint { margin-top: 34px; }
  .work-body { padding: 30px 24px 28px; }
  .work-media { min-height: 280px; max-height: 330px; }
  .work-body h3 em { display: block; margin: 8px 0 0; }
  .work-actions .btn { flex: 1 1 auto; }
  .about-card { flex-direction: column; gap: 18px; padding: 28px; }
  .about-facts { padding: 28px; grid-template-columns: 1fr; gap: 18px; }
  .skill-row { padding: 22px; }
  .footer-inner { padding: 68px 20px 28px; }
  .footer-bottom { margin-top: 52px; flex-direction: column; }
  .modal { padding: 10px; }
  .modal-panel { max-height: calc(100vh - 20px); border-radius: 14px; }
  .modal-stage iframe, .modal-stage video { height: min(560px, 68vh); max-height: 68vh; }
  .modal-foot { font-size: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}
