/* Core theme: black background, white text, centered layout */
:root {
  --bg: #121212;
  --text: #e8e9ed;
  --muted: #a5acb8;
  --card: rgba(22, 26, 31, 0.9);
  --border: #1f262f;
  --accent: #dfe3ea;
  --accent-dim: rgba(223, 227, 234, 0.08);
  --max-width: 1120px;
  --onyx: #151515ff;
  --dusty-mauve: #a63d40ff;
  --sunlit-clay: #e9b872ff;
  --sage-green: #90a959ff;
  --air-force-blue: #6494aaff;
}

.light {
  --bg: #e6e8ed;
  --text: #111827;
  --muted: #4b5563;
  --card: rgba(244, 246, 250, 0.92);
  --border: #c7ccd5;
  --accent: #0f1722;
  --accent-dim: rgba(15, 23, 34, 0.08);
}

@font-face {
  font-family: "TapeWhite";
  src: url("assets/tape-white.woff2") format("woff2");
  font-display: swap;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  display: block;
  overflow-y: scroll;
  position: relative;
}

body.has-bg::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0) 60%, rgba(0, 0, 0, 0.75) 100%),
    var(--page-bg);
  background-size: cover;
  background-position: center;
  opacity: 0.5;
  pointer-events: none;
  z-index: 0;
}

.page {
  position: relative;
  z-index: 1;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  color: var(--accent);
}

.page {
  width: 100%;
  max-width: var(--max-width);
  padding: 32px 20px 48px;
  margin: 0 auto;
}

.site-header {
  margin-bottom: clamp(16px, 2.5vw, 28px);
  position: relative;
}

.header-right {
  gap: 10px;
}

.brand-nav {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  flex-wrap: wrap;
  flex: 1 1 auto;
}

.search-bar {
  align-self: flex-end;
  margin-top: auto;
}

.search-form {
  --timing: 0.3s;
  --width-of-input: 180px;
  --height-of-input: 30px;
  --border-height: 2px;
  --input-bg: var(--card);
  --border-color: var(--accent);
  --border-radius: 30px;
  --after-border-radius: 1px;
  position: relative;
  width: var(--width-of-input);
  height: var(--height-of-input);
  display: flex;
  align-items: center;
  padding-inline: 0.8em;
  border-radius: var(--border-radius);
  transition: border-radius 0.5s ease;
  background: var(--input-bg);
  border: 1px solid var(--border);
  color: var(--text);
}

.search-form input {
  font-size: 0.9rem;
  background-color: transparent;
  width: 100%;
  height: 100%;
  padding-inline: 0.5em;
  padding-block: 0.7em;
  border: none;
  color: var(--text);
  outline: none;
}

.search-form input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
  display: none;
}

.search-form input::-ms-clear {
  display: none;
}

.search-form input::placeholder {
  color: var(--muted);
}

.search-form::before {
  content: "";
  position: absolute;
  background: var(--border-color);
  transform: scaleX(0);
  transform-origin: center;
  width: 100%;
  height: var(--border-height);
  left: 0;
  bottom: 0;
  border-radius: 1px;
  transition: transform var(--timing) ease;
}

.search-form:focus-within {
  border-radius: var(--after-border-radius);
}

.search-form:focus-within::before {
  transform: scale(1);
}

.search-form button {
  border: none;
  background: none;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  cursor: pointer;
}

.search-form .search-reset {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease;
}

.search-form .search-input:not(:placeholder-shown) ~ .search-reset {
  opacity: 1;
  visibility: visible;
}

.search-form svg {
  width: 17px;
  height: 17px;
}

.aux-nav {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  grid-row: 1 / span 2;
  flex: 0 0 auto;
  align-self: stretch;
}

.aux-nav .switch {
  align-self: flex-end;
  margin-top: 10px;
}

.nav-extras .switch {
  margin-top: 0;
  align-self: center;
}

.aux-nav a {
  color: var(--text);
}

.search-under-nav {
  grid-column: 2;
  grid-row: 3;
  align-self: start;
}

.search-under-nav .search-form {
  --width-of-input: 180px;
  margin-top: 6px;
}

.about-link {
  font-size: 14px;
  padding: 6px 8px;
  text-transform: lowercase;
  text-decoration: none;
}

