/* ==========================================================================
   Theme Yubing — Minimalist Bento & Smooth Motion System for Halo 2.x
   Inspired by Snapblocks, ScrollTide, ScrollShaders & Awwwards minimalism
   ========================================================================== */

:root {
  /* Light Mode — Crisp Snapblocks Pure White Bento over Kinetic Curved Lines */
  --bg-canvas: #f6f7fa;
  --bg-surface: rgba(255, 255, 255, 0.85);
  --bg-surface-solid: #ffffff;
  --bg-surface-subtle: rgba(241, 243, 247, 0.85);
  --bg-glass: rgba(255, 255, 255, 0.78);
  --bg-glass-strong: rgba(255, 255, 255, 0.93);

  --ink-primary: #0b0f19;
  --ink-secondary: #4b5565;
  --ink-muted: #848e9f;

  --border-subtle: rgba(15, 23, 42, 0.075);
  --border-hover: rgba(15, 23, 42, 0.16);
  --border-strong: rgba(15, 23, 42, 0.22);

  --accent: #2563eb;
  --accent-soft: rgba(37, 99, 235, 0.09);
  --accent-glow: rgba(37, 99, 235, 0.14);
  --spot-color: rgba(37, 99, 235, 0.065);
  --spot-border: rgba(37, 99, 235, 0.28);

  --shadow-card:
    0 1px 2px rgba(15, 23, 42, 0.03),
    0 10px 28px -12px rgba(15, 23, 42, 0.06);
  --shadow-card-hover:
    0 2px 6px rgba(15, 23, 42, 0.04),
    0 18px 40px -14px rgba(15, 23, 42, 0.11);
  --shadow-nav:
    0 4px 20px -4px rgba(15, 23, 42, 0.08),
    0 1px 2px rgba(15, 23, 42, 0.04);

  --radius-xl: 26px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-pill: 9999px;

  --ease-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-smooth: cubic-bezier(0.22, 1, 0.36, 1);

  --font-sans: 'Plus Jakarta Sans', 'Inter', 'Noto Sans SC', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  --container-max: 1120px;
  --grid-gap: 16px;
}

[data-theme="dark"] {
  --bg-canvas: #090b10;
  --bg-surface: rgba(17, 20, 29, 0.82);
  --bg-surface-solid: #11141d;
  --bg-surface-subtle: rgba(24, 28, 40, 0.85);
  --bg-glass: rgba(17, 20, 29, 0.78);
  --bg-glass-strong: rgba(17, 20, 29, 0.94);

  --ink-primary: #f3f5f9;
  --ink-secondary: #9ca5b7;
  --ink-muted: #677185;

  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.16);
  --border-strong: rgba(255, 255, 255, 0.24);

  --accent: #60a5fa;
  --accent-soft: rgba(96, 165, 250, 0.13);
  --accent-glow: rgba(96, 165, 250, 0.22);
  --spot-color: rgba(96, 165, 250, 0.085);
  --spot-border: rgba(96, 165, 250, 0.34);

  --shadow-card:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 12px 30px -14px rgba(0, 0, 0, 0.55);
  --shadow-card-hover:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    0 20px 44px -12px rgba(0, 0, 0, 0.72);
  --shadow-nav:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 10px 30px -6px rgba(0, 0, 0, 0.55);
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  background-color: var(--bg-canvas);
  color: var(--ink-primary);
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  background-color: var(--bg-canvas);
  color: var(--ink-primary);
  line-height: 1.65;
  overflow-x: clip;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.45s var(--ease-smooth), color 0.35s var(--ease-smooth);
}

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

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

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

/* Full-viewport parametric kinetic curved lines background */
.yb-bg-waves {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
}

/* Subtle dot-grid canvas texture layered lightly beneath waves */
.yb-canvas-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: radial-gradient(rgba(15, 23, 42, 0.045) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: radial-gradient(ellipse 85% 65% at 50% 0%, #000 35%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 85% 65% at 50% 0%, #000 35%, transparent 100%);
}

[data-theme="dark"] .yb-canvas-grid {
  background-image: radial-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px);
}

