/*
Theme Name: Evadora
Theme URI: https://evadoraz.com
Author: Eva Zheng
Description: A well-edited personal site. Writing is the center of everything.
Version: 2.2.0
License: GNU General Public License v2 or later
Text Domain: evadora
*/

/* ── Fonts loaded via functions.php
   DM Sans — all typography, full weight range 100–900
   ───────────────────────────────────────────────── */

/* ══════════════════════════════════════════════
   VARIABLES — sage palette
══════════════════════════════════════════════ */
:root {
  --bg-primary:     #0F0E0C;
  --text-primary:   #F5F1EC;
  --text-headline:  #FFFCF7;
  --text-body:      #EDE8E1;
  --secondary-text: #8A9490;
  --accent:         #8BAFA5;
  --accent-hover:   #A3C4BB;
  --link:           #9DBAB1;
  --border:         rgba(139, 175, 165, 0.08);
  --border-dim:     rgba(139, 175, 165, 0.04);

  --font-display: 'DM Sans', -apple-system, sans-serif;
  --font-body:    'DM Sans', -apple-system, sans-serif;

  --max:    760px;
  --radius: 4px;
}

/* ══════════════════════════════════════════════
   LIGHT MODE
   Dark is default. .light class flips to warm paper.
══════════════════════════════════════════════ */
html.light {
  --bg-primary:     #FAF8F5;
  --text-primary:   #1C1E1D;
  --text-headline:  #0F100F;
  --text-body:      #1E2120;
  --secondary-text: #5E7275;
  --accent:         #3D7178;
  --accent-hover:   #2E5F66;
  --link:           #3D7178;
  --border:         rgba(78, 122, 110, 0.12);
  --border-dim:     rgba(78, 122, 110, 0.06);
}
html.light body { font-weight: 300; }

/* ══════════════════════════════════════════════
   LIFE MODE — galaxy palette, always overrides light/dark.
   Activated by html.life-mode (set in life.js).
══════════════════════════════════════════════ */
html.life-mode {
  --bg-primary:     #08070A;
  --text-primary:   #D4A853;
  --text-headline:  #F0EBE2;
  --text-body:      #D6CFC3;
  --secondary-text: #8A7A58;
  --accent:         #D4A853;
  --accent-hover:   #C8A050;
  --border:         rgba(212,168,83,0.1);
  --border-dim:     rgba(212,168,83,0.05);
}
html.life-mode body {
  background: var(--bg-primary);
  color: var(--text-headline);
  font-weight: 400;
}

/* ══════════════════════════════════════════════
   RESET & BASE
══════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

html { font-size: 17px; scroll-behavior: smooth; }

body {
  background: var(--bg-primary);
  color: var(--text-body);
  font-family: var(--font-body);
  font-weight: 300;
  line-height: 1.85;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ══════════════════════════════════════════════
   BACKGROUND LAYERS
   z-index stack (back to front):
     -1  .gradient-wash  — animated background
      0  #stars-canvas   — galaxy (life mode only)
     auto  content
══════════════════════════════════════════════ */

/* ── Galaxy canvas ─────────────────────────────── */
#stars-canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  transition: opacity 1.2s ease;
}
html.life-mode #stars-canvas { opacity: 1; }

/* ── Animated gradient wash ────────────────────── */
.gradient-wash {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  z-index: -1;
  background: linear-gradient(
    160deg,
    #0F0E0C 0%,
    #0F0E0C 30%,
    #101314 55%,
    #111415 80%,
    #111516 100%
  );
  background-size: 200% 200%;
  animation: gradientShift 35s ease-in-out infinite;
}

html.light .gradient-wash {
  background: linear-gradient(
    160deg,
    #FAF8F5 0%,
    #FAF8F5 30%,
    #F5F8F8 55%,
    #F1F6F6 80%,
    #EEF4F4 100%
  );
}

/* Stars canvas handles life-mode background */
html.life-mode .gradient-wash { display: none; }

@keyframes gradientShift {
  0%, 100% { background-position: 0% 0%; }
  25%       { background-position: 100% 0%; }
  50%       { background-position: 100% 100%; }
  75%       { background-position: 0% 100%; }
}

