/* ==============================================================================
   AIMANESIA — Modern Vibrant Tech Publication & Journal
   Theme: Luminous Clean Canvas with Vibrant Indigo, Emerald & Cyan Accents
   Editorial Typography, Interactive Animations, Retina Vector Visuals.
   ============================================================================== */

:root {
  --bg: #FFFFFF;
  --bg-subtle: #F8FAFC;
  --bg-card: #FFFFFF;
  --bg-elevated: #F1F5F9;
  --border: #E2E8F0;
  --border-light: #F1F5F9;
  --border-hover: #CBD5E1;
  --text: #0F172A;
  --text-muted: #334155;
  --text-subtle: #64748B;
  --accent: #4F46E5;
  --accent-light: #6366F1;
  --accent-hover: #4338CA;
  --accent-glow: rgba(79, 70, 229, 0.12);
  --emerald: #059669;
  --emerald-glow: rgba(5, 150, 105, 0.12);
  --cyan: #0284C7;
  --font-sans: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-pill: 999px;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.05);
  --shadow: 0 4px 20px rgba(15, 23, 42, 0.06);
  --shadow-hover: 0 12px 32px rgba(79, 70, 229, 0.12);
}

[data-theme="dark"] {
  --bg: #090D16;
  --bg-subtle: #0F172A;
  --bg-card: #131B2E;
  --bg-elevated: #1E293B;
  --border: #1E293B;
  --border-light: #151E32;
  --border-hover: #334155;
  --text: #F8FAFC;
  --text-muted: #CBD5E1;
  --text-subtle: #94A3B8;
  --accent: #818CF8;
  --accent-light: #A5B4FC;
  --accent-hover: #C7D2FE;
  --accent-glow: rgba(129, 140, 248, 0.18);
  --emerald: #34D399;
  --emerald-glow: rgba(52, 211, 153, 0.15);
  --cyan: #38BDF8;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
  --shadow-hover: 0 12px 36px rgba(129, 140, 248, 0.22);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg);
  background-image: 
    radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.05) 0px, transparent 45%),
    radial-gradient(at 100% 100%, rgba(16, 185, 129, 0.05) 0px, transparent 45%);
  background-attachment: fixed;
  color: var(--text);
  line-height: 1.65;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.25s ease, color 0.25s ease;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: all 0.15s ease;
}

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

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: border-color 0.2s ease, background 0.2s ease;
}

.header-inner {
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none !important;
}

/* Custom Dynamic Geometric Logo */
.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #4F46E5 0%, #06B6D4 50%, #10B981 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.28);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.brand-link:hover .brand-mark {
  transform: rotate(6deg) scale(1.08);
}

.brand-mark svg {
  width: 22px;
  height: 22px;
  fill: #FFFFFF;
}

.brand-title-wrap {
  display: flex;
  flex-direction: column;
}

.brand-text {
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: var(--text);
  line-height: 1.1;
}

.brand-sub {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
}

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

.nav-link {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text-muted);
  transition: color 0.15s ease;
}

.nav-link:hover, .nav-link.active {
  color: var(--text);
}

.theme-btn {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  color: var(--text);
  width: 38px;
  height: 38px;
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 15px;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.theme-btn:hover {
  transform: rotate(25deg) scale(1.1);
  border-color: var(--accent);
  background: var(--accent-glow);
}

/* Hero Section with Ambient Glow & Floating Badge */
.hero-section {
  padding: 56px 0 44px;
  text-align: center;
  position: relative;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--accent);
  background: var(--accent-glow);
  border: 1px solid rgba(99, 102, 241, 0.25);
  padding: 5px 16px;
  border-radius: var(--radius-pill);
  margin-bottom: 20px;
  animation: pulseAura 3s infinite alternate;
}

@keyframes pulseAura {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(79, 70, 229, 0.2); }
  100% { transform: scale(1.02); box-shadow: 0 0 20px 4px rgba(79, 70, 229, 0.15); }
}

