/* ==========================================================================
   SdashAPI — Main Stylesheet v2
   Design language: "answer sheet meets API" — OMR bubbles + JSON.
   Tokens: light paper background, cobalt brand, marker-orange accent.
   ========================================================================== */

:root {
  --bg:        #ffffff;
  --bg-soft:   #f3f5fb;
  --bg-dark:   #0e1326;
  --ink:       #11131a;
  --ink-soft:  #5c6275;
  --ink-faint: #9aa0b4;
  --line:      #e6e9f2;
  --brand:     #3457ff;
  --brand-dark:#1f36cc;
  --brand-soft:#eaefff;
  --accent:    #ff5c35;
  --accent-soft:#ffe8e0;
  --correct:   #1fae6b;
  --correct-soft:#e3f8ee;

  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;

  --radius-lg: 20px;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow-sm: 0 4px 16px -8px rgba(17,19,26,.12);
  --shadow: 0 16px 40px -16px rgba(17,19,26,.18);
  --container: 1180px;
}

/* ---------------------------------------------------------------------- */
/* Reset & base                                                            */
/* ---------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: var(--brand); text-decoration: none; }
h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.12;
  margin: 0 0 .5em;
  letter-spacing: -0.01em;
}
p { margin: 0 0 1em; color: var(--ink-soft); }
code, pre, .mono { font-family: var(--font-mono); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

.container { max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.section { padding: 88px 0; }
.section-soft { background: var(--bg-soft); }

@media (max-width: 768px) { .section { padding: 56px 0; } }
@media (max-width: 480px) {
  .container { padding: 0 16px; }
  .section { padding: 40px 0; }
}

/* Eyebrow / labels */
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px; font-weight: 500;
  color: var(--brand);
  background: var(--brand-soft);
  border: 1px solid #d6deff;
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 18px;
}
.eyebrow::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }

.section-head { max-width: 640px; margin: 0 0 48px; }
.section-head.center { margin: 0 auto 56px; text-align: center; }
.section-head h2 { font-size: clamp(24px, 4vw, 40px); }
.section-head p { font-size: 17px; }

@media (max-width: 480px) {
  .section-head.center { margin-bottom: 32px; }
  .section-head p { font-size: 15px; }
}

/* ---------------------------------------------------------------------- */
/* Buttons                                                                 */
/* ---------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-body); font-weight: 600; font-size: 15px;
  padding: 13px 26px; border-radius: 999px;
  border: 1px solid transparent; cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease, color .15s ease, border-color .15s ease;
  white-space: nowrap;
}
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 8px 20px -8px rgba(52,87,255,.55); }
.btn-primary:hover { background: var(--brand-dark); transform: translateY(-2px); box-shadow: 0 12px 24px -8px rgba(52,87,255,.6); }
.btn-accent { background: var(--accent); color: #fff; box-shadow: 0 8px 20px -8px rgba(255,92,53,.5); }
.btn-accent:hover { background: #e64a26; transform: translateY(-2px); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }
.btn-light { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); }
.btn-light:hover { transform: translateY(-2px); }
.btn-block { width: 100%; }
.btn-sm { padding: 9px 18px; font-size: 13px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none !important; }

@media (max-width: 480px) {
  .btn { font-size: 14px; padding: 12px 20px; }
  .btn-sm { padding: 8px 14px; font-size: 12px; }
}

/* ---------------------------------------------------------------------- */
/* Navbar                                                                  */
/* ---------------------------------------------------------------------- */
.navbar {
  position: sticky; top: 0; z-index: 1000;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
  padding: 0;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-display); font-weight: 700; font-size: 20px;
  color: var(--ink);
  flex-shrink: 0;
  z-index: 1001;
}
.brand-mark {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--brand);
  display: flex; align-items: center; justify-content: center;
  position: relative; flex-shrink: 0;
  transition: transform .2s ease, box-shadow .2s ease;
}
.brand-mark:hover { transform: rotate(-5deg) scale(1.05); box-shadow: 0 8px 16px -4px rgba(52,87,255,.4); }
.brand-mark::after {
  content: '';
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--accent);
  border: 2px solid #fff;
  position: absolute; top: -4px; right: -4px;
  animation: pulse-dot 2s ease infinite;
}
@keyframes pulse-dot {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}
.brand-mark svg { width: 18px; height: 18px; }
.brand small { font-family: var(--font-mono); color: var(--accent); font-weight: 600; }