/* ---------- Top Hairline Reading Progress ---------- */
.yb-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 2.5px;
  z-index: 90;
  pointer-events: none;
  background: transparent;
}

.yb-progress__bar {
  height: 100%;
  width: 100%;
  transform-origin: 0 50%;
  transform: scaleX(0);
  background: linear-gradient(90deg, var(--accent), #8b5cf6, #06b6d4);
  will-change: transform;
}

/* ---------- Floating Glass Pill Navbar ---------- */
.yb-nav-wrap {
  position: fixed;
  top: calc(14px + env(safe-area-inset-top, 0px));
  left: 0;
  right: 0;
  z-index: 80;
  display: flex;
  justify-content: center;
  padding: 0 16px;
  pointer-events: none;
  transition: transform 0.55s var(--ease-expo), opacity 0.4s ease;
}

.yb-nav-wrap.is-hidden {
  transform: translateY(-120%);
  opacity: 0;
}

.yb-nav {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px 6px 12px;
  border-radius: var(--radius-pill);
  background: var(--bg-glass);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-nav);
  max-width: 100%;
}

.yb-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 4px 10px 4px 4px;
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-size: 0.93rem;
  letter-spacing: -0.02em;
  transition: opacity 0.25s ease;
}

.yb-brand:hover {
  opacity: 0.8;
}

.yb-brand__mark {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--ink-primary);
  color: var(--bg-surface);
  overflow: hidden;
  flex-shrink: 0;
  transition: transform 0.45s var(--ease-spring);
}

.yb-brand:hover .yb-brand__mark {
  transform: rotate(-10deg) scale(1.06);
}

.yb-brand__mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.yb-nav__links {
  position: relative;
  display: flex;
  align-items: center;
  gap: 2px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.yb-nav__link {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ink-secondary);
  transition: color 0.25s ease, background-color 0.25s ease;
  white-space: nowrap;
}

.yb-nav__link:hover,
.yb-nav__link.is-active {
  color: var(--ink-primary);
}

.yb-nav__link.is-active {
  background: var(--bg-surface-subtle);
  font-weight: 600;
}

.yb-nav__divider {
  width: 1px;
  height: 18px;
  background: var(--border-subtle);
  margin: 0 2px;
}

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

.yb-icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-secondary);
  border: 1px solid transparent;
  transition:
    color 0.25s ease,
    background-color 0.25s ease,
    border-color 0.25s ease,
    transform 0.35s var(--ease-spring);
}

.yb-icon-btn:hover {
  color: var(--ink-primary);
  background: var(--bg-surface-subtle);
  border-color: var(--border-subtle);
}

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

.yb-icon-btn svg {
  width: 17px;
  height: 17px;
}

/* Theme toggle icon swap */
.yb-theme-btn .icon-sun { display: none; }
.yb-theme-btn .icon-moon { display: block; }
[data-theme="dark"] .yb-theme-btn .icon-sun { display: block; }
[data-theme="dark"] .yb-theme-btn .icon-moon { display: none; }

/* Mobile menu toggle */
.yb-mobile-toggle {
  display: none;
}

.yb-mobile-drawer {
  position: fixed;
  top: 74px;
  left: 16px;
  right: 16px;
  z-index: 79;
  padding: 12px;
  border-radius: var(--radius-lg);
  background: var(--bg-glass-strong);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-card-hover);
  display: none;
  flex-direction: column;
  gap: 4px;
  opacity: 0;
  transform: translateY(-10px) scale(0.98);
  transition: opacity 0.3s var(--ease-expo), transform 0.35s var(--ease-expo);
}

.yb-mobile-drawer.is-open {
  display: flex;
  opacity: 1;
  transform: translateY(0) scale(1);
}

.yb-mobile-drawer a {
  padding: 11px 14px;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink-secondary);
}

.yb-mobile-drawer a:hover,
.yb-mobile-drawer a.is-active {
  background: var(--bg-surface-subtle);
  color: var(--ink-primary);
}

