/* =========================================================
   ZLT Co. — Base Stylesheet (Premium Edition)
   ========================================================= */

/* ---------- VARIABLES ---------- */
:root {
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --bg: #0f1117;
  --bg-elevated: #161b22;
  --bg-card: #161b22;
  --text: #f0f0f5;
  --text-muted: #9ca3af;
  --text-dim: #6b7280;
  --accent: #ff1e56;
  --accent-glow: rgba(255, 30, 86, 0.18);
  --border: rgba(255, 255, 255, 0.06);
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.15);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 24px 48px rgba(0, 0, 0, 0.22);
  --glass-bg: rgba(22, 27, 34, 0.6);
  --glass-border: rgba(255, 255, 255, 0.08);
}

[data-theme="light"] {
  --bg: #f5f5f7;
  --bg-elevated: #ffffff;
  --bg-card: #ffffff;
  --text: #111111;
  --text-muted: #6b7280;
  --text-dim: #9ca3af;
  --accent: #e11d48;
  --accent-glow: rgba(225, 29, 72, 0.10);
  --border: rgba(0, 0, 0, 0.08);
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 24px 48px rgba(0, 0, 0, 0.08);
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(0, 0, 0, 0.08);
}

/* ---------- RESET ---------- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

::selection {
  background: var(--accent);
  color: white;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 5px;
  border: 2px solid var(--bg);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-dim);
}

/* ---------- NAV ---------- */
.zlt-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 40px;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}

.nav-brand {
  display: flex;
  align-items: center;
}

.nav-logo {
  font-weight: 800;
  font-size: 1.35rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 8px;
  transition: color 0.2s, background 0.2s;
}

.nav-links a:hover,
.nav-links a:focus-visible,
.nav-links a.active {
  color: var(--accent);
  background: var(--accent-glow);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  position: relative;
}

.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  transform-origin: center;
}

.nav-toggle span:nth-child(1) { width: 100%; }
.nav-toggle span:nth-child(2) { width: 75%; }
.nav-toggle span:nth-child(3) { width: 50%; }

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
  width: 100%;
}
.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
  width: 100%;
}

/* ---------- ARTICLE BASE ---------- */
.article-container {
  max-width: 850px;
  margin: 100px auto 60px;
  padding: 40px 20px;
}

.article-container h1 {
  font-size: clamp(30px, 4vw, 42px);
  line-height: 1.1;
  margin-bottom: 14px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
}

