/* ============================================================
   李冬阳 · 个人项目 — Bento UI
   方向：现代 Bento 网格 · 深浅撞色 · 大圆角 · 玻璃质感
   ============================================================ */

:root {
  /* palette */
  --bg: #f4f3ef;
  --bg-soft: #faf9f6;
  --card: #ffffff;
  --ink: #17150f;
  --ink-2: #57534a;
  --ink-3: #918c80;
  --line: #e8e5dc;
  --line-2: #dbd7cb;
  --accent: #ff4d00;
  --accent-deep: #d13e00;
  --ok: #16a34a;
  --warn: #d97706;
  --plate: #17150f; /* per-card / per-project override */

  /* type */
  --sans: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --disp: 'Space Grotesk', 'Noto Sans SC', -apple-system, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  /* radius */
  --r-xl: 28px;
  --r-lg: 22px;
  --r-md: 16px;
  --r-sm: 10px;

  /* shadow */
  --sh-sm: 0 1px 2px rgba(23, 21, 15, 0.04), 0 8px 24px -14px rgba(23, 21, 15, 0.12);
  --sh-md: 0 2px 4px rgba(23, 21, 15, 0.05), 0 18px 40px -18px rgba(23, 21, 15, 0.18);
  --sh-lg: 0 4px 8px rgba(23, 21, 15, 0.05), 0 28px 64px -24px rgba(23, 21, 15, 0.25);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  background:
    radial-gradient(1100px 480px at 85% -8%, rgba(255, 77, 0, 0.07), transparent 60%),
    radial-gradient(900px 460px at -5% 2%, rgba(67, 56, 202, 0.05), transparent 55%),
    var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.75;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: rgba(255, 77, 0, 0.2);
}

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

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

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

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

.dim {
  color: var(--ink-3);
}

/* ---------- top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px clamp(20px, 5vw, 72px);
  background: rgba(244, 243, 239, 0.78);
  backdrop-filter: blur(14px) saturate(1.5);
  -webkit-backdrop-filter: blur(14px) saturate(1.5);
  border-bottom: 1px solid rgba(232, 229, 220, 0.8);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
  letter-spacing: 0.2px;
}

.brand-dot {
  width: 12px;
  height: 12px;
  border-radius: 4px;
  background: linear-gradient(135deg, var(--accent), #ffb347);
  box-shadow: 0 2px 8px -2px rgba(255, 77, 0, 0.55);
}

.topbar-right {
  font-size: 13px;
  color: var(--ink-3);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink-2);
  padding: 8px 16px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: var(--card);
  transition: 0.18s;
}

.back-link:hover {
  border-color: var(--ink);
  color: var(--ink);
  transform: translateY(-1px);
  box-shadow: var(--sh-sm);
}

/* ---------- layout ---------- */
.page-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding-left: clamp(20px, 5vw, 72px);
  padding-right: clamp(20px, 5vw, 72px);
}

.detail {
  max-width: 940px;
  padding-top: clamp(40px, 6vw, 72px);
  padding-bottom: 80px;
}

/* ---------- hero (index) ---------- */
.hero {
  padding-top: clamp(44px, 7vw, 80px);
  padding-bottom: clamp(28px, 4vw, 44px);
}

.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 2.4px;
  text-transform: uppercase;
  color: var(--accent-deep);
  margin-bottom: 18px;
}

.hero h1 {
  font-weight: 900;
  font-size: clamp(44px, 7vw, 80px);
  line-height: 1.12;
  letter-spacing: 0.02em;
  margin-bottom: 16px;
}

.hero-lead {
  font-size: 16px;
  color: var(--ink-2);
  line-height: 1.95;
  max-width: 620px;
}

/* ---------- filters ---------- */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 8px;
  padding-bottom: 22px;
}

.filter {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: var(--card);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-2);
  transition: 0.18s;
}

.filter .count {
  font-family: var(--disp);
  font-size: 11px;
  background: var(--bg);
  border-radius: 999px;
  padding: 2px 8px;
  color: var(--ink-3);
  transition: 0.18s;
}

.filter:hover {
  border-color: var(--ink);
  color: var(--ink);
  transform: translateY(-1px);
  box-shadow: var(--sh-sm);
}

.filter.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
  font-weight: 700;
}

