/*
Theme Name: ourghost
Theme URI: https://ourghost.com
Author: tocull5
Description: A dark, introspective theme with hidden easter eggs. What we leave behind.
Version: 1.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: ourghost
*/

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

:root {
  --bg: #0a0a0c;
  --fg: #e8e5de;
  --fg-dim: #9a9590;
  --fg-ghost: #4a4540;
  --accent: #d4b892;
  --accent-dim: rgba(212, 184, 146, 0.2);
  --void: #060608;
  --serif: 'Cormorant Garamond', Georgia, serif;
  --mono: 'Space Mono', monospace;
}

html { font-size: 16px; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--serif);
  min-height: 100vh;
  overflow-x: hidden;
  cursor: default;
  position: relative;
}

/* ── Grain overlay ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9999;
}

/* ── Ghost cursor trail ── */
.cursor-ghost {
  position: fixed;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  pointer-events: none;
  z-index: 9998;
  opacity: 0;
  transition: none;
  mix-blend-mode: screen;
}

/* ── Ambient floating particles ── */
.particle {
  position: fixed;
  width: 2px;
  height: 2px;
  background: var(--fg-dim);
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  z-index: 1;
}

/* ── Navigation ── */
nav.site-nav {
  position: fixed;
  top: 0;
  width: 100%;
  padding: 2rem 3rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 100;
  mix-blend-mode: difference;
}

.logo {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--fg-dim);
  text-decoration: none;
  transition: color 1.2s ease;
  position: relative;
}

.logo:hover { color: var(--accent); }

.logo::after {
  content: attr(data-clicks);
  position: absolute;
  right: -1.5rem;
  top: -0.3rem;
  font-size: 0.5rem;
  color: var(--fg-ghost);
  opacity: 0;
  transition: opacity 0.6s;
}

.logo.clicked::after { opacity: 1; }

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

.nav-links a {
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: lowercase;
  color: var(--fg-dim);
  text-decoration: none;
  transition: color 0.8s ease;
  position: relative;
}

.nav-links a::before {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.nav-links a:hover { color: var(--fg); }
.nav-links a:hover::before { width: 100%; }

/* ── Hero section ── */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
  padding: 2rem;
}

.hero-title {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(3rem, 8vw, 8rem);
  line-height: 0.95;
  letter-spacing: -0.03em;
  color: var(--fg);
  text-align: center;
  opacity: 0;
  animation: fadeIn 3s ease 0.5s forwards;
  position: relative;
  user-select: none;
}

.hero-title .ghost-letter {
  display: inline-block;
  transition: all 1.5s cubic-bezier(0.22, 1, 0.36, 1);
  cursor: default;
}

.hero-title .ghost-letter:hover {
  opacity: 0.15;
  transform: translateY(-8px);
  color: var(--accent);
  text-shadow: 0 20px 40px rgba(196, 168, 130, 0.2);
}

.tagline {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.4em;
  color: var(--fg-ghost);
  margin-top: 3rem;
  opacity: 0;
  animation: fadeIn 2s ease 2s forwards;
  text-transform: lowercase;
  transition: color 4s ease;
}

.tagline:hover { color: var(--fg-dim); }

.patience-reward {
  position: absolute;
  bottom: 15%;
  font-family: var(--mono);
  font-size: 0.6rem;
  color: var(--fg-ghost);
  opacity: 0;
  transition: opacity 6s ease;
  letter-spacing: 0.15em;
  pointer-events: none;
}

.patience-reward.visible { opacity: 1; }

/* ── Divider ── */
.divider {
  width: 1px;
  height: 120px;
  background: linear-gradient(to bottom, transparent, var(--fg-ghost), transparent);
  margin: 0 auto;
}

/* ── Sections ── */
.section {
  padding: 8rem 3rem;
  max-width: 800px;
  margin: 0 auto;
  position: relative;
}

