/* ============================================================
   IEC 61850 HUB — MAIN STYLESHEET
   Edit variables at the top to retheme the whole site.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Share+Tech+Mono&family=Barlow:wght@300;400;600;700&family=Barlow+Condensed:wght@700;900&display=swap');

/* ── THEME VARIABLES ─────────────────────────────────────── */
:root {
  --bg:          #0b0f1a;
  --bg2:         #111827;
  --bg3:         #1a2235;
  --border:      #1f2d45;
  --accent:      #00d4ff;
  --accent2:     #0090cc;
  --accent3:     #ff6b2b;
  --green:       #00e676;
  --text:        #c8d8e8;
  --text-dim:    #627080;
  --text-bright: #eaf4ff;
  --font-body:   'Barlow', sans-serif;
  --font-mono:   'Share Tech Mono', monospace;
  --font-display:'Barlow Condensed', sans-serif;
  --radius:      6px;
  --nav-h:       60px;
}

/* ── RESET & BASE ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.65;
  min-height: 100vh;
}

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

h1,h2,h3,h4 {
  font-family: var(--font-display);
  color: var(--text-bright);
  line-height: 1.1;
  letter-spacing: .5px;
}

/* ── TOP NAV ─────────────────────────────────────────────── */
.topnav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--nav-h);
  background: rgba(11,15,26,.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
}

.topnav__inner {
  max-width: 1280px; width: 100%; margin: 0 auto;
  padding: 0 24px;
  display: flex; align-items: center; gap: 8px;
}

.topnav__logo {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  color: var(--accent);
  white-space: nowrap;
  margin-right: auto;
  display: flex; align-items: center; gap: 10px;
}
.topnav__logo-badge {
  background: var(--accent);
  color: #000;
  font-size: .65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 3px;
  letter-spacing: 1px;
}

.topnav__links {
  display: flex; gap: 4px; list-style: none;
}
.topnav__links a {
  display: block;
  padding: 6px 14px;
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .8px;
  text-transform: uppercase;
  color: var(--text-dim);
  border-radius: var(--radius);
  transition: all .2s;
}
.topnav__links a:hover,
.topnav__links a.active {
  color: var(--accent);
  background: rgba(0,212,255,.07);
}

.topnav__hamburger {
  display: none;
  background: none; border: none; cursor: pointer;
  color: var(--text); font-size: 1.4rem; padding: 4px;
}

/* ── PAGE WRAPPER ─────────────────────────────────────────── */
.page {
  padding-top: var(--nav-h);
  min-height: 100vh;
}

/* ── HERO ─────────────────────────────────────────────────── */
.hero {
  position: relative;
  padding: 80px 24px 60px;
  text-align: center;
  overflow: hidden;
  background:
    radial-gradient(ellipse 60% 50% at 50% 0%, rgba(0,144,204,.18) 0%, transparent 70%),
    var(--bg);
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 40px 40px;
  opacity: .25;
  pointer-events: none;
}

