/* ================================================================
   Genesist Labs — Ghost Theme Stylesheet
   ================================================================ */

/* ── 1. Reset & Base ── */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--background);
  color: var(--foreground);
  font-family: 'Work Sans', system-ui, -apple-system, sans-serif;
  font-weight: 400;
  font-feature-settings: 'liga' 1, 'calt' 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

button, input, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  background: none;
  border: none;
  outline: none;
}

::selection {
  background: rgba(139, 108, 239, 0.35);
  color: #ffffff;
}

/* ── 2. Design Tokens ── */

:root {
  /* Backgrounds — elevation = lighter */
  --background: #09090b;
  --surface: #0f0f11;
  --card: #141416;
  --elevated: #1a1a1e;

  /* Text hierarchy — never pure white */
  --foreground: #e8e6e3;
  --text-secondary: #a1a1aa;
  --text-tertiary: #71717a;
  --text-muted: #52525b;
  --text-ghost: #3f3f46;

  /* Accent system */
  --accent: #8b6cef;
  --accent-hover: #9d82f2;
  --accent-glow-strong: rgba(139, 108, 239, 0.20);
  --accent-glow-medium: rgba(139, 108, 239, 0.10);
  --accent-glow-subtle: rgba(139, 108, 239, 0.05);
  --accent-surface: rgba(139, 108, 239, 0.06);
  --accent-border: rgba(139, 108, 239, 0.15);

  /* Borders */
  --border-subtle: rgba(255, 255, 255, 0.04);
  --border-default: rgba(255, 255, 255, 0.06);
  --border-strong: rgba(255, 255, 255, 0.10);

  /* Motion */
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-snappy: cubic-bezier(0.2, 0, 0, 1);
}

/* ── 3. Typography ── */

h1, h2, h3, h4, h5, h6 {
  font-weight: 300;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--foreground);
}

h1 { font-size: 2.25rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.375rem; }
h4 { font-size: 1.125rem; font-weight: 400; }

p {
  color: var(--text-secondary);
  line-height: 1.75;
}

.label {
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--accent);
}

.meta {
  font-size: 0.625rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-ghost);
}

/* ── 4. Background Layers ── */

.aurora {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  filter: blur(100px) saturate(140%);
}

.aurora-orb {
  position: absolute;
  border-radius: 50%;
}

.aurora-orb-1 {
  width: 50vw;
  height: 50vh;
  background: rgba(139, 108, 239, 0.14);
  top: -20%;
  left: 25%;
  animation: aurora1 16s var(--ease-smooth) infinite;
}

.aurora-orb-2 {
  width: 40vw;
  height: 40vh;
  background: rgba(100, 80, 220, 0.10);
  top: 5%;
  right: -10%;
  animation: aurora2 22s var(--ease-smooth) infinite;
}

.aurora-orb-3 {
  width: 35vw;
  height: 35vh;
  background: rgba(120, 90, 200, 0.07);
  bottom: -10%;
  left: -5%;
  animation: aurora3 19s var(--ease-smooth) infinite;
}

@keyframes aurora1 {
  0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.6; }
  33% { transform: translate(4vw, 3vh) scale(1.1); opacity: 1; }
  66% { transform: translate(-2vw, 5vh) scale(0.95); opacity: 0.7; }
}

@keyframes aurora2 {
  0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.5; }
  50% { transform: translate(-5vw, -3vh) scale(1.15); opacity: 0.9; }
}

@keyframes aurora3 {
  0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.4; }
  50% { transform: translate(5vw, -4vh) scale(1.1); opacity: 0.8; }
}

.bg-grain {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.7' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 200px 200px;
}

.bg-vignette {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(
    ellipse at center,
    transparent 40%,
    rgba(9, 9, 11, 0.5) 100%
  );
}

/* ── 5. Layout ── */

.page-content {
  position: relative;
  z-index: 2;
  animation: pageIn 0.7s var(--ease-out-expo) forwards;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.container--narrow {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.grid {
  display: grid;
  gap: 1.5rem;
}

.grid--2col {
  grid-template-columns: 1fr;
}

/* ── 6. Components ── */

/* --- Site Header --- */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  padding: 2rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-header::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, var(--background), transparent);
  pointer-events: none;
  z-index: -1;
}

