:root {
  --bg: #151515;
  --bg-2: #1c1c1c;
  --panel: #101010;
  --fg: #eaeaea;
  --muted: #9a9a9a;
  --accent: #b5e853;
  --accent-2: #63c0f5;
  --border: #2e2e2e;
  --shadow: 0 6px 20px rgba(0, 0, 0, .55);
  --radius: 4px;
  --maxw: 1120px;
  --mono: Monaco, "Bitstream Vera Sans Mono", "Lucida Console", Terminal, "Courier New", monospace;
  --glow-green: 0 1px 1px rgba(0,0,0,.3), 0 0 5px rgba(181, 232, 83, .25), 0 0 10px rgba(181, 232, 83, .12);
  --glow-blue: 0 0 5px rgba(104, 182, 255, .5);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body.site {
  margin: 0;
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  grid-template-columns: minmax(0, 1fr);
  font-family: var(--mono);
  background: #151515;
  color: var(--fg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Hacker-style headings: green, glowing, monospace */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--mono);
  color: var(--accent);
  letter-spacing: -0.02em;
  text-shadow: var(--glow-green);
}

a { color: var(--accent-2); text-decoration: none; text-shadow: var(--glow-blue); }
a:hover { text-decoration: underline; }
.muted { color: var(--muted); }
img { max-width: 100%; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 1.25rem; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 10, 10, .85);
  backdrop-filter: blur(8px);
  border-bottom: 1px dashed var(--accent);
}
.header-inner { display: flex; align-items: center; gap: 1.25rem; height: 62px; }
.logo { font-weight: bold; font-size: 1.15rem; color: var(--accent); white-space: nowrap; text-shadow: var(--glow-green); }
.logo:hover { text-decoration: none; color: var(--accent); }
.logo::before { content: "./ "; color: var(--accent); }

.main-nav { display: flex; align-items: center; gap: .25rem; flex: 1; }
.main-nav > a,
.nav-item > a {
  display: inline-block;
  padding: .5rem .7rem;
  color: var(--fg);
  border-radius: 4px;
  font-size: .95rem;
  text-shadow: none;
}
.main-nav > a:hover,
.nav-item > a:hover { background: var(--bg-2); text-decoration: none; }

/* Dropdowns (nested categories) */
.nav-item { position: relative; }
.nav-item .dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 200px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: .35rem;
  display: none;
  flex-direction: column;
  box-shadow: 0 12px 30px rgba(0,0,0,.4);
}
.nav-item:hover > .dropdown { display: flex; }
.nav-item .dropdown .nav-item .dropdown { top: 0; left: 100%; }
.nav-item.has-children > a::after { content: " ▾"; color: var(--muted); font-size: .8em; }

/* Search */
.search-box { display: flex; align-items: center; }
.search-box input {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 8px 0 0 8px;
  padding: .45rem .7rem;
  color: var(--fg);
  font: inherit;
  width: 200px;
}
.search-box button {
  border: 1px solid var(--border);
  border-left: 0;
  background: var(--accent);
  color: #101010;
  padding: .45rem .7rem;
  border-radius: 0 4px 4px 0;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  text-shadow: none;
}

/* Main */
.site-main { width: 100%; padding: 2rem 1.25rem 3rem; }

/* ===== Homepage ===== */
.intro { text-align: center; padding: 2.5rem 1rem 2rem; max-width: 780px; margin: 0 auto; }
.eyebrow { text-transform: uppercase; letter-spacing: 2px; font-size: .78rem; color: var(--accent); font-weight: 700; margin: 0 0 .5rem; }
.intro-title { font-size: clamp(2rem, 5vw, 3.1rem); line-height: 1.12; margin: 0 0 .8rem; letter-spacing: -.02em; }
.intro-title span {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: none;
}
.intro-sub { color: var(--muted); font-size: 1.1rem; margin: 0; }

