:root {
  --bg: #f0f4fb;
  --panel: #ffffff;
  --panel-soft: #f7f9fc;
  --line: rgba(0, 0, 0, 0.07);
  --text: #111827;
  --muted: #4b5563;
  --muted-soft: #9ca3af;
  --primary: #111827;
  --accent: #2563eb;
  --accent-soft: rgba(37, 99, 235, 0.08);
  --red: #ef4444;
  --red-soft: rgba(239, 68, 68, 0.08);
  --danger: #dc2626;
  --success: #16a34a;
  --shadow: 0 2px 16px rgba(0, 0, 0, 0.07);
  --shadow-md: 0 6px 28px rgba(0, 0, 0, 0.1);
  --radius: 20px;
  --max: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, Arial, Helvetica, sans-serif;
  color: var(--text);
  min-height: 100vh;
  background:
    radial-gradient(circle at 10% 8%, rgba(37, 99, 235, 0.07), transparent 28%),
    radial-gradient(circle at 88% 15%, rgba(99, 102, 241, 0.05), transparent 24%),
    radial-gradient(circle at 50% 88%, rgba(37, 99, 235, 0.04), transparent 30%),
    linear-gradient(180deg, #edf2ff 0%, #f3f6fc 40%, #f8fafd 100%);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    linear-gradient(rgba(0,0,0,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,0,0,0.025) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(circle at center, black 55%, transparent 95%);
  pointer-events: none;
  z-index: 0;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
}

.wrap {
  position: relative;
  z-index: 1;
  width: min(var(--max), calc(100% - 28px));
  margin: 0 auto;
  padding: 26px 0 54px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 8px 0 26px;
}

.nav .nav-right {
  flex: 1;
  justify-content: flex-end;
}

/* Desktop: theme-toggle after nav-right */
.nav > .theme-toggle {
  order: 10;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.2px;
  color: var(--primary);
  text-decoration: none;
}

.brand span {
  color: var(--muted);
  font-weight: 500;
}

.avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center;
  border: 2px solid rgba(37, 99, 235, 0.35);
  box-shadow: 0 0 14px rgba(37, 99, 235, 0.15);
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.nav-links a {
  text-decoration: none;
  color: var(--muted);
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(0,0,0,0.04);
  border: 1px solid rgba(0,0,0,0.07);
  transition: 0.22s ease;
  font-size: 14px;
}

.nav-links a:hover {
  color: var(--text);
  background: rgba(0,0,0,0.07);
  border-color: rgba(0,0,0,0.12);
  transform: translateY(-1px);
}

.panel,
.section-card,
.hero-card,
.hero-visual,
.post-card,
.admin-card,
.empty-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero-shell {
  display: grid;
  gap: 22px;
  margin-top: 8px;
}

.hero-visual {
  position: relative;
  min-height: 300px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(0, 10, 30, 0.12), rgba(0, 10, 30, 0.44)),
    url("https://images.unsplash.com/photo-1499951360447-b19be8fe80f5?auto=format&fit=crop&w=1600&q=80") center center / cover no-repeat;
}

.hero-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(5, 15, 40, 0.62) 0%, rgba(5, 15, 40, 0.22) 50%, rgba(5, 15, 40, 0.55) 100%);
}

.hero-visual-inner {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  align-items: end;
  padding: 32px;
}

.hero-quote {
  max-width: 680px;
  color: #eef4ff;
}

.hero-quote-label,
.label {
  display: inline-flex;
  margin-bottom: 14px;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 12px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(37, 99, 235, 0.09);
  border: 1px solid rgba(37, 99, 235, 0.16);
}

.hero-quote h2,
.page-title {
  margin: 0;
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.08;
  letter-spacing: -1px;
}

.hero-quote p,
.page-subtitle {
  margin: 14px 0 0;
  color: rgba(236, 243, 255, 0.88);
  line-height: 1.8;
  font-size: 15px;
  max-width: 720px;
}

.hero-main {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 22px;
}

.hero-card {
  padding: 40px;
  min-height: 410px;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 40px;
  background: #ffffff;
  position: relative;
  overflow: hidden;
}

.hero-card-content {
  flex: 1;
  min-width: 0;
}

.hero-photo-wrap {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.hero-social {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.hero-social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  overflow: hidden;
}

.hero-social-btn img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.hero-social-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.22);
}

.hero-photo {
  width: 170px;
  height: 170px;
  border-radius: 20px;
  object-fit: cover;
  object-position: center top;
  border: 2px solid var(--line);
  box-shadow: 0 8px 32px rgba(37, 99, 235, 0.14);
  display: block;
}

.hero-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #ef4444 0%, #2563eb 45%, #818cf8 100%);
  border-radius: 20px 20px 0 0;
}

.eyebrow {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid rgba(37, 99, 235, 0.14);
  font-size: 12px;
  margin-bottom: 18px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(42px, 7vw, 78px);
  line-height: 0.95;
  letter-spacing: -2px;
  color: var(--text);
}