/* ---------- Main Layout Container ---------- */
.yb-main {
  position: relative;
  z-index: 1;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 102px 20px 64px;
}

/* ---------- Bento Card Core (Snapblocks Frosted Bento) ---------- */
.yb-card {
  position: relative;
  background: var(--bg-surface);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition:
    transform 0.55s var(--ease-expo),
    box-shadow 0.45s var(--ease-expo),
    border-color 0.35s ease,
    background-color 0.35s ease;
}

/* Pointer-tracking spotlight overlay (desktop fine pointers only) */
.yb-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  opacity: 0;
  background: radial-gradient(
    420px circle at var(--mx, 50%) var(--my, 50%),
    var(--spot-color),
    transparent 65%
  );
  transition: opacity 0.4s ease;
  z-index: 2;
}

@media (hover: hover) and (pointer: fine) {
  .yb-card:hover::before {
    opacity: 1;
  }

  .yb-card--interactive:hover {
    transform: translateY(-4px);
    border-color: var(--border-hover);
    box-shadow: var(--shadow-card-hover);
  }
}

/* Tactile spring tap feedback on iPad & Phone */
@media (hover: none) {
  .yb-card--interactive:active {
    transform: scale(0.985);
    border-color: var(--border-hover);
  }
}

/* ---------- Top Bento Grid (Home) ---------- */
.yb-bento-top {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--grid-gap);
  margin-bottom: 48px;
}

/* Hero Bento Card (8 cols) — Optical Frosted Glass letting the 3D Contour Light-Field breathe through */
.yb-hero {
  grid-column: span 8;
  min-height: 410px;
  padding: 40px 42px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  isolation: isolate;
  background: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.84) 0%,
    rgba(255, 255, 255, 0.64) 100%
  );
  backdrop-filter: blur(22px) saturate(165%);
  -webkit-backdrop-filter: blur(22px) saturate(165%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 12px 36px -14px rgba(15, 23, 42, 0.08);
}

[data-theme="dark"] .yb-hero {
  background: linear-gradient(
    145deg,
    rgba(18, 22, 34, 0.78) 0%,
    rgba(13, 16, 26, 0.58) 100%
  );
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.09),
    0 18px 42px -14px rgba(0, 0, 0, 0.65);
}

.yb-hero__shader {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.42;
  background:
    radial-gradient(55% 55% at 88% 14%, rgba(96, 165, 250, 0.16), transparent 68%),
    radial-gradient(45% 45% at 12% 88%, rgba(167, 139, 250, 0.12), transparent 68%);
}

[data-theme="dark"] .yb-hero__shader {
  opacity: 0.45;
}

.yb-hero__content {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  height: 100%;
  justify-content: space-between;
  gap: 28px;
}

.yb-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  padding: 6px 13px;
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--ink-secondary);
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
}

.yb-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5);
  animation: yb-pulse 2.4s infinite;
}