.site-logo {
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--foreground);
  transition: color 0.3s var(--ease-snappy);
}

.site-logo:hover {
  color: var(--accent);
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.header-nav a {
  font-size: 0.625rem;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-ghost);
  transition: color 0.3s var(--ease-snappy);
  position: relative;
}

.header-nav a::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width 0.4s var(--ease-out-expo);
}

.header-nav a:hover {
  color: var(--accent);
}

.header-nav a:hover::after {
  width: 100%;
}

/* --- Site Footer --- */

.site-footer {
  padding: 4rem 1.5rem 3rem;
  text-align: center;
}

.footer-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2.5rem;
  flex-wrap: wrap;
}

.footer-nav a {
  font-size: 0.625rem;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-ghost);
  transition: color 0.3s var(--ease-snappy);
  position: relative;
}

.footer-nav a::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width 0.4s var(--ease-out-expo);
}

.footer-nav a:hover {
  color: var(--accent);
}

.footer-nav a:hover::after {
  width: 100%;
}

.footer-copy {
  margin-top: 2rem;
  font-size: 0.625rem;
  letter-spacing: 0.1em;
  color: var(--text-ghost);
}

/* --- Dividers --- */

.divider {
  height: 1px;
  border: none;
  background: linear-gradient(
    to right,
    transparent,
    var(--border-default) 20%,
    var(--border-default) 80%,
    transparent
  );
}

.accent-rule {
  width: 32px;
  height: 1px;
  background: linear-gradient(90deg, var(--accent), transparent);
  opacity: 0.6;
}

.accent-rule--center {
  width: 64px;
  margin-left: auto;
  margin-right: auto;
  background: linear-gradient(90deg, transparent, rgba(139, 108, 239, 0.4), transparent);
}

/* --- Post Cards (Research Paper Style) --- */

.post-card {
  position: relative;
  display: block;
  overflow: hidden;
  background: #0c0c0e;
  border: 1px solid var(--border-subtle);
  transition: all 0.5s var(--ease-smooth);
}

.post-card:hover {
  border-color: var(--accent-border);
  box-shadow: 0 0 60px -15px rgba(139, 108, 239, 0.15);
}

/* Paper texture overlay */
.post-card__texture {
  position: absolute;
  inset: 0;
  opacity: 0.015;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  pointer-events: none;
}

/* Corner fold effect */
.post-card__fold {
  position: absolute;
  top: 0;
  right: 0;
  width: 3rem;
  height: 3rem;
  overflow: hidden;
}

.post-card__fold::before {
  content: "";
  position: absolute;
  top: -1.5rem;
  right: -1.5rem;
  width: 3rem;
  height: 3rem;
  background: linear-gradient(to bottom-left, var(--background), var(--background), transparent);
  transform: rotate(45deg);
}

.post-card__fold::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 1px;
  height: 2rem;
  background: var(--border-subtle);
  transform: rotate(45deg);
  transform-origin: top right;
  translate: 5px 0;
}

.post-card__body {
  position: relative;
  padding: 2rem;
}

.post-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.post-card__issue {
  font-size: 0.625rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-ghost);
  font-weight: 500;
}

.post-card__badge {
  padding: 0.25rem 0.5rem;
  font-size: 0.5625rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.post-card__badge--free {
  background: rgba(139, 108, 239, 0.10);
  color: var(--accent);
  border: 1px solid rgba(139, 108, 239, 0.20);
}

.post-card__badge--members {
  background: var(--surface);
  color: var(--text-ghost);
  border: 1px solid var(--border-subtle);
}

.post-card__title {
  margin-top: 1.5rem;
  font-size: 1.125rem;
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.35;
  color: var(--foreground);
  transition: color 0.3s var(--ease-snappy);
}

.post-card:hover .post-card__title {
  color: var(--accent);
}

.post-card__divider {
  margin-top: 1.25rem;
  width: 3rem;
  height: 1px;
  background: linear-gradient(90deg, rgba(139, 108, 239, 0.4), transparent);
}

.post-card__abstract {
  margin-top: 1.25rem;
}

.post-card__abstract-label {
  font-size: 0.5625rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-ghost);
  margin-bottom: 0.5rem;
}