.filter.is-active .count {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

/* ---------- bento grid ---------- */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-auto-flow: dense;
  gap: 18px;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.bento-grid.switching {
  opacity: 0;
  transform: translateY(8px);
}

.span-4 { grid-column: span 4; }
.span-5 { grid-column: span 5; }
.span-6 { grid-column: span 6; }
.span-7 { grid-column: span 7; }

.bento {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: var(--r-lg);
  padding: clamp(22px, 2.6vw, 32px);
  min-height: 320px;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--sh-sm);
  overflow: hidden;
  transition: transform 0.25s cubic-bezier(0.2, 0.7, 0.3, 1), box-shadow 0.25s, border-color 0.25s;
  animation: rise 0.5s cubic-bezier(0.2, 0.7, 0.3, 1) both;
  animation-delay: calc(var(--i, 0) * 55ms);
}

.bento:hover {
  transform: translateY(-5px);
  box-shadow: var(--sh-lg);
  border-color: var(--line-2);
}

.span-7 {
  min-height: 360px;
}

/* white card with plate tint */
.tone-white::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(560px 220px at 100% 0%, color-mix(in srgb, var(--plate) 8%, transparent), transparent 65%);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.tone-white:hover::before {
  opacity: 1;
}

/* colored card */
.tone-color {
  background: linear-gradient(155deg, var(--plate), color-mix(in srgb, var(--plate) 55%, #0c0c10));
  border-color: transparent;
  color: #fff;
}

.tone-color::after {
  content: '';
  position: absolute;
  width: 300px;
  height: 300px;
  right: -90px;
  top: -90px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 255, 255, 0.2), transparent);
  pointer-events: none;
}

.bento > * {
  position: relative;
  z-index: 1;
}

.bento-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: clamp(18px, 2.4vw, 28px);
}

.bento-no {
  font-family: var(--disp);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.12em;
  color: color-mix(in srgb, var(--plate) 70%, var(--ink));
}

.tone-color .bento-no {
  color: rgba(255, 255, 255, 0.62);
}

/* card category label */
.bento-cat {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 1.6px;
  color: var(--ink-3);
}

.tone-color .bento-cat {
  color: rgba(255, 255, 255, 0.6);
}

.bento h3 {
  font-size: clamp(21px, 2vw, 28px);
  font-weight: 900;
  line-height: 1.3;
  letter-spacing: 0.01em;
  margin-bottom: 2px;
}

.tone-color h3 {
  color: #fff;
}

.bento-sub {
  font-size: 13.5px;
  font-weight: 700;
  color: color-mix(in srgb, var(--plate) 78%, #241f18);
  margin-bottom: 14px;
}

.tone-color .bento-sub {
  color: rgba(255, 255, 255, 0.8);
}

.bento-pos {
  font-size: 14.5px;
  color: var(--ink-2);
  line-height: 1.9;
  margin-bottom: 18px;
  flex: 1;
}

.tone-color .bento-pos {
  color: rgba(255, 255, 255, 0.68);
}

.bento-words {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 22px;
}

.chip {
  font-family: var(--mono);
  font-size: 11px;
  padding: 5px 12px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--plate) 8%, #fff);
  border: 1px solid color-mix(in srgb, var(--plate) 18%, #fff);
  color: color-mix(in srgb, var(--plate) 68%, #26221b);
}

.tone-color .chip {
  background: rgba(255, 255, 255, 0.13);
  border-color: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.bento-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--ink-3);
}

.tone-color .bento-foot {
  border-color: rgba(255, 255, 255, 0.16);
  color: rgba(255, 255, 255, 0.6);
}

.bento-arrow {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  display: grid;
  place-items: center;
  font-size: 15px;
  color: var(--ink);
  flex: none;
  transition: 0.22s;
}

.bento:hover .bento-arrow {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
  transform: translateX(4px);
}

.tone-color .bento-arrow {
  border-color: rgba(255, 255, 255, 0.35);
  color: #fff;
}

.tone-color .bento:hover .bento-arrow {
  background: #fff;
  border-color: #fff;
  color: var(--plate);
}

@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- legend ---------- */
.legend {
  margin-top: 26px;
  margin-bottom: 8px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 16px 20px;
  font-size: 13.5px;
  color: var(--ink-2);
  box-shadow: var(--sh-sm);
}

.legend .sym {
  color: var(--accent);
  font-family: var(--mono);
  flex: none;
}

.legend p {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* ---------- footer ---------- */
.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  max-width: 1200px;
  margin: 56px auto 0;
  padding: 22px clamp(20px, 5vw, 72px) 36px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--ink-3);
}

/* ================= detail page ================= */
.detail-hero {
  padding-bottom: clamp(28px, 4vw, 40px);
  animation: rise 0.5s cubic-bezier(0.2, 0.7, 0.3, 1) both;
  animation-delay: calc(var(--i, 0) * 70ms);
}

