/* ==========================================================================
   陈墨 · AI 研究与落地 — 样式表
   无框架、无外部字体依赖，直接打开 index.html 即可预览
   ========================================================================== */

/* ---------- Design tokens ---------- */
:root {
  --bg: #f7f6f2;
  --bg-soft: #eeede7;
  --surface: #ffffff;
  --text: #15181d;
  --text-soft: #414852;
  --muted: #6d7580;
  --line: rgba(21, 24, 29, 0.1);
  --line-strong: rgba(21, 24, 29, 0.18);
  --ghost: rgba(21, 24, 29, 0.055);
  --accent: #0d7a67;
  --accent-soft: rgba(13, 122, 103, 0.1);
  --accent-line: rgba(13, 122, 103, 0.28);
  --glow-1: rgba(13, 122, 103, 0.14);
  --glow-2: rgba(196, 142, 68, 0.12);
  --header-bg: rgba(247, 246, 242, 0.76);
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-md: 0 2px 4px rgba(16, 24, 40, 0.04), 0 16px 40px -18px rgba(16, 24, 40, 0.22);
  --shadow-lg: 0 30px 70px -30px rgba(16, 24, 40, 0.35);
  --term-bg: #10161a;
  --term-text: #d5dfe2;
  --panel: #10161b;
  --radius-sm: 10px;
  --radius: 18px;
  --radius-lg: 26px;
  --max: 1120px;
  --font-sans: "Inter", "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-serif: "Newsreader", "Noto Serif SC", "Songti SC", "STSong", Georgia,
    "Times New Roman", serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.22, 0.61, 0.25, 1);
}

[data-theme="dark"] {
  --bg: #0c0f12;
  --bg-soft: #101419;
  --surface: #13181d;
  --text: #edf1f3;
  --text-soft: #b4bdc5;
  --muted: #8b959e;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.17);
  --ghost: rgba(255, 255, 255, 0.05);
  --accent: #5eead4;
  --accent-soft: rgba(94, 234, 212, 0.11);
  --accent-line: rgba(94, 234, 212, 0.3);
  --glow-1: rgba(94, 234, 212, 0.11);
  --glow-2: rgba(120, 140, 255, 0.09);
  --header-bg: rgba(12, 15, 18, 0.76);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 2px 4px rgba(0, 0, 0, 0.25), 0 18px 44px -18px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 30px 80px -30px rgba(0, 0, 0, 0.75);
  --term-bg: #0a0e11;
  --panel: #11181d;
}

/* ---------- Reset ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  transition: background-color 0.35s ease, color 0.35s ease;
}

h1,
h2,
h3,
p,
dl,
dd,
ol,
ul {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

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

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

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

::selection {
  background: var(--accent);
  color: var(--bg);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

section {
  scroll-margin-top: 88px;
}

/* ---------- Utilities ---------- */
.container {
  width: min(100% - 48px, var(--max));
  margin-inline: auto;
}

.mono {
  font-family: var(--font-mono);
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  z-index: 200;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  background: var(--text);
  color: var(--bg);
  font-size: 0.9rem;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 12px;
}

.progress {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 70;
  height: 2px;
  pointer-events: none;
}

.progress span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent));
  opacity: 0.9;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--header-bg);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease, background-color 0.3s ease;
}

.site-header.is-scrolled {
  border-bottom-color: var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  height: 68px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.logo-mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--text);
  color: var(--bg);
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.logo-text {
  font-size: 1.02rem;
}

.logo-dot {
  color: var(--accent);
}

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav a {
  position: relative;
  padding: 0.45rem 0.7rem;
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.9rem;
  transition: color 0.2s ease;
}

.nav a::after {
  content: "";
  position: absolute;
  left: 0.7rem;
  right: 0.7rem;
  bottom: 2px;
  height: 1.5px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s var(--ease);
}

.nav a:hover {
  color: var(--text);
}

.nav a:hover::after,
.nav a.is-active::after {
  transform: scaleX(1);
}

.nav a.is-active {
  color: var(--text);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--text-soft);
  transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}

.icon-btn:hover {
  border-color: var(--line-strong);
  color: var(--text);
  background: var(--ghost);
}

[data-theme="light"] .icon-moon,
[data-theme="dark"] .icon-sun {
  display: none;
}

.menu-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 38px;
  height: 38px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 50%;
}

.menu-btn span {
  display: block;
  height: 1.5px;
  background: var(--text);
  transition: transform 0.25s var(--ease), opacity 0.2s ease;
}

