/* ==========================================================================
   AGANG — personal site design system
   A single, dependency-free stylesheet. Dark first, light supported.
   ========================================================================== */

/* 1. Design tokens ------------------------------------------------------- */
:root {
  --bg: #070a0b;
  --bg-soft: #0a0e10;
  --surface: #0e1416;
  --surface-2: #131c1f;
  --text: #e9f2ef;
  --text-strong: #ffffff;
  --muted: #94a7a1;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.16);
  --accent: #2ee6a8;
  --accent-2: #47c9ff;
  --accent-ink: #032218;
  --accent-soft: rgba(46, 230, 168, 0.1);
  --accent-ring: rgba(46, 230, 168, 0.35);
  --warm: #ffb86b;
  --hot: #ff8a8a;
  --shadow-lg: 0 40px 80px -40px rgba(0, 0, 0, 0.85);
  --shadow-md: 0 20px 40px -24px rgba(0, 0, 0, 0.7);
  --radius-sm: 12px;
  --radius: 18px;
  --radius-lg: 26px;
  --shell: 1180px;
  --gutter: clamp(20px, 4vw, 40px);
  --header-h: 68px;
  --font-sans: "Segoe UI Variable Text", "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei",
    "Noto Sans SC", "Source Han Sans SC", sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei",
    "Noto Sans SC", sans-serif;
  --font-mono: "Cascadia Code", "JetBrains Mono", "SFMono-Regular", Consolas,
    "Liberation Mono", monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: dark;
}

[data-theme="light"] {
  --bg: #f4f7f5;
  --bg-soft: #eef3f0;
  --surface: #ffffff;
  --surface-2: #f0f4f2;
  --text: #0c1612;
  --text-strong: #05100c;
  --muted: #586a64;
  --line: rgba(8, 26, 19, 0.1);
  --line-strong: rgba(8, 26, 19, 0.18);
  --accent: #0b9c72;
  --accent-2: #0a7fb8;
  --accent-ink: #ffffff;
  --accent-soft: rgba(11, 156, 114, 0.09);
  --accent-ring: rgba(11, 156, 114, 0.28);
  --warm: #b26d12;
  --hot: #cf4d4d;
  --shadow-lg: 0 40px 80px -46px rgba(9, 40, 30, 0.45);
  --shadow-md: 0 18px 36px -24px rgba(9, 40, 30, 0.32);
  color-scheme: light;
}

/* 2. Reset & base -------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 24px);
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(55rem 38rem at 88% -12%, rgba(46, 230, 168, 0.13), transparent 62%),
    radial-gradient(45rem 32rem at -8% 6%, rgba(71, 201, 255, 0.1), transparent 60%);
  background-repeat: no-repeat;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

[data-theme="light"] body {
  background-image:
    radial-gradient(55rem 38rem at 88% -12%, rgba(11, 156, 114, 0.12), transparent 62%),
    radial-gradient(45rem 32rem at -8% 6%, rgba(10, 127, 184, 0.09), transparent 60%);
}

img,
svg,
video,
iframe {
  max-width: 100%;
}

img {
  height: auto;
  border-style: none;
}

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

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

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 650;
  line-height: 1.22;
  letter-spacing: -0.02em;
  color: var(--text-strong);
  text-wrap: balance;
}

p {
  margin: 0;
  text-wrap: pretty;
}

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

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

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

.mt-6 {
  margin-top: 24px;
}

/* 3. Layout primitives --------------------------------------------------- */
.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  padding-block: clamp(56px, 8vw, 104px);
}

.section--tight {
  padding-block: clamp(36px, 5vw, 64px);
}

.section--soft {
  background: linear-gradient(180deg, transparent, var(--bg-soft) 18%, var(--bg-soft) 82%, transparent);
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 200;
  transform: translateY(-150%);
  background: var(--accent);
  color: var(--accent-ink);
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 650;
  transition: transform 0.2s var(--ease);
}

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.icon {
  width: 20px;
  height: 20px;
  flex: none;
  display: block;
}

