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

/* ─── Design tokens ─────────────────────────────────────────── */
:root {
  --bg:            #020204;
  --bg-elevated:   #111119;
  --bg-card:       #13131d;
  --bg-card-hover: rgba(23, 23, 34, 0.6);

  --border:        rgba(255, 255, 255, 0.07);
  --border-hover:  rgba(255, 255, 255, 0.18);

  --text:          #f0ece3;
  --text-muted:    #7878a0;
  --text-subtle:   #404060;

  --accent:        #8aaa9c;
  --accent-light:  #a8c4b7;
  --accent-dim:    rgba(138, 170, 156, 0.12);
  --accent-border: rgba(138, 170, 156, 0.25);
  --neon:          #4ade80;

  --font-display: 'Space Grotesk', sans-serif;
  --font-body:    Arial, sans-serif;

  --nav-height:    64px;
  --max-width:     1160px;
  --sidebar-width: 280px;
  --gap:           clamp(1rem, 3vw, 2rem);

  --radius-sm: 3px;
  --radius-md: 6px;
  --radius-lg: 10px;
  --ease: 200ms ease;
}

/* ─── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; color-scheme: dark; }
body {
  background-color: var(--bg);
  /* set --bg-image in :root or a child rule once you have the cityscape file */
  background-image: var(--bg-image, none);
  background-size: cover;
  background-position: center top;
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }

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

/* ─── Scrollbar ──────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--text-subtle); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ─── Focus / Selection ──────────────────────────────────────── */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: var(--radius-sm); }
::selection { background: var(--accent-dim); color: var(--accent-light); }

/* ─── Header ─────────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-height);
  background: rgba(9, 9, 15, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

/* ─── Stacking above the fixed rain canvas ───────────────────── */
.site-main,
.site-footer { position: relative; z-index: 1; }

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--gap);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.site-branding { flex-shrink: 0; }

.site-logo-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.site-logo {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.site-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  color: var(--text);
  text-transform: uppercase;
}

/* ─── Primary Nav ────────────────────────────────────────────── */
.primary-nav { margin-right: auto; }

.nav-menu {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav-menu li { position: relative; }

.nav-menu li a {
  display: block;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: color var(--ease), background var(--ease);
  letter-spacing: 0.01em;
}

.nav-menu li a:hover,
.nav-menu li.current-menu-item > a,
.nav-menu li.current_page_item > a {
  color: var(--text);
  background: var(--accent-dim);
}

/* Sub-menu dropdown */
.nav-menu .sub-menu {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 160px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.3rem 0;
  flex-direction: column;
  gap: 0;
  z-index: 200;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.nav-menu li:hover > .sub-menu,
.nav-menu li:focus-within > .sub-menu { display: flex; }

.nav-menu .sub-menu li { width: 100%; }

.nav-menu .sub-menu li a {
  padding: 0.4rem 0.9rem;
  border-radius: 0;
  white-space: nowrap;
  font-size: 0.825rem;
}

/* ─── Full-page rain canvas ──────────────────────────────────── */
#rain-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  /* opacity controlled per-element in JS so buildings and rain can differ */
}

/* ─── Hero (home page only) ──────────────────────────────────── */
.site-hero-wrap {
  max-width: var(--max-width);
  margin: 2rem auto 2rem;
  padding: 0 var(--gap);
  position: relative;
  z-index: 1;
}

.site-hero {
  position: relative;
  min-height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background-image: url('../images/hero.png');
  background-size: cover;
  background-position: center center;
}

.site-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(2, 2, 4, 0.45);
  pointer-events: none;
}

.hero-content {
  position: relative;
  text-align: center;
  padding: 4rem var(--gap);
  z-index: 1;
}

/* ─── Flanking phrase layout ─────────────────────────────────── */
.hero-phrase {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(1.5rem, 4vw, 3rem);
  margin-bottom: 1.5rem;
}