.hero-subtitle {
  margin-top: 18px;
  font-size: clamp(18px, 2.2vw, 24px);
  font-weight: 600;
  color: var(--muted);
}

.hero-text,
.about-text,
.metric span,
.post-excerpt,
.post-content,
.muted {
  color: var(--muted);
  line-height: 1.9;
  font-size: 16px;
}

.cta-row,
.links-row,
.app-links,
.top-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.btn,
.app-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 14px;
  text-decoration: none;
  font-weight: 700;
  transition: 0.22s ease;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
}

.btn-primary {
  color: #ffffff;
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.28);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.38);
}

.btn-secondary,
.app-link {
  color: var(--text);
  background: rgba(0,0,0,0.04);
  border-color: rgba(0,0,0,0.09);
}

.btn-secondary:hover,
.app-link:hover {
  transform: translateY(-2px);
  background: rgba(0,0,0,0.07);
  border-color: rgba(0,0,0,0.15);
}

.btn-danger {
  color: #fff;
  background: rgba(220, 38, 38, 0.1);
  border-color: rgba(220, 38, 38, 0.28);
  color: var(--danger);
}

.btn-danger:hover {
  transform: translateY(-2px);
  background: rgba(220, 38, 38, 0.16);
}

.btn-success {
  color: #065f46;
  background: linear-gradient(135deg, #d1fae5, #6ee7b7);
}

.btn-success:hover {
  transform: translateY(-2px);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.chip {
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.06);
  border: 1px solid rgba(37, 99, 235, 0.12);
  color: #1d4ed8;
  font-size: 13px;
}

.side-stack,
.metric-list,
.story-list,
.posts-grid,
.admin-list {
  display: grid;
  gap: 16px;
}

.panel {
  padding: 26px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.panel h3,
.section-title,
.admin-card h2,
.admin-card h3,
.post-card h2,
.post-card h3 {
  margin: 0 0 16px;
  font-size: 22px;
  letter-spacing: -0.4px;
  color: var(--text);
}

.metric {
  padding: 16px;
  border-radius: 16px;
  background: rgba(37, 99, 235, 0.04);
  border: 1px solid rgba(37, 99, 235, 0.10);
}

.metric strong {
  display: block;
  margin-bottom: 6px;
  font-size: 15px;
  color: var(--text);
}

.main-sections {
  display: grid;
  gap: 22px;
  margin-top: 22px;
}

.section-card {
  padding: 30px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.section-note {
  color: var(--muted-soft);
  font-size: 14px;
  max-width: 620px;
  line-height: 1.7;
}

.apps-grid,
.journal-grid,
.blog-layout,
.admin-layout {
  display: grid;
  gap: 16px;
}

.apps-grid {
  grid-template-columns: repeat(2, 1fr);
}

.journal-grid {
  grid-template-columns: 1.1fr 0.9fr;
}

.app-card,
.journal-card,
.post-card,
.admin-card,
.empty-card {
  padding: 24px;
  border-radius: 18px;
  background: #ffffff;
  border: 1px solid rgba(0,0,0,0.07);
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.05);
}

.app-card:hover,
.post-card:hover {
  transform: translateY(-4px);
  border-color: rgba(37, 99, 235, 0.2);
  box-shadow: 0 10px 28px rgba(37, 99, 235, 0.1);
}

.app-card,
.post-card {
  transition: 0.22s ease;
}

.app-top,
.post-top,
.admin-item-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

.app-card h4,
.post-card h2,
.post-card h3 {
  margin: 0;
  font-size: 24px;
  letter-spacing: -0.4px;
  color: var(--text);
}

.app-badge,
.post-badge {
  display: inline-flex;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  background: rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(37, 99, 235, 0.14);
  white-space: nowrap;
}

.story-item {
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(0,0,0,0.02);
  border: 1px solid rgba(0,0,0,0.06);
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.story-item strong {
  display: block;
  margin-bottom: 4px;
  color: var(--text);
  font-size: 14px;
}

.footer {
  margin-top: 28px;
  padding: 20px 2px 8px;
  text-align: center;
  color: var(--muted-soft);
  font-size: 14px;
}

.footer-social {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 14px;
}

.footer-social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  overflow: hidden;
}

.footer-social-btn img {
  width: 26px;
  height: 26px;
  object-fit: contain;
}

.footer-social-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.22);
}

.disclaimer {
  max-width: 560px;
  margin: 0 auto 14px;
  font-size: 12px;
  color: var(--muted-soft);
  line-height: 1.6;
  font-style: italic;
  opacity: 0.7;
}

.footer-copy {
  color: var(--muted-soft);
  font-size: 14px;
}

.version-tag {
  display: inline-flex;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.4px;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid rgba(37, 99, 235, 0.14);
  vertical-align: middle;
}

.blog-layout {
  grid-template-columns: 1fr;
}

.posts-grid {
  grid-template-columns: repeat(2, 1fr);
}

.post-card a.title-link {
  text-decoration: none;
}

