:root {
  --shell-width: 1180px;
  --font-ui: "Avenir Next", "Segoe UI", sans-serif;
  --font-copy: Georgia, "Times New Roman", serif;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light;
}

body {
  margin: 0;
  font-family: var(--font-ui);
  line-height: 1.5;
  background: var(--bg);
  color: var(--fg);
}

body.lightbox-open {
  overflow: hidden;
}

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

img {
  display: block;
  width: 100%;
  height: auto;
}

.shell {
  width: min(100% - 2rem, var(--shell-width));
  margin: 0 auto;
}

.theme-paper {
  --bg: #f7f3ec;
  --fg: #1f1a16;
  --muted: #6c6258;
  --line: rgba(31, 26, 22, 0.12);
  --panel: rgba(255, 255, 255, 0.72);
  --panel-strong: #fffdf9;
  --accent: #8a5a36;
  --accent-contrast: #fff7f1;
}

.theme-ember {
  --bg: #1b120f;
  --fg: #f9f2ec;
  --muted: #c9b1a4;
  --line: rgba(249, 242, 236, 0.16);
  --panel: rgba(255, 255, 255, 0.06);
  --panel-strong: rgba(255, 255, 255, 0.1);
  --accent: #ff8a3d;
  --accent-contrast: #1b120f;
}

.theme-charcoal {
  --bg: #121417;
  --fg: #f4f5f7;
  --muted: #a9b2bd;
  --line: rgba(244, 245, 247, 0.12);
  --panel: rgba(255, 255, 255, 0.05);
  --panel-strong: rgba(255, 255, 255, 0.08);
  --accent: #b9d4ff;
  --accent-contrast: #0f1626;
}

.theme-crimson {
  --bg: #190d11;
  --fg: #fff3f5;
  --muted: #d9aab4;
  --line: rgba(255, 243, 245, 0.14);
  --panel: rgba(255, 255, 255, 0.05);
  --panel-strong: rgba(255, 255, 255, 0.08);
  --accent: #ff5d6c;
  --accent-contrast: #23090f;
}

.theme-amber {
  --bg: #17120a;
  --fg: #fff9f0;
  --muted: #d6c6ab;
  --line: rgba(255, 249, 240, 0.12);
  --panel: rgba(255, 255, 255, 0.05);
  --panel-strong: rgba(255, 255, 255, 0.08);
  --accent: #ffb347;
  --accent-contrast: #241602;
}

.theme-ocean {
  --bg: #0c1720;
  --fg: #f0f8ff;
  --muted: #a7c5d8;
  --line: rgba(240, 248, 255, 0.14);
  --panel: rgba(255, 255, 255, 0.05);
  --panel-strong: rgba(255, 255, 255, 0.08);
  --accent: #4cb7ff;
  --accent-contrast: #071d30;
}

.theme-neon {
  --bg: #0f1114;
  --fg: #f7fff8;
  --muted: #98c6aa;
  --line: rgba(247, 255, 248, 0.14);
  --panel: rgba(255, 255, 255, 0.04);
  --panel-strong: rgba(255, 255, 255, 0.07);
  --accent: #39ff88;
  --accent-contrast: #07130d;
}

.theme-dracula {
  --bg: #1a1823;
  --fg: #f7f2ff;
  --muted: #c6b2ef;
  --line: rgba(247, 242, 255, 0.12);
  --panel: rgba(255, 255, 255, 0.05);
  --panel-strong: rgba(255, 255, 255, 0.08);
  --accent: #bd93f9;
  --accent-contrast: #23142f;
}

.theme-cyber {
  --bg: #0c1018;
  --fg: #f8fbff;
  --muted: #a5bfce;
  --line: rgba(248, 251, 255, 0.12);
  --panel: rgba(255, 255, 255, 0.05);
  --panel-strong: rgba(255, 255, 255, 0.08);
  --accent: #00e5ff;
  --accent-contrast: #032027;
}

.theme-solar {
  --bg: #10222a;
  --fg: #f5f0d7;
  --muted: #d6d0b3;
  --line: rgba(245, 240, 215, 0.12);
  --panel: rgba(255, 255, 255, 0.05);
  --panel-strong: rgba(255, 255, 255, 0.08);
  --accent: #b58900;
  --accent-contrast: #1a2930;
}