/* ── Grain (body::before) ──────────────────────────
   Paste grain rules here — migrated from Additional CSS.
   ─────────────────────────────────────────────────── */


/* ══════════════════════════════════════════════
   HEADER — centered magazine masthead
══════════════════════════════════════════════ */
.site-header {
  position: relative;
  text-align: center;
  padding: 3.25rem 2rem 1rem;
}

.site-title {
  display: block;
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 3rem;
  letter-spacing: 0.03em;
  line-height: 1;
  color: var(--text-primary);
  margin-bottom: 1.25rem;
  transition: opacity 0.15s, color 0.3s;
}
.site-title:hover { opacity: 0.8; }

.site-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  font-size: 0.68rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--secondary-text);
}

.nav-link { transition: color 0.15s; }
.nav-link:hover, .nav-link.current { color: var(--text-headline); }

/* ── Diamond toggle ─────────────────────────── */
.diamond-toggle {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  transition: transform 0.3s ease;
}
.diamond-toggle:hover  { transform: scale(1.25); }
.diamond-toggle:active { transform: scale(0.9); }
.diamond-toggle svg {
  width: 14px;
  height: 14px;
  transition: transform 0.5s ease, filter 0.5s ease;
  filter: drop-shadow(0 0 5px rgba(139, 175, 165, 0.3));
  animation: shimmer 3.5s ease-in-out infinite;
}
html.light .diamond-toggle svg {
  transform: rotate(45deg);
  filter: drop-shadow(0 0 5px rgba(61, 113, 120, 0.25));
}
.diamond-fill {
  transition: fill 0.5s ease;
  fill: var(--accent);
}
html.life-mode .diamond-fill { fill: #EDD38A; }
html.life-mode .diamond-toggle svg {
  filter: drop-shadow(0 0 5px rgba(212, 168, 83, 0.4));
}

@keyframes shimmer {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.55; }
}

/* ── TOC toggle — single posts only, below sidebar breakpoint ─── */
.nav-toggle { display: none; }

.nav-bar {
  display: block;
  width: 18px;
  height: 1.5px;
  background: var(--secondary-text);
  border-radius: 1px;
  transition: transform 0.22s ease, opacity 0.18s ease;
  transform-origin: center;
}

/* Show as a fixed pill in the top-right corner on single posts, mobile only */
@media (max-width: 640px) {
  body.single .nav-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 36px;
    height: 36px;
    padding: 8px;
    background: none;
    border: 1px solid var(--border);
    border-radius: 50%;
    cursor: pointer;
    position: fixed;
    right: 1.25rem;
    top: 1.25rem;
    z-index: 51;
  }
  body.single .nav-toggle.is-active { border-color: var(--accent); }
  body.single .nav-toggle.is-active .nav-bar:nth-child(1) {
    transform: translateY(3.25px) rotate(45deg);
  }
  body.single .nav-toggle.is-active .nav-bar:nth-child(2) {
    transform: translateY(-3.25px) rotate(-45deg);
  }
}

@media (min-width: 641px) {
  .nav-toggle { display: none !important; }
}

/* TOC mobile panel */
.toc-mobile {
  position: fixed;
  top: 0; left: 0; right: 0;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border);
  padding: 1.25rem 1.75rem;
  z-index: 50;
  max-height: 60vh;
  overflow-y: auto;
  display: none;
}
.toc-mobile.is-open { display: block; }

.toc-mobile-label {
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--secondary-text);
  margin-bottom: 0.85rem;
}

.toc-mobile-list { list-style: none; padding: 0; margin: 0; }

.toc-mobile-link {
  display: block;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--text-body);
  text-decoration: none;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--border-dim);
  transition: color 0.15s;
}
.toc-mobile-list li:last-child .toc-mobile-link { border-bottom: none; }
.toc-mobile-link:hover { color: var(--accent-hover); }

/* ══════════════════════════════════════════════
   LAYOUT
══════════════════════════════════════════════ */
.site-main { flex: 1; }

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

/* ══════════════════════════════════════════════
   HERO BIO
══════════════════════════════════════════════ */
.site-hero {
  padding: 2.5rem 0 1.5rem;
  text-align: center;
}