.post-meta {
  color: var(--muted-soft);
  font-size: 13px;
  margin-bottom: 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.meta-date { white-space: nowrap; }
.meta-read { white-space: nowrap; }
.meta-sep  { opacity: 0.4; }

.post-content {
  white-space: pre-wrap;
}

.empty-card {
  text-align: center;
}

.admin-layout {
  grid-template-columns: 1.1fr 0.9fr;
  align-items: start;
}

label {
  display: block;
  margin-bottom: 8px;
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
}

input,
textarea,
select {
  width: 100%;
  background: rgba(0,0,0,0.03);
  color: var(--text);
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 14px;
  padding: 14px 16px;
  outline: none;
  font-family: inherit;
  font-size: 15px;
}

textarea {
  min-height: 180px;
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(37, 99, 235, 0.45);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.10);
}

.form-row {
  display: grid;
  gap: 14px;
  margin-bottom: 14px;
}

.form-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 18px;
}

/* ── Newsletter ─────────────────────────────────────────── */

.newsletter-section {
  text-align: left;
}

.newsletter-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  max-width: 480px;
}

.newsletter-row input[type="email"] {
  flex: 1;
  min-width: 200px;
}

.newsletter-status {
  max-width: 480px;
}

.status-box {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 16px;
  font-size: 14px;
  display: none;
}

.status-box.show {
  display: block;
}

.status-success {
  background: rgba(22, 163, 74, 0.08);
  border: 1px solid rgba(22, 163, 74, 0.22);
  color: #15803d;
}

.status-error {
  background: rgba(220, 38, 38, 0.08);
  border: 1px solid rgba(220, 38, 38, 0.22);
  color: #dc2626;
}

.admin-item {
  padding: 18px;
  border-radius: 16px;
  background: rgba(0,0,0,0.02);
  border: 1px solid rgba(0,0,0,0.06);
}

.small {
  font-size: 13px;
  color: var(--muted-soft);
}

.hidden {
  display: none !important;
}

@media (max-width: 980px) {
  .hero-main,
  .journal-grid,
  .apps-grid,
  .posts-grid,
  .admin-layout {
    grid-template-columns: 1fr;
  }

  .hero-visual {
    min-height: 240px;
  }

  .hero-card {
    flex-direction: column-reverse;
    align-items: flex-start;
    gap: 24px;
  }

  .hero-photo {
    width: 110px;
    height: 110px;
    border-radius: 14px;
  }
}

@media (max-width: 700px) {
  .wrap {
    width: min(calc(100% - 20px), var(--max));
    padding-top: 18px;
  }

  /* Mobile nav: row 1 = brand + theme-toggle, row 2 = links */
  .nav {
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding-bottom: 12px;
  }

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

  /* theme-toggle stays on row 1 next to brand */
  .nav > .theme-toggle {
    order: 0;
    flex-shrink: 0;
  }

  /* nav-right drops to full-width row 2 */
  .nav .nav-right {
    flex: 0 0 100%;
    justify-content: flex-start;
    order: 1;
  }

  .nav-links {
    justify-content: flex-start;
  }

  .nav-social {
    display: none !important;
  }

  .hero-card,
  .panel,
  .section-card,
  .hero-visual-inner,
  .post-card,
  .admin-card {
    padding: 22px;
  }

  h1 {
    letter-spacing: -1.3px;
  }

  .brand {
    font-size: 20px;
  }

  .avatar {
    width: 40px;
    height: 40px;
  }
}

.EasyMDEContainer {
  background: transparent;
}

.EasyMDEContainer .CodeMirror {
  background: rgba(0,0,0,0.03);
  color: var(--text);
  border: 1px solid rgba(0,0,0,0.10);
  border-radius: 14px;
  min-height: 260px;
  padding: 8px 10px;
}

.EasyMDEContainer .CodeMirror[dir="rtl"],
.EasyMDEContainer .CodeMirror.CodeMirror-rtl {
  direction: rtl;
  text-align: right;
}

.EasyMDEContainer .CodeMirror[dir="rtl"] .CodeMirror-lines,
.EasyMDEContainer .CodeMirror.CodeMirror-rtl .CodeMirror-lines {
  direction: rtl;
  text-align: right;
}

.EasyMDEContainer .editor-toolbar {
  background: rgba(0,0,0,0.02);
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 14px;
  margin-bottom: 10px;
}

.EasyMDEContainer .editor-toolbar button {
  color: var(--muted) !important;
}

.EasyMDEContainer .editor-toolbar i.separator {
  border-left: 1px solid rgba(0,0,0,0.12);
  border-right: none;
}

