/* ============================================================
   肖立浚 · AI Builder Portfolio — dark tech theme (light motion)
   ============================================================ */
:root {
  --bg: #0a0d12;
  --bg-2: #0e1319;
  --bg-3: #131a23;
  --line: rgba(148, 163, 184, 0.14);
  --line-strong: rgba(148, 163, 184, 0.28);
  --text: #e6edf3;
  --muted: #8b98a5;
  --dim: #5b6773;
  --accent: #34d399;
  --accent-soft: rgba(52, 211, 153, 0.12);
  --cyan: #22d3ee;
  --coral: #fb7185;
  --blue: #60a5fa;
  --amber: #fbbf24;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", "JetBrains Mono", Consolas, monospace;
  --sans: "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --radius: 14px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--text);
  font: 15px/1.75 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  /* 静态网格背景（替代粒子 Canvas，零性能开销） */
  background:
    radial-gradient(900px 480px at 75% -5%, rgba(52, 211, 153, 0.07), transparent 65%),
    radial-gradient(700px 420px at 8% 30%, rgba(34, 211, 238, 0.05), transparent 60%),
    linear-gradient(rgba(148, 163, 184, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.045) 1px, transparent 1px),
    var(--bg);
  background-size: auto, auto, 56px 56px, 56px 56px, auto;
}
body.dialog-open { overflow: hidden; }
::selection { background: rgba(52, 211, 153, 0.3); }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
img { display: block; max-width: 100%; }
.content-width { width: min(1120px, calc(100% - 48px)); margin-inline: auto; }

.skip-link {
  position: fixed; top: -48px; left: 16px; z-index: 300;
  padding: 8px 14px; background: var(--accent); color: #06281c;
  border-radius: 8px; text-decoration: none; font-weight: 600;
  transition: top 0.2s;
}
.skip-link:focus { top: 12px; }