.patreon-logo {
  width: 28px;
  height: 28px;
  display: block;
}

.nav-separator {
  width: 1px;
  height: 20px;
  background: rgba(223, 227, 234, 0.65);
}

.light .nav-separator {
  background: #0f1722;
}

.patreon-link {
  padding-left: 6px;
}

.nav-patreon-link {
  padding: 2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Theme toggle (simple slider) */
.switch {
  font-size: 10px;
  position: relative;
  display: inline-block;
  width: 3.5em;
  height: 2em;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  --background: #1e1e1e;
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--background);
  transition: 0.5s;
  border-radius: 30px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 1.4em;
  width: 1.4em;
  border-radius: 50%;
  left: 10%;
  bottom: 15%;
  box-shadow: inset 8px -4px 0px 0px #fff000;
  background: var(--background);
  transition: 0.5s;
}

.switch input:checked + .slider {
  background-color: #434343;
}

.switch input:checked + .slider:before {
  transform: translateX(100%);
  box-shadow: inset 15px -4px 0px 15px #fff000;
}

.light .logo-image,
.light .patreon-logo {
  filter: invert(1) hue-rotate(180deg) brightness(1.05);
}

.logo {
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-wrap {
  grid-row: 1 / span 2;
}

.logo-image {
  width: 140px;
  max-width: 140px;
  height: auto;
  display: block;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}

.nav a {
  font-size: 14px;
  padding: 6px 8px;
  border-bottom: 2px solid transparent;
  transition: border 0.2s ease, color 0.2s ease;
  text-align: center;
}

.nav a:hover,
.nav a.active {
  border-color: var(--accent);
  color: var(--accent);
}

.nav-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
}

.nav-extras {
  display: flex;
  gap: 22px;
  align-items: center;
  justify-content: flex-start;
}

.nav-extras > * {
  display: inline-flex;
  align-items: center;
}

.search-under-nav {
  width: 100%;
  max-width: 320px;
  padding: 6px 0;
  display: flex;
}

.search-under-nav .search-form {
  --width-of-input: 180px;
  width: 100%;
  max-width: var(--width-of-input);
  margin-top: 0;
}

@media (max-width: 768px) {
  .nav a {
    font-size: 13px;
    padding: 4px 6px;
  }
  .search-under-nav {
    max-width: 100%;
  }
  .post-card h2 {
    font-size: 28px;
    line-height: 1.2;
  }
  .subtitle {
    font-size: 16px;
  }
}

.pagination {
  display: flex;
  gap: 8px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.page-link {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  text-decoration: none;
  color: var(--text);
}

.page-link.active {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
}

/* SMPTE-inspired colors per category */
.nav-games:hover,
.nav-games.active {
  border-color: #d7d900;
  color: #d7d900;
}
.nav-movies:hover,
.nav-movies.active {
  border-color: #00c0c0;
  color: #00c0c0;
}
.nav-tv-shows:hover,
.nav-tv-shows.active {
  border-color: #00b140;
  color: #00b140;
}
.nav-albums:hover,
.nav-albums.active {
  border-color: #c000c0;
  color: #c000c0;
}
.nav-books:hover,
.nav-books.active {
  border-color: #c00000;
  color: #c00000;
}
.nav-about-link {
  border-bottom: 2px solid transparent;
}
.nav-all:hover,
.nav-all.active {
  border-color: #9c9c9c;
  color: #dfe3ea;
}

.hero {
  text-align: left;
  margin-bottom: 28px;
  color: var(--muted);
  line-height: 1.6;
}

.post-grid {
  display: grid;
  gap: 18px;
  margin-top: 0;
}

.post-card {
  padding: 20px 22px;
  background: var(--card);
  background-image: linear-gradient(
      90deg,
      rgba(0, 0, 0, 0.78) 0%,
      rgba(0, 0, 0, 0.55) 45%,
      rgba(0, 0, 0, 0.15) 100%
    ),
    var(--card-image, none);
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: border 0.2s ease, box-shadow 0.2s ease;
  display: block;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.light .post-card {
  background: var(--card);
  background-image: linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.8) 0%,
      rgba(255, 255, 255, 0.58) 45%,
      rgba(255, 255, 255, 0.2) 100%
    ),
    var(--card-image, none);
  border-color: #c7ccd5;
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
}