.hero-bio {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--text-body);
  text-align: left;
}
.hero-bio p + p { margin-top: 1rem; }

/* ══════════════════════════════════════════════
   SECTION LABEL
══════════════════════════════════════════════ */
.section-label {
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--secondary-text);
  margin-bottom: 1.5rem;
}

.section-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 3.5rem 0 2.25rem;
}

.section-divider::before,
.section-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.section-divider-text {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 0.95rem;
  color: var(--secondary-text);
  white-space: nowrap;
}

/* ══════════════════════════════════════════════
   POST LIST — essays on homepage
══════════════════════════════════════════════ */
.posts-section { padding-bottom: 1rem; }

/* Lead post */
.post-item--lead {
  padding-bottom: 2.25rem;
  border-bottom: 1px solid var(--border-dim);
}

.post-item--lead .post-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 2.1rem;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin-bottom: 0.5rem;
}

.post-item--lead .post-title a { transition: color 0.15s; }
.post-item--lead .post-title a:hover { color: var(--accent-hover); }

.post-item--lead .post-excerpt {
  font-size: 0.92rem;
  line-height: 1.75;
  color: var(--text-body);
  margin-bottom: 0.6rem;
}

.post-item--lead .post-meta {
  font-size: 0.72rem;
  color: var(--secondary-text);
}

/* Post list */
.post-list { list-style: none; }

.post-list-item {
  border-bottom: 1px solid var(--border-dim);
}

.post-list-item a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 0;
  transition: color 0.15s;
}

.post-list-item a:hover { color: var(--accent-hover); }

.post-list-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.1rem;
  line-height: 1.3;
  flex: 1;
}

.post-list-date {
  font-size: 0.72rem;
  color: var(--secondary-text);
  white-space: nowrap;
  flex-shrink: 0;
  font-family: var(--font-body);
  font-weight: 300;
}

/* ══════════════════════════════════════════════
   LIFE POSTS — locked state (homepage)
══════════════════════════════════════════════ */
.post-list--life .post-list-item { border-bottom-color: var(--border-dim); }

.post-item--locked { cursor: pointer; }

.post-item--locked > div,
.post-item--locked > a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 0;
  color: var(--text-body);
  transition: color 0.2s;
}

.post-item--locked:hover > div,
.post-item--locked:hover > a { color: var(--accent-hover); }

.life-post-gem {
  font-size: 0.6rem;
  color: var(--secondary-text);
  flex-shrink: 0;
  line-height: 1.75;
  transition: color 0.2s;
}

.post-item--locked:hover .life-post-gem { color: var(--accent-hover); }

.post-item--revealed > div,
.post-item--revealed > a {
  color: var(--text-headline);
  animation: fadeReveal 0.5s ease forwards;
}

.post-item--revealed .life-post-gem { color: var(--accent); }

@keyframes fadeReveal {
  from { opacity: 0.4; }
  to   { opacity: 1; }
}