.markdown-body {
  color: var(--text);
  line-height: 1.9;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4 {
  color: var(--text);
  margin-top: 28px;
  margin-bottom: 14px;
}

.markdown-body p {
  margin: 0 0 18px;
}

.markdown-body ul,
.markdown-body ol {
  margin: 0 0 18px 24px;
}

.markdown-body code {
  background: rgba(0,0,0,0.06);
  padding: 2px 6px;
  border-radius: 6px;
  color: #1d4ed8;
}

.markdown-body pre {
  background: rgba(0,0,0,0.04);
  border: 1px solid rgba(0,0,0,0.08);
  padding: 16px;
  border-radius: 16px;
  overflow-x: auto;
}

.markdown-body pre code {
  color: var(--text);
  background: none;
}

.markdown-body blockquote {
  margin: 20px 0;
  padding: 14px 18px;
  border-left: 4px solid rgba(37, 99, 235, 0.4);
  background: rgba(37, 99, 235, 0.04);
  border-radius: 10px;
  color: var(--muted);
}

/* ── Nav Right ── */
.nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-social {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  overflow: hidden;
  flex-shrink: 0;
}

.nav-social-btn img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.nav-social-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.22);
}

/* ── Theme Toggle Button ── */
.theme-toggle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--panel-soft);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.22s ease;
  color: var(--muted);
  flex-shrink: 0;
  outline: none;
  padding: 0;
}

.theme-toggle:hover {
  background: var(--accent-soft);
  border-color: rgba(37, 99, 235, 0.22);
  color: var(--accent);
  transform: rotate(18deg);
}

/* ── App Card Covers ── */
.app-card {
  overflow: hidden;
}

.app-cover {
  margin: -24px -24px 20px;
  height: 165px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.app-cover-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

.app-cover-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.app-cover-math .app-cover-overlay {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.48) 0%, rgba(99, 102, 241, 0.38) 100%);
}

.app-cover-english .app-cover-overlay {
  background: linear-gradient(135deg, rgba(5, 150, 105, 0.48) 0%, rgba(6, 182, 212, 0.38) 100%);
}

.app-cover-symbol {
  position: relative;
  z-index: 2;
  font-size: 58px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -2px;
  color: #ffffff;
  opacity: 0.92;
  font-family: Inter, Arial, sans-serif;
  text-shadow: 0 2px 16px rgba(0,0,0,0.3);
}

/* ── Featured Journal Card (Blog section) ── */
.journal-card-featured {
  position: relative;
  overflow: hidden;
  padding: 0;
}

.journal-card-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

.journal-card-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(160deg, rgba(238, 242, 255, 0.92) 0%, rgba(245, 243, 255, 0.88) 100%);
}

.journal-card-body {
  position: relative;
  z-index: 2;
  padding: 24px;
}

/* ── Dark Mode ── */
html[data-theme="dark"] {
  --bg: #08121f;
  --panel: #111c2d;
  --panel-soft: #0d1625;
  --line: rgba(255, 255, 255, 0.08);
  --text: #f0f4fc;
  --muted: #a8b8cc;
  --muted-soft: #6b7d92;
  --primary: #f0f4fc;
  --accent: #6ea8fe;
  --accent-soft: rgba(110, 168, 254, 0.13);
  --red: #f87171;
  --red-soft: rgba(248, 113, 113, 0.12);
  --danger: #ff6b6b;
  --success: #7fe6a2;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.32);
}

html[data-theme="dark"] body {
  background:
    radial-gradient(circle at 10% 8%, rgba(110, 168, 254, 0.11), transparent 28%),
    radial-gradient(circle at 88% 15%, rgba(99, 102, 241, 0.07), transparent 24%),
    radial-gradient(circle at 50% 88%, rgba(37, 99, 235, 0.05), transparent 30%),
    linear-gradient(180deg, #070f1e 0%, #0b1624 50%, #09131e 100%);
}

html[data-theme="dark"] body::before {
  background:
    linear-gradient(rgba(255,255,255,0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.018) 1px, transparent 1px);
  background-size: 42px 42px;
}

html[data-theme="dark"] .hero-card {
  background: linear-gradient(160deg, #14202e, #0e1826);
}

html[data-theme="dark"] .app-card,
html[data-theme="dark"] .journal-card,
html[data-theme="dark"] .post-card,
html[data-theme="dark"] .admin-card,
html[data-theme="dark"] .empty-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0.025));
  border-color: rgba(255,255,255,0.07);
  box-shadow: 0 2px 12px rgba(0,0,0,0.22);
}

html[data-theme="dark"] .app-card:hover,
html[data-theme="dark"] .post-card:hover {
  border-color: rgba(110, 168, 254, 0.24);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
}

html[data-theme="dark"] .btn-secondary,
html[data-theme="dark"] .app-link {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.10);
  color: var(--text);
}

html[data-theme="dark"] .btn-secondary:hover,
html[data-theme="dark"] .app-link:hover {
  background: rgba(255,255,255,0.10);
  border-color: rgba(255,255,255,0.18);
}

html[data-theme="dark"] .nav-links a {
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.07);
}

html[data-theme="dark"] .nav-links a:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.14);
  color: var(--text);
}

html[data-theme="dark"] .theme-toggle {
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.08);
}

html[data-theme="dark"] .theme-toggle:hover {
  background: rgba(110, 168, 254, 0.12);
  border-color: rgba(110, 168, 254, 0.22);
  color: var(--accent);
}

html[data-theme="dark"] .chip {
  background: rgba(110, 168, 254, 0.10);
  border-color: rgba(110, 168, 254, 0.18);
  color: #93c5fd;
}