.post-card__excerpt {
  font-size: 0.875rem;
  line-height: 1.65;
  color: var(--text-tertiary);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card__footer {
  margin-top: 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.post-card__date {
  font-size: 0.625rem;
  letter-spacing: 0.1em;
  color: var(--text-ghost);
}

.post-card__link {
  font-size: 0.625rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-ghost);
  transition: color 0.3s var(--ease-snappy);
}

.post-card:hover .post-card__link {
  color: var(--accent);
}

/* --- Buttons --- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.875rem 2.25rem;
  border: 1px solid var(--border-default);
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.6875rem;
  font-weight: 400;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.3s var(--ease-snappy);
}

.btn:hover {
  border-color: var(--accent-border);
  color: var(--foreground);
  box-shadow: 0 0 30px -10px var(--accent-glow-strong);
}

.btn--accent {
  border-color: rgba(139, 108, 239, 0.3);
  background: rgba(139, 108, 239, 0.05);
  color: var(--accent);
}

.btn--accent:hover {
  border-color: var(--accent);
  background: rgba(139, 108, 239, 0.10);
  box-shadow: 0 0 30px -5px rgba(139, 108, 239, 0.3);
}

/* --- Forms --- */

.form-input {
  width: 100%;
  border: 1px solid var(--border-subtle);
  background: #0c0c0e;
  padding: 0.875rem 1rem;
  font-size: 0.875rem;
  color: var(--foreground);
  transition: border-color 0.3s var(--ease-snappy);
}

.form-input::placeholder {
  color: var(--text-ghost);
}

.form-input:focus {
  border-color: var(--accent);
  outline: none;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* --- Badges --- */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.625rem;
  font-size: 0.5625rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.badge--open {
  background: rgba(139, 108, 239, 0.10);
  color: var(--accent);
  border: 1px solid rgba(139, 108, 239, 0.20);
}

.badge--members {
  background: var(--surface);
  color: var(--text-ghost);
  border: 1px solid var(--border-subtle);
}

.badge--paid {
  background: rgba(139, 108, 239, 0.06);
  color: var(--accent);
  border: 1px solid rgba(139, 108, 239, 0.12);
}

/* --- Pagination --- */

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  padding: 3rem 0;
}

.pagination a {
  font-size: 0.625rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-ghost);
  transition: color 0.3s var(--ease-snappy);
}

.pagination a:hover {
  color: var(--accent);
}

.pagination .page-number {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ── 7. Membership ── */

/* Membership gate (inline content gate) */
.membership-gate {
  position: relative;
  margin: 3rem 0;
  padding: 3rem 2rem;
  text-align: center;
  border: 1px solid var(--border-subtle);
  background: var(--surface);
}

.membership-gate::before {
  content: "";
  position: absolute;
  top: -60px;
  left: 0;
  right: 0;
  height: 60px;
  background: linear-gradient(to top, var(--surface), transparent);
  pointer-events: none;
}

.membership-gate__title {
  font-size: 1.125rem;
  font-weight: 300;
  color: var(--foreground);
  margin-bottom: 0.75rem;
}

.membership-gate__text {
  font-size: 0.875rem;
  color: var(--text-tertiary);
  margin-bottom: 2rem;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

.membership-gate .form-row {
  max-width: 400px;
  margin: 0 auto;
}

/* Membership form states */
.membership-form {
  position: relative;
}

.membership-form .form-feedback {
  display: none;
  margin-top: 1rem;
  font-size: 0.8125rem;
}

.membership-form.loading .form-feedback--loading {
  display: block;
  color: var(--text-tertiary);
}

.membership-form.success .form-feedback--success {
  display: block;
  color: var(--accent);
}

.membership-form.error .form-feedback--error {
  display: block;
  color: #ef4444;
}

.membership-form.loading .btn {
  opacity: 0.5;
  pointer-events: none;
}

/* Subscribe CTA section */
.subscribe-cta {
  margin-top: 5rem;
  text-align: center;
  max-width: 28rem;
  margin-left: auto;
  margin-right: auto;
}

.subscribe-cta__text {
  margin-top: 1rem;
  font-size: 0.875rem;
  color: var(--text-tertiary);
}

.subscribe-cta .form-row {
  margin-top: 2rem;
}

/* --- Members pages (signup, signin, account) --- */

.members-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
}

.members-card {
  width: 100%;
  max-width: 400px;
  padding: 3rem 2rem;
  border: 1px solid var(--border-subtle);
  background: var(--surface);
}

.members-card__title {
  font-size: 1.5rem;
  font-weight: 300;
  text-align: center;
  margin-bottom: 0.5rem;
}

.members-card__subtitle {
  font-size: 0.875rem;
  color: var(--text-tertiary);
  text-align: center;
  margin-bottom: 2rem;
}

.members-card .form-input {
  margin-bottom: 0.75rem;
}

.members-card .btn {
  width: 100%;
  margin-top: 0.5rem;
}

.members-card__footer {
  margin-top: 1.5rem;
  text-align: center;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.members-card__footer a {
  color: var(--accent);
  transition: color 0.3s var(--ease-snappy);
}

.members-card__footer a:hover {
  color: var(--accent-hover);
}

/* Account page */
.account-section {
  margin-bottom: 2rem;
}

.account-label {
  font-size: 0.625rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-ghost);
  margin-bottom: 0.5rem;
}

.account-value {
  font-size: 0.9375rem;
  color: var(--foreground);
}

.account-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 2rem;
}

/* ── 8. Animations ── */

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pageIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.animate-fade-up {
  animation: fadeUp 1s var(--ease-out-expo) forwards;
  opacity: 0;
}

.animate-delay-1 { animation-delay: 0.2s; }
.animate-delay-2 { animation-delay: 0.4s; }
.animate-delay-3 { animation-delay: 0.6s; }
.animate-delay-4 { animation-delay: 0.8s; }

/* Hover underline from left */
.hover-underline {
  position: relative;
  text-decoration: none;
  transition: color 0.3s var(--ease-snappy);
}

.hover-underline::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width 0.4s var(--ease-out-expo);
}

.hover-underline:hover::after {
  width: 100%;
}

/* ── 9. Post Content (Prose) ── */

.post-content {
  font-size: 1.0625rem;
  line-height: 1.8;
  color: var(--text-secondary);
}

.post-content > * + * {
  margin-top: 1.5rem;
}

.post-content h2 {
  margin-top: 3rem;
  margin-bottom: 1rem;
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--foreground);
}

.post-content h3 {
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--foreground);
}

.post-content h4 {
  margin-top: 2rem;
  margin-bottom: 0.5rem;
  font-size: 1.0625rem;
  font-weight: 500;
  color: var(--foreground);
}

.post-content p {
  color: var(--text-secondary);
  line-height: 1.8;
}

.post-content a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: rgba(139, 108, 239, 0.3);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.3s var(--ease-snappy);
}

.post-content a:hover {
  text-decoration-color: var(--accent);
}

.post-content strong {
  color: var(--foreground);
  font-weight: 500;
}

.post-content em {
  font-style: italic;
}

.post-content blockquote {
  padding-left: 1.5rem;
  border-left: 2px solid var(--accent-border);
  color: var(--text-tertiary);
  font-style: italic;
}

.post-content ul,
.post-content ol {
  padding-left: 1.5rem;
  color: var(--text-secondary);
}

.post-content li {
  margin-bottom: 0.5rem;
}

.post-content li::marker {
  color: var(--text-ghost);
}

.post-content pre {
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  overflow-x: auto;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

.post-content code {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.875em;
  padding: 0.15em 0.4em;
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  color: var(--accent);
}

.post-content pre code {
  padding: 0;
  background: none;
  border: none;
  color: inherit;
}

.post-content hr {
  border: none;
  height: 1px;
  background: linear-gradient(
    to right,
    transparent,
    var(--border-default) 20%,
    var(--border-default) 80%,
    transparent
  );
  margin: 3rem 0;
}

.post-content img {
  margin: 2rem 0;
  border: 1px solid var(--border-subtle);
}

.post-content figcaption {
  margin-top: 0.75rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
  text-align: center;
}

.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  font-size: 0.9375rem;
}

.post-content th,
.post-content td {
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-subtle);
  text-align: left;
}

