/* === Penshroom — Inkwell theme === */

@import url('https://fonts.googleapis.com/css2?family=EB+Garamond:ital,wght@0,400;0,500;1,400;1,500&family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;1,300;1,400&display=swap');

:root {
  --bg:             #0c0c10;
  --text:           #d8d5dd;
  --muted:          #72707a;
  --accent:         #9370c0;
  --divider:        rgba(216,213,221,0.07);
  --pill-bg:        rgba(216,213,221,0.06);
  --pill-bg-hover:  rgba(147,112,192,0.18);
  --card-border:    rgba(216,213,221,0.08);
  --bg-raised:      #111117;
}

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

html {
  font-size: 18px;
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
}

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-thumb { background: rgba(216,213,221,0.1); border-radius: 3px; }
::selection { background: rgba(147,112,192,0.2); }

body {
  font-family: 'EB Garamond', Georgia, serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.75;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

p { text-wrap: pretty; }

a {
  text-decoration: none;
  color: var(--muted);
  transition: color 0.2s ease;
}

a:hover { color: var(--accent); }

/* ─── Noise texture ──────────────────────────────────────── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  opacity: 0.022;
  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)'/%3E%3C/svg%3E");
  background-size: 128px;
}

/* ─── Keyframes ──────────────────────────────────────────── */
@keyframes blink   { 0%,100%{opacity:1} 50%{opacity:0} }
@keyframes fadeIn  { from{opacity:0;transform:translateY(6px)} to{opacity:1;transform:none} }
@keyframes pulse   { 0%,100%{transform:scale(1)} 50%{transform:scale(1.2)} }

/* ─── Header ─────────────────────────────────────────────── */
header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: 52px;
  background: rgba(12,12,16,0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--divider);
  display: flex;
  align-items: center;
  padding: 0 40px;
  justify-content: space-between;
}

.logo {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 15px;
  font-weight: 300;
  letter-spacing: 0.1em;
  color: var(--text);
  opacity: 0.85;
  text-decoration: none;
}

.logo:hover { color: var(--text); opacity: 1; }

.nav-bar {
  display: flex;
  align-items: center;
}

.nav-bar a {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 13.5px;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-left: 24px;
  transition: color 0.2s;
}

.nav-bar a:hover { color: var(--accent); }

.nav-bar a.active {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(147,112,192,0.5);
}

/* ─── Main ───────────────────────────────────────────────── */
main {
  flex: 1;
  padding-top: 52px;
}

/* ─── Pill ───────────────────────────────────────────────── */
.pill {
  display: inline-block;
  padding: 2px 9px;
  margin-right: 5px;
  margin-bottom: 5px;
  border: 1px solid var(--card-border);
  background: var(--pill-bg);
  color: var(--muted);
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 11.5px;
  letter-spacing: 0.08em;
  transition: all 0.2s;
  white-space: nowrap;
  text-decoration: none;
}

a.pill:hover, .pill.active {
  border-color: var(--accent);
  background: var(--pill-bg-hover);
  color: var(--accent);
}

/* ─── Home Page ──────────────────────────────────────────── */
.home-wrap {
  max-width: 640px;
  margin: 0 auto;
  padding: 44px 40px 80px;
}

.recent-card {
  padding-bottom: 44px;
  border-bottom: 1px solid var(--divider);
  margin-bottom: 44px;
  animation: fadeIn 0.5s ease both;
}

.entry-date {
  font-size: 11.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-family: 'Cormorant Garamond', Georgia, serif;
  color: var(--muted);
  margin-bottom: 10px;
}

.entry-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 400;
  font-size: 1.5rem;
  color: var(--text);
  line-height: 1.35;
  margin-bottom: 10px;
  transition: color 0.2s;
  text-decoration: none;
  display: block;
}

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

.entry-pills { margin-bottom: 12px; }

.entry-preview {
  font-size: 1.075rem;
  line-height: 1.82;
  color: var(--text);
  margin-bottom: 14px;
}

#typewriter-cursor {
  display: inline-block;
  width: 2px;
  height: 0.9em;
  background: var(--accent);
  margin-left: 2px;
  vertical-align: middle;
  animation: blink 1s step-end infinite;
}