.detail-eyebrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 24px;
}

.detail-cat {
  color: var(--accent-deep);
}

.detail-hero h1 {
  font-size: clamp(38px, 6vw, 66px);
  font-weight: 900;
  line-height: 1.14;
  letter-spacing: 0.01em;
  margin-bottom: 10px;
}

.detail-sub {
  font-size: clamp(15px, 2vw, 18px);
  color: var(--ink-2);
  margin-bottom: 26px;
}

.detail-positioning {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--sh-sm);
  padding: 20px 24px 20px 28px;
  font-size: clamp(15.5px, 2vw, 19px);
  font-weight: 700;
  line-height: 1.85;
  overflow: hidden;
  margin-bottom: 24px;
}

.detail-positioning::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 6px;
  background: linear-gradient(var(--plate), color-mix(in srgb, var(--plate) 60%, #000));
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 22px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  font-size: 15px;
  font-weight: 700;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: 0.2s;
}

.btn-primary {
  background: var(--ink);
  color: #fff;
  box-shadow: var(--sh-sm);
}

.btn-primary:hover {
  background: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--sh-md);
}

.btn-ghost {
  border-color: var(--line-2);
  color: var(--ink-2);
  background: var(--card);
}

.btn-ghost:hover {
  border-color: var(--ink);
  color: var(--ink);
  transform: translateY(-2px);
  box-shadow: var(--sh-sm);
}

.btn[disabled] {
  background: var(--bg-soft);
  color: var(--ink-3);
  border-color: var(--line);
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

/* plate banner */
.plate {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  background: linear-gradient(155deg, var(--plate), color-mix(in srgb, var(--plate) 55%, #0c0c10));
  color: #fff;
  padding: clamp(26px, 4vw, 40px) clamp(24px, 4vw, 44px);
  margin-bottom: 22px;
  border-radius: var(--r-xl);
  box-shadow: var(--sh-md);
  animation: rise 0.5s cubic-bezier(0.2, 0.7, 0.3, 1) both;
  animation-delay: calc(var(--i, 0) * 70ms);
}

.plate::after {
  content: '';
  position: absolute;
  width: 340px;
  height: 340px;
  right: -100px;
  top: -120px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 255, 255, 0.2), transparent);
}

.plate .plate-no {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 2.5px;
  opacity: 0.72;
  position: relative;
  z-index: 1;
}

.plate .plate-words {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 30px;
  font-size: clamp(17px, 2.3vw, 25px);
  font-weight: 900;
  position: relative;
  z-index: 1;
}

.plate .plate-words span {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.plate .plate-words span::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
}

/* case sections — bento cards */
.case-section {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-sm);
  padding: clamp(24px, 3.5vw, 38px);
  margin-bottom: 18px;
  animation: rise 0.5s cubic-bezier(0.2, 0.7, 0.3, 1) both;
  animation-delay: calc(var(--i, 0) * 70ms);
}

.sec-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}