/* 4. Header & navigation ------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  border-bottom: 1px solid transparent;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  backdrop-filter: blur(16px) saturate(160%);
  transition: border-color 0.25s ease, background 0.25s ease;
}

.site-header.is-scrolled {
  border-bottom-color: var(--line);
  background: color-mix(in srgb, var(--bg) 90%, transparent);
}

@supports not (background: color-mix(in srgb, red 50%, blue)) {
  .site-header {
    background: rgba(7, 10, 11, 0.82);
  }
  [data-theme="light"] .site-header {
    background: rgba(244, 247, 245, 0.86);
  }
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 18px;
  height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-right: auto;
  font-family: var(--font-display);
  font-size: 1.06rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text-strong);
}

.brand-logo {
  width: 38px;
  height: 38px;
  flex: none;
  object-fit: contain;
}

.brand-name span {
  color: var(--accent);
}

.brand-sub {
  margin-left: 2px;
  padding-left: 12px;
  border-left: 1px solid var(--line);
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: var(--muted);
}

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

.nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--muted);
  transition: color 0.2s ease, background 0.2s ease;
}

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

.nav a[aria-current="page"] {
  color: var(--text-strong);
  background: var(--surface-2);
}

.nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 2px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  transform: translateX(-50%);
}

.nav .nav-ext {
  color: var(--accent);
}

.nav .nav-ext:hover {
  color: var(--accent);
  background: var(--accent-soft);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 6px;
}

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

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

.icon-btn:active {
  transform: scale(0.96);
}

.theme-toggle .icon-sun {
  display: none;
}

[data-theme="light"] .theme-toggle .icon-sun {
  display: block;
}

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

.menu-toggle {
  display: none;
}

/* 5. Buttons, tags & pills ----------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.94rem;
  font-weight: 620;
  letter-spacing: 0.01em;
  white-space: nowrap;
  transition: transform 0.2s var(--ease), box-shadow 0.2s ease,
    background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn .icon {
  width: 18px;
  height: 18px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--accent-ink);
  box-shadow: 0 12px 30px -14px var(--accent-ring);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 38px -14px var(--accent-ring);
}

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

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

.btn-soft {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 24%, transparent);
}

.btn-soft:hover {
  background: color-mix(in srgb, var(--accent) 18%, transparent);
}

.btn-sm {
  min-height: 38px;
  padding: 0 16px;
  font-size: 0.85rem;
}

.btn-block {
  width: 100%;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  font-size: 0.72rem;
  font-weight: 550;
  line-height: 1.6;
  color: var(--muted);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.tag-open {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 28%, transparent);
  background: var(--accent-soft);
}

.tag-hot {
  color: var(--warm);
  border-color: color-mix(in srgb, var(--warm) 28%, transparent);
  background: color-mix(in srgb, var(--warm) 10%, transparent);
}

.tag-new {
  color: var(--hot);
  border-color: color-mix(in srgb, var(--hot) 28%, transparent);
  background: color-mix(in srgb, var(--hot) 9%, transparent);
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.eyebrow .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

/* 6. Section headings ---------------------------------------------------- */
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: clamp(24px, 3.5vw, 40px);
}

.section-head h2 {
  margin-top: 10px;
  font-size: clamp(1.65rem, 3.4vw, 2.35rem);
}

.section-head p {
  margin-top: 10px;
  max-width: 52ch;
  color: var(--muted);
  font-size: 0.96rem;
}

.section-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  padding-bottom: 4px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
  transition: color 0.2s ease;
}

.section-link:hover {
  color: var(--accent);
}

.section-link .icon {
  width: 16px;
  height: 16px;
}

/* 7. Hero --------------------------------------------------------------- */
.hero {
  position: relative;
  padding-block: clamp(48px, 7vw, 92px) clamp(40px, 6vw, 76px);
  overflow: clip;
}