.section-question {
  font-family: var(--serif);
  font-weight: 300;
  font-style: italic;
  font-size: clamp(1.8rem, 4vw, 3.2rem);
  line-height: 1.35;
  color: var(--fg);
  opacity: 0;
  transform: translateY(40px);
  transition: all 1.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.section-question.visible {
  opacity: 1;
  transform: translateY(0);
}

.section-body {
  font-family: var(--serif);
  font-weight: 300;
  font-size: 1.15rem;
  line-height: 1.9;
  color: var(--fg-dim);
  margin-top: 2.5rem;
  opacity: 0;
  transform: translateY(30px);
  transition: all 1.5s cubic-bezier(0.22, 1, 0.36, 1) 0.3s;
}

.section-body.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── WordPress post styling ── */
.posts-section {
  padding: 6rem 3rem;
  max-width: 800px;
  margin: 0 auto;
}

.posts-section-title {
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.5em;
  text-transform: uppercase;
  color: var(--fg-ghost);
  text-align: center;
  margin-bottom: 4rem;
}

.post-entry {
  padding: 3rem 0;
  border-bottom: 1px solid var(--fg-ghost);
}

.post-entry:last-child { border-bottom: none; }

.post-entry a {
  text-decoration: none;
  color: inherit;
}

.post-entry-title {
  font-family: var(--serif);
  font-weight: 300;
  font-style: italic;
  font-size: 1.8rem;
  color: var(--fg);
  transition: color 0.8s ease;
  margin-bottom: 0.8rem;
}

.post-entry-title:hover { color: var(--accent); }

.post-entry-meta {
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  color: var(--fg-ghost);
  margin-bottom: 1.2rem;
}

.post-entry-excerpt {
  font-family: var(--serif);
  font-weight: 300;
  font-size: 1rem;
  line-height: 1.8;
  color: var(--fg-dim);
}

/* ── Single post styling ── */
.single-post-content {
  padding: 10rem 3rem 6rem;
  max-width: 700px;
  margin: 0 auto;
}

.single-post-content h1 {
  font-family: var(--serif);
  font-weight: 300;
  font-style: italic;
  font-size: clamp(2rem, 5vw, 3.5rem);
  color: var(--fg);
  margin-bottom: 1rem;
  line-height: 1.2;
}

.single-post-content .post-meta {
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  color: var(--fg-ghost);
  margin-bottom: 3rem;
}

.single-post-content .post-body {
  font-family: var(--serif);
  font-weight: 300;
  font-size: 1.15rem;
  line-height: 1.9;
  color: var(--fg-dim);
}

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

.single-post-content .post-body a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid var(--accent-dim);
  transition: border-color 0.6s ease;
}

.single-post-content .post-body a:hover {
  border-color: var(--accent);
}

.single-post-content .post-body img {
  max-width: 100%;
  height: auto;
  margin: 2rem 0;
  opacity: 0.85;
  transition: opacity 0.6s ease;
}

.single-post-content .post-body img:hover { opacity: 1; }

/* ── Void zone ── */
.void-zone {
  height: 300px;
  position: relative;
  cursor: default;
  display: flex;
  align-items: center;
  justify-content: center;
}

.void-zone .void-text {
  font-family: var(--mono);
  font-size: 0.6rem;
  color: transparent;
  letter-spacing: 0.3em;
  transition: color 3s ease;
  user-select: none;
}

.void-zone:hover .void-text { color: var(--fg-ghost); }

.void-zone .hidden-room {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 1rem;
  background: var(--void);
  opacity: 0;
  pointer-events: none;
  transition: opacity 2s ease;
  border: 1px solid var(--fg-ghost);
}

.void-zone .hidden-room.open {
  opacity: 1;
  pointer-events: all;
}

.hidden-room p {
  font-family: var(--mono);
  font-size: 0.65rem;
  color: var(--accent);
  letter-spacing: 0.2em;
  text-align: center;
  line-height: 2.2;
}

/* ── Memory wall ── */
.memory-wall {
  padding: 6rem 2rem;
  position: relative;
  overflow: hidden;
  min-height: 60vh;
}

.memory-wall-title {
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.5em;
  text-transform: uppercase;
  color: var(--fg-ghost);
  text-align: center;
  margin-bottom: 4rem;
}

.memory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1px;
  background: var(--fg-ghost);
  max-width: 900px;
  margin: 0 auto;
}

.memory-cell {
  aspect-ratio: 1;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: background 1.5s ease;
}

.memory-cell::before {
  content: attr(data-symbol);
  font-family: var(--serif);
  font-size: 1.8rem;
  color: var(--fg-ghost);
  transition: all 1.2s cubic-bezier(0.22, 1, 0.36, 1);
  position: absolute;
}

