:root{
  --bg:#0b1220;
  --bg-soft:#111a2e;
  --card:#16223b;
  --card-2:#1b2945;
  --text:#eef4ff;
  --muted:#a9b7d1;
  --line:rgba(255,255,255,.08);
  --primary:#34d399;
  --primary-dark:#10b981;
  --accent:#60a5fa;
  --danger:#fb7185;
  --shadow:0 18px 50px rgba(0,0,0,.28);
  --shadow-soft:0 10px 30px rgba(0,0,0,.18);
  --radius:20px;
  --radius-sm:14px;
  --max:1200px;
}

/* RESET */
*{
  box-sizing:border-box;
}

html{
  scroll-behavior:smooth;
}

body{
  margin:0;
  font-family:Arial, Helvetica, sans-serif;
  background:linear-gradient(180deg,#08111f 0%, #0b1220 55%, #0f172a 100%);
  color:var(--text);
  line-height:1.6;
}

a{
  color:inherit;
  text-decoration:none;
}

img{
  max-width:100%;
  display:block;
}

button,
input,
textarea,
select{
  font:inherit;
}

button{
  background:none;
}

.container{
  width:min(var(--max), calc(100% - 32px));
  margin:0 auto;
}

/* HEADER */
.site-header{
  position:sticky;
  top:0;
  z-index:1000;
  backdrop-filter:blur(14px);
  background:rgba(8,17,31,.88);
  border-bottom:1px solid var(--line);
}

.nav-wrap{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:24px;
  padding:18px 0;
  position:relative;
}

/* BRAND */
.brand{
  display:flex;
  align-items:center;
  gap:14px;
  min-width:0;
  flex:0 1 auto;
}

.brand-mark{
  width:48px;
  height:48px;
  border-radius:14px;
  background:linear-gradient(135deg,var(--primary),var(--accent));
  display:grid;
  place-items:center;
  color:#062413;
  font-weight:900;
  font-size:20px;
  box-shadow:var(--shadow);
  flex:0 0 auto;
}

.brand-logo{
  height:110px;
  width:auto;
  flex:0 0 auto;
}

.brand-text{
  min-width:0;
}

.brand-text strong{
  display:block;
  font-size:1rem;
  letter-spacing:.2px;
  line-height:1.1;
}

.brand-text small{
  display:block;
  color:var(--muted);
  font-size:.82rem;
  line-height:1.2;
  margin-top:3px;
}

/* NAVIGATION */
.site-nav{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:8px;
  flex-wrap:wrap;
  margin-left:auto;
}

.site-nav > a,
.nav-dropbtn{
  color:var(--muted);
  font-size:.95rem;
  font-weight:600;
  padding:10px 14px;
  border-radius:12px;
  border:1px solid transparent;
  transition:all .2s ease;
  white-space:nowrap;
}

.site-nav > a:hover,
.nav-dropbtn:hover,
.nav-dropdown:hover .nav-dropbtn{
  color:var(--text);
  background:rgba(255,255,255,.05);
  border-color:rgba(255,255,255,.08);
}

.site-nav > a.active{
  color:var(--text);
  background:linear-gradient(135deg, rgba(52,211,153,.20), rgba(96,165,250,.12));
  border-color:rgba(52,211,153,.28);
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.03);
}

/* DROPDOWN */
.nav-dropdown{
  position:relative;
  display:flex;
  align-items:center;
}

.nav-dropbtn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  cursor:pointer;
  background:none;
}

.nav-dropdown-content{
  display:none;
  position:absolute;
  top:calc(100% + 10px);
  left:0;
  min-width:240px;
  background:linear-gradient(180deg,var(--card),var(--card-2));
  border:1px solid var(--line);
  border-radius:16px;
  padding:10px;
  box-shadow:var(--shadow);
  z-index:1200;
}

.nav-dropdown-content a{
  display:block;
  width:100%;
  padding:11px 12px;
  border-radius:10px;
  color:var(--muted);
  font-size:.93rem;
  font-weight:500;
  transition:all .2s ease;
}

.nav-dropdown-content a:hover{
  color:var(--text);
  background:rgba(255,255,255,.05);
}

.nav-dropdown:hover .nav-dropdown-content{
  display:block;
}