.sec-no {
  font-family: var(--disp);
  font-weight: 700;
  font-size: 12.5px;
  letter-spacing: 0.06em;
  color: #fff;
  background: linear-gradient(140deg, var(--plate), color-mix(in srgb, var(--plate) 62%, #000));
  border-radius: 9px;
  padding: 6px 10px;
}

.sec-head h2 {
  font-size: clamp(20px, 2.4vw, 26px);
  font-weight: 900;
  letter-spacing: 0.01em;
}

.sec-lead {
  font-size: 15px;
  color: var(--ink-2);
  line-height: 2;
  max-width: 70ch;
}

/* feature rows — sub cards */
.rows {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.row {
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 16px;
  align-items: start;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 20px;
  transition: 0.2s;
}

.row:hover {
  transform: translateY(-3px);
  box-shadow: var(--sh-sm);
  border-color: var(--line-2);
}

.row-no {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-family: var(--disp);
  font-weight: 700;
  font-size: 15px;
  color: color-mix(in srgb, var(--plate) 80%, #1a160f);
  background: color-mix(in srgb, var(--plate) 10%, #fff);
  border: 1px solid color-mix(in srgb, var(--plate) 20%, #fff);
}

.row h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 4px;
}

.row p {
  font-size: 13.5px;
  color: var(--ink-2);
  line-height: 1.85;
}

/* flow steps */
.flow {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
}

.flow-step {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 18px;
  transition: 0.2s;
}

.flow-step:hover {
  transform: translateY(-3px);
  box-shadow: var(--sh-sm);
  border-color: var(--line-2);
}

.flow-step .n {
  display: inline-grid;
  place-items: center;
  min-width: 30px;
  height: 30px;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-family: var(--disp);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}

.flow-step h4 {
  font-size: 14.5px;
  font-weight: 700;
  margin-bottom: 4px;
}

.flow-step p {
  font-size: 12.5px;
  color: var(--ink-3);
  line-height: 1.7;
}

/* tech note */
.tech-note {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--ink-2);
  line-height: 1.9;
}

.tech-note .sym {
  color: var(--accent);
  flex: none;
}

/* ---------- mock screens ---------- */
.mock-wrap {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--bg-soft);
  box-shadow: var(--sh-sm);
}

.mock-wrap-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
}

.mock-wrap-head::before {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ff5f57;
  box-shadow: 16px 0 0 #febc2e, 32px 0 0 #28c840;
  flex: none;
}

.mock-wrap-head span:first-of-type {
  margin-right: auto;
}

.mock-wrap-head .m-note {
  color: var(--warn);
  font-size: 10.5px;
}

.mock-wrap-body {
  padding: 20px;
  background:
    linear-gradient(90deg, rgba(23, 21, 15, 0.03) 1px, transparent 1px),
    var(--bg-soft);
  background-size: 22px 22px;
}

.mock-screen {
  border-radius: var(--r-md);
  background: #0f1219;
  overflow: hidden;
  box-shadow: var(--sh-md);
}

.mock-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-family: var(--mono);
  font-size: 10.5px;
  color: #5b7186;
}

.mock-body {
  padding: 18px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 2.1;
  color: #d7e2ea;
}

.mock-body b {
  color: #57c7ff;
}

.m-dim {
  color: #5b7186;
}

.caret {
  color: #5ce1a6;
  animation: blink 1.1s steps(1) infinite;
}

@keyframes blink {
  0%, 55% { opacity: 1; }
  56%, 100% { opacity: 0; }
}

.mock-cols,
.mock-cols3 {
  display: grid;
  gap: 14px;
}

.mock-cols {
  grid-template-columns: 1fr 1.15fr;
}

.mock-cols3 {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.mock-card {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--card);
  padding: 16px 18px;
  font-size: 13px;
  color: var(--ink-2);
  overflow-x: auto;
  box-shadow: var(--sh-sm);
}

.mock-title {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--accent-deep);
  margin-bottom: 12px;
}

.mock-card pre {
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.9;
  color: #d7e2ea;
  background: #14161c;
  border-radius: var(--r-sm);
  padding: 12px 14px;
  white-space: pre-wrap;
  word-break: break-all;
}

.mock-card table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  min-width: 420px;
}

.mock-card th {
  text-align: left;
  font-family: var(--mono);
  font-weight: 500;
  font-size: 10.5px;
  color: var(--ink-3);
  padding: 6px 8px;
  border-bottom: 1px solid var(--line-2);
  white-space: nowrap;
}

.mock-card td {
  padding: 8px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  white-space: nowrap;
}

.mock-card td.mono {
  font-family: var(--mono);
  font-size: 11px;
}

.ok,
.warn {
  display: inline-block;
  font-family: var(--mono);
  font-size: 10.5px;
  padding: 2px 9px;
  border-radius: 999px;
  white-space: nowrap;
}

.ok {
  color: var(--ok);
  background: rgba(22, 163, 74, 0.1);
}

.warn {
  color: var(--warn);
  background: rgba(217, 119, 6, 0.12);
}

.mock-name {
  color: var(--ink);
  font-weight: 700;
  margin-bottom: 3px;
}

.mock-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  color: var(--ink-3);
  margin-top: 12px;
  flex-wrap: wrap;
}

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

/* ---------- live preview (embedded webview) ---------- */
.live-frame {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--card);
  box-shadow: var(--sh-sm);
}

.live-frame-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 11px 16px;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
}

.live-frame-bar i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--line-2);
  flex: none;
}

