/* ============ Design tokens — change colours here ============ */
:root {
  --bg: #070710;
  --text: #ecebff;
  --muted: #a7a5c9;
  --accent: #8b7bff;
  --accent-2: #ff7ad9;
  --glass: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.14);
  --display: "Cormorant Garamond", Georgia, serif;
  --body: "Inter", system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; background: var(--bg); }
body {
  font-family: var(--body);
  color: var(--text);
  background: transparent;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }

/* ============ 3D canvas sits behind everything ============ */
#scene { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -1; display: block; }
.no-webgl body {
  background: radial-gradient(circle at 30% 20%, #251a5a, var(--bg) 60%);
  background-attachment: fixed;
}

/* ============ Loader + progress ============ */
#loader {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center;
  background: var(--bg); color: var(--muted); letter-spacing: .3em; text-transform: uppercase;
  font-size: .8rem; transition: opacity .9s ease, visibility .9s;
}
.ready #loader { opacity: 0; visibility: hidden; }
#progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 100%; z-index: 60;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transform: scaleX(0); transform-origin: left;
}

/* ============ Navigation ============ */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; justify-content: space-between; align-items: center;
  padding: 1.1rem 6vw; backdrop-filter: blur(10px);
  background: linear-gradient(to bottom, rgba(7,7,16,.7), transparent);
}
.brand { font-family: var(--display); font-size: 1.5rem; font-weight: 700; letter-spacing: .04em; }
.nav nav { display: flex; gap: 1.6rem; font-size: .9rem; color: var(--muted); }
.nav nav a:hover { color: var(--text); }

/* ============ Hero ============ */
.hero {
  min-height: 100svh; display: grid; place-content: center; text-align: center; padding: 0 6vw;
}
.eyebrow { letter-spacing: .35em; text-transform: uppercase; font-size: .78rem; color: var(--muted); animation: rise 1.2s .3s both; }
.hero h1 {
  font-family: var(--display); font-size: clamp(3.6rem, 15vw, 10.5rem); line-height: 1;
  background: linear-gradient(120deg, #fff 10%, var(--accent) 55%, var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: rise 1.4s .5s both;
}
.tagline { font-family: var(--display); font-style: italic; font-size: clamp(1.2rem, 3vw, 1.9rem); color: var(--muted); margin-top: .8rem; animation: rise 1.4s .8s both; }
.hint { margin-top: 3rem; font-size: .85rem; color: var(--muted); animation: rise 1.4s 1.2s both, bob 2.4s 2.6s ease-in-out infinite; }
@keyframes rise { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: none; } }
@keyframes bob { 50% { transform: translateY(8px); } }

/* ============ Chapters ============ */
.chapter { min-height: 100svh; display: flex; align-items: center; padding: 0 6vw; }
.chapter.left { justify-content: flex-start; }
.chapter.right { justify-content: flex-end; }

.reveal { opacity: 0; transform: translateY(44px); transition: opacity .9s ease, transform .9s cubic-bezier(.2,.7,.2,1); }
.reveal.in { opacity: 1; transform: none; }

.card {
  max-width: 470px; padding: 2rem 2.1rem; border-radius: 22px;
  background: var(--glass); border: 1px solid var(--border);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 20px 60px rgba(0,0,0,.35);
}
.tilt {
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform .18s ease-out;
}
.card .year { font-size: .75rem; letter-spacing: .3em; text-transform: uppercase; color: var(--accent-2); }
.card h2 { font-family: var(--display); font-size: 2.3rem; line-height: 1.1; margin: .4rem 0 .8rem; }
.card p { color: var(--muted); font-weight: 300; }

/* ============ Blocks (journal / contact) ============ */
.block { padding: 18vh 6vw 10vh; max-width: 1200px; margin: 0 auto; }
.block.center { text-align: center; }
.section-title { font-family: var(--display); font-size: clamp(2.6rem, 7vw, 4.5rem); margin-bottom: 2.5rem; }
.grid { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.post { text-align: left; width: 100%; color: inherit; font: inherit; cursor: pointer; display: block; }
.post .tag { font-size: .7rem; letter-spacing: .25em; text-transform: uppercase; color: var(--accent); }
.post h3 { font-family: var(--display); font-size: 1.7rem; line-height: 1.15; margin: .5rem 0; }
.post p { font-size: .95rem; }
.post .date { display: block; margin-top: 1rem; font-size: .8rem; color: var(--muted); }
.lead { color: var(--muted); max-width: 520px; margin: 0 auto 2rem; }
.button {
  display: inline-block; padding: .9rem 2rem; border-radius: 999px; font-weight: 600;
  background: linear-gradient(120deg, var(--accent), var(--accent-2)); color: #0b0b1a;
  transition: transform .2s, box-shadow .2s;
}
.button:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(139,123,255,.45); }
.socials { margin-top: 2rem; display: flex; gap: 1.4rem; justify-content: center; flex-wrap: wrap; color: var(--muted); }
.socials a:hover { color: var(--text); }
footer { text-align: center; padding: 3rem 1rem; color: var(--muted); font-size: .8rem; }

/* ============ Post modal ============ */
dialog { border: 0; background: transparent; color: var(--text); max-width: min(720px, 94vw); width: 100%; margin: auto; padding: 0; }
dialog::backdrop { background: rgba(4,4,12,.78); backdrop-filter: blur(6px); }
dialog article {
  position: relative; padding: 2.4rem; border-radius: 22px; max-height: 86vh; overflow-y: auto;
  background: #11111f; border: 1px solid var(--border);
}
dialog h2 { font-family: var(--display); font-size: 2.6rem; line-height: 1.1; margin: .4rem 0 1.2rem; }
dialog .meta { color: var(--accent-2); font-size: .8rem; letter-spacing: .2em; text-transform: uppercase; }
#m-body p { margin-bottom: 1rem; color: #cfcdee; font-weight: 300; }
#close-modal {
  position: absolute; top: .8rem; right: 1rem; background: none; border: 0; color: var(--muted);
  font-size: 2rem; cursor: pointer; line-height: 1;
}

/* ============ Mobile ============ */
@media (max-width: 760px) {
  .nav nav { gap: 1rem; font-size: .8rem; }
  .chapter { align-items: flex-end; padding-bottom: 6vh; }
  .chapter.left, .chapter.right { justify-content: center; }
  .card { background: rgba(7,7,16,.72); padding: 1.5rem; }
  .card h2 { font-size: 1.9rem; }
}

/* ============ Respect reduced-motion settings ============ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal, .eyebrow, .hero h1, .tagline, .hint { animation: none; transition: none; opacity: 1; transform: none; }
}
