:root {
  color-scheme: light;
  --text: #273347;
  --text-strong: #1b2638;
  --muted: #5e6d82;
  --faint: #6c7a8e;
  --accent: #4c75ae;
  --active: #e5edf7;
  --glass: rgba(255, 255, 255, 0.52);
  --surface: rgba(255, 255, 255, 0.72);
  --surface-strong: rgba(255, 255, 255, 0.88);
  --border: rgba(255, 255, 255, 0.88);
  --line: rgba(93, 115, 146, 0.11);
  --shadow: 0 7px 25px rgba(67, 89, 124, 0.045);
  --bg: #edf1f7;
  --sidebar-width: 224px;
  --blur: 24px;
  --radius: 20px;
  --ambient-a: 173, 190, 238;
  --ambient-b: 198, 175, 215;
  --ambient-c: 240, 201, 167;
  --group-rgb: 107, 139, 190;
  --group-ink: #4e6c96;
  --prose-size: 17px;
  --prose-font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Microsoft YaHei", sans-serif;
}

:root[data-ambience="sunset"] {
  --ambient-a: 231, 188, 165;
  --ambient-b: 214, 180, 192;
  --ambient-c: 244, 216, 162;
}

:root[data-ambience="ocean"] {
  --ambient-a: 151, 194, 210;
  --ambient-b: 158, 191, 203;
  --ambient-c: 202, 220, 181;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --text: #dbe4ef;
  --text-strong: #f2f6fc;
  --muted: #98a9be;
  --faint: #7c8da5;
  --accent: #a0bfdf;
  --active: rgba(52, 75, 104, 0.45);
  --glass: rgba(36, 49, 70, 0.54);
  --surface: rgba(39, 52, 73, 0.76);
  --surface-strong: rgba(35, 50, 72, 0.92);
  --border: rgba(156, 181, 212, 0.15);
  --line: rgba(156, 181, 212, 0.13);
  --bg: #182332;
  --shadow: 0 10px 30px rgba(7, 17, 31, 0.16);
}

:root[data-material="frosted"] {
  --glass: rgba(247, 250, 254, 0.92);
  --surface: rgba(255, 255, 255, 0.95);
  --blur: 14px;
}

:root[data-theme="dark"][data-material="frosted"] {
  --glass: rgba(34, 48, 68, 0.95);
  --surface: rgba(40, 55, 76, 0.98);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

button, input, textarea, select, a { -webkit-tap-highlight-color: transparent; }
button, input, textarea, select { font: inherit; color: inherit; }
button, a { touch-action: manipulation; }
button { cursor: pointer; border: 0; background: none; min-height: 36px; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 2px solid #719ed4;
  outline-offset: 3px;
}
[hidden] { display: none !important; }

svg.icon {
  width: 18px;
  height: 18px;
  display: block;
  flex-shrink: 0;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}
[data-icon] { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }

.glass {
  background: var(--glass);
  border: 1px solid var(--border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), inset 0 -1px 0 rgba(255, 255, 255, 0.14), var(--shadow);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(145%);
  backdrop-filter: blur(var(--blur)) saturate(145%);
}
:root[data-theme="dark"] .glass {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), var(--shadow);
}