html[data-theme="dark"] .metric {
  background: rgba(110, 168, 254, 0.06);
  border-color: rgba(110, 168, 254, 0.12);
}

html[data-theme="dark"] .story-item {
  background: rgba(255,255,255,0.03);
  border-color: rgba(255,255,255,0.07);
}

html[data-theme="dark"] .admin-item {
  background: rgba(255,255,255,0.03);
  border-color: rgba(255,255,255,0.06);
}

html[data-theme="dark"] input,
html[data-theme="dark"] textarea,
html[data-theme="dark"] select {
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.12);
  color: var(--text);
}

html[data-theme="dark"] .EasyMDEContainer .CodeMirror {
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.10);
  color: var(--text);
}

html[data-theme="dark"] .EasyMDEContainer .editor-toolbar {
  background: rgba(255,255,255,0.03);
  border-color: rgba(255,255,255,0.08);
}

html[data-theme="dark"] .EasyMDEContainer .editor-toolbar button {
  color: var(--muted) !important;
}

html[data-theme="dark"] .EasyMDEContainer .editor-toolbar i.separator {
  border-left-color: rgba(255,255,255,0.12);
}

html[data-theme="dark"] .markdown-body code {
  background: rgba(255,255,255,0.08);
  color: #93c5fd;
}

html[data-theme="dark"] .markdown-body pre {
  background: rgba(0,0,0,0.28);
  border-color: rgba(255,255,255,0.08);
}

html[data-theme="dark"] .markdown-body pre code {
  color: var(--text);
  background: none;
}

html[data-theme="dark"] .markdown-body blockquote {
  border-left-color: rgba(110, 168, 254, 0.5);
  background: rgba(110, 168, 254, 0.07);
}

html[data-theme="dark"] .app-badge,
html[data-theme="dark"] .post-badge {
  background: rgba(110, 168, 254, 0.12);
  border-color: rgba(110, 168, 254, 0.22);
  color: #93c5fd;
}

html[data-theme="dark"] .label,
html[data-theme="dark"] .eyebrow,
html[data-theme="dark"] .hero-quote-label {
  background: rgba(110, 168, 254, 0.10);
  border-color: rgba(110, 168, 254, 0.20);
  color: #93c5fd;
}

html[data-theme="dark"] .status-success {
  background: rgba(127, 230, 162, 0.10);
  border-color: rgba(127, 230, 162, 0.24);
  color: #b9f5cf;
}

html[data-theme="dark"] .status-error {
  background: rgba(255, 107, 107, 0.10);
  border-color: rgba(255, 107, 107, 0.24);
  color: #ffd4d4;
}

html[data-theme="dark"] .app-cover-math {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.22), rgba(99, 102, 241, 0.18));
}

html[data-theme="dark"] .app-cover-english {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.20), rgba(6, 182, 212, 0.15));
}

html[data-theme="dark"] .app-cover-symbol {
  color: #93c5fd;
  opacity: 0.6;
}

html[data-theme="dark"] .app-cover-english .app-cover-symbol {
  color: #6ee7b7;
}

html[data-theme="dark"] .journal-card-featured .journal-card-overlay {
  background: linear-gradient(160deg, rgba(8, 18, 42, 0.68) 0%, rgba(15, 8, 38, 0.62) 100%);
}

html[data-theme="dark"] .hero-photo {
  border-color: rgba(110, 168, 254, 0.2);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

html[data-theme="dark"] .app-cover-math .app-cover-overlay {
  background: linear-gradient(135deg, rgba(30, 58, 180, 0.55) 0%, rgba(70, 60, 200, 0.48) 100%);
}

html[data-theme="dark"] .app-cover-english .app-cover-overlay {
  background: linear-gradient(135deg, rgba(5, 100, 80, 0.55) 0%, rgba(6, 120, 140, 0.48) 100%);
}

/* ── Photo Strip ── */
.photo-strip {
  border-radius: var(--radius);
  overflow: hidden;
  min-height: 190px;
  position: relative;
  box-shadow: var(--shadow);
}

.photo-strip-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

.photo-strip-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(90deg, rgba(0,0,0,0.42) 0%, rgba(0,0,0,0.14) 55%, rgba(0,0,0,0.36) 100%);
}

.photo-strip-inner {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 190px;
  padding: 36px 44px;
}

.photo-strip-label {
  display: inline-flex;
  margin-bottom: 12px;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.75);
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.16);
  width: fit-content;
}

.photo-strip-quote {
  font-size: clamp(18px, 2.8vw, 28px);
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.5px;
  margin: 0;
  line-height: 1.28;
  max-width: 580px;
}

@media (max-width: 700px) {
  .photo-strip-inner {
    padding: 28px 24px;
  }
}

html[data-theme="dark"] .journal-decor {
  color: rgba(110, 168, 254, 0.10);
}