.post-card:hover {
  border-color: var(--border);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.18),
    0 12px 28px rgba(0, 0, 0, 0.4);
}

.light .post-card:hover {
  border-color: #c7ccd5;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.08),
    0 10px 22px rgba(0, 0, 0, 0.2);
}

.post-card h2 {
  margin: 0 0 4px;
  font-size: 40px;
}

.post-card h2 a {
  color: inherit;
  text-decoration: none;
}

.subtitle {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.5;
}

.tag-button {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: none;
  color: var(--tag-color, var(--text));
  text-decoration: none;
  padding: 0;
  border: none;
  border-radius: 0;
  text-shadow:
    0 0 6px rgba(0, 0, 0, 0.18),
    0 0 12px rgba(0, 0, 0, 0.12);
}

.tag-button:hover {
  color: var(--tag-color, var(--text));
  opacity: 0.85;
}

.tag-games {
  --tag-underline: var(--sunlit-clay);
  --tag-color: var(--sunlit-clay);
}

.tag-movies {
  --tag-underline: var(--air-force-blue);
  --tag-color: var(--air-force-blue);
}

.tag-tv-shows {
  --tag-underline: var(--sage-green);
  --tag-color: var(--sage-green);
}

.tag-albums {
  --tag-underline: var(--dusty-mauve);
  --tag-color: var(--dusty-mauve);
}

.tag-books {
  --tag-underline: var(--onyx);
  --tag-color: var(--onyx);
}

.tag-uncategorized {
  --tag-underline: #9c9c9c;
  --tag-color: #9c9c9c;
}

.meta {
  display: flex;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
  margin: 8px 0 12px;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--accent-dim);
  color: var(--text);
  text-transform: none;
  letter-spacing: 0;
  font-size: 12px;
  font-style: italic;
  line-height: 1;
}

.tag-games,
.tag-movies,
.tag-tv-shows,
.tag-albums,
.tag-books,
.tag-uncategorized {
  background: transparent;
  border: none;
}

.pill-muted {
  text-transform: none;
  letter-spacing: 0;
  color: var(--muted);
  background: transparent;
  font-style: italic;
}

.excerpt {
  position: relative;
  margin: 0;
  color: var(--text);
  line-height: 1.6;
}

.excerpt-fade {
  display: inline;
}

.preview-media {
  grid-column: 1;
  grid-row: 1 / span 4;
  max-width: 260px;
}

.header-media {
  margin: 0 0 16px;
}

.header-image {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.empty-state {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.post-page .content {
  background: rgba(22, 26, 31, 0.98);
  border: 1px solid var(--border);
  padding: 24px;
  border-radius: 8px;
  line-height: 1.75;
}

.light .post-page .content {
  background: rgba(255, 255, 255, 0.98);
  border-color: #c7ccd5;
  color: #0f1722;
}

.post-page {
  padding-top: 0;
  margin-top: 0;
}

.post-page h1 {
  margin: 4px 0 4px;
  font-size: 40px;
  line-height: 1.1;
}

.post-page .content h1 {
  margin-top: 0;
}

.content h2,
.content h3,
.content h4 {
  margin-top: 24px;
  margin-bottom: 12px;
}

.content p {
  margin: 0 0 16px;
}

.content ul {
  padding-left: 22px;
  margin: 0 0 16px;
}

.content li {
  margin-bottom: 8px;
}

.content pre {
  background: #0f141a;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  overflow: auto;
}

.content code {
  background: #0f141a;
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 14px;
}

.content img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 16px 0;
  border-radius: 6px;
}

.content iframe {
  max-width: 100%;
  width: 100%;
  height: auto;
  min-height: 240px;
  aspect-ratio: 16 / 9;
  border: none;
  display: block;
  margin: 16px 0;
}

.content a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.content a:hover {
  color: var(--accent);
  text-decoration-thickness: 3px;
}

.footer {
  margin-top: 36px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

@media (max-width: 640px) {
  .logo {
    font-size: 32px;
  }

  .page {
    padding: 32px 16px 48px;
  }
}
