/* =========================================================
   DARK CODE — Homepage
   Core stylesheet: tokens, base, layout, components
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root{
  /* --- surface layers --- */
  --ink-950:#050708;
  --ink-900:#090c10;
  --ink-850:#0c1015;
  --ink-800:#10151b;
  --ink-700:#161c24;
  --border:rgba(255,255,255,.08);
  --border-soft:rgba(255,255,255,.05);
  --glass:rgba(255,255,255,.03);
  --glass-hover:rgba(255,255,255,.055);

  /* --- text --- */
  --text-1:#edf1f3;
  --text-2:#93a0ac;
  --text-3:#5b6672;

  /* --- signal (brand accent) --- */
  --signal:#39ff8a;
  --signal-2:#1fe07a;
  --signal-dim:#173d29;
  --signal-glow:rgba(57,255,138,.28);
  --signal-glow-soft:rgba(57,255,138,.12);

  /* --- syntax accents (used sparingly, code editor only) --- */
  --syn-kw:#c792ea;
  --syn-str:#39ff8a;
  --syn-fn:#82aaff;
  --syn-num:#f78c6c;
  --syn-cmt:#5b6672;

  /* --- type --- */
  --f-display:'Space Grotesk', sans-serif;
  --f-body:'Inter', sans-serif;
  --f-mono:'JetBrains Mono', monospace;

  /* --- radii / shadow --- */
  --r-sm:10px;
  --r-md:16px;
  --r-lg:22px;
  --r-pill:999px;
  --shadow-1:0 8px 30px rgba(0,0,0,.35);
  --shadow-glow:0 0 0 1px rgba(57,255,138,.15), 0 12px 40px -10px rgba(57,255,138,.25);

  --section-pad:88px;
  --container:1240px;

  /* --- theme-aware surface tints (swapped in light theme below) --- */
  --border-strong:rgba(255,255,255,.12);
  --surface-a:rgba(255,255,255,.045);
  --surface-b:rgba(255,255,255,.015);
  --surface-strong-a:rgba(255,255,255,.07);
  --surface-strong-b:rgba(255,255,255,.03);
  --surface-soft-a:rgba(255,255,255,.06);
  --surface-soft-b:rgba(255,255,255,.025);
  --footer-tint:rgba(255,255,255,.015);
  --titlebar-bg:rgba(255,255,255,.02);
  --scrolled-shadow:0 12px 34px rgba(0,0,0,.45);
}

html[data-theme="light"]{
  --ink-950:#f4f6f8;
  --ink-900:#eef1f4;
  --ink-850:#e7ebef;
  --ink-800:#e1e6eb;
  --ink-700:#d5dce2;
  --border:rgba(15,25,35,.10);
  --border-soft:rgba(15,25,35,.06);
  --border-strong:rgba(15,25,35,.14);
  --glass:rgba(15,25,35,.035);
  --glass-hover:rgba(15,25,35,.06);

  --text-1:#0d1318;
  --text-2:#4c5762;
  --text-3:#7d8893;

  --surface-a:rgba(15,25,35,.045);
  --surface-b:rgba(15,25,35,.015);
  --surface-strong-a:rgba(15,25,35,.07);
  --surface-strong-b:rgba(15,25,35,.03);
  --surface-soft-a:rgba(15,25,35,.06);
  --surface-soft-b:rgba(15,25,35,.025);
  --footer-tint:rgba(15,25,35,.03);
  --titlebar-bg:rgba(15,25,35,.03);

  --shadow-1:0 8px 30px rgba(15,25,35,.10);
  --shadow-glow:0 0 0 1px rgba(31,224,122,.18), 0 12px 40px -10px rgba(31,224,122,.20);
  --scrolled-shadow:0 12px 34px rgba(15,25,35,.12);
}

/* smooth crossfade whenever the theme attribute changes */
body, .glass, .site-header .header-inner, .editor-card, .editor-titlebar,
.cat-icon, .topic-icon, .lang-icon, .dropdown-icon, .feature-icon,
.note-thumb, .icon-btn, .btn-ghost, .cta-banner, .site-footer{
  transition:background-color .35s ease, background .35s ease, border-color .35s ease, color .35s ease, box-shadow .35s ease;
}