/* ── Chip links ── */
.chip-link {
  text-decoration: none;
  cursor: pointer;
  transition: 0.22s ease;
}
.chip-link:hover {
  transform: translateY(-2px);
  background: rgba(37, 99, 235, 0.13);
  border-color: rgba(37, 99, 235, 0.26);
}
html[data-theme="dark"] .chip-link:hover {
  background: rgba(110, 168, 254, 0.16);
  border-color: rgba(110, 168, 254, 0.30);
}

/* ── Category hero ── */
.cat-hero {
  position: relative;
  min-height: 280px;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  margin-bottom: 22px;
}
.cat-hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}
.cat-hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(90deg, rgba(0,0,0,0.74) 0%, rgba(0,0,0,0.34) 55%, rgba(0,0,0,0.62) 100%);
}
.cat-hero-body {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 280px;
  padding: 36px;
}
.cat-hero-label {
  display: inline-flex;
  margin-bottom: 12px;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.82);
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.20);
  width: fit-content;
}
.cat-hero-body h1 {
  margin: 0;
  font-size: clamp(28px, 5vw, 52px);
  font-weight: 800;
  letter-spacing: -1.5px;
  color: #ffffff;
  line-height: 1.05;
}
.cat-hero-body p {
  margin: 12px 0 0;
  color: rgba(255,255,255,0.78);
  font-size: 16px;
  line-height: 1.7;
  max-width: 560px;
}

/* RTL / Hebrew support */
[dir="rtl"] {
  font-family: Inter, Arial, "Segoe UI", Helvetica, sans-serif;
}

[dir="rtl"] .markdown-body blockquote {
  border-left: none;
  border-right: 4px solid rgba(37, 99, 235, 0.4);
}

[dir="rtl"] .markdown-body ul,
[dir="rtl"] .markdown-body ol {
  margin: 0 24px 18px 0;
  padding-right: 0;
}

[dir="rtl"] .post-top {
  flex-direction: row-reverse;
}

[dir="rtl"] .top-actions {
  justify-content: flex-start;
}

[dir="rtl"] .section-head {
  flex-direction: row-reverse;
}

[dir="rtl"] .label,
[dir="rtl"] .eyebrow {
  direction: rtl;
}


/* ── Likes & Comments ── */
.engagement-section {
  margin-top: 0;
}

.likes-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 32px;
}

.reactions-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.reaction-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel-soft);
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  color: var(--text);
}

.reaction-emoji {
  font-size: 18px;
  line-height: 1;
}

.reaction-count {
  font-weight: 600;
  min-width: 12px;
}

.reaction-label {
  color: var(--muted);
  font-size: 12px;
}

.reaction-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
  background: var(--panel);
}

.reaction-btn.reacted {
  background: rgba(37, 99, 235, 0.1);
  border-color: rgba(37, 99, 235, 0.3);
}

.reaction-btn:disabled {
  cursor: default;
}

html[data-theme="dark"] .reaction-btn.reacted {
  background: rgba(110, 168, 254, 0.12);
  border-color: rgba(110, 168, 254, 0.3);
}

.like-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.06);
  border: 1px solid rgba(37, 99, 235, 0.18);
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.2s ease;
}

.like-btn:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.3);
  color: #ef4444;
  transform: translateY(-1px);
}

.like-btn.liked {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
  color: #ef4444;
}

.like-btn:disabled {
  cursor: default;
}

html[data-theme="dark"] .like-btn {
  background: rgba(110, 168, 254, 0.08);
  border-color: rgba(110, 168, 254, 0.18);
}

html[data-theme="dark"] .like-btn.liked {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.3);
  color: #f87171;
}

.comments-title {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 20px;
  color: var(--text);
}

.comment-card {
  padding: 16px 20px;
  background: rgba(37, 99, 235, 0.04);
  border: 1px solid var(--border);
  border-radius: 14px;
  margin-bottom: 14px;
}

html[data-theme="dark"] .comment-card {
  background: rgba(110, 168, 254, 0.06);
}

.comment-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.comment-author {
  font-size: 14px;
  color: var(--text);
}

.comment-date {
  font-size: 12px;
  color: var(--muted);
}

.comment-text {
  margin: 0;
  font-size: 15px;
  line-height: 1.65;
  color: var(--text);
}

.comment-form {
  margin-top: 28px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}

/* ── Reading progress bar ──────────────────────────────── */

#readProgress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, #2563eb, #60a5fa);
  z-index: 9999;
  transition: width 0.1s linear;
  pointer-events: none;
}

/* ── Heading anchor copy links ─────────────────────────── */

.heading-anchor {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  opacity: 0;
  color: var(--muted);
  text-decoration: none;
  vertical-align: middle;
  transition: opacity 0.15s, color 0.15s;
}

h2:hover .heading-anchor,
h3:hover .heading-anchor,
h4:hover .heading-anchor {
  opacity: 1;
}

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

.heading-anchor-copied {
  opacity: 1 !important;
  color: #16a34a !important;
}

/* ── Blog search ───────────────────────────────────────── */

.search-wrap {
  position: relative;
  width: 240px;
}

.search-wrap input[type="search"] {
  width: 100%;
  padding-left: 34px;
  font-size: 14px;
}

.search-icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