/* Atmosphere matching Joel's Life */
.atmosphere {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 76% 1%, rgba(var(--ambient-a), 0.28), transparent 52%),
    radial-gradient(ellipse at 100% 59%, rgba(var(--ambient-c), 0.30), transparent 49%),
    linear-gradient(135deg, #f3f5f8, #eef1f6 55%, #f1efee);
}
:root[data-theme="dark"] .atmosphere {
  background:
    radial-gradient(ellipse at 80% 0, rgba(var(--ambient-a), 0.12), transparent 55%),
    radial-gradient(ellipse at 100% 60%, rgba(var(--ambient-c), 0.08), transparent 50%),
    linear-gradient(130deg, #17283b, #182637 55%, #202c3e);
}
.orb { position: absolute; filter: blur(52px); border-radius: 50%; }
.orb-one {
  width: 700px; height: 650px; top: -240px; right: -140px;
  background: radial-gradient(ellipse, rgba(var(--ambient-a), 0.72), transparent 70%);
  animation: ambient-drift 22s ease-in-out infinite alternate;
}
.orb-two {
  width: 850px; height: 850px; left: 26%; top: 410px;
  background: radial-gradient(ellipse, rgba(var(--ambient-b), 0.34), transparent 66%);
  animation: ambient-drift 28s ease-in-out -12s infinite alternate-reverse;
}
.orb-three {
  width: 750px; height: 750px; right: -340px; top: 180px;
  background: radial-gradient(ellipse, rgba(var(--ambient-c), 0.56), transparent 66%);
}
:root[data-theme="dark"] .orb-one { background: radial-gradient(ellipse, rgba(var(--ambient-a), 0.17), transparent 68%); }
:root[data-theme="dark"] .orb-two { background: radial-gradient(ellipse, rgba(var(--ambient-b), 0.10), transparent 65%); }
:root[data-theme="dark"] .orb-three { background: radial-gradient(ellipse, rgba(var(--ambient-c), 0.12), transparent 66%); }

.atmosphere > svg { position: absolute; inset: 0; width: 100%; height: 100%; fill: none; stroke: #fff; stroke-width: 1.3; opacity: 0.52; }
.atmosphere > svg path + path { stroke: #94abca; opacity: 0.3; }
:root[data-theme="dark"] .atmosphere > svg { opacity: 0.09; }

@keyframes ambient-drift {
  from { transform: translate3d(-15px, 0, 0); }
  to { transform: translate3d(25px, 25px, 0); }
}

/* Reading Progress & Mini Sticky Bar */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2.5px;
  z-index: 60;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s;
}
.reading-progress.visible { opacity: 1; }
.reading-progress span {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #5d87b8, #8ea2cf, #c9a790);
  transition: width 0.08s linear;
}

.reading-mini-bar {
  position: fixed;
  top: 14px;
  left: calc(var(--sidebar-width) + 48px);
  right: 48px;
  max-width: 1180px;
  margin: 0 auto;
  z-index: 40;
  border-radius: 18px;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: rgba(255, 255, 255, 0.78);
  animation: fade-down 0.22s ease;
}
:root[data-theme="dark"] .reading-mini-bar {
  background: rgba(28, 42, 61, 0.82);
}
@keyframes fade-down {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
.mini-back {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 500;
  color: var(--accent);
  padding: 4px 10px;
  border-radius: 10px;
  flex-shrink: 0;
}
.mini-back:hover { background: var(--active); }
.mini-title-wrap {
  min-width: 0;
  flex: 1;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 12px;
}
.mini-title-wrap strong {
  font-size: 13px;
  font-weight: 550;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mini-title-wrap span {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
}
.mini-actions { display: flex; align-items: center; gap: 6px; position: relative; flex-shrink: 0; }

.typo-wrap { position: relative; }
#typo-toggle {
  font-family: Georgia, serif;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.5px;
}
.typo-popover {
  position: absolute;
  top: 44px;
  right: 0;
  width: 248px;
  padding: 14px;
  border-radius: 18px;
  background: var(--surface-strong);
  z-index: 50;
  display: grid;
  gap: 12px;
}
.typo-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 11px; color: var(--muted); }
.typo-seg {
  display: flex;
  gap: 3px;
  padding: 3px;
  border-radius: 10px;
  background: rgba(130, 152, 180, 0.14);
}
.typo-seg button {
  min-height: 26px;
  padding: 0 9px;
  border-radius: 7px;
  font-size: 11px;
  color: var(--muted);
}
.typo-seg button.active {
  background: var(--surface);
  color: var(--accent);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

/* Sidebar */
.sidebar {
  position: fixed;
  z-index: 20;
  inset: 16px auto 16px 16px;
  width: var(--sidebar-width);
  border-radius: 27px;
  padding: 26px 14px 16px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  scrollbar-width: thin;
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.62), rgba(249, 251, 255, 0.34) 65%, rgba(226, 234, 250, 0.42));
  border-color: rgba(255, 255, 255, 0.78);
}
:root[data-theme="dark"] .sidebar {
  background: linear-gradient(155deg, rgba(48, 69, 91, 0.46), rgba(32, 47, 66, 0.50));
  border-color: rgba(152, 180, 211, 0.16);
}
.brand { display: flex; align-items: center; gap: 11px; padding: 0 9px; flex-shrink: 0; }
.brand img, .mobile-brand img {
  object-fit: cover;
  border-radius: 50%;
  border: 2.5px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 4px 12px rgba(79, 103, 136, 0.2);
}
.brand strong { font-size: 20px; font-weight: 650; letter-spacing: -0.7px; white-space: nowrap; }
.brand-dot { color: #6a8eae; }
.brand div > span {
  display: block;
  font-size: 7.5px;
  font-weight: 550;
  letter-spacing: 1.6px;
  margin-top: 2px;
  color: var(--muted);
}

.sidebar-caption {
  font-size: 10px;
  letter-spacing: 1.7px;
  color: var(--muted);
  margin: 30px 14px 10px;
  flex-shrink: 0;
}
.sidebar-caption-compact { margin-top: 18px; }

.category-button {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 43px;
  width: 100%;
  padding: 0 13px;
  border: 1px solid transparent;
  border-radius: 13px;
  margin-bottom: 5px;
  text-align: left;
  color: var(--muted);
  transition: background 0.2s, color 0.2s, transform 0.2s;
}
.category-button .icon { width: 17px; height: 17px; }
.category-button .nav-label { flex: 1; white-space: nowrap; font-size: 13px; }
.category-button .nav-count { font-size: 10px; color: var(--muted); font-variant-numeric: tabular-nums; opacity: 0.8; }
.category-button:hover { background: rgba(255, 255, 255, 0.28); color: var(--text); }
:root[data-theme="dark"] .category-button:hover { background: rgba(255, 255, 255, 0.06); }
.category-button.active {
  background: linear-gradient(125deg, #6c8fbb, #51749e);
  border-color: rgba(255, 255, 255, 0.28);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 6px 15px rgba(73, 106, 153, 0.16);
}
.category-button.active .nav-count { background: rgba(255, 255, 255, 0.2); color: #fff; border-radius: 5px; padding: 1px 5px; opacity: 1; }
:root[data-theme="dark"] .category-button.active {
  background: linear-gradient(125deg, rgba(103, 139, 183, 0.42), rgba(63, 99, 139, 0.56));
  border-color: rgba(166, 195, 230, 0.25);
  color: #edf4ff;
}

.sidebar-bottom { margin-top: auto; padding-top: 20px; flex-shrink: 0; }
.repo-button {
  display: flex;
  align-items: center;
  text-align: left;
  gap: 10px;
  width: 100%;
  padding: 12px 10px;
  border-radius: 16px;
  background: linear-gradient(130deg, rgba(203, 220, 243, 0.34), rgba(237, 231, 232, 0.30));
  border: 1px solid rgba(255, 255, 255, 0.56);
  transition: transform 0.2s, background 0.2s;
}
.repo-button:hover { transform: translateY(-1px); background: linear-gradient(130deg, rgba(203, 220, 243, 0.52), rgba(237, 231, 232, 0.46)); }
:root[data-theme="dark"] .repo-button {
  background: linear-gradient(130deg, rgba(109, 142, 175, 0.14), rgba(201, 180, 170, 0.06));
  border-color: rgba(165, 189, 213, 0.14);
}
.repo-icon { border-radius: 10px; padding: 7px; background: rgba(255, 255, 255, 0.65); color: #6885aa; }
:root[data-theme="dark"] .repo-icon { background: rgba(180, 204, 224, 0.12); color: #b4ccdf; }
.repo-button > span:nth-child(2) { flex: 1; min-width: 0; }
.repo-button strong { display: block; font-size: 12px; font-weight: 550; }
.repo-button small { display: block; font-size: 10px; color: var(--muted); margin-top: 2px; }
.repo-button > span:last-child .icon { width: 13px; height: 13px; color: var(--faint); }

.sidebar-line { height: 1px; background: var(--line); margin: 13px 6px; }
.appearance-side {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 10px;
  width: 100%;
  font-size: 12px;
  color: var(--muted);
  border-radius: 10px;
  min-height: 34px;
}
.appearance-side:hover { color: var(--text); background: rgba(255, 255, 255, 0.22); }
:root[data-theme="dark"] .appearance-side:hover { background: rgba(255, 255, 255, 0.05); }
.appearance-side .icon { width: 15px; height: 15px; }
.shortcut-key { font-size: 10px; margin-left: auto; color: var(--faint); }
.sidebar-signature {
  font-family: Georgia, serif;
  font-style: italic;
  font-size: 9px;
  color: var(--faint);
  text-align: center;
  margin-top: 14px;
  opacity: 0.78;
}

/* Main Shell & Topbar */
.page-shell { margin-left: calc(var(--sidebar-width) + 16px); min-height: 100dvh; display: flex; flex-direction: column; }
.topbar {
  height: 86px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 48px;
  max-width: 1540px;
  width: 100%;
  margin: 0 auto;
}
.breadcrumbs { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); min-width: 0; }
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs strong { font-weight: 550; color: var(--text); }
.crumb-slash { color: var(--faint); opacity: 0.6; }
.crumb-ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 280px; }
.mobile-brand { display: none; }

.topbar-right { display: flex; align-items: center; gap: 9px; }
.space-label { font-family: Georgia, serif; font-size: 11px; font-style: italic; color: var(--muted); margin-right: 8px; }
.search-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12px;
  color: var(--muted);
  transition: background 0.2s, border-color 0.2s;
}
.search-pill:hover { background: var(--surface); color: var(--text); }
.search-pill .icon { width: 14px; height: 14px; }
.search-pill kbd {
  font-size: 10px;
  color: var(--faint);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 0 5px;
}
.icon-button {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  flex-shrink: 0;
  transition: background 0.2s, color 0.2s;
}
.icon-button .icon { width: 16px; height: 16px; }
.icon-button:hover { background: var(--surface); color: var(--text); }

main {
  flex: 1;
  max-width: 1444px;
  width: 100%;
  margin: 0 auto;
  padding: 12px 48px 0;
}

/* Home Hero */
.hero-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 348px;
  gap: 32px;
  align-items: center;
  margin-bottom: 34px;
}
.hero-intro { padding-left: 4px; min-width: 0; }
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.3px;
}
.greeting-mark { color: #b29165; }
.eyebrow-divider { height: 10px; width: 1px; background: var(--line); margin: 0 2px; }
.hero h1 {
  font-size: 44px;
  font-weight: 560;
  line-height: 1.24;
  letter-spacing: -0.4px;
  margin: 16px 0 12px;
  color: var(--text-strong);
}
.hero h1 span {
  display: block;
  background: linear-gradient(95deg, #5479aa, #8c83a5 78%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
:root[data-theme="dark"] .hero h1 span {
  background: linear-gradient(95deg, #9fbedc, #b8a6c9);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-copy { color: var(--muted); font-size: 14px; letter-spacing: 0.3px; margin: 0; max-width: 560px; }

/* Writing Pulse Panel (echoes main site's clock-panel) */
.pulse-panel {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-radius: 26px;
  padding: 20px 22px 18px;
  color: #edf4ff;
  background: linear-gradient(135deg, rgba(55, 84, 122, 0.92), rgba(38, 60, 99, 0.92) 58%, rgba(74, 86, 123, 0.88));
  border: 1px solid rgba(255, 255, 255, 0.62);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.38), 0 18px 36px rgba(82, 109, 150, 0.20);
  transform: rotate(-1.2deg);
  transition: transform 0.4s cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 0.4s;
}
.pulse-panel:hover {
  transform: rotate(0deg) translateY(-2px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.44), 0 24px 44px rgba(82, 109, 150, 0.25);
}
:root[data-theme="dark"] .pulse-panel {
  background: linear-gradient(135deg, rgba(77, 114, 151, 0.46), rgba(38, 62, 105, 0.78) 65%, rgba(112, 103, 133, 0.28));
  border-color: rgba(195, 220, 255, 0.28);
}
.pulse-art { position: absolute; inset: 0; pointer-events: none; z-index: 0; }
.pulse-art i {
  position: absolute; width: 210px; height: 210px; border-radius: 50%;
  border: 1px solid rgba(219, 234, 255, 0.12); right: -88px; top: -78px;
}
.pulse-art i:nth-child(2) { width: 280px; height: 280px; right: -122px; top: -112px; }
.pulse-art span { position: absolute; right: 24px; bottom: 16px; font-size: 13px; color: rgba(220, 233, 255, 0.35); }
.pulse-heading {
  position: relative; z-index: 1;
  display: flex; justify-content: space-between; align-items: center;
  font-size: 9px; letter-spacing: 1.5px; color: rgba(212, 225, 243, 0.8);
  margin-bottom: 14px;
}
.pulse-live { display: inline-flex; align-items: center; gap: 5px; }
.pulse-live i {
  width: 5px; height: 5px; border-radius: 50%; background: #a8e6c1;
  animation: live-pulse 2.8s ease-in-out infinite;
}
@keyframes live-pulse { 0%, 100% { opacity: 0.45; } 50% { opacity: 1; } }

.pulse-stats {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
  padding-bottom: 13px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}
.pulse-stat strong {
  display: block; font-size: 24px; font-weight: 450; letter-spacing: 0.4px;
  font-variant-numeric: tabular-nums;
}
.pulse-stat span { font-size: 10px; color: rgba(214, 228, 246, 0.78); }
.pulse-cities {
  position: relative; z-index: 1;
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 11px; font-size: 11px; color: rgba(226, 236, 251, 0.9);
  font-variant-numeric: tabular-nums;
}

/* Featured Editorial Bento Card */
.featured-bento {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.85fr);
  gap: 28px;
  padding: 32px;
  border-radius: 26px;
  margin-bottom: 34px;
  overflow: hidden;
  transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 0.35s;
}
.featured-bento:hover {
  transform: translateY(-3px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.88), 0 18px 42px rgba(74, 102, 144, 0.12);
}
.featured-badge {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 10px; font-weight: 600; letter-spacing: 1.4px;
  color: var(--accent);
  background: rgba(114, 149, 194, 0.12);
  border: 1px solid rgba(114, 149, 194, 0.22);
  padding: 5px 11px; border-radius: 999px;
}
.featured-copy h2 {
  font-size: 28px; font-weight: 600; line-height: 1.3; letter-spacing: -0.3px;
  margin: 16px 0 8px; color: var(--text-strong);
}
.featured-subtitle { font-size: 15px; color: var(--muted); margin: 0 0 12px; font-weight: 450; }
.featured-summary {
  font-size: 13px; line-height: 1.75; color: var(--muted);
  margin: 0 0 22px; max-width: 60ch;
}
.featured-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 14px;
  font-size: 12px; color: var(--faint); margin-bottom: 22px;
}
.featured-cta {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: 13px;
  background: linear-gradient(145deg, #7495bf, #5174a4);
  color: #fff; font-size: 13px; font-weight: 500;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.38), 0 6px 16px rgba(79, 114, 166, 0.24);
  transition: filter 0.2s, transform 0.2s;
}
.featured-cta:hover { filter: brightness(1.06); transform: translateY(-1px); }

.featured-artwork {
  position: relative;
  border-radius: 20px;
  min-height: 230px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.48);
  display: flex; flex-direction: column; justify-content: flex-end; padding: 20px;
  color: #fff;
}
.featured-artwork[data-art="aurora"] {
  background: radial-gradient(circle at 80% 15%, rgba(235, 210, 195, 0.65), transparent 48%),
              radial-gradient(circle at 20% 80%, rgba(164, 194, 232, 0.72), transparent 55%),
              linear-gradient(135deg, #4b6e9e, #6e6c96 60%, #9b889c);
}
.featured-artwork[data-art="ocean"] {
  background: radial-gradient(circle at 85% 20%, rgba(202, 224, 194, 0.65), transparent 50%),
              linear-gradient(135deg, #356478, #4d808f 55%, #73999b);
}
.featured-artwork[data-art="sunset"] {
  background: radial-gradient(circle at 75% 25%, rgba(246, 220, 174, 0.72), transparent 48%),
              linear-gradient(135deg, #8a645a, #a87b86 58%, #c9a17a);
}
.featured-artwork svg { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0.45; }
.artwork-caption { position: relative; z-index: 1; }
.artwork-caption span { display: block; font-size: 9px; letter-spacing: 1.6px; opacity: 0.85; }
.artwork-caption strong { display: block; font-size: 16px; font-weight: 550; margin-top: 4px; }

/* Toolbar & Filter Pills */
.feed-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; margin-bottom: 18px; flex-wrap: wrap;
}
.feed-title-wrap { display: flex; align-items: center; gap: 10px; }
.feed-title-wrap h2 { font-size: 16px; font-weight: 600; margin: 0; }
.count-badge {
  font-size: 11px; color: var(--accent);
  background: rgba(255, 255, 255, 0.62); border: 1px solid var(--border);
  padding: 2px 8px; border-radius: 7px; font-variant-numeric: tabular-nums;
}
:root[data-theme="dark"] .count-badge { background: rgba(160, 187, 213, 0.14); }

.toolbar-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tag-pills { display: flex; align-items: center; gap: 6px; overflow-x: auto; scrollbar-width: none; max-width: 100%; }
.tag-pills::-webkit-scrollbar { display: none; }
.tag-pill {
  min-height: 30px; padding: 0 11px; border-radius: 999px;
  font-size: 11px; color: var(--muted); white-space: nowrap;
  border: 1px solid var(--line); background: rgba(255, 255, 255, 0.25);
  transition: all 0.18s;
}
:root[data-theme="dark"] .tag-pill { background: rgba(255, 255, 255, 0.04); }
.tag-pill:hover { color: var(--text); border-color: var(--accent); }
.tag-pill.active { background: var(--active); color: var(--accent); border-color: rgba(113, 158, 212, 0.45); }

.view-switch { display: flex; border-radius: 10px; padding: 3px; gap: 2px; }
.view-switch button {
  width: 30px; min-height: 26px; border-radius: 7px;
  display: flex; align-items: center; justify-content: center; color: var(--muted);
}
.view-switch button.active { background: var(--surface); color: var(--accent); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08); }
.view-switch .icon { width: 14px; height: 14px; }

.mobile-categories { display: none; }

/* Post Cards Grid */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.post-card {
  position: relative;
  border-radius: 22px;
  padding: 24px;
  display: flex; flex-direction: column; justify-content: space-between; gap: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72), var(--shadow);
  transition: transform 0.28s cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 0.28s, border-color 0.28s;
  overflow: hidden;
  cursor: pointer;
}
:root[data-theme="dark"] .post-card {
  box-shadow: inset 0 1px 0 rgba(223, 237, 255, 0.06), var(--shadow);
}
.post-card::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse at 100% 0%, rgba(var(--group-rgb), 0.12), transparent 68%);
  opacity: 0.75; transition: opacity 0.25s;
}
.post-card[data-category="architecture"], .post-card[data-category="life"] { --group-rgb: 111, 167, 155; }
.post-card[data-category="ai"] { --group-rgb: 158, 135, 180; }
.post-card:hover {
  transform: translateY(-4px);
  border-color: rgba(140, 174, 214, 0.55);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85), 0 14px 28px rgba(var(--group-rgb), 0.16);
}
.post-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; position: relative; z-index: 1; }
.post-cat-badge {
  font-size: 11px; font-weight: 500; color: var(--accent);
  background: rgba(107, 139, 190, 0.11); padding: 3px 9px; border-radius: 7px;
}
.post-draft-badge {
  font-size: 10px; font-weight: 600; color: #b67a3d;
  background: rgba(219, 164, 93, 0.16); padding: 2px 8px; border-radius: 6px;
}
.post-date { font-size: 11px; color: var(--faint); font-variant-numeric: tabular-nums; }
.post-card-body { position: relative; z-index: 1; }
.post-card-body h3 {
  font-size: 18px; font-weight: 600; line-height: 1.4;
  margin: 0 0 8px; color: var(--text-strong);
}
.post-card-body p {
  font-size: 13px; line-height: 1.7; color: var(--muted);
  margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.post-card-foot {
  position: relative; z-index: 1;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding-top: 12px; border-top: 1px solid var(--line);
  font-size: 11px; color: var(--faint);
}
.post-tags-inline { display: flex; gap: 6px; overflow: hidden; }
.post-tags-inline span { font-size: 10px; color: var(--muted); background: rgba(120, 145, 180, 0.09); padding: 2px 7px; border-radius: 6px; white-space: nowrap; }
.post-metrics { display: inline-flex; align-items: center; gap: 10px; white-space: nowrap; flex-shrink: 0; }

/* Editorial Index (List View) */
.posts-index { display: grid; gap: 8px; }
.index-row {
  display: flex; align-items: center; gap: 16px;
  padding: 15px 20px; border-radius: 16px;
  background: var(--surface); border: 1px solid var(--border);
  transition: transform 0.2s, border-color 0.2s;
  cursor: pointer;
}
.index-row:hover { transform: translateX(4px); border-color: rgba(140, 174, 214, 0.5); }
.index-date { font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; width: 92px; flex-shrink: 0; }
.index-title { font-size: 15px; font-weight: 550; color: var(--text-strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.index-dots { flex: 1; height: 1px; border-bottom: 1px dashed var(--line); min-width: 24px; }
.index-meta { font-size: 12px; color: var(--muted); white-space: nowrap; flex-shrink: 0; }

/* Archive Timeline View */
.archive-header { margin-bottom: 28px; }
.archive-header h1 { font-size: 34px; font-weight: 600; margin: 8px 0 8px; color: var(--text-strong); }
.archive-header p { color: var(--muted); margin: 0; }
.archive-year-block { margin-bottom: 34px; }
.archive-year-title {
  display: flex; align-items: baseline; gap: 12px;
  font-size: 24px; font-weight: 600; color: var(--text-strong);
  margin: 0 0 14px; padding-bottom: 10px; border-bottom: 1px solid var(--line);
}
.archive-year-title span { font-size: 12px; font-weight: 450; color: var(--muted); }
.archive-list { display: grid; gap: 10px; }

/* Article Reader View */
.article-shell {
  display: grid;
  grid-template-columns: minmax(0, 740px) 240px;
  justify-content: center;
  gap: 44px;
  align-items: start;
  padding-top: 10px;
}
.article-shell.no-toc { grid-template-columns: minmax(0, 740px); }
.article-column { min-width: 0; }
.article-back-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px; gap: 12px;
}
.pill-link {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 14px; border-radius: 999px;
  font-size: 12px; color: var(--muted);
}
.pill-link:hover { color: var(--accent); background: var(--surface); }

.article-header { margin-bottom: 30px; }
.article-kicker { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; font-size: 12px; color: var(--muted); }
.article-header h1 {
  font-size: clamp(28px, 3.6vw, 40px);
  font-weight: 650; line-height: 1.26; letter-spacing: -0.4px;
  margin: 0 0 12px; color: var(--text-strong);
}
.article-subtitle { font-size: 17px; line-height: 1.6; color: var(--muted); margin: 0 0 20px; font-weight: 420; }
.article-meta-bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 12px; padding: 14px 18px; border-radius: 16px;
}
.author-chip { display: flex; align-items: center; gap: 10px; }
.author-chip img { border-radius: 50%; border: 1.5px solid var(--border); }
.author-chip strong { display: block; font-size: 13px; font-weight: 550; }
.author-chip span { display: block; font-size: 11px; color: var(--muted); }
.meta-numbers { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--muted); }