.hero::before {
  content: "";
  position: absolute;
  inset: -20% -10% auto 45%;
  height: 70%;
  background: radial-gradient(closest-side, rgba(46, 230, 168, 0.16), transparent 72%);
  filter: blur(10px);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}

.hero-copy {
  max-width: 630px;
}

.hero h1 {
  margin-top: 18px;
  font-size: clamp(2.5rem, 5.6vw, 4rem);
  line-height: 1.08;
  letter-spacing: -0.035em;
}

.hero h1 .grad {
  background: linear-gradient(115deg, var(--accent) 10%, var(--accent-2) 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-lede {
  margin-top: 22px;
  max-width: 46ch;
  font-size: clamp(1rem, 1.3vw, 1.1rem);
  line-height: 1.85;
  color: var(--muted);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.hero-note {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
  margin-top: 30px;
  font-size: 0.8rem;
  color: var(--muted);
}

.hero-note span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.hero-note .icon {
  width: 15px;
  height: 15px;
  color: var(--accent);
}

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(20px, 4vw, 40px);
  margin-top: 38px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}

.stat dt {
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.stat dd {
  margin: 4px 0 0;
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-strong);
}

.stat dd span {
  margin-left: 3px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--muted);
}

/* Hero media / status card */
.hero-media {
  position: relative;
  justify-self: end;
  width: 100%;
  max-width: 420px;
}

.hero-media::before {
  content: "";
  position: absolute;
  inset: 8% -8% -6% 10%;
  border-radius: 40px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  opacity: 0.16;
  filter: blur(34px);
  pointer-events: none;
}

.status-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-lg);
  transition: transform 0.4s var(--ease), border-color 0.3s ease;
}

.status-card:hover {
  transform: translateY(-4px);
  border-color: var(--line-strong);
}

.status-media {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--surface-2);
}

.status-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease);
}

.status-card:hover .status-media img {
  transform: scale(1.04);
}

.status-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(4, 10, 8, 0.55));
  pointer-events: none;
}

.status-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(5, 14, 11, 0.55);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  font-size: 0.72rem;
  font-weight: 600;
  color: #fff;
}

.status-badge .icon {
  width: 13px;
  height: 13px;
  color: var(--accent);
}

.status-body {
  padding: 20px 22px 22px;
}

.status-kicker {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}

.status-body h2 {
  margin-top: 8px;
  font-size: 1.22rem;
  line-height: 1.4;
}

.status-body p {
  margin-top: 6px;
  font-size: 0.86rem;
  color: var(--muted);
}

.status-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.status-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text);
}

.status-link:hover {
  color: var(--accent);
}

.status-link .icon {
  width: 15px;
  height: 15px;
}

.wave {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 26px;
}

.wave i {
  width: 3px;
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  opacity: 0.75;
  transform-origin: bottom;
  animation: wave 1.4s ease-in-out infinite alternate;
}

.wave i:nth-child(2n) {
  animation-delay: -0.3s;
}
.wave i:nth-child(3n) {
  animation-delay: -0.6s;
}
.wave i:nth-child(4n) {
  animation-delay: -0.15s;
}
.wave i:nth-child(5n) {
  animation-delay: -0.9s;
}
.wave i:nth-child(1) {
  height: 35%;
}
.wave i:nth-child(2) {
  height: 70%;
}
.wave i:nth-child(3) {
  height: 45%;
}
.wave i:nth-child(4) {
  height: 90%;
}
.wave i:nth-child(5) {
  height: 60%;
}
.wave i:nth-child(6) {
  height: 100%;
}
.wave i:nth-child(7) {
  height: 55%;
}

@keyframes wave {
  from {
    transform: scaleY(0.45);
  }
  to {
    transform: scaleY(1);
  }
}

/* 8. Entry cards -------------------------------------------------------- */
.entry-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.entry-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 22px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--surface), color-mix(in srgb, var(--surface) 60%, var(--bg)));
  overflow: hidden;
  transition: transform 0.3s var(--ease), border-color 0.3s ease, background 0.3s ease;
}