.menu-btn[aria-expanded="true"] span:first-child {
  transform: translateY(3.25px) rotate(45deg);
}

.menu-btn[aria-expanded="true"] span:last-child {
  transform: translateY(-3.25px) rotate(-45deg);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0.8rem 1.4rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.94rem;
  font-weight: 500;
  white-space: nowrap;
  transition: transform 0.2s var(--ease), box-shadow 0.2s ease,
    background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.btn-primary {
  background: var(--text);
  color: var(--bg);
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-primary svg {
  transition: transform 0.25s var(--ease);
}

.btn-primary:hover svg {
  transform: translateX(3px);
}

.btn-ghost {
  border-color: var(--line-strong);
  color: var(--text-soft);
}

.btn-ghost:hover {
  border-color: var(--text);
  color: var(--text);
  background: var(--ghost);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding-block: clamp(56px, 8vw, 104px) clamp(56px, 8vw, 100px);
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(560px 420px at 12% 8%, var(--glow-1), transparent 68%),
    radial-gradient(520px 380px at 88% 22%, var(--glow-2), transparent 70%);
}

.hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 64px 64px;
  opacity: 0.45;
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, #000 10%, transparent 75%);
  mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, #000 10%, transparent 75%);
}

.hero-inner {
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  align-items: center;
  gap: clamp(36px, 5vw, 72px);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 0.34rem 0.8rem 0.34rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.pulse {
  position: relative;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  flex: none;
}

.pulse::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 1px solid var(--accent);
  animation: ping 2.4s var(--ease) infinite;
}

@keyframes ping {
  0% {
    transform: scale(0.7);
    opacity: 0.8;
  }
  70%,
  100% {
    transform: scale(1.9);
    opacity: 0;
  }
}

.hero h1 {
  margin-top: 22px;
  font-family: var(--font-serif);
  font-size: clamp(2.5rem, 5.2vw, 4.1rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.018em;
}

.hero h1 em {
  font-style: normal;
  color: var(--accent);
  background: linear-gradient(180deg, transparent 63%, var(--accent-soft) 63%);
  padding-inline: 0.06em;
}

.lede {
  max-width: 36em;
  margin-top: 24px;
  color: var(--text-soft);
  font-size: clamp(1rem, 0.35vw + 0.92rem, 1.08rem);
  line-height: 1.85;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-top: 46px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.stat {
  display: flex;
  flex-direction: column-reverse;
  gap: 4px;
}

.stat dd {
  font-family: var(--font-serif);
  font-size: clamp(1.6rem, 2.4vw, 2rem);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.02em;
}

.stat dd span {
  color: var(--accent);
  font-size: 0.72em;
  margin-left: 1px;
}

.stat dt {
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.4;
}

/* Hero terminal card */
.hero-card {
  width: 100%;
  max-width: 430px;
  justify-self: end;
  transform: rotate(-1.1deg);
  transition: transform 0.45s var(--ease);
}

.hero-card:hover {
  transform: rotate(0deg) translateY(-2px);
}

.terminal {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  background: var(--term-bg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.terminal-bar .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.dot-r {
  background: #ff5f57;
}
.dot-y {
  background: #febc2e;
}
.dot-g {
  background: #28c840;
}

.terminal-bar em {
  margin-left: auto;
  margin-right: auto;
  padding-right: 33px;
  color: rgba(213, 223, 226, 0.45);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-style: normal;
  letter-spacing: 0.04em;
}

.terminal-body {
  padding: 18px 20px 20px;
  color: var(--term-text);
  font-family: var(--font-mono);
  font-size: 0.79rem;
  line-height: 2.05;
  overflow-x: auto;
}

.terminal-body p {
  white-space: nowrap;
}

.t-dim {
  color: rgba(213, 223, 226, 0.42);
}

.t-accent {
  color: #5eead4;
}

.t-ok {
  color: #7ee787;
}

.caret {
  display: inline-block;
  width: 7px;
  height: 14px;
  vertical-align: -2px;
  background: #5eead4;
  animation: blink 1.1s steps(1) infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

.hero-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding-inline: 4px;
  color: var(--muted);
  font-size: 0.74rem;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.hero-card-foot .mono {
  font-size: 0.7rem;
  letter-spacing: 0.02em;
  opacity: 0.75;
}

/* ---------- Sections ---------- */
.section {
  padding-block: clamp(68px, 8.5vw, 110px);
}

.section-soft {
  background: var(--bg-soft);
  border-block: 1px solid var(--line);
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 40px;
  margin-bottom: clamp(32px, 4vw, 50px);
}

.section-head .section-desc {
  max-width: 320px;
  padding-bottom: 6px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.75;
  text-align: right;
}

.section-kicker {
  margin-bottom: 14px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.section-title {
  font-family: var(--font-serif);
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 600;
  line-height: 1.18;
  letter-spacing: -0.012em;
}

/* ---------- About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 0.82fr 1.18fr;
  gap: clamp(32px, 6vw, 80px);
}

.section-side {
  position: sticky;
  top: 108px;
  align-self: start;
}

.about-lead {
  color: var(--text) !important;
  font-size: clamp(1.08rem, 0.5vw + 0.98rem, 1.22rem) !important;
  line-height: 1.8 !important;
}

.about-body p {
  max-width: 62ch;
  margin-bottom: 18px;
  color: var(--text-soft);
  line-height: 1.9;
}

.skills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 30px;
}

.skills li {
  padding: 0.4rem 0.78rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-soft);
  font-size: 0.8rem;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.skills li:hover {
  border-color: var(--accent-line);
  color: var(--accent);
}

/* ---------- Research ---------- */
.research-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.research-card {
  position: relative;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  transition: transform 0.3s var(--ease), border-color 0.3s ease,
    box-shadow 0.3s ease;
}

.research-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent-line);
  box-shadow: var(--shadow-md);
}

.research-index {
  position: absolute;
  top: 16px;
  right: 22px;
  color: var(--ghost);
  font-family: var(--font-serif);
  font-size: 3.1rem;
  font-weight: 600;
  line-height: 1;
  pointer-events: none;
}

.research-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 22px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
}

.research-card h3 {
  margin-bottom: 8px;
  font-size: 1.08rem;
  font-weight: 600;
  letter-spacing: -0.005em;
}

.research-card p {
  max-width: 40ch;
  color: var(--text-soft);
  font-size: 0.9rem;
  line-height: 1.8;
}

.mini-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--muted);
}

.mini-tags li::before {
  content: "#";
  margin-right: 2px;
  color: var(--accent);
  opacity: 0.7;
}

/* ---------- Filters ---------- */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 26px;
}

.filter {
  padding: 0.42rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.82rem;
  transition: color 0.2s ease, border-color 0.2s ease,
    background-color 0.2s ease;
}

.filter:hover {
  border-color: var(--line-strong);
  color: var(--text);
}

.filter.is-active {
  border-color: var(--text);
  background: var(--text);
  color: var(--bg);
}

/* ---------- Cases ---------- */
.case-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
}

