/* ═══════════════════════════════════════
   MYTHEME — Main Stylesheet
   ═══════════════════════════════════════ */

/* ─── TOKENS ─── */
:root {
  --neon:      #8b2fd4;
  --neon-glow: #8b2fd455;
  --neon-dim:  #8b2fd418;

  --bg:        #f8f8f8;
  --bg-card:   #ffffff;
  --bg-tag:    #f0e6ff;
  --text:      #111111;
  --text-muted:#666666;
  --border:    #e0e0e0;

  --font-mono:    'JetBrains Mono', monospace;
  --font-display: 'Syne', sans-serif;
  --font-hero: 'Cutive Mono', monospace;

  --radius:   3px;
  --max-w:    860px;
  --transition: 0.3s cubic-bezier(0.4,0,0.2,1);
}

[data-theme="dark"] {
  --bg:        #0e0e0e;
  --bg-card:   #161616;
  --bg-tag:    #1e0d33;
  --text:      #f0f0f0;
  --text-muted:#888888;
  --border:    #2a2a2a;
}

/* ─── RESET ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-mono);
  background: var(--bg);
  color: var(--text);
  transition: background var(--transition), color var(--transition);
  min-height: 100vh;
  line-height: 1.7;
}

img { display: block; width: 100%; object-fit: cover; }
a   { color: inherit; text-decoration: none; }

/* ─── LAYOUT ─── */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 2rem;
}

/* ─── NAVBAR ─── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  transition: background var(--transition), border-color var(--transition);
}

.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 2rem;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Logo */
.logo-link { display: flex; align-items: center; }

.logo-img {
  height: 32px;
  width: auto;
  max-width: 140px;
  display: block;
  object-fit: contain;
}

.logo-placeholder {
  height: 32px;
  padding: 0 10px;
  border: 1.5px dashed var(--border);
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  transition: border-color 0.2s;
  font-family: var(--font-display);
  font-weight: 700;
}
.logo-placeholder:hover { border-color: var(--neon); }

/* Nav links */
.nav-links {
  display: flex;
  gap: 2rem;
  align-items: center;
  list-style: none;
}

.nav-links a {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  transition: color 0.2s;
  position: relative;
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0; right: 100%;
  height: 1px;
  background: var(--neon);
  transition: right 0.25s ease;
}
.nav-links a:hover,
.nav-links a.nav-active { color: var(--neon); }
.nav-links a:hover::after,
.nav-links a.nav-active::after { right: 0; }

/* Theme toggle */
.toggle-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 12px;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}
.toggle-btn:hover {
  border-color: var(--neon);
  color: var(--neon);
  box-shadow: 0 0 10px var(--neon-glow);
}
.toggle-icon { font-size: 0.9rem; }

/* ─── HERO ─── */
.hero {
  padding: 5rem 0 3.5rem;
  border-bottom: 1px solid var(--border);
  animation: fadeUp 0.7s ease both;
}

.page-hero {
  padding: 4rem 0 2.5rem;
  border-bottom: 1px solid var(--border);
  animation: fadeUp 0.7s ease both;
}

.hero-label {
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--neon);
  margin-bottom: 1.2rem;
}

.hero h1,
.page-title {
  font-family: var(--font-hero);
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.15;
  margin-bottom: 1.2rem;
  color: var(--text);
}

.hero h1 em {
  font-style: normal;
  color: var(--neon);
  position: relative;
}
.hero h1 em::after {
  content: '';
  position: absolute;
  bottom: 2px; left: 0; right: 0;
  height: 2px;
  background: var(--neon);
  opacity: 0.35;
}

.hero-sub {
  max-width: 520px;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.8;
}

/* Cursor blink */
.cursor {
  display: inline-block;
  width: 2px;
  height: 1em;
  background: var(--neon);
  margin-left: 4px;
  vertical-align: middle;
  animation: blink 1s step-end infinite;
}

/* ─── SECTION HEADER ─── */
.section-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 3rem 0 1.8rem;
}
.section-header h2 {
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
}
.section-header::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ─── TAG FILTER ─── */
.tag-filter {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 1.5rem 0 2rem;
  flex-wrap: wrap;
}
.tag-filter-label {
  font-size: 0.62rem;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  margin-right: 0.4rem;
}
.active-tag {
  background: var(--neon) !important;
  color: #fff !important;
  border-color: var(--neon) !important;
}

/* ─── CARDS ─── */
.posts-grid {
  display: grid;
  gap: 1.5px;
  margin-bottom: 4rem;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: grid;
  grid-template-columns: 280px 1fr;
  transition: border-color 0.25s, box-shadow 0.25s, transform 0.25s;
  animation: fadeUp 0.6s ease both;
  cursor: pointer;
}
.card:nth-child(1) { animation-delay: 0.1s; }
.card:nth-child(2) { animation-delay: 0.2s; }
.card:nth-child(3) { animation-delay: 0.3s; }

.card:hover {
  border-color: #999;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  transform: translateY(-2px);
  z-index: 1;
}
[data-theme="dark"] .card:hover {
  border-color: #555;
  box-shadow: 0 4px 20px rgba(0,0,0,0.35);
}