/* CTA */
.nav-cta{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:11px 16px;
  border-radius:12px;
  background:linear-gradient(135deg,var(--primary),var(--primary-dark));
  color:#042315 !important;
  font-weight:700;
  border:1px solid rgba(255,255,255,.12) !important;
  box-shadow:0 10px 24px rgba(16,185,129,.18);
}

.nav-cta:hover{
  transform:translateY(-1px);
  background:linear-gradient(135deg,#46e0a4,#14c98d);
  color:#042315 !important;
}

/* ADMIN LINK */
.admin-link{
  display:none;
}

body.logged-in .admin-link{
  display:inline-flex;
}

/* MOBILE TOGGLE */
.menu-toggle{
  display:none;
  align-items:center;
  justify-content:center;
  background:rgba(255,255,255,.03);
  border:1px solid var(--line);
  color:var(--text);
  font-size:1.25rem;
  padding:8px 12px;
  border-radius:12px;
  cursor:pointer;
  transition:.2s ease;
}

.menu-toggle:hover{
  background:rgba(255,255,255,.06);
}

/* HERO */
.hero{
  position:relative;
  overflow:hidden;
  padding:84px 0 56px;
}

.hero::before,
.hero::after{
  content:"";
  position:absolute;
  border-radius:999px;
  filter:blur(60px);
  opacity:.35;
  pointer-events:none;
}

.hero::before{
  width:320px;
  height:320px;
  top:-80px;
  right:-70px;
  background:var(--primary);
}

.hero::after{
  width:260px;
  height:260px;
  left:-80px;
  bottom:20px;
  background:var(--accent);
}

.hero-grid{
  display:grid;
  grid-template-columns:1.15fr .85fr;
  gap:34px;
  align-items:center;
  position:relative;
  z-index:1;
}

.eyebrow{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:8px 12px;
  border-radius:999px;
  background:rgba(52,211,153,.12);
  color:#a7f3d0;
  border:1px solid rgba(52,211,153,.18);
  font-size:.9rem;
  margin-bottom:18px;
}

h1,
h2,
h3,
h4{
  line-height:1.15;
  margin:0 0 14px;
}

h1{
  font-size:clamp(2.1rem,5vw,4rem);
  letter-spacing:-1.2px;
  max-width:800px;
}

p.lead,
.hero p{
  color:var(--muted);
  font-size:1.07rem;
  max-width:720px;
  margin:0 0 24px;
}

.hero-actions,
.post-actions{
  display:flex;
  flex-wrap:wrap;
  gap:14px;
}

/* BUTTONS */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  padding:14px 20px;
  border-radius:14px;
  font-weight:700;
  transition:.2s ease;
  border:1px solid transparent;
  cursor:pointer;
}

.btn-primary{
  background:linear-gradient(135deg,var(--primary),var(--primary-dark));
  color:#042315;
  box-shadow:var(--shadow-soft);
}

.btn-primary:hover{
  transform:translateY(-2px);
}

.btn-secondary,
.btn-outline{
  background:rgba(255,255,255,.03);
  color:var(--text);
  border-color:var(--line);
}

.btn-secondary:hover,
.btn-outline:hover{
  background:rgba(255,255,255,.06);
}

/* GRIDS */
.hero-stats,
.grid-2,
.grid-3,
.grid-4,
.footer-grid{
  display:grid;
  gap:18px;
}

.hero-stats{
  grid-template-columns:repeat(3,1fr);
  margin-top:10px;
}

.grid-2{
  grid-template-columns:repeat(2,1fr);
}

.grid-3{
  grid-template-columns:repeat(3,1fr);
}

.grid-4{
  grid-template-columns:repeat(4,1fr);
}

/* CARDS */
.stat,
.card{
  background:linear-gradient(180deg,var(--card),var(--card-2));
  border:1px solid var(--line);
  border-radius:var(--radius);
  padding:22px;
  box-shadow:var(--shadow);
}

.card{
  overflow:hidden;
}

.hero-card{
  background:linear-gradient(180deg,rgba(255,255,255,.06),rgba(255,255,255,.03));
  border:1px solid var(--line);
  border-radius:26px;
  padding:26px;
  box-shadow:var(--shadow);
}

.stat strong{
  display:block;
  font-size:1.5rem;
  margin-bottom:6px;
}

.stat span,
.muted,
.card p{
  color:var(--muted);
}

