:root {
  --bg: #fbfaf8;
  --card: #ffffff;
  --card-bg: #fff;
  --muted: #7b7b7b;
  --ink: #111114;
  --accent: #8a5dff; /* soft purple */
  --accent-2: #d4b483; /* warm beige */
  --accent: #f6f0d9;
  --radius: 10px;
  --max-width: 900px;
  --gap: 10px;
  --hover-scale: 1.04;
  --hover-dim: 0.08; /* darkness on hover */
  --shadow: 0 6px 24px rgba(0,0,0,.12);
  --speed: 220ms;
  --overlay-bg: rgba(12,12,12,0.65);
  --ease: cubic-bezier(.2,.9,.25,1);
}

/* Reset & Base */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  padding: 36px 22px;
  font-family: Inter, system-ui, Segoe UI, Roboto, Arial;
  background: linear-gradient(180deg, var(--bg), #f6f5f4);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

/* Layout */
.container { max-width: var(--max-width); margin: 0 auto; }
main { display: grid; grid-template-columns: 1fr 300px; gap: 36px; }
@media (max-width: 900px) { main { grid-template-columns: 1fr; } aside { order: 2; } }

/* Header */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 36px;
}
.brand {
  display: flex;
  flex-direction: column;
}
.brand h1 {
  margin: 0;
  font-family: 'Playfair Display', serif;
  font-size: 34px;
  letter-spacing: -0.02em;
}
.brand p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
}

/* Navigation */
nav {
  display: flex;
  gap: 12px;
  align-items: center;
}
nav a {
  cursor: pointer;
  text-decoration: none;
  color: var(--muted);
  font-size: 14px;
  padding: 8px 10px;
  border-radius: 10px;
  position: relative;
  transition: color 220ms var(--ease);
}
nav a.active {
  color: var(--ink);
  font-weight: 600;
}
nav a.cta {
  background: var(--ink);
  color: white;
  font-weight: 600;
  display: inline-block;
  padding: 8px 12px;
  border-radius: 6px;
  text-decoration: none;
}
nav a.active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -6px;
  height: 2px;
  background: var(--muted);
  transform-origin: left;
  animation: underlineIn 320ms var(--ease) both;
}
@keyframes underlineIn {
  from { transform: scaleX(0); opacity: 0.7; }
  to   { transform: scaleX(1); opacity: 1; }
}

/* Featured Post */
.featured {
  background: linear-gradient(180deg, rgba(138,93,255,0.05), transparent);
  padding: 28px;
  border-radius: 20px;
  border: 1px solid rgba(15,15,20,0.04);
  box-shadow: 0 20px 40px rgba(15,15,20,0.05);
}
.featured .eyebrow {
  font-size: 16px;
  color: var(--accent-2);
  font-weight: 700;
  letter-spacing: 0.06em;
}
.featured h2 {
  font-family: 'Playfair Display', serif;
  font-size: 28px;
  margin: 8px 0;
}
.lede {
  font-size: 16px;
  color: var(--muted);
  margin: 8px 0 0;
}

/* Posts */
.posts {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: 18px;
}
.post-card {
  background: var(--card-bg);
  border-radius: 8px;
  padding: 1.1rem;
  box-shadow: 0 6px 18px rgba(18,18,18,0.06);
  border: 1px solid rgba(12,12,15,0.04);
  transition: transform 300ms var(--ease), box-shadow 300ms var(--ease);
  transform-origin: center;
  opacity: 0;
  transform: translateY(6px) scale(0.998);
}
.post-card.appear {
  animation: cardIn 420ms var(--ease) both;
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(10px) scale(0.995); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.post-card:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 18px 38px rgba(20,20,20,0.08);
}
.post-title {
  font-family: 'Playfair Display', serif;
  font-size: 20px;
  margin: 6px 0;
}
.post-excerpt {
  color: var(--muted);
  margin: 10px 0;
}
.post-meta {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 0.35rem;
}

