/* ============================================
   Space Blog — Design Tokens & Base
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Inter:wght@400;500;600&display=swap');

:root {
  /* Deep space dark (default) */
  --bg:        oklch(12% 0.025 270);
  --surface:   oklch(17% 0.03 270);
  --surface-2: oklch(22% 0.035 270);
  --fg:        oklch(92% 0.01 270);
  --fg-muted:  oklch(65% 0.02 270);
  --fg-dim:    oklch(48% 0.025 270);
  --border:    oklch(28% 0.04 270);
  --accent:    oklch(62% 0.22 285);
  --accent-2:  oklch(70% 0.18 320);
  --success:   oklch(65% 0.18 145);
  --warn:      oklch(72% 0.16 85);
  --danger:    oklch(58% 0.20 25);

  --font-display: 'Space Grotesk', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-body:    'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, Menlo, monospace;

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --nav-height: 64px;
  --shadow-glow: 0 0 40px oklch(62% 0.22 285 / 0.12);
}

[data-theme="light"] {
  --bg:        oklch(97% 0.005 270);
  --surface:   oklch(100% 0 0);
  --surface-2: oklch(94% 0.01 270);
  --fg:        oklch(18% 0.02 270);
  --fg-muted:  oklch(45% 0.03 270);
  --fg-dim:    oklch(58% 0.025 270);
  --border:    oklch(88% 0.015 270);
  --accent:    oklch(55% 0.22 285);
  --accent-2:  oklch(60% 0.18 320);
  --shadow-glow: 0 0 40px oklch(55% 0.22 285 / 0.08);
}

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

html {
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
  font-size: 16px;
  overflow-x: hidden;
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.65;
  color: var(--fg);
  background: var(--bg);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  transition: background 0.4s ease, color 0.4s ease;
}

/* Starfield canvas */
#starfield {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.7;
}

[data-theme="light"] #starfield {
  opacity: 0.15;
}

/* ============================================
   Layout
   ============================================ */

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

@media (max-width: 640px) {
  .container {
    padding: 0 16px;
  }
}

/* ============================================
   Reader Auth
   ============================================ */

.auth-shell {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  padding: 112px 0 64px;
}

.auth-layout {
  width: min(960px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 28px;
  align-items: stretch;
}

.auth-intro,
.auth-card {
  background: oklch(from var(--surface) l c h / 0.78);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
}

.auth-intro {
  padding: 32px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 420px;
}

.auth-kicker {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid oklch(from var(--accent) l c h / 0.35);
  color: var(--accent);
  background: oklch(from var(--accent) l c h / 0.08);
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

.auth-intro h1 {
  margin-top: 28px;
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.3rem);
  line-height: 1.04;
  letter-spacing: 0;
}

.auth-intro p {
  margin-top: 18px;
  color: var(--fg-muted);
  max-width: 28rem;
}

.auth-points {
  display: grid;
  gap: 10px;
  margin-top: 34px;
}

.auth-point {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--fg-muted);
  font-size: 0.92rem;
}

.auth-point span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  flex: 0 0 auto;
}

.auth-card {
  padding: 34px;
}

.auth-card h2 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  margin-bottom: 8px;
}

.auth-card-subtitle {
  color: var(--fg-muted);
  margin-bottom: 28px;
}

.auth-form {
  display: grid;
  gap: 18px;
}

.auth-form label {
  display: block;
  margin-bottom: 7px;
  color: var(--fg-muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.auth-input {
  width: 100%;
  min-height: 46px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--fg);
  padding: 12px 14px;
  font: inherit;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.auth-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px oklch(from var(--accent) l c h / 0.14);
}

.auth-helper,
.auth-error {
  display: block;
  margin-top: 7px;
  font-size: 0.8rem;
}

.auth-helper { color: var(--fg-dim); }
.auth-error { color: var(--danger); }

.auth-actions {
  display: grid;
  gap: 12px;
  margin-top: 8px;
}

.auth-switch {
  text-align: center;
  color: var(--fg-muted);
  font-size: 0.92rem;
}

.auth-switch a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
}

.auth-switch a:hover { text-decoration: underline; }

.auth-submit[disabled] {
  opacity: 0.65;
  cursor: wait;
}

.comments-shell {
  max-width: 820px;
  margin: 0 auto;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: oklch(from var(--surface) l c h / 0.72);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
}

.comments-header {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-end;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--border);
}