.continue-reading {
  font-size: 12.5px;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-style: italic;
  color: var(--accent);
  letter-spacing: 0.03em;
  border-bottom: 1px solid rgba(147,112,192,0.27);
  padding-bottom: 1px;
  transition: border-color 0.2s;
  text-decoration: none;
}

.continue-reading:hover { border-color: var(--accent); }

/* Older entries */
.older-label {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  padding-bottom: 14px;
  border-bottom: 1px solid var(--divider);
  margin-bottom: 0;
}

.compact-card {
  padding: 16px 0;
  border-bottom: 1px solid var(--divider);
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 0 20px;
  text-decoration: none;
}

.compact-date {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-family: 'Cormorant Garamond', Georgia, serif;
  color: var(--muted);
  padding-top: 3px;
}

.compact-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.125rem;
  color: var(--text);
  transition: color 0.2s;
  margin-bottom: 6px;
  font-weight: 400;
  line-height: 1.3;
}

.compact-card:hover .compact-title { color: var(--accent); }

.archive-link-wrap {
  margin-top: 28px;
  text-align: right;
}

.archive-link {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 13.5px;
  font-style: italic;
  color: var(--accent);
  letter-spacing: 0.03em;
  border-bottom: 1px solid rgba(147,112,192,0.27);
  padding-bottom: 1px;
  transition: border-color 0.2s;
  text-decoration: none;
}

.archive-link:hover { border-color: var(--accent); }

/* ─── Archive Page ────────────────────────────────────────── */
.archive-wrap {
  max-width: 1000px;
  margin: 0 auto;
  padding: 44px 40px 80px;
  animation: fadeIn 0.4s ease;
}

.archive-layout {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 0 48px;
  align-items: start;
}

@media (max-width: 768px) {
  .archive-layout { grid-template-columns: 1fr; }
  .archive-sidebar { display: none; }
  .archive-grid { grid-template-columns: 1fr; }
}

.archive-filter-bar {
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.filter-label {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 13px;
  font-style: italic;
  color: var(--muted);
}

.filter-value {
  color: var(--accent);
  font-style: normal;
}

.filter-clear {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--divider);
  text-decoration: none;
  transition: color 0.2s;
}

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

.archive-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.archive-card {
  border: 1px solid var(--card-border);
  padding: 20px;
  background: transparent;
  transition: background 0.2s;
  animation: fadeIn 0.3s ease both;
  text-decoration: none;
  display: block;
}

.archive-card:hover { background: var(--pill-bg); }

.archive-card-date {
  font-size: 11px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  font-family: 'Cormorant Garamond', Georgia, serif;
  color: var(--muted);
  margin-bottom: 8px;
}

.archive-card-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 400;
  font-size: 1.15rem;
  color: var(--text);
  line-height: 1.35;
  margin-bottom: 8px;
  transition: color 0.2s;
}

.archive-card:hover .archive-card-title { color: var(--accent); }

.archive-card-preview {
  font-size: 0.9rem;
  line-height: 1.65;
  color: var(--muted);
  margin-bottom: 10px;
}

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--divider);
}

.pag-btn {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 13.5px;
  font-style: italic;
  letter-spacing: 0.03em;
  transition: color 0.2s;
  text-decoration: none;
  color: var(--accent);
}

.pag-btn:hover { color: var(--text); }

.pag-btn.disabled {
  color: var(--muted);
  opacity: 0.35;
  cursor: default;
  pointer-events: none;
}

.pag-info {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.1em;
}

/* Sidebar */
.archive-sidebar { position: sticky; top: 72px; }

.sidebar-section {
  padding-bottom: 20px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--divider);
}

.sidebar-section:last-child { border-bottom: none; margin-bottom: 0; }

.sidebar-label {
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-family: 'Cormorant Garamond', Georgia, serif;
  color: var(--muted);
  margin-bottom: 12px;
}

.sidebar-cat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid var(--divider);
  text-decoration: none;
  transition: color 0.2s;
}

.sidebar-cat:last-child { border-bottom: none; }

.sidebar-cat .cat-name {
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 0.95rem;
  color: var(--text);
  transition: color 0.2s;
}

.sidebar-cat .cat-count {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 12px;
  color: var(--muted);
}