/* ══════════════════════════════════════════════
   LIFE SECTION — homepage gold accents
   Locked post titles + section divider
══════════════════════════════════════════════ */
.section-divider-text              { color: #C8960A; }

.post-list--life .life-post-gem    { color: #B8860A; }
.post-list--life .post-item--locked > div { color: #7A5828; }
.post-list--life .post-item--locked:hover > div { color: #C8960A; }
.post-list--life .post-item--locked:hover .life-post-gem { color: #E8A030; }
.post-list--life .post-item--revealed .life-post-gem { color: #C8960A; }

/* ══════════════════════════════════════════════
   RIDDLE BLOCK — inline, appears after clicked item
══════════════════════════════════════════════ */
.riddle-block {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transform: translateY(-4px);
  transition:
    max-height 0.35s ease,
    opacity    0.3s  ease,
    transform  0.3s  ease,
    padding    0.3s  ease;
  padding: 0 1.5rem;
  border: 1px dashed transparent;
  border-radius: var(--radius);
  margin: 0;
}

.riddle-block.visible {
  max-height: 200px;
  opacity: 1;
  transform: translateY(0);
  padding: 1.35rem 1.5rem;
  border-color: #B8860A;
  background: #0A0805;
  margin: 0.15rem 0 0.25rem;
}

.riddle-block.dissolve {
  max-height: 0;
  opacity: 0;
  padding: 0 1.5rem;
  border-color: transparent;
}

.riddle-question {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 1.05rem;
  color: #E8C86A;
  margin-bottom: 0.9rem;
  line-height: 1.4;
}

.riddle-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.riddle-input {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 0.87rem;
  padding: 0.5rem 0.85rem;
  border: 1px solid #2A1E08;
  border-radius: var(--radius);
  background: #141008;
  color: #E8C86A;
  outline: none;
  width: 200px;
  transition: border-color 0.2s;
}

.riddle-input::placeholder { color: #3A2A10; }
.riddle-input:focus { border-color: #C8960A; }

.riddle-btn {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.5rem 1rem;
  background: #C8960A;
  color: #0A0805;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: opacity 0.15s;
}

.riddle-btn:hover { opacity: 0.85; }

.riddle-error {
  font-size: 0.75rem;
  color: #E8A030;
  margin-top: 0.6rem;
  display: none;
}

.riddle-error.visible { display: block; }
.riddle-block.shake { animation: riddleShake 0.45s ease; }

@keyframes riddleShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-5px); }
  40%, 80% { transform: translateX(5px); }
}

/* ══════════════════════════════════════════════
   FULL POST CONTENT (single.php)
══════════════════════════════════════════════ */
.single-post { padding: 4rem 0 5rem; }

.back-link {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--secondary-text);
  margin-bottom: 2.5rem;
  transition: color 0.15s;
}
.back-link:hover { color: var(--accent-hover); }

.post-title-large {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 2.75rem;
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin-bottom: 0.5rem;
  color: var(--text-headline);
}

.post-meta-line {
  font-size: 0.72rem;
  color: var(--secondary-text);
  margin-bottom: 3rem;
}

.post-content { color: var(--text-body); }
.post-content p { margin-bottom: 1.4rem; }

.post-content h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.9rem;
  line-height: 1.2;
  margin: 2.75rem 0 0.85rem;
}

.post-content h3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.45rem;
  line-height: 1.2;
  margin: 2rem 0 0.7rem;
}

.post-content h4 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.2rem;
  line-height: 1.2;
  margin: 1.75rem 0 0.6rem;
}

.post-content h5 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.2;
  margin: 1.5rem 0 0.5rem;
}

.post-content h6 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 0.875rem;
  line-height: 1.2;
  margin: 1.25rem 0 0.4rem;
}

/* Heading color hierarchy */
.article-body h1,
.article-body h2 { color: var(--text-headline); }
.article-body h3,
.article-body h4 { color: var(--text-body); }
.article-body h5,
.article-body h6 { color: var(--secondary-text); }

/* Inline links in article body */
.post-content a {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--border);
  transition: color 0.15s, text-decoration-color 0.15s;
}
.post-content a:hover {
  color: var(--accent-hover);
  text-decoration-color: var(--accent-hover);
}

.post-content blockquote {
  border-left: 2px solid var(--accent);
  padding-left: 1.25rem;
  margin: 1.75rem 0;
  font-family: var(--font-display);
  font-weight: 300;
  font-style: italic;
  font-size: 1.1rem;
  color: var(--text-body);
  line-height: 1.65;
}

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

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

.post-content img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius);
  margin: 1.75rem 0;
}

.post-content figure { margin: 1.75rem 0; }
.post-content figure img { margin: 0; }

.post-content figcaption,
.post-content .wp-caption-text {
  font-size: 0.75rem;
  color: var(--secondary-text);
  font-style: italic;
  margin-top: 0.5rem;
}

.post-content .wp-caption { max-width: 100% !important; }

.post-thumbnail {
  margin: 1.75rem 0 2.5rem;
}
.post-thumbnail img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius);
}

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

/* ══════════════════════════════════════════════
   TABLE OF CONTENTS
   Mobile: hidden. Desktop (≥1101px): fixed left gutter.
══════════════════════════════════════════════ */
.toc { display: none; }