/* Desktop nav */
.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-links a:not(.btn) {
  color: var(--ink-soft); font-weight: 500; font-size: 15px;
  transition: color .15s;
  position: relative;
}
.nav-links a:not(.btn)::after {
  content: '';
  position: absolute; bottom: -4px; left: 0;
  width: 0; height: 2px;
  background: var(--brand);
  border-radius: 2px;
  transition: width .25s ease;
}
.nav-links a:not(.btn):hover { color: var(--ink); }
.nav-links a:not(.btn):hover::after { width: 100%; }
.nav-actions { display: flex; align-items: center; gap: 10px; }

/* Fancy Burger Icon */
.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 8px 10px;
  z-index: 1001;
  position: relative;
  flex-shrink: 0;
  transition: border-color .2s ease;
}
.nav-toggle:hover { border-color: var(--brand); }
.fancy-burger {
  position: relative;
  width: 22px;
  height: 16px;
}
.fancy-burger .line {
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--ink);
  border-radius: 2px;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
              width 0.35s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.35s ease;
}
.fancy-burger .line-1 { top: 0; }
.fancy-burger .line-2 { bottom: 0; width: 14px; }
.fancy-burger .dot {
  position: absolute;
  right: 0; bottom: 0;
  width: 5px; height: 5px;
  background-color: var(--accent);
  border-radius: 50%;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.35s ease;
}

/* Open state */
.nav-toggle.open .fancy-burger .line-1 { transform: translateY(8px) rotate(45deg); }
.nav-toggle.open .fancy-burger .line-2 { width: 100%; transform: translateY(-8px) rotate(-45deg); }
.nav-toggle.open .fancy-burger .dot { opacity: 0; transform: scale(0); }
.nav-toggle.open { border-color: var(--brand); }

/* Mobile */
@media (max-width: 860px) {
  .nav-inner { height: 60px; }
  .nav-toggle { display: flex; align-items: center; justify-content: center; }
  .nav-actions { display: none; }

  /* Backdrop overlay */
  .nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(17,19,26,.45);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    z-index: 998;
    opacity: 0;
    transition: opacity .25s ease;
  }
  .nav-overlay.open { opacity: 1; }

  /* Menu panel — drops from below navbar */
  .nav-links {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    background: #fff;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    padding: 0;
    gap: 0;
    transform: translateY(-12px);
    opacity: 0;
    pointer-events: none;
    transition: transform .25s cubic-bezier(0.4, 0, 0.2, 1),
                opacity .25s ease;
    border-bottom: 1px solid var(--line);
    box-shadow: 0 16px 40px -8px rgba(17,19,26,.18);
    z-index: 999;
    overflow: hidden; /* never scrollable */
  }
  .nav-links.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: all;
  }

  /* Nav link rows */
  .nav-links a:not(.btn) {
    font-size: 16px;
    font-weight: 500;
    color: var(--ink);
    padding: 16px 24px;
    border-bottom: 1px solid var(--line);
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background .15s ease, color .15s ease;
  }
  .nav-links a:not(.btn)::after { display: none; }
  .nav-links a:not(.btn):hover {
    background: var(--bg-soft);
    color: var(--brand);
  }
  .nav-links a:not(.btn):last-of-type { border-bottom: none; }

  /* CTA buttons at bottom of menu */
  .mobile-actions {
    display: flex;
    flex-direction: row;
    gap: 10px;
    padding: 16px 24px;
    border-top: 1px solid var(--line);
    background: var(--bg-soft);
    width: 100%;
  }
  .mobile-actions .btn {
    flex: 1;
    font-size: 14px;
    padding: 10px 12px;
  }
}
@media (min-width: 861px) {
  .mobile-actions { display: none; }
  .nav-overlay { display: none !important; }
}