.comments-kicker {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

.comments-header h2 {
  margin-top: 6px;
  font-family: var(--font-display);
  font-size: 1.75rem;
}

.comments-header p {
  max-width: 26rem;
  color: var(--fg-muted);
  font-size: 0.92rem;
}

.comments-list {
  display: grid;
  gap: 14px;
  padding: 24px 0;
}

.comment-item {
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.comment-item-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
  color: var(--fg-muted);
  font-size: 0.82rem;
}

.comment-author {
  color: var(--fg);
  font-weight: 700;
}

.comment-content {
  color: var(--fg-muted);
  white-space: pre-wrap;
}

.comment-replies {
  margin-top: 14px;
  padding-left: 16px;
  border-left: 2px solid color-mix(in oklch, var(--accent) 45%, var(--border));
  display: grid;
  gap: 12px;
}

.comment-reply {
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: color-mix(in oklch, var(--surface-2) 82%, transparent);
  border: 1px solid var(--border);
}

.comments-empty {
  padding: 22px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  color: var(--fg-muted);
  text-align: center;
}

.comment-form {
  display: grid;
  gap: 18px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.comment-form label {
  display: block;
  margin-bottom: 7px;
  color: var(--fg-muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.comment-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.comment-textarea {
  min-height: 128px;
  resize: vertical;
}

.comment-submit {
  justify-self: start;
}

@media (max-width: 820px) {
  .nav-auth-link {
    display: none;
  }

  .auth-layout {
    grid-template-columns: 1fr;
  }

  .auth-intro {
    min-height: auto;
  }

  .comments-header,
  .comment-form-grid {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: flex-start;
  }
}

.content-layer {
  position: relative;
  z-index: 1;
  padding-top: var(--nav-height);
}

/* ============================================
   Navigation
   ============================================ */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  background: oklch(from var(--bg) l c h / 0.75);
  border-bottom: 1px solid var(--border);
  transition: background 0.4s ease;
  min-height: var(--nav-height);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-height);
  gap: 24px;
}

.nav-logo {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--fg);
  text-decoration: none;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 160px;
  flex: 0 0 auto;
}

.nav-logo-icon {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0;
  line-height: 1;
}

.nav-logo-icon::before {
  content: '*';
  color: #fff;
  font-size: 15px;
  font-weight: 700;
}
.nav-logo-icon.has-image {
  background: var(--brand-icon-url) center / cover no-repeat, var(--surface-2);
}
.nav-logo-icon.has-image::before {
  content: '';
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
  justify-content: center;
  flex: 1 1 auto;
}

.nav-links a {
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--fg-muted);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  transition: color 0.2s ease, background 0.2s ease;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--fg);
  background: var(--surface-2);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 216px;
  justify-content: flex-end;
  flex: 0 0 auto;
}

.nav-auth-link {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--fg-muted);
  background: var(--surface);
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.nav-auth-link:hover {
  color: var(--fg);
  border-color: oklch(from var(--accent) l c h / 0.45);
  background: var(--surface-2);
}

/* Theme toggle */
.theme-toggle {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--fg-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s ease;
}

.theme-toggle:hover {
  color: var(--fg);
  border-color: var(--accent);
  box-shadow: var(--shadow-glow);
}

/* Mobile nav */
.nav-mobile-btn {
  display: none;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--fg);
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

.search-toggle { order: 10; }
.nav-auth-link { order: 20; }
.theme-toggle[data-theme-toggle] { order: 30; }
.nav-mobile-btn { order: 40; }

.nav-mobile-menu {
  display: none;
  position: fixed;
  top: calc(var(--nav-height, 72px) + 8px);
  left: 12px;
  right: 12px;
  z-index: 1100;
  background: color-mix(in oklch, var(--bg) 86%, transparent);
  backdrop-filter: blur(24px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 10px;
  flex-direction: column;
  gap: 6px;
  transform: translateY(-8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}

.nav-mobile-menu.open {
  display: flex;
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.nav-mobile-menu a {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 500;
  color: var(--fg-muted);
  text-decoration: none;
  min-height: 44px;
  display: flex;
  align-items: center;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.nav-mobile-menu a:hover,
.nav-mobile-menu a.active {
  color: var(--fg);
  background: var(--surface-2);
}

@media (max-width: 768px) {
  .nav-inner {
    gap: 10px;
  }
  .nav-logo {
    min-width: 0;
    font-size: 1.12rem;
  }
  .nav-right {
    min-width: 0;
    gap: 8px;
  }
  .nav-auth-link {
    display: none;
  }
  .theme-toggle {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
  }
  .nav-mobile-btn {
    width: 40px;
    height: 40px;
  }
  .nav-links {
    display: none;
  }
  .nav-mobile-btn {
    display: flex;
  }
}

/* ============================================
   Typography
   ============================================ */

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--fg);
}

h1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
}

h2 {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
}

h3 {
  font-size: clamp(1.25rem, 2vw, 1.5rem);
}

h4 {
  font-size: 1.125rem;
}

p {
  color: var(--fg-muted);
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: opacity 0.2s ease;
}

a:hover {
  opacity: 0.8;
}

.text-gradient {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-muted {
  color: var(--fg-muted);
}

.text-dim {
  color: var(--fg-dim);
}

.text-mono {
  font-family: var(--font-mono);
  font-size: 0.8em;
}

/* ============================================
   Buttons
   ============================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all 0.25s ease;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white;
  box-shadow: 0 4px 20px oklch(62% 0.22 285 / 0.25);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 30px oklch(62% 0.22 285 / 0.35);
  opacity: 1;
}

.btn-secondary {
  background: var(--surface);
  color: var(--fg);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-glow);
  opacity: 1;
}

.btn-ghost {
  background: transparent;
  color: var(--fg-muted);
  border: 1px solid transparent;
}

.btn-ghost:hover {
  color: var(--fg);
  background: var(--surface-2);
  opacity: 1;
}

/* ============================================
   Cards
   ============================================ */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: all 0.3s ease;
}

.card:hover {
  border-color: oklch(from var(--accent) l c h / 0.4);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

.card-glass {
  background: oklch(from var(--surface) l c h / 0.6);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid oklch(from var(--border) l c h / 0.5);
}

/* ============================================
   Tags & Pills
   ============================================ */

.tag {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 100px;
  background: var(--surface-2);
  color: var(--fg-muted);
  border: 1px solid var(--border);
  transition: all 0.2s ease;
  cursor: pointer;
}

.tag:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.tag-active {
  background: oklch(from var(--accent) l c h / 0.12);
  color: var(--accent);
  border-color: oklch(from var(--accent) l c h / 0.3);
}

/* ============================================
   Article List
   ============================================ */

.article-item {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 24px 0;
  border-bottom: 1px solid var(--border);
  transition: all 0.3s ease;
}

.article-item-with-cover {
  display: grid;
  grid-template-columns: 172px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.article-item-cover {
  aspect-ratio: 16 / 10;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface-2);
}

.article-item-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.article-item:first-child {
  padding-top: 0;
}

.article-item:last-child {
  border-bottom: none;
}

.article-item-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--fg);
  line-height: 1.3;
  transition: color 0.2s ease;
}