.memory-cell:hover::before {
  color: var(--accent);
  transform: scale(1.3);
  text-shadow: 0 0 30px var(--accent-dim);
  opacity: 0.1;
}

.memory-cell .cell-text {
  font-family: var(--mono);
  font-size: 0.55rem;
  color: var(--fg-dim);
  letter-spacing: 0.15em;
  text-align: center;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.8s ease;
  line-height: 1.8;
  position: relative;
  z-index: 2;
}

.memory-cell:hover .cell-text {
  opacity: 1;
  transform: translateY(0);
}

/* ── Séance (Ghost Chat) ── */
.seance-section {
  padding: 8rem 2rem;
  max-width: 800px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.seance-title {
  font-family: var(--serif);
  font-weight: 300;
  font-style: italic;
  font-size: clamp(2rem, 4vw, 3.2rem);
  letter-spacing: 0.05em;
  color: var(--fg);
  text-align: center;
  margin-bottom: 0.8rem;
}

.seance-subtitle {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--fg-dim);
  text-align: center;
  margin-bottom: 3rem;
  letter-spacing: 0.2em;
  transition: color 2s ease;
}

.seance-log {
  width: 100%;
  max-height: 500px;
  min-height: 200px;
  overflow-y: auto;
  margin-bottom: 2.5rem;
  padding: 2rem;
  border: 1px solid var(--fg-ghost);
  border-radius: 2px;
  background: rgba(6, 6, 8, 0.5);
  display: flex;
  flex-direction: column;
  gap: 2rem;
  scrollbar-width: thin;
  scrollbar-color: var(--fg-ghost) transparent;
}

.seance-log::-webkit-scrollbar {
  width: 3px;
}

.seance-log::-webkit-scrollbar-thumb {
  background: var(--fg-ghost);
  border-radius: 2px;
}

.seance-message {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  opacity: 0;
  animation: seanceFadeIn 1.5s ease forwards;
}

.seance-speaker {
  font-family: var(--serif);
  font-size: 1.3rem;
  color: var(--fg-ghost);
  flex-shrink: 0;
  width: 1.5rem;
  text-align: center;
  line-height: 1.6;
}

.ghost-msg .seance-speaker { color: var(--accent); }

.seance-text {
  font-family: var(--serif);
  font-weight: 300;
  font-size: 1.2rem;
  line-height: 1.8;
  color: var(--fg-dim);
}

.ghost-msg .seance-text {
  color: var(--fg);
  font-style: italic;
}

.user-msg .seance-text {
  color: var(--fg-dim);
}

.seance-input-row {
  width: 100%;
  position: relative;
}

.seance-input {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--fg-ghost);
  padding: 1rem 0;
  font-family: var(--serif);
  font-size: 1.2rem;
  color: var(--fg);
  outline: none;
  letter-spacing: 0.03em;
  caret-color: var(--accent);
  transition: border-color 1s ease;
}

.seance-input::placeholder {
  color: var(--fg-ghost);
  font-style: italic;
}

.seance-input:focus {
  border-color: var(--fg-dim);
}

.seance-input:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.seance-sending {
  position: absolute;
  right: 0;
  bottom: 1.2rem;
  font-family: var(--mono);
  font-size: 1rem;
  color: var(--accent);
  opacity: 0;
  transition: opacity 0.6s ease;
}

.seance-sending.active { opacity: 1; }

.seance-dot {
  animation: seancePulse 1.4s infinite;
  display: inline-block;
}

.seance-dot:nth-child(2) { animation-delay: 0.2s; }
.seance-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes seancePulse {
  0%, 80%, 100% { opacity: 0.2; }
  40% { opacity: 1; }
}

@keyframes seanceFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.seance-offline {
  font-family: var(--mono);
  font-size: 0.65rem;
  color: var(--fg-dim);
  letter-spacing: 0.15em;
  margin-top: 1.5rem;
  min-height: 1rem;
  text-align: center;
}

/* ── Whisper section ── */
.whisper-section {
  padding: 8rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}

.whisper-prompt {
  font-family: var(--serif);
  font-weight: 300;
  font-style: italic;
  font-size: 1.4rem;
  color: var(--fg-ghost);
  transition: color 2s ease;
}