@media (max-width: 480px) {
  .brand { font-size: 18px; }
  .brand-mark { width: 32px; height: 32px; }
}

/* ---------------------------------------------------------------------- */
/* Hero                                                                    */
/* ---------------------------------------------------------------------- */
.hero {
  padding: 80px 0 48px;
  background:
    radial-gradient(640px 360px at 85% -10%, #eaf0ff 0%, transparent 70%),
    radial-gradient(480px 320px at -5% 30%, #fff1ec 0%, transparent 70%);
  overflow: hidden;
}
.hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 56px; align-items: center; }
.hero h1 { font-size: clamp(32px, 5.4vw, 60px); }
.hero h1 .hl { color: var(--brand); }
.hero .lead { font-size: clamp(16px, 2vw, 19px); max-width: 480px; }
.hero-actions { display: flex; gap: 12px; margin-top: 28px; flex-wrap: wrap; }
.hero-meta { display: flex; gap: 20px; margin-top: 36px; flex-wrap: wrap; }
.hero-meta div { font-family: var(--font-mono); font-size: 12px; color: var(--ink-soft); }
.hero-meta strong { display: block; font-family: var(--font-display); font-size: clamp(18px, 2.5vw, 22px); color: var(--ink); }

@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .hero .lead { max-width: none; }
  .hero { padding: 56px 0 32px; }
}
@media (max-width: 480px) {
  .hero { padding: 40px 0 24px; }
  .hero-actions { flex-direction: column; }
  .hero-actions .btn { text-align: center; justify-content: center; }
  .hero-meta { gap: 16px; }
}

/* --- Signature visual: answer sheet -> JSON (animated typing) ---------- */
.demo { position: relative; display: grid; gap: 16px; }
.demo-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 22px 24px;
}
.demo-sheet .sheet-head {
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--font-mono); font-size: 12px; color: var(--ink-faint);
  margin-bottom: 14px; padding-bottom: 14px; border-bottom: 1px dashed var(--line);
}
.sheet-head span.tag { background: var(--bg-soft); padding: 4px 10px; border-radius: 6px; }
.demo-sheet .q-text { font-size: 15px; font-weight: 500; margin-bottom: 16px; }
.options { display: grid; gap: 10px; }
.option { display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--ink-soft); }
.bubble {
  width: 26px; height: 26px; border-radius: 50%;
  border: 2px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 12px; font-weight: 700;
  color: var(--ink-faint);
  flex-shrink: 0;
  transition: all .4s cubic-bezier(.4,0,.2,1);
}
.option.is-answer { color: var(--ink); font-weight: 600; }
.option.is-answer .bubble { position: relative; }
.option.is-answer .bubble::after { content: '✓'; opacity: 0; transition: opacity .3s ease; }
.option.is-answer .bubble.lit { background: var(--correct); border-color: var(--correct); color: #fff; }
.option.is-answer .bubble.lit::after { opacity: 1; }

.demo-arrow { display: flex; align-items: center; justify-content: center; color: var(--ink-faint); }
.demo-arrow svg { width: 22px; height: 22px; animation: bob 2.4s ease-in-out infinite; }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(5px); } }

/* Animated code terminal */
.demo-code {
  background: var(--bg-dark);
  color: #d7defc;
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  box-shadow: var(--shadow);
  font-family: var(--font-mono);
  font-size: clamp(11px, 1.2vw, 13.5px);
  overflow: hidden;
  position: relative;
  min-height: 220px;
}
.demo-code .code-head { display: flex; gap: 8px; margin-bottom: 16px; }
.demo-code .dot { width: 11px; height: 11px; border-radius: 50%; }
.dot.r { background: #ff6159; } .dot.y { background: #ffbd2e; } .dot.g { background: #28c941; }

/* Typing animation area */
#typingOutput {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.6;
  min-height: 160px;
}
#typingOutput .k { color: #8da3ff; }
#typingOutput .s { color: #ffd28a; }
#typingOutput .c { color: #56e3a3; }
#typingOutput .num { color: #ff9f6e; }
#typingOutput .hl { background: rgba(31,174,107,.22); border-radius: 4px; padding: 0 3px; }
#typingOutput .url { color: #56e3a3; }