.article-item:hover .article-item-title {
  color: var(--accent);
}

.article-item-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.article-item-date {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--fg-dim);
}

.article-item-excerpt {
  color: var(--fg-muted);
  font-size: 0.95rem;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ============================================
   Article Detail
   ============================================ */

.article-header {
  padding: 72px 0 48px;
  text-align: center;
}

.article-content {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 0 80px;
}

.article-cover {
  margin: 0 0 34px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface-2);
}

.article-cover img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
}

.article-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  display: block;
  margin: 22px auto;
}

.article-image {
  margin: 24px 0;
}

.article-image figcaption {
  color: var(--fg-dim);
  font-size: 0.86rem;
  text-align: center;
  margin-top: 8px;
}

.article-content h2 {
  margin-top: 48px;
  margin-bottom: 16px;
}

.article-content h3 {
  margin-top: 32px;
  margin-bottom: 12px;
}

.article-content p {
  margin-bottom: 20px;
  font-size: 1.05rem;
  line-height: 1.75;
}

.article-content ul,
.article-content ol {
  margin-bottom: 20px;
  padding-left: 24px;
}

.article-content li {
  margin-bottom: 8px;
  color: var(--fg-muted);
}

.article-content blockquote {
  margin: 32px 0;
  padding: 20px 24px;
  border-left: 3px solid var(--accent);
  background: var(--surface);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-style: italic;
}

.article-content blockquote p {
  margin: 0;
  color: var(--fg);
}

.article-content pre {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.6;
  margin-bottom: 20px;
}

.article-content code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--surface-2);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--accent);
}

.article-content pre code {
  background: none;
  padding: 0;
  color: var(--fg);
}

.content-lock {
  max-width: 760px;
  margin: 48px auto;
}

.content-lock-panel {
  border: 1px solid var(--border);
  background: color-mix(in oklch, var(--surface) 86%, transparent);
  border-radius: 8px;
  padding: 28px;
}

.content-lock-panel h2 {
  margin: 14px 0 8px;
  font-size: clamp(1.5rem, 3vw, 2.25rem);
}

.content-lock-panel p,
.content-lock-error {
  color: var(--fg-muted);
}

.content-lock-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-top: 20px;
}

.content-lock-form input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--fg);
  padding: 0 14px;
  font: inherit;
}

.content-lock-form input:focus {
  outline: 2px solid color-mix(in oklch, var(--accent) 45%, transparent);
  outline-offset: 2px;
}

.content-lock-error {
  min-height: 20px;
  margin-top: 10px;
  font-size: 0.9rem;
}

.content-unlock-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 20px;
  background: oklch(10% 0.03 260 / 0.72);
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
}

.content-unlock-modal.active {
  opacity: 1;
  pointer-events: auto;
}

.content-unlock-box {
  width: min(420px, 100%);
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  padding: 24px;
  box-shadow: var(--shadow-lg);
}

.content-unlock-box h2 {
  margin: 14px 0 8px;
}

.content-unlock-box p,
.content-unlock-error {
  color: var(--fg-muted);
}

.content-unlock-box input {
  width: 100%;
  min-height: 44px;
  margin-top: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--fg);
  padding: 0 14px;
  font: inherit;
}

.content-unlock-error {
  min-height: 20px;
  margin-top: 10px;
  font-size: 0.9rem;
}

.content-unlock-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

@media (max-width: 640px) {
  .content-lock-form {
    grid-template-columns: 1fr;
  }

  .content-unlock-actions {
    flex-direction: column-reverse;
  }

  .content-unlock-actions .btn {
    width: 100%;
  }
}

/* ============================================
   Sections
   ============================================ */

.section {
  padding: 80px 0;
}

@media (max-width: 640px) {
  .section {
    padding: 48px 0;
  }
}

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 32px;
  flex-wrap: wrap;
  gap: 12px;
}

