/* =========================================================
   HBCE UI SYSTEM — CANONICAL (FULL, REFACTORED)
   - Single design system for all core pages
   - Dark institutional theme (EU-first posture)
   - Supports: hbce-grid--2 / --3 / --4, hbce-btn, hbce-hero, cards
   - Refactored for protocol / infrastructure portal semantics
   - No dependency on DOM injection
   ========================================================= */

:root{
  --hbce-bg:#0b0f14;
  --hbce-panel:#0f1620;
  --hbce-panel2:rgba(15,22,32,.55);
  --hbce-text:#e8eef7;
  --hbce-muted:#9fb0c3;

  --hbce-line:rgba(255,255,255,.08);
  --hbce-line2:rgba(255,255,255,.12);

  --hbce-accent:#00ffe1;
  --hbce-accent2:#7c5cff;

  --hbce-shadow:0 20px 60px rgba(0,0,0,.45);
  --hbce-shadow2:0 12px 35px rgba(0,0,0,.35);

  --hbce-radius:18px;
  --hbce-radius2:26px;
  --hbce-max:1120px;

  --hbce-sticky-offset:76px;
}

*{box-sizing:border-box}
html,body{height:100%}
html{scroll-padding-top:var(--hbce-sticky-offset)}

body{
  margin:0;
  font-family:ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Noto Sans", "Liberation Sans", sans-serif;
  color:var(--hbce-text);
  background:
    radial-gradient(1200px 800px at 20% 10%, rgba(124,92,255,.10), transparent 55%),
    radial-gradient(900px 700px at 80% 20%, rgba(0,255,225,.08), transparent 55%),
    radial-gradient(1100px 900px at 50% 110%, rgba(0,0,0,.65), transparent 60%),
    var(--hbce-bg);
  line-height:1.55;
}

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

img{
  max-width:100%;
  height:auto;
  display:block;
}

.hbce-container{
  width:100%;
  max-width:var(--hbce-max);
  margin:0 auto;
  padding:28px 18px 60px;
}

.hbce-main{
  min-height:70vh;
}

.hbce-section{
  margin:22px 0 0;
}

.hbce-muted{color:var(--hbce-muted)}