@media (min-width: 1101px) {
  .article-container .single-post {
    margin-left: clamp(120px, 14vw, 260px);
  }

  .toc {
    display: block;
    position: fixed;
    top: 160px;
    width: 220px;
    z-index: 10;
  }
}

.toc-label {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--secondary-text);
  margin-bottom: 16px;
}

.toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
  position: relative;
  left: -13px;
}

.toc-item {
  position: relative;
  padding: 7px 0 7px 14px;
}

.toc-item::before {
  content: '';
  position: absolute;
  left: 0; top: 7px; bottom: 7px;
  width: 1.5px;
  background: var(--accent);
  opacity: 0;
  border-radius: 1px;
  transition: opacity 0.35s ease;
}

.toc-item.active::before { opacity: 1; }

.toc-link {
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.3;
  color: var(--secondary-text);
  text-decoration: none;
  transition: color 0.3s ease;
  display: block;
}

.toc-item.active .toc-link,
.toc-link:hover { color: var(--text-body); }

/* Post navigation */
.post-nav {
  margin-top: 3.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-dim);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.8rem;
  color: var(--secondary-text);
}

.post-nav a { transition: color 0.15s; }
.post-nav a:hover { color: var(--accent-hover); }

/* ══════════════════════════════════════════════
   ESSAYS PAGE
══════════════════════════════════════════════ */
.page-essays { padding: 4rem 0 5rem; }

.page-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 2.75rem;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
  color: var(--text-headline);
}

.page-subtitle {
  font-size: 0.82rem;
  color: var(--text-body);
  margin-bottom: 3rem;
}

/* Featured post */
.essays-featured {
  padding-top: 0;
}

/* "Latest" label — same treatment as "Earlier" */
.essays-featured-label {
  font-family: var(--font-body);
  font-size: 0.6rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--secondary-text);
  margin-bottom: 20px;
}

.essays-featured-title {
  font-family: var(--font-body);
  font-size: 2rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin-bottom: 14px;
}

.essays-featured-title a {
  color: var(--text-headline);
  text-decoration: none;
  transition: color 0.15s;
}

.essays-featured-title a:hover { color: var(--accent-hover); }

.essays-featured-date {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--secondary-text);
  letter-spacing: 0.02em;
  margin-bottom: 18px;
}

.essays-featured-excerpt {
  font-family: var(--font-body);
  font-size: 1.15rem;
  font-weight: 300;
  line-height: 1.6;
  color: var(--text-body);
  margin-bottom: 20px;
}

.essays-featured-excerpt p { margin: 0; }

.essays-featured-read {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--accent);
  text-decoration: none;
  transition: color 0.15s;
}

.essays-featured-read:hover { color: var(--accent-hover); }

.essays-featured-read .arrow {
  display: inline-block;
  transition: transform 0.2s ease;
}

.essays-featured-read:hover .arrow { transform: translateX(3px); }

/* Older posts — "Earlier" label same as "Latest" */
.essays-older { padding-top: 48px; }

.essays-older-label {
  display: block;
  font-family: var(--font-body);
  font-size: 0.6rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--secondary-text);
  margin-bottom: 24px;
}

.essays-older-list { list-style: none; padding: 0; margin: 0; }

.essays-older-item {
  border-bottom: 1px solid var(--border-dim);
  transition: border-color 0.15s;
}

.essays-older-item:first-child {
  border-top: 1px solid var(--border-dim);
}

.essays-older-item:hover { border-bottom-color: var(--border); }
.essays-older-item:first-child:hover { border-top-color: var(--border); }

.essays-older-link {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  text-decoration: none;
  color: inherit;
}

.essays-older-title {
  font-family: var(--font-body);
  font-size: 1.2rem;
  font-weight: 400;
  color: var(--text-body);
  line-height: 1.3;
  transition: color 0.15s;
}

.essays-older-link:hover .essays-older-title { color: var(--text-headline); }