.post-content th {
  background: var(--surface);
  color: var(--foreground);
  font-weight: 500;
  font-size: 0.8125rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.post-content td {
  color: var(--text-secondary);
}

/* ── 10. Responsive ── */

@media (min-width: 640px) {
  .grid--2col {
    grid-template-columns: repeat(2, 1fr);
  }

  .form-row {
    flex-direction: row;
  }

  h1 { font-size: 2.5rem; }
}

@media (min-width: 1024px) {
  .site-header {
    padding: 2.5rem 3rem;
  }

  .container {
    padding: 0 3rem;
  }
}

@media (max-width: 639px) {
  .post-card__body {
    padding: 1.5rem;
  }

  .header-nav {
    display: none;
  }

  .members-card {
    padding: 2rem 1.5rem;
  }
}

/* ── 11. Ghost Content Cards ── */

/* Image cards */
.kg-image-card,
.kg-gallery-card {
  margin: 2rem 0;
}

.kg-image-card img {
  border: 1px solid var(--border-subtle);
}

.kg-image-card.kg-width-wide img {
  max-width: calc(100% + 4rem);
  margin-left: -2rem;
  margin-right: -2rem;
  width: calc(100% + 4rem);
}

.kg-image-card.kg-width-full img {
  max-width: 100vw;
  margin-left: calc(-50vw + 50%);
  width: 100vw;
}

.kg-image-card figcaption {
  margin-top: 0.75rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
  text-align: center;
}

/* Bookmark cards */
.kg-bookmark-card {
  margin: 2rem 0;
}

.kg-bookmark-container {
  display: flex;
  border: 1px solid var(--border-subtle);
  background: var(--surface);
  transition: border-color 0.3s var(--ease-snappy);
  text-decoration: none;
}

.kg-bookmark-container:hover {
  border-color: var(--accent-border);
}

.kg-bookmark-content {
  flex: 1;
  padding: 1.25rem;
}

.kg-bookmark-title {
  font-size: 0.9375rem;
  font-weight: 400;
  color: var(--foreground);
  line-height: 1.4;
}

.kg-bookmark-description {
  margin-top: 0.5rem;
  font-size: 0.8125rem;
  color: var(--text-tertiary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.kg-bookmark-metadata {
  margin-top: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.kg-bookmark-icon {
  width: 16px;
  height: 16px;
}

.kg-bookmark-thumbnail {
  flex-shrink: 0;
  width: 160px;
}

.kg-bookmark-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: none;
}

/* Callout cards */
.kg-callout-card {
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--border-subtle);
  background: var(--surface);
  display: flex;
  gap: 0.75rem;
  margin: 2rem 0;
}

.kg-callout-emoji {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.kg-callout-text {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Toggle cards */
.kg-toggle-card {
  border: 1px solid var(--border-subtle);
  margin: 2rem 0;
}

.kg-toggle-heading {
  padding: 1rem 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--foreground);
  font-weight: 400;
}

.kg-toggle-content {
  padding: 0 1.5rem 1rem;
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Video & audio */
.kg-video-card,
.kg-audio-card {
  margin: 2rem 0;
}

/* Gallery cards */
.kg-gallery-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 2rem 0;
}

.kg-gallery-row {
  display: flex;
  gap: 0.5rem;
}

.kg-gallery-image {
  flex: 1;
}

.kg-gallery-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 1px solid var(--border-subtle);
}

/* Bookmark author & publisher */
.kg-bookmark-author {
  font-weight: 500;
  color: var(--text-secondary);
}

.kg-bookmark-publisher {
  color: var(--text-muted);
}

.kg-bookmark-author::after {
  content: " \2022 ";
  color: var(--text-ghost);
}

/* Button card */
.kg-button-card {
  margin: 2rem 0;
  text-align: center;
}

.kg-button-card a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.875rem 2.25rem;
  border: 1px solid var(--accent-border);
  background: rgba(139, 108, 239, 0.05);
  color: var(--accent);
  font-size: 0.6875rem;
  font-weight: 400;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  transition: all 0.3s var(--ease-snappy);
}

.kg-button-card a:hover {
  border-color: var(--accent);
  background: rgba(139, 108, 239, 0.10);
  box-shadow: 0 0 30px -5px rgba(139, 108, 239, 0.3);
}

/* ── 12. Scrollbar ── */

::-webkit-scrollbar { width: 2px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.06); border-radius: 1px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.12); }

/* ── 13. Focus ── */

*:focus-visible {
  outline: none;
  box-shadow: 0 0 0 1px var(--accent),
              0 0 0 4px rgba(139, 108, 239, 0.15);
}