/* ============================================
   Hero
   ============================================ */

.hero {
  padding: 96px 0 80px;
  text-align: center;
  position: relative;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
  background: oklch(from var(--accent) l c h / 0.1);
  border: 1px solid oklch(from var(--accent) l c h / 0.2);
  padding: 6px 14px;
  border-radius: 100px;
  margin-bottom: 24px;
}

.hero-badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.hero h1 {
  margin-bottom: 20px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.hero p {
  font-size: 1.125rem;
  max-width: 560px;
  margin: 0 auto 32px;
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* ============================================
   About Page
   ============================================ */

.about-hero {
  padding: 96px 0 60px;
  text-align: center;
}

.about-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  margin: 0 auto 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 700;
  color: white;
  box-shadow: var(--shadow-glow);
  overflow: hidden;
}

.about-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 48px;
}

.about-stat {
  text-align: center;
  padding: 32px 24px;
}

.about-stat-value {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 8px;
}

.about-stat-label {
  font-size: 0.875rem;
  color: var(--fg-dim);
}

/* ============================================
   RSS Link
   ============================================ */

.rss-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--fg-dim);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  transition: all 0.2s ease;
}

.rss-link:hover {
  color: var(--accent);
  border-color: var(--accent);
  opacity: 1;
}

/* ============================================
   Footer
   ============================================ */

.footer {
  border-top: 1px solid var(--border);
  padding: 40px 0;
  margin-top: auto;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-copy {
  font-size: 0.875rem;
  color: var(--fg-dim);
}

.footer-links {
  display: flex;
  gap: 20px;
}

.footer-links a {
  font-size: 0.875rem;
  color: var(--fg-muted);
}

.footer-links a:hover {
  color: var(--fg);
}

.footer-filing {
  flex-basis: 100%;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.8125rem;
  color: var(--fg-dim);
}

.footer-filing[hidden] {
  display: none;
}

.footer-filing a {
  color: var(--fg-dim);
  text-decoration: none;
}

.footer-filing a:hover {
  color: var(--fg-muted);
}

.footer-police-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.footer-police-link img {
  width: 16px;
  height: 16px;
}

.footer-police-dot {
  width: 14px;
  height: 14px;
  border: 1px solid var(--fg-dim);
  border-radius: 50%;
  display: inline-block;
}

/* ============================================
   Filters
   ============================================ */

.filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.filter-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--fg-dim);
  margin-right: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ============================================
   Scroll reveal
   ============================================ */

.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================
   Utilities
   ============================================ */

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

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

/* ============================================
   Timeline — Archive Page
   ============================================ */

.timeline {
  max-width: 800px;
  margin: 0 auto;
}

.timeline-year {
  margin-bottom: 48px;
}

.timeline-year-marker {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.timeline-year-label {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--fg);
  letter-spacing: -0.02em;
}

.timeline-year-count {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--fg-dim);
}

.timeline-entries {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.timeline-entry {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: all 0.25s ease;
  border: 1px solid transparent;
}

.timeline-entry:hover {
  background: var(--surface);
  border-color: var(--border);
}

.timeline-entry:hover .timeline-entry-title {
  color: var(--accent);
}

.timeline-entry-date {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--fg-dim);
  min-width: 40px;
  text-align: right;
  flex-shrink: 0;
}

.timeline-entry-body {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.timeline-entry-title {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.2s ease;
}

@media (max-width: 640px) {
  .timeline-entry {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 14px 16px;
  }
  .timeline-entry-date {
    text-align: left;
    min-width: auto;
  }
  .timeline-entry-title {
    white-space: normal;
  }
}

/* ============================================
   Music Player
   ============================================ */

.player-wrap {
  max-width: 640px;
  margin: 0 auto 64px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 32px;
  text-align: center;
}

.player-art {
  position: relative;
  width: 180px;
  height: 180px;
  margin: 0 auto 28px;
}

.player-art-visual {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  position: relative;
  z-index: 1;
  transition: transform 0.4s ease;
}

.player-art-visual.playing {
  animation: spin-art 8s linear infinite;
}

@keyframes spin-art {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.player-art-glow {
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  opacity: 0.2;
  filter: blur(24px);
  z-index: 0;
}

.player-info {
  margin-bottom: 24px;
}

.player-track-name {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 6px;
}

.player-track-artist {
  font-size: 0.9rem;
  color: var(--fg-muted);
}

.player-progress-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.player-time {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--fg-dim);
  min-width: 36px;
}

.player-progress-bar {
  flex: 1;
  height: 4px;
  background: var(--surface-2);
  border-radius: 2px;
  cursor: pointer;
  position: relative;
}

.player-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 2px;
  transition: width 0.1s linear;
}

.player-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-bottom: 20px;
}

.player-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--fg);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.player-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.player-btn-play {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border: none;
  color: white;
  box-shadow: 0 4px 20px oklch(62% 0.22 285 / 0.3);
}

.player-btn-play:hover {
  transform: scale(1.05);
  color: white;
  box-shadow: 0 6px 28px oklch(62% 0.22 285 / 0.4);
}

