/* ============================================================
   Calcudesk Dark Theme — shared design system
   Adopted from NexusAI template. Used by:
   - /index.html (homepage)
   - /calculator/index.html
   - /templates/blog-index.html, post.html, page.html
   - /templates/partials/*.html
   ============================================================ */

:root{
  /* Surfaces */
  --bg:#08080f;
  --bg2:#0d0d1a;
  --bg3:#12121f;
  --sf:#16162a;

  /* Borders */
  --bd:rgba(255,255,255,0.07);
  --bd2:rgba(255,255,255,0.13);

  /* Text */
  --tx:#f0f0ff;
  --tx2:#a8a8c8;
  --tx3:#6b6b8a;

  /* Brand */
  --pur:#8b5cf6;
  --blu:#3b82f6;
  --grad:linear-gradient(135deg,#8b5cf6,#3b82f6);

  /* Semantic */
  --ok:#22c55e;
  --warn:#fbbf24;
  --err:#ef4444;

  /* Layout */
  --nav:68px;
  --maxw:1200px;
}

*,*::before,*::after{ box-sizing:border-box; }
html,body{ margin:0; padding:0; }
body{
  font-family:'Space Grotesk', ui-sans-serif, system-ui, sans-serif;
  background:var(--bg);
  color:var(--tx);
  overflow-x:hidden;
  -webkit-font-smoothing:antialiased;
  line-height:1.6;
}

/* ---------- Type helpers ---------- */
.grad-text{
  background:var(--grad);
  -webkit-background-clip:text;
  background-clip:text;
  color:transparent;
}
.grad-bg{ background:var(--grad); }

.eyebrow{
  display:inline-flex; align-items:center; gap:8px;
  font-size:11px; letter-spacing:0.18em; text-transform:uppercase;
  color:var(--pur); font-weight:600;
  padding:6px 16px; border-radius:999px;
  background:rgba(139,92,246,0.08);
  border:1px solid rgba(139,92,246,0.2);
}
.eyebrow::before,.eyebrow::after{
  content:''; width:24px; height:1px;
  background:rgba(139,92,246,0.4);
}

/* ---------- Layout ---------- */
.container{ max-width:var(--maxw); margin:0 auto; padding:0 32px; }
.section{ position:relative; padding:120px 0; }

.blob{
  position:absolute; border-radius:50%;
  filter:blur(120px); opacity:.35;
  pointer-events:none; z-index:0;
}
.blob.a{ width:600px; height:600px; background:#8b5cf6; }
.blob.b{ width:500px; height:500px; background:#3b82f6; }

.section-head{ text-align:center; margin-bottom:64px; }
.section-head h2{
  font-size:clamp(32px, 4.5vw, 52px); font-weight:700;
  letter-spacing:-0.025em; margin:18px 0 16px; line-height:1.1;
}
.section-head p{
  color:var(--tx2);
  max-width:560px;
  margin:0 auto;
  font-size:16px;
}

/* ---------- Top banner ---------- */
.topbar{
  background:linear-gradient(90deg, rgba(139,92,246,0.12), rgba(59,130,246,0.12));
  border-bottom:1px solid var(--bd);
  padding:8px 0; text-align:center; font-size:13px; color:var(--tx2);
}
.topbar a{ color:var(--tx); text-decoration:none; font-weight:500; }
.topbar .pill{
  display:inline-block; padding:2px 10px; border-radius:999px;
  background:rgba(139,92,246,0.2); color:#c4b5fd;
  font-size:10px; letter-spacing:0.06em; font-weight:600; margin-right:8px;
}

/* ---------- Nav ---------- */
nav.top{
  position:sticky; top:0; z-index:50;
  background:rgba(8,8,15,0.78);
  backdrop-filter:blur(20px) saturate(180%);
  -webkit-backdrop-filter:blur(20px) saturate(180%);
  border-bottom:1px solid var(--bd);
}
nav.top .inner{
  height:var(--nav);
  display:flex; align-items:center; justify-content:space-between;
  max-width:var(--maxw); margin:0 auto; padding:0 32px;
}
.logo{
  display:flex; align-items:center; gap:10px;
  font-weight:700; font-size:18px;
  color:var(--tx); text-decoration:none;
  letter-spacing:-0.01em;
}
.logo-mark{
  width:30px; height:30px; border-radius:8px;
  background:var(--grad);
  display:flex; align-items:center; justify-content:center;
  box-shadow:0 4px 14px rgba(139,92,246,0.45);
}
.nav-links{ display:flex; gap:32px; }
.nav-links a{
  color:var(--tx2); text-decoration:none;
  font-size:14px; font-weight:500;
  transition:color .2s;
}
.nav-links a:hover{ color:var(--tx); }
.nav-right{ display:flex; align-items:center; gap:14px; }
.icon-btn{
  width:38px; height:38px; border-radius:10px;
  background:var(--sf); border:1px solid var(--bd);
  color:var(--tx2);
  display:flex; align-items:center; justify-content:center;
  cursor:pointer; transition:background .2s, color .2s;
}
.icon-btn:hover{ color:var(--tx); background:var(--bg3); }

/* ---------- Buttons ---------- */
.btn{
  display:inline-flex; align-items:center; gap:8px;
  padding:11px 22px; border-radius:10px;
  font-size:14px; font-weight:600;
  font-family:inherit; text-decoration:none;
  cursor:pointer; border:none;
  transition:transform .15s ease, box-shadow .2s ease, background .2s;
  white-space:nowrap;
}
.btn-primary{
  background:var(--grad); color:white;
  box-shadow:0 8px 22px -6px rgba(139,92,246,0.55),
             inset 0 1px 0 rgba(255,255,255,0.15);
}
.btn-primary:hover{
  transform:translateY(-1px);
  box-shadow:0 12px 28px -6px rgba(139,92,246,0.7),
             inset 0 1px 0 rgba(255,255,255,0.2);
}
.btn-ghost{
  background:var(--sf); color:var(--tx);
  border:1px solid var(--bd2);
}
.btn-ghost:hover{
  background:var(--bg3);
  border-color:rgba(255,255,255,0.2);
}
.btn-lg{ padding:14px 26px; font-size:15px; }

/* ---------- Cards ---------- */
.card{
  background:var(--bg2);
  border:1px solid var(--bd);
  border-radius:16px;
  padding:32px;
  transition:border-color .25s, transform .25s;
}
.card:hover{
  border-color:var(--bd2);
  transform:translateY(-2px);
}
.card-icon{
  width:44px; height:44px; border-radius:10px;
  display:flex; align-items:center; justify-content:center;
  margin-bottom:20px;
}
.card h3{
  font-size:18px; font-weight:600;
  margin:0 0 10px;
  letter-spacing:-0.01em;
  color:var(--tx);
}
.card p{
  color:var(--tx2);
  font-size:14px; line-height:1.65;
  margin:0;
}
.card .tag{
  display:inline-flex; font-size:11px; font-weight:600;
  padding:4px 10px; border-radius:6px;
  margin-top:18px;
}

/* ---------- Grids ---------- */
.grid-2{ display:grid; grid-template-columns:repeat(2,1fr); gap:20px; }
.grid-3{ display:grid; grid-template-columns:repeat(3,1fr); gap:20px; }
.grid-4{ display:grid; grid-template-columns:repeat(4,1fr); gap:20px; }

/* ---------- Fade-up on scroll ---------- */
.fade-up{
  opacity:0;
  transform:translateY(28px);
  transition:opacity .7s ease, transform .8s cubic-bezier(.2,.7,.2,1);
  will-change:opacity, transform;
}
.fade-up.in{ opacity:1; transform:translateY(0); }
.grid-3 > .fade-up:nth-child(1), .grid-2 > .fade-up:nth-child(1){ transition-delay:0ms; }
.grid-3 > .fade-up:nth-child(2), .grid-2 > .fade-up:nth-child(2){ transition-delay:90ms; }
.grid-3 > .fade-up:nth-child(3), .grid-2 > .fade-up:nth-child(3){ transition-delay:180ms; }
.grid-3 > .fade-up:nth-child(4){ transition-delay:0ms; }
.grid-3 > .fade-up:nth-child(5){ transition-delay:90ms; }
.grid-3 > .fade-up:nth-child(6){ transition-delay:180ms; }
@media (prefers-reduced-motion: reduce){
  .fade-up{ opacity:1; transform:none; transition:none; }
}

/* ---------- Form controls ---------- */
/* Scoped to text-like inputs so checkboxes / radios / ranges aren't
   stretched to width:100% by the generic selector. */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="url"],
input[type="search"],
input[type="number"],
input[type="password"],
input[type="date"],
input[type="datetime-local"],
input[type="time"],
input:not([type]),
textarea,
select{
  font-family:inherit;
  background:var(--bg3);
  color:var(--tx);
  border:1px solid var(--bd);
  border-radius:10px;
  padding:11px 14px;
  font-size:14px;
  outline:none;
  transition:border-color .2s, box-shadow .2s;
  width:100%;
}
input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="url"]:focus,
input[type="search"]:focus,
input[type="number"]:focus,
input[type="password"]:focus,
input[type="date"]:focus,
input[type="datetime-local"]:focus,
input[type="time"]:focus,
input:not([type]):focus,
textarea:focus, select:focus{
  border-color:var(--pur);
  box-shadow:0 0 0 3px rgba(139,92,246,0.15);
}
input::placeholder, textarea::placeholder{ color:var(--tx3); }
input[type="checkbox"], input[type="radio"]{ accent-color:var(--pur); }
label{ font-size:13px; color:var(--tx2); display:block; margin-bottom:6px; font-weight:500; }

/* ---------- FAQ details ---------- */
details{
  background:var(--bg2); border:1px solid var(--bd);
  border-radius:12px; padding:0; margin-bottom:12px;
  transition:border-color .2s;
}
details[open]{ border-color:var(--bd2); background:var(--bg3); }
details summary{
  list-style:none; cursor:pointer;
  padding:20px 24px;
  display:flex; justify-content:space-between; align-items:center;
  font-size:15px; font-weight:500;
  color:var(--tx);
}
details summary::-webkit-details-marker{ display:none; }
details summary::after{
  content:''; width:10px; height:10px;
  border-right:2px solid var(--tx2); border-bottom:2px solid var(--tx2);
  transform:rotate(45deg); margin-left:14px; transition:transform .2s;
}
details[open] summary::after{ transform:rotate(-135deg); margin-top:6px; }
details .answer{
  padding:0 24px 22px;
  color:var(--tx2);
  font-size:14px; line-height:1.7;
}

/* ---------- Responsive ---------- */
@media (max-width: 980px){
  .nav-links{ display:none; }
  .grid-3, .grid-4{ grid-template-columns:repeat(2,1fr); }
  .section{ padding:80px 0; }
}
@media (max-width: 640px){
  .container{ padding:0 20px; }
  .grid-2, .grid-3, .grid-4{ grid-template-columns:1fr; }
}
