/* ============================================================
   NETWORK ENGINEER HUB — Home page (Proposal v2: Simulation-Theory
   synthwave + Normandy heraldic logo)
   ============================================================ */

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; }
img, svg { display: block; max-width: 100%; }
ul { list-style: none; margin: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }

/* ---------- Theme variables ---------- */
:root {
  color-scheme: dark;

  --bg-base: #0a0e13;
  --bg-surface: #120b1e;      /* deep violet-tinted panel */
  --bg-surface-alt: #0c0917;
  --bg-elevated: #1b1430;

  --border-color: #2c2247;
  --border-strong: #4a2f66;

  --text-primary: #f2eefb;
  --text-secondary: #b9b0cf;
  --text-tertiary: #7d7396;

  /* synthwave neons (chrome / structure) */
  --neon-magenta: #ff2d95;
  --neon-cyan:    #2de2ff;
  --neon-purple:  #b57bff;
  --neon-gold:    #ffd15c;

  /* brand taxonomy accents (badges keep the category meaning) */
  --accent-green:  #2ee6a1;
  --accent-purple: #a78bfa;
  --accent-yellow: #e8c547;

  --font-heading: "Space Grotesk", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-body:    "Inter", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, "Cascadia Code", "SFMono-Regular", Menlo, Consolas, monospace;
}

/* ---------- Typography ---------- */
body {
  font-family: var(--font-body);
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
}
h1, h2, h3 { font-family: var(--font-heading); font-weight: 600; line-height: 1.15; margin: 0 0 0.5em; }
p { margin: 0 0 1em; color: var(--text-secondary); }
.mono { font-family: var(--font-mono); }

/* ---------- Layout / container ---------- */
.container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }
.section { padding: 4.5rem 0; position: relative; }
.section-alt { background: var(--bg-surface-alt); border-top: 1px solid var(--border-color); border-bottom: 1px solid var(--border-color); }
.section-head { max-width: 660px; margin: 0 auto 2.75rem; text-align: center; }
.section-kicker {
  color: var(--neon-magenta); font-size: 0.75rem; letter-spacing: 0.2em;
  text-transform: uppercase; margin: 0 0 0.45rem; text-shadow: 0 0 12px rgba(255,45,149,0.5);
}
.section-head h2 { font-size: clamp(1.6rem, 3.2vw, 2.1rem); letter-spacing: 0.01em; }
.section-sub { color: var(--text-tertiary); }

/* ---------- Utilities ---------- */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 0; top: -3rem; background: var(--neon-magenta); color: #14030c;
  padding: 0.6rem 1rem; z-index: 100; transition: top 0.2s ease; font-weight: 600;
}
.skip-link:focus { top: 0; }
:focus-visible { outline: 2px solid var(--neon-cyan); outline-offset: 2px; }

.is-placeholder { color: var(--text-tertiary) !important; cursor: default; }
.soon-pill {
  font-family: var(--font-mono); font-size: 0.58rem; text-transform: uppercase;
  background: var(--bg-elevated); color: var(--text-tertiary); border: 1px solid var(--border-color);
  border-radius: 2px; padding: 0.05rem 0.35rem; margin-left: 0.35rem; vertical-align: middle;
}

/* ---------- Logo (heraldic shield, raster crest) ---------- */
.logo { height: auto; display: block; }
.logo--small { width: 41px; }
.logo--hero { width: min(300px, 72vw); margin-bottom: 0.25rem; }
@media (prefers-reduced-motion: no-preference) {
  .logo--hero { animation: crest-glow 6s ease-in-out infinite; }
}
@keyframes crest-glow {
  0%, 100% { filter: drop-shadow(0 0 6px rgba(45,226,255,.45)) drop-shadow(0 0 12px rgba(45,226,255,.25)); }
  50%      { filter: drop-shadow(0 0 12px rgba(45,226,255,.65)) drop-shadow(0 0 22px rgba(45,226,255,.4)); }
}

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(10, 14, 19, 0.9); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; padding: 0.7rem 1.5rem; gap: 1rem; }
.brand { display: flex; align-items: center; gap: 0.65rem; }
.brand-name {
  font-family: var(--font-heading); font-weight: 700; font-size: 1rem;
  letter-spacing: 0.04em; white-space: nowrap; color: var(--text-primary);
}
.brand-dim { color: var(--neon-cyan); }
.brand-accent { color: var(--neon-magenta); }

.nav-toggle { display: none; flex-direction: column; gap: 4px; background: none; border: 0; padding: 0.4rem; }
.nav-toggle-bar { width: 22px; height: 2px; background: var(--text-primary); border-radius: 2px; }