.player-volume-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 200px;
  margin: 0 auto;
  color: var(--fg-dim);
}

.player-volume-bar {
  flex: 1;
  height: 4px;
  background: var(--surface-2);
  border-radius: 2px;
  cursor: pointer;
}

.player-volume-fill {
  height: 100%;
  background: var(--fg-dim);
  border-radius: 2px;
  transition: width 0.2s ease;
}

/* Playlist */

.playlist-wrap {
  max-width: 640px;
  margin: 0 auto;
}

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

.playlist-track {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.playlist-track:hover {
  background: var(--surface);
  border-color: var(--border);
}

.playlist-track.active {
  background: oklch(from var(--accent) l c h / 0.08);
  border-color: oklch(from var(--accent) l c h / 0.2);
}

.playlist-track.active .playlist-track-title {
  color: var(--accent);
}

.playlist-track-num {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--fg-dim);
  min-width: 24px;
}

.playlist-track-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.playlist-track-title {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.2s ease;
}

.playlist-track-meta {
  font-size: 0.75rem;
  color: var(--fg-dim);
}

.playlist-track-duration {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--fg-dim);
}

/* ============================================
   Gallery Grid
   ============================================ */

.gallery-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: flex-start;
}

.gallery-item {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  border: 1px solid var(--border);
  transition: all 0.35s ease;
  background: var(--surface);
  contain: layout paint;
  flex: 0 0 auto;
  width: auto;
  margin: 0;
}

.gallery-item:hover {
  transform: translateY(-4px) scale(1.01);
  border-color: oklch(from var(--accent) l c h / 0.3);
  box-shadow: var(--shadow-glow);
}

.gallery-item:hover .gallery-item-caption {
  opacity: 1;
  transform: translateY(0);
}

.gallery-item-placeholder {
  width: 100%;
  height: var(--gallery-item-height, 260px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-item-image {
  background: var(--surface-2);
}

.gallery-item-image img,
.lightbox-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gallery-load-more {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  margin-top: 28px;
  color: var(--fg-muted);
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.gallery-loading {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.gallery-skeleton,
.timeline-skeleton {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: linear-gradient(110deg, var(--surface), var(--surface-2), var(--surface));
}

.gallery-skeleton::after,
.timeline-skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, oklch(100% 0 0 / 0.08), transparent);
  animation: skeleton-shimmer 1.4s ease-in-out infinite;
}

.gallery-skeleton { height: 220px; }
.gallery-skeleton.wide { grid-column: span 2; }
.gallery-skeleton.tall { height: 320px; }

.timeline-skeleton {
  height: 76px;
  margin-bottom: 14px;
}

.timeline-skeleton.short {
  width: 72%;
}

@keyframes skeleton-shimmer {
  100% { transform: translateX(100%); }
}

.gallery-item-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 20px 16px 16px;
  background: linear-gradient(transparent, oklch(10% 0.02 270 / 0.85));
  display: flex;
  flex-direction: column;
  gap: 4px;
  opacity: 0;
  transform: translateY(8px);
  transition: all 0.3s ease;
}

.gallery-item-title {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 500;
  color: white;
}

.gallery-item-date {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: oklch(85% 0.01 270);
}

[data-theme="light"] .gallery-item-caption {
  background: linear-gradient(transparent, oklch(20% 0.02 270 / 0.8));
}

@media (max-width: 1024px) {
  .gallery-grid {
    gap: 14px;
  }
}

@media (max-width: 768px) {
  .article-item-with-cover {
    grid-template-columns: 1fr;
  }

  .article-item-cover {
    max-width: none;
  }

  .gallery-grid {
    gap: 12px;
  }
  .gallery-item {
    margin: 0;
  }
}

@media (max-width: 480px) {
  .gallery-grid {
    gap: 10px;
  }
}

/* ============================================
   Lightbox
   ============================================ */

.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: oklch(5% 0.02 270 / 0.95);
  backdrop-filter: blur(20px);
  align-items: center;
  justify-content: center;
  padding: 28px 88px;
}

.lightbox.open {
  display: flex;
}

.lightbox-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  max-width: min(1500px, 100%);
  max-height: calc(100vh - 56px);
  width: 100%;
}

.lightbox-image {
  width: fit-content;
  max-width: 100%;
  height: auto;
  max-height: min(70vh, 780px);
  border-radius: var(--radius-lg);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--fg-dim);
  font-family: var(--font-display);
  font-size: 1rem;
  border: none;
  overflow: hidden;
}

.lightbox-image img {
  width: auto;
  height: auto;
  max-width: min(100vw - 176px, 1500px);
  max-height: min(70vh, 780px);
  object-fit: contain;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
}

.lightbox-caption {
  margin-top: 16px;
  text-align: center;
  color: var(--fg-muted);
  font-size: 0.95rem;
  max-width: min(760px, 100%);
  flex-shrink: 0;
}

.lightbox-original-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 14px;
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid oklch(from var(--accent) l c h / 0.35);
  background: oklch(from var(--accent) l c h / 0.12);
  color: var(--accent);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
}

.lightbox-original-link:hover {
  border-color: var(--accent);
  background: oklch(from var(--accent) l c h / 0.18);
}

