/* =========================================================
   a quiet room — a portal to my innerworld
   Shared stylesheet. Dark & atmospheric.
   ========================================================= */

:root {
  --bg:        #08080c;
  --bg-soft:   #0e0e15;
  --ink:       #e7e4de;
  --ink-dim:   #a29fb0;
  --ink-faint: #6b6879;
  --glow:      #9db0d8;   /* dusty periwinkle */
  --glow-warm: #c9a9c8;   /* faded violet */
  --line:      rgba(157, 176, 216, 0.14);

  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --measure: 40rem;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 300;
  line-height: 1.75;
  letter-spacing: 0.01em;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Ambient drifting-dust canvas sits behind everything */
#ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.55;
}

/* A soft light that follows the cursor (portal pages, fine pointers only) */
.cursor-glow {
  position: fixed;
  top: 0; left: 0;
  width: 40rem;
  height: 40rem;
  margin: -20rem 0 0 -20rem;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  background: radial-gradient(circle, rgba(157,176,216,0.10), rgba(157,176,216,0.04) 35%, transparent 65%);
  transition: opacity 1.2s var(--ease);
  will-change: transform;
}
.cursor-glow.is-awake { opacity: 1; }

/* A slow radial breath of light behind content */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(60vw 60vw at 50% -10%, rgba(157,176,216,0.08), transparent 70%),
    radial-gradient(50vw 50vw at 85% 110%, rgba(201,169,200,0.06), transparent 70%);
}

/* ---------------------------------------------------------
   Layout
   --------------------------------------------------------- */

.wrap {
  position: relative;
  z-index: 1;
  max-width: var(--measure);
  margin: 0 auto;
  padding: clamp(2rem, 6vw, 5rem) clamp(1.5rem, 5vw, 2rem);
}

.wrap--wide { max-width: 56rem; }

/* ---------------------------------------------------------
   Header / navigation
   --------------------------------------------------------- */

.site-head {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
  max-width: 56rem;
  margin: 0 auto;
  padding: clamp(1.5rem, 4vw, 2.5rem) clamp(1.5rem, 5vw, 2rem) 0;
  flex-wrap: wrap;
}

.site-head a { text-decoration: none; }

.mark {
  font-family: var(--serif);
  font-size: 1.25rem;
  letter-spacing: 0.04em;
  color: var(--ink);
  transition: color 0.4s var(--ease);
}
.mark:hover { color: var(--glow); }

.nav {
  display: flex;
  gap: clamp(1rem, 3vw, 1.75rem);
  font-size: 0.82rem;
  letter-spacing: 0.14em;
  text-transform: lowercase;
}
.nav a {
  color: var(--ink-faint);
  position: relative;
  padding-bottom: 0.2rem;
  transition: color 0.4s var(--ease);
}
.nav a::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 100%;
  height: 1px;
  background: var(--glow);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.5s var(--ease);
}
.nav a:hover,
.nav a[aria-current="page"] { color: var(--ink); }
.nav a:hover::after,
.nav a[aria-current="page"]::after { transform: scaleX(1); }

/* ---------------------------------------------------------
   Typography
   --------------------------------------------------------- */

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: 0.005em;
}

.title {
  font-size: clamp(2.6rem, 8vw, 4.75rem);
  font-weight: 300;
  letter-spacing: 0.02em;
  color: var(--ink);
}

.subtitle {
  font-family: var(--sans);
  font-size: 0.8rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-top: 1.25rem;
}

.lede {
  font-family: var(--serif);
  font-size: clamp(1.35rem, 3.5vw, 1.75rem);
  line-height: 1.5;
  color: var(--ink-dim);
  font-style: italic;
}

.eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--glow);
  opacity: 0.8;
}

p { color: var(--ink-dim); }
p + p { margin-top: 1.25rem; }

a { color: var(--glow); }

.prose { max-width: var(--measure); }
.prose h2 { font-size: 1.9rem; color: var(--ink); margin: 3rem 0 1rem; }
.prose p  { font-size: 1.05rem; }
.prose a  { color: var(--ink); border-bottom: 1px solid var(--line); text-decoration: none; transition: border-color 0.4s var(--ease); }
.prose a:hover { border-color: var(--glow); }
.prose blockquote {
  border-left: 2px solid var(--line);
  padding-left: 1.5rem;
  margin: 2rem 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.25rem;
  color: var(--ink-dim);
}

/* ---------------------------------------------------------
   Home / portal
   --------------------------------------------------------- */

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

.portal .title { position: relative; }

/* Splash landing — the whole screen is the door */
.splash {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}
.splash .subtitle { margin-top: 1.5rem; }
.splash-enter {
  margin-top: 3.5rem;
  font-size: 0.72rem;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--ink-faint);
  transition: color 0.6s var(--ease), letter-spacing 0.6s var(--ease);
}
.splash-enter::after {
  content: "";
  display: block;
  width: 1px;
  height: 2.5rem;
  margin: 1.25rem auto 0;
  background: linear-gradient(var(--ink-faint), transparent);
  opacity: 0.5;
}
.splash:hover .splash-enter { color: var(--glow); letter-spacing: 0.5em; }