/* Shared: pill, byline, media placeholder */
.pill { display: inline-block; background: rgba(181,232,83,.12); color: var(--accent); font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; padding: 4px 12px; border-radius: 999px; border: 1px solid rgba(181,232,83,.35); text-shadow: none; }
.byline { display: flex; flex-wrap: wrap; gap: .9rem; color: var(--muted); font-size: .85rem; }
.byline.sm { gap: .6rem; font-size: .78rem; }
[data-placeholder] { background: linear-gradient(135deg, #1c1c1c, #101010 55%, #0a0a0a); border: 1px solid var(--border); }
.media-mono { font-size: 4rem; font-weight: 800; color: var(--accent); letter-spacing: 2px; text-shadow: var(--glow-green); }
.media-mono.sm { font-size: 1.3rem; }

/* Top section: featured story + Top Stories list */
.top-section { display: grid; grid-template-columns: 1.6fr 1fr; gap: 2rem; margin-bottom: 2rem; padding-bottom: 2rem; border-bottom: 1px solid var(--border); }
.top-story { display: block; color: inherit; }
.top-story:hover { text-decoration: none; }
.top-media { height: 380px; border-radius: 12px; background-size: cover; background-position: center; display: flex; align-items: center; justify-content: center; margin-bottom: 1rem; }
.top-story-body { display: flex; flex-direction: column; gap: .1rem; }
.top-story:hover .top-title { color: var(--accent); }
.top-title { font-size: clamp(1.6rem, 3vw, 2.3rem); line-height: 1.15; letter-spacing: -.01em; margin: .7rem 0 .5rem; }
.top-dek { color: var(--muted); font-size: 1.05rem; margin: 0 0 .8rem; }

.top-list { display: flex; flex-direction: column; }
.top-list-head { font-size: .8rem; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; color: var(--accent); padding-bottom: .6rem; border-bottom: 2px solid var(--accent); margin-bottom: .2rem; }
.top-item { display: flex; flex-direction: column; gap: .25rem; padding: .85rem 0; border-bottom: 1px solid var(--border); color: inherit; }
.top-item:hover { text-decoration: none; }
.top-item:hover .top-item-title { color: var(--accent); }
.top-item-cat { font-size: .68rem; text-transform: uppercase; letter-spacing: .4px; color: var(--accent); font-weight: 700; }
.top-item-title { font-size: 1.02rem; font-weight: 650; line-height: 1.3; }

/* Topic bar */
.topic-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem 1.1rem; padding: .25rem 0 1.25rem; border-bottom: 1px solid var(--border); margin-bottom: 1.5rem; }
.topic-bar-label { font-size: .75rem; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); }
.topic-link { font-size: .92rem; font-weight: 600; color: var(--fg); }
.topic-link:hover { color: var(--accent); text-decoration: none; }