/* ICONS */
.icon{
  width:52px;
  height:52px;
  border-radius:16px;
  display:grid;
  place-items:center;
  margin-bottom:14px;
  background:linear-gradient(135deg,rgba(52,211,153,.18),rgba(96,165,250,.18));
  border:1px solid rgba(255,255,255,.08);
  font-size:1.35rem;
}

/* LISTS */
.check-list{
  display:grid;
  gap:12px;
  margin:0;
  padding:0;
  list-style:none;
}

.check-list li{
  display:flex;
  gap:12px;
  align-items:flex-start;
  color:var(--muted);
  background:rgba(255,255,255,.03);
  border:1px solid rgba(255,255,255,.06);
  border-radius:14px;
  padding:12px 14px;
}

.check-list i{
  width:24px;
  height:24px;
  border-radius:999px;
  flex:0 0 24px;
  display:grid;
  place-items:center;
  background:rgba(52,211,153,.14);
  color:#6ee7b7;
  font-style:normal;
  font-weight:700;
  font-size:.82rem;
  margin-top:1px;
}

/* SECTIONS */
section{
  padding:34px 0 20px;
  scroll-margin-top:120px;
}

.section-head{
  display:flex;
  align-items:end;
  justify-content:space-between;
  gap:20px;
  margin-bottom:22px;
}

.section-head p{
  max-width:720px;
  margin:0;
  color:var(--muted);
}

.section-head-simple{
  margin-bottom:24px;
}

.page-space{
  padding:40px 0 60px;
}

/* BLOG */
.blog-filter-grid{
  display:grid;
  grid-template-columns:1fr 260px;
  gap:16px;
  align-items:end;
}

#featuredPost{
  position:relative;
}

#featuredPost img,
.blog-post-image{
  width:100%;
  border-radius:16px;
  object-fit:cover;
}

#featuredPost h2{
  font-size:clamp(1.6rem, 3vw, 2.4rem);
  margin-bottom:10px;
}

#featuredPost .muted{
  margin-bottom:12px;
}

#blogPosts article.card{
  display:flex;
  flex-direction:column;
  height:100%;
}

#blogPosts article.card h2{
  font-size:1.3rem;
  margin-bottom:10px;
}

#blogPosts article.card p{
  margin-top:0;
}

#blogPosts article.card .btn{
  margin-top:auto;
  align-self:flex-start;
}

.blog-content{
  line-height:1.75;
  color:var(--text);
}

.blog-content p{
  margin:0 0 16px;
  color:var(--text);
}

.blog-content h2,
.blog-content h3,
.blog-content h4{
  margin:28px 0 14px;
}

.blog-content ul,
.blog-content ol{
  margin:0 0 18px 20px;
  color:var(--text);
}

.blog-content li{
  margin-bottom:8px;
}

.blog-content a{
  color:#a7f3d0;
  text-decoration:underline;
  text-underline-offset:2px;
}

.blog-content blockquote{
  margin:20px 0;
  padding:16px 18px;
  border-left:4px solid var(--primary);
  background:rgba(255,255,255,.04);
  border-radius:0 14px 14px 0;
  color:var(--muted);
}

.blog-content img{
  margin:24px 0;
  border-radius:16px;
  border:1px solid var(--line);
  box-shadow:var(--shadow-soft);
}

.blog-meta{
  display:flex;
  flex-wrap:wrap;
  gap:12px;
  color:var(--muted);
  margin-bottom:18px;
}

.empty-state,
#emptyState{
  text-align:left;
}

/* FORMS */
label{
  display:block;
  margin-bottom:8px;
  font-weight:700;
  color:var(--text);
}