.essays-older-date {
  font-family: var(--font-body);
  font-size: 0.68rem;
  font-weight: 400;
  color: var(--secondary-text);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ══════════════════════════════════════════════
   LIFE PAGE — gate + posts
══════════════════════════════════════════════ */
.page-life { padding: 4rem 0 5rem; }

.life-gate-center {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  padding: 3rem 2rem;
  position: relative;
  z-index: 1;
}

.gate-box {
  position: relative;
  background: rgba(212,168,83,0.025);
  border: 1px solid rgba(212,168,83,0.1);
  border-radius: 8px;
  padding: 40px 40px 36px;
  margin: 0 auto 56px;
  max-width: 480px;
  width: 100%;
  text-align: center;
  transition: border-color 0.4s ease, box-shadow 0.4s ease;
  box-shadow:
    inset 0 0 40px rgba(212,168,83,0.02),
    0 0 0 1px rgba(212,168,83,0.03);
}

.gate-box:hover,
.gate-box:focus-within {
  border-color: rgba(212,168,83,0.2);
  box-shadow:
    inset 0 0 60px rgba(212,168,83,0.035),
    0 0 30px rgba(212,168,83,0.04),
    0 0 0 1px rgba(212,168,83,0.06);
}

.gate-box::before,
.gate-box::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border-color: rgba(212,168,83,0.18);
  border-style: solid;
  transition: border-color 0.4s ease;
}

.gate-box::before {
  top: -1px; left: -1px;
  border-width: 1px 0 0 1px;
  border-radius: 8px 0 0 0;
}

.gate-box::after {
  bottom: -1px; right: -1px;
  border-width: 0 1px 1px 0;
  border-radius: 0 0 8px 0;
}

.gate-box:hover::before,
.gate-box:hover::after,
.gate-box:focus-within::before,
.gate-box:focus-within::after {
  border-color: rgba(212,168,83,0.35);
}

.gate-box.shake { animation: gateShake 0.45s ease; }

@keyframes gateShake {
  0%,100% { transform: translateX(0); }
  20%,60% { transform: translateX(-6px); }
  40%,80% { transform: translateX(6px); }
}

.gate-question {
  font-family: var(--font-body);
  font-size: 1.05rem;
  font-weight: 300;
  color: #BFA06A;
  margin-bottom: 24px;
  line-height: 1.4;
}

.gate-input-row {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  max-width: 280px;
  margin: 0 auto;
}

.gate-input {
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(212,168,83,0.15);
  border-radius: 0;
  padding: 8px 28px 8px 0;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 300;
  color: #BFA06A;
  width: 100%;
  outline: none;
  transition: border-color 0.4s ease;
}

.gate-input::placeholder { color: #8A7A58; opacity: 0.35; }
.gate-input:focus { border-bottom-color: rgba(212,168,83,0.4); }

.gate-submit {
  position: absolute;
  right: 0;
  bottom: 8px;
  background: transparent;
  border: none;
  cursor: pointer;
  opacity: 0.3;
  transition: opacity 0.3s ease, transform 0.2s ease;
  padding: 0;
  display: flex;
  align-items: center;
}

.gate-submit:hover { opacity: 0.6; transform: translateX(2px); }
.gate-input:focus ~ .gate-submit { opacity: 0.5; }
.gate-submit svg { width: 16px; height: 16px; }

.life-post-list .post-list-item .post-list-title { color: var(--accent); }
.life-post-list .post-list-item a:hover { color: #D4A853; }

.life-lock-btn {
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--secondary-text);
  cursor: pointer;
  transition: color 0.15s;
  background: none;
  border: none;
  font-family: var(--font-body);
  padding: 0;
}
.life-lock-btn:hover { color: var(--accent-hover); }

/* ══════════════════════════════════════════════
   FOOTER
══════════════════════════════════════════════ */
.site-footer {
  padding: 2.5rem 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  border-top: 1px solid var(--border-dim);
}

.social-link {
  display: flex;
  align-items: center;
  color: var(--secondary-text);
  transition: color 0.15s;
}

.social-link:hover { color: var(--text-primary); }

.social-link svg {
  width: 17px;
  height: 17px;
}

/* ══════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════ */
@media (max-width: 640px) {
  .site-title { font-size: 2.75rem; }
  .hero-bio { font-size: 0.95rem; }
  .essays-featured-title { font-size: 1.55rem; }
  .post-title-large { font-size: 2.1rem; }
  .riddle-input { width: 140px; }
}