/* Cursor blink */
.typing-cursor {
  display: inline-block;
  width: 2px; height: 1.1em;
  background: #56e3a3;
  vertical-align: text-bottom;
  animation: blink .75s step-end infinite;
  margin-left: 1px;
}
@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: 0; } }

/* ---------------------------------------------------------------------- */
/* Stats strip                                                             */
/* ---------------------------------------------------------------------- */
.stats {
  display: grid; grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  overflow: hidden; background: #fff;
}
.stat { padding: 28px 20px; text-align: center; border-right: 1px solid var(--line); }
.stat:last-child { border-right: none; }
.stat .num { font-family: var(--font-display); font-size: clamp(22px, 3.4vw, 38px); font-weight: 700; color: var(--brand); }
.stat .label { font-family: var(--font-mono); font-size: 12px; color: var(--ink-soft); margin-top: 4px; }

@media (max-width: 760px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(1), .stat:nth-child(2) { border-bottom: 1px solid var(--line); }
  .stat:nth-child(2) { border-right: 1px solid var(--line); }
  .stat { padding: 20px 14px; }
}
@media (max-width: 400px) {
  .stat { padding: 16px 10px; }
  .stat .num { font-size: 20px; }
}

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

@media (max-width: 980px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px; transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: transparent; }
.card .icon {
  width: 46px; height: 46px; border-radius: 12px;
  background: var(--brand-soft); color: var(--brand);
  display: flex; align-items: center; justify-content: center; margin-bottom: 18px;
}
.card .icon svg { width: 22px; height: 22px; }
.card h3 { font-size: clamp(16px, 2vw, 19px); margin-bottom: 8px; }
.card p { margin: 0; font-size: 14px; }

@media (max-width: 480px) { .card { padding: 20px; } }

/* ---------------------------------------------------------------------- */
/* Subjects / exam types                                                   */
/* ---------------------------------------------------------------------- */
.tag-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.tag-pill {
  font-family: var(--font-mono); font-size: 13px; font-weight: 500;
  padding: 9px 16px; border-radius: 999px;
  background: #fff; border: 1px solid var(--line); color: var(--ink-soft);
  transition: all .15s ease;
}
.tag-pill:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
.exam-types { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 14px; }
.exam-type {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; display: flex; align-items: center; gap: 12px;
  transition: transform .2s ease, box-shadow .2s ease;
}
.exam-type:hover { transform: translateY(-3px); box-shadow: var(--shadow-sm); }
.exam-type .code { font-family: var(--font-mono); font-weight: 700; color: var(--brand); font-size: 13px; background: var(--brand-soft); padding: 5px 10px; border-radius: 8px; }