.entry-card::after {
  content: "";
  position: absolute;
  inset: auto -30% -60% auto;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0;
  filter: blur(60px);
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.entry-card:hover {
  transform: translateY(-4px);
  border-color: var(--line-strong);
}

.entry-card:hover::after {
  opacity: 0.18;
}

.entry-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 13px;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 20%, transparent);
}

.entry-icon .icon {
  width: 22px;
  height: 22px;
}

.entry-card h3 {
  font-size: 1.12rem;
  letter-spacing: 0;
}

.entry-card p {
  margin-top: 6px;
  font-size: 0.84rem;
  line-height: 1.65;
  color: var(--muted);
}

.entry-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
}

.entry-foot .icon {
  width: 16px;
  height: 16px;
  transition: transform 0.25s var(--ease);
}

.entry-card:hover .entry-foot .icon {
  transform: translateX(3px);
}

/* 9. Project cards ------------------------------------------------------ */
.project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

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

.project-card:hover {
  transform: translateY(-4px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-md);
}

.project-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.project-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  object-fit: cover;
}

.project-icon--placeholder {
  display: grid;
  place-items: center;
  color: var(--warm);
  background:
    radial-gradient(circle at 30% 20%, color-mix(in srgb, var(--warm) 22%, transparent), transparent 65%),
    var(--surface-2);
}

.project-icon--placeholder .icon {
  width: 26px;
  height: 26px;
}

.project-icon--accent {
  color: var(--accent);
  background:
    radial-gradient(circle at 30% 20%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 65%),
    var(--surface-2);
}

.project-icon--cool {
  color: var(--accent-2);
  background:
    radial-gradient(circle at 30% 20%, color-mix(in srgb, var(--accent-2) 22%, transparent), transparent 65%),
    var(--surface-2);
}

.project-card h3 {
  font-size: 1.08rem;
  letter-spacing: 0;
}

.project-card p {
  font-size: 0.86rem;
  line-height: 1.7;
  color: var(--muted);
}

.project-foot {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: auto;
  padding-top: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
}

.project-foot .icon {
  width: 15px;
  height: 15px;
  transition: transform 0.25s var(--ease), color 0.2s ease;
}

.project-card:hover .project-foot {
  color: var(--accent);
}

.project-card:hover .project-foot .icon {
  transform: translateX(3px);
}

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

/* 10. Software filter chips -------------------------------------------- */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 26px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 0.82rem;
  font-weight: 550;
  color: var(--muted);
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

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

.chip[aria-pressed="true"] {
  color: var(--accent-ink);
  border-color: transparent;
  background: var(--accent);
}

.chip .count {
  font-size: 0.72rem;
  opacity: 0.7;
}

/* 11. Video cards ------------------------------------------------------- */
.video-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px 20px;
}

.video-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.video-card.is-hidden {
  display: none;
}

.table-wrap {
  margin: 1.6em 0;
  overflow-x: auto;
  border-radius: var(--radius-sm);
}

.table-wrap table {
  min-width: 520px;
}

.video-thumb {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface-2);
}

.video-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease), opacity 0.3s ease;
}

.video-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 45%, rgba(3, 9, 7, 0.55));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.video-play {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.3s ease, transform 0.3s var(--ease);
}

.video-play span {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: #07110d;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.video-play .icon {
  width: 20px;
  height: 20px;
  margin-left: 2px;
  fill: currentColor;
  stroke: none;
}

.video-card:hover .video-thumb img {
  transform: scale(1.05);
}

.video-card:hover .video-thumb::after,
.video-card:hover .video-play {
  opacity: 1;
  transform: scale(1);
}

.video-card h3 {
  font-size: 0.98rem;
  line-height: 1.55;
  letter-spacing: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.video-card h3 a:hover {
  color: var(--accent);
}

.video-desc {
  font-size: 0.82rem;
  line-height: 1.7;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.video-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding-top: 2px;
  font-size: 0.74rem;
  color: var(--muted);
}

/* Featured video / embed */
.feature-video {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 0.55fr);
  gap: 0;
  overflow: hidden;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--surface);
}

.feature-video .ratio {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
}

.feature-video .ratio iframe,
.embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.feature-video .feature-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: clamp(22px, 3vw, 34px);
  border-left: 1px solid var(--line);
}

.feature-video h2 {
  font-size: clamp(1.25rem, 2vw, 1.55rem);
  line-height: 1.4;
}

.feature-video p {
  font-size: 0.88rem;
  line-height: 1.75;
  color: var(--muted);
}

.feature-video .feature-meta {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 0.78rem;
  color: var(--muted);
}

/* 12. Article rows / cards --------------------------------------------- */
.article-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.article-row {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 22px 24px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  transition: transform 0.25s var(--ease), border-color 0.25s ease, background 0.25s ease;
}

.article-row:hover {
  transform: translateX(3px);
  border-color: var(--line-strong);
  background: var(--surface-2);
}

.article-row-main {
  min-width: 0;
  flex: 1;
}

.article-row h3 {
  font-size: 1.06rem;
  letter-spacing: 0;
}

.article-row p {
  margin-top: 5px;
  font-size: 0.86rem;
  color: var(--muted);
}

.article-row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.article-row .icon {
  width: 18px;
  height: 18px;
  color: var(--muted);
  transition: transform 0.25s var(--ease), color 0.25s ease;
}

.article-row:hover .icon {
  transform: translateX(3px);
  color: var(--accent);
}

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

.pack-card {
  display: grid;
  grid-template-columns: 148px minmax(0, 1fr);
  gap: 22px;
  align-items: center;
  padding: 18px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  transition: transform 0.3s var(--ease), border-color 0.3s ease;
}

.pack-card:hover {
  transform: translateY(-3px);
  border-color: var(--line-strong);
}

.pack-card img {
  width: 148px;
  height: 148px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
}

.pack-card h3 {
  font-size: 1.1rem;
  letter-spacing: 0;
}

.pack-card p {
  margin-top: 7px;
  font-size: 0.84rem;
  line-height: 1.7;
  color: var(--muted);
}

.pack-card .btn {
  margin-top: 14px;
}

/* 14. Page hero (inner pages) ------------------------------------------ */
.page-hero {
  position: relative;
  padding-block: clamp(40px, 6vw, 72px) clamp(32px, 4vw, 52px);
  border-bottom: 1px solid var(--line);
  overflow: clip;
}

.page-hero::before {
  content: "";
  position: absolute;
  inset: -60% 30% auto auto;
  width: 520px;
  height: 420px;
  background: radial-gradient(closest-side, var(--accent-soft), transparent 75%);
  pointer-events: none;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 22px;
  font-size: 0.8rem;
  color: var(--muted);
}

.breadcrumb a:hover {
  color: var(--accent);
}

.breadcrumb .sep {
  opacity: 0.45;
}

.breadcrumb [aria-current="page"] {
  color: var(--text);
}

.page-hero h1 {
  margin-top: 12px;
  font-size: clamp(2.1rem, 5vw, 3.2rem);
  letter-spacing: -0.03em;
}

.page-hero .lede {
  margin-top: 16px;
  max-width: 62ch;
  font-size: 1rem;
  line-height: 1.85;
  color: var(--muted);
}

.page-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  margin-top: 24px;
  font-size: 0.82rem;
  color: var(--muted);
}

.page-meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.page-meta .icon {
  width: 15px;
  height: 15px;
  color: var(--accent);
}

/* 15. Detail layout ---------------------------------------------------- */
.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: clamp(32px, 5vw, 64px);
  align-items: start;
}

