/* ══════════════════════════════════════════════════════════
   Personal Blog — Pastel Minimalist Design System
   Font: Space Mono | Colors: Soft Pastels
   ══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Space+Mono:ital,wght@0,400;0,700;1,400&display=swap');

/* ── Tokens ──────────────────────────────────────────────── */
:root {
  /* backgrounds — off-white cream */
  --bg:          #FAF9F6;
  --bg-card:     rgba(255, 255, 255, 0.6);
  --bg-card-hover: rgba(255, 255, 255, 0.85);

  /* text — black / dark */
  --text:        #1a1a1a;
  --text-muted:  #5c5c5c;
  --text-light:  #9a9a9a;

  /* accents — soft pastels on cream */
  --accent:      #b8a9c9;      /* muted lavender */
  --accent-rose: #e8a0b4;      /* soft rose */
  --accent-mint: #9dd5be;      /* mint */
  --accent-peach:#f0c6a0;      /* peach */
  --accent-sky:  #9dc8d9;      /* sky */

  /* status colours */
  --status-online:  #9dd5be;
  --status-away:    #f0c6a0;
  --status-dnd:     #e8a0b4;
  --status-offline: #c0c0c0;

  /* misc */
  --radius:      16px;
  --radius-sm:   10px;
  --shadow:      0 4px 30px rgba(60, 60, 60, 0.06);
  --transition:  0.3s cubic-bezier(.4,0,.2,1);
}

/* ── Reset & Base ────────────────────────────────────────── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

#snowCanvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Space Mono', monospace;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* pastel gradient blobs removed per user request for solid background */

/* ── Layout ──────────────────────────────────────────────── */
.container {
  max-width: 700px;
  margin: 0 auto;
  padding: 60px 24px 80px;
}

/* ── Content Blocks (formerly Glassmorphism Cards) ───────── */
.card {
  padding: 16px 0;
  margin-bottom: 24px;
}

/* ── Hero Section ────────────────────────────────────────── */
.hero {
  text-align: left;
  margin-bottom: 48px;
}

.hero__identity {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 6px;
}

.hero__avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  transition: transform var(--transition);
}

.hero__avatar:hover {
  transform: scale(1.08);
}

.hero__name {
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 6px;
  color: var(--text);
}

.hero__tagline {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 400;
  margin-bottom: 22px;
}

/* ── Status Indicator ────────────────────────────────────── */
.status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.78rem;
  color: var(--text-muted);
  cursor: default;
  transition: background var(--transition);
}

.status__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--status-online);
  position: relative;
  flex-shrink: 0;
}

.status__dot::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: inherit;
  opacity: 0.4;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 0.4; }
  50%      { transform: scale(1.8); opacity: 0; }
}

.status__dot[data-status="online"]  { background: var(--status-online); }
.status__dot[data-status="away"]    { background: var(--status-away); }
.status__dot[data-status="dnd"]     { background: var(--status-dnd); }
.status__dot[data-status="offline"] { background: var(--status-offline); }
.status__dot[data-status="offline"]::after { animation: none; }

/* ── Section Headers ─────────────────────────────────────── */
.section-title {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: 18px;
  padding-left: 4px;
}

/* ── Now Playing (Spotify) ───────────────────────────────── */
.now-playing {
  margin-bottom: 48px;
}

.np__inner {
  display: flex;
  align-items: center;
  gap: 20px;
}

.np__art {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 2px 16px rgba(100,80,120,0.12);
}

.np__art--placeholder {
  background: linear-gradient(135deg, var(--accent-sky), var(--accent-mint));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.5rem;
}

.np__info {
  flex: 1;
  min-width: 0;
}