/* Mobile/Inline TOC */
.toc-inline {
  display: none;
  margin-bottom: 24px;
  padding: 14px 18px;
  border-radius: 16px;
}
.toc-inline summary { cursor: pointer; font-size: 13px; font-weight: 550; color: var(--text-strong); }
.toc-inline nav { margin-top: 10px; display: grid; gap: 6px; }

/* Desktop Sticky TOC */
.toc-aside {
  position: sticky;
  top: 86px;
  padding: 18px;
  border-radius: 20px;
}
.toc-title { font-size: 10px; letter-spacing: 1.6px; color: var(--faint); margin-bottom: 12px; font-weight: 600; }
.toc-list { display: grid; gap: 4px; border-left: 1.5px solid var(--line); padding-left: 12px; }
.toc-link {
  display: block; font-size: 12px; line-height: 1.5; color: var(--muted);
  padding: 4px 0; transition: color 0.18s, transform 0.18s;
}
.toc-link.depth-3 { padding-left: 12px; font-size: 11.5px; opacity: 0.88; }
.toc-link:hover { color: var(--accent); }
.toc-link.active { color: var(--accent); font-weight: 550; transform: translateX(2px); }

/* Prose Typography (Apple Editorial) */
.prose {
  font-family: var(--prose-font);
  font-size: var(--prose-size);
  line-height: 1.85;
  color: var(--text);
  letter-spacing: 0.01em;
}
.prose[data-font="serif"] {
  --prose-font: Georgia, "Songti SC", "Noto Serif SC", serif;
}
.prose[data-size="sm"] { --prose-size: 15px; }
.prose[data-size="md"] { --prose-size: 17px; }
.prose[data-size="lg"] { --prose-size: 19px; }