/* Read More */
.read-more {
  display: inline-block;
  margin-top: 0.6rem;
  text-decoration: none;
  transition: transform 220ms var(--ease);
}
.read-more:hover { transform: translateX(6px); }

/* Dropcap */
.dropcap {
  float: left;
  font-family: 'Playfair Display', serif;
  font-size: 56px;
  line-height: 0.7;
  margin-right: 12px;
  color: var(--accent-2);
}

/* About Card */
aside { position: relative; }
.about-card {
  background: var(--card);
  padding: 18px;
  border-radius: 12px;
  border: 1px solid rgba(12,12,15,0.03);
  box-shadow: 0 6px 20px rgba(0,0,0,0.06);
  width: 100%;
  max-width: none;
  overflow: visible;
  box-sizing: border-box;
}
.about-card h3 { font-family: 'Playfair Display', serif; margin: 0; }
.about-card p { color: var(--muted); margin-top: 8px; }
@media (max-width: 700px) {
  .about-card { padding: 14px; }
}

/* Gallery */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: var(--gap);
  margin-top: 10px;
}
.gallery figure {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  margin: 0;
  cursor: zoom-in;
  box-shadow: var(--shadow);
  transform: translateZ(0);
  transition: transform var(--speed) ease, box-shadow var(--speed) ease;
  background: linear-gradient(90deg,#eee,#fff);
}
.gallery img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  transform: scale(1);
  transition: transform var(--speed) ease, opacity var(--speed) ease;
}
.gallery figure::after {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(120% 120% at 80% 10%, rgba(255,255,255,.0) 0%, rgba(0,0,0,var(--hover-dim)) 100%);
  opacity: 0;
  transition: opacity var(--speed) ease;
  pointer-events: none;
}
.gallery figure:hover {
  transform: translateY(-2px) scale(var(--hover-scale));
  box-shadow: 0 10px 36px rgba(0,0,0,.16);
}
.gallery figure:hover img { opacity: .9; transform: scale(1.02); }
.gallery figure:hover::after { opacity: 1; }
@media (max-width: 700px) { .gallery { grid-template-columns: 1fr; } }

/* Gallery Images (JS-less) */
#sideGallery img {
  width: 100%;
  display: block;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 480ms var(--ease), transform 480ms var(--ease);
  border-radius: 6px;
}
#sideGallery img.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Lightbox */
.lightbox {
  position: fixed; inset: 0;
  background: rgba(10,10,11,.85);
  display: grid; place-items: center;
  opacity: 0; visibility: hidden;
  transition: opacity var(--speed) ease, visibility var(--speed) step-end;
  z-index: 999;
}
.lightbox.open {
  opacity: 1; visibility: visible;
  transition: opacity var(--speed) ease, visibility 0s;
}
.lightbox__imgwrap {
  position: relative;
  max-width: min(92vw, 1200px);
  max-height: 86vh;
  width: 100%;
  aspect-ratio: auto;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 14px;
  box-shadow: 0 20px 80px rgba(0,0,0,.45);
  animation: pop var(--speed) ease;
}
.lightbox__imgwrap img { max-width: 100%; max-height: 86vh; display: block; }
@keyframes pop { from { transform: translateY(8px) scale(.98); } to { transform: translateY(0) scale(1); } }
.lightbox__close, .lightbox__nav {
  position: absolute; top: 10px; display: flex; gap: 8px; z-index: 2;
}
.lightbox__close { right: 10px; }
.iconbtn {
  -webkit-tap-highlight-color: transparent;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.25);
  color: #fff;
  border-radius: 999px;
  padding: 10px 12px;
  cursor: pointer;
  font-size: 14px;
  backdrop-filter: blur(6px);
  transition: transform 120ms ease, background 120ms ease, border-color 120ms ease;
}
.iconbtn:hover {
  transform: translateY(-1px);
  background: rgba(255,255,255,.18);
  border-color: rgba(255,255,255,.35);
}
.lightbox__nav { left: 10px; }
@media (max-width: 520px) { .lightbox__nav { display: none; } }