.site-header {
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(120deg, color-mix(in srgb, var(--accent) 14%, transparent), transparent 35%),
    var(--panel);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 30;
}

.header-shell {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
}

.brand-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.brand {
  font-size: clamp(1.2rem, 1rem + 1vw, 1.9rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.domain-pill,
.tag-pill,
.page-link,
.button-link {
  border-radius: 999px;
  border: 1px solid var(--line);
}

.domain-pill {
  padding: 0.28rem 0.7rem;
  font-size: 0.78rem;
  color: var(--muted);
}

.main-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.main-nav a {
  color: var(--muted);
  font-size: 0.95rem;
}

.main-nav a:hover,
.sidebar-list a:hover,
.post-card h3:hover,
.featured-card h3:hover {
  color: var(--accent);
}

.hero {
  padding: 2.5rem 0 1rem;
}

.hero-shell {
  display: grid;
  grid-template-columns: 1.3fr 0.9fr;
  gap: 1.5rem;
  align-items: stretch;
}

.hero-copy,
.hero-card,
.featured-card,
.post-card,
.sidebar-block,
.comment-card,
.error-card {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.08);
}

.hero-copy {
  padding: clamp(1.5rem, 4vw, 3.5rem);
  border-radius: 28px;
  background:
    radial-gradient(circle at top left, color-mix(in srgb, var(--accent) 26%, transparent), transparent 35%),
    var(--panel-strong);
}

.hero-copy h1,
.post-header h1,
.section-head h1 {
  margin: 0;
  font-family: var(--font-copy);
  font-size: clamp(2rem, 3vw, 4.4rem);
  line-height: 0.98;
}

.hero-text,
.post-content,
.post-card-copy p,
.featured-card-copy p,
.sidebar-block p,
.error-card p {
  color: var(--muted);
}

.eyebrow {
  margin: 0 0 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.78rem;
  color: var(--accent);
}

.hero-card {
  border-radius: 28px;
  overflow: hidden;
}

.hero-card img,
.featured-card img,
.post-card img {
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.hero-card-copy,
.featured-card-copy,
.post-card-copy {
  padding: 1rem 1.1rem 1.2rem;
}

.hero-card-copy strong,
.featured-card-copy h3,
.post-card-copy h3 {
  display: block;
  margin-top: 0.35rem;
  font-family: var(--font-copy);
  font-size: 1.25rem;
}

.featured-strip {
  padding: 1rem 0 0.5rem;
}

.featured-grid,
.post-list {
  display: grid;
  gap: 1rem;
}

.featured-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.layout-main,
.layout-post {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 1.4rem;
  padding: 1.25rem 0 2.5rem;
}

.content-column,
.post-article {
  min-width: 0;
}

.section-head {
  margin-bottom: 1rem;
}

.section-head h2,
.section-head h1,
.comments h2,
.sidebar-block h3 {
  font-family: var(--font-copy);
}

.cards-v1 .post-card-link,
.cards-v2 .post-card-link,
.cards-v3 .post-card-link,
.cards-v4 .post-card-link,
.cards-v5 .post-card-link {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: 100%;
}

.cards-v2 .post-card {
  border-radius: 24px;
}

.cards-v2 .post-card-link {
  grid-template-columns: 1fr;
}

.cards-v3 .post-card-link {
  grid-template-columns: 180px 1fr;
}

.cards-v4 .post-card-link {
  grid-template-columns: 1fr;
}

.cards-v5 .post-card-link {
  grid-template-columns: 240px 1fr;
}

.cards-v2 .post-card img,
.cards-v4 .post-card img {
  aspect-ratio: 16 / 9;
}

.post-card {
  overflow: hidden;
  border-radius: 20px;
}

.post-meta,
.post-meta-line,
.featured-card-copy span,
.hero-card-copy span,
.recent-list span,
.comment-card header span {
  color: var(--muted);
  font-size: 0.84rem;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.38rem 0.78rem;
  font-size: 0.82rem;
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}

.tag-pill.subdued {
  background: color-mix(in srgb, var(--fg) 6%, transparent);
}

.sidebar {
  position: sticky;
  top: 6.5rem;
  display: grid;
  gap: 1rem;
}

.sidebar-block,
.comment-card,
.error-card {
  border-radius: 20px;
  padding: 1rem;
}

.sidebar-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.75rem;
}

.recent-list li {
  display: grid;
  gap: 0.12rem;
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.post-header {
  margin-bottom: 1.2rem;
}

.post-meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 0.75rem;
}

.gallery {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 1.2rem;
}

.gallery-v1 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.gallery-v2 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.gallery-item {
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--panel);
}