.article-meta {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.article-container p {
  color: var(--text-muted);
  margin-bottom: 22px;
  font-size: 16.5px;
  line-height: 1.8;
}

.article-container h2 {
  margin-top: 44px;
  margin-bottom: 14px;
  font-size: 24px;
  font-weight: 700;
  color: var(--accent);
}

.article-container h2::after {
  content: "";
  display: block;
  width: 40px;
  height: 2px;
  background: var(--accent);
  margin-top: 10px;
  opacity: 0.5;
  border-radius: 2px;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 48px;
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
  border: 1px solid var(--accent);
  padding: 11px 20px;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  background: transparent;
  cursor: pointer;
}

.back-btn:hover,
.back-btn:focus-visible {
  background: var(--accent);
  color: white;
}

/* ---------- FOOTER ---------- */
.zlt-footer {
  font-family: var(--font);
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
  padding-top: 60px;
  margin-top: 0;
}

.footer-container {
  max-width: 1200px;
  margin: auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 40px;
  padding: 0 48px 48px;
}

.footer-col h4 {
  margin-bottom: 18px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.footer-col a {
  display: block;
  color: var(--text-muted);
  text-decoration: none;
  margin-bottom: 10px;
  font-size: 14px;
  font-weight: 400;
  transition: color 0.2s;
}

.footer-col a:hover,
.footer-col a:focus-visible {
  color: var(--text);
}

.footer-bottom {
  text-align: center;
  padding: 24px;
  font-size: 13px;
  color: var(--text-dim);
  border-top: 1px solid var(--border);
  font-weight: 400;
}

/* ---------- UTILITIES ---------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 760px) {
  .zlt-nav {
    padding: 14px 20px;
  }

  .nav-toggle {
    display: flex;
  }

  .nav-links {
    position: fixed;
    inset: 0;
    top: 60px;
    background: var(--bg);
    flex-direction: column;
    align-items: flex-start;
    padding: 24px 32px;
    gap: 8px;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
    border-left: 1px solid var(--border);
    z-index: 40;
    overflow-y: auto;
    max-height: calc(100vh - 60px);
  }

  .nav-links.open {
    transform: translateX(0);
  }

  .nav-links a {
    font-size: 16px;
    padding: 10px 0;
    width: 100%;
  }

  .footer-container {
    padding: 0 24px 36px;
    gap: 32px;
    grid-template-columns: repeat(2, 1fr);
  }

  .article-container {
    margin: 40px auto;
    padding: 24px 16px;
  }
}

@media (max-width: 480px) {
  .footer-container {
    grid-template-columns: 1fr;
  }
}

/* ---------- REDUCED MOTION ---------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* =========================================================
   PREMIUM ARTICLE EXPERIENCE UPGRADE
   ========================================================= */

/* ---------- GLOBAL BACKGROUND ---------- */

body {
  position: relative;
  overflow-x: hidden;
  background:
    radial-gradient(circle at top left, var(--accent-glow), transparent 30%),
    radial-gradient(circle at bottom right, rgba(59,130,246,0.08), transparent 35%),
    var(--bg);
}

/* ---------- PREMIUM ARTICLE CARD ---------- */

.article-container {
  position: relative;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);

  border-radius: 28px;

  box-shadow:
    var(--shadow-lg),
    inset 0 1px 0 rgba(255,255,255,0.04);

  padding:
    clamp(28px, 5vw, 56px);

  margin-top: 72px;
  margin-bottom: 72px;

  overflow: hidden;
}

/* ---------- TOP ACCENT LINE ---------- */

.article-container::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;

  background:
    linear-gradient(
      90deg,
      transparent,
      var(--accent),
      transparent
    );

  opacity: 0.8;
}

/* ---------- ARTICLE TYPOGRAPHY ---------- */

.article-container h1 {
  font-size: clamp(2.4rem, 6vw, 4rem);

  line-height: 1.02;

  letter-spacing: -0.045em;

  font-weight: 850;

  max-width: 14ch;

  margin-bottom: 18px;

  text-wrap: balance;
}

/* ---------- META ---------- */

.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;

  font-size: 0.95rem;

  color: var(--text-dim);

  margin-bottom: 44px;

  padding-bottom: 22px;

  border-bottom: 1px solid var(--border);
}

/* ---------- BODY TEXT ---------- */

.article-container p {
  font-size: clamp(1.04rem, 1.2vw, 1.12rem);

  line-height: 1.95;

  color: var(--text-muted);

  max-width: 72ch;

  text-wrap: pretty;
}

/* ---------- DROP CAPS ---------- */

.article-container p:first-of-type::first-letter {
  float: left;

  font-size: 4.5rem;

  line-height: 0.9;

  padding-right: 12px;

  font-weight: 800;

  color: var(--accent);
}

/* ---------- SECTION HEADINGS ---------- */

.article-container h2 {
  position: relative;

  margin-top: 72px;

  margin-bottom: 22px;

  font-size: clamp(1.5rem, 3vw, 2rem);

  font-weight: 800;

  letter-spacing: -0.03em;

  color: var(--text);
}

.article-container h2::after {
  width: 72px;
  height: 3px;

  border-radius: 999px;

  background:
    linear-gradient(
      90deg,
      var(--accent),
      transparent
    );

  opacity: 1;

  margin-top: 14px;
}

/* ---------- LINKS ---------- */

.article-container a:not(.back-btn) {
  color: var(--accent);

  text-decoration: none;

  font-weight: 600;

  position: relative;
}

.article-container a:not(.back-btn)::after {
  content: "";

  position: absolute;

  left: 0;
  bottom: -2px;

  width: 100%;
  height: 1px;

  background: currentColor;

  transform: scaleX(0);

  transform-origin: right;

  transition: transform 0.25s ease;
}