@keyframes yb-pulse {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5); }
  70% { box-shadow: 0 0 0 7px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.yb-hero__title {
  margin: 0;
  font-size: clamp(2.15rem, 4.2vw, 3.35rem);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.035em;
  color: var(--ink-primary);
}

/* ScrollTide masked line reveal */
.yb-mask-line {
  display: block;
  overflow: hidden;
  padding-bottom: 0.08em;
}

.yb-mask-line > span {
  display: inline-block;
  transform: translateY(108%);
  opacity: 0;
  animation: yb-line-up 0.95s var(--ease-expo) forwards;
  animation-delay: var(--delay, 0.08s);
}

@keyframes yb-line-up {
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.yb-hero__subtitle {
  margin: 14px 0 0;
  max-width: 520px;
  font-size: 1.03rem;
  line-height: 1.72;
  color: var(--ink-secondary);
}

.yb-hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

/* Magnetic Pill Buttons */
.yb-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: var(--radius-pill);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  transition:
    transform 0.35s var(--ease-expo),
    background-color 0.25s ease,
    border-color 0.25s ease,
    box-shadow 0.3s ease;
  will-change: transform;
}

.yb-btn--primary {
  background: var(--ink-primary);
  color: var(--bg-surface);
  box-shadow: 0 6px 18px -6px rgba(15, 23, 42, 0.35);
}

.yb-btn--primary:hover {
  box-shadow: 0 10px 24px -6px rgba(15, 23, 42, 0.45);
}

.yb-btn--ghost {
  background: var(--bg-glass);
  color: var(--ink-primary);
  border: 1px solid var(--border-subtle);
  backdrop-filter: blur(10px);
}

.yb-btn--ghost:hover {
  background: var(--bg-surface);
  border-color: var(--border-hover);
}

.yb-btn svg {
  width: 16px;
  height: 16px;
  transition: transform 0.35s var(--ease-expo);
}

.yb-btn:hover svg.arrow-right {
  transform: translateX(3px);
}

.yb-btn:hover svg.arrow-down {
  transform: translateY(2px);
}

/* Right Stacked Bento Column (4 cols) */
.yb-bento-side {
  grid-column: span 4;
  display: grid;
  grid-template-rows: 1fr auto;
  gap: var(--grid-gap);
}

/* Profile Bento Card */
.yb-profile-card {
  padding: 26px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
}

.yb-profile__head {
  display: flex;
  align-items: center;
  gap: 14px;
}

.yb-avatar {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-subtle);
  overflow: hidden;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  transition: transform 0.5s var(--ease-spring);
}

.yb-profile-card:hover .yb-avatar {
  transform: rotate(-4deg) scale(1.05);
}

.yb-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.yb-profile__name {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.yb-profile__handle {
  margin: 2px 0 0;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ink-muted);
}

.yb-profile__bio {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.65;
  color: var(--ink-secondary);
}

.yb-social-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.yb-chip-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-secondary);
  background: var(--bg-surface-subtle);
  border: 1px solid transparent;
  transition: color 0.25s ease, border-color 0.25s ease, transform 0.3s var(--ease-spring);
}

.yb-chip-link:hover {
  color: var(--ink-primary);
  border-color: var(--border-hover);
  transform: translateY(-2px);
}

.yb-chip-link svg {
  width: 14px;
  height: 14px;
}

/* Stats + Live Clock Bento Card */
.yb-stats-card {
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.yb-stats__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--ink-muted);
}

.yb-stats__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.yb-stat-box {
  padding: 12px 10px;
  border-radius: var(--radius-md);
  background: var(--bg-surface-subtle);
  text-align: center;
  transition: transform 0.35s var(--ease-spring);
}

.yb-stat-box:hover {
  transform: translateY(-2px);
}

.yb-stat-box__num {
  display: block;
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--ink-primary);
  line-height: 1.2;
}

.yb-stat-box__label {
  display: block;
  margin-top: 3px;
  font-size: 0.72rem;
  color: var(--ink-muted);
}

/* ---------- Section Heading ---------- */
.yb-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  padding: 0 4px;
}

.yb-section-head__eyebrow {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 4px;
}

.yb-section-head__title {
  margin: 0;
  font-size: 1.45rem;
  font-weight: 750;
  letter-spacing: -0.025em;
}

.yb-section-head__more {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--ink-secondary);
  transition: color 0.25s ease, gap 0.3s var(--ease-expo);
}

.yb-section-head__more:hover {
  color: var(--ink-primary);
  gap: 9px;
}

/* ---------- Category Filter Pills Strip ---------- */
.yb-filter-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.yb-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--ink-secondary);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  transition: all 0.28s var(--ease-expo);
}

.yb-pill:hover,
.yb-pill.is-active {
  color: var(--ink-primary);
  border-color: var(--border-hover);
  transform: translateY(-1px);
}

.yb-pill.is-active {
  background: var(--ink-primary);
  color: var(--bg-surface);
  border-color: var(--ink-primary);
}

.yb-pill__count {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  opacity: 0.65;
}

/* ---------- Posts Bento Grid ---------- */
.yb-posts-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--grid-gap);
}

.yb-post-card {
  grid-column: span 6;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 240px;
}

/* Featured first card on page 1 spans full 12 cols as split horizontal Bento */
.yb-post-card--featured {
  grid-column: span 12;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  min-height: 310px;
}