.sidebar-cat:hover .cat-name,
.sidebar-cat.active .cat-name { color: var(--accent); }

.sidebar-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.sidebar-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border: 1px solid var(--card-border);
  background: var(--pill-bg);
  color: var(--muted);
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 11.5px;
  transition: all 0.2s;
  text-decoration: none;
}

.sidebar-tag:hover,
.sidebar-tag.active {
  color: var(--accent);
  background: var(--pill-bg-hover);
  border-color: var(--accent);
}

.sidebar-tag .tag-count { opacity: 0.55; font-size: 10px; }

.archive-empty {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-style: italic;
  color: var(--muted);
  font-size: 1.1rem;
  margin-top: 40px;
}

/* ─── Article Page ────────────────────────────────────────── */
.article-wrap {
  max-width: 860px;
  margin: 0 auto;
  padding: 44px 40px 80px;
  animation: fadeIn 0.4s ease;
}

.article-date {
  font-size: 11.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-family: 'Cormorant Garamond', Georgia, serif;
  color: var(--muted);
  margin-bottom: 12px;
}

.article-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 400;
  font-size: 2.1rem;
  line-height: 1.25;
  color: var(--text);
  margin-bottom: 18px;
}

.article-pills {
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--divider);
}

.article-body {
  font-size: 1.085rem;
  line-height: 1.87;
  color: var(--text);
}

.article-body p { margin-bottom: 1.2em; }

.article-body h2 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--text);
  margin: 48px 0 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--divider);
  scroll-margin-top: 70px;
}

.article-body h3 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--text);
  margin: 36px 0 14px;
  font-style: italic;
  scroll-margin-top: 70px;
}

.article-body h4, .article-body h5, .article-body h6 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 400;
  color: var(--text);
  margin: 28px 0 12px;
  scroll-margin-top: 70px;
}

.article-body blockquote {
  margin: 36px 0;
  padding: 16px 24px;
  border-left: 2px solid var(--accent);
  background: rgba(147,112,192,0.04);
  font-style: italic;
}

.article-body code {
  font-family: 'Courier New', monospace;
  background: var(--bg-raised);
  border: 1px solid var(--card-border);
  padding: 1px 5px;
  font-size: 14px;
}

.article-body pre {
  background: var(--bg-raised);
  border: 1px solid var(--card-border);
  padding: 20px;
  overflow-x: auto;
  margin-bottom: 1.4em;
}

.article-body pre code { background: transparent; border: none; padding: 0; }

.article-body ul, .article-body ol { margin: 0 0 1.4em 28px; }
.article-body li { margin-bottom: 8px; }

.article-body a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }

/* Post images (injected between paragraphs) */
.post-image {
  margin: 32px 0;
  border: 1px solid var(--card-border);
  overflow: hidden;
}

.post-image img {
  width: 100%;
  display: block;
}

.post-image figcaption {
  padding: 7px 12px;
  border-top: 1px solid var(--card-border);
  font-size: 12px;
  font-style: italic;
  color: var(--muted);
  font-family: 'EB Garamond', Georgia, serif;
}

.article-back {
  margin-top: 44px;
  padding-top: 24px;
  border-top: 1px solid var(--divider);
}

.back-link {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 13px;
  font-style: italic;
  color: var(--muted);
  transition: color 0.2s;
  text-decoration: none;
}

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

/* ─── Me Page ─────────────────────────────────────────────── */
.me-wrap {
  max-width: 600px;
  margin: 0 auto;
  padding: 44px 40px 80px;
  animation: fadeIn 0.4s ease;
}

.me-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 300;
  font-size: 2.4rem;
  color: var(--text);
  margin-bottom: 32px;
  font-style: italic;
  line-height: 1.2;
}

.me-bio {
  font-size: 1.075rem;
  line-height: 1.87;
  color: var(--text);
}

.me-bio p { margin-bottom: 1.2em; }

.me-divider {
  margin: 36px 0;
  border: none;
  border-top: 1px solid var(--divider);
}

.me-section-label {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 16px;
}

.inked-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0 16px;
  padding: 11px 0;
  border-bottom: 1px solid var(--divider);
  align-items: baseline;
}

.inked-pen {
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 1rem;
  color: var(--text);
}