@media (max-width: 760px) { .exam-types { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 400px) { .exam-types { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------------- */
/* How it works                                                            */
/* ---------------------------------------------------------------------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.step { position: relative; padding: 32px 24px 24px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.step .step-num {
  font-family: var(--font-display); font-weight: 700; font-size: 14px;
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--bg-dark); color: #fff;
  display: flex; align-items: center; justify-content: center; margin-bottom: 16px;
}
.step h3 { font-size: clamp(16px, 2vw, 18px); }
.step p { font-size: 14px; margin: 0; }

@media (max-width: 860px) { .steps { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------------- */
/* Code example section                                                    */
/* ---------------------------------------------------------------------- */
.code-tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.code-tab {
  font-family: var(--font-mono); font-size: 12px; padding: 6px 13px; border-radius: 8px;
  background: var(--bg-soft); color: var(--ink-soft); border: 1px solid var(--line);
}
.code-tab.active { background: var(--bg-dark); color: #fff; border-color: var(--bg-dark); }
.code-block {
  background: var(--bg-dark); color: #d7defc; border-radius: var(--radius-lg);
  padding: 20px; font-family: var(--font-mono); font-size: clamp(11px, 1.2vw, 13.5px); overflow-x: auto;
  box-shadow: var(--shadow);
}
.code-block pre { margin: 0; white-space: pre-wrap; word-break: break-all; }
.code-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

@media (max-width: 900px) { .code-cols { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------------- */
/* Pricing                                                                 */
/* ---------------------------------------------------------------------- */
.pricing-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; align-items: stretch; }
@media (max-width: 980px) { .pricing-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .pricing-grid { grid-template-columns: 1fr; } }
.price-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 32px; display: flex; flex-direction: column;
}
.price-card.featured { border: 2px solid var(--brand); box-shadow: var(--shadow); position: relative; }
.price-card.featured::before {
  content: 'Most popular'; position: absolute; top: -13px; left: 28px;
  background: var(--brand); color: #fff; font-size: 12px; font-weight: 600;
  padding: 4px 12px; border-radius: 999px; font-family: var(--font-mono);
}
.price-card h3 { font-size: 20px; margin-bottom: 4px; }
.price-card .price { font-family: var(--font-display); font-size: clamp(30px, 4vw, 38px); font-weight: 700; margin: 12px 0; }
.price-card .price span { font-family: var(--font-body); font-size: 14px; font-weight: 500; color: var(--ink-soft); }
.price-card ul { list-style: none; padding: 0; margin: 20px 0 28px; display: grid; gap: 12px; }
.price-card li { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; color: var(--ink-soft); }
.price-card li svg { width: 18px; height: 18px; color: var(--correct); flex-shrink: 0; margin-top: 1px; }
.price-card .btn { margin-top: auto; }

@media (max-width: 480px) { .price-card { padding: 24px; } }

/* ---------------------------------------------------------------------- */
/* CTA banner                                                              */
/* ---------------------------------------------------------------------- */
.cta-banner {
  background: var(--bg-dark); border-radius: var(--radius-lg);
  padding: clamp(32px, 5vw, 56px); text-align: center; color: #fff;
  background-image: radial-gradient(500px 240px at 20% 0%, rgba(52,87,255,.35), transparent 70%),
                     radial-gradient(500px 240px at 80% 100%, rgba(255,92,53,.25), transparent 70%);
}
.cta-banner h2 { color: #fff; font-size: clamp(22px, 4vw, 36px); }
.cta-banner p { color: #b9bfd9; max-width: 520px; margin: 0 auto 24px; font-size: clamp(14px, 1.8vw, 17px); }
.cta-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* ---------------------------------------------------------------------- */
/* Footer                                                                  */
/* ---------------------------------------------------------------------- */
.footer { background: var(--bg-dark); color: #b9bfd9; padding: 64px 0 28px; }
.footer .brand { color: #fff; margin-bottom: 12px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; padding-bottom: 40px; border-bottom: 1px solid rgba(255,255,255,.08); }
.footer-grid p { color: #8b91ad; font-size: 14px; max-width: 320px; }
.footer h4 { font-family: var(--font-body); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: #8b91ad; margin-bottom: 16px; }
.footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.footer a { color: #d7defc; font-size: 14px; }
.footer a:hover { color: #fff; }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; padding-top: 24px; font-size: 13px; color: #6e759a; flex-wrap: wrap; gap: 12px; }

@media (max-width: 860px) { .footer-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) {
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .footer { padding: 40px 0 24px; }
}

/* ---------------------------------------------------------------------- */
/* Scroll reveal                                                           */
/* ---------------------------------------------------------------------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: translateY(0); }

/* ---------------------------------------------------------------------- */
/* Floating lively elements                                                */
/* ---------------------------------------------------------------------- */
.float-tag {
  position: absolute;
  background: var(--bg-dark);
  color: #56e3a3;
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
  box-shadow: 0 4px 12px rgba(0,0,0,.2);
  animation: floatAround 8s ease-in-out infinite;
}
.float-tag:nth-child(2) { animation-delay: -3s; }
.float-tag:nth-child(3) { animation-delay: -5.5s; }
@keyframes floatAround {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  33% { transform: translateY(-8px) rotate(1deg); }
  66% { transform: translateY(4px) rotate(-1deg); }
}

/* ---------------------------------------------------------------------- */
/* Auth / form pages                                                       */
/* ---------------------------------------------------------------------- */
.auth-wrap {
  min-height: calc(100vh - 64px);
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-soft); padding: 48px 16px;
}
.auth-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); padding: 40px; max-width: 440px; width: 100%;
}
.auth-card h1 { font-size: clamp(22px, 3vw, 26px); }
.auth-card .sub { margin-bottom: 24px; }
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 12px 14px; font-size: 15px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  font-family: var(--font-body); background: #fff; color: var(--ink);
  transition: border-color .15s;
  -webkit-appearance: none; appearance: none;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--brand); }
.field textarea { resize: vertical; min-height: 110px; }
.field-hint { font-size: 12px; color: var(--ink-faint); margin-top: 4px; }
.form-foot { text-align: center; margin-top: 20px; font-size: 14px; color: var(--ink-soft); }

.alert { padding: 13px 16px; border-radius: var(--radius-sm); font-size: 14px; margin-bottom: 18px; }
.alert-error { background: #fdecec; color: #b3261e; border: 1px solid #f6c5c2; }
.alert-success { background: var(--correct-soft); color: #146c44; border: 1px solid #b9e8d0; }
.alert-info { background: var(--brand-soft); color: var(--brand-dark); border: 1px solid #cfd9ff; }

@media (max-width: 480px) {
  .auth-card { padding: 24px 20px; }
}

/* ---------------------------------------------------------------------- */
/* Dashboard                                                               */
/* ---------------------------------------------------------------------- */
.dash-shell { background: var(--bg-soft); min-height: calc(100vh - 64px); padding: 40px 0 80px; }
.dash-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 28px; }
.dash-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 28px; }
@media (max-width: 860px) { .dash-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .dash-grid { grid-template-columns: 1fr; } }
.dash-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.dash-card h3 { font-size: 13px; color: var(--ink-soft); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 8px; }
.dash-card .big { font-family: var(--font-display); font-size: 28px; font-weight: 700; }
.token-box {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--bg-dark); color: #d7defc; border-radius: var(--radius-sm);
  padding: 14px 16px; font-family: var(--font-mono); font-size: 13px; overflow-x: auto;
  white-space: nowrap;
}
.token-box code { color: #8da3ff; }
.progress { height: 8px; border-radius: 999px; background: var(--bg-soft); overflow: hidden; margin-top: 10px; }
.progress > span { display: block; height: 100%; background: var(--brand); border-radius: 999px; }

/* ---------------------------------------------------------------------- */
/* Misc utilities                                                          */
/* ---------------------------------------------------------------------- */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.badge { display: inline-block; font-family: var(--font-mono); font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 6px; }
.badge-green { background: var(--correct-soft); color: #146c44; }
.badge-orange { background: var(--accent-soft); color: #b8401d; }
.badge-blue { background: var(--brand-soft); color: var(--brand-dark); }

/* ---------------------------------------------------------------------- */
/* Lively glow pulse on hero                                               */
/* ---------------------------------------------------------------------- */
@keyframes glow-brand {
  0%, 100% { box-shadow: 0 0 0 0 rgba(52,87,255,0); }
  50% { box-shadow: 0 0 32px 8px rgba(52,87,255,.12); }
}
.btn-primary { animation: glow-brand 3s ease infinite; }
.btn-primary:hover { animation: none; }
