/* ==========================================================================
   Daydream Ghost Theme — screen.css
   Matches daydream.live marketing site design system
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design Tokens
   -------------------------------------------------------------------------- */

:root {
  --bg: #0a0a0a;
  --fg: #ededed;
  --white: #ffffff;
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-light: rgba(255, 255, 255, 0.1);
  --border-medium: rgba(255, 255, 255, 0.15);
  --border-hover: rgba(255, 255, 255, 0.2);
  --text-muted: rgba(255, 255, 255, 0.4);
  --text-secondary: rgba(255, 255, 255, 0.6);
  --text-tertiary: rgba(255, 255, 255, 0.7);
  --text-body: rgba(255, 255, 255, 0.8);
  --card-bg: rgba(24, 24, 27, 0.4);
  --card-bg-hover: rgba(24, 24, 27, 0.6);
  --nav-bg: rgba(0, 0, 0, 0.3);
  --container-max: 1280px;
  --container-narrow: 720px;
  --font-sans: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
  --transition-fast: 200ms ease;
  --transition-medium: 300ms ease;
}

/* --------------------------------------------------------------------------
   2. Reset & Base
   -------------------------------------------------------------------------- */

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  line-height: 1.6;
  min-height: 100vh;
}

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

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

*:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px #0a0a0a, 0 0 0 4px rgba(255, 255, 255, 0.2);
  border-radius: inherit;
}

/* --------------------------------------------------------------------------
   3. Layout
   -------------------------------------------------------------------------- */

.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.container--narrow {
  max-width: var(--container-narrow);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.site-content {
  min-height: 60vh;
}

/* --------------------------------------------------------------------------
   4. Navigation (matches daydream.live TopNav)
   -------------------------------------------------------------------------- */

.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  height: 64px;
  border-bottom: 1px solid transparent;
  background: transparent;
  transition: border-color 0.3s, background 0.3s;
}

.site-nav.is-scrolled {
  border-bottom-color: rgba(255, 255, 255, 0.05);
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}

.site-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: 80rem;       /* max-w-7xl */
  margin: 0 auto;
  padding: 0 1.5rem;
}

.site-nav-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.site-nav-logo img {
  height: 28px;
  width: auto;
}

.nav {
  display: flex;
  list-style: none;
  gap: 0.25rem;
}

.nav li a {
  display: block;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  color: var(--text-tertiary);
  border-radius: 0.5rem;
  transition: color var(--transition-fast);
}

.nav li a:hover {
  color: var(--white);
}

/* Right side: Download + Sign In */
.site-nav-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nav-btn-download {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #000;
  background: var(--white);
  border-radius: 9999px;
  transition: background var(--transition-fast), transform var(--transition-fast);
}

.nav-btn-download:hover {
  background: #e4e4e7;
  transform: scale(1.02);
}

.nav-btn-download:active {
  transform: scale(0.98);
}

.nav-btn-icon {
  width: 14px;
  height: 14px;
}

.nav-btn-signin {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  color: var(--text-tertiary);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 9999px;
  transition: border-color var(--transition-fast), color var(--transition-fast);
}

.nav-btn-signin:hover {
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--white);
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  color: var(--white);
}

.nav-toggle svg {
  width: 24px;
  height: 24px;
}

@media (max-width: 768px) {
  .nav-toggle {
    display: block;
  }

  .nav,
  .site-nav-right {
    display: none;
  }

  .nav.is-open {
    display: flex;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    background: rgba(9, 9, 11, 0.95);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-bottom: 1px solid var(--border-subtle);
    padding: 0.75rem 1.5rem 1rem;
  }

  .nav.is-open + .site-nav-right-mobile {
    display: flex;
  }

  .nav li a {
    padding: 0.75rem 0;
    font-size: 1rem;
  }
}

/* --------------------------------------------------------------------------
   4b. Fog of War Background (toned-down CSS version)
   -------------------------------------------------------------------------- */