/* News list (horizontal rows) */
.news-list { display: flex; flex-direction: column; }
.news-row { display: grid; grid-template-columns: 220px 1fr; gap: 1.25rem; padding: 1.25rem 0; border-bottom: 1px solid var(--border); color: inherit; }
.news-row:hover { text-decoration: none; }
.news-row:hover .news-title { color: var(--accent); }
.news-thumb { height: 140px; border-radius: 10px; background-size: cover; background-position: center; display: flex; align-items: center; justify-content: center; }
.news-body { display: flex; flex-direction: column; gap: .4rem; }
.news-cat { font-size: .7rem; text-transform: uppercase; letter-spacing: .5px; color: var(--accent); font-weight: 700; }
.news-title { font-size: 1.3rem; line-height: 1.25; margin: 0; letter-spacing: -.01em; }
.news-dek { color: var(--muted); margin: 0; font-size: .95rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.see-all { font-size: .9rem; font-weight: 600; }
.small { font-size: .85rem; }

/* CTA */
.cta { margin: 3rem 0 1rem; }
.cta-inner {
  text-align: center; padding: 2.5rem 1.5rem;
  background: linear-gradient(135deg, #1a1a1a, #101010);
  border: 1px dashed var(--accent); border-radius: var(--radius);
}
.cta-inner h2 { margin: 0 0 .4rem; font-size: 1.6rem; }
.cta-inner p { color: var(--muted); margin: 0 0 1.25rem; }
.cta-search { display: flex; gap: .5rem; max-width: 480px; margin: 0 auto; }
.cta-search input { flex: 1; background: #000; border: 1px solid var(--border); border-radius: var(--radius); padding: .65rem .9rem; color: var(--fg); font: inherit; }
.cta-search button { background: var(--accent); color: #101010; border: 0; border-radius: var(--radius); padding: .65rem 1.4rem; cursor: pointer; font: inherit; font-weight: bold; text-shadow: none; }
.cta-search button:hover { background: var(--accent-2); }

@media (max-width: 820px) {
  .top-section { grid-template-columns: 1fr; }
  .top-media { height: 240px; }
  .news-row { grid-template-columns: 120px 1fr; gap: .9rem; }
  .news-thumb { height: 90px; }
  .news-title { font-size: 1.1rem; }
}

/* Sections */
.section { margin-top: 2rem; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 1rem; border-bottom: 1px solid var(--border); padding-bottom: .5rem; }
.section-head h2 { margin: 0; font-size: 1.3rem; }

/* Card grid */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.25rem; }
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.card:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: 0 12px 28px rgba(181, 232, 83, .12); }
.card-cover img { width: 100%; height: 160px; object-fit: cover; display: block; }
.card-body { padding: 1rem 1.1rem 1.2rem; display: flex; flex-direction: column; gap: .5rem; }
.card-cat { font-size: .75rem; text-transform: uppercase; letter-spacing: .4px; color: var(--accent-2); }
.card-cat:hover { text-decoration: none; }
.card-title { margin: 0; font-size: 1.15rem; line-height: 1.35; }
.card-title a { color: var(--fg); }
.card-title a:hover { color: var(--accent-2); text-decoration: none; }
.card-summary { margin: 0; color: var(--muted); font-size: .92rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card-meta { display: flex; flex-wrap: wrap; gap: .75rem; color: var(--muted); font-size: .8rem; margin-top: auto; }

/* Breadcrumb */
.breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; font-size: .85rem; color: var(--muted); margin-bottom: 1rem; }
.breadcrumb .sep { color: var(--border); }

/* Page head */
.page-head { margin-bottom: 1.25rem; }
.page-head h1 { margin: 0 0 .35rem; font-size: 2rem; }

/* Subcategories */
.subcats { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.5rem; }
.subcat-chip { background: var(--bg-2); border: 1px solid var(--border); padding: .35rem .8rem; border-radius: 999px; color: var(--fg); font-size: .88rem; }
.subcat-chip:hover { border-color: var(--accent); text-decoration: none; }

/* Article */
.article { max-width: 820px; margin: 0 auto; }
.article--doc { max-width: 100%; }
.article-head { margin-bottom: 1.5rem; }
.article-cat { font-size: .78rem; text-transform: uppercase; letter-spacing: .5px; color: var(--accent-2); }
.article-head h1 { margin: .4rem 0 .6rem; font-size: clamp(1.6rem, 3.5vw, 2.4rem); line-height: 1.2; }
.article-meta { display: flex; flex-wrap: wrap; gap: 1rem; color: var(--muted); font-size: .85rem; }
.article-lead { color: var(--muted); font-size: 1.1rem; margin: 1rem 0 0; }
.article-cover { width: 100%; border-radius: var(--radius); margin: 1.5rem 0; }

/* Imported full-HTML documents: auto-grow to content height (page scrolls, no inner scrollbar) */
.article-frame { width: 100%; height: 600px; border: 0; background: #151515; border-radius: var(--radius); display: block; overflow: hidden; }

.article-content { font-size: 1.05rem; }
.article-content h1, .article-content h2, .article-content h3 { line-height: 1.3; margin: 1.8rem 0 .6rem; }
.article-content p { margin: .9rem 0; }
.article-content img { border-radius: 8px; margin: 1rem 0; }
.article-content pre { background: #000; border: 1px solid rgba(255,255,255,.15); border-radius: var(--radius); padding: 1rem; overflow-x: auto; color: var(--accent); }
.article-content code { background: rgba(0,0,0,.9); border: 1px solid rgba(255,255,255,.15); padding: 0 4px; border-radius: 2px; font-size: .9em; color: #aa759f; }
.article-content pre code { background: none; padding: 0; border: 0; color: inherit; }
.article-content a { color: var(--accent-2); }
.article-content blockquote { border-left: 1px dotted var(--muted); margin: 1rem 0; padding: .3rem 0 .3rem 1rem; color: var(--muted); }

.article-tags { display: flex; flex-wrap: wrap; gap: .5rem; margin: 2rem 0 0; }
.tag-chip { background: rgba(99,192,245,.12); color: var(--accent-2); border: 1px solid rgba(99,192,245,.35); padding: 3px 12px; border-radius: 999px; font-size: .82rem; text-shadow: none; }

.related { margin-top: 3rem; }

/* Search page */
.search-inline { display: flex; gap: .5rem; margin-top: .75rem; max-width: 520px; }
.search-inline input { flex: 1; background: var(--bg-2); border: 1px solid var(--border); border-radius: 8px; padding: .55rem .8rem; color: var(--fg); font: inherit; }
.search-inline .btn-primary { background: var(--accent); color: #101010; border: 0; border-radius: var(--radius); padding: .55rem 1.1rem; cursor: pointer; font: inherit; font-weight: bold; text-shadow: none; }
.search-inline .btn-primary:hover { background: var(--accent-2); }

/* Prose */
.prose { max-width: 760px; font-size: 1.05rem; }
.prose pre { background: #000; border: 1px solid rgba(255,255,255,.15); border-radius: var(--radius); padding: 1rem; overflow-x: auto; color: var(--accent); }
.prose code { background: rgba(0,0,0,.9); border: 1px solid rgba(255,255,255,.15); padding: 0 4px; border-radius: 2px; color: #aa759f; }
.prose pre code { background: none; padding: 0; border: 0; color: inherit; }
.prose blockquote { border-left: 1px dotted var(--muted); padding-left: 1rem; color: var(--muted); }

/* Global elements (hacker style) */
hr { height: 0; border: 0; border-bottom: 1px dashed var(--accent); margin: 1.5rem 0; }
table { width: 100%; border-collapse: collapse; margin: 0 0 1.25rem; }
th { text-align: left; border-bottom: 1px dashed var(--accent); padding: 5px 10px; color: var(--accent); }
td { padding: 5px 10px; border-bottom: 1px solid var(--border); }
::selection { background: var(--accent); color: #101010; text-shadow: none; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #101010; }
::-webkit-scrollbar-thumb { background: #2e2e2e; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* Footer */
.site-footer { border-top: 1px dashed var(--accent); padding: 1.5rem 0; color: var(--muted); font-size: .9rem; }

/* Responsive */
@media (max-width: 720px) {
  .header-inner { flex-wrap: wrap; height: auto; padding: .6rem 0; gap: .6rem; }
  .main-nav { order: 3; width: 100%; overflow-x: auto; }
  .search-box { order: 2; margin-left: auto; }
  .search-box input { width: 150px; }
}
