:root {
  --bg: #07090f;
  --bg-elevated: #0e1219;
  --bg-card: #121820;
  --border: rgba(255, 255, 255, 0.08);
  --text: #e8ecf4;
  --text-muted: #8b95a8;
  --accent: #00e5ff;
  --accent-2: #ff3d6e;
  --accent-dim: rgba(0, 229, 255, 0.12);
  --font-display: "Chakra Petch", system-ui, sans-serif;
  --font-body: "IBM Plex Sans", system-ui, sans-serif;
  --wrap: min(1120px, 92vw);
  --radius: 10px;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(0, 229, 255, 0.08), transparent),
    radial-gradient(ellipse 60% 40% at 100% 50%, rgba(255, 61, 110, 0.05), transparent);
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; transition: color 0.15s; }
a:hover { color: #fff; }

.wrap { width: var(--wrap); margin-inline: auto; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(7, 9, 15, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 0;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: 0.02em;
}

.brand:hover { color: #fff; }

.brand-mark {
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-radius: 6px;
  box-shadow: 0 0 20px rgba(0, 229, 255, 0.35);
}

.brand-accent { color: var(--accent); }

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.nav-link {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.45rem 0.75rem;
  border-radius: 6px;
}

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

.nav-rss {
  font-size: 0.8rem;
  color: var(--text-muted);
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-left: 0.5rem;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
}

/* Hero */
.hero {
  padding: 3.5rem 0 2rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  align-items: center;
}

.hero-kicker {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent);
  margin: 0 0 1rem;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  font-weight: 700;
  line-height: 1.1;
  margin: 0 0 1rem;
}

.hero-accent {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-lead {
  color: var(--text-muted);
  font-size: 1.15rem;
  max-width: 42ch;
  margin: 0 0 1.75rem;
}

.hero-cta { display: flex; gap: 0.75rem; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.7rem 1.25rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}

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

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #00b8d4);
  color: #000;
  box-shadow: 0 4px 24px rgba(0, 229, 255, 0.25);
}

.btn-primary:hover { color: #000; box-shadow: 0 6px 32px rgba(0, 229, 255, 0.4); }

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* Ticker */
.ticker {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 0;
  margin-bottom: 1rem;
  border-block: 1px solid var(--border);
  overflow: hidden;
}

.ticker-label {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-2);
  white-space: nowrap;
}

.ticker-track {
  display: flex;
  gap: 1rem;
  align-items: center;
  overflow-x: auto;
  scrollbar-width: none;
  font-size: 0.9rem;
}

.ticker-track::-webkit-scrollbar { display: none; }
.ticker-track a { color: var(--text-muted); white-space: nowrap; }
.ticker-track a:hover { color: var(--accent); }
.ticker-dot { color: var(--border); font-size: 0.5rem; }

/* Sections */
.section { padding: 2.5rem 0; }

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 1.5rem;
}

.section-head h2, .section > h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  margin: 0;
}

.section-more { font-size: 0.9rem; color: var(--text-muted); }
.section-more:hover { color: var(--accent); }

/* Cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.card:hover {
  border-color: rgba(0, 229, 255, 0.25);
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.card-cover {
  display: block;
  height: 140px;
  position: relative;
}

.card-featured .card-cover { height: 200px; }

.card-cat {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  color: var(--accent);
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
}

.card-body { padding: 1.1rem 1.25rem 1.25rem; }

.card-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.meta-sep { margin: 0 0.35rem; opacity: 0.5; }

.card-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  line-height: 1.3;
  margin: 0 0 0.5rem;
}

.card-featured .card-title { font-size: 1.35rem; }

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

.card-dek {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin: 0 0 0.75rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-byline { font-size: 0.8rem; color: var(--text-muted); }

/* Categories */
.cat-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

.cat-pill {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 1.1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  transition: border-color 0.2s, background 0.2s;
}

.cat-pill:hover {
  border-color: var(--accent);
  background: var(--accent-dim);
  color: var(--text);
}

.cat-count {
  font-size: 0.75rem;
  color: var(--text-muted);
  background: var(--bg);
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
}

/* Newsletter */
.newsletter { padding: 2rem 0 4rem; }

.newsletter-box {
  text-align: center;
  padding: 2.5rem 2rem;
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.06), rgba(255, 61, 110, 0.06));
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.newsletter-box h2 {
  font-family: var(--font-display);
  margin: 0 0 0.5rem;
}

.newsletter-box p {
  color: var(--text-muted);
  max-width: 40ch;
  margin: 0 auto 1.25rem;
}

/* Page hero */
.page-hero {
  padding: 3rem 0 1.5rem;
}

.page-hero h1 {
  font-family: var(--font-display);
  font-size: 2.5rem;
  margin: 0 0 0.5rem;
}

.page-hero p { color: var(--text-muted); margin: 0; }

/* Article */
.article { padding: 2rem 0 3rem; max-width: 720px; }

.article-header { margin-bottom: 2rem; }

.article-cat {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
}

.article h1 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  line-height: 1.15;
  margin: 0.5rem 0;
}

.article-dek {
  font-size: 1.2rem;
  color: var(--text-muted);
  margin: 0 0 1rem;
}

.article-meta {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.article-cover {
  height: 220px;
  border-radius: var(--radius);
  margin-bottom: 1rem;
}

.article-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.tag {
  font-size: 0.8rem;
  color: var(--text-muted);
  background: var(--bg-elevated);
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  border: 1px solid var(--border);
}

.tag:hover { color: var(--accent); border-color: var(--accent); }

/* Prose */
.prose h2 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  margin: 2rem 0 0.75rem;
  color: var(--text);
}

.prose p { margin: 0 0 1rem; }

.prose ul, .prose ol {
  margin: 0 0 1rem;
  padding-left: 1.4rem;
}

.prose li { margin-bottom: 0.35rem; }

.prose strong { color: #fff; }

.prose em { color: var(--text-muted); }

/* Footer */
.site-footer {
  margin-top: 3rem;
  padding: 3rem 0 1.5rem;
  border-top: 1px solid var(--border);
  background: var(--bg-elevated);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-logo {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.footer-brand p {
  color: var(--text-muted);
  font-size: 0.92rem;
  max-width: 36ch;
  margin: 0;
}

.site-footer h4 {
  font-family: var(--font-display);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin: 0 0 0.75rem;
}

.site-footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.site-footer li { margin-bottom: 0.4rem; }

.site-footer a { color: var(--text-muted); font-size: 0.92rem; }
.site-footer a:hover { color: var(--accent); }

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer-tag {
  font-family: var(--font-display);
  font-size: 0.8rem;
  color: var(--accent);
}

/* 404 */
.not-found {
  text-align: center;
  padding: 6rem 0;
}

.not-found h1 {
  font-family: var(--font-display);
  font-size: 5rem;
  margin: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.not-found p { color: var(--text-muted); margin: 1rem 0 2rem; }

.about-prose { max-width: 680px; padding-bottom: 4rem; }

/* Responsive */
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-featured { order: -1; }
  .footer-grid { grid-template-columns: 1fr; }
  .nav-toggle { display: flex; }
  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    padding: 1rem;
  }
  .site-nav.open { display: flex; }
  .header-inner { position: relative; flex-wrap: wrap; }
}

@media (max-width: 500px) {
  .card-grid { grid-template-columns: 1fr; }
  .ticker { flex-direction: column; align-items: flex-start; }
}