.np__track {
  font-size: 0.88rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.np__artist {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.np__album {
  font-size: 0.7rem;
  color: var(--text-light);
  font-style: italic;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.np__bar-wrapper {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.np__bar {
  flex: 1;
  height: 3px;
  background: rgba(0,0,0,0.06);
  border-radius: 3px;
  overflow: hidden;
}

.np__bar-fill {
  height: 100%;
  background: var(--text);
  border-radius: 3px;
  width: 0%;
  transition: width 1s linear;
}

.np__time {
  font-size: 0.62rem;
  color: var(--text-light);
  font-variant-numeric: tabular-nums;
  min-width: 32px;
}

.np__idle {
  font-size: 0.82rem;
  color: var(--text-light);
  display: flex;
  align-items: center;
  gap: 8px;
}

.np__idle-icon {
  font-size: 1.1rem;
}

/* Spotify branding subtle */
.np__spotify-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.62rem;
  color: var(--text-light);
  margin-top: 8px;
  opacity: 0.6;
}

.np__spotify-badge svg {
  width: 14px;
  height: 14px;
}

/* ── Lyrics ───────────────────────────────────────────────── */
.lyrics {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(0,0,0,0.04);
  max-height: 260px;
  overflow-y: auto;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: rgba(0,0,0,0.08) transparent;
}

.lyrics::-webkit-scrollbar {
  width: 4px;
}

.lyrics::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.1);
  border-radius: 4px;
}

.lyric-line {
  display: none;
}

.lyric-line--active {
  display: block;
  font-size: 0.82rem;
  line-height: 1.9;
  color: var(--text);
  font-weight: 700;
  padding: 2px 0;
  opacity: 0;
  transform: translateY(8px);
  animation: fadeIn 0.3s ease forwards;
  white-space: pre-wrap;
}

.lyric-char {
  opacity: 0;
}

.lyric-line--active .lyric-char {
  animation: typeChar 0.1s forwards;
}

@keyframes typeChar {
  to { opacity: 1; }
}

/* ── Blog Posts ────────────────────────────────────────────── */
.blog {
  margin-bottom: 48px;
}

.blog__list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.post {
  cursor: default;
}

.post__date {
  font-size: 0.68rem;
  color: var(--text-light);
  letter-spacing: 0.5px;
}

.post__title {
  font-size: 0.92rem;
  font-weight: 700;
  margin: 4px 0;
}

.post__excerpt {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.post__tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.post__tag {
  font-size: 0.62rem;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(197,163,232,0.15);
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.5px;
}

.post__tag:nth-child(2n) {
  background: rgba(240,166,202,0.15);
  color: var(--accent-rose);
}

.post__tag:nth-child(3n) {
  background: rgba(168,230,207,0.15);
  color: #6bb89e;
}

/* ── Post Full View ──────────────────────────────────────── */
.post-full {
  display: none;
}

.post-full.active {
  display: block;
}

.post-full__back {
  font-size: 0.78rem;
  color: var(--accent);
  cursor: pointer;
  border: none;
  background: none;
  font-family: 'Space Mono', monospace;
  margin-bottom: 18px;
  padding: 0;
  transition: opacity var(--transition);
}

.post-full__back:hover {
  opacity: 0.7;
}

.post-full__title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.post-full__date {
  font-size: 0.7rem;
  color: var(--text-light);
  margin-bottom: 20px;
}

.post-full__body {
  font-size: 0.82rem;
  line-height: 1.8;
  color: var(--text);
}

.post-full__body p {
  margin-bottom: 14px;
}

/* ── Footer ──────────────────────────────────────────────── */
.footer {
  text-align: center;
  padding-top: 12px;
}

.footer__links {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.footer__link {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--transition);
  font-family: 'Space Mono', monospace;
}

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

.footer__copy {
  font-size: 0.62rem;
  color: var(--text-light);
}

/* ── Fade-in Animation ───────────────────────────────────── */
.fade-in {
  opacity: 0;
  transform: translateY(16px);
  animation: fadeIn 0.6s ease forwards;
}

@keyframes fadeIn {
  to { opacity: 1; transform: translateY(0); }
}

.fade-in:nth-child(2) { animation-delay: 0.1s; }
.fade-in:nth-child(3) { animation-delay: 0.2s; }
.fade-in:nth-child(4) { animation-delay: 0.3s; }
.fade-in:nth-child(5) { animation-delay: 0.4s; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 520px) {
  .container {
    padding: 40px 16px 60px;
  }

  .hero__name {
    font-size: 1.6rem;
  }

  .np__inner {
    flex-direction: column;
    text-align: center;
    gap: 14px;
  }

  .np__info {
    width: 100%;
  }

  .card {
    padding: 22px 20px;
  }

  .hero__avatar {
    width: 38px;
    height: 38px;
  }
}

/* ── Top Bar (login + settings) ───────────────────────────── */
.topbar {
  position: fixed;
  top: 20px;
  right: 24px;
  display: flex;
  gap: 8px;
  z-index: 100;
}

.auth-btn {
  font-family: 'Space Mono', monospace;
  font-size: 0.7rem;
  padding: 6px 16px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
}

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

/* ── Settings Panel Styles ───────────────────────────────── */
.settings__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.settings__label {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-family: 'Space Mono', monospace;
}

.settings__color-group {
  display: flex;
  align-items: center;
  gap: 8px;
}


.settings__picker {
  width: 32px;
  height: 32px;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: var(--radius-sm);
  padding: 2px;
  cursor: pointer;
  background: transparent;
}

.settings__hex {
  width: 90px;
  margin-bottom: 0 !important;
  font-size: 0.72rem !important;
  padding: 6px 10px !important;
}

.settings__presets {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.settings__preset {
  font-family: 'Space Mono', monospace;
  font-size: 0.62rem;
  padding: 4px 12px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
}

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

/* ── Blog Header ─────────────────────────────────────────── */
.blog__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.blog__header .section-title {
  margin-bottom: 0;
}

.new-post-btn {
  font-family: 'Space Mono', monospace;
  font-size: 0.68rem;
  padding: 5px 14px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
}

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

/* ── Post Admin Buttons ──────────────────────────────────── */
.post__admin {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.post__admin-btn {
  font-family: 'Space Mono', monospace;
  font-size: 0.6rem;
  padding: 3px 10px;
  border: none;
  background: transparent;
  color: var(--text-light);
  cursor: pointer;
  transition: all var(--transition);
}

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

.post__admin-btn--delete:hover {
  color: var(--accent-rose);
}

/* ── Modal (Post Editor) ─────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.3);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 24px;
}

.modal {
  width: 100%;
  max-width: 560px;
  max-height: 80vh;
  overflow-y: auto;
  background: var(--bg);
  padding: 32px;
  border-radius: var(--radius);
  border: 1px solid rgba(128,128,128,0.2);
}

.modal__title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 18px;
}

.modal__input {
  display: block;
  width: 100%;
  font-family: 'Space Mono', monospace;
  font-size: 0.78rem;
  padding: 10px 14px;
  margin-bottom: 12px;
  border: none;
  border-radius: var(--radius-sm);
  background: rgba(0,0,0,0.03);
  color: var(--text);
  outline: none;
  text-align: left;
  transition: background var(--transition);
}

.modal__input:focus {
  background: rgba(0,0,0,0.06);
}

.modal__textarea {
  display: block;
  width: 100%;
  min-height: 180px;
  font-family: 'Space Mono', monospace;
  font-size: 0.78rem;
  padding: 10px 14px;
  margin-bottom: 12px;
  border: none;
  border-radius: var(--radius-sm);
  background: rgba(0,0,0,0.03);
  color: var(--text);
  outline: none;
  resize: vertical;
  transition: background var(--transition);
}

.modal__textarea:focus {
  background: rgba(0,0,0,0.06);
}

.modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.modal__btn {
  font-family: 'Space Mono', monospace;
  font-size: 0.72rem;
  padding: 8px 20px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
}

.modal__btn--cancel {
  background: transparent;
  color: var(--text-muted);
}

.modal__btn--cancel:hover {
  color: var(--text);
}

.modal__btn--save {
  background: var(--text);
  color: var(--bg);
}

.modal__btn--save:hover {
  opacity: 0.85;
}

/* ── Custom Animations & Protected Elements ──────────────── */
.caret {
  display: inline-block;
  color: var(--text);
  margin-left: 0;
  animation: blink 1s step-end infinite;
}

.post__title--locked {
  font-size: 0.82rem !important;
  color: var(--text-light) !important;
  font-weight: 400 !important;
  letter-spacing: 0.01rem;
}

@keyframes blink {
  50% { opacity: 0; }
}

.protected-preview {
  filter: blur(5px);
  user-select: none;
  opacity: 0.5;
  pointer-events: none;
}

.protected-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: transparent;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 10;
  border-radius: var(--radius);
  gap: 15px;
  padding: 20px;
}

.protected-overlay__icon {
  font-size: 2rem;
  color: var(--text);
  opacity: 0.8;
}

.protected-overlay__text {
  font-weight: 500;
  color: var(--text);
  font-size: 0.95rem;
  margin-bottom: 5px;
}

.protected-overlay__input {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  width: 100%;
  max-width: 280px;
  text-align: center;
  transition: border-color var(--transition);
}

.protected-overlay__input:focus {
  border-color: var(--text-light);
}

.protected-overlay__btn {
  background: var(--text);
  color: var(--bg);
  border: none;
  padding: 8px 22px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  transition: opacity 0.2s;
  font-weight: 600;
}

.protected-overlay__btn:hover {
  opacity: 0.9;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.shake {
  animation: shake 0.2s ease-in-out 0s 2;
}

.modal__btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