.yb-post-card--featured.no-cover {
  grid-template-columns: 1fr;
  min-height: 230px;
}

.yb-post-card__media {
  position: relative;
  overflow: hidden;
  background: var(--bg-surface-subtle);
  aspect-ratio: 16 / 9;
}

.yb-post-card--featured .yb-post-card__media {
  aspect-ratio: auto;
  min-height: 280px;
  height: 100%;
}

.yb-post-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.85s var(--ease-expo);
  will-change: transform;
}

.yb-post-card:hover .yb-post-card__media img {
  transform: scale(1.045);
}

.yb-post-card__body {
  position: relative;
  z-index: 3;
  padding: 26px 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  flex: 1;
}

.yb-post-card--featured .yb-post-card__body {
  padding: 34px 36px;
}

.yb-post-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--ink-muted);
}

.yb-tag-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
}

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

.yb-post-card__title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.38;
  letter-spacing: -0.02em;
  color: var(--ink-primary);
  transition: color 0.25s ease;
}

.yb-post-card--featured .yb-post-card__title {
  font-size: clamp(1.45rem, 2.3vw, 1.85rem);
}

.yb-post-card:hover .yb-post-card__title {
  color: var(--accent);
}

.yb-post-card__excerpt {
  margin: 8px 0 0;
  font-size: 0.92rem;
  line-height: 1.68;
  color: var(--ink-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.yb-post-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.8rem;
  color: var(--ink-muted);
}

.yb-read-arrow {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 600;
  color: var(--ink-primary);
  transition: gap 0.3s var(--ease-expo), color 0.25s ease;
}

.yb-post-card:hover .yb-read-arrow {
  gap: 9px;
  color: var(--accent);
}

/* Empty state Bento card */
.yb-empty-card {
  grid-column: span 12;
  padding: 56px 28px;
  text-align: center;
}

.yb-empty-card h3 {
  margin: 0 0 8px;
  font-size: 1.15rem;
}

.yb-empty-card p {
  margin: 0;
  color: var(--ink-secondary);
  font-size: 0.92rem;
}

/* ---------- Pagination ---------- */
.yb-pagination {
  margin-top: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.yb-page-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius-pill);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--ink-primary);
  box-shadow: var(--shadow-card);
  transition: all 0.3s var(--ease-expo);
}

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

.yb-page-indicator {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--ink-muted);
  padding: 0 8px;
}

/* ---------- Post / Single Page Layout ---------- */
.yb-article-hero {
  padding: 40px 44px;
  margin-bottom: 20px;
}

.yb-article-hero__title {
  margin: 14px 0 0;
  font-size: clamp(1.8rem, 3.6vw, 2.7rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.03em;
}

.yb-article-hero__meta {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  font-size: 0.84rem;
  color: var(--ink-muted);
}

.yb-article-cover {
  margin-bottom: 20px;
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  max-height: 480px;
}

.yb-article-cover img {
  width: 100%;
  height: 100%;
  max-height: 480px;
  object-fit: cover;
}

.yb-article-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 256px;
  gap: 20px;
  align-items: start;
}

.yb-article-layout--single {
  grid-template-columns: minmax(0, 1fr);
}

.yb-article-body {
  padding: 42px 46px;
}

/* Magazine-grade Prose Typography */
.yb-prose {
  font-size: 1.02rem;
  line-height: 1.85;
  color: var(--ink-primary);
  word-break: break-word;
}

.yb-prose > *:first-child { margin-top: 0; }
.yb-prose > *:last-child { margin-bottom: 0; }

.yb-prose h2, .yb-prose h3, .yb-prose h4 {
  margin: 2em 0 0.7em;
  font-weight: 750;
  letter-spacing: -0.02em;
  line-height: 1.3;
  scroll-margin-top: 96px;
}

.yb-prose h2 {
  font-size: 1.48rem;
  padding-bottom: 0.35em;
  border-bottom: 1px solid var(--border-subtle);
}