/* Overlay Modal */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(8,8,10,0.5);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 28px;
}
.overlay.open { display: flex; }
.article-modal {
  width: 100%;
  max-width: 820px;
  background: var(--card);
  padding: 34px;
  border-radius: 14px;
  overflow: auto;
  max-height: 92vh;
}
.close-btn {
  position: absolute;
  right: 22px;
  top: 18px;
  background: transparent;
  border: 0;
  font-size: 18px;
  color: var(--muted);
}

/* Overlay Modal (new) */
#overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: start center;
  padding: 48px 20px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 360ms var(--ease);
  z-index: 1200;
}
#overlay.open {
  pointer-events: auto;
  opacity: 1;
}
#overlay .modal {
  width: min(940px, 92vw);
  max-height: 86vh;
  overflow: auto;
  background: #fff;
  border-radius: 10px;
  padding: 1.6rem;
  box-shadow: 0 30px 80px rgba(10,10,10,0.22);
  transform: translateY(12px) scale(.995);
  opacity: 0;
  transition: transform 360ms var(--ease), opacity 360ms var(--ease);
}
#overlay.open .modal {
  transform: translateY(0) scale(1);
  opacity: 1;
}
#closeModal {
  background: transparent;
  border: none;
  font-size: 1.05rem;
  cursor: pointer;
  position: absolute;
  right: 14px;
  top: 12px;
}
@media (max-width:700px){
  .post-card{ padding: .9rem; }
  #overlay .modal{ padding: 1.1rem; width: calc(100% - 40px); }
}