.fog-background {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.fog-gradient {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.5;
}

.fog-gradient--orange {
  width: 600px;
  height: 400px;
  top: -10%;
  right: 10%;
  background: radial-gradient(ellipse, rgba(234, 146, 30, 0.12) 0%, transparent 70%);
}

.fog-gradient--teal {
  width: 500px;
  height: 400px;
  top: 60%;
  left: 5%;
  background: radial-gradient(ellipse, rgba(56, 189, 192, 0.08) 0%, transparent 70%);
}

.fog-gradient--red {
  width: 450px;
  height: 350px;
  top: 30%;
  left: 40%;
  background: radial-gradient(ellipse, rgba(200, 50, 80, 0.06) 0%, transparent 70%);
}

.site-content,
.site-footer {
  position: relative;
  z-index: 10;
}

/* --------------------------------------------------------------------------
   5. Site Header
   -------------------------------------------------------------------------- */

.site-header {
  padding: 10rem 0 4rem;
  text-align: center;
}

.site-header--compact {
  padding: 7rem 0 2rem;
}

.site-header--spacer {
  padding: 7.5rem 0 2rem;
}

.site-title {
  font-size: clamp(2.25rem, 5vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--white);
  line-height: 1.15;
}

.site-description {
  margin-top: 1.25rem;
  font-size: 1.125rem;
  line-height: 1.75;
  color: var(--text-body);
  max-width: 42rem;
  margin-left: auto;
  margin-right: auto;
}

/* --------------------------------------------------------------------------
   5b. Hero Card (most recent post)
   -------------------------------------------------------------------------- */

.hero-card {
  border-radius: 1rem;
  border: 1px solid var(--border-subtle);
  background: var(--card-bg);
  overflow: hidden;
  margin-bottom: 2rem;
  transition: all var(--transition-medium);
}

.hero-card:hover {
  border-color: var(--border-light);
  background: var(--card-bg-hover);
}

.hero-card-link {
  display: grid;
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .hero-card-link {
    grid-template-columns: 1.2fr 1fr;
  }
}

.hero-card-image {
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

@media (min-width: 768px) {
  .hero-card-image {
    aspect-ratio: auto;
    min-height: 280px;
    max-height: 420px;
  }
}

.hero-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 500ms ease;
}

.hero-card:hover .hero-card-image img {
  transform: scale(1.02);
}

.hero-card-image--empty {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.15), rgba(236, 72, 153, 0.15));
  min-height: 240px;
}

@media (min-width: 768px) {
  .hero-card-image--empty {
    min-height: 320px;
  }
}

.hero-card-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2rem;
}

@media (min-width: 768px) {
  .hero-card-content {
    padding: 3rem;
  }
}

.hero-card-title {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  color: var(--white);
  margin-top: 0.5rem;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.hero-card-excerpt {
  margin-top: 1rem;
  font-size: 1rem;
  line-height: 1.75;
  color: var(--text-tertiary);
}

/* --------------------------------------------------------------------------
   6. Post Grid
   -------------------------------------------------------------------------- */

.post-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  padding-bottom: 2rem;
}

@media (min-width: 640px) {
  .post-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .post-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* --------------------------------------------------------------------------
   7. Post Card
   -------------------------------------------------------------------------- */

.post-card {
  border-radius: 1rem;
  border: 1px solid var(--border-subtle);
  background: var(--card-bg);
  overflow: hidden;
  transition: all var(--transition-medium);
}

.post-card:hover {
  border-color: var(--border-light);
  background: var(--card-bg-hover);
  transform: scale(1.02);
}

.post-card-link {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.post-card-image {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-bottom: 1px solid var(--border-subtle);
}

.post-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 500ms ease;
}

.post-card:hover .post-card-image img {
  transform: scale(1.02);
}

.post-card-image--empty {
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.15), rgba(236, 72, 153, 0.15));
}

.post-card-content {
  padding: 1.5rem;
}

@media (min-width: 640px) {
  .post-card-content {
    padding: 1.75rem 2rem;
  }
}

.post-card-tag {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  font-weight: 600;
}

.post-card-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--fg);
  margin-top: 0.5rem;
  line-height: 1.3;
}

.post-card-excerpt {
  margin-top: 0.75rem;
  font-size: 0.9375rem;
  line-height: 1.75;
  color: var(--text-tertiary);
}

.post-card-meta {
  margin-top: 1.25rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

/* --------------------------------------------------------------------------
   8. Post Full (Single Post)
   -------------------------------------------------------------------------- */

.post-full {
  padding-top: 8rem;
}

.post-full-header {
  text-align: center;
  padding-bottom: 2rem;
}

.post-tag {
  display: inline-block;
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  margin-bottom: 1rem;
  transition: color var(--transition-fast);
}

.post-tag:hover {
  color: var(--white);
}

.post-full-title {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--white);
  line-height: 1.15;
}