.primary-nav ul { display: flex; align-items: center; gap: 1.35rem; flex-wrap: wrap; }
.primary-nav a {
  font-size: 0.88rem; color: var(--text-secondary); transition: color 0.15s ease;
  display: inline-flex; align-items: center; position: relative;
}
.primary-nav a:not(.is-placeholder)::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: -4px; height: 1px;
  background: var(--neon-magenta); transition: right 0.2s ease; box-shadow: 0 0 6px var(--neon-magenta);
}
.primary-nav a:not(.is-placeholder):hover { color: var(--neon-cyan); }
.primary-nav a:not(.is-placeholder):hover::after { right: 0; }
.primary-nav a[aria-current="page"] { color: var(--neon-cyan); }
.nav-search { font-size: 1rem; }

/* ---------- Hero (Simulation-Theory synthwave) ---------- */
.hero {
  position: relative; overflow: hidden; text-align: center;
  padding: 5rem 0 5.5rem;
  background:
    radial-gradient(ellipse 60% 45% at 50% 74%, rgba(255,45,149,0.30), transparent 70%),
    linear-gradient(180deg, #0a0e13 0%, #140a24 45%, #1e0c33 66%, #0a0e13 100%);
}
.hero-sun {
  position: absolute; left: 50%; top: 92px; transform: translateX(-50%);
  width: 300px; height: 300px; border-radius: 50%;
  background: linear-gradient(180deg, #ffe27a 0%, #ff8a3d 42%, #ff2d95 100%);
  opacity: 0.55; filter: blur(0.5px); z-index: 0;
}
/* horizontal "slit" bars across the lower half of the sun */
.hero-sun::before {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 58%;
  background: repeating-linear-gradient(to bottom, transparent 0 6px, #0a0e13 6px 9px);
  border-radius: 0 0 150px 150px;
}
/* outrun perspective grid on the floor */
.hero-grid {
  position: absolute; left: 50%; bottom: 0; width: 230%; height: 44%;
  transform: translateX(-50%) perspective(300px) rotateX(60deg);
  transform-origin: 50% 100%; z-index: 0;
  background-image:
    linear-gradient(90deg, rgba(45,226,255,0.45) 1px, transparent 1px),
    linear-gradient(rgba(255,45,149,0.45) 1px, transparent 1px);
  background-size: 46px 46px;
  -webkit-mask-image: linear-gradient(to top, #000 30%, transparent 92%);
          mask-image: linear-gradient(to top, #000 30%, transparent 92%);
}
.hero-inner { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; }
.hero-terminal {
  font-family: var(--font-mono); color: var(--neon-cyan); font-size: 0.82rem;
  margin: 1.4rem 0 0.6rem; padding: 0.3rem 0.75rem; border: 1px solid var(--border-color);
  border-radius: 3px; background: rgba(10,14,19,0.6);
}
.hero-terminal::before { content: "> "; color: var(--neon-magenta); }
.hero h1 { font-size: clamp(2rem, 6.4vw, 3.9rem); margin: 0.3rem 0 0.6rem; font-weight: 700; letter-spacing: 0.02em; }
.hero h1 .glitch {
  background: linear-gradient(180deg, #ffffff 0%, var(--neon-cyan) 45%, var(--neon-magenta) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  position: relative; display: inline-block;
  filter: drop-shadow(0 0 16px rgba(255,45,149,0.55)) drop-shadow(0 0 26px rgba(45,226,255,0.35));
}
@media (prefers-reduced-motion: no-preference) {
  .hero h1 .glitch::before, .hero h1 .glitch::after {
    content: attr(data-text); position: absolute; left: 0; top: 0; width: 100%;
    -webkit-background-clip: text; background-clip: text; color: transparent; pointer-events: none;
  }
  .hero h1 .glitch::before { background: var(--neon-magenta); opacity: 0.22; animation: glitch-x 5.5s infinite steps(2); }
  .hero h1 .glitch::after  { background: var(--neon-cyan);    opacity: 0.22; animation: glitch-x 5.5s infinite steps(2) reverse; }
}
@keyframes glitch-x {
  0%, 92%, 100% { transform: translate(0, 0); }
  93% { transform: translate(-1.8px, 0.6px); }
  96% { transform: translate(1.8px, -0.6px); }
}
.hero-tagline { font-size: 1.12rem; color: var(--text-primary); max-width: 660px; }
.hero-intro { max-width: 620px; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: center; margin-top: 0.75rem; }

/* ---------- Buttons / badges ---------- */
.btn {
  display: inline-block; padding: 0.72rem 1.5rem; font-weight: 600; font-size: 0.9rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}
.btn-primary { background: var(--neon-magenta); color: #14030c; box-shadow: 0 0 14px rgba(255,45,149,.35); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 0 22px rgba(255,45,149,.6); }
.btn-secondary { background: transparent; color: var(--text-primary); border: 1px solid var(--border-strong); }
.btn-secondary:hover { box-shadow: inset 0 0 0 1px var(--neon-cyan); }
.btn-ghost {
  background: var(--bg-elevated); color: var(--text-secondary); border: 1px solid var(--border-color);
  padding: 0.5rem 1rem; font-size: 0.85rem;
}
.btn.is-placeholder:hover { transform: none; box-shadow: none; }

.badge {
  display: inline-block; font-family: var(--font-mono); font-size: 0.68rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em; padding: 0.24rem 0.55rem;
  border-radius: 2px; margin-bottom: 0.85rem;
}
.badge-green { background: var(--accent-green); color: #06110d; }
.badge-purple { background: var(--accent-purple); color: #140a2e; }
.badge-yellow { background: var(--accent-yellow); color: #241d02; }
.badge-outline { background: transparent; border: 1px solid var(--border-strong); color: var(--text-tertiary); }
.card-tags { display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* ---------- Card grids ---------- */
.grid { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.card {
  background: var(--bg-surface); border: 1px solid var(--border-color);
  padding: 1.6rem; display: flex; flex-direction: column; position: relative;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 16px, 100% 100%, 0 100%);
}
.card::before {
  content: ""; position: absolute; left: 0; top: 0; width: 3px; height: 100%;
  background: linear-gradient(var(--neon-magenta), var(--neon-cyan)); opacity: 0.8;
}
.card:hover { transform: translateY(-3px); border-color: var(--border-strong); box-shadow: 0 8px 30px rgba(255,45,149,0.18); }
.card h3 { font-size: 1.05rem; }
.card h3 a:hover:not(.is-placeholder) { color: var(--neon-cyan); }
.card-excerpt { flex-grow: 1; }
.card-meta { color: var(--text-tertiary); font-size: 0.8rem; margin-bottom: 0.75rem; }
.card-link { font-weight: 600; color: var(--neon-magenta); font-size: 0.9rem; }
.card-link.is-placeholder { color: var(--text-tertiary) !important; }
.card-tool::before { background: linear-gradient(var(--neon-cyan), var(--neon-purple)); }
.card-tool h3 { margin-top: 0.5rem; }

/* ---------- Downloads list ---------- */
.download-list { display: flex; flex-direction: column; gap: 0.75rem; max-width: 860px; margin: 0 auto; }
.download-row {
  display: flex; align-items: center; gap: 1rem; background: var(--bg-surface);
  border: 1px solid var(--border-color); padding: 1rem 1.25rem; flex-wrap: wrap;
  transition: border-color 0.15s ease;
}
.download-row:hover { border-color: var(--border-strong); }
.file-badge {
  background: var(--bg-elevated); color: var(--neon-gold); border: 1px solid var(--border-color);
  border-radius: 3px; padding: 0.25rem 0.55rem; font-size: 0.75rem; font-weight: 700;
}
.download-info { flex: 1 1 240px; display: flex; flex-direction: column; gap: 0.15rem; }
.download-title { font-size: 0.9rem; color: var(--text-primary); }
.download-desc { color: var(--text-tertiary); font-size: 0.85rem; }

/* ---------- Newsletter ---------- */
.newsletter { text-align: center; }
.newsletter-inner { max-width: 540px; }
#newsletter-form { display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: center; margin-top: 1.25rem; }
#newsletter-form input {
  flex: 1 1 260px; padding: 0.72rem 1rem; border: 1px solid var(--border-strong);
  background: var(--bg-elevated); color: var(--text-primary); font-family: var(--font-body);
  border-radius: 3px;
}
#newsletter-form input:focus { outline: none; border-color: var(--neon-cyan); box-shadow: 0 0 0 1px var(--neon-cyan); }
#newsletter-form input::placeholder { color: var(--text-tertiary); }
.newsletter-note { color: var(--neon-cyan); font-size: 0.9rem; min-height: 1.2em; margin: 1rem 0 0; font-family: var(--font-mono); }
.newsletter-disclaimer { color: var(--text-tertiary); font-size: 0.8rem; margin-top: 0.5rem; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border-color); background: var(--bg-surface-alt); padding: 3rem 0 1.5rem; }
.footer-inner { display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin-bottom: 2rem; }
.footer-tagline { font-size: 0.85rem; margin-top: 0.75rem; }
.footer-nav ul { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 0.6rem; }
.footer-nav a, .footer-contact a { font-size: 0.85rem; color: var(--text-secondary); }
.footer-nav a:not(.is-placeholder):hover, .footer-contact a:not(.is-placeholder):hover { color: var(--neon-cyan); }
.footer-contact { display: flex; gap: 1.25rem; align-items: flex-start; }
.footer-copyright { text-align: center; color: var(--text-tertiary); font-size: 0.75rem; font-family: var(--font-mono); }

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .nav-toggle { display: flex; }
  .primary-nav {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    background: var(--bg-surface); border-bottom: 1px solid var(--border-color);
    padding: 1rem 1.5rem 1.5rem;
  }
  .primary-nav.nav-open { display: block; }
  .primary-nav ul { flex-direction: column; align-items: flex-start; gap: 0.9rem; }
}
@media (max-width: 480px) {
  .hero-ctas { flex-direction: column; width: 100%; }
  .hero-ctas .btn { width: 100%; text-align: center; }
  .hero-sun { width: 220px; height: 220px; }
}