.lightbox-close {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--fg);
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 10;
}

.lightbox-close:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--fg);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 10;
}

.lightbox-nav:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.lightbox-prev { left: 24px; }
.lightbox-next { right: 24px; }

@media (max-width: 768px) {
  .lightbox {
    padding: 64px 14px 22px;
  }
  .lightbox-content {
    max-height: calc(100vh - 86px);
  }
  .lightbox-image {
    max-height: 58vh;
    border-radius: var(--radius);
  }
  .lightbox-image img {
    max-width: calc(100vw - 28px);
    max-height: 58vh;
    border-radius: var(--radius);
  }
  .lightbox-caption {
    margin-top: 12px;
    font-size: 0.88rem;
  }
  .lightbox-nav {
    display: none;
  }
  .lightbox-close {
    top: 12px;
    right: 12px;
  }
}

/* ============================================
   Section variants
   ============================================ */

.section-compact {
  padding: 40px 0;
}

.section-title {
  margin-bottom: 32px;
}

/* ============================================
   Author Strip
   ============================================ */

.author-strip {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 24px 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: all 0.3s ease;
}

.author-strip:hover {
  border-color: oklch(from var(--accent) l c h / 0.3);
}

.about-avatar-sm {
  width: 56px;
  height: 56px;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.author-strip-body {
  flex: 1;
  min-width: 0;
}

.author-strip-body p {
  color: var(--fg-muted);
  font-size: 0.95rem;
  line-height: 1.6;
  margin: 0;
}

.author-strip-body strong {
  color: var(--fg);
  font-weight: 600;
}

.author-strip-links {
  display: flex;
  gap: 16px;
  margin-top: 10px;
}

.author-strip-links a {
  font-size: 0.85rem;
  font-weight: 500;
}

@media (max-width: 640px) {
  .author-strip {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
}

/* ============================================
   Bento Grid
   ============================================ */

.bento-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(2, 180px);
  gap: 16px;
}

.bento-card {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  text-decoration: none;
  border: 1px solid var(--border);
  transition: all 0.35s ease;
  display: flex;
  flex-direction: column;
}

.bento-card:hover {
  transform: translateY(-3px);
  border-color: oklch(from var(--accent) l c h / 0.3);
  box-shadow: var(--shadow-glow);
}

.bento-card:hover .bento-card-arrow {
  transform: translateX(4px);
}

.bento-card-lg {
  grid-column: span 2;
  grid-row: span 2;
}

.bento-card-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  transition: transform 0.5s ease;
}

.bento-card:hover .bento-card-bg {
  transform: scale(1.05);
}

.bento-card-content {
  position: relative;
  z-index: 1;
  padding: 24px;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.bento-card-tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: oklch(85% 0.01 270);
  background: oklch(10% 0.02 270 / 0.4);
  padding: 4px 10px;
  border-radius: 100px;
  align-self: flex-start;
  margin-bottom: 16px;
}

.bento-card h3 {
  font-size: 1.5rem;
  color: white;
  margin-bottom: 8px;
}

.bento-card p {
  font-size: 0.9rem;
  color: oklch(85% 0.01 270);
  line-height: 1.5;
  flex: 1;
}

.bento-card-arrow {
  font-size: 1.25rem;
  color: white;
  transition: transform 0.3s ease;
  align-self: flex-end;
  margin-top: auto;
}

[data-theme="light"] .bento-card-tag {
  color: oklch(30% 0.01 270);
  background: oklch(95% 0.01 270 / 0.7);
}

[data-theme="light"] .bento-card h3 {
  color: white;
}

[data-theme="light"] .bento-card p {
  color: oklch(90% 0.01 270);
}

@media (max-width: 1024px) {
  .bento-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(3, 160px);
  }
  .bento-card-lg {
    grid-column: span 2;
    grid-row: span 2;
  }
}

@media (max-width: 640px) {
  .bento-grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }
  .bento-card,
  .bento-card-lg {
    grid-column: span 1;
    grid-row: span 1;
    min-height: 160px;
  }
}

/* ============================================
   Featured Article Card
   ============================================ */

.featured-card {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  text-decoration: none;
  transition: all 0.35s ease;
}

.featured-card:hover {
  border-color: oklch(from var(--accent) l c h / 0.3);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

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

.featured-card-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  background: var(--surface-2);
  border-right: 1px solid var(--border);
}

.featured-card-visual-inner {
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 32px oklch(10% 0.02 270 / 0.3);
  overflow: hidden;
}

.featured-card-visual-inner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.featured-card-body {
  padding: 32px;
  display: flex;
  flex-direction: column;
}

.featured-card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.featured-card-body h3 {
  font-size: 1.5rem;
  margin-bottom: 12px;
  color: var(--fg);
  transition: color 0.2s ease;
}

.featured-card:hover .featured-card-body h3 {
  color: var(--accent);
}

.featured-card-body p {
  color: var(--fg-muted);
  line-height: 1.65;
  flex: 1;
  margin-bottom: 16px;
}

.featured-card-link {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--fg-muted);
  transition: color 0.2s ease;
}