/* ---------- hero ---------- */
.hero {
  position: relative;
  min-height: 96vh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
}
.hero-kicker {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.14em;
  color: var(--accent);
}
.status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.6);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.55); }
  70% { box-shadow: 0 0 0 9px rgba(52, 211, 153, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

.hero-title {
  margin: 18px 0 6px;
  font-size: clamp(64px, 10vw, 120px);
  line-height: 1.05; font-weight: 800; letter-spacing: 0.02em;
}
.hero-title .char {
  display: inline-block;
  opacity: 0; transform: translateY(0.6em);
  animation: char-in 0.6s cubic-bezier(0.2, 0.9, 0.3, 1.15) forwards;
  animation-delay: var(--cd, 0s);
  background: linear-gradient(120deg, #f2f7f4 30%, var(--accent) 70%, var(--cyan));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
@keyframes char-in { to { opacity: 1; transform: none; } }

.hero-typed {
  min-height: 30px;
  font-family: var(--mono); font-size: clamp(15px, 2vw, 19px);
  color: var(--cyan); margin: 4px 0 14px;
}
.typed-prefix { color: var(--accent); }
.typed-caret {
  display: inline-block; width: 9px; height: 1.1em;
  background: var(--cyan); vertical-align: -0.18em; margin-left: 3px;
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.hero-lead { color: var(--muted); font-size: 16px; max-width: 560px; margin: 0 0 30px; }

.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
.btn-primary, .btn-ghost {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 12px 22px; border-radius: 12px;
  font-weight: 600; font-size: 14.5px; text-decoration: none;
  transition: box-shadow 0.25s, border-color 0.25s, color 0.25s;
}
.btn-primary { background: var(--accent); color: #06281c; }
.btn-primary:hover { box-shadow: 0 0 28px rgba(52, 211, 153, 0.5); }
.btn-ghost {
  border: 1px solid var(--line-strong); color: var(--text);
  background: rgba(19, 26, 35, 0.6);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-primary svg, .btn-ghost svg { width: 16px; height: 16px; }

.hero-meta {
  display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap;
  margin-top: 34px; color: var(--dim); font-size: 13px;
}
.hero-meta span { display: flex; align-items: center; gap: 7px; }
.hero-meta svg { width: 14px; height: 14px; color: var(--muted); }
.hero-meta a { color: var(--muted); text-decoration: none; border-bottom: 1px dashed var(--line-strong); }
.hero-meta a:hover { color: var(--accent); border-color: var(--accent); }
.meta-sep { color: var(--line-strong); }

.scroll-hint {
  position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  color: var(--dim); text-decoration: none;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.3em;
  animation: float-y 2.4s ease-in-out infinite;
}
.scroll-hint svg { width: 18px; height: 18px; }
@keyframes float-y { 50% { transform: translate(-50%, 8px); } }

/* ---------- marquee ---------- */
.marquee {
  border-block: 1px solid var(--line);
  background: rgba(14, 19, 25, 0.7);
  overflow: hidden; padding: 14px 0;
  position: relative; z-index: 1;
}
.marquee-track {
  display: flex; align-items: center; gap: 34px;
  width: max-content;
  animation: marquee 36s linear infinite;
  will-change: transform;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-track span {
  font-family: var(--mono); font-size: 13px; letter-spacing: 0.06em;
  color: var(--muted); white-space: nowrap;
}
.marquee-track i { color: var(--accent); font-style: normal; font-size: 9px; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- method ---------- */
.method-section { padding: 72px 0 8px; }
.method-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.method-card {
  position: relative;
  padding: 26px 24px 24px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: linear-gradient(170deg, rgba(19, 26, 35, 0.7), rgba(14, 19, 25, 0.4));
  transition: border-color 0.25s, transform 0.25s;
}
.method-card:hover { border-color: rgba(52, 211, 153, 0.4); transform: translateY(-3px); }
.method-num {
  font-family: var(--mono); font-size: 13px; letter-spacing: 0.16em;
  color: var(--accent);
}
.method-card h3 { margin: 10px 0 10px; font-size: 17px; line-height: 1.5; }
.method-card p { margin: 0; color: var(--muted); font-size: 13.5px; line-height: 1.85; }
.method-card p strong { color: var(--text); font-weight: 600; }

/* ---------- section headings ---------- */
section { scroll-margin-top: 24px; }
.works-section, .about-section, .contact-section { padding: 96px 0 40px; }
.about-section {
  background: linear-gradient(180deg, transparent, rgba(14, 19, 25, 0.6) 18%, rgba(14, 19, 25, 0.6) 82%, transparent);
}
.section-heading {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 24px; margin-bottom: 40px;
  border-bottom: 1px solid var(--line); padding-bottom: 20px;
}
.section-kicker {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.22em;
  color: var(--accent);
}
.heading-group h2 {
  margin: 6px 0 0; font-size: clamp(30px, 4vw, 42px);
  letter-spacing: 0.02em;
}
.section-sidenote { color: var(--dim); font-size: 13px; }
.contact-spark { width: 26px; height: 26px; color: var(--amber); }

/* ---------- works ---------- */
.works-toolbar {
  display: flex; justify-content: space-between; align-items: center;
  gap: 18px; flex-wrap: wrap; margin-bottom: 30px;
}
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.filter {
  padding: 8px 15px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--muted); font-size: 13px;
  transition: all 0.22s;
}
.filter span { font-family: var(--mono); font-size: 11px; color: var(--dim); }
.filter:hover { border-color: var(--line-strong); color: var(--text); }
.filter.is-active {
  background: var(--accent-soft); border-color: var(--accent); color: var(--accent);
}
.filter.is-active span { color: var(--accent); }
.project-count { font-family: var(--mono); font-size: 12px; color: var(--dim); }

/* 整行项目卡：横图在上，简介在下 */
.project-list { display: flex; flex-direction: column; gap: 26px; }
.project-row {
  display: flex; flex-direction: column; gap: 22px;
  padding: 22px;
  border: 1px solid var(--line); border-radius: 20px;
  background: linear-gradient(170deg, var(--bg-3), var(--bg-2));
  position: relative; overflow: hidden;
  transition: border-color 0.25s, box-shadow 0.25s, transform 0.25s;
}
.project-row:hover {
  border-color: rgba(52, 211, 153, 0.35);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.45);
  transform: translateY(-4px);
}
.project-row::before {
  content: ""; position: absolute; inset: 0; z-index: 0;
  background: radial-gradient(480px circle at var(--mx, 30%) var(--my, 30%), rgba(52, 211, 153, 0.09), transparent 65%);
  opacity: 0; transition: opacity 0.3s; pointer-events: none;
}
.project-row:hover::before { opacity: 1; }
.project-row > * { position: relative; z-index: 1; }
.project-row[hidden] { display: none; }

.project-cover {
  display: block; width: 100%; padding: 0;
  border-radius: 14px; overflow: hidden; position: relative;
  border: 1px solid var(--line);
  background: #0b0f14;
}
.project-cover img {
  width: 100%; aspect-ratio: 16 / 9; object-fit: contain;
  transition: transform 0.45s cubic-bezier(0.2, 0.8, 0.3, 1);
}
.project-row:hover .project-cover img { transform: scale(1.02); }
.cover-corner {
  position: absolute; right: 10px; top: 10px;
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 9px;
  background: rgba(10, 13, 18, 0.75); color: var(--accent);
  border: 1px solid var(--line-strong);
  opacity: 0; transform: translate(6px, -6px);
  transition: all 0.3s;
  backdrop-filter: blur(6px);
}
.project-row:hover .cover-corner { opacity: 1; transform: none; }
.cover-corner svg { width: 15px; height: 15px; }
.award-label {
  position: absolute; left: 10px; top: 10px;
  display: flex; align-items: center; gap: 6px;
  padding: 5px 10px; border-radius: 8px;
  background: rgba(251, 191, 36, 0.14); color: var(--amber);
  border: 1px solid rgba(251, 191, 36, 0.4);
  font-size: 11.5px; font-weight: 600;
  backdrop-filter: blur(6px);
}
.award-label.oss {
  background: rgba(52, 211, 153, 0.14); color: var(--accent);
  border-color: rgba(52, 211, 153, 0.4);
}
.award-label svg { width: 13px; height: 13px; }

.project-meta {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin-bottom: 10px;
  font-family: var(--mono); font-size: 11.5px; color: var(--dim);
}
.project-type { display: flex; align-items: center; gap: 7px; }
.tiny-square { width: 7px; height: 7px; border-radius: 2px; }
.tiny-square.green { background: var(--accent); }
.tiny-square.coral { background: var(--coral); }
.tiny-square.blue { background: var(--blue); }
.tiny-square.amber { background: var(--amber); }

.project-body h3 { margin: 0; font-size: clamp(20px, 2.4vw, 26px); }
.project-body h3 button { text-align: left; padding: 0; transition: color 0.2s; }
.project-body h3 button:hover { color: var(--accent); }
.project-body h3 span { color: var(--muted); font-weight: 400; font-size: 0.72em; }
.project-summary { margin: 10px 0 16px; color: var(--muted); font-size: 14.5px; line-height: 1.75; }

.project-tags { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 16px; }
.project-tags span {
  padding: 3px 10px; border-radius: 999px;
  border: 1px solid var(--line);
  font-family: var(--mono); font-size: 11px; color: var(--muted);
}
.project-footer {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
  font-size: 12px; color: var(--dim);
}
.text-link {
  display: inline-flex; align-items: center; gap: 5px;
  color: var(--accent); font-size: 13px; text-decoration: none;
  transition: gap 0.2s;
}
.text-link:hover { gap: 9px; }
.text-link svg { width: 14px; height: 14px; }
.text-link:disabled { color: var(--dim); cursor: default; }
.text-link:disabled:hover { gap: 5px; }

/* 显眼的项目笔记按钮 */
.btn-notes {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 18px; border-radius: 10px;
  background: var(--accent); color: #06281c;
  font-weight: 600; font-size: 13.5px; white-space: nowrap;
  transition: box-shadow 0.25s, transform 0.25s;
}
.btn-notes:hover { box-shadow: 0 0 22px rgba(52, 211, 153, 0.45); transform: translateY(-1px); }
.btn-notes svg { width: 15px; height: 15px; }

/* 项目详情图集 */
.case-gallery {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 14px; margin-bottom: 24px;
}
.case-gallery figure { margin: 0; }
.case-gallery figure:only-child { grid-column: 1 / -1; }
.case-gallery img { width: 100%; border-radius: 10px; border: 1px solid var(--line); }
.case-gallery figcaption { margin-top: 7px; font-size: 12px; color: var(--dim); }

.works-endnote {
  display: flex; align-items: center; gap: 8px;
  margin-top: 36px; color: var(--muted); font-size: 14px;
}
.works-endnote svg { width: 15px; height: 15px; color: var(--dim); }
.works-endnote a { color: var(--accent); text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
.works-endnote a:hover { text-decoration: underline; }

/* ---------- terminal ---------- */
.about-grid {
  display: grid; grid-template-columns: 1.15fr 0.85fr;
  gap: 28px; align-items: start;
}
.terminal {
  border: 1px solid var(--line-strong); border-radius: 14px;
  background: #0b0f14;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}
.terminal-bar {
  display: flex; align-items: center; gap: 7px;
  padding: 11px 14px;
  background: var(--bg-3); border-bottom: 1px solid var(--line);
}
.tl { width: 11px; height: 11px; border-radius: 50%; }
.tl-red { background: #f87171; }
.tl-yellow { background: #fbbf24; }
.tl-green { background: #34d399; }
.terminal-title {
  margin-left: 8px; font-family: var(--mono); font-size: 11.5px; color: var(--dim);
}
.terminal-body {
  padding: 18px 20px 22px;
  font-family: var(--mono); font-size: 13px; line-height: 1.9;
  min-height: 460px;
}
.terminal-body .line { white-space: pre-wrap; word-break: break-word; }
.terminal-body .prompt { color: var(--accent); }
.terminal-body .cmd { color: var(--text); }
.terminal-body .out { color: var(--muted); }
.terminal-body .out strong { color: var(--cyan); font-weight: 600; }
.terminal-body .out em { color: var(--amber); font-style: normal; }
.terminal-body .caret {
  display: inline-block; width: 8px; height: 14px;
  background: var(--accent); vertical-align: -2px;
  animation: blink 1s steps(1) infinite;
}

/* ---------- timeline ---------- */
.timeline-title {
  display: flex; align-items: center; gap: 8px;
  margin: 4px 0 18px; font-size: 15px; color: var(--muted);
  font-family: var(--mono); font-weight: 500; letter-spacing: 0.06em;
}
.timeline-title svg { width: 16px; height: 16px; color: var(--accent); }
.timeline-list { list-style: none; margin: 0; padding: 0 0 0 2px; position: relative; }
.timeline-list::before {
  content: ""; position: absolute; left: 5px; top: 8px; bottom: 8px;
  width: 1px; background: linear-gradient(var(--accent), var(--line));
}
.tl-item {
  position: relative; padding: 0 0 24px 26px;
  opacity: 0; transform: translateX(14px);
  transition: opacity 0.5s, transform 0.5s;
  transition-delay: var(--td, 0s);
}
.timeline.in .tl-item { opacity: 1; transform: none; }
.tl-item:last-child { padding-bottom: 0; }
.tl-dot {
  position: absolute; left: 0; top: 7px;
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--dim);
}
.tl-dot.accent { border-color: var(--amber); }
.tl-dot.pulse { border-color: var(--accent); animation: pulse 2s infinite; }
.tl-date {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em;
  color: var(--accent);
}
.tl-item h4 { margin: 2px 0 2px; font-size: 15px; }
.tl-item p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.65; }
.tl-item small { display: block; color: var(--dim); }
.tl-item.now h4 { color: var(--accent); }

/* ---------- stack / skills ---------- */
.stack-section { padding: 96px 0 40px; }
.stack-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 18px; margin-bottom: 26px;
}
.stack-card {
  padding: 24px 22px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: linear-gradient(170deg, var(--bg-3), var(--bg-2));
  transition: border-color 0.25s, transform 0.25s;
}
.stack-card:hover { border-color: rgba(52, 211, 153, 0.4); transform: translateY(-3px); }
.stack-card > svg { width: 24px; height: 24px; color: var(--accent); }
.stack-card h4 { margin: 12px 0 6px; font-size: 16px; }
.stack-card p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.8; }

.ai-tools {
  padding: 26px 26px 22px;
  border: 1px solid rgba(52, 211, 153, 0.3);
  border-radius: 18px;
  background: linear-gradient(160deg, rgba(52, 211, 153, 0.07), rgba(14, 19, 25, 0.5));
  margin-bottom: 26px;
}
.ai-tools-head {
  display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap;
  margin-bottom: 18px;
}
.ai-tools-head h3 {
  display: flex; align-items: center; gap: 9px;
  margin: 0; font-size: 17px;
}
.ai-tools-head svg { width: 18px; height: 18px; color: var(--accent); }
.ai-tools-note { color: var(--dim); font-size: 12.5px; }
.tool-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 16px; border-radius: 999px;
  border: 1px solid var(--line-strong); color: var(--muted);
  font-family: var(--mono); font-size: 13px;
  transition: all 0.2s;
}
.chip::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  border: 1.5px solid var(--dim);
}
.chip:hover { border-color: var(--accent); color: var(--text); }
.chip.deep {
  border-color: rgba(52, 211, 153, 0.5); color: var(--accent);
  background: var(--accent-soft);
}
.chip.deep::before { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 8px rgba(52, 211, 153, 0.6); }
.chip-legend {
  display: flex; gap: 22px; margin-top: 16px;
  color: var(--dim); font-size: 12px;
}
.chip-legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend-dot {
  width: 7px; height: 7px; border-radius: 50%;
  border: 1.5px solid var(--dim);
}
.legend-dot.deep { background: var(--accent); border-color: var(--accent); }

.cert-row { display: flex; gap: 12px; flex-wrap: wrap; }
.cert {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: 12px;
  border: 1px dashed var(--line-strong); color: var(--muted);
  font-size: 13px;
  transition: all 0.2s;
}
.cert:hover { border-color: var(--amber); color: var(--text); }
.cert svg { width: 15px; height: 15px; color: var(--amber); }

/* ---------- contact ---------- */
.contact-grid {
  display: grid; grid-template-columns: 1.1fr 0.9fr;
  gap: 44px; align-items: center;
}
.contact-headline { font-size: clamp(24px, 3.2vw, 32px); font-weight: 700; line-height: 1.5; margin: 0 0 16px; }
.title-dot { color: var(--accent); }
.contact-description { color: var(--muted); margin: 0 0 20px; }
.contact-note {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 7px 14px; border-radius: 999px;
  border: 1px solid rgba(52, 211, 153, 0.35);
  background: var(--accent-soft);
  color: var(--accent); font-size: 13px;
}
.contact-actions { display: flex; flex-direction: column; gap: 16px; }
.github-contact {
  display: flex; align-items: center; gap: 16px;
  padding: 20px 22px; border-radius: 16px;
  border: 1px solid var(--line-strong);
  background: linear-gradient(160deg, var(--bg-3), var(--bg-2));
  text-decoration: none;
  transition: border-color 0.25s, box-shadow 0.25s;
}
.github-contact:hover { border-color: var(--accent); box-shadow: 0 0 32px rgba(52, 211, 153, 0.18); }
.github-contact > svg:first-child { width: 34px; height: 34px; color: var(--text); }
.github-contact > svg:last-child { width: 18px; height: 18px; color: var(--dim); margin-left: auto; }
.github-contact span { display: flex; flex-direction: column; }
.github-contact small { color: var(--dim); font-size: 12px; }
.github-contact strong { font-size: 17px; }
.contact-secondary { display: flex; gap: 12px; flex-wrap: wrap; }

/* ---------- footer ---------- */
.site-footer {
  display: flex; align-items: center; gap: 20px;
  padding: 36px 0 40px; margin-top: 60px;
  border-top: 1px solid var(--line);
  color: var(--dim); font-size: 13px;
}
.footer-note { margin-inline: auto; font-family: var(--mono); font-size: 12px; }
.back-top {
  display: flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 10px;
  border: 1px solid var(--line); color: var(--muted);
  transition: all 0.2s;
}
.back-top:hover { color: var(--accent); border-color: var(--accent); }
.back-top svg { width: 16px; height: 16px; }

/* ---------- dialogs ---------- */
dialog {
  border: 1px solid var(--line-strong);
  background: var(--bg-2); color: var(--text);
  border-radius: 18px;
  padding: 0;
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.65);
}
dialog::backdrop { background: rgba(4, 6, 9, 0.7); backdrop-filter: blur(6px); }
dialog[open] { animation: dialog-in 0.3s ease-out; }
@keyframes dialog-in { from { opacity: 0; transform: translateY(18px); } }
.dialog-topbar {
  position: sticky; top: 0; z-index: 2;
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 20px;
  background: rgba(14, 19, 25, 0.92); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.dialog-notebook {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.14em;
  color: var(--accent);
}
.dialog-notebook svg { width: 15px; height: 15px; }
.icon-button {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 10px;
  border: 1px solid var(--line); color: var(--muted);
  transition: color 0.2s, border-color 0.2s;
}
.icon-button:hover { color: var(--text); border-color: var(--line-strong); }
.icon-button svg { width: 17px; height: 17px; }

.case-dialog { width: min(760px, calc(100% - 32px)); max-height: 86vh; }
.case-content { padding: 30px 36px 20px; }
.case-kicker { font-family: var(--mono); font-size: 12px; letter-spacing: 0.12em; color: var(--accent); }
.case-content h2 { margin: 10px 0 8px; font-size: 28px; }
.case-deck { color: var(--muted); margin: 0 0 18px; }
.case-facts {
  display: flex; gap: 34px; margin: 0 0 22px;
  padding: 14px 18px; border: 1px dashed var(--line-strong); border-radius: 12px;
}
.case-facts dt { font-family: var(--mono); font-size: 11px; color: var(--dim); letter-spacing: 0.08em; }
.case-facts dd { margin: 3px 0 0; font-size: 13.5px; }
.case-figure { margin: 0 0 26px; }
.case-figure img { border-radius: 12px; border: 1px solid var(--line); }
.case-figure figcaption { margin-top: 9px; font-size: 12px; color: var(--dim); }
.case-section { margin-bottom: 24px; }
.case-section h3 {
  display: flex; align-items: baseline; gap: 10px;
  font-size: 17px; margin: 0 0 8px;
}
.case-section h3 span { font-family: var(--mono); font-size: 12px; color: var(--accent); }
.case-section p { color: var(--muted); margin: 0 0 8px; }
.case-section ul { margin: 0; padding: 0; list-style: none; }
.case-section li { position: relative; padding-left: 18px; margin-bottom: 7px; color: var(--muted); }
.case-section li::before { content: "▸"; position: absolute; left: 0; color: var(--accent); }
.case-section li strong { color: var(--text); }
.case-highlight {
  padding: 16px 20px; border-radius: 12px;
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  color: #b9e8d4; font-size: 14px;
  margin-bottom: 24px;
}
.case-links { display: flex; gap: 12px; flex-wrap: wrap; padding-bottom: 10px; }
.case-links a {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px; border-radius: 10px;
  border: 1px solid var(--line-strong);
  color: var(--text); text-decoration: none; font-size: 13.5px;
  transition: all 0.2s;
}
.case-links a:hover { border-color: var(--accent); color: var(--accent); }
.case-links svg { width: 15px; height: 15px; }
.case-bottom-bar {
  position: sticky; bottom: 0;
  display: flex; justify-content: space-between; align-items: center;
  padding: 13px 20px;
  background: rgba(14, 19, 25, 0.92); backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
}
.case-bottom-bar span { font-family: var(--mono); font-size: 12px; color: var(--dim); }

.resume-dialog { width: min(560px, calc(100% - 32px)); }
.resume-content { padding: 28px 30px 32px; }
.resume-content h2 { margin: 8px 0 4px; font-size: 24px; }
.resume-content > p { color: var(--muted); margin: 0 0 22px; }
.resume-option {
  display: flex; align-items: center; gap: 16px;
  padding: 18px; margin-bottom: 14px;
  border: 1px solid var(--line); border-radius: 14px;
  transition: border-color 0.2s, background 0.2s;
}
.resume-option:hover { border-color: rgba(52, 211, 153, 0.4); background: rgba(19, 26, 35, 0.6); }
.resume-option > svg { width: 26px; height: 26px; color: var(--accent); flex-shrink: 0; }
.resume-option h3 { margin: 0 0 2px; font-size: 16px; }
.resume-option p { margin: 0 0 6px; color: var(--muted); font-size: 13px; }
.resume-option a:not(.download-button) {
  color: var(--accent); font-size: 13px; text-decoration: none;
  display: inline-flex; align-items: center; gap: 5px;
}
.resume-option a:not(.download-button):hover { text-decoration: underline; }
.resume-option a svg { width: 13px; height: 13px; }
.download-button { margin-left: auto; flex-shrink: 0; }

/* ---------- toast ---------- */
.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%);
  z-index: 320;
  display: flex; align-items: center; gap: 9px;
  padding: 11px 18px; border-radius: 12px;
  background: var(--bg-3); border: 1px solid rgba(52, 211, 153, 0.45);
  color: var(--text); font-size: 13.5px;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.5);
  animation: toast-in 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
.toast[hidden] { display: none; }
.toast svg { width: 15px; height: 15px; color: var(--accent); }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 12px); } }

.noscript-note {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 500;
  padding: 14px 20px; background: var(--bg-3); color: var(--muted);
  border-top: 1px solid var(--line); font-size: 13px;
}
.noscript-note a { color: var(--accent); }

/* ---------- reveal ---------- */
.reveal {
  opacity: 0; transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.2, 0.8, 0.3, 1);
  transition-delay: var(--d, 0s);
}
.reveal.in { opacity: 1; transform: none; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .stack-grid { grid-template-columns: repeat(2, 1fr); }
  .method-grid { grid-template-columns: 1fr; }
  .about-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; gap: 30px; }
}
@media (max-width: 600px) {
  .stack-grid { grid-template-columns: 1fr; }
  .hero { min-height: 92vh; }
  .case-gallery { grid-template-columns: 1fr; }
  .section-heading { flex-direction: column; align-items: flex-start; gap: 8px; }
  .case-content { padding: 22px 20px 14px; }
  .case-facts { flex-direction: column; gap: 10px; }
  .method-section { padding-top: 52px; }
  .method-card { padding: 20px 18px; }
  .works-section, .about-section, .contact-section { padding-top: 72px; }
  .project-row { padding: 16px; }
}

/* ---------- reduced motion ---------- */
@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;
  }
  .reveal, .tl-item, .hero-title .char { opacity: 1 !important; transform: none !important; }
  .marquee-track { animation: none; flex-wrap: wrap; width: 100%; justify-content: center; }
}