.post-full-excerpt {
  margin-top: 1rem;
  font-size: 1.25rem;
  line-height: 1.6;
  color: var(--text-body);
}

.post-meta {
  margin-top: 1.5rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  display: flex;
  justify-content: center;
  gap: 0.5rem;
}

.post-meta-separator {
  opacity: 0.5;
}

.post-full-image {
  margin: 2rem auto;
  max-width: 1000px;
  border-radius: 1rem;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
}

.post-full-image img {
  width: 100%;
}

.post-full-image figcaption {
  padding: 0.75rem 1rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
  text-align: center;
}

/* --------------------------------------------------------------------------
   9. Post Content Typography
   -------------------------------------------------------------------------- */

.post-full-content {
  padding: 3rem 0 4rem;
  font-size: 1.0625rem;
  line-height: 1.8;
  color: var(--text-body);
}

.post-full-content h2 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--white);
  margin: 3rem 0 1rem;
  letter-spacing: -0.02em;
}

.post-full-content h3 {
  font-size: 1.375rem;
  font-weight: 600;
  color: var(--white);
  margin: 2.5rem 0 0.75rem;
}

.post-full-content h4 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--white);
  margin: 2rem 0 0.5rem;
}

.post-full-content p {
  margin-bottom: 1.5rem;
}

.post-full-content a {
  color: var(--white);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(255, 255, 255, 0.3);
  transition: text-decoration-color var(--transition-fast);
}

.post-full-content a:hover {
  text-decoration-color: var(--white);
}

.post-full-content strong {
  color: var(--white);
  font-weight: 600;
}

.post-full-content blockquote {
  border-left: 3px solid var(--border-medium);
  padding-left: 1.5rem;
  margin: 2rem 0;
  font-style: italic;
  color: var(--text-tertiary);
}

.post-full-content pre {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: 0.75rem;
  padding: 1.25rem;
  overflow-x: auto;
  margin: 2rem 0;
  font-size: 0.875rem;
  line-height: 1.6;
}

.post-full-content code {
  background: rgba(255, 255, 255, 0.08);
  padding: 0.15rem 0.4rem;
  border-radius: 0.25rem;
  font-size: 0.9em;
}

.post-full-content pre code {
  background: none;
  padding: 0;
  border-radius: 0;
  font-size: inherit;
}

.post-full-content ul,
.post-full-content ol {
  margin: 1.5rem 0;
  padding-left: 1.5rem;
}

.post-full-content li {
  margin-bottom: 0.5rem;
}

.post-full-content img {
  border-radius: 0.75rem;
  margin: 2rem 0;
}

.post-full-content hr {
  border: none;
  border-top: 1px solid var(--border-subtle);
  margin: 3rem 0;
}

.post-full-content figure {
  margin: 2rem 0;
}

.post-full-content figcaption {
  margin-top: 0.75rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
  text-align: center;
}

.post-full-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
}

.post-full-content th,
.post-full-content td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
  text-align: left;
}

.post-full-content th {
  color: var(--white);
  font-weight: 600;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Ghost card width overrides */
.post-full-content .kg-width-wide {
  max-width: 1000px;
  margin-left: auto;
  margin-right: auto;
}

.post-full-content .kg-width-full {
  max-width: none;
  margin-left: calc(-50vw + 50%);
  margin-right: calc(-50vw + 50%);
}

/* --------------------------------------------------------------------------
   10. Ghost Card Overrides (dark theme)
   -------------------------------------------------------------------------- */

.kg-bookmark-card {
  border: 1px solid var(--border-subtle) !important;
  border-radius: 0.75rem !important;
  overflow: hidden;
  background: var(--card-bg) !important;
}

.kg-bookmark-container {
  background: var(--card-bg) !important;
  color: var(--fg) !important;
  border: none !important;
}

.kg-bookmark-content {
  padding: 1.25rem !important;
}

.kg-bookmark-title {
  color: var(--white) !important;
  font-weight: 600 !important;
}

.kg-bookmark-description {
  color: var(--text-tertiary) !important;
}

.kg-bookmark-metadata {
  color: var(--text-muted) !important;
}

.kg-callout-card {
  background: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid var(--border-subtle) !important;
  border-radius: 0.75rem !important;
  color: var(--text-body) !important;
}

.kg-toggle-card {
  background: transparent !important;
  border: 1px solid var(--border-subtle) !important;
  border-radius: 0.75rem !important;
}

.kg-toggle-heading-text {
  color: var(--white) !important;
}

.kg-toggle-content p {
  color: var(--text-body) !important;
}

.kg-gallery-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 2rem 0;
}