.hero-title {
  font-size: clamp(2.1rem, 5vw, 3.4rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1.15;
  color: var(--text);
  max-width: 820px;
  margin: 0 auto 18px;
}

.hero-title .gradient-text {
  background: linear-gradient(135deg, #4F46E5 0%, #06B6D4 60%, #10B981 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

[data-theme="dark"] .hero-title .gradient-text {
  background: linear-gradient(135deg, #818CF8 0%, #38BDF8 60%, #34D399 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-desc {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--text-muted);
  max-width: 680px;
  margin: 0 auto;
  line-height: 1.65;
}

/* Feature Topic Bar */
.topic-pills-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 32px 0 10px;
}

.topic-filter-btn {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  transition: all 0.15s ease;
  cursor: pointer;
}

.topic-filter-btn:hover, .topic-filter-btn.active {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
  transform: translateY(-1px);
}

/* Section Header */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 40px 0 24px;
  padding-bottom: 12px;
  border-bottom: 1.5px solid var(--border);
}

.section-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title::before {
  content: "";
  width: 4px;
  height: 18px;
  background: var(--accent);
  border-radius: 2px;
}

/* Article Grid with Beautiful Cover Graphics */
.article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 28px;
  margin-bottom: 80px;
}

.article-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease, border-color 0.25s ease;
  text-decoration: none !important;
}

.article-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-hover);
  border-color: rgba(79, 70, 229, 0.35);
}

.card-img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--bg-elevated);
  overflow: hidden;
  border-bottom: 1px solid var(--border-light);
}

.card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.article-card:hover .card-img-wrap img {
  transform: scale(1.06);
}

.card-body {
  padding: 22px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-subtle);
  margin-bottom: 12px;
}

.card-category {
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-glow);
  padding: 2px 9px;
  border-radius: var(--radius-pill);
}

.card-title {
  font-size: 18px;
  font-weight: 800;
  line-height: 1.35;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 10px;
  transition: color 0.15s ease;
}

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

.card-excerpt {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 18px;
  flex-grow: 1;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-subtle);
  border-top: 1px solid var(--border-light);
  padding-top: 14px;
  margin-top: auto;
}

.read-btn-link {
  font-weight: 700;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: transform 0.15s ease;
}

.article-card:hover .read-btn-link {
  transform: translateX(3px);
}

/* Article Detail Page */
.article-detail-wrap {
  max-width: 760px;
  margin: 36px auto 80px;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 24px;
  transition: transform 0.15s ease, color 0.15s ease;
}

.back-btn:hover {
  color: var(--accent);
  transform: translateX(-3px);
}

.detail-cover-wrap {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 32px;
  border: 1.5px solid var(--border);
  box-shadow: var(--shadow);
}

.detail-cover-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-header {
  margin-bottom: 36px;
  padding-bottom: 24px;
  border-bottom: 1.5px solid var(--border);
}

.detail-category {
  display: inline-block;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--accent);
  background: var(--accent-glow);
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  margin-bottom: 16px;
}

.detail-title {
  font-size: clamp(1.9rem, 4.5vw, 2.6rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: var(--text);
  margin-bottom: 18px;
}

.detail-meta-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13.5px;
  color: var(--text-muted);
  flex-wrap: wrap;
}

/* Article Typography */
.article-body {
  font-size: 17.5px;
  line-height: 1.82;
  color: var(--text);
}

.article-body p {
  margin-bottom: 24px;
}

.article-body p.lead {
  font-size: 20px;
  line-height: 1.7;
  color: var(--text);
  font-weight: 500;
  border-left: 3.5px solid var(--accent);
  padding-left: 18px;
  margin-bottom: 28px;
}

.article-body h2 {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--text);
  margin: 44px 0 16px;
  line-height: 1.3;
}

.article-body h3 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 32px 0 14px;
  line-height: 1.4;
}

.article-body ul, .article-body ol {
  margin-bottom: 24px;
  padding-left: 24px;
}

.article-body li {
  margin-bottom: 10px;
}

.article-body a {
  color: var(--accent);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 4px;
  transition: color 0.15s ease;
}

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

.article-author-card {
  margin-top: 56px;
  padding: 24px;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  gap: 18px;
  box-shadow: var(--shadow-sm);
}

.author-avatar {
  width: 52px;
  height: 52px;
  background: linear-gradient(135deg, #4F46E5, #06B6D4);
  color: #FFFFFF;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 20px;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.author-info h4 {
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 3px;
}

.author-info p {
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-card);
  padding: 44px 0;
  margin-top: auto;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  font-size: 13.5px;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  gap: 20px;
}

.footer-links a {
  color: var(--text-muted);
}

.footer-links a:hover {
  color: var(--text);
}

@media (max-width: 640px) {
  .hero-section {
    padding: 36px 0 24px;
  }
  .article-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .header-inner {
    height: 60px;
  }
  .article-detail-wrap {
    margin: 20px auto 60px;
  }
}