.case-card {
  display: flex;
  flex-direction: column;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  transition: transform 0.3s var(--ease), border-color 0.3s ease,
    box-shadow 0.3s ease;
}

.case-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent-line);
  box-shadow: var(--shadow-md);
}

.case-card[hidden] {
  display: none;
}

.case-card.is-filtering-in {
  animation: card-in 0.35s var(--ease) both;
}

@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.case-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.tag {
  padding: 0.26rem 0.52rem;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.case-year {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.72rem;
}

.case-card h3 {
  margin-bottom: 10px;
  font-size: 1.12rem;
  font-weight: 600;
  letter-spacing: -0.005em;
}

.case-card > p {
  color: var(--text-soft);
  font-size: 0.88rem;
  line-height: 1.78;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 20px 0 18px;
  padding-block: 15px;
  border-block: 1px dashed var(--line);
}

.metrics li {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.metrics strong {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.metrics span {
  color: var(--muted);
  font-size: 0.7rem;
}

.stack {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
}

.stack li {
  padding: 0.22rem 0.48rem;
  border-radius: 5px;
  background: var(--bg-soft);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.01em;
}

[data-theme="dark"] .stack li {
  background: rgba(255, 255, 255, 0.05);
}

.case-more {
  margin-top: 34px;
  text-align: center;
  color: var(--muted);
  font-size: 0.82rem;
}

/* ---------- Notes ---------- */
.note-list {
  border-top: 1px solid var(--line);
}

.note-item {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 24px;
  padding-block: 26px;
  border-bottom: 1px solid var(--line);
  transition: padding 0.25s ease;
}

.note-meta {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding-top: 3px;
}

.note-meta time {
  color: var(--text-soft);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.02em;
}

.note-meta span {
  padding: 0.1rem 0.4rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.62rem;
}

.note-body h3 {
  margin-bottom: 7px;
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  transition: color 0.2s ease;
}

.note-item:hover .note-body h3 {
  color: var(--accent);
}

.note-body p {
  max-width: 66ch;
  color: var(--text-soft);
  font-size: 0.88rem;
  line-height: 1.8;
}

/* ---------- Contact ---------- */
.contact-panel {
  position: relative;
  padding: clamp(32px, 6vw, 64px);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius-lg);
  background: var(--panel);
  color: #f3f6f5;
  overflow: hidden;
}

.contact-glow {
  position: absolute;
  top: -140px;
  right: -100px;
  width: 460px;
  height: 460px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(94, 234, 212, 0.16), transparent 65%);
  pointer-events: none;
}

.kicker-light {
  color: rgba(243, 246, 245, 0.5);
}

.contact-panel h2 {
  position: relative;
  margin-block: 8px 16px;
  font-family: var(--font-serif);
  font-size: clamp(2.05rem, 4vw, 3.15rem);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.015em;
}

.contact-desc {
  position: relative;
  max-width: 46ch;
  color: rgba(243, 246, 245, 0.66);
  font-size: 0.95rem;
  line-height: 1.8;
}

.contact-actions {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.btn-light {
  background: #f3f6f5;
  color: #0c1215;
  font-family: var(--font-mono);
  font-size: 0.86rem;
}

.btn-light:hover {
  transform: translateY(-1px);
  background: #ffffff;
}

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0.8rem 1.15rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  color: rgba(243, 246, 245, 0.8);
  font-size: 0.86rem;
  transition: border-color 0.2s ease, color 0.2s ease,
    background-color 0.2s ease;
}

.copy-btn:hover {
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.socials {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 26px;
  margin-top: 38px;
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.socials a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: rgba(243, 246, 245, 0.66);
  font-size: 0.86rem;
  transition: color 0.2s ease;
}

.socials a:hover {
  color: #fff;
}

.socials a span {
  opacity: 0.55;
  font-size: 0.78em;
}

/* ---------- Footer ---------- */
.site-footer {
  padding-block: 26px;
  border-top: 1px solid var(--line);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  font-size: 0.78rem;
}

.back-top {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--text-soft);
  transition: color 0.2s ease;
}

.back-top:hover {
  color: var(--accent);
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 120;
  padding: 0.65rem 1rem;
  border-radius: 10px;
  background: var(--text);
  color: var(--bg);
  font-size: 0.84rem;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 10px);
  transition: opacity 0.25s ease, transform 0.25s var(--ease);
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------- Reveal on scroll ---------- */
.js .reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  transition-delay: var(--d, 0s);
}