.kg-gallery-row {
  display: flex;
  gap: 0.75rem;
}

.kg-gallery-row img {
  flex: 1;
  height: 100%;
  object-fit: cover;
  border-radius: 0.5rem;
}

.kg-gallery-image img {
  border-radius: 0.5rem;
}

.kg-bookmark-icon {
  width: 22px;
  height: 22px;
  margin-right: 0.5rem;
}

.kg-bookmark-author {
  color: var(--text-secondary) !important;
}

.kg-bookmark-author::after {
  content: "·";
  margin: 0 0.375rem;
}

.kg-bookmark-publisher {
  color: var(--text-muted) !important;
}

.kg-bookmark-thumbnail {
  position: relative;
  min-width: 33%;
  max-height: 100%;
}

.kg-bookmark-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
}

.kg-button-card .kg-btn {
  background: var(--white) !important;
  color: var(--bg) !important;
  border-radius: 9999px !important;
  font-weight: 500 !important;
}

/* --------------------------------------------------------------------------
   11. Author Card & Author Header
   -------------------------------------------------------------------------- */

.author-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 2rem 0;
  border-top: 1px solid var(--border-subtle);
  margin-top: 2rem;
}

.author-card-image {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.author-card-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--white);
}

.author-card-name a:hover {
  text-decoration: underline;
}

.author-card-bio {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

.author-header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  text-align: left;
  justify-content: center;
}

.author-header-image {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border-light);
  flex-shrink: 0;
}

.author-post-count {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

/* --------------------------------------------------------------------------
   12. Footer (matches daydream.live multi-column footer)
   -------------------------------------------------------------------------- */

.site-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding: 5rem 0;
  background: var(--bg);
}

.site-footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
}

@media (min-width: 640px) {
  .site-footer-grid {
    grid-template-columns: 1.5fr repeat(2, 1fr);
    gap: 2rem;
  }
}

@media (min-width: 1024px) {
  .site-footer-grid {
    grid-template-columns: 1.8fr repeat(4, 1fr);
    gap: 2rem;
  }
}

.site-footer-brand-col {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.site-footer-brand img {
  height: 24px;
  width: auto;
}

.site-footer-socials {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.site-footer-socials a {
  color: var(--text-muted);
  transition: color var(--transition-fast);
}

.site-footer-socials a:hover {
  color: var(--white);
}

.site-footer-col {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.site-footer-heading {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--white);
  margin-bottom: 0.25rem;
}

.site-footer-col a {
  font-size: 0.875rem;
  color: var(--text-muted);
  transition: color var(--transition-fast);
}

.site-footer-col a:hover {
  color: var(--white);
}

.site-footer-copyright {
  margin-top: 4rem;
  padding-top: 2.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   13. Pagination
   -------------------------------------------------------------------------- */

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  padding: 2rem 0 4rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.pagination a {
  padding: 0.5rem 1.25rem;
  border: 1px solid var(--border-light);
  border-radius: 9999px;
  color: var(--text-tertiary);
  transition: all var(--transition-fast);
}

.pagination a:hover {
  border-color: var(--border-hover);
  color: var(--white);
}

/* --------------------------------------------------------------------------
   14. Error Page
   -------------------------------------------------------------------------- */

.error-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 80vh;
  text-align: center;
  padding: 2rem;
}

.error-code {
  font-size: 8rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: -0.05em;
  line-height: 1;
}

.error-message {
  font-size: 1.25rem;
  color: var(--text-secondary);
  margin-top: 1rem;
}

.error-link {
  display: inline-block;
  margin-top: 2rem;
  padding: 0.75rem 2rem;
  border: 1px solid var(--border-medium);
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--white);
  transition: all var(--transition-fast);
}

.error-link:hover {
  border-color: var(--border-hover);
  transform: scale(1.02);
}

/* --------------------------------------------------------------------------
   15. Page template
   -------------------------------------------------------------------------- */

.page-full {
  padding-top: 8rem;
}