.hero-phrase__side {
  display: flex;
  flex-direction: column;
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

/* slope: left rides up, right drops down — ~8% against horizontal */
.hero-phrase__left  { text-align: right; transform: translateY(-16px); }
.hero-phrase__right { text-align: left;  transform: translateY(16px);  }

/* "Reads" and "Modern" — the stressed words */
.hero-phrase__emphasis {
  font-size: clamp(2.2rem, 4.2vw, 3.4rem);
  color: var(--text);
}

/* "Pleistocene" and "Scenes" — quieter supporting words */
.hero-phrase__context {
  font-size: clamp(1rem, 1.8vw, 1.5rem);
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

/* "on" — connector, barely there */
.hero-phrase__on {
  font-style: normal;
  font-size: 0.55em;
  font-weight: 600;
  color: var(--text-subtle);
  letter-spacing: 0.08em;
  margin-right: 0.15em;
}

.hero-logo-wrap { flex-shrink: 0; }

.hero-logo-img {
  width: clamp(80px, 10vw, 130px);
  height: auto;
  display: block;
  filter:
    drop-shadow(0 0 8px rgba(74, 222, 128, 0.25))
    drop-shadow(0 0 24px rgba(74, 222, 128, 0.10));
}

/* site name — small branding subtitle below the phrase */
.hero-title {
  font-size: clamp(0.6rem, 1vw, 0.8rem);
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-subtle);
  margin-bottom: 0;
}

.hero-tagline {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 42ch;
  margin: 0.5rem auto 0;
}

/* ─── Site layout (two-column) ───────────────────────────────── */
.site-main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem var(--gap) 4rem;
  display: grid;
  grid-template-columns: 1fr var(--sidebar-width);
  gap: 3rem;
  align-items: start;
}

/* Single post & pages take full width for the content area */
.site-main.single-post .content-area,
.site-main.page-template .content-area--full {
  min-width: 0;
}

/* ─── Archive header ─────────────────────────────────────────── */
.archive-header,
.search-header {
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.archive-title,
.search-title { font-size: 1.5rem; color: var(--text-muted); }
.search-title span { color: var(--text); }

.archive-description { margin-top: 0.5rem; color: var(--text-muted); font-size: 0.95rem; }

/* ─── Post card (listing) ────────────────────────────────────── */
.post-card {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border);
}
.post-card:last-of-type { border-bottom: none; }

.post-thumbnail {
  margin-bottom: 1rem;
  border-radius: var(--radius-md);
  overflow: hidden;
}
.post-thumbnail img { width: 100%; height: 200px; object-fit: cover; transition: transform 400ms ease; }
.post-thumbnail:hover img { transform: scale(1.02); }

.entry-header { margin-bottom: 0.6rem; }

.entry-title { font-size: 1.35rem; margin-bottom: 0.4rem; }
.entry-title a { color: var(--text); transition: color var(--ease); }
.entry-title a:hover { color: var(--accent-light); }

/* ─── Entry meta ─────────────────────────────────────────────── */
.entry-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.post-date { color: var(--text-subtle); }

.post-categories a,
.post-tags a {
  display: inline-block;
  padding: 0.15em 0.6em;
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  background: var(--accent-dim);
  color: var(--accent-light);
  border: 1px solid var(--accent-border);
  transition: background var(--ease), border-color var(--ease);
}
.post-categories a:hover,
.post-tags a:hover {
  background: rgba(138, 170, 156, 0.2);
  border-color: rgba(138, 170, 156, 0.45);
}

.post-tags a { background: rgba(255,255,255,0.04); color: var(--text-muted); border-color: var(--border); }
.post-tags a:hover { background: rgba(255,255,255,0.08); border-color: var(--border-hover); color: var(--text); }

.post-comments a { color: var(--text-muted); transition: color var(--ease); }
.post-comments a:hover { color: var(--accent); }

/* ─── Excerpt / Read more ────────────────────────────────────── */
.entry-summary { color: var(--text-muted); font-size: 0.975rem; line-height: 1.7; }

.read-more {
  display: inline-block;
  margin-top: 0.5rem;
  color: var(--accent);
  font-weight: 600;
  font-size: 0.875rem;
  transition: color var(--ease);
}
.read-more:hover { color: var(--accent-light); }

/* ─── Single post ────────────────────────────────────────────── */
.entry-content {
  max-width: 68ch;
  line-height: 1.8;
}