@media (max-width: 768px) {
  .featured-card {
    grid-template-columns: 1fr;
  }
  .featured-card-visual {
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 24px;
  }
  .featured-card-visual-inner {
    max-width: 120px;
    max-height: 120px;
    margin: 0 auto;
  }
  .featured-card-body {
    padding: 24px;
  }
}

/* ============================================
   Article list extras
   ============================================ */

.article-list-more {
  text-align: center;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

/* ============================================
   Stats Strip
   ============================================ */

.stats-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 48px;
  padding: 40px 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--fg-dim);
}

.stat-divider {
  width: 1px;
  height: 40px;
  background: var(--border);
}

@media (max-width: 640px) {
  .stats-strip {
    flex-wrap: wrap;
    gap: 24px;
    padding: 28px 20px;
  }
  .stat-divider {
    display: none;
  }
  .stat-item {
    flex: 1;
    min-width: 80px;
  }
}

/* ============================================
   CTA / Newsletter Card
   ============================================ */

.cta-card {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 32px;
  padding: 48px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
}

.cta-card-content {
  position: relative;
  z-index: 1;
}

.cta-card-content h3 {
  font-size: 1.5rem;
  margin-bottom: 10px;
}

.cta-card-content p {
  color: var(--fg-muted);
  margin-bottom: 24px;
  max-width: 480px;
  line-height: 1.6;
}

.cta-form {
  display: flex;
  gap: 12px;
  max-width: 420px;
}

.cta-input {
  flex: 1;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s ease;
}

.cta-input:focus {
  border-color: var(--accent);
}

.cta-input::placeholder {
  color: var(--fg-dim);
}

.cta-card-decoration {
  position: relative;
  z-index: 0;
  opacity: 0.6;
}

@media (max-width: 768px) {
  .cta-card {
    grid-template-columns: 1fr;
    padding: 32px 24px;
    text-align: center;
  }
  .cta-form {
    flex-direction: column;
    max-width: 100%;
  }
  .cta-card-decoration {
    display: none;
  }
}

/* ============================================
   Home Hero enhancement
   ============================================ */

.hero-home {
  padding: 116px 0 100px;
}

.hero-line {
  display: block;
}

.hero-subtitle {
  font-size: 1.125rem;
  max-width: 560px;
  margin: 0 auto 32px;
}

/* ============================================
   Radio dot animation
   ============================================ */

#radioDot {
  animation: pulse-dot 2s ease-in-out infinite;
}

#radioDot.playing {
  background: var(--success);
  animation: none;
}

/* ============================================
   Search / Projects
   ============================================ */

.search-panel {
  position: fixed;
  top: calc(var(--nav-height, 72px) + 14px);
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 0 16px;
  pointer-events: none;
}

.search-panel > .container {
  max-width: 980px;
  padding: 18px;
  border: 1px solid color-mix(in oklch, var(--accent) 45%, var(--border));
  border-radius: var(--radius-lg);
  background: color-mix(in oklch, var(--bg) 94%, transparent);
  box-shadow: 0 22px 80px color-mix(in oklch, black 58%, transparent), var(--shadow-glow);
  backdrop-filter: blur(22px);
  pointer-events: auto;
  max-height: calc(100vh - var(--nav-height, 72px) - 32px);
  overflow: auto;
}

.search-panel[hidden] {
  display: none !important;
}

.search-shell {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
}

.search-shell input {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--fg);
  outline: none;
  font: inherit;
  caret-color: var(--accent);
}

.search-shell input:focus {
  border-color: color-mix(in oklch, var(--accent) 70%, var(--border));
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--accent) 16%, transparent);
}

.search-results {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  max-height: min(48vh, 460px);
  overflow: auto;
}

.search-meta {
  margin: 10px 0 0;
  color: var(--fg-dim);
  font-size: 0.78rem;
}

.search-tabs {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.search-tab {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--fg-muted);
  border-radius: 999px;
  padding: 7px 12px;
  cursor: pointer;
}

.search-tab.active {
  color: var(--fg);
  border-color: color-mix(in oklch, var(--accent) 70%, var(--border));
  background: color-mix(in oklch, var(--accent) 14%, var(--surface));
}

.search-result-item {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  text-decoration: none;
}

.search-result-item span,
.search-result-item small,
.search-empty {
  color: var(--fg-muted);
  font-size: 0.82rem;
}

.search-result-item mark {
  background: color-mix(in oklch, var(--accent-2) 30%, transparent);
  color: var(--fg);
  border-radius: 3px;
  padding: 0 2px;
}

.search-type.project {
  color: var(--accent-2);
}

.search-type.post {
  color: var(--accent);
}

.search-result-item strong {
  color: var(--fg);
}

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

.project-card {
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
}

.project-cover {
  margin: -22px -22px 18px;
  aspect-ratio: 16 / 9;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}

.project-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.project-card-head,
.project-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

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

.project-card p {
  color: var(--fg-muted);
  line-height: 1.65;
}

.project-status {
  color: var(--fg-dim);
  font-size: 0.78rem;
}

.project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 18px 0;
}

.project-tech span {
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--fg-muted);
  font-size: 0.75rem;
}