/* Write Modal */
#writeOverlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0,0,0,0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity .28s ease;
  z-index: 9999;
}
#writeOverlay.open {
  opacity: 1;
  pointer-events: auto;
}
.write-modal {
  background: transparent;
  padding: 0;
  width: min(720px, 96vw);
  border-radius: 14px;
  transform-origin: center;
  transition: transform 420ms cubic-bezier(.2,.9,.25,1), box-shadow 420ms;
}
#writeOverlay.open .write-modal { transform: none; }
.paper {
  background: linear-gradient(180deg,#fffef9,#fffaf0);
  border-radius: 12px;
  padding: 1.35rem;
  box-shadow: 0 40px 90px rgba(8,10,12,0.22), 0 6px 20px rgba(8,10,12,0.06);
  transform: rotate(-0.6deg);
  position: relative;
  overflow: hidden;
}
.paper::after {
  content: "";
  position: absolute; inset: 0;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="600" height="400"><filter id="n"><feTurbulence baseFrequency="0.9" numOctaves="2" stitchTiles="stitch"/><feColorMatrix type="saturate" values="0"/></filter><rect width="100%" height="100%" filter="url(%23n)" opacity="0.02"/></svg>');
  pointer-events: none;
  mix-blend-mode: multiply;
}
.close-btn {
  position: absolute;
  right: 18px;
  top: 18px;
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
}
.mode-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 8px;
}
.tab {
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid #ddd;
  cursor: pointer;
  background: #fff;
}
.tab.active {
  background: #111;
  color: #fff;
  border-color: #111;
}
textarea#oneLiner {
  width: 100%;
  min-height: 100px;
  font-size: 18px;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #ddd;
  box-sizing: border-box;
  font-family: 'Patrick Hand', cursive;
  line-height: 1.5;
  color: #111;
  resize: vertical;
}
#drawCanvas, .text-preview {
  width: 100%;
  border-radius: 8px;
  background: transparent;
  display: block;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.6);
}
#drawCanvas {
  height: 240px;
  background: #fffdf7;
  border-radius: 8px;
  border: 1px solid #ddd;
  display: block;
}
.controls {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.btn {
  padding: 7px 10px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  background: #111;
  color: #fff;
}
.btn.primary { background: #111; color: #fff; border: none; }
.draw-toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}
.color-swatch {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid rgba(0,0,0,0.06);
  cursor: pointer;
}
.size-slider { width: 120px; }
.stamp {
  position: absolute;
  right: 12px;
  bottom: 10px;
  font-family: 'Playfair Display', serif;
  color: #777;
  font-size: 13px;
  opacity: 0.9;
}
.text-preview {
  height: 260px;
  border-radius: 10px;
  background: linear-gradient(180deg,#fffef9,#fff7ea);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.7), 0 18px 40px rgba(6,8,10,0.06);
  padding: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-family: 'Patrick Hand', cursive;
  color: #111;
  position: relative;
  overflow: hidden;
}
.text-preview .muted-stamp {
  position: absolute;
  right: 12px;
  bottom: 10px;
  font-family: 'Playfair Display', serif;
  color: rgba(30,30,30,0.5);
  font-size: 12px;
}

/* More Button */
.morebtn {
  margin-top: 14px;
  padding: 12px 22px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(90deg, #f6f0ff 0%, #fffbe6 100%);
  color: #5a3fc0;
  font-family: 'Playfair Display', serif;
  font-size: 1.08rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(138,93,255,0.10), 0 1px 0 rgba(255,255,255,0.7) inset;
  transition: box-shadow 180ms var(--ease), transform 180ms var(--ease), background 180ms var(--ease);
}
.morebtn:hover {
  background: linear-gradient(90deg, #e9e3ff 0%, #fff3d6 100%);
  color: #3d2a7a;
  box-shadow: 0 10px 32px rgba(138,93,255,0.18), 0 2px 0 rgba(255,255,255,0.8) inset;
  transform: translateY(-2px) scale(1.04);
}

/* Utility */
.is-hidden { display: none; }
.page { display: none; }
.page.active { display: block; }
a:hover { opacity: 0.9; }
footer {
  margin-top: 40px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}
.debug { margin-top: 12px; font-size: 13px; color: #555; }
.outline-debug { outline: 2px dashed rgba(0,128,0,0.6); }

/* Blockquote */
blockquote {
  font-style: italic;
  border-left: 3px solid var(--accent);
  padding-left: 12px;
  color: var(--muted);
  margin: 18px 0;
}

/* Now Page */
#now {
  max-width: 700px;
  margin: 4rem auto;
  padding: 0 1.5rem;
  font-family: 'Georgia', serif;
  line-height: 1.7;
}
#now h2 {
  font-size: 2rem;
  margin-bottom: 1rem;
  font-weight: 600;
  letter-spacing: -0.5px;
}
#now .intro p {
  margin-bottom: 1.2rem;
  font-size: 1.05rem;
  color: #333;
}
#now em {
  font-style: italic;
  background: #fffbe6;
  padding: 0.1em 0.3em;
  border-radius: 3px;
}
#now .now-list { margin-top: 2rem; }
#now .now-list h3 {
  font-size: 1.2rem;
  margin-bottom: 0.6rem;
  font-weight: 500;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
#now ul { list-style: none; padding-left: 0; }
#now li {
  margin-bottom: 0.8rem;
  padding-left: 1.2rem;
  position: relative;
}
#now li::before {
  content: "*";
  position: absolute;
  left: 0;
  color: #888;
}

/* About Page */
#about {
  max-width: 720px;
  margin: 4rem auto;
  padding: 0 1.5rem;
  font-family: "Georgia", serif;
  line-height: 1.75;
  color: #2b2b2b;
}
#about h2 {
  font-size: 2rem;
  margin-bottom: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.3px;
}
#about .intro p {
  margin-bottom: 1.5rem;
  font-size: 1.05rem;
}
#about em {
  background: #fff8d6;
  padding: 0.15em 0.3em;
  border-radius: 3px;
}