.entry-content p { margin-bottom: 1.25rem; }
.entry-content h2 { margin: 2rem 0 0.75rem; font-size: 1.4rem; }
.entry-content h3 { margin: 1.75rem 0 0.6rem; font-size: 1.15rem; }
.entry-content h4 { margin: 1.5rem 0 0.5rem; font-size: 1rem; }

.entry-content a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.entry-content a:hover { color: var(--accent-light); }

.entry-content ul,
.entry-content ol { padding-left: 1.5rem; margin-bottom: 1.25rem; }
.entry-content li { margin-bottom: 0.35rem; }

.entry-content blockquote {
  border-left: 3px solid var(--accent);
  padding: 0.75rem 1.25rem;
  margin: 1.5rem 0;
  background: var(--bg-card);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-muted);
  font-style: italic;
}

.entry-content pre {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  overflow-x: auto;
  margin-bottom: 1.25rem;
  font-size: 0.875rem;
}

.entry-content code {
  font-family: 'Fira Code', 'Consolas', monospace;
  font-size: 0.875em;
  background: var(--bg-card);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  border: 1px solid var(--border);
}

.entry-content pre code { background: none; border: none; padding: 0; }

.entry-content img {
  border-radius: var(--radius-md);
  margin: 1.5rem 0;
}

.post-thumbnail-single {
  margin-bottom: 2rem;
  border-radius: var(--radius-md);
  overflow: hidden;
}
.post-thumbnail-single img { width: 100%; max-height: 420px; object-fit: cover; }

/* ─── Post navigation (prev/next) ────────────────────────────── */
.entry-footer { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--border); }

.post-navigation {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.nav-previous, .nav-next {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.nav-next { align-items: flex-end; text-align: right; }

.nav-subtitle {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-subtle);
  font-weight: 600;
}
.nav-title { font-size: 0.95rem; color: var(--accent); transition: color var(--ease); }
.nav-previous:hover .nav-title,
.nav-next:hover .nav-title { color: var(--accent-light); }

/* ─── Pagination ─────────────────────────────────────────────── */
.pagination { margin-top: 2.5rem; }

.page-numbers {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.page-numbers a,
.page-numbers span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  border: 1px solid var(--border);
  transition: background var(--ease), color var(--ease), border-color var(--ease);
}
.page-numbers a:hover { background: var(--bg-card); color: var(--text); border-color: var(--border-hover); }
.page-numbers .current { background: var(--accent-dim); color: var(--accent-light); border-color: var(--accent-border); }
.page-numbers .dots { border-color: transparent; }

.posts-navigation { margin-top: 2.5rem; display: flex; justify-content: space-between; }
.posts-navigation a {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent);
  transition: color var(--ease);
}
.posts-navigation a:hover { color: var(--accent-light); }

/* ─── Sidebar ────────────────────────────────────────────────── */
.widget-area {
  position: sticky;
  top: calc(var(--nav-height) + 1.5rem);
}

.widget {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.1rem;
  margin-bottom: 1.25rem;
  overflow: visible;
}

.widget:last-child { margin-bottom: 0; }

.widget-title {
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 0.9rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

/* absorb trailing letter-spacing so the last glyph isn't clipped */
.widget-title::after {
  content: '';
  letter-spacing: 0;
}

/* Sidebar list styles (recent posts, categories, archives) */
.widget ul { list-style: none; }

.widget ul li {
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
}

.widget ul li:last-child { border-bottom: none; }

.widget ul li a {
  color: var(--text-muted);
  transition: color var(--ease);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
}

.widget ul li a:hover { color: var(--accent-light); }

.widget .post-date {
  font-size: 0.75rem;
  color: var(--text-subtle);
  flex-shrink: 0;
}

/* Category/archive counts */
.widget ul li a .count,
.widget_categories .count,
.widget_archive .count { color: var(--text-subtle); font-size: 0.75rem; }

/* Built-in WP widget nesting */
.widget_categories ul ul,
.widget_pages ul ul { padding-left: 0.85rem; margin-top: 0.25rem; }

/* ─── Search form ────────────────────────────────────────────── */
.search-form {
  display: flex;
  gap: 0.5rem;
}

.search-form label {
  display: contents;
}

.search-field {
  flex: 1;
  min-width: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.875rem;
  outline: none;
  transition: border-color var(--ease);
}
.search-field:focus { border-color: var(--accent); }
.search-field::placeholder { color: var(--text-subtle); }

.search-submit {
  background: var(--accent-dim);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.9rem;
  color: var(--accent-light);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background var(--ease);
  white-space: nowrap;
}
.search-submit:hover { background: rgba(138, 170, 156, 0.2); }

/* ─── Comments area ──────────────────────────────────────────── */
.comments-area {
  margin-top: 3rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--border);
}