.hbce-mono{
  font-family:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

hr{
  border:0;
  height:1px;
  background:linear-gradient(90deg, transparent, var(--hbce-line2), transparent);
  margin:24px 0;
}

pre,code{
  font-family:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

code{
  padding:.12em .38em;
  border-radius:10px;
  border:1px solid var(--hbce-line);
  background:rgba(0,0,0,.18);
}

pre{
  padding:14px 14px;
  border:1px solid var(--hbce-line);
  border-radius:var(--hbce-radius);
  background:rgba(0,0,0,.25);
  overflow:auto;
}

:focus-visible{
  outline:2px solid rgba(0,255,225,.35);
  outline-offset:2px;
}

/* ---------------------------------------------------------
   HEADER / NAV
--------------------------------------------------------- */
.hbce-header{
  position:sticky;
  top:0;
  z-index:50;
  backdrop-filter:blur(10px);
  background:linear-gradient(180deg, rgba(11,15,20,.85), rgba(11,15,20,.55));
  border-bottom:1px solid var(--hbce-line);
}

.hbce-header__row{
  max-width:var(--hbce-max);
  margin:0 auto;
  padding:14px 18px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}

.hbce-brand{
  display:flex;
  align-items:baseline;
  gap:10px;
  letter-spacing:.2px;
  flex-wrap:wrap;
}

.hbce-nav{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

.hbce-nav a,
.hbce-nav__link{
  padding:8px 10px;
  border-radius:12px;
  border:1px solid transparent;
  color:var(--hbce-muted);
  font-size:13px;
}

.hbce-nav a:hover,
.hbce-nav__link:hover{
  border-color:var(--hbce-line2);
  color:var(--hbce-text);
}

.hbce-nav a.is-active,
.hbce-nav__link.is-active{
  border-color:rgba(0,255,225,.25);
  box-shadow:0 0 0 2px rgba(0,255,225,.10) inset;
  color:var(--hbce-text);
}

/* ---------------------------------------------------------
   HERO
--------------------------------------------------------- */
.hbce-hero{
  margin:26px 0 8px;
  padding:22px 22px;
  border-radius:var(--hbce-radius2);
  border:1px solid var(--hbce-line);
  background:
    radial-gradient(900px 400px at 10% 10%, rgba(0,255,225,.10), transparent 55%),
    radial-gradient(900px 500px at 90% 30%, rgba(124,92,255,.10), transparent 55%),
    var(--hbce-panel2);
  box-shadow:var(--hbce-shadow2);
}

.hbce-hero__kicker{
  font-size:12px;
  letter-spacing:.14em;
  text-transform:uppercase;
  color:var(--hbce-muted);
}

.hbce-hero__title{
  margin:10px 0 8px;
  font-size:38px;
  line-height:1.1;
  letter-spacing:-.02em;
}

.hbce-hero__lead{
  margin:0;
  max-width:70ch;
  color:var(--hbce-muted);
  font-size:15px;
}

/* ---------------------------------------------------------
   CARDS / TYPOGRAPHY
--------------------------------------------------------- */
.hbce-card{
  padding:16px 16px;
  border-radius:var(--hbce-radius);
  border:1px solid var(--hbce-line);
  background:linear-gradient(180deg, rgba(15,22,32,.75), rgba(15,22,32,.55));
  box-shadow:var(--hbce-shadow2);
}

.hbce-card h2,
.hbce-card h3{
  margin:0 0 8px;
  line-height:1.2;
}

.hbce-card p{
  margin:0 0 10px;
}

.hbce-card p.hbce-muted{
  color:var(--hbce-muted);
}

.hbce-card ul{
  margin:10px 0 0;
  padding-left:18px;
  color:var(--hbce-muted);
}

.hbce-card li{
  margin:6px 0;
}

/* ---------------------------------------------------------
   GRID
--------------------------------------------------------- */
.hbce-grid{
  display:grid;
  gap:14px;
}

.hbce-grid--2{
  grid-template-columns:repeat(2, minmax(0, 1fr));
}

.hbce-grid--3{
  grid-template-columns:repeat(3, minmax(0, 1fr));
}

.hbce-grid--4{
  grid-template-columns:repeat(4, minmax(0, 1fr));
}

@media (max-width: 1100px){
  .hbce-grid--4{
    grid-template-columns:repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 920px){
  .hbce-grid--3{
    grid-template-columns:repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px){
  :root{
    --hbce-sticky-offset:92px;
  }

  .hbce-hero__title{
    font-size:30px;
  }

  .hbce-grid--2,
  .hbce-grid--3,
  .hbce-grid--4{
    grid-template-columns:1fr;
  }

  .hbce-header__row{
    align-items:flex-start;
  }
}

/* ---------------------------------------------------------
   BUTTONS / CONTROLS
--------------------------------------------------------- */
.hbce-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding:10px 12px;
  border-radius:14px;
  border:1px solid var(--hbce-line2);
  background:rgba(0,0,0,.10);
  color:var(--hbce-text);
  font-size:13px;
  cursor:pointer;
  user-select:none;
  text-decoration:none;
  appearance:none;
}

.hbce-btn:hover{
  border-color:rgba(0,255,225,.25);
  box-shadow:0 0 0 2px rgba(0,255,225,.10) inset;
}

.hbce-btn--primary{
  border-color:rgba(0,255,225,.35);
  background:linear-gradient(180deg, rgba(0,255,225,.12), rgba(0,0,0,.10));
}

/* ---------------------------------------------------------
   FOOTER
--------------------------------------------------------- */
.hbce-footer{
  margin-top:28px;
  padding-top:20px;
  border-top:1px solid var(--hbce-line);
  color:var(--hbce-muted);
}

.hbce-footer__row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
}

.hbce-footer__links{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

.hbce-footer__links a{
  color:var(--hbce-muted);
}

.hbce-footer__links a:hover{
  color:var(--hbce-text);
}

/* ---------------------------------------------------------
   LIGHT REVEAL ENHANCEMENT
--------------------------------------------------------- */
@media (prefers-reduced-motion: no-preference){
  .hbce-section[data-hbce-reveal="pending"]{
    opacity:0;
    transform:translateY(10px);
  }

  .hbce-section[data-hbce-reveal="visible"]{
    opacity:1;
    transform:translateY(0);
    transition:
      opacity .42s ease,
      transform .42s ease;
  }
}