.detail-aside {
  position: sticky;
  top: calc(var(--header-h) + 24px);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.info-card {
  padding: 22px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
}

.info-card h2 {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.info-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

.info-list div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  font-size: 0.85rem;
}

.info-list dt {
  color: var(--muted);
  white-space: nowrap;
}

.info-list dd {
  margin: 0;
  text-align: right;
  color: var(--text);
  font-weight: 550;
  overflow-wrap: anywhere;
}

.info-card .btn + .btn {
  margin-top: 10px;
}

.info-card-actions {
  margin-top: 18px;
}

.aside-note {
  padding: 18px 20px;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--line-strong);
  font-size: 0.8rem;
  line-height: 1.75;
  color: var(--muted);
}

.aside-note strong {
  color: var(--text);
}

/* 16. Prose (article / long-form content) ------------------------------ */
.prose {
  max-width: 72ch;
  font-size: 1rem;
  line-height: 1.95;
  color: var(--text);
}

.prose > * + * {
  margin-top: 1.15em;
}

.prose h2 {
  margin-top: 2.4em;
  padding-top: 0.2em;
  font-size: clamp(1.3rem, 2.4vw, 1.6rem);
  scroll-margin-top: calc(var(--header-h) + 24px);
}

.prose h2:first-child {
  margin-top: 0;
}

.prose h3 {
  margin-top: 1.8em;
  font-size: 1.14rem;
  scroll-margin-top: calc(var(--header-h) + 24px);
}

.prose h4 {
  margin-top: 1.6em;
  font-size: 1rem;
}

.prose p {
  color: var(--muted);
}

.prose strong,
.prose b {
  color: var(--text-strong);
  font-weight: 650;
}

.prose em {
  color: var(--text);
}

.prose a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.2s ease;
}

.prose a:hover {
  text-decoration-color: var(--accent);
}

/* Buttons keep their own colours inside long-form content. */
.prose a.btn {
  text-decoration: none;
}

.prose a.btn-primary {
  color: var(--accent-ink);
}

.prose a.btn-ghost {
  color: var(--text);
}

.prose a.btn-ghost:hover {
  color: var(--accent);
}

.prose a.btn-soft {
  color: var(--accent);
}

.prose ul,
.prose ol {
  padding-left: 1.25em;
  color: var(--muted);
}

.prose ul {
  list-style: disc;
}

.prose ol {
  list-style: decimal;
}

.prose li + li {
  margin-top: 0.4em;
}

.prose li::marker {
  color: var(--accent);
}

.prose img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface);
}

.prose img.img-natural {
  width: auto;
  max-width: 100%;
  margin-inline: auto;
}

.prose figure {
  margin: 1.8em 0;
}

.prose figure img {
  margin: 0;
}

.prose figcaption {
  margin-top: 10px;
  font-size: 0.78rem;
  line-height: 1.6;
  color: var(--muted);
  text-align: center;
}

.prose blockquote {
  margin: 1.8em 0;
  padding: 16px 20px;
  border-left: 2px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--accent-soft);
  color: var(--text);
  font-size: 0.94rem;
}

.prose blockquote p {
  color: var(--text);
}

.prose code {
  padding: 2px 6px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  font-family: var(--font-mono);
  font-size: 0.86em;
  color: var(--accent);
}

.prose pre {
  overflow-x: auto;
  padding: 18px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface-2);
  line-height: 1.7;
}

.prose pre code {
  padding: 0;
  border: 0;
  background: none;
  color: var(--text);
  font-size: 0.84rem;
}

.prose hr {
  margin: 2.6em 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.prose .note {
  padding: 12px 16px;
  border-left: 2px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--accent-soft);
  font-size: 0.9rem;
  line-height: 1.75;
  color: var(--muted);
}

.spoiler {
  margin-top: 1.2em;
  padding: 14px 18px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.spoiler summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text);
  list-style-position: inside;
}

.spoiler summary::marker {
  color: var(--accent);
}