.comments-title {
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
  color: var(--text-muted);
}

.comment-list { list-style: none; }

.comment {
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}

.comment-author { font-weight: 600; font-size: 0.9rem; color: var(--accent-light); }
.comment-metadata { font-size: 0.75rem; color: var(--text-subtle); margin: 0.2rem 0 0.6rem; }
.comment-content { font-size: 0.95rem; color: var(--text-muted); }

/* Comment form */
.comment-reply-title { font-size: 1rem; margin-bottom: 1rem; }

.comment-form label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
  letter-spacing: 0.03em;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.85rem;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.9rem;
  outline: none;
  transition: border-color var(--ease);
  margin-bottom: 1rem;
}

.comment-form input:focus,
.comment-form textarea:focus { border-color: var(--accent); }

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

.comment-form .form-submit input[type="submit"] {
  background: var(--accent-dim);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-sm);
  padding: 0.6rem 1.5rem;
  color: var(--accent-light);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.875rem;
  cursor: pointer;
  transition: background var(--ease);
}
.comment-form .form-submit input[type="submit"]:hover { background: rgba(138, 170, 156, 0.22); }

/* ─── Spotify embed ──────────────────────────────────────────── */
.spotify-embed {
  margin: 1.5rem 0;
  border-radius: var(--radius-md);
  overflow: hidden;
}

/* ─── Page layout ────────────────────────────────────────────── */
.page-article { max-width: 72ch; }

/* ─── 404 / no results ───────────────────────────────────────── */
.error-404,
.no-results { padding: 3rem 0; }

.page-title {
  font-size: 1.5rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}
.page-content { color: var(--text-muted); margin-bottom: 1.5rem; }
.page-content a { color: var(--accent); }

/* ─── Footer ─────────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem var(--gap);
  margin-top: 2rem;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer-copy { font-size: 0.8rem; color: var(--text-subtle); }

.footer-nav { display: flex; gap: 1.25rem; }
.footer-nav a {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: color var(--ease);
}
.footer-nav a:hover { color: var(--accent); }

/* ─── Screen reader text ─────────────────────────────────────── */
.screen-reader-text {
  clip: rect(1px, 1px, 1px, 1px);
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ─── WP alignment classes ───────────────────────────────────── */
.alignleft  { float: left; margin: 0.5rem 1.5rem 1rem 0; }
.alignright { float: right; margin: 0.5rem 0 1rem 1.5rem; }
.aligncenter { display: block; margin: 1.5rem auto; }
.wp-caption { max-width: 100%; }
.wp-caption-text { font-size: 0.8rem; color: var(--text-muted); text-align: center; margin-top: 0.4rem; }

/* ─── Responsive ─────────────────────────────────────────────── */
@media (max-width: 860px) {
  .site-main {
    grid-template-columns: 1fr;
  }
  .widget-area {
    position: static;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
  }
  .widget { margin-bottom: 0; }
}

@media (max-width: 600px) {
  .site-name { display: none; }
  .nav-menu li a { padding: 0.4rem 0.5rem; font-size: 0.8rem; }
  .hero-phrase { gap: 1rem; }
  .hero-phrase__left  { transform: translateY(-8px); }
  .hero-phrase__right { transform: translateY(8px);  }
  .hero-phrase__emphasis { font-size: 1.3rem; }
  .hero-phrase__context  { font-size: 0.7rem; }
  .hero-logo-img { width: 64px; }
  .post-navigation { grid-template-columns: 1fr; }
  .nav-next { align-items: flex-start; text-align: left; }
  .widget-area { grid-template-columns: 1fr; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}