input,
textarea,
select{
  width:100%;
  padding:12px 14px;
  border-radius:10px;
  border:1px solid var(--line);
  background:rgba(255,255,255,.06);
  color:var(--text);
  outline:none;
  transition:border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

input::placeholder,
textarea::placeholder{
  color:#93a4c3;
}

select{
  appearance:none;
  background-image:
    linear-gradient(45deg, transparent 50%, #a9b7d1 50%),
    linear-gradient(135deg, #a9b7d1 50%, transparent 50%);
  background-position:
    calc(100% - 18px) calc(50% - 3px),
    calc(100% - 12px) calc(50% - 3px);
  background-size:6px 6px, 6px 6px;
  background-repeat:no-repeat;
  padding-right:42px;
}

input:focus,
textarea:focus,
select:focus{
  border-color:var(--primary);
  box-shadow:0 0 0 3px rgba(52,211,153,.12);
  background:rgba(255,255,255,.08);
}

textarea[readonly]{
  opacity:.95;
}

.form-stack{
  display:flex;
  flex-direction:column;
  gap:16px;
}

.form-group{
  display:block;
}

.two-col{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:16px;
}

/* ADMIN / LOGIN */
.admin-grid-page{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:24px;
}

.login-card{
  max-width:460px;
  margin:0 auto;
  padding:32px;
}

.login-form{
  display:flex;
  flex-direction:column;
  gap:18px;
}

.login-btn{
  width:160px;
  align-self:flex-start;
}

#msg{
  margin:0;
  min-height:20px;
}

/* TABLES / CONTENT */
table{
  width:100%;
  border-collapse:collapse;
}

th,
td{
  padding:12px 14px;
  border-bottom:1px solid var(--line);
  text-align:left;
}

th{
  color:var(--text);
}

td{
  color:var(--muted);
}

/* FOOTER */
.footer{
  margin-top:44px;
  border-top:1px solid var(--line);
  padding:28px 0 40px;
  color:var(--muted);
}

.footer-grid{
  grid-template-columns:1.3fr .7fr .7fr;
}

.footer h4{
  margin:0 0 12px;
  color:var(--text);
  font-size:1rem;
}

.subfooter{
  margin-top:18px;
  padding-top:18px;
  border-top:1px solid var(--line);
  display:flex;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
}

/* TABLET */
@media (max-width:1100px){
  .brand-text small{
    display:none;
  }

  .site-nav{
    gap:6px;
  }

  .site-nav > a,
  .nav-dropbtn{
    padding:9px 12px;
    font-size:.92rem;
  }
}

@media (max-width:980px){
  .hero-grid{
    grid-template-columns:1fr;
  }

  .grid-4{
    grid-template-columns:repeat(2,1fr);
  }

  .grid-3{
    grid-template-columns:repeat(2,1fr);
  }

  .grid-2,
  .footer-grid,
  .admin-grid-page,
  .two-col{
    grid-template-columns:1fr 1fr;
  }

  .nav-wrap{
    gap:14px;
  }

  .brand-text strong{
    font-size:.95rem;
  }

  .blog-filter-grid{
    grid-template-columns:1fr;
  }
}

@media (max-width:900px){
  .admin-grid-page,
  .two-col{
    grid-template-columns:1fr;
  }
}

/* MOBILE */
@media (max-width:760px){
  .menu-toggle{
    display:inline-flex;
    margin-left:auto;
  }

  .site-nav{
    display:none;
    position:absolute;
    top:74px;
    left:0;
    right:0;
    background:rgba(10,16,28,.98);
    border:1px solid var(--line);
    border-radius:18px;
    padding:14px;
    box-shadow:var(--shadow);
    flex-direction:column;
    align-items:stretch;
    gap:8px;
    flex-wrap:nowrap;
  }

  .site-nav.open{
    display:flex;
  }

  .site-nav > a,
  .nav-dropbtn{
    width:100%;
    padding:12px 14px;
    border-radius:12px;
    text-align:left;
    justify-content:flex-start;
  }

  .nav-dropdown{
    display:block;
    width:100%;
  }

  .nav-dropdown-content{
    position:static;
    display:block;
    min-width:100%;
    margin-top:8px;
    padding:8px;
    border-radius:14px;
    box-shadow:none;
    background:rgba(255,255,255,.03);
  }

  .nav-dropdown-content a{
    padding:10px 12px;
  }

  .nav-cta{
    margin-top:4px;
    width:100%;
  }

  .hero{
    padding-top:62px;
  }

  .hero-stats,
  .grid-4,
  .grid-3,
  .grid-2,
  .footer-grid{
    grid-template-columns:1fr;
  }

  h1{
    font-size:2.3rem;
  }

  .section-head{
    display:block;
  }

  .brand{
    max-width:calc(100% - 60px);
  }

  .brand-text strong{
    font-size:.92rem;
  }

  .brand-text small{
    display:none;
  }

  .brand-logo{
    height:74px;
  }

  .login-card{
    padding:24px;
  }

  .login-btn{
    width:100%;
  }

  .subfooter{
    flex-direction:column;
    align-items:flex-start;
  }

  .blog-content{
    line-height:1.7;
  }

  #featuredPost,
  .card{
    padding:18px;
  }
}