.card-img {
  overflow: hidden;
  height: 200px;
}
.card-img img {
  height: 100%;
  transition: transform 0.5s ease;
  filter: grayscale(15%);
}
.card:hover .card-img img {
  transform: scale(1.04);
  filter: grayscale(0%);
}

.card-body {
  padding: 1.5rem 1.8rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 0.8rem;
  flex-wrap: wrap;
}

.card-date, .read-time {
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.tag {
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: var(--bg-tag);
  color: var(--neon);
  padding: 2px 8px;
  border-radius: 2px;
  border: 1px solid var(--neon-dim);
  transition: background 0.2s;
}
.tag:hover {
  background: var(--neon-dim);
}

.card-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.3;
  margin-bottom: 0.6rem;
  color: var(--text);
}
.card-title a { color: inherit; }

.card-excerpt {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.7;
  flex: 1;
}

.card-link {
  margin-top: 1.2rem;
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--neon);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.card-link::after {
  content: '→';
  transition: transform 0.2s;
}
.card:hover .card-link::after { transform: translateX(4px); }

/* ─── ABOUT TEASER ─── */
.about-teaser {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--neon);
  border-radius: var(--radius);
  padding: 2rem 2.2rem;
  margin-bottom: 4rem;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2rem;
  align-items: center;
  animation: fadeUp 0.7s 0.4s ease both;
}

.about-teaser h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.3rem;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}
.about-teaser p {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.8;
}

.about-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 2px solid var(--neon);
  box-shadow: 0 0 20px var(--neon-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  flex-shrink: 0;
}

/* ─── SINGLE POST ─── */
.post-single {
  max-width: 680px;
  margin: 0 auto;
  padding: 3rem 0 5rem;
}

.post-cover {
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 2.5rem;
  max-height: 420px;
}

.post-header { margin-bottom: 2.5rem; }

.post-title {
  font-family: var(--font-hero);
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 400;
  line-height: 1.2;
  margin: 0.8rem 0 0.5rem;
}

.post-subtitle {
  font-size: 0.88rem;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 0.5rem;
}

/* Post content typography */
.post-content {
  font-size: 0.9rem;
  line-height: 1.9;
  color: var(--text);
}
.post-content h2 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  margin: 2.5rem 0 1rem;
  color: var(--text);
}
.post-content h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  margin: 2rem 0 0.8rem;
}
.post-content p { margin-bottom: 1.3rem; }
.post-content a { color: var(--neon); border-bottom: 1px solid var(--neon-dim); }
.post-content a:hover { border-color: var(--neon); }
.post-content blockquote {
  border-left: 3px solid var(--neon);
  padding: 0.8rem 1.2rem;
  margin: 1.5rem 0;
  color: var(--text-muted);
  font-style: italic;
  background: var(--bg-tag);
}
.post-content code {
  font-family: var(--font-mono);
  font-size: 0.82em;
  background: var(--bg-tag);
  padding: 2px 6px;
  border-radius: 2px;
  color: var(--neon);
}
.post-content pre {
  background: #0e0e0e;
  color: #f0f0f0;
  padding: 1.2rem;
  border-radius: var(--radius);
  overflow-x: auto;
  margin: 1.5rem 0;
  font-size: 0.8rem;
  line-height: 1.6;
}
.post-content pre code {
  background: none;
  color: inherit;
  padding: 0;
}
.post-content img {
  border-radius: var(--radius);
  margin: 1.5rem 0;
}
.post-content ul, .post-content ol {
  padding-left: 1.5rem;
  margin-bottom: 1.3rem;
}
.post-content li { margin-bottom: 0.4rem; }

/* Post nav */
.post-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}
.post-nav-link {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 45%;
}
.post-nav-link.next { align-items: flex-end; text-align: right; }
.post-nav-label {
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--neon);
}
.post-nav-title {
  font-size: 0.8rem;
  color: var(--text-muted);
  transition: color 0.2s;
}
.post-nav-link:hover .post-nav-title { color: var(--text); }

/* ─── PAGINATION ─── */
.pagination {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin: 2rem 0 4rem;
  list-style: none;
}
.pagination a, .pagination span {
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  transition: all 0.2s;
}
.pagination a:hover { border-color: var(--neon); color: var(--neon); }
.pagination .active a { border-color: var(--neon); color: var(--neon); }

/* ─── ACCENT ─── */
.accent { color: var(--neon); }

/* ─── FOOTER ─── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem;
}
.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ─── ANIMATIONS ─── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* ─── RESPONSIVE ─── */
@media (max-width: 640px) {
  .card { grid-template-columns: 1fr; }
  .card-img { height: 180px; }
  .about-teaser { grid-template-columns: 1fr; }
  .nav-links { gap: 1rem; }
  .post-nav { flex-direction: column; }
  .post-nav-link { max-width: 100%; }
  .post-nav-link.next { align-items: flex-start; text-align: left; }
  .footer-inner { flex-direction: column; gap: 0.5rem; text-align: center; }
}