.yb-prose h3 { font-size: 1.22rem; }
.yb-prose h4 { font-size: 1.05rem; }

.yb-prose p {
  margin: 1.15em 0;
  color: var(--ink-primary);
}

.yb-prose a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.yb-prose ul, .yb-prose ol {
  margin: 1.1em 0;
  padding-left: 1.4em;
}

.yb-prose li {
  margin: 0.45em 0;
}

.yb-prose blockquote {
  margin: 1.5em 0;
  padding: 14px 20px;
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  background: var(--bg-surface-subtle);
  color: var(--ink-secondary);
}

.yb-prose code {
  font-family: var(--font-mono);
  font-size: 0.87em;
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-subtle);
}

.yb-prose pre {
  position: relative;
  margin: 1.6em 0;
  padding: 18px 20px;
  border-radius: var(--radius-md);
  background: #0f131c;
  color: #e5e9f2;
  overflow-x: auto;
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.88rem;
  line-height: 1.65;
}

.yb-prose pre code {
  background: transparent;
  border: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

.yb-copy-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 4px 10px;
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: all 0.25s ease;
}

.yb-copy-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
}

.yb-prose img {
  margin: 1.6em auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  cursor: zoom-in;
}

.yb-prose hr {
  border: none;
  border-top: 1px solid var(--border-subtle);
  margin: 2em 0;
}

.yb-prose .yb-table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 1.5em 0;
  border-radius: var(--radius-md);
}

.yb-prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
  font-size: 0.92rem;
  min-width: 420px;
}

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

.yb-prose th {
  background: var(--bg-surface-subtle);
  font-weight: 600;
}

/* Mobile & iPad Portrait Collapsible TOC Accordion */
.yb-mobile-toc {
  display: none;
  margin-bottom: 16px;
  padding: 0;
}

.yb-mobile-toc summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  font-size: 0.88rem;
  font-weight: 650;
  color: var(--ink-primary);
  cursor: pointer;
  user-select: none;
}

.yb-mobile-toc summary::-webkit-details-marker {
  display: none;
}

.yb-mobile-toc__chevron {
  width: 16px;
  height: 16px;
  color: var(--ink-muted);
  transition: transform 0.3s var(--ease-expo);
}

.yb-mobile-toc[open] .yb-mobile-toc__chevron {
  transform: rotate(180deg);
}

.yb-mobile-toc__body {
  padding: 0 14px 14px;
  border-top: 1px solid var(--border-subtle);
}

.yb-mobile-toc__body .yb-toc__list {
  padding-top: 10px;
  max-height: 46vh;
}

/* Sticky TOC Card */
.yb-toc-card {
  position: sticky;
  top: 90px;
  padding: 20px 22px;
}

.yb-toc__title {
  margin: 0 0 12px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
}

.yb-toc__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: calc(100vh - 200px);
  overflow-y: auto;
}

.yb-toc__link {
  display: block;
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 0.83rem;
  color: var(--ink-secondary);
  border-left: 2px solid transparent;
  transition: all 0.25s ease;
  line-height: 1.45;
}

.yb-toc__link:hover {
  color: var(--ink-primary);
  background: var(--bg-surface-subtle);
}

.yb-toc__link.is-active {
  color: var(--accent);
  background: var(--accent-soft);
  border-left-color: var(--accent);
  font-weight: 600;
}

.yb-toc__link--h3 {
  padding-left: 20px;
  font-size: 0.8rem;
}

/* Tags & Prev/Next Bento Row */
.yb-article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--border-subtle);
}

.yb-post-nav {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--grid-gap);
}

.yb-post-nav__item {
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.yb-post-nav__label {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--ink-muted);
}

.yb-post-nav__title {
  font-size: 0.98rem;
  font-weight: 650;
  color: var(--ink-primary);
}

/* Comments Bento Wrapper */
.yb-comments-card {
  margin-top: 20px;
  padding: 30px 36px;
}

/* ---------- Archives / Categories / Tags Pages ---------- */
.yb-page-header {
  padding: 36px 40px;
  margin-bottom: 22px;
}