.gallery-trigger {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: zoom-in;
  position: relative;
}

.gallery-item img {
  aspect-ratio: 3 / 4;
  object-fit: cover;
}

.gallery-zoom-hint {
  position: absolute;
  right: 0.8rem;
  bottom: 0.8rem;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  background: rgba(10, 10, 10, 0.72);
  color: #fff;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 60;
}

.lightbox[hidden] {
  display: none;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 10, 14, 0.84);
  backdrop-filter: blur(8px);
}

.lightbox-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(100% - 1.5rem, 1400px);
  height: min(100% - 1.5rem, 96vh);
  margin: 0.75rem auto;
  border-radius: 28px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.08), transparent 38%),
    rgba(8, 12, 16, 0.84);
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.42);
}

.lightbox-topbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.1rem;
  color: #f6f7fb;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.lightbox-headline {
  display: grid;
  gap: 0.2rem;
  min-width: 0;
}

.lightbox-kicker {
  font-size: 0.74rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.66);
}

.lightbox-title {
  font-family: var(--font-copy);
  font-size: clamp(1.2rem, 1rem + 1vw, 1.9rem);
  line-height: 1.05;
}

.lightbox-counter {
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.82);
}

.lightbox-zoom-readout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 3.6rem;
  min-height: 40px;
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 0.9rem;
}

.lightbox-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
}

.lightbox-button,
.lightbox-nav,
.lightbox-share-link,
.lightbox-thumb {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
  cursor: pointer;
}

.lightbox-button {
  min-height: 40px;
  min-width: 40px;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  font: inherit;
}

.lightbox-body {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  min-height: 0;
}

.lightbox-rail {
  min-height: 0;
  padding: 1rem 0.9rem 1rem 1rem;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  overflow: auto;
}

.lightbox-rail-title {
  margin-bottom: 0.8rem;
  font-size: 0.76rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.62);
}

.lightbox-thumbs {
  display: grid;
  gap: 0.7rem;
}

.lightbox-thumb {
  padding: 0;
  overflow: hidden;
  border-radius: 18px;
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}

.lightbox-thumb img {
  aspect-ratio: 3 / 4;
  object-fit: cover;
}

.lightbox-thumb.is-active {
  border-color: color-mix(in srgb, var(--accent) 72%, white);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 36%, transparent);
  transform: translateX(2px);
}

.lightbox-main {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  min-height: 0;
}

.lightbox-stage {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.85rem;
  min-height: 0;
  padding: 1rem 1rem 0.75rem;
}

.lightbox-viewport {
  display: grid;
  place-items: center;
  min-height: 0;
  height: 100%;
  overflow: auto;
  border-radius: 24px;
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.08), transparent 42%),
    rgba(255, 255, 255, 0.03);
  cursor: default;
  scrollbar-width: thin;
}

.lightbox-viewport.is-zoomed {
  cursor: grab;
}

.lightbox-image {
  width: auto;
  max-width: min(100%, 1200px);
  max-height: calc(96vh - 16rem);
  object-fit: contain;
  transform-origin: center center;
  transition: transform 0.18s ease;
  will-change: transform;
  user-select: none;
}

.lightbox-image.is-zoomed {
  cursor: grab;
}

.lightbox-image.is-dragging {
  cursor: grabbing;
}

.lightbox-nav {
  width: 3rem;
  height: 3rem;
  border-radius: 999px;
  font-size: 2rem;
  line-height: 1;
}