.whisper-input {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--fg-ghost);
  padding: 0.8rem 0;
  font-family: var(--serif);
  font-size: 1.1rem;
  font-style: italic;
  color: var(--fg);
  width: 300px;
  text-align: center;
  outline: none;
  letter-spacing: 0.05em;
  caret-color: var(--accent);
  transition: border-color 1s ease;
}

.whisper-input::placeholder {
  color: var(--fg-ghost);
  font-style: italic;
}

.whisper-input:focus { border-color: var(--fg-dim); }

.whisper-response {
  font-family: var(--mono);
  font-size: 0.6rem;
  color: var(--fg-ghost);
  letter-spacing: 0.2em;
  min-height: 1.5rem;
  transition: color 2s ease;
  text-align: center;
  max-width: 400px;
  line-height: 2;
}

/* ── Konami ── */
.konami-hint {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--mono);
  font-size: 0.5rem;
  color: transparent;
  letter-spacing: 0.3em;
  transition: color 8s ease;
  pointer-events: none;
  z-index: 100;
}

body.idle .konami-hint { color: var(--fg-ghost); }

body.konami-active { animation: konamiShift 10s ease infinite; }

@keyframes konamiShift {
  0%, 100% { filter: hue-rotate(0deg); }
  50% { filter: hue-rotate(30deg); }
}

.konami-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, transparent 0%, var(--void) 70%);
  z-index: 9990;
  pointer-events: none;
  opacity: 0;
  transition: opacity 3s ease;
}

body.konami-active .konami-overlay { opacity: 0.6; }

/* ── Scroll progress ── */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 1px;
  background: var(--accent);
  opacity: 0.15;
  z-index: 9999;
  transition: width 0.1s linear;
}

/* ── Footer ── */
footer.site-footer {
  padding: 4rem 3rem;
  text-align: center;
  position: relative;
}

.footer-line {
  font-family: var(--mono);
  font-size: 0.55rem;
  letter-spacing: 0.3em;
  color: var(--fg-ghost);
  cursor: default;
  transition: color 3s ease;
}

.footer-line:hover { color: var(--fg-dim); }

.footer-secret {
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.8rem;
  color: transparent;
  margin-top: 2rem;
  transition: color 5s ease;
  user-select: none;
}

footer.site-footer.lingered .footer-secret { color: var(--fg-ghost); }

/* ── Page / 404 ── */
.page-content {
  padding: 10rem 3rem 6rem;
  max-width: 700px;
  margin: 0 auto;
}

.page-content h1 {
  font-family: var(--serif);
  font-weight: 300;
  font-style: italic;
  font-size: clamp(2rem, 5vw, 3.5rem);
  color: var(--fg);
  margin-bottom: 2rem;
}

.page-content .entry-content {
  font-family: var(--serif);
  font-weight: 300;
  font-size: 1.15rem;
  line-height: 1.9;
  color: var(--fg-dim);
}

.page-content .entry-content p { margin-bottom: 1.5rem; }

.page-content .entry-content img {
  max-width: 100%;
  height: auto;
  margin: 2rem 0;
  opacity: 0.85;
}

.four-oh-four {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
}

.four-oh-four h1 {
  font-family: var(--serif);
  font-weight: 300;
  font-size: 5rem;
  color: var(--fg-ghost);
}

.four-oh-four p {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--fg-dim);
  letter-spacing: 0.2em;
  margin-top: 1rem;
}

.four-oh-four a {
  color: var(--accent);
  text-decoration: none;
}

/* ── Keyframes ── */
@keyframes fadeIn { to { opacity: 1; } }

@keyframes float {
  0%, 100% { transform: translateY(0) translateX(0); opacity: 0; }
  10% { opacity: 0.4; }
  90% { opacity: 0.4; }
  100% { transform: translateY(-100vh) translateX(20px); opacity: 0; }
}

/* ── Mobile ── */
@media (max-width: 600px) {
  nav.site-nav { padding: 1.5rem; }
  .nav-links { gap: 1.5rem; }
  .section { padding: 5rem 1.5rem; }
  .memory-grid { grid-template-columns: repeat(2, 1fr); }
  .whisper-input { width: 240px; }
  .seance-section { padding: 4rem 1.5rem; }
  .seance-log { max-height: 300px; }
  .single-post-content,
  .page-content { padding: 8rem 1.5rem 4rem; }
}