.hero__eyebrow {
  font-family: var(--font-mono);
  font-size: .8rem;
  color: var(--accent);
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.hero__title {
  font-size: clamp(2.6rem, 6vw, 5rem);
  font-weight: 900;
  color: var(--text-bright);
  line-height: 1;
  margin-bottom: 8px;
}
.hero__title span { color: var(--accent); }
.hero__subtitle {
  font-size: 1.05rem;
  color: var(--text-dim);
  max-width: 600px;
  margin: 12px auto 32px;
}
.hero__stats {
  display: flex; justify-content: center; flex-wrap: wrap; gap: 32px;
  margin-top: 40px;
}
.hero__stat {
  text-align: center;
}
.hero__stat-num {
  font-family: var(--font-mono);
  font-size: 2rem;
  color: var(--accent);
}
.hero__stat-label {
  font-size: .78rem;
  color: var(--text-dim);
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* ── SECTION ─────────────────────────────────────────────── */
.section {
  max-width: 1280px;
  margin: 0 auto;
  padding: 48px 24px;
}
.section--dark { background: var(--bg2); }

.section__header {
  display: flex; align-items: baseline; gap: 12px;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 14px;
}
.section__icon { font-size: 1.4rem; }
.section__title {
  font-size: 1.5rem;
  font-weight: 700;
}
.section__count {
  font-family: var(--font-mono);
  font-size: .75rem;
  color: var(--text-dim);
  margin-left: auto;
}

/* ── RESOURCE CARDS GRID ──────────────────────────────────── */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  display: flex; flex-direction: column; gap: 8px;
  transition: border-color .2s, transform .15s;
  position: relative;
}
.card:hover {
  border-color: var(--accent2);
  transform: translateY(-2px);
}
.card::before {
  content: '';
  position: absolute; top: 0; left: 0;
  width: 3px; height: 100%;
  border-radius: var(--radius) 0 0 var(--radius);
  background: var(--accent);
  opacity: 0;
  transition: opacity .2s;
}
.card:hover::before { opacity: 1; }

.card__title {
  font-size: .95rem;
  font-weight: 600;
  color: var(--text-bright);
}
.card__title a { color: inherit; }
.card__title a:hover { color: var(--accent); }

.card__desc {
  font-size: .83rem;
  color: var(--text-dim);
  flex: 1;
}

.card__tags {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-top: 4px;
}
.tag {
  font-family: var(--font-mono);
  font-size: .68rem;
  padding: 2px 8px;
  border-radius: 20px;
  letter-spacing: .5px;
}
.tag--free     { background: rgba(0,230,118,.12); color: var(--green); border: 1px solid rgba(0,230,118,.25); }
.tag--paid     { background: rgba(255,107,43,.12); color: var(--accent3); border: 1px solid rgba(255,107,43,.25); }
.tag--official { background: rgba(0,212,255,.12); color: var(--accent); border: 1px solid rgba(0,212,255,.25); }
.tag--tool     { background: rgba(180,130,255,.12); color: #b48fff; border: 1px solid rgba(180,130,255,.25); }
.tag--book     { background: rgba(255,215,0,.10); color: #ffd700; border: 1px solid rgba(255,215,0,.25); }
.tag--video    { background: rgba(255,60,80,.12); color: #ff6060; border: 1px solid rgba(255,60,80,.25); }
.tag--community{ background: rgba(100,220,150,.10); color: #64dc96; border: 1px solid rgba(100,220,150,.25); }

/* ── SEARCH BAR ───────────────────────────────────────────── */
.search-wrap {
  max-width: 560px;
  margin: 0 auto 40px;
  position: relative;
}
.search-wrap input {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-bright);
  font-family: var(--font-body);
  font-size: .95rem;
  padding: 12px 44px 12px 16px;
  outline: none;
  transition: border-color .2s;
}
.search-wrap input:focus { border-color: var(--accent); }
.search-wrap input::placeholder { color: var(--text-dim); }
.search-icon {
  position: absolute; right: 14px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim); font-size: 1rem;
  pointer-events: none;
}

/* ── FILTER PILLS ─────────────────────────────────────────── */
.filter-pills {
  display: flex; flex-wrap: wrap; gap: 8px;
  justify-content: center;
  margin-bottom: 32px;
}
.pill {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .6px;
  text-transform: uppercase;
  padding: 5px 14px;
  border-radius: 20px;
  cursor: pointer;
  transition: all .2s;
}
.pill:hover, .pill.active {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(0,212,255,.07);
}

/* ── GLOSSARY TABLE ───────────────────────────────────────── */
.glossary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 12px;
}
.glossary-item {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.glossary-term {
  font-family: var(--font-mono);
  font-size: .95rem;
  color: var(--accent);
  margin-bottom: 4px;
}
.glossary-def {
  font-size: .83rem;
  color: var(--text-dim);
}

/* ── INFO BOXES ───────────────────────────────────────────── */
.infobox {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 20px;
  font-size: .88rem;
  color: var(--text-dim);
}
.infobox strong { color: var(--text-bright); }

/* ── FOOTER ───────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border);
  text-align: center;
  padding: 28px 24px;
  font-family: var(--font-mono);
  font-size: .78rem;
  color: var(--text-dim);
}
.footer a { color: var(--text-dim); }
.footer a:hover { color: var(--accent); }

/* ── RESPONSIVE ───────────────────────────────────────────── */
@media (max-width: 700px) {
  .topnav__links { display: none; flex-direction: column; }
  .topnav__links.open {
    display: flex;
    position: fixed; top: var(--nav-h); left: 0; right: 0;
    background: var(--bg2);
    border-bottom: 1px solid var(--border);
    padding: 12px;
  }
  .topnav__hamburger { display: block; }
  .cards-grid { grid-template-columns: 1fr; }
  .hero { padding: 60px 20px 40px; }
}
