:root {
  color-scheme: light;
  --bg: #f8fafc;
  --surface: #ffffff;
  --text: #0f172a;
  --body: #334155;
  --muted: #64748b;
  --navy: #0b1e3b;
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --sky: #7dd3fc;
  --teal: #0d9488;
  --border: #e2e8f0;
  --pill-ai-bg: #dbeafe;
  --pill-ai-text: #2563eb;
  --pill-tech-bg: #ccfbf1;
  --pill-tech-text: #0d9488;
  --table-head: #f1f5f9;
  --orb-a: rgba(37, 99, 235, 0.14);
  --orb-b: rgba(13, 148, 136, 0.12);
  --max: 1080px;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b1120;
  --surface: #1e293b;
  --text: #f1f5f9;
  --body: #cbd5e1;
  --muted: #94a3b8;
  --accent: #60a5fa;
  --accent-dark: #3b82f6;
  --border: #334155;
  --pill-ai-bg: #1e3a8a;
  --pill-ai-text: #93c5fd;
  --pill-tech-bg: #134e4a;
  --pill-tech-text: #5eead4;
  --table-head: #0f172a;
  --orb-a: rgba(96, 165, 250, 0.20);
  --orb-b: rgba(45, 212, 191, 0.14);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  transition: background-color 0.3s ease, color 0.3s ease;
}

h1, h2, h3 {
  font-family: "Plus Jakarta Sans", Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: var(--max); margin: 0 auto; padding: 0 20px; }

/* Header */
.site-header {
  background: var(--navy);
  position: sticky;
  top: 0;
  z-index: 50;
  transition: box-shadow 0.2s ease;
}
.site-header.scrolled { box-shadow: 0 4px 16px rgba(2, 6, 23, 0.25); }

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 60px;
  gap: 16px;
}

.logo { display: flex; align-items: center; gap: 10px; font-size: 1.3rem; font-weight: 800; color: #ffffff; letter-spacing: -0.02em; }
.logo span { color: var(--sky); }
.logo:hover { text-decoration: none; }
.logo-img { width: 36px; height: 36px; display: block; flex-shrink: 0; }

.header-actions { display: flex; align-items: center; gap: 8px; }

.theme-toggle {
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: transparent;
  border-radius: 8px;
  padding: 7px 9px;
  cursor: pointer;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
}
.theme-toggle:hover { background: rgba(255, 255, 255, 0.1); }
.theme-toggle svg { transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1); }
.theme-toggle.spin svg { transform: rotate(180deg); }

.main-nav { display: flex; gap: 4px; }
.main-nav a {
  color: #e2e8f0;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 8px 12px;
  border-radius: 8px;
  position: relative;
}
.main-nav a::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 3px;
  height: 2px;
  border-radius: 2px;
  background: var(--sky);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}
.main-nav a:hover::after, .main-nav a.active::after { transform: scaleX(1); }
.main-nav a:hover { background: rgba(255, 255, 255, 0.1); color: #ffffff; text-decoration: none; }
.main-nav a.active { color: var(--sky); }

.nav-toggle {
  display: none;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: transparent;
  border-radius: 8px;
  padding: 7px 9px;
  cursor: pointer;
  color: #ffffff;
  align-items: center;
  justify-content: center;
}
.nav-toggle:hover { background: rgba(255, 255, 255, 0.1); }

/* News ticker */
.ticker { display: flex; background: var(--accent); color: #fff; overflow: hidden; }
.ticker-label {
  background: var(--navy);
  padding: 8px 14px;
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  flex-shrink: 0;
  display: flex;
  align-items: center;
}
.ticker-viewport { overflow: hidden; flex: 1; display: flex; align-items: center; }
.ticker-track { display: flex; white-space: nowrap; animation: ticker-scroll 45s linear infinite; }
.ticker:hover .ticker-track { animation-play-state: paused; }
.ticker-items { padding: 8px 0; font-size: 0.92rem; }
.ticker-items a { color: #fff; }
.ticker-items a:hover { color: #fff; text-decoration: underline; }
@keyframes ticker-scroll { to { transform: translateX(-50%); } }

/* Hero */
.hero {
  background: radial-gradient(700px 320px at 85% 15%, rgba(37, 99, 235, 0.09), transparent 60%), var(--surface);
  padding: 48px 0 40px;
  border-bottom: 1px solid var(--border);
  transition: background-color 0.3s ease, border-color 0.3s ease;
  position: relative;
  overflow: hidden;
}
.hero::before, .hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  pointer-events: none;
}
.hero::before {
  width: 420px;
  height: 420px;
  background: var(--orb-a);
  top: -160px;
  right: -60px;
  animation: orb-drift 14s ease-in-out infinite alternate;
}
.hero::after {
  width: 320px;
  height: 320px;
  background: var(--orb-b);
  bottom: -150px;
  left: -80px;
  animation: orb-drift 18s ease-in-out infinite alternate-reverse;
}
@keyframes orb-drift {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(-30px, 24px) scale(1.12); }
}
.hero-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 36px; align-items: center; position: relative; z-index: 1; }
@keyframes hero-in {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
.hero-text > * { animation: hero-in 0.6s cubic-bezier(0.22, 1, 0.36, 1) both; }
.hero-text > *:nth-child(1) { animation-delay: 0.05s; }
.hero-text > *:nth-child(2) { animation-delay: 0.12s; }
.hero-text > *:nth-child(3) { animation-delay: 0.19s; }
.hero-text > *:nth-child(4) { animation-delay: 0.26s; }
.hero-text > *:nth-child(5) { animation-delay: 0.33s; }
.hero-img-link { animation: hero-in 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.1s both, hero-float 7s ease-in-out 1.2s infinite; }
@keyframes hero-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}
.hero-img { width: 100%; border-radius: 16px; display: block; box-shadow: 0 12px 32px rgba(11, 30, 59, 0.25); transition: transform 0.35s ease-out, box-shadow 0.3s ease; }
.hero-img-link { display: block; }
.hero-img-link:hover .hero-img { box-shadow: 0 16px 40px rgba(11, 30, 59, 0.3); }
.eyebrow {
  color: var(--accent);
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.eyebrow-tech { color: var(--teal); }
.hero h1 {
  font-size: 2.3rem;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 12px 0 16px;
}
.lede { font-size: 1.12rem; color: var(--body); }
.meta { color: var(--muted); font-size: 0.9rem; margin-top: 16px; }
.btn {
  display: inline-block;
  margin-top: 20px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  padding: 11px 22px;
  border-radius: 999px;
  transition: background 0.2s ease, transform 0.2s ease;
}
.btn:hover { background: var(--accent-dark); text-decoration: none; transform: translateY(-1px); box-shadow: 0 8px 20px rgba(37, 99, 235, 0.35); }
.btn:active { transform: translateY(0) scale(0.97); }

/* Search + category chips */
.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 12px 18px;
  margin-top: 24px;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
  color: var(--muted);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}
.search-box:focus-within { border-color: var(--accent); box-shadow: 0 4px 20px rgba(37, 99, 235, 0.15); }
.search-box input {
  border: none;
  outline: none;
  flex: 1;
  font: inherit;
  font-size: 1rem;
  color: var(--text);
  background: transparent;
  min-width: 0;
}
.search-box input::placeholder { color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.chip {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 999px;
  padding: 8px 16px;
  font: inherit;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--body);
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip:active { transform: scale(0.95); }
.no-results { text-align: center; color: var(--muted); padding: 24px 0; }

/* Sections */
.section { padding: 36px 0; }
.section h2 { font-size: 1.45rem; letter-spacing: -0.01em; margin-bottom: 20px; }
.section h2::after {
  content: "";
  display: block;
  width: 32px;
  height: 3px;
  background: var(--accent);
  border-radius: 2px;
  margin-top: 8px;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.6s ease 0.15s;
}
.section.in-view h2::after { transform: scaleX(1); }
.section-intro { color: var(--muted); max-width: 720px; margin: -8px 0 20px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }

/* News cards: the whole card is one link */
a.card {
  color: var(--text);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
  border: none;
  border-radius: 20px;
  background: var(--surface);
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.3s ease;
}
a.card:hover { text-decoration: none; transform: translateY(-3px); box-shadow: 0 14px 32px rgba(15, 23, 42, 0.14); }
a.card:hover h3 { color: var(--accent); }
a.card-featured { grid-column: span 2; }

.card-cover {
  aspect-ratio: 16 / 9;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}
.card-cover img.cover-photo { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.4s ease; }
a.card:hover .card-cover img.cover-photo { transform: scale(1.05); }
.card-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.35) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform 0.7s ease;
  pointer-events: none;
}
a.card:hover .card-cover::after { transform: translateX(120%); }
a.card.tilt-live, .cat-card.tilt-live { transition: transform 0.12s ease-out, box-shadow 0.2s ease, background-color 0.3s ease, opacity 0.6s ease; }

.card-body { padding: 20px; display: flex; flex-direction: column; flex: 1; }
.cat {
  display: inline-block;
  align-self: flex-start;
  background: var(--pill-ai-bg);
  color: var(--pill-ai-text);
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 4px 11px;
  border-radius: 999px;
}
.cat-tech { background: var(--pill-tech-bg); color: var(--pill-tech-text); }
.card h3 { font-size: 1.15rem; line-height: 1.35; margin: 12px 0 8px; }
.card-body p { color: var(--body); font-size: 0.95rem; flex: 1; }
.card .meta { margin-top: 14px; }

/* Category cards */
.cat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.cat-card {
  border-radius: 20px;
  padding: 28px;
  color: #fff;
  display: block;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.cat-card:hover { text-decoration: none; transform: translateY(-3px); box-shadow: 0 14px 32px rgba(15, 23, 42, 0.18); }
.cat-card-ai { background: var(--navy); }
.cat-card-tech { background: var(--teal); }
.cat-card h3 { font-size: 1.5rem; color: #fff; margin: 8px 0; }
.cat-card p { color: rgba(255, 255, 255, 0.85); }
.cat-card-count { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; opacity: 0.75; }
.cat-card-link { display: inline-block; margin-top: 16px; font-weight: 700; color: #fff; }

/* Paling Banyak Dibaca */
.popular { list-style: none; }
.popular li { display: flex; gap: 18px; padding: 18px 0; border-bottom: 1px solid var(--border); align-items: flex-start; }
.popular li:last-child { border-bottom: none; }
.popular-num {
  font-family: "Plus Jakarta Sans", Inter, sans-serif;
  font-size: 1.9rem;
  font-weight: 800;
  color: var(--accent);
  opacity: 0.3;
  line-height: 1;
  flex-shrink: 0;
}
.popular h3 { font-size: 1.08rem; line-height: 1.4; }
.popular h3 a { color: var(--text); }
.popular h3 a:hover { color: var(--accent); text-decoration: none; }
.popular .meta { margin-top: 4px; }

/* Article page */
.article {
  max-width: 760px;
  margin: 32px auto 64px;
  padding: 40px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}
.article-hero { margin-bottom: 24px; }
.article-hero img { width: 100%; border-radius: 16px; display: block; }
.article h1 {
  font-size: 2.1rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 12px 0 16px;
}
.article h2 { font-size: 1.4rem; margin: 32px 0 12px; letter-spacing: -0.01em; }
.article p { margin-bottom: 16px; color: var(--body); }
.article ul, .article ol { margin: 0 0 16px 22px; }
.article li { margin-bottom: 8px; color: var(--body); }
.article table { width: 100%; border-collapse: collapse; margin: 16px 0 24px; font-size: 0.92rem; display: block; overflow-x: auto; }
.article th, .article td { border: 1px solid var(--border); padding: 10px 12px; text-align: left; }
.article th { background: var(--table-head); font-weight: 700; }
.article strong { color: var(--text); }
.back-link { display: inline-block; margin-bottom: 8px; font-size: 0.95rem; font-weight: 600; }
.sources {
  border-top: 1px solid var(--border);
  margin-top: 40px;
  padding-top: 20px;
  font-size: 0.9rem;
  color: var(--muted);
}
.sources ul { margin: 8px 0 0 20px; }
.sources li { margin-bottom: 6px; }
.sources a { word-break: break-all; }

/* Reading progress bar + back to top */
.reading-progress {
  position: fixed;
  top: 60px;
  left: 0;
  height: 3px;
  background: var(--accent);
  width: 0;
  z-index: 60;
}
.to-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  border: none;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.25);
  z-index: 60;
  transition: transform 0.2s ease, background-color 0.2s ease;
}
.to-top:hover { background: var(--accent-dark); transform: translateY(-2px); }
.to-top.show { display: flex; }

/* About page */
.about {
  max-width: 760px;
  margin: 32px auto 64px;
  padding: 40px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}
.about h1 { font-size: 2rem; letter-spacing: -0.02em; margin-bottom: 16px; }
.about h2 { font-size: 1.35rem; margin: 28px 0 10px; }
.about p { margin-bottom: 16px; color: var(--body); }
.about ul { margin: 0 0 16px 22px; }
.about li { margin-bottom: 8px; color: var(--body); }

/* Newsletter CTA (ala Petani Kode) */
.newsletter {
  background: var(--navy);
  border-radius: 20px;
  padding: 32px;
  color: #fff;
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 8px 24px rgba(11, 30, 59, 0.25);
}
.newsletter h2 { color: #fff; margin-bottom: 0; }
.newsletter h2::after { display: none; }
.newsletter p { color: rgba(255, 255, 255, 0.85); margin-top: 6px; }
.btn-wa { background: #25d366; margin-top: 0; flex-shrink: 0; }
.btn-wa:hover { background: #1da851; box-shadow: 0 8px 20px rgba(37, 211, 102, 0.35); }

/* Footer */
.site-footer {
  background: var(--navy);
  padding: 36px 0;
  margin-top: 48px;
}
.footer-inner { display: flex; flex-wrap: wrap; gap: 32px; justify-content: space-between; }
.footer-brand { max-width: 420px; }
.footer-brand p { color: #94a3b8; font-size: 0.92rem; margin-top: 8px; }
.footer-nav { display: flex; flex-direction: column; gap: 8px; }
.footer-nav a { color: #e2e8f0; font-size: 0.95rem; }
.copyright { color: #94a3b8; font-size: 0.88rem; margin-top: 28px; }

/* Cursor glow (desktop only, added by JS) */
.cursor-glow {
  position: fixed;
  width: 340px;
  height: 340px;
  left: -400px;
  top: -400px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.09), transparent 65%);
  opacity: 0;
  transition: opacity 0.4s ease;
  transform: translate(-50%, -50%);
}
[data-theme="dark"] .cursor-glow { background: radial-gradient(circle, rgba(96, 165, 250, 0.13), transparent 65%); }

/* Reveal on scroll */
.reveal { opacity: 0; transform: translateY(16px) scale(0.985); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.visible { opacity: 1; transform: none; }

@media (max-width: 768px) {
  .hero-grid { grid-template-columns: 1fr; gap: 24px; }
}

@media (max-width: 640px) {
  .hero { padding: 32px 0 24px; }
  .hero h1 { font-size: 1.8rem; }
  .article, .about { padding: 24px 20px; margin: 20px 16px 48px; }
  .article h1 { font-size: 1.7rem; }
  a.card-featured { grid-column: span 1; }
  .cat-grid { grid-template-columns: 1fr; }
  .nav-toggle { display: flex; }
  .main-nav {
    display: none;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 8px 20px 16px;
  }
  .main-nav.open { display: flex; }
  .main-nav a { color: var(--text); }
  .main-nav a::after { background: var(--accent); }
  .main-nav a:hover { background: var(--bg); color: var(--text); }
  .main-nav a.active { color: var(--accent); }
  .header-inner { position: relative; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .ticker-track { animation: none; }
  .hero::before, .hero::after { animation: none; }
  .hero-text > *, .hero-img-link { animation: none; }
  .hero-img { transition: none; }
  .cursor-glow { display: none; }
  .card-cover::after { transition: none; }
  .main-nav a::after { transition: none; }
  .section h2::after { transform: scaleX(1); transition: none; }
  .theme-toggle svg { transition: none; }
  a.card { transition: none; }
  a.card:hover { transform: none; box-shadow: 0 4px 16px rgba(15, 23, 42, 0.08); }
  a.card:hover .card-cover img.cover-photo { transform: none; }
  .btn { transition: none; }
  .btn:hover { transform: none; }
  .cat-card { transition: none; }
  .cat-card:hover { transform: none; }
  .to-top { transition: none; }
  .to-top:hover { transform: none; }
  body, .hero, .article, .about, .search-box, .chip { transition: none; }
}