.prose > *:first-child { margin-top: 0; }
.prose h2 {
  font-size: 1.48em; font-weight: 620; line-height: 1.35;
  margin: 2.1em 0 0.75em; color: var(--text-strong); letter-spacing: -0.02em;
  position: relative;
}
.prose h3 {
  font-size: 1.2em; font-weight: 600; line-height: 1.4;
  margin: 1.65em 0 0.6em; color: var(--text-strong);
}
.prose h4 { font-size: 1.05em; font-weight: 600; margin: 1.4em 0 0.5em; }
.heading-anchor {
  position: absolute; left: -22px; opacity: 0; color: var(--accent);
  font-weight: 400; text-decoration: none; transition: opacity 0.18s;
}
.prose h2:hover .heading-anchor, .prose h3:hover .heading-anchor { opacity: 0.75; }

.prose p { margin: 0 0 1.25em; }
.prose a { color: var(--accent); text-decoration: underline; text-decoration-color: rgba(113, 158, 212, 0.4); text-underline-offset: 3px; }
.prose a:hover { text-decoration-color: var(--accent); }
.prose ul, .prose ol { margin: 0 0 1.3em; padding-left: 1.5em; }
.prose li { margin-bottom: 0.45em; }
.prose li.task-item { list-style: none; margin-left: -1.3em; display: flex; align-items: baseline; gap: 9px; }
.task-box {
  width: 15px; height: 15px; border-radius: 5px;
  border: 1.5px solid var(--accent); display: inline-block; flex-shrink: 0; transform: translateY(2px);
}
.task-box.checked { background: var(--accent); box-shadow: inset 0 0 0 3px var(--bg); }