.js .reveal.in {
  opacity: 1;
  transform: none;
}

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .hero-inner {
    grid-template-columns: 1fr;
  }

  .hero-card {
    max-width: 470px;
    justify-self: start;
    margin-top: 8px;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .section-side {
    position: static;
  }

  .section-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }

  .section-head .section-desc {
    padding-bottom: 0;
    text-align: left;
  }
}

@media (max-width: 860px) {
  .menu-btn {
    display: flex;
  }

  .nav {
    position: absolute;
    top: calc(100% + 6px);
    left: 24px;
    right: 24px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: var(--shadow-md);
  }

  .nav.is-open {
    display: flex;
  }

  .nav a {
    padding: 0.65rem 0.75rem;
    border-radius: 8px;
    font-size: 0.94rem;
  }

  .nav a::after {
    display: none;
  }

  .nav a:hover,
  .nav a.is-active {
    background: var(--ghost);
    color: var(--text);
  }

  .research-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .container {
    width: calc(100% - 32px);
  }

  .header-inner {
    height: 62px;
  }

  section {
    scroll-margin-top: 78px;
  }

  .logo-text {
    font-size: 0.98rem;
  }

  .hero {
    padding-top: 40px;
  }

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

  .stats {
    gap: 12px;
    margin-top: 36px;
  }

  .stat dt {
    font-size: 0.7rem;
  }

  .terminal-body {
    font-size: 0.72rem;
    padding: 15px 16px 18px;
  }

  .note-item {
    grid-template-columns: 1fr;
    gap: 10px;
    padding-block: 22px;
  }

  .note-meta {
    align-items: center;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .contact-actions .btn,
  .contact-actions .copy-btn {
    width: 100%;
    justify-content: center;
  }

  .socials {
    gap: 20px;
  }
}

@media (max-width: 420px) {
  .hero-cta {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-cta .btn {
    width: 100%;
  }

  .metrics strong {
    font-size: 1.25rem;
  }
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .js .reveal {
    opacity: 1;
    transform: none;
  }

  .hero-card {
    transform: none;
  }
}