.project-detail-page .container {
  max-width: 1120px;
}

.project-detail-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 28px;
  align-items: start;
  margin-bottom: 28px;
}

.project-detail-copy,
.project-detail-panel,
.project-detail-section,
.project-detail-cover {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: color-mix(in oklch, var(--surface) 88%, transparent);
}

.project-detail-copy {
  padding: clamp(24px, 4vw, 42px);
}

.project-back-link {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  margin-bottom: 18px;
  color: var(--fg-dim);
  text-decoration: none;
  font-size: .9rem;
}

.project-back-link:hover {
  color: var(--fg);
}

.project-detail-copy h1 {
  margin: 16px 0 12px;
  font-size: clamp(2rem, 5vw, 4rem);
}

.project-detail-copy > p {
  max-width: 720px;
  color: var(--fg-muted);
  font-size: 1.08rem;
  line-height: 1.75;
}

.project-detail-panel {
  position: sticky;
  top: calc(var(--nav-height, 72px) + 22px);
  padding: 20px;
}

.project-detail-meta {
  display: grid;
  gap: 14px;
}

.project-detail-meta div,
.project-outcome {
  display: grid;
  gap: 5px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.project-detail-meta span,
.project-outcome span {
  color: var(--fg-dim);
  font-size: .78rem;
}

.project-detail-meta strong,
.project-outcome strong {
  color: var(--fg);
  font-size: .96rem;
}

.project-outcome {
  margin-top: 14px;
}

.project-detail-actions {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.project-detail-actions .btn {
  justify-content: center;
  min-height: 44px;
}

.project-detail-cover {
  overflow: hidden;
  margin: 0 0 28px;
  aspect-ratio: 16 / 8;
  background: var(--surface-2);
}

.project-detail-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.project-detail-section {
  padding: clamp(22px, 4vw, 34px);
  margin-top: 18px;
}

.project-detail-section h2 {
  margin: 0 0 18px;
  font-size: clamp(1.35rem, 3vw, 1.9rem);
}

.project-detail-text {
  display: grid;
  gap: 14px;
  color: var(--fg-muted);
  line-height: 1.85;
  max-width: 820px;
}

.project-highlight-grid,
.project-metric-grid,
.project-related-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.project-highlight-grid article,
.project-metric-grid div,
.project-related-list a {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  padding: 16px;
}

.project-highlight-grid p {
  color: var(--fg-muted);
  line-height: 1.7;
}

.project-screenshot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.project-screenshot-grid figure {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-2);
}

.project-screenshot-grid img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  display: block;
}

.project-screenshot-grid figcaption {
  padding: 12px 14px;
  color: var(--fg-muted);
  font-size: .88rem;
}

.project-timeline {
  list-style: none;
  display: grid;
  gap: 16px;
  margin: 0;
  padding: 0;
}

.project-timeline li {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.project-timeline time {
  color: var(--fg-dim);
  font-size: .86rem;
}

.project-timeline strong {
  color: var(--fg);
}

.project-timeline p,
.project-related-list p {
  margin-top: 6px;
  color: var(--fg-muted);
  line-height: 1.65;
}

.project-related-list a {
  color: inherit;
  text-decoration: none;
  transition: border-color .2s ease, transform .2s ease;
}

.project-related-list a:hover {
  transform: translateY(-2px);
  border-color: color-mix(in oklch, var(--accent) 55%, var(--border));
}

.project-related-list span {
  display: block;
  margin-bottom: 6px;
  color: var(--fg-dim);
  font-size: .75rem;
}

.home-project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.home-project-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 230px;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: color-mix(in oklch, var(--surface) 88%, transparent);
  text-decoration: none;
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}

.home-project-card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in oklch, var(--accent) 55%, var(--border));
  box-shadow: var(--shadow-glow);
}

.home-project-card h3 {
  margin: 14px 0 8px;
  color: var(--fg);
  font-size: 1.12rem;
}

.home-project-card p {
  color: var(--fg-muted);
  line-height: 1.65;
}

@media (max-width: 768px) {
  .search-panel {
    top: calc(var(--nav-height, 64px) + 10px);
    padding: 0 12px;
  }

  .search-panel > .container {
    padding: 14px;
  }

  .search-shell,
  .project-grid,
  .home-project-grid {
    grid-template-columns: 1fr;
  }

  .project-detail-hero {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .project-detail-copy,
  .project-detail-panel,
  .project-detail-section {
    border-radius: var(--radius-md);
  }

  .project-detail-panel {
    position: static;
  }

  .project-detail-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .project-detail-cover {
    aspect-ratio: 4 / 3;
    border-radius: var(--radius-md);
  }

  .project-screenshot-grid {
    grid-template-columns: 1fr;
  }

  .project-timeline li {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

@media (max-width: 480px) {
  .project-detail-meta,
  .project-highlight-grid,
  .project-metric-grid,
  .project-related-list {
    grid-template-columns: 1fr;
  }

  .project-detail-actions {
    grid-template-columns: 1fr;
  }

  .project-detail-copy,
  .project-detail-panel,
  .project-detail-section {
    padding: 18px;
  }
}