.spoiler p {
  margin-top: 10px;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.prose th,
.prose td {
  padding: 10px 12px;
  border: 1px solid var(--line);
  text-align: left;
}

.prose th {
  background: var(--surface-2);
  color: var(--text);
}

/* Images inside prose that are screenshots: limit extreme width */
.prose img {
  cursor: zoom-in;
}

/* 17. Callouts & next/prev --------------------------------------------- */
.embed {
  position: relative;
  aspect-ratio: 16 / 9;
  margin: 1.6em 0;
  overflow: hidden;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: #000;
}

.embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.figure-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 1.8em 0;
}

.figure-grid figure {
  margin: 0;
}

.figure-grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (max-width: 640px) {
  .figure-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.callout {
  display: flex;
  gap: 14px;
  padding: 18px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid color-mix(in srgb, var(--warm) 26%, transparent);
  background: color-mix(in srgb, var(--warm) 8%, transparent);
  font-size: 0.88rem;
  line-height: 1.75;
  color: var(--text);
}

.callout .icon {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  color: var(--warm);
}

.callout strong {
  color: var(--warm);
}

.callout p {
  margin-top: 4px;
  color: var(--muted);
}

.callout .btn-row {
  margin-top: 14px;
}

.callout--info {
  border-color: color-mix(in srgb, var(--accent) 26%, transparent);
  background: var(--accent-soft);
}

.callout--info .icon,
.callout--info strong {
  color: var(--accent);
}

.pager {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: clamp(36px, 5vw, 56px);
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.pager a {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 18px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  transition: border-color 0.2s ease, transform 0.2s var(--ease);
}

.pager a:hover {
  border-color: var(--line-strong);
  transform: translateY(-2px);
}

.pager .pager-label {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.pager .pager-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
}

.pager .next {
  text-align: right;
  align-items: flex-end;
}

/* 18. TOC / series ------------------------------------------------------ */
.article-single {
  max-width: 780px;
  margin-inline: auto;
}

.group-card {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: clamp(24px, 4vw, 48px);
  align-items: center;
  padding: clamp(22px, 3vw, 34px);
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--surface);
}

.group-qr {
  padding: 14px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: #fff;
}

.group-qr img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
}

.group-card h2 {
  margin-top: 10px;
  font-size: clamp(1.5rem, 3vw, 2rem);
}

.group-card p {
  margin-top: 10px;
  max-width: 46ch;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.8;
}

.group-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.group-note {
  margin-top: 16px;
  font-size: 0.78rem;
  color: var(--muted);
}

@media (max-width: 640px) {
  .group-card {
    grid-template-columns: minmax(0, 1fr);
  }
  .group-qr {
    max-width: 260px;
  }
}

.toc-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.toc-card {
  padding: 24px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
}

.toc-card h2 {
  font-size: 1.05rem;
  letter-spacing: 0;
}

.toc-card h2 span {
  margin-right: 8px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--accent);
}

.toc-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 12px;
}

.toc-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 10px;
  margin-inline: -10px;
  border-radius: 8px;
  font-size: 0.87rem;
  color: var(--muted);
  transition: color 0.2s ease, background 0.2s ease;
}

.toc-list a:hover {
  color: var(--text);
  background: var(--surface-2);
}

.toc-list .icon {
  width: 14px;
  height: 14px;
  opacity: 0.5;
}

/* 19. Footer ------------------------------------------------------------ */
.site-footer {
  margin-top: clamp(48px, 8vw, 96px);
  border-top: 1px solid var(--line);
  background: var(--bg-soft);
}

.footer-top {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, 0.8fr));
  gap: clamp(28px, 5vw, 64px);
  padding-block: clamp(40px, 6vw, 64px);
}

.footer-brand p {
  margin-top: 14px;
  max-width: 34ch;
  font-size: 0.86rem;
  line-height: 1.8;
  color: var(--muted);
}

.footer-col h2 {
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.footer-col ul {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-top: 16px;
}

.footer-col a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.88rem;
  color: var(--text);
  transition: color 0.2s ease;
}