/* ── Pinned badge ──────────────────────────────────────── */

.post-badge-pinned {
  background: rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(37, 99, 235, 0.22);
  color: #2563eb;
}

/* ── Related posts ─────────────────────────────────────── */

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.related-card {
  display: block;
  padding: 18px 20px;
  border-radius: 16px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  text-decoration: none;
  color: var(--text);
  transition: 0.2s ease;
}

.related-card:hover {
  transform: translateY(-3px);
  border-color: rgba(37, 99, 235, 0.25);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.08);
}

.related-title {
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 8px;
  line-height: 1.4;
}

.related-excerpt {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── RSS link ──────────────────────────────────────────── */

.rss-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s;
}

.rss-link:hover {
  color: #f97316;
}

/* ── Honeypot (anti-spam hidden field) ── */
/* ── Sports widget ─────────────────────────────────────── */

.sports-section {
  position: relative;
}

.sports-section::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, #ef4444 0%, #f97316 50%, #ef4444 100%);
  border-radius: var(--radius) var(--radius) 0 0;
}

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

@media (max-width: 640px) {
  .sports-grid { grid-template-columns: 1fr; }
}

.sport-panel {
  border-radius: 16px;
  border: 1px solid var(--line);
  overflow: hidden;
  background: var(--panel-soft);
}

.sport-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}

.sport-emoji { font-size: 22px; line-height: 1; }

.sport-title {
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
}

.sport-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 1px;
}

.scores-list {
  display: flex;
  flex-direction: column;
}

.score-card {
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
}

.score-card:last-child { border-bottom: none; }

.score-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2px 0;
  gap: 8px;
}

.score-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
}

.score-num {
  font-size: 15px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  min-width: 28px;
  text-align: right;
  color: var(--muted);
}

.score-winner.score-name,
.score-winner.score-num {
  color: var(--text);
}

.score-status {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-top: 5px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.score-final   { color: var(--muted-soft); }
.score-live    { color: var(--red); }
.score-upcoming { color: var(--muted); }

.scores-empty {
  padding: 14px 16px;
  color: var(--muted);
  font-size: 13px;
  margin: 0;
}

/* Yesterday divider */
.scores-day-divider {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 10px 16px 4px;
  border-top: 1px solid var(--line);
  margin-top: 8px;
}

/* Standings section */
.standings-header {
  font-size: 14px;
  font-weight: 700;
  color: var(--fg);
  padding: 18px 0 10px;
  border-top: 1px solid var(--line);
  margin-top: 20px;
}
.standings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 640px) {
  .standings-grid { grid-template-columns: 1fr; }
}
.standings-panel {
  background: var(--card2);
  border-radius: 12px;
  overflow: hidden;
}
.standings-conf-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 10px 14px 6px;
  border-bottom: 1px solid var(--line);
}
.standings-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.standings-table th {
  text-align: right;
  padding: 5px 10px;
  color: var(--muted);
  font-weight: 600;
  font-size: 11px;
  background: var(--card2);
}
.standings-table th:first-child { text-align: left; }
.standings-table td {
  padding: 5px 10px;
  text-align: right;
  border-bottom: 1px solid var(--line);
  color: var(--fg);
}
.standings-table td:first-child { text-align: left; font-weight: 500; }
.standings-table tr:last-child td { border-bottom: none; }
.standings-table tr.playoff-spot td:first-child {
  border-left: 3px solid var(--accent);
}
.standings-table tr.play-in-spot td:first-child {
  border-left: 3px solid var(--red);
}

/* Pulsing red dot for live games */
.live-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--red);
  animation: livePulse 1.4s ease-in-out infinite;
  flex-shrink: 0;
}

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

/* World Cup countdown */
.wc-countdown {
  padding: 28px 20px;
  text-align: center;
}

.wc-days {
  font-size: 58px;
  font-weight: 800;
  line-height: 1;
  background: linear-gradient(135deg, var(--red), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.wc-days-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--muted);
  margin-top: 6px;
}

.wc-info {
  font-size: 12px;
  color: var(--muted-soft);
  margin-top: 12px;
  line-height: 1.7;
}

/* ── Honeypot (anti-spam hidden field) ── */
.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

/* ═══════════════════════════════════════════════════════════
   WOW FACTOR — animations, hover glow, transitions
   ═══════════════════════════════════════════════════════════ */

/* ── Font: Plus Jakarta Sans ───────────────────────────────── */
body {
  font-family: "Plus Jakarta Sans", Inter, Arial, Helvetica, sans-serif;
}

/* ── Smooth theme transitions ──────────────────────────────── */
html.theme-transitioning *,
html.theme-transitioning *::before,
html.theme-transitioning *::after {
  transition:
    background-color 0.45s ease,
    border-color     0.45s ease,
    color            0.35s ease,
    box-shadow       0.35s ease !important;
}