.enter {
  margin-top: 3.5rem;
  display: flex;
  gap: clamp(1.25rem, 4vw, 2.5rem);
  flex-wrap: wrap;
  justify-content: center;
  font-size: 0.85rem;
  letter-spacing: 0.16em;
  text-transform: lowercase;
}
.enter a {
  color: var(--ink-faint);
  text-decoration: none;
  position: relative;
  transition: color 0.5s var(--ease), letter-spacing 0.5s var(--ease);
}
.enter a:hover { color: var(--ink); letter-spacing: 0.22em; }

/* ---------------------------------------------------------
   Writing index
   --------------------------------------------------------- */

.entries { list-style: none; margin-top: 3rem; }

.entry {
  border-top: 1px solid var(--line);
  padding: 1.75rem 0;
  transition: padding-left 0.5s var(--ease);
}
.entry:last-child { border-bottom: 1px solid var(--line); }
.entry:hover { padding-left: 0.75rem; }

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

.entry time {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 0.5rem;
}
.entry h3 {
  font-size: 1.65rem;
  color: var(--ink);
  transition: color 0.4s var(--ease);
}
.entry:hover h3 { color: var(--glow); }
.entry p { font-size: 0.98rem; margin-top: 0.5rem; color: var(--ink-faint); }

/* ---------------------------------------------------------
   Projects
   --------------------------------------------------------- */

.works { list-style: none; margin-top: 3rem; display: grid; gap: 1.25rem; }

.work {
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1.75rem;
  background: linear-gradient(180deg, rgba(157,176,216,0.02), transparent);
  transition: border-color 0.5s var(--ease), transform 0.5s var(--ease), background 0.5s var(--ease);
}
.work:hover {
  border-color: rgba(157,176,216,0.35);
  transform: translateY(-3px);
  background: linear-gradient(180deg, rgba(157,176,216,0.06), transparent);
}
.work h3 { font-size: 1.5rem; color: var(--ink); display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.work h3 .year { font-family: var(--sans); font-size: 0.72rem; letter-spacing: 0.2em; color: var(--ink-faint); font-weight: 300; }
.work p { font-size: 0.98rem; margin-top: 0.6rem; }
.work .tags { margin-top: 1rem; display: flex; gap: 0.5rem; flex-wrap: wrap; }
.work .tag {
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  border: 1px solid var(--line);
  border-radius: 100px;
  padding: 0.25rem 0.7rem;
}
.work a.work-link { color: var(--glow); text-decoration: none; font-size: 0.8rem; letter-spacing: 0.1em; }
.work a.work-link:hover { color: var(--ink); }

/* ---------------------------------------------------------
   Post
   --------------------------------------------------------- */

.post-cover {
  display: block;
  width: 100%;
  max-height: 22rem;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--line);
  margin-bottom: 2.5rem;
}

.post-head { margin-bottom: 3rem; }
.post-head time {
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.post-head h1 { font-size: clamp(2rem, 6vw, 3rem); margin-top: 0.75rem; color: var(--ink); }

/* ---------------------------------------------------------
   Elsewhere / social links
   --------------------------------------------------------- */

.links {
  list-style: none;
  margin-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.links a {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 1rem;
  border: 1px solid var(--line);
  border-radius: 100px;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  color: var(--ink-dim);
  text-decoration: none;
  transition: color 0.4s var(--ease), border-color 0.4s var(--ease),
    transform 0.4s var(--ease);
}
.links a:hover {
  color: var(--ink);
  border-color: rgba(157, 176, 216, 0.4);
  transform: translateY(-2px);
}
.links a svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------------------------------------------------------
   Post meta + prev/next
   --------------------------------------------------------- */

.post-meta {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-top: 0.75rem;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.post-meta .dot { opacity: 0.5; }

.post-nav {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.post-nav a {
  text-decoration: none;
  color: var(--ink-faint);
  max-width: 45%;
  transition: color 0.4s var(--ease);
}
.post-nav a:hover { color: var(--glow); }
.post-nav a span {
  display: block;
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 0.35rem;
}
.post-nav a strong {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.1rem;
  color: var(--ink-dim);
}
.post-nav .next { text-align: right; margin-left: auto; }

/* ---------------------------------------------------------
   Footer
   --------------------------------------------------------- */

.site-foot {
  position: relative;
  z-index: 1;
  max-width: 56rem;
  margin: 4rem auto 0;
  padding: 2.5rem clamp(1.5rem, 5vw, 2rem) 3rem;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: var(--ink-faint);
}
.site-foot a { color: var(--ink-faint); text-decoration: none; transition: color 0.4s var(--ease); }
.site-foot a:hover { color: var(--glow); }

/* ---------------------------------------------------------
   Reveal-on-load animation
   --------------------------------------------------------- */

[data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 1.1s var(--ease), transform 1.1s var(--ease);
}
[data-reveal].is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  [data-reveal] { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}

.back {
  display: inline-block;
  margin-top: 3rem;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: lowercase;
  color: var(--ink-faint);
  text-decoration: none;
  transition: color 0.4s var(--ease);
}
.back:hover { color: var(--glow); }
.back::before { content: "← "; }