.footer-col a:hover {
  color: var(--accent);
}

.footer-col .icon {
  width: 13px;
  height: 13px;
  opacity: 0.5;
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-block: 22px;
  border-top: 1px solid var(--line);
  font-size: 0.78rem;
  color: var(--muted);
}

.footer-bottom .footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

.footer-bottom a:hover {
  color: var(--accent);
}

/* 20. Lightbox ---------------------------------------------------------- */
.lightbox {
  position: fixed;
  inset: 0;
  margin: auto;
  width: -moz-fit-content;
  width: fit-content;
  max-width: min(1100px, 92vw);
  max-height: 90vh;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-lg);
}

.lightbox::backdrop {
  background: rgba(3, 7, 6, 0.82);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.lightbox img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 86vh;
  object-fit: contain;
  border-radius: var(--radius);
}

.lightbox-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(4, 10, 8, 0.65);
  color: #fff;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

/* 21. Reveal animation -------------------------------------------------- */
/* Content stays visible without JavaScript; the `.js` class is added by theme.js. */
.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

@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;
  }
  .js .reveal {
    opacity: 1;
    transform: none;
  }
}

/* 22. Responsive ------------------------------------------------------- */
@media (max-width: 1024px) {
  .entry-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .project-grid,
  .video-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .hero-inner {
    grid-template-columns: minmax(0, 1fr);
    gap: 40px;
  }
  .hero-copy {
    max-width: 640px;
  }
  .hero-media {
    justify-self: start;
    max-width: 460px;
  }
  .detail-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .detail-aside {
    position: static;
    order: -1;
  }
  .feature-video {
    grid-template-columns: minmax(0, 1fr);
  }
  .feature-video .feature-body {
    border-left: 0;
    border-top: 1px solid var(--line);
  }
}

@media (max-width: 860px) {
  .nav {
    position: fixed;
    inset: var(--header-h) 0 auto;
    z-index: 55;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 14px var(--gutter) 22px;
    border-bottom: 1px solid var(--line);
    background: var(--bg);
    box-shadow: var(--shadow-lg);
  }
  .nav.is-open {
    display: flex;
  }
  .nav a {
    justify-content: space-between;
    padding: 13px 14px;
    border-radius: 10px;
    font-size: 0.98rem;
    color: var(--text);
  }
  .nav a[aria-current="page"]::after {
    display: none;
  }
  .nav a[aria-current="page"] {
    color: var(--accent);
  }
  .menu-toggle {
    display: grid;
  }
  .menu-toggle .icon-close {
    display: none;
  }
  .menu-toggle[aria-expanded="true"] .icon-close {
    display: block;
  }
  .menu-toggle[aria-expanded="true"] .icon-menu {
    display: none;
  }
  body.nav-open {
    overflow: hidden;
  }
  .section-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .footer-top {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
  .footer-brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  :root {
    --header-h: 62px;
  }
  .brand-sub {
    display: none;
  }
  .hero {
    padding-block: 36px 44px;
  }
  .hero h1 {
    font-size: clamp(2.15rem, 10vw, 2.9rem);
  }
  .hero-actions .btn {
    flex: 1 1 auto;
  }
  .stats {
    gap: 18px 26px;
  }
  .stat dd {
    font-size: 1.3rem;
  }
  .entry-grid,
  .project-grid,
  .video-grid,
  .toc-grid,
  .pack-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .pack-card {
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 16px;
  }
  .pack-card img {
    width: 96px;
    height: 96px;
  }
  .article-row {
    align-items: flex-start;
    padding: 18px;
    gap: 14px;
  }
  .article-row > .icon {
    margin-top: 4px;
  }
  .footer-top {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
  }
  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }
  .pager {
    grid-template-columns: minmax(0, 1fr);
  }
  .pager .next {
    text-align: left;
    align-items: flex-start;
  }
  .detail-aside {
    order: 0;
  }
  .status-body h2 {
    font-size: 1.1rem;
  }
}