*,*::before,*::after{box-sizing:border-box;margin:0;padding:0;}
html{scroll-behavior:smooth;}
body{
  background:
    radial-gradient(ellipse 900px 500px at 82% -10%, rgba(57,255,138,.08), transparent 60%),
    radial-gradient(ellipse 700px 500px at -10% 20%, rgba(57,255,138,.05), transparent 55%),
    var(--ink-950);
  color:var(--text-1);
  font-family:var(--f-body);
  line-height:1.5;
  -webkit-font-smoothing:antialiased;
  overflow-x:hidden;
}
img{max-width:100%;display:block;}
a{color:inherit;text-decoration:none;}
ul{list-style:none;}
button{font-family:inherit;cursor:pointer;border:none;background:none;color:inherit;}
.container{width:100%;max-width:var(--container);margin:0 auto;padding:0 32px;}
section{padding:var(--section-pad) 0;}
::selection{background:var(--signal-glow);color:#04140a;}

/* focus visibility */
a:focus-visible,button:focus-visible,input:focus-visible{
  outline:2px solid var(--signal);
  outline-offset:3px;
  border-radius:6px;
}

@media (prefers-reduced-motion: reduce){
  *{animation-duration:.001ms !important;animation-iteration-count:1 !important;transition-duration:.001ms !important;scroll-behavior:auto !important;}
}

/* =========================================================
   Utility
   ========================================================= */
.eyebrow{
  font-family:var(--f-mono);
  font-size:12px;
  letter-spacing:.14em;
  text-transform:uppercase;
  color:var(--signal);
  display:inline-flex;
  align-items:center;
  gap:8px;
}
.eyebrow::before{
  content:"";
  width:6px;height:6px;border-radius:50%;
  background:var(--signal);
  box-shadow:0 0 10px var(--signal);
}
.section-head{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:24px;
  margin-bottom:36px;
}
.section-title{
  font-family:var(--f-display);
  font-size:clamp(24px,2.6vw,32px);
  font-weight:600;
  letter-spacing:-.01em;
}
.view-all{
  font-family:var(--f-mono);
  font-size:13px;
  color:var(--text-2);
  display:inline-flex;
  align-items:center;
  gap:6px;
  white-space:nowrap;
  transition:color .2s ease, gap .2s ease;
}
.view-all:hover{color:var(--signal);gap:10px;}
.view-all svg{width:14px;height:14px;}

.glow-word{
  color:var(--signal);
  text-shadow:0 0 30px var(--signal-glow);
}

/* buttons */
.btn{
  font-family:var(--f-body);
  font-weight:600;
  font-size:14.5px;
  padding:13px 24px;
  border-radius:var(--r-pill);
  display:inline-flex;
  align-items:center;
  gap:8px;
  transition:transform .25s cubic-bezier(.2,.8,.2,1), box-shadow .25s ease, background .25s ease, border-color .25s ease;
  white-space:nowrap;
}
.btn svg{width:16px;height:16px;transition:transform .25s ease;}
.btn:hover svg{transform:translateX(3px);}
.btn-primary{
  background:linear-gradient(180deg, var(--signal-2), #17b263);
  color:#03150a;
  box-shadow:0 1px 0 rgba(255,255,255,.35) inset, 0 10px 30px -8px rgba(57,255,138,.55);
}
.btn-primary:hover{transform:translateY(-2px);box-shadow:0 1px 0 rgba(255,255,255,.4) inset, 0 16px 40px -8px rgba(57,255,138,.7);}
.btn-ghost{
  background:var(--glass);
  color:var(--text-1);
  border:1px solid var(--border);
  backdrop-filter:blur(10px);
}
.btn-ghost:hover{background:var(--glass-hover);border-color:var(--border-strong);transform:translateY(-2px);}
.btn-block{width:100%;justify-content:center;}

/* glass card base */
.glass{
  background:linear-gradient(180deg, var(--surface-a), var(--surface-b));
  border:1px solid var(--border);
  border-radius:var(--r-md);
  backdrop-filter:blur(14px);
  -webkit-backdrop-filter:blur(14px);
}

/* =========================================================
   Hero
   ========================================================= */
.hero{padding-top:64px;padding-bottom:40px;position:relative;}
.hero .container{
  display:grid;grid-template-columns:1.05fr 1fr;gap:60px;align-items:center;
}
.hero-copy h1{
  font-family:var(--f-display);
  font-size:clamp(38px,4.6vw,58px);
  line-height:1.06;
  font-weight:600;
  letter-spacing:-.02em;
  margin:20px 0 20px;
}
.hero-copy p.lede{
  font-size:16.5px;color:var(--text-2);max-width:460px;margin-bottom:32px;line-height:1.6;
}
.hero-actions{display:flex;gap:14px;margin-bottom:48px;flex-wrap:wrap;}
.hero-stats{display:flex;gap:0;border-top:1px solid var(--border-soft);padding-top:26px;}
.stat{flex:1;padding-right:18px;}
.stat + .stat{border-left:1px solid var(--border-soft);padding-left:18px;}
.stat-num{
  font-family:var(--f-display);font-weight:600;font-size:21px;
  display:flex;align-items:center;gap:6px;
}
.stat-num svg{width:15px;height:15px;color:var(--signal);}
.stat-label{font-size:12px;color:var(--text-3);margin-top:3px;}

/* code editor card */
.hero-visual{position:relative;}
.editor-card{
  border-radius:var(--r-lg);
  overflow:hidden;
  box-shadow:var(--shadow-1);
  position:relative;
  animation:float-y 6s ease-in-out infinite;
}
.editor-titlebar{
  display:flex;align-items:center;justify-content:space-between;
  padding:13px 18px;border-bottom:1px solid var(--border-soft);
  background:var(--titlebar-bg);
}
.editor-titlebar .dots{display:flex;gap:7px;}
.editor-titlebar .dots span{width:10px;height:10px;border-radius:50%;background:var(--ink-700);}
.editor-file{
  font-family:var(--f-mono);font-size:12.5px;color:var(--text-2);
  display:flex;align-items:center;gap:7px;
}
.editor-file svg{width:13px;height:13px;color:var(--signal);}
.editor-body{padding:22px 22px 26px;font-family:var(--f-mono);font-size:13.5px;line-height:1.85;}
.editor-body .line{display:flex;gap:18px;}
.line-num{color:var(--text-3);width:16px;flex-shrink:0;text-align:right;user-select:none;}
.line-code{color:var(--text-2);white-space:pre;}
.tok-kw{color:var(--syn-kw);}
.tok-fn{color:var(--syn-fn);}
.tok-str{color:var(--syn-str);}
.tok-num{color:var(--syn-num);}
.tok-cmt{color:var(--syn-cmt);font-style:italic;}
.editor-run{
  position:absolute;right:18px;bottom:16px;
  width:36px;height:36px;border-radius:50%;
  background:var(--signal);color:#04150a;
  display:flex;align-items:center;justify-content:center;
  box-shadow:0 0 0 4px var(--signal-glow-soft), 0 8px 20px -6px rgba(57,255,138,.6);
  animation:pulse-run 2.4s ease-in-out infinite;
}
.editor-run svg{width:15px;height:15px;margin-left:2px;}
.typed-cursor{display:inline-block;width:7px;height:15px;background:var(--signal);vertical-align:-2px;animation:blink 1s step-end infinite;}

.floating-icons{position:absolute;inset:0;pointer-events:none;}
.fic{
  position:absolute;width:46px;height:46px;border-radius:12px;
  display:flex;align-items:center;justify-content:center;
  color:var(--text-2);
  animation:float-y 5s ease-in-out infinite;
}
.fic svg{width:20px;height:20px;}
.fic.fic-1{top:-6%;right:6%;animation-delay:.2s;}
.fic.fic-2{bottom:8%;right:-4%;animation-delay:1.1s;color:var(--signal);}
.fic.fic-3{bottom:-8%;left:14%;animation-delay:1.8s;}

/* =========================================================
   Category grid (9 cards)
   ========================================================= */
.category-grid{
  display:grid;
  grid-template-columns:repeat(9,1fr);
  gap:14px;
}
.cat-card{
  padding:22px 14px;border-radius:var(--r-md);
  display:flex;flex-direction:column;align-items:center;gap:12px;
  text-align:center;position:relative;overflow:hidden;
  transition:transform .3s cubic-bezier(.2,.8,.2,1), border-color .3s ease, background .3s ease;
}
.cat-card::before{
  content:"";position:absolute;inset:0;
  background:radial-gradient(120px 90px at 50% 0%, var(--signal-glow-soft), transparent 70%);
  opacity:0;transition:opacity .3s ease;
}
.cat-card:hover{transform:translateY(-5px);border-color:rgba(57,255,138,.28);}
.cat-card:hover::before{opacity:1;}
.cat-icon{
  width:44px;height:44px;border-radius:12px;
  display:flex;align-items:center;justify-content:center;
  background:var(--ink-800);border:1px solid var(--border);
  transition:transform .3s ease, box-shadow .3s ease;
}
.cat-card:hover .cat-icon{transform:scale(1.08) rotate(-4deg);box-shadow:0 6px 20px -6px var(--signal-glow);}
.cat-icon svg{width:20px;height:20px;color:var(--signal);}
.cat-icon img{width:60%;height:60%;object-fit:contain;}
.cat-card span{font-size:13px;font-weight:500;color:var(--text-1);}

/* =========================================================
   Python / topic cards
   ========================================================= */
.topic-grid{
  display:grid;grid-template-columns:repeat(5,1fr);gap:16px;
}
.topic-card{
  padding:22px;border-radius:var(--r-md);
  display:flex;flex-direction:column;gap:12px;
  transition:transform .3s cubic-bezier(.2,.8,.2,1), border-color .3s ease;
}
.topic-card:hover{transform:translateY(-4px);border-color:rgba(57,255,138,.25);box-shadow:var(--shadow-glow);}
.topic-icon{
  width:42px;height:42px;border-radius:11px;
  display:flex;align-items:center;justify-content:center;
  background:var(--ink-800);border:1px solid var(--border);
}
.topic-icon svg{width:20px;height:20px;}
.topic-icon img{width:62%;height:62%;object-fit:contain;}
.topic-card h3{font-size:14.5px;font-weight:600;}
.topic-card p{font-size:12.5px;color:var(--text-3);line-height:1.5;}

/* =========================================================
   Language pills
   ========================================================= */
.lang-grid{
  display:grid;grid-template-columns:repeat(5,1fr);gap:12px;
}
.lang-pill{
  display:flex;align-items:center;gap:10px;
  padding:13px 16px;border-radius:var(--r-pill);
  transition:transform .25s ease, border-color .25s ease, background .25s ease;
}
.lang-pill:hover{transform:translateY(-3px);border-color:rgba(57,255,138,.3);background:var(--glass-hover);}
.lang-icon{
  width:26px;height:26px;border-radius:7px;flex-shrink:0;
  display:flex;align-items:center;justify-content:center;
  background:#fff;
  border:1px solid var(--border);
  padding:4px;
}
.lang-icon img{width:100%;height:100%;object-fit:contain;}
.lang-pill span{font-size:13.5px;font-weight:500;}

/* =========================================================
   Feature cards (Learn more with Dark Code)
   ========================================================= */
.feature-grid{
  display:grid;grid-template-columns:repeat(4,1fr);gap:16px;
}
.feature-card{
  padding:24px;border-radius:var(--r-md);
  display:flex;flex-direction:column;gap:10px;
  transition:transform .3s cubic-bezier(.2,.8,.2,1), border-color .3s ease;
}
.feature-card:hover{transform:translateY(-4px);border-color:rgba(57,255,138,.25);}
.feature-icon{
  width:42px;height:42px;border-radius:11px;
  display:flex;align-items:center;justify-content:center;
  background:var(--signal-dim);color:var(--signal);
  margin-bottom:4px;
}
.feature-icon svg{width:20px;height:20px;}
.feature-card h3{font-size:15.5px;font-weight:600;}
.feature-card p{font-size:12.5px;color:var(--text-3);line-height:1.55;flex:1;}
.feature-link{
  display:inline-flex;align-items:center;gap:6px;
  font-family:var(--f-mono);font-size:12px;color:var(--signal);
  margin-top:6px;
}
.feature-link svg{width:12px;height:12px;transition:transform .2s ease;}
.feature-card:hover .feature-link svg{transform:translateX(3px);}

/* =========================================================
   Blog
   ========================================================= */
.blog-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:22px;}
.blog-card{border-radius:var(--r-md);overflow:hidden;transition:transform .3s cubic-bezier(.2,.8,.2,1), border-color .3s ease;}
.blog-card:hover{transform:translateY(-5px);border-color:rgba(57,255,138,.22);}
.blog-thumb{
  aspect-ratio:16/9;position:relative;overflow:hidden;
  display:flex;align-items:center;justify-content:center;
}
.blog-thumb svg{width:44px;height:44px;color:rgba(255,255,255,.5);position:relative;z-index:1;}
.blog-tag{
  position:absolute;top:12px;left:12px;z-index:2;
  font-family:var(--f-mono);font-size:10.5px;letter-spacing:.06em;text-transform:uppercase;
  padding:5px 10px;border-radius:var(--r-pill);
  background:rgba(5,7,8,.75);backdrop-filter:blur(6px);
  color:var(--signal);border:1px solid rgba(57,255,138,.25);
}
.blog-body{padding:18px 18px 20px;}
.blog-body h3{font-size:15.5px;font-weight:600;line-height:1.35;margin-bottom:10px;}
.blog-meta{font-size:12px;color:var(--text-3);font-family:var(--f-mono);}

/* =========================================================
   Notes
   ========================================================= */
.notes-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:22px;}
.note-card{
  padding:16px;border-radius:var(--r-md);
  display:flex;align-items:center;gap:14px;
  transition:transform .3s ease, border-color .3s ease;
}
.note-card:hover{transform:translateY(-3px);border-color:rgba(57,255,138,.22);}
.note-thumb{
  width:56px;height:56px;border-radius:12px;flex-shrink:0;
  display:flex;align-items:center;justify-content:center;
  background:var(--ink-800);border:1px solid var(--border);
}
.note-thumb svg{width:24px;height:24px;}
.note-info{flex:1;min-width:0;}
.note-info h3{font-size:14px;font-weight:600;line-height:1.35;}
.note-info .blog-meta{margin-top:5px;}
.bookmark-btn{
  width:32px;height:32px;border-radius:8px;flex-shrink:0;
  display:flex;align-items:center;justify-content:center;
  color:var(--text-3);border:1px solid var(--border);
  transition:.2s ease;
}
.bookmark-btn svg{width:15px;height:15px;}
.bookmark-btn:hover{color:var(--signal);border-color:rgba(57,255,138,.3);}
.bookmark-btn.active{color:var(--signal);border-color:rgba(57,255,138,.35);background:var(--signal-dim);}

/* =========================================================
   CTA banner
   ========================================================= */
.cta-banner{
  border-radius:28px;
  padding:56px 56px;
  position:relative;overflow:hidden;
  display:flex;align-items:center;justify-content:space-between;
  gap:40px;
  background:
    radial-gradient(600px 300px at 85% 20%, rgba(57,255,138,.16), transparent 65%),
    linear-gradient(180deg, var(--surface-a), var(--surface-b));
  border:1px solid var(--border);
}
.cta-mark{
  position:absolute;right:40px;top:50%;transform:translateY(-50%);
  width:150px;height:150px;border-radius:26px;
  display:flex;align-items:center;justify-content:center;
  background:var(--signal-dim);
  box-shadow:0 0 80px 10px var(--signal-glow-soft);
  opacity:.9;
}
.cta-mark svg{width:56px;height:56px;color:var(--signal);}
.cta-copy h2{
  font-family:var(--f-display);font-size:clamp(24px,3vw,32px);font-weight:600;margin-bottom:10px;letter-spacing:-.01em;
}
.cta-copy p{color:var(--text-2);font-size:14.5px;max-width:420px;}
.cta-actions{display:flex;gap:14px;flex-shrink:0;position:relative;z-index:2;}