.yb-page-header h1 {
  margin: 6px 0 0;
  font-size: clamp(1.7rem, 3vw, 2.35rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.yb-page-header p {
  margin: 10px 0 0;
  color: var(--ink-secondary);
  font-size: 0.95rem;
}

.yb-archive-year {
  padding: 28px 32px;
  margin-bottom: 16px;
}

.yb-archive-year__title {
  margin: 0 0 18px;
  font-family: var(--font-mono);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink-primary);
}

.yb-archive-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.yb-archive-item a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  transition: background-color 0.25s ease, transform 0.35s var(--ease-expo);
}

.yb-archive-item a:hover {
  background: var(--bg-surface-subtle);
  transform: translateX(4px);
}

.yb-archive-item__title {
  font-weight: 600;
  font-size: 0.97rem;
}

.yb-archive-item__date {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--ink-muted);
  flex-shrink: 0;
}

.yb-taxonomy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: var(--grid-gap);
}

.yb-taxonomy-card {
  padding: 24px 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.yb-taxonomy-card__name {
  font-weight: 700;
  font-size: 1.05rem;
}

.yb-taxonomy-card__count {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: var(--bg-surface-subtle);
  color: var(--ink-secondary);
}

/* ---------- Footer Bento Bar ---------- */
.yb-footer {
  margin-top: 56px;
  padding: 22px 28px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  font-size: 0.84rem;
  color: var(--ink-muted);
}

.yb-footer__links {
  display: flex;
  align-items: center;
  gap: 16px;
}

.yb-footer__links a:hover {
  color: var(--ink-primary);
}

.yb-back-top {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  background: var(--bg-surface-subtle);
  color: var(--ink-primary);
  font-size: 0.8rem;
  font-weight: 600;
  transition: transform 0.35s var(--ease-spring), background-color 0.25s ease;
}

.yb-back-top:hover {
  transform: translateY(-2px);
}

/* ---------- Scroll Reveal Utilities (ScrollTide rhythm) ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(26px) scale(0.985);
  transition:
    opacity 0.78s var(--ease-expo),
    transform 0.88s var(--ease-expo);
  transition-delay: var(--stagger, 0ms);
  will-change: opacity, transform;
}

[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Image Lightbox */
.yb-lightbox {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(9, 11, 16, 0.82);
  backdrop-filter: blur(12px);
  display: none;
  place-items: center;
  padding: 24px;
  cursor: zoom-out;
}

.yb-lightbox.is-open {
  display: grid;
}

.yb-lightbox img {
  max-width: min(92vw, 1100px);
  max-height: 88vh;
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
}

/* ---------- Reduced Motion Accessibility ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  [data-reveal], .yb-mask-line > span {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ---------- Responsive Breakpoints (Desktop / iPad Landscape / iPad Portrait / Phone) ---------- */

/* iPad Landscape (961px - 1100px) */
@media (max-width: 1100px) and (min-width: 961px) {
  .yb-main { padding: 96px 22px 56px; }
  .yb-hero { grid-column: span 7; padding: 34px 32px; min-height: 380px; }
  .yb-bento-side { grid-column: span 5; }
  .yb-article-layout { grid-template-columns: minmax(0, 1fr) 220px; }
  .yb-article-body { padding: 34px 34px; }
}

/* iPad Portrait & Medium Tablets (681px - 960px) */
@media (max-width: 960px) {
  .yb-main { padding: 92px 20px 54px; }
  .yb-nav__link { padding: 7px 11px; font-size: 0.85rem; }
  .yb-bento-top { margin-bottom: 36px; }
  .yb-hero { grid-column: span 12; min-height: 330px; padding: 32px 30px; }
  .yb-bento-side { grid-column: span 12; grid-template-columns: 1fr 1fr; grid-template-rows: auto; }
  .yb-post-card--featured { grid-template-columns: 1fr; }
  .yb-post-card--featured .yb-post-card__media { aspect-ratio: 16 / 9; min-height: 220px; }
  .yb-post-card--featured .yb-post-card__body { padding: 28px 28px; }
  .yb-article-layout { grid-template-columns: 1fr; }
  .yb-toc-card { display: none; }
  .yb-mobile-toc { display: block; }
  .yb-article-hero { padding: 32px 30px; }
  .yb-article-body { padding: 32px 30px; }
}

/* Mobile / Phone (<= 680px, including iPhone safe areas) */
@media (max-width: 680px) {
  :root {
    --radius-xl: 20px;
    --radius-lg: 16px;
    --radius-md: 12px;
    --grid-gap: 12px;
  }

  .yb-nav-wrap {
    top: calc(10px + env(safe-area-inset-top, 0px));
    padding: 0 12px;
  }

  .yb-nav {
    width: 100%;
    justify-content: space-between;
    padding: 5px 6px 5px 10px;
  }

  .yb-brand {
    font-size: 0.9rem;
    max-width: 58vw;
  }

  .yb-brand span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .yb-icon-btn {
    width: 40px;
    height: 40px;
  }

  .yb-nav__links { display: none; }
  .yb-nav__divider { display: none; }
  .yb-mobile-toggle { display: inline-flex; }

  .yb-mobile-drawer {
    top: calc(68px + env(safe-area-inset-top, 0px));
    left: 12px;
    right: 12px;
  }

  .yb-mobile-drawer a {
    padding: 13px 16px;
    font-size: 0.98rem;
  }

  .yb-main {
    padding: calc(78px + env(safe-area-inset-top, 0px)) 14px calc(44px + env(safe-area-inset-bottom, 0px));
  }

  .yb-bento-top { margin-bottom: 30px; }

  .yb-hero {
    min-height: auto;
    padding: 24px 20px;
  }

  .yb-hero__content { gap: 20px; }

  .yb-hero__title {
    font-size: clamp(1.7rem, 7.2vw, 2.2rem);
    line-height: 1.18;
  }

  .yb-hero__subtitle {
    margin-top: 10px;
    font-size: 0.94rem;
    line-height: 1.65;
  }

  .yb-hero__actions {
    width: 100%;
    gap: 8px;
  }

  .yb-btn {
    flex: 1 1 auto;
    justify-content: center;
    min-height: 44px;
    padding: 10px 16px;
    font-size: 0.88rem;
  }

  .yb-bento-side { grid-template-columns: 1fr; }
  .yb-profile-card { padding: 20px; gap: 14px; }
  .yb-stats-card { padding: 18px 20px; }
  .yb-stat-box { padding: 10px 6px; }
  .yb-stat-box__num { font-size: 1.12rem; }

  .yb-section-head { margin-bottom: 14px; }
  .yb-section-head__title { font-size: 1.28rem; }

  /* Horizontal swipeable category pill bar on mobile */
  .yb-filter-strip {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    margin: 0 -14px 16px;
    padding: 2px 14px;
  }

  .yb-filter-strip::-webkit-scrollbar { display: none; }
  .yb-pill { flex-shrink: 0; padding: 7px 14px; }

  .yb-post-card { grid-column: span 12; min-height: auto; }
  .yb-post-card--featured .yb-post-card__media { min-height: 180px; }
  .yb-post-card__body,
  .yb-post-card--featured .yb-post-card__body { padding: 20px; }
  .yb-post-card__title,
  .yb-post-card--featured .yb-post-card__title { font-size: 1.18rem; }
  .yb-post-card__excerpt { font-size: 0.89rem; -webkit-line-clamp: 2; }

  .yb-article-hero,
  .yb-article-body,
  .yb-comments-card,
  .yb-page-header,
  .yb-archive-year { padding: 22px 18px; }

  .yb-article-hero__title { font-size: 1.55rem; }
  .yb-prose { font-size: 0.97rem; line-height: 1.8; }
  .yb-prose pre { padding: 14px 14px; font-size: 0.82rem; }

  .yb-archive-item a { padding: 10px 8px; }
  .yb-post-nav { grid-template-columns: 1fr; }

  .yb-footer {
    margin-top: 36px;
    padding: 18px 20px;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .yb-footer__links {
    width: 100%;
    justify-content: space-between;
  }
}