.prose code {
  font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.86em;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(114, 144, 184, 0.12);
  color: var(--text-strong);
}
.prose kbd {
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.8em;
  padding: 2px 6px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 0 1px 0 var(--line);
}

.prose blockquote {
  margin: 1.6em 0;
  padding: 4px 0 4px 20px;
  border-left: 3px solid var(--accent);
  color: var(--muted);
  font-style: normal;
}
.prose blockquote p:last-child { margin-bottom: 0; }

/* Apple Callout Boxes */
.callout {
  margin: 1.6em 0;
  padding: 16px 20px;
  border-radius: 16px;
  border: 1px solid rgba(113, 158, 212, 0.25);
  background: rgba(113, 158, 212, 0.08);
}
.callout-tip { border-color: rgba(88, 166, 134, 0.28); background: rgba(88, 166, 134, 0.08); }
.callout-important { border-color: rgba(154, 128, 196, 0.28); background: rgba(154, 128, 196, 0.08); }
.callout-warning { border-color: rgba(212, 151, 86, 0.32); background: rgba(212, 151, 86, 0.09); }
.callout-head {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--text-strong);
}
.callout-tip .callout-head { color: #3d7d66; }
:root[data-theme="dark"] .callout-tip .callout-head { color: #8cd3b8; }
.callout-warning .callout-head { color: #a86b2d; }
:root[data-theme="dark"] .callout-warning .callout-head { color: #ebb981; }
.callout-body { font-size: 0.94em; line-height: 1.72; }
.callout-body p:last-child { margin-bottom: 0; }

/* macOS Code Window */
.code-window {
  margin: 1.7em 0;
  border-radius: 16px;
  overflow: hidden;
  background: #1b2432;
  border: 1px solid rgba(152, 180, 214, 0.16);
  box-shadow: 0 14px 32px rgba(15, 25, 42, 0.14);
  color: #e4ecf7;
}
.code-chrome {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  font-size: 11px; color: #92a4bd;
}
.code-dots { display: flex; gap: 6px; margin-right: 4px; }
.code-dots i { width: 10px; height: 10px; border-radius: 50%; background: rgba(255, 255, 255, 0.22); transition: background 0.2s; }
.code-window:hover .code-dots i:nth-child(1) { background: #ff5f57; }
.code-window:hover .code-dots i:nth-child(2) { background: #febc2e; }
.code-window:hover .code-dots i:nth-child(3) { background: #28c840; }
.code-lang { font-weight: 550; letter-spacing: 0.6px; }
.code-lines { margin-left: auto; opacity: 0.7; }
.code-copy {
  min-height: 24px; padding: 2px 9px; border-radius: 6px;
  font-size: 11px; color: #c7d5e8;
  background: rgba(255, 255, 255, 0.08);
  transition: background 0.18s;
}
.code-copy:hover { background: rgba(255, 255, 255, 0.16); }
.code-window pre {
  margin: 0; padding: 16px 18px; overflow-x: auto;
  font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 13px; line-height: 1.65;
}
.code-window pre code { background: none; padding: 0; color: inherit; font-size: inherit; }
.tok-kw { color: #8ab8f0; font-weight: 500; }
.tok-str { color: #a3d9a5; }
.tok-cmt { color: #7a8ba3; font-style: italic; }
.tok-num { color: #f0b884; }
.tok-key { color: #c3b0e8; }
.tok-fn { color: #7cd4d0; }
.tok-var { color: #e8b896; }

/* Tables & Figures */
.table-wrap {
  margin: 1.7em 0;
  border-radius: 16px;
  overflow-x: auto;
}
.table-wrap table { width: 100%; border-collapse: collapse; font-size: 0.92em; }
.table-wrap th, .table-wrap td { padding: 12px 16px; border-bottom: 1px solid var(--line); }
.table-wrap th { font-weight: 600; color: var(--text-strong); background: rgba(120, 148, 188, 0.07); }
.table-wrap tr:last-child td { border-bottom: 0; }

.article-figure { margin: 1.8em 0; text-align: center; }
.article-figure img, .prose img {
  max-width: 100%; height: auto; border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: 0 12px 30px rgba(32, 48, 72, 0.10);
  cursor: zoom-in;
}
.article-figure figcaption { margin-top: 9px; font-size: 12px; color: var(--muted); }

.editorial-rule {
  border: 0; margin: 2.4em auto; text-align: center; height: 20px; position: relative;
}
.editorial-rule::before { content: "✧   ✧   ✧"; color: var(--faint); font-size: 12px; letter-spacing: 6px; }

/* End of Article Interaction */
.article-engage {
  margin-top: 42px;
  padding: 24px;
  border-radius: 22px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.clap-button {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 10px 18px; border-radius: 999px;
  background: linear-gradient(145deg, rgba(114, 150, 194, 0.16), rgba(140, 131, 165, 0.14));
  border: 1px solid rgba(114, 150, 194, 0.3);
  color: var(--text-strong); font-size: 13px; font-weight: 550;
  transition: transform 0.18s cubic-bezier(0.2, 0.9, 0.3, 1.4), background 0.2s;
}
.clap-button:hover { transform: translateY(-2px); background: rgba(114, 150, 194, 0.24); }
.clap-button.popping { transform: scale(1.1); }
.clap-count { font-variant-numeric: tabular-nums; color: var(--accent); }

.article-nav-cards {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px; margin-top: 22px;
}
.nav-post-card {
  padding: 18px 20px; border-radius: 18px; display: block;
  transition: transform 0.2s, border-color 0.2s;
}
.nav-post-card:hover { transform: translateY(-2px); border-color: rgba(140, 174, 214, 0.55); }
.nav-post-card span { display: block; font-size: 11px; color: var(--faint); margin-bottom: 5px; }
.nav-post-card strong { display: block; font-size: 14px; font-weight: 550; color: var(--text-strong); }

/* Studio Workspace (Apple Notes / Bear Style) */
.studio-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 18px;
  min-height: calc(100dvh - 150px);
}
.studio-list-pane {
  border-radius: 22px;
  padding: 16px;
  display: flex; flex-direction: column; gap: 12px;
  max-height: calc(100dvh - 140px);
  overflow: hidden;
}
.studio-list-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.studio-list-head h2 { font-size: 15px; font-weight: 600; margin: 0; }
.studio-search {
  width: 100%; height: 36px; border-radius: 10px;
  border: 1px solid var(--line); background: rgba(255, 255, 255, 0.45);
  padding: 0 11px; font-size: 12px;
}
:root[data-theme="dark"] .studio-search { background: rgba(15, 25, 40, 0.42); }
.studio-items { overflow-y: auto; display: grid; gap: 6px; padding-right: 2px; }
.studio-item {
  text-align: left; padding: 11px 12px; border-radius: 13px;
  border: 1px solid transparent; transition: background 0.18s;
}
.studio-item:hover { background: rgba(255, 255, 255, 0.35); }
:root[data-theme="dark"] .studio-item:hover { background: rgba(255, 255, 255, 0.06); }
.studio-item.active { background: var(--active); border-color: rgba(113, 158, 212, 0.35); }
.studio-item strong { display: block; font-size: 13px; font-weight: 550; margin-bottom: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.studio-item small { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); }

.studio-editor-pane {
  border-radius: 22px;
  padding: 18px 22px;
  display: flex; flex-direction: column; gap: 14px;
}
.studio-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; flex-wrap: wrap; padding-bottom: 12px; border-bottom: 1px solid var(--line);
}
.studio-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.studio-meta-grid {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px;
  padding: 14px; border-radius: 15px; background: rgba(125, 150, 185, 0.07);
}
.studio-field { display: flex; flex-direction: column; gap: 4px; font-size: 11px; color: var(--muted); }
.studio-field.span-2 { grid-column: span 2; }
.studio-field.span-4 { grid-column: 1 / -1; }
.studio-field input, .studio-field select {
  height: 34px; border-radius: 9px; border: 1px solid var(--line);
  background: var(--surface); padding: 0 10px; font-size: 12px; color: var(--text);
}
.studio-toggles { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; font-size: 12px; }
.studio-toggles label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }

.md-format-bar {
  display: flex; align-items: center; gap: 4px; flex-wrap: wrap;
}
.md-format-bar button {
  min-height: 30px; padding: 0 9px; border-radius: 8px;
  font-size: 12px; color: var(--muted); border: 1px solid transparent;
}
.md-format-bar button:hover { background: var(--active); color: var(--accent); }

.studio-split {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px; flex: 1; min-height: 460px;
}
.studio-split[data-pane="write"] { grid-template-columns: 1fr; }
.studio-split[data-pane="write"] .studio-preview { display: none; }
.studio-split[data-pane="preview"] { grid-template-columns: 1fr; }
.studio-split[data-pane="preview"] .studio-textarea { display: none; }

.studio-textarea {
  width: 100%; min-height: 460px; resize: vertical;
  border-radius: 16px; border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.5);
  padding: 18px; font-family: "SF Mono", ui-monospace, Menlo, monospace;
  font-size: 13.5px; line-height: 1.75;
}
:root[data-theme="dark"] .studio-textarea { background: rgba(16, 26, 40, 0.55); }
.studio-preview {
  border-radius: 16px; border: 1px solid var(--line);
  background: var(--surface); padding: 20px 24px;
  max-height: 640px; overflow-y: auto;
}

/* Dialogs, Spotlight & Lightbox */
dialog.glass {
  padding: 30px; border-radius: 28px; max-width: calc(100% - 32px);
  color: var(--text); background: rgba(242, 246, 252, 0.95);
  box-shadow: inset 0 1px 0 #fff, 0 30px 100px rgba(26, 48, 89, 0.2);
}
:root[data-theme="dark"] dialog.glass { background: rgba(35, 50, 72, 0.96); }
dialog::backdrop { background: rgba(32, 49, 75, 0.3); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }

.settings-dialog { width: 500px; }
.auth-dialog { width: 420px; }
.dialog-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.dialog-eyebrow { font-size: 9px; letter-spacing: 2px; color: var(--accent); }
.dialog-top h2 { font-size: 22px; font-weight: 560; margin: 7px 0 0; }
.dialog-intro { font-size: 12px; line-height: 1.75; color: var(--muted); margin: 12px 0 22px; }
.settings-dialog h3 { font-size: 12px; font-weight: 550; margin: 20px 0 10px; }
.theme-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.theme-options button { padding: 0; text-align: center; font-size: 11px; color: var(--muted); }
.theme-preview { display: flex; gap: 6px; border: 2px solid transparent; border-radius: 12px; height: 72px; padding: 14px 10px; background: #e1e8f2; margin-bottom: 7px; }
.theme-preview i { display: block; width: 24%; border-radius: 5px; background: rgba(255, 255, 255, 0.72); }
.theme-preview i + i { width: 70%; background: rgba(255, 255, 255, 0.5); }
.preview-dark { background: #28384c; }
.preview-dark i { background: rgba(255, 255, 255, 0.22); }
.preview-dark i + i { background: rgba(255, 255, 255, 0.12); }
.preview-system { background: linear-gradient(90deg, #e1e8f2 50%, #28384c 50%); }
.theme-options button.active .theme-preview { border-color: #7a9ec6; }

.ambience-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.ambience-options button { display: flex; align-items: center; gap: 9px; border: 1px solid var(--line); background: var(--glass); border-radius: 12px; padding: 10px; font-size: 12px; min-height: 46px; }
.ambience-options button.active { border-color: #89a6ca; background: rgba(203, 220, 244, 0.22); }
.ambience-swatch { width: 24px; height: 24px; border-radius: 50%; display: block; border: 1px solid rgba(255, 255, 255, 0.6); }
.swatch-aurora { background: conic-gradient(from 20deg, #afc8e9, #c5b8d7, #efd5bf, #afc8e9); }
.swatch-sunset { background: conic-gradient(from 20deg, #e6c2a8, #d9aebc, #f1d7a6, #e6c2a8); }
.swatch-ocean { background: conic-gradient(from 20deg, #9fcbd5, #a5c0cb, #d3ddbd, #9fcbd5); }
.material-options { display: flex; gap: 12px; }
.material-options button { text-align: left; flex: 1; border: 1px solid var(--line); background: var(--glass); border-radius: 12px; padding: 13px; font-size: 12px; }
.material-options button span { display: block; font-size: 10px; color: var(--muted); margin-top: 4px; }
.material-options button.active { border-color: #86a6c8; background: rgba(226, 236, 246, 0.35); }
.settings-note { display: flex; align-items: center; gap: 8px; padding-top: 18px; color: var(--muted); font-size: 11px; }

/* Spotlight Dialog */
.spotlight-dialog { width: 620px; padding: 0 !important; overflow: hidden; }
.spotlight-input-wrap {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 20px; border-bottom: 1px solid var(--line);
}
.spotlight-input-wrap input {
  flex: 1; border: 0; background: none; outline: none !important; font-size: 15px;
}
.spotlight-input-wrap kbd { font-size: 10px; color: var(--faint); border: 1px solid var(--line); padding: 2px 6px; border-radius: 5px; }
.spotlight-results { max-height: 380px; overflow-y: auto; padding: 10px; display: grid; gap: 4px; }
.spotlight-item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; text-align: left; padding: 11px 14px; border-radius: 12px;
}
.spotlight-item:hover, .spotlight-item.active { background: var(--active); }
.spotlight-item strong { display: block; font-size: 13px; font-weight: 550; }
.spotlight-item small { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }
.spotlight-kind { font-size: 10px; color: var(--accent); flex-shrink: 0; }
.spotlight-footer {
  display: flex; justify-content: space-between; padding: 10px 18px;
  font-size: 11px; color: var(--faint); border-top: 1px solid var(--line);
}

.auth-form { display: grid; gap: 12px; }
.auth-form input {
  height: 42px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface); padding: 0 14px; font-size: 14px;
}
.auth-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }
.form-error { margin: 0; font-size: 12px; color: #c75151; }

.primary-button {
  min-height: 38px; padding: 0 18px; border-radius: 12px;
  background: linear-gradient(145deg, #7495bf, #5174a4); color: #fff; font-size: 13px; font-weight: 500;
}
.secondary-button {
  min-height: 36px; padding: 0 14px; border-radius: 11px;
  border: 1px solid var(--line); background: var(--surface); font-size: 12px;
}
.danger-button {
  min-height: 36px; padding: 0 14px; border-radius: 11px;
  color: #c75151; border: 1px solid rgba(199, 81, 81, 0.25); font-size: 12px;
}
.text-button { font-size: 12px; color: var(--muted); padding: 0 10px; }

/* Lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(15, 23, 36, 0.84);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  display: flex; align-items: center; justify-content: center; padding: 32px;
}
.lightbox-close { position: fixed; top: 20px; right: 20px; color: #fff; background: rgba(255, 255, 255, 0.14); }
.lightbox-figure { margin: 0; max-width: 92vw; max-height: 88vh; text-align: center; }
.lightbox-figure img { max-width: 100%; max-height: 80vh; border-radius: 14px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45); }
.lightbox-figure figcaption { margin-top: 12px; color: #d6e2f2; font-size: 13px; }

.toast {
  position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%);
  z-index: 120; border-radius: 13px; padding: 11px 20px; font-size: 12px;
  white-space: nowrap; background: var(--surface-strong);
}

footer {
  border-top: 1px solid var(--line);
  margin: 54px auto 0;
  padding: 22px 48px 30px;
  max-width: 1444px;
  width: 100%;
  display: flex; justify-content: space-between; align-items: center;
  font-size: 11px; color: var(--faint);
}
footer a:hover { color: var(--accent); }
.footer-divider { margin: 0 10px; opacity: 0.6; }
.mobile-dock { display: none; }
.skip-link { position: fixed; top: -60px; left: 40%; padding: 10px; background: #fff; color: #344a66; z-index: 200; border-radius: 10px; }
.skip-link:focus { top: 20px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }

/* Responsive */
@media (min-width: 761px) and (max-width: 1180px) {
  :root { --sidebar-width: 186px; }
  .topbar, main, footer { padding-left: 30px; padding-right: 30px; }
  .space-label, .shortcut-key, .settings-desktop { display: none; }
  .hero-header { grid-template-columns: minmax(0, 1fr) 290px; gap: 22px; }
  .hero h1 { font-size: 36px; }
  .article-shell { grid-template-columns: minmax(0, 1fr); }
  .toc-aside { display: none; }
  .toc-inline { display: block; }
  .reading-mini-bar { left: calc(var(--sidebar-width) + 30px); right: 30px; }
}

@media (min-width: 761px) and (max-width: 960px) {
  :root { --sidebar-width: 72px; }
  .sidebar { padding: 22px 10px 16px; }
  .brand { justify-content: center; padding: 0; }
  .brand > div, .sidebar-caption, .nav-label, .nav-count, .sidebar-signature,
  .repo-button > span:nth-child(2), .repo-button > span:last-child,
  .appearance-side > span:not(:first-child) { display: none; }
  .category-button, .repo-button, .appearance-side { justify-content: center; padding: 0; }
  .repo-button { background: none; border: 0; padding: 6px 0; }
  .featured-bento { grid-template-columns: 1fr; }
  .studio-shell { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .sidebar { display: none; }
  .page-shell { margin-left: 0; }
  .topbar {
    height: 76px;
    padding: max(12px, env(safe-area-inset-top)) 20px 0;
  }
  .breadcrumbs, .space-label, .settings-desktop, .search-pill-text, .search-pill kbd { display: none; }
  .search-pill { width: 36px; padding: 0; justify-content: center; }
  .mobile-brand { display: flex; align-items: center; gap: 9px; font-size: 17px; }
  main { padding: 14px 20px 0; }
  .hero-header { grid-template-columns: 1fr; gap: 18px; margin-bottom: 24px; }
  .hero h1 { font-size: 31px; }
  .pulse-panel { transform: none; }
  .featured-bento { grid-template-columns: 1fr; padding: 22px; }
  .featured-copy h2 { font-size: 22px; }
  .featured-artwork { min-height: 150px; }
  .mobile-categories {
    display: flex; align-items: center; gap: 7px; overflow-x: auto;
    margin: 0 -20px 18px; padding: 0 20px 4px; scrollbar-width: none;
  }
  .mobile-categories::-webkit-scrollbar { display: none; }
  .mobile-categories button {
    flex-shrink: 0; min-height: 34px; padding: 0 13px; border-radius: 11px;
    font-size: 12px; color: var(--muted); border: 1px solid transparent;
  }
  .mobile-categories button.active {
    background: var(--surface); border-color: var(--border); color: var(--accent);
  }
  .posts-grid, .article-nav-cards, .studio-shell, .studio-split, .studio-meta-grid {
    grid-template-columns: 1fr;
  }
  .studio-field.span-2 { grid-column: auto; }
  .article-shell { grid-template-columns: 1fr; gap: 20px; }
  .toc-aside { display: none; }
  .toc-inline { display: block; }
  .reading-mini-bar { left: 12px; right: 12px; top: 10px; }
  .mini-title-wrap span { display: none; }
  footer {
    padding: 22px 20px calc(106px + env(safe-area-inset-bottom));
    flex-direction: column; gap: 8px; text-align: center;
  }
  .mobile-dock {
    position: fixed; z-index: 30;
    bottom: calc(14px + env(safe-area-inset-bottom));
    left: 50%; transform: translateX(-50%);
    display: flex; justify-content: space-around; align-items: center;
    width: calc(100% - 36px); max-width: 400px;
    padding: 6px 8px; border-radius: 24px;
    background: rgba(246, 250, 255, 0.85);
  }
  :root[data-theme="dark"] .mobile-dock { background: rgba(37, 54, 75, 0.86); }
  .mobile-dock button {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 3px; flex: 1; min-height: 46px; border-radius: 16px; font-size: 10px; color: var(--muted);
  }
  .mobile-dock button.active { color: var(--accent); background: rgba(120, 149, 187, 0.14); }
  .toast { bottom: calc(96px + env(safe-area-inset-bottom)); }
}