.live-frame-bar i:nth-child(1) { background: #ff5f57; }
.live-frame-bar i:nth-child(2) { background: #febc2e; }
.live-frame-bar i:nth-child(3) { background: #28c840; }

.live-frame-bar span {
  flex: 1;
  min-width: 0;
  margin-left: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-frame-bar a {
  margin-left: auto;
  flex: none;
  color: var(--accent-deep);
  font-weight: 700;
  transition: 0.16s;
}

.live-frame-bar a:hover {
  color: var(--accent);
}

.live-stage {
  min-height: 420px;
  display: grid;
  place-items: center;
  background: linear-gradient(155deg, var(--plate), color-mix(in srgb, var(--plate) 55%, #0c0c10));
  position: relative;
  overflow: hidden;
}

.live-stage::after {
  content: '';
  position: absolute;
  width: 340px;
  height: 340px;
  right: -90px;
  top: -110px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 255, 255, 0.18), transparent);
  pointer-events: none;
}

.live-load {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 48px 24px;
  color: #fff;
  width: 100%;
}

.live-play {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #fff;
  color: var(--plate);
  display: grid;
  place-items: center;
  font-size: 20px;
  padding-left: 4px;
  box-shadow: var(--sh-md);
  transition: transform 0.2s;
}

.live-load:hover .live-play {
  transform: scale(1.08);
}

.live-load-t {
  font-weight: 900;
  font-size: 17px;
  letter-spacing: 0.02em;
}

.live-load-d {
  font-size: 12.5px;
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.75);
  max-width: 48ch;
}

.live-embed {
  width: 100%;
  height: 72vh;
  min-height: 560px;
  border: 0;
  display: block;
  background: var(--card);
}

/* ---------- prev / next pager ---------- */
.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 8px;
}

.pager-item {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 18px 22px;
  box-shadow: var(--sh-sm);
  transition: 0.2s;
  animation: rise 0.5s cubic-bezier(0.2, 0.7, 0.3, 1) both;
  animation-delay: calc(8 * 70ms);
}

.pager-item:hover {
  transform: translateY(-3px);
  box-shadow: var(--sh-md);
  border-color: var(--line-2);
}

.pager-item .p-dir {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 1.5px;
  color: var(--ink-3);
  margin-bottom: 6px;
}

.pager-item .p-name {
  font-weight: 900;
  font-size: 17px;
}

.pager-item.next {
  text-align: right;
}

/* ---------- standalone demo page ---------- */
.demo-body {
  background: var(--bg);
}

.demo-top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px clamp(18px, 4vw, 52px);
  background: rgba(244, 243, 239, 0.85);
  backdrop-filter: blur(14px) saturate(1.5);
  -webkit-backdrop-filter: blur(14px) saturate(1.5);
  border-bottom: 1px solid rgba(232, 229, 220, 0.9);
}

.demo-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: clamp(28px, 5vw, 52px) clamp(16px, 3vw, 40px) 60px;
}

.demo-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.demo-head h1 {
  font-size: clamp(26px, 3.6vw, 42px);
  font-weight: 900;
  letter-spacing: 0.01em;
}

.demo-sub {
  color: var(--ink-2);
  font-size: 14px;
  margin-top: 4px;
}

.demo-frame {
  border: 1px solid var(--line-2);
  border-radius: var(--r-xl);
  background: var(--card);
  overflow: hidden;
  box-shadow: var(--sh-lg);
}

.demo-frame-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 12px 18px;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
}

.demo-frame-bar i {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--line-2);
}

.demo-frame-bar i:nth-child(1) { background: #ff5f57; }
.demo-frame-bar i:nth-child(2) { background: #febc2e; }
.demo-frame-bar i:nth-child(3) { background: #28c840; }

.demo-frame-bar span {
  margin-left: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 14px;
}

.demo-stage {
  padding: clamp(20px, 4vw, 44px);
  min-height: 300px;
  background:
    linear-gradient(90deg, rgba(23, 21, 15, 0.025) 1px, transparent 1px),
    var(--bg-soft);
  background-size: 24px 24px;
  display: grid;
  place-items: start center;
}

.demo-stage > * {
  width: 100%;
  max-width: 1000px;
}

.demo-embed {
  width: 100%;
  height: 78vh;
  min-height: 620px;
  border: 0;
  display: block;
  background: var(--card);
  max-width: none;
  border-radius: var(--r-md);
}

.demo-footnote {
  margin-top: 18px;
  font-size: 13px;
  color: var(--ink-3);
  text-align: center;
}

/* ---------- responsive ---------- */
@media (max-width: 1020px) {
  .span-4,
  .span-5,
  .span-6,
  .span-7 {
    grid-column: span 6;
  }

  .span-7 {
    min-height: 320px;
  }
}

@media (max-width: 640px) {
  .topbar-right {
    display: none;
  }

  .span-4,
  .span-5,
  .span-6,
  .span-7 {
    grid-column: span 12;
  }

  .bento {
    min-height: 0;
  }

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

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

  .pager-item.next {
    text-align: left;
  }

  .mock-cols {
    grid-template-columns: 1fr;
  }

  .detail-positioning {
    padding: 18px 18px 18px 24px;
  }

  .live-stage {
    min-height: 340px;
  }

  .live-embed {
    height: 62vh;
    min-height: 420px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