.lightbox-button:hover,
.lightbox-nav:hover,
.lightbox-share-link:hover,
.lightbox-thumb:hover {
  background: rgba(255, 255, 255, 0.16);
}

.lightbox-button:disabled,
.lightbox-nav:disabled {
  opacity: 0.45;
  cursor: default;
}

.lightbox-meta {
  display: grid;
  gap: 0.85rem;
  padding: 0.9rem 1rem 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent);
}

.lightbox-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}

.lightbox-hint {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.88rem;
}

.lightbox-share {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.lightbox-share-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  font: inherit;
  font-size: 0.9rem;
}

.lightbox-share-copy.is-done {
  background: color-mix(in srgb, var(--accent) 76%, white);
  border-color: transparent;
  color: var(--accent-contrast);
}

.lightbox-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.lightbox-tags .tag-pill {
  color: #f8fbff;
  border-color: rgba(255, 255, 255, 0.16);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 28%, transparent), rgba(255, 255, 255, 0.06));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.lightbox-tags .tag-pill:hover {
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 42%, transparent), rgba(255, 255, 255, 0.12));
}

.post-content {
  white-space: pre-wrap;
  font-family: var(--font-copy);
  font-size: 1.08rem;
  line-height: 1.8;
  margin-bottom: 2rem;
}

.comment-list {
  display: grid;
  gap: 0.9rem;
}

.comment-card header {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.4rem;
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  margin-top: 1.4rem;
}

.page-link,
.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0.55rem 0.9rem;
  background: var(--panel);
}

.page-link.current,
.button-link,
.page-link:hover {
  background: var(--accent);
  color: var(--accent-contrast);
  border-color: transparent;
}

.page-link.disabled {
  opacity: 0.45;
}

.page-gap {
  color: var(--muted);
}

.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 2rem;
  padding: 1.2rem 0 2.5rem;
}

.footer-shell {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
}

.footer-shell p,
.footer-meta {
  color: var(--muted);
}

.footer-meta {
  display: grid;
  gap: 0.2rem;
  text-align: right;
}

.error-shell {
  min-height: 60vh;
  display: grid;
  place-items: center;
}

.error-card {
  max-width: 560px;
  text-align: center;
}

.empty-state,
.image-fallback {
  color: var(--muted);
}

.image-fallback {
  display: grid;
  place-items: center;
  min-height: 220px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 18%, transparent), transparent 55%),
    var(--panel-strong);
}

@media (max-width: 1080px) {
  .hero-shell,
  .layout-main,
  .layout-post {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

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

@media (max-width: 760px) {
  .cards-v1 .post-card-link,
  .cards-v2 .post-card-link,
  .cards-v3 .post-card-link,
  .cards-v4 .post-card-link,
  .cards-v5 .post-card-link {
    grid-template-columns: 1fr;
  }

  .gallery-v1,
  .gallery-v2 {
    grid-template-columns: 1fr;
  }

  .header-shell,
  .footer-shell {
    flex-direction: column;
  }

  .footer-meta {
    text-align: left;
  }

  .lightbox-shell {
    width: 100%;
    height: 100%;
    margin: 0;
    border-radius: 0;
  }

  .lightbox-topbar {
    padding: 0.85rem;
  }

  .lightbox-body {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .lightbox-rail {
    padding: 0.85rem;
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .lightbox-thumbs {
    grid-auto-flow: column;
    grid-auto-columns: minmax(72px, 84px);
    overflow-x: auto;
  }

  .lightbox-stage {
    grid-template-columns: 1fr;
    padding: 0.85rem 0.85rem 0.6rem;
  }

  .lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1;
  }

  .lightbox-prev {
    left: 0.75rem;
  }

  .lightbox-next {
    right: 0.75rem;
  }

  .lightbox-image {
    max-height: calc(100vh - 20rem);
  }

  .lightbox-meta {
    padding: 0.75rem 0.85rem 1rem;
  }

  .lightbox-meta-row {
    align-items: flex-start;
  }

  .lightbox-share {
    width: 100%;
  }

  .lightbox-share-link {
    flex: 1 1 auto;
  }
}