.inked-nib {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 12.5px;
  color: var(--muted);
  margin-left: 8px;
  font-style: italic;
}

.inked-ink {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 12.5px;
  color: var(--muted);
  font-style: italic;
  text-align: right;
}

.thinks-item {
  padding: 9px 0;
  border-bottom: 1px solid var(--divider);
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 0.975rem;
  color: var(--text);
  font-style: italic;
  line-height: 1.5;
}

.me-footer-info {
  margin-top: 12px;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 13px;
  color: var(--muted);
  font-style: italic;
  line-height: 1.8;
}

.me-footer-info a { color: var(--accent); text-decoration: none; }

.profile-image {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  border: 1px solid var(--card-border);
  overflow: hidden;
  filter: grayscale(20%) brightness(0.75);
  margin-bottom: 28px;
}

.profile-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.video-container {
  margin: 20px 0;
  border: 1px solid var(--card-border);
  overflow: hidden;
}

.video-container iframe {
  display: block;
  width: 100%;
  aspect-ratio: 16/9;
  height: auto;
}

/* ─── Footer ──────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--divider);
  padding: 24px 40px;
}

.footer-content {
  max-width: 1000px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.footer-content a { color: var(--muted); transition: color 0.2s; }
.footer-content a:hover { color: var(--accent); }

/* ─── Music Player ────────────────────────────────────────── */
#music-player {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
}

#player-toggle {
  display: flex;
  align-items: center;
  background: rgba(12,12,16,0.92);
  padding: 8px 12px;
  border-radius: 30px;
  cursor: pointer;
  backdrop-filter: blur(6px);
  border: 1px solid var(--card-border);
  box-shadow: 0 4px 14px rgba(0,0,0,0.6);
  transition: all 0.3s ease;
  max-width: 50px;
  overflow: hidden;
}

#player-toggle.expanded { max-width: 300px; }

#toggle-music {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  color: var(--bg);
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 10px;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.3s ease;
}

#toggle-music:hover { transform: scale(1.1); }

#music-info {
  display: flex;
  flex-direction: column;
  white-space: nowrap;
  margin-right: 10px;
  overflow: hidden;
}

#music-status {
  font-size: 11px;
  color: var(--muted);
  font-family: 'Cormorant Garamond', Georgia, serif;
  letter-spacing: 1px;
}

#track-title {
  font-size: 13px;
  color: var(--text);
  opacity: 0.9;
  font-style: italic;
}

#music-controls { display: flex; gap: 5px; }

#prev-track, #next-track {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-size: 10px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

#prev-track:hover, #next-track:hover { background: rgba(147,112,192,0.15); }

#music-icon.playing { animation: pulse 1.5s infinite; }
#youtube-player { position: absolute; visibility: hidden; }

/* ─── Login ──────────────────────────────────────────────── */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}

.login-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 100%;
  max-width: 340px;
  padding: 0 20px;
}

.login-logo {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 22px;
  font-weight: 300;
  letter-spacing: 0.12em;
  color: var(--text);
  margin-bottom: 8px;
  font-style: italic;
}

.login-input {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-raised);
  border: 1px solid var(--card-border);
  color: var(--text);
  font-size: 16px;
  font-family: inherit;
  font-style: italic;
  outline: none;
  transition: border-color 0.2s ease;
  text-align: center;
  letter-spacing: 3px;
}

.login-input:focus { border-color: var(--accent); }

.login-btn {
  width: 100%;
  padding: 12px;
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-size: 14px;
  font-family: 'Cormorant Garamond', Georgia, serif;
  letter-spacing: 2.5px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.login-btn:hover { background: var(--accent); color: var(--bg); }

.login-error {
  font-size: 14px;
  font-style: italic;
  color: #a06050;
}

/* ─── 404 ──────────────────────────────────────────────────── */
.error-page {
  text-align: center;
  padding: 120px 40px 80px;
}

.error-code {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 80px;
  font-weight: 300;
  color: var(--muted);
  margin-bottom: 20px;
  letter-spacing: 8px;
}

.error-message {
  font-size: 18px;
  font-style: italic;
  color: var(--muted);
  margin-bottom: 32px;
}

.error-page .continue-reading {
  font-size: 14px;
}