/* ── Scroll reveal ─────────────────────────────────────────── */
.will-reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}
.will-reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* ── Enhanced card hover glow ──────────────────────────────── */
.app-card,
.post-card {
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.app-card:hover,
.post-card:hover {
  transform: translateY(-6px) scale(1.012);
  box-shadow:
    0 16px 48px rgba(37, 99, 235, 0.14),
    0 4px 12px rgba(0, 0, 0, 0.08),
    0 0 0 1px rgba(37, 99, 235, 0.12);
  border-color: rgba(37, 99, 235, 0.22);
}
html[data-theme="dark"] .app-card:hover,
html[data-theme="dark"] .post-card:hover {
  box-shadow:
    0 16px 48px rgba(110, 168, 254, 0.18),
    0 4px 16px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(110, 168, 254, 0.2);
  border-color: rgba(110, 168, 254, 0.28);
}

/* ── Journal cards hover ───────────────────────────────────── */
.journal-card {
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.journal-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 36px rgba(37, 99, 235, 0.12);
}

/* ── Gradient text on hero h1 ──────────────────────────────── */
.hero-card h1 {
  background: linear-gradient(135deg, var(--text) 30%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
html[data-theme="dark"] .hero-card h1 {
  background: linear-gradient(135deg, #f0f4fc 20%, #6ea8fe 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

/* ── Section title gradient ────────────────────────────────── */
.section-title {
  background: linear-gradient(120deg, var(--text) 60%, var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: inline-block;
}

/* ── Hero card subtle perspective on hover ─────────────────── */
.hero-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  transform-style: preserve-3d;
  will-change: transform;
}

/* ── Enhanced nav glass ────────────────────────────────────── */
.nav {
  backdrop-filter: blur(18px) saturate(1.6);
  -webkit-backdrop-filter: blur(18px) saturate(1.6);
}

/* ── Button ripple ─────────────────────────────────────────── */
.btn-ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  transform: scale(0);
  animation: ripple-anim 0.5s ease-out forwards;
  pointer-events: none;
}
@keyframes ripple-anim {
  to { transform: scale(2.5); opacity: 0; }
}

/* ── Button shimmer on hover ───────────────────────────────── */
.btn-primary {
  background-size: 200% 100%;
  background-image: linear-gradient(90deg, #2563eb 0%, #3b82f6 40%, #2563eb 100%);
  transition: background-position 0.4s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.btn-primary:hover {
  background-position: -60% 0;
  box-shadow: 0 4px 20px rgba(37, 99, 235, 0.4);
  transform: translateY(-1px);
}

/* ── Chip hover animation ──────────────────────────────────── */
.chip {
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.chip:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.18);
}

/* ── Custom scrollbar ──────────────────────────────────────── */
::-webkit-scrollbar       { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 999px;
  opacity: 0.5;
}
::-webkit-scrollbar-thumb:hover { background: #1d4ed8; }

/* ── Text selection ────────────────────────────────────────── */
::selection {
  background: rgba(37, 99, 235, 0.2);
  color: inherit;
}

/* ── Blog excerpt line-clamp ───────────────────────────────── */
.post-excerpt {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 4.5em;
}

/* ── Score card hover ──────────────────────────────────────── */
.score-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.score-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.12);
}

/* ── Sport panel hover ─────────────────────────────────────── */
.sport-panel {
  transition: box-shadow 0.25s ease;
}
.sport-panel:hover {
  box-shadow: 0 8px 32px rgba(37, 99, 235, 0.1);
}

/* ── Animate in page title on post.html ────────────────────── */
.page-title {
  animation: titleFadeIn 0.6s ease both;
}
@keyframes titleFadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Section card subtle left border accent ────────────────── */
.section-card {
  border-left: 3px solid transparent;
  transition: border-color 0.3s ease;
}
.section-card:hover {
  border-left-color: var(--accent);
}

/* ── Language / Translate button ──────────────────────────── */
.lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--accent);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  padding: 5px 11px;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
  white-space: nowrap;
}
.lang-flag {
  font-size: 1rem;
  line-height: 1;
}
.lang-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #fff;
  line-height: 1;
}
.lang-btn:hover {
  transform: translateY(-1px) scale(1.04);
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.45);
  background: #1d4ed8;
}

/* ── Brand logo (cropped from logo.png, shows A-circle) ─── */
.brand-logo {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  object-fit: cover;
  object-position: 50% 28%;
  flex-shrink: 0;
  filter: drop-shadow(0 0 6px rgba(14,165,233,0.45));
  transition: filter 0.25s ease, transform 0.25s ease;
}
.brand:hover .brand-logo {
  filter: drop-shadow(0 0 12px rgba(14,165,233,0.7)) drop-shadow(0 0 5px rgba(249,115,22,0.35));
  transform: scale(1.06);
}

/* ── Brand text: ASSAFLEV.IT.COM ───────────────────────── */
.brand .brand-it {
  color: #f97316;
  font-weight: 800;
}
html[data-theme="dark"] .brand div {
  color: #e8f0fc;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.03em;
}


/* Hide Google Translate toolbar so it doesn't push layout */
.goog-te-banner-frame, #goog-gt-tt, .goog-te-balloon-frame { display: none !important; }
.skiptranslate { display: none !important; }
body { top: 0 !important; }