.article-container a:not(.back-btn):hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* ---------- BACK BUTTON ---------- */

.back-btn {
  position: relative;

  overflow: hidden;

  isolation: isolate;

  font-size: 0.95rem;

  padding: 14px 22px;

  border-radius: 14px;

  border: 1px solid var(--border);

  background:
    linear-gradient(
      180deg,
      rgba(255,255,255,0.04),
      transparent
    );

  box-shadow:
    0 10px 24px rgba(0,0,0,0.12);

  transition:
    transform 0.22s ease,
    box-shadow 0.22s ease,
    border-color 0.22s ease;
}

.back-btn::before {
  content: "";

  position: absolute;
  inset: 0;

  background:
    linear-gradient(
      135deg,
      var(--accent),
      #ff4d7d
    );

  opacity: 0;

  transition: opacity 0.25s ease;

  z-index: -1;
}

.back-btn:hover {
  transform: translateY(-2px);

  border-color: transparent;

  box-shadow:
    0 18px 40px rgba(0,0,0,0.22);
}

.back-btn:hover::before {
  opacity: 1;
}

/* ---------- ARTICLE READABILITY ---------- */

.article-container p + p {
  margin-top: 18px;
}

/* ---------- IMAGE SUPPORT ---------- */

.article-container img {
  width: 100%;

  border-radius: 20px;

  margin: 36px 0;

  border: 1px solid var(--border);

  box-shadow: var(--shadow-md);
}

/* ---------- BLOCKQUOTE ---------- */

.article-container blockquote {
  position: relative;

  margin: 36px 0;

  padding: 24px 28px;

  border-left: 3px solid var(--accent);

  background:
    linear-gradient(
      180deg,
      rgba(255,255,255,0.03),
      transparent
    );

  border-radius: 0 18px 18px 0;

  color: var(--text);

  font-style: italic;
}

/* ---------- CODE ---------- */

.article-container code {
  background: rgba(255,255,255,0.06);

  border: 1px solid var(--border);

  padding: 2px 6px;

  border-radius: 6px;

  font-size: 0.92em;
}

/* ---------- FOOTER POLISH ---------- */

.zlt-footer {
  position: relative;

  overflow: hidden;
}

.zlt-footer::before {
  content: "";

  position: absolute;

  inset: 0;

  background:
    radial-gradient(
      circle at center,
      var(--accent-glow),
      transparent 70%
    );

  pointer-events: none;
}

/* ---------- NAV ENHANCEMENT ---------- */

.zlt-nav {
  position: sticky;

  backdrop-filter: blur(18px);

  border-bottom:
    1px solid rgba(255,255,255,0.05);
}

/* ---------- MOBILE ---------- */

@media (max-width: 760px) {

  .article-container {
    border-radius: 22px;

    padding: 24px 20px;

    margin-top: 24px;

    margin-bottom: 24px;
  }

  .article-container h1 {
    max-width: 100%;
  }

  .article-container p:first-of-type::first-letter {
    font-size: 3.2rem;
  }

  .article-meta {
    gap: 8px;
  }

  .back-btn {
    width: 100%;

    justify-content: center;
  }
}

/* ---------- LIGHT MODE FIXES ---------- */

[data-theme="light"] body {
  background:
    radial-gradient(circle at top left, rgba(225,29,72,0.06), transparent 30%),
    radial-gradient(circle at bottom right, rgba(59,130,246,0.05), transparent 35%),
    var(--bg);
}

[data-theme="light"] .article-container {
  box-shadow:
    0 24px 48px rgba(0,0,0,0.06),
    0 2px 6px rgba(0,0,0,0.04);

  border:
    1px solid rgba(0,0,0,0.06);
}

[data-theme="light"] .article-container p {
  color: #4b5563;
}

[data-theme="light"] .article-container code {
  background: rgba(0,0,0,0.04);
}

/* ---------- ULTRA SMOOTH ---------- */

* {
  transition-property:
    background-color,
    border-color,
    color,
    fill,
    stroke,
    opacity,
    box-shadow,
    transform;

  transition-duration: 0.22s;

  transition-timing-function:
    cubic-bezier(0.22, 1, 0.36, 1);
}