/* ===================================================
   CATB.IN — Global Design System v2
   Light-only · Mac HIG · Liquid Glass · WCAG AA
   =================================================== */

/* ─── Google Fonts (display=swap for perf) ────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ─── Design Tokens ──────────────────────────────── */
:root {
  /* Background */
  --bg-base:       #f2f2f7;   /* Apple systemGroupedBackground */
  --bg-card:       #ffffff;
  --bg-subtle:     #f9f9fb;
  --bg-inset:      #ececf0;

  /* Glass surface (navbar, cards) */
  --glass-bg:      rgba(255, 255, 255, 0.72);
  --glass-border:  rgba(0, 0, 0, 0.08);
  --glass-hover:   rgba(255, 255, 255, 0.88);
  --glass-active:  rgba(255, 255, 255, 0.96);

  /* Text — all WCAG AA on white (#fff) */
  --text-900:  #111115;   /* 16.9:1 */
  --text-700:  #3a3a42;   /* 10.8:1 */
  --text-500:  #6b6b78;   /*  5.4:1 ✓ AA */
  --text-300:  #9696a0;   /*  3.5:1 — decorative only */

  /* Accent — Apple Blue */
  --accent:      #0066cc;
  --accent-h:    #0071e3;
  --accent-light: rgba(0, 102, 204, 0.10);

  /* Category palette */
  --c-electrical: #c45200;  /* AA on white 4.7:1 */
  --c-robotics:   #4c46c7;  /* AA on white 5.9:1 */
  --c-computer:   #0058b3;  /* AA on white 5.3:1 */
  --c-it:         #1a7a35;  /* AA on white 5.1:1 */
  --c-mechanical: #cc2a00;  /* AA on white 5.6:1 */
  --c-electronics:#8230b0;  /* AA on white 5.4:1 */

  /* Category bg tints (10% opacity on white) */
  --c-electrical-bg: rgba(196, 82, 0,   0.08);
  --c-robotics-bg:   rgba(76, 70, 199,  0.08);
  --c-computer-bg:   rgba(0, 88, 179,   0.08);
  --c-it-bg:         rgba(26, 122, 53,  0.08);
  --c-mechanical-bg: rgba(204, 42, 0,   0.08);
  --c-electronics-bg:rgba(130, 48, 176, 0.08);

  /* Difficulty (AA contrast) */
  --diff-beginner:     #0f6e32;
  --diff-beginner-bg:  rgba(15, 110, 50,  0.10);
  --diff-inter:        #8a4c00;
  --diff-inter-bg:     rgba(138, 76, 0,   0.10);
  --diff-advanced:     #b0180e;
  --diff-advanced-bg:  rgba(176, 24, 14,  0.10);

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.06);
  --shadow-sm: 0 2px 8px  rgba(0,0,0,0.07), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 6px 24px rgba(0,0,0,0.09), 0 2px 6px rgba(0,0,0,0.05);
  --shadow-lg: 0 16px 48px rgba(0,0,0,0.11),0 4px 12px rgba(0,0,0,0.06);

  /* Layout */
  --r-sm:   8px;
  --r-md:  14px;
  --r-lg:  20px;
  --r-xl:  28px;
  --r-max: 9999px;

  --max-w:    1280px;
  --content-w: 800px;

  /* Motion */
  --ease:    cubic-bezier(0.4, 0, 0.2, 1);
  --spring:  cubic-bezier(0.34, 1.56, 0.64, 1);
  --fast:  130ms;
  --base:  240ms;
  --slow:  380ms;
}

/* ─── Reset ──────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg-base);
  color: var(--text-700);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* ─── Typography ─────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-900);
  letter-spacing: -0.022em;
  line-height: 1.2;
  font-weight: 700;
}

h1 { font-size: clamp(1.9rem, 4.5vw, 3.25rem); font-weight: 800; }
h2 { font-size: clamp(1.45rem, 2.8vw, 2.1rem); }
h3 { font-size: clamp(1.15rem, 2vw, 1.6rem); }
h4 { font-size: 1.2rem; font-weight: 600; }
h5 { font-size: 1.05rem; font-weight: 600; }

p  { color: var(--text-500); line-height: 1.8; margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }

a  { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-h); text-decoration: underline; }

strong { color: var(--text-900); font-weight: 600; }

code {
  font-family: 'SF Mono', 'Fira Code', Menlo, Monaco, Consolas, monospace;
  font-size: 0.875em;
  background: var(--bg-inset);
  border-radius: 5px;
  padding: 2px 6px;
  color: var(--c-robotics);
}

pre {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-md);
  padding: 1.25rem 1.5rem;
  overflow-x: auto;
  margin: 1.25rem 0;
}

pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.875rem;
  color: var(--text-700);
  display: block;
  line-height: 1.75;
}

ul, ol { padding-left: 1.5rem; color: var(--text-500); line-height: 1.85; }
li { margin-bottom: 0.3rem; }
li strong { color: var(--text-900); }
img { max-width: 100%; height: auto; display: block; }

/* ─── Layout ─────────────────────────────────────── */
.container        { max-width: var(--max-w); margin: 0 auto; padding: 0 24px; }
.container-narrow { max-width: var(--content-w); margin: 0 auto; padding: 0 24px; }
.section    { padding: 80px 0; }
.section-sm { padding: 48px 0; }

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

/* ─── Liquid Glass Card ──────────────────────────── */
.glass-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  box-shadow: var(--shadow-sm);
  transition:
    transform    var(--base) var(--spring),
    box-shadow   var(--base) var(--ease),
    background   var(--fast) var(--ease),
    border-color var(--fast) var(--ease);
}
.glass-card:hover {
  transform: translateY(-3px) scale(1.005);
  box-shadow: var(--shadow-lg);
  background: var(--glass-hover);
  border-color: rgba(0,0,0,0.13);
}

/* ─── Navbar ─────────────────────────────────────── */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  height: 64px;

  /* Liquid glass */
  background: rgba(242, 242, 247, 0.80);
  backdrop-filter: blur(28px) saturate(200%) brightness(1.04);
  -webkit-backdrop-filter: blur(28px) saturate(200%) brightness(1.04);
  border-bottom: 1px solid rgba(0,0,0,0.07);
  box-shadow: 0 1px 0 rgba(255,255,255,0.60) inset,
              0 2px 12px rgba(0,0,0,0.06);
}

.navbar-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Logo */
.navbar-logo {
  display: flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: var(--text-900);
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: -0.03em;
  flex-shrink: 0;
  margin-right: 8px;
}
.navbar-logo:hover { text-decoration: none; color: var(--text-900); }

.logo-badge {
  background: var(--accent);
  color: #fff;
  padding: 3px 8px;
  border-radius: 7px;
  font-size: 0.73rem;
  font-weight: 800;
  letter-spacing: 0.06em;
}

/* Nav links */
.navbar-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  list-style: none;
  flex: 1;
}

.navbar-nav li a {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--text-700);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--r-sm);
  text-decoration: none;
  white-space: nowrap;
  position: relative;
  transition:
    color        var(--fast) var(--ease),
    background   var(--fast) var(--ease),
    box-shadow   var(--base) var(--ease),
    backdrop-filter var(--base) var(--ease);
}

/* Hover — liquid glass pill */
.navbar-nav li a:hover {
  color: var(--text-900);
  background: rgba(255,255,255,0.70);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08),
              0 0 0 1px rgba(255,255,255,0.60) inset;
  text-decoration: none;
}

/* Active — full liquid glass */
.navbar-nav li a.active,
.navbar-nav li a[aria-current="page"] {
  color: var(--accent);
  background: rgba(255,255,255,0.88);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  box-shadow: 0 2px 12px rgba(0,0,0,0.10),
              0 0 0 1px rgba(255,255,255,0.80) inset,
              0 1px 0 rgba(255,255,255,0.90) inset;
  font-weight: 600;
}

/* Nav emoji icons */
.nav-icon {
  font-size: 14px;
  line-height: 1;
  flex-shrink: 0;
}

/* Search */
.navbar-search {
  display: flex;
  align-items: center;
  background: rgba(255,255,255,0.65);
  border: 1px solid rgba(0,0,0,0.09);
  border-radius: var(--r-sm);
  padding: 6px 12px;
  gap: 7px;
  min-width: 200px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all var(--fast) var(--ease);
  flex-shrink: 0;
}
.navbar-search:focus-within {
  background: rgba(255,255,255,0.94);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0,102,204,0.12);
}
.navbar-search svg { color: var(--text-300); flex-shrink: 0; }
.navbar-search input {
  background: none;
  border: none;
  outline: none;
  font-size: 0.875rem;
  color: var(--text-900);
  width: 100%;
  font-family: inherit;
}
.navbar-search input::placeholder { color: var(--text-300); }

/* ─── Buttons ────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 20px;
  border-radius: var(--r-md);
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
  transition: all var(--fast) var(--ease);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0,102,204,0.30);
}
.btn-primary:hover {
  background: var(--accent-h);
  color: #fff;
  transform: scale(1.02);
  box-shadow: 0 4px 16px rgba(0,102,204,0.38);
  text-decoration: none;
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-700);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-xs);
}
.btn-secondary:hover {
  background: var(--bg-subtle);
  color: var(--text-900);
  text-decoration: none;
}

.btn-ghost { background: transparent; color: var(--accent); padding: 8px 14px; }
.btn-ghost:hover { background: var(--accent-light); text-decoration: none; }

.btn-sm { padding: 6px 14px; font-size: 0.875rem; border-radius: var(--r-sm); }
.btn-lg { padding: 13px 30px; font-size: 1rem; border-radius: var(--r-lg); }

/* ─── Badge / Tag ────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 11px;
  border-radius: var(--r-max);
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1;
}

.badge-blue   { background: var(--c-computer-bg);    color: var(--c-computer); }
.badge-green  { background: var(--c-it-bg);           color: var(--c-it); }
.badge-orange { background: var(--c-electrical-bg);   color: var(--c-electrical); }
.badge-red    { background: var(--c-mechanical-bg);   color: var(--c-mechanical); }
.badge-purple { background: var(--c-electronics-bg);  color: var(--c-electronics); }
.badge-indigo { background: var(--c-robotics-bg);     color: var(--c-robotics); }
.badge-gray   { background: rgba(0,0,0,0.06);         color: var(--text-500); }
.badge-teal   { background: rgba(0,160,200,0.10);     color: #006880; }

/* Difficulty */
.difficulty-beginner     { background: var(--diff-beginner-bg); color: var(--diff-beginner); }
.difficulty-intermediate { background: var(--diff-inter-bg);    color: var(--diff-inter); }
.difficulty-advanced     { background: var(--diff-advanced-bg); color: var(--diff-advanced); }

/* Tags */
.tags-row { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.tag {
  background: var(--bg-inset);
  color: var(--text-500);
  border: 1px solid rgba(0,0,0,0.07);
  border-radius: var(--r-max);
  padding: 4px 11px;
  font-size: 0.8rem;
  font-weight: 500;
  text-decoration: none;
  transition: all var(--fast);
}
.tag:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }

/* ─── Breadcrumb ─────────────────────────────────── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.875rem;
  color: var(--text-300);
  flex-wrap: wrap;
  padding: 8px 0;
}
.breadcrumb a { color: var(--text-500); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); text-decoration: underline; }
.breadcrumb .sep { color: var(--text-300); }
.breadcrumb .current { color: var(--text-900); font-weight: 500; }

/* ─── Footer ─────────────────────────────────────── */
.footer {
  background: var(--bg-card);
  border-top: 1px solid var(--glass-border);
  padding: 52px 0 32px;
  margin-top: 80px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 40px;
}
.footer-brand .logo-text { font-size: 1.2rem; font-weight: 800; color: var(--text-900); }
.footer-brand .tagline   { color: var(--text-300); font-size: 0.875rem; margin-top: 6px; }
.footer-brand p { font-size: 0.875rem; margin-top: 10px; }
.footer-col h5 {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-300);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 14px;
}
.footer-col ul { list-style: none; padding: 0; }
.footer-col li { margin-bottom: 9px; }
.footer-col li a { color: var(--text-500); font-size: 0.9rem; }
.footer-col li a:hover { color: var(--accent); text-decoration: none; }
.footer-bottom {
  border-top: 1px solid var(--glass-border);
  padding-top: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-300);
  flex-wrap: wrap;
  gap: 10px;
}

/* ─── Ad Slots ───────────────────────────────────── */
.ad-slot {
  background: var(--bg-subtle);
  border: 1px dashed rgba(0,0,0,0.12);
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-300);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  min-height: 90px;
  width: 100%;
  margin: 1.5rem 0;
}
.ad-slot-square { min-height: 250px; }
.ad-slot-leader { min-height: 90px; }
.ad-slot-rect   { min-height: 250px; }

/* ─── FAQ ────────────────────────────────────────── */
.faq-item {
  border: 1px solid var(--glass-border);
  border-radius: var(--r-md);
  overflow: hidden;
  margin-bottom: 10px;
  background: var(--bg-card);
  transition: border-color var(--fast), box-shadow var(--fast);
}
.faq-item:hover { border-color: rgba(0,0,0,0.13); box-shadow: var(--shadow-xs); }

.faq-question {
  padding: 15px 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--text-900);
  background: var(--bg-card);
  user-select: none;
  list-style: none;
  transition: background var(--fast);
}
.faq-question:hover { background: var(--bg-subtle); }
.faq-question::marker,
.faq-question::-webkit-details-marker { display: none; }
.faq-chevron { transition: transform var(--base) var(--ease); color: var(--text-300); flex-shrink: 0; }
details[open] .faq-chevron { transform: rotate(90deg); }

.faq-answer {
  padding: 14px 18px 16px;
  background: var(--bg-card);
  color: var(--text-500);
  font-size: 0.9375rem;
  line-height: 1.8;
  border-top: 1px solid var(--glass-border);
}

/* ─── Info Boxes ─────────────────────────────────── */
.info-box {
  border-radius: var(--r-md);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  border-left: 4px solid;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.info-box-icon { font-size: 1.1rem; flex-shrink: 0; margin-top: 2px; }
.info-box-content strong { display: block; margin-bottom: 3px; color: var(--text-900); }
.info-box-content p { margin: 0; font-size: 0.9375rem; }
.info-box-blue   { background: rgba(0,88,179,0.06);  border-color: var(--c-computer); }
.info-box-green  { background: rgba(26,122,53,0.07); border-color: var(--c-it); }
.info-box-orange { background: rgba(196,82,0,0.07);  border-color: var(--c-electrical); }
.info-box-red    { background: rgba(176,24,14,0.07); border-color: var(--c-mechanical); }

/* ─── Code Block ─────────────────────────────────── */
.code-block {
  border-radius: var(--r-md);
  border: 1px solid var(--glass-border);
  overflow: hidden;
  margin: 1.5rem 0;
  box-shadow: var(--shadow-xs);
}
.code-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-inset);
  padding: 10px 16px;
  border-bottom: 1px solid var(--glass-border);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-500);
}
.code-block-header .lang-badge {
  background: var(--c-robotics);
  color: #fff;
  padding: 2px 8px;
  border-radius: 5px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}
.code-block pre { margin: 0; border: none; border-radius: 0; padding: 1.25rem 1.5rem; }

/* ─── Table ──────────────────────────────────────── */
.table-wrap { overflow-x: auto; margin: 1.5rem 0; border-radius: var(--r-md); box-shadow: var(--shadow-xs); }
table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; background: var(--bg-card); }
th {
  background: var(--bg-inset);
  color: var(--text-700);
  font-weight: 700;
  font-size: 0.825rem;
  text-align: left;
  padding: 11px 16px;
  border-bottom: 2px solid var(--glass-border);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
td { padding: 11px 16px; border-bottom: 1px solid var(--glass-border); color: var(--text-500); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--bg-subtle); }

/* ─── Playground Zone ────────────────────────────── */
.playground-zone {
  background: linear-gradient(135deg, rgba(76,70,199,0.05), rgba(0,88,179,0.05));
  border: 1px solid rgba(76,70,199,0.18);
  border-radius: var(--r-xl);
  padding: 2.5rem 2rem;
  text-align: center;
  margin: 2.5rem 0;
}
.playground-header { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 12px; }
.playground-header h2 { font-size: 1.4rem; margin: 0; }
.coming-soon-badge {
  background: linear-gradient(90deg, var(--c-robotics), var(--c-computer));
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 11px;
  border-radius: var(--r-max);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.playground-zone p { max-width: 500px; margin: 0 auto 1.25rem; }
.playground-preview {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg);
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 10px;
  color: var(--text-300);
  max-width: 600px;
  margin: 0 auto;
}
.preview-icon { font-size: 2rem; opacity: 0.35; }

/* ─── 3D canvas ──────────────────────────────────── */
#three-canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* ─── Animations ─────────────────────────────────── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-10px); }
}

.animate-in { animation: fadeInUp 0.55s var(--ease) both; }
.animate-in-delay-1 { animation-delay: 0.10s; }
.animate-in-delay-2 { animation-delay: 0.20s; }
.animate-in-delay-3 { animation-delay: 0.30s; }
.animate-in-delay-4 { animation-delay: 0.40s; }

/* ─── Responsive ─────────────────────────────────── */
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 28px; }
  .navbar-nav li a { padding: 6px 9px; font-size: 0.84rem; }
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   SKIP LINK (keyboard / screen readers)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.skip-link {
  position: absolute;
  top: -100%;
  left: 16px;
  z-index: 9999;
  padding: 10px 20px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 0.875rem;
  border-radius: 0 0 10px 10px;
  text-decoration: none;
  transition: top 0.15s ease;
  white-space: nowrap;
}
.skip-link:focus { top: 0; }

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   HAMBURGER BUTTON
   Google guidelines: min 48×48px touch target
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.nav-hamburger {
  display: none;           /* hidden on desktop */
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  width: 48px;
  height: 48px;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 12px;
  border-radius: 10px;
  flex-shrink: 0;
  transition: background 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.nav-hamburger:hover { background: rgba(0,0,0,0.05); }
.nav-hamburger:active { background: rgba(0,0,0,0.10); transform: scale(0.94); }

.ham-bar {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-700);
  border-radius: 2px;
  transition:
    transform 0.30s cubic-bezier(0.34,1.56,0.64,1),
    opacity   0.18s ease,
    width     0.22s ease;
  transform-origin: center;
}
/* Open state: bars animate into X */
.nav-hamburger[aria-expanded="true"] .ham-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-hamburger[aria-expanded="true"] .ham-bar:nth-child(2) {
  opacity: 0; width: 0;
}
.nav-hamburger[aria-expanded="true"] .ham-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   MOBILE OVERLAY (backdrop)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1090;
  background: rgba(0,0,0,0.38);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.28s ease;
}
.mobile-overlay.open { display: block; }
.mobile-overlay.visible { opacity: 1; }

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   MOBILE DRAWER PANEL
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.mobile-drawer {
  display: none;
  position: fixed;
  top: 0; right: 0;
  width: min(300px, 88vw);
  height: 100dvh;          /* dynamic viewport height for iOS */
  height: 100vh;           /* fallback */
  z-index: 1100;
  overflow-y: auto;
  overscroll-behavior: contain;

  /* Liquid glass panel */
  background: rgba(248,248,252,0.97);
  backdrop-filter: blur(32px) saturate(200%);
  -webkit-backdrop-filter: blur(32px) saturate(200%);
  border-left: 1px solid rgba(255,255,255,0.60);
  box-shadow: -8px 0 40px rgba(0,0,0,0.14),
              1px 0 0 rgba(255,255,255,0.50) inset;

  transform: translateX(105%);
  transition: transform 0.34s cubic-bezier(0.32,0.72,0,1);
  padding: 0 0 32px 0;
}
.mobile-drawer.open { display: block; }
.mobile-drawer.visible { transform: translateX(0); }

/* Header row inside drawer */
.mobile-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(0,0,0,0.07);
  position: sticky;
  top: 0;
  background: rgba(248,248,252,0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 1;
}

.drawer-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  border: none;
  background: rgba(0,0,0,0.06);
  border-radius: 50%;
  cursor: pointer;
  color: var(--text-700);
  transition: background 0.15s ease, transform 0.20s cubic-bezier(0.34,1.56,0.64,1);
  -webkit-tap-highlight-color: transparent;
}
.drawer-close:hover { background: rgba(0,0,0,0.11); }
.drawer-close:active { transform: scale(0.90); }

/* Search inside drawer */
.mobile-search {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 20px;
  padding: 10px 14px;
  background: rgba(0,0,0,0.05);
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 12px;
  color: var(--text-300);
}
.mobile-search input {
  border: none;
  background: transparent;
  font-size: 0.9rem;
  color: var(--text-900);
  width: 100%;
  outline: none;
  font-family: inherit;
}
.mobile-search input::placeholder { color: var(--text-300); }

/* Nav list inside drawer */
.mobile-nav-list {
  list-style: none;
  padding: 8px 12px;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.mobile-nav-list li a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;       /* 48px min touch height */
  min-height: 48px;
  border-radius: 12px;
  text-decoration: none;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  transition: background 0.14s ease, transform 0.20s cubic-bezier(0.34,1.56,0.64,1);
  -webkit-tap-highlight-color: transparent;
}
.mobile-nav-list li a:hover,
.mobile-nav-list li a:focus {
  background: rgba(0,0,0,0.05);
}
.mobile-nav-list li a:active { transform: scale(0.97); }
.mobile-nav-list li a.active {
  background: rgba(0,102,204,0.08);
  font-weight: 700;
}
.mobile-nav-list li a::after {
  content: '';
  display: block;
  margin-left: auto;
  width: 7px; height: 7px;
  border-right: 2px solid currentColor;
  border-top: 2px solid currentColor;
  transform: rotate(45deg);
  opacity: 0.40;
  flex-shrink: 0;
}

.mobile-drawer-footer {
  padding: 16px 20px 0;
  border-top: 1px solid rgba(0,0,0,0.06);
  margin-top: 8px;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   TABLET — 768px
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
@media (max-width: 768px) {
  /* Grids */
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }

  /* Navbar */
  .navbar-nav { display: none; }           /* hide desktop links */
  .navbar-search { display: none; }        /* hide desktop search */
  .nav-hamburger { display: flex; }        /* show hamburger */
  .navbar-inner { gap: 0; }
  .navbar { height: 60px; }

  /* Footer */
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }

  /* Container */
  .container { padding: 0 16px; }

  /* Hero */
  h1 { font-size: clamp(1.7rem, 6.5vw, 2.4rem); }
  .hero-content { text-align: center; }
  .hero-eyebrow { justify-content: center; }
  .hero-cta-row { justify-content: center; }
  .hero-stats { justify-content: center; }
  .hero-subtitle { max-width: 100%; text-align: center; }

  /* Section headers */
  .section-header h2 { font-size: 1.2rem; }

  /* Buttons: full-width stacked on tiny screens */
  .hero-cta-row { flex-direction: column; align-items: center; gap: 12px; }
  .btn-lg { width: 100%; max-width: 320px; justify-content: center; }
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   MOBILE — 480px
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
@media (max-width: 480px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .container { padding: 0 14px; }
  h1 { font-size: clamp(1.55rem, 8vw, 2rem); }

  /* Navbar height */
  .navbar { height: 56px; }

  /* Category & project cards */
  .category-card, .project-card {
    padding: 18px 16px;
  }

  /* Badges wrap */
  .project-meta-row { flex-wrap: wrap; }

  /* TOC hidden on tiny screens */
  .hero-stats { flex-wrap: wrap; gap: 12px; }
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   SMALLEST SCREENS — 360px
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
@media (max-width: 360px) {
  .container { padding: 0 12px; }
  .navbar-inner { padding: 0 12px; }
  .logo-badge { font-size: 0.66rem; padding: 2px 6px; }
}



/* ─── Print ──────────────────────────────────────── */
@media print {
  .navbar, .footer, .ad-slot, .playground-zone, #three-canvas { display: none !important; }
  body { background: #fff; color: #111; }
  a::after { content: " (" attr(href) ")"; font-size: 0.8em; color: #555; }
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   ELITE MOTION & GLASS LAYER (appended v3)
   Supports js/ui.js Spring engine
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

/* ─── Navbar nav links: remove old CSS hover/active
       (Spring JS indicator takes over completely)  */
.navbar-nav li a {
  background: transparent !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  z-index: 1;
  transition: color 0.13s ease;
}
.navbar-nav li a:hover { color: var(--text-900) !important; }
.navbar-nav li a.active,
.navbar-nav li a[aria-current="page"] {
  color: var(--accent) !important;
  font-weight: 600;
}

/* ─── Glass card base: prep for JS glare overlay ── */
.category-card,
.project-card,
.glass-card,
.related-card {
  /* JS writes --gx/--gy/--go/--gs via inline style */
  position: relative;
  overflow: hidden;
  isolation: isolate;           /* creates stacking context */
  transform-style: preserve-3d;/* enables perspective tilt */
}

/* ─── Subtle top-edge specular bevel on all cards ─ */
.category-card,
.glass-card,
.sidebar-card {
  box-shadow:
    var(--shadow-sm),
    0 1px 0 rgba(255,255,255,0.90) inset,  /* top bevel */
    0 -1px 0 rgba(0,0,0,0.04) inset;       /* bottom edge */
}
.category-card:hover,
.glass-card:hover {
  box-shadow:
    var(--shadow-lg),
    0 1px 0 rgba(255,255,255,0.95) inset,
    0 -1px 0 rgba(0,0,0,0.06) inset;
}

/* ─── Project card subtle bevel ──────────────────── */
.project-card {
  box-shadow:
    var(--shadow-xs),
    0 1px 0 rgba(255,255,255,0.85) inset;
}
.project-card:hover {
  box-shadow:
    var(--shadow-md),
    0 1px 0 rgba(255,255,255,0.92) inset;
}

/* ─── Sidebar glass card ─────────────────────────── */
.sidebar-card {
  border: 1px solid rgba(0,0,0,0.07);
  background:
    linear-gradient(160deg, rgba(255,255,255,0.92) 0%, rgba(248,248,252,0.88) 100%);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
}

/* ─── Hero title overflow guard for word-wrap JS ─── */
.hero-title {
  overflow: hidden;          /* hides clip-path word reveal */
  line-height: 1.12;
}
.hero-title .hw {
  will-change: clip-path, transform, opacity;
}

/* ─── Gradient text shimmer setup ───────────────── */
.gradient-text {
  background-image: linear-gradient(135deg, #0058b3 0%, #4c46c7 55%, #8230b0 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: #0058b3; /* fallback for browsers without background-clip:text */
  will-change: background-image;
  /* Ensure it keeps display:inline so the block-span fix in JS works */
  display: inline;
}
/* When JS wraps it as display:inline-block for animation, keep gradient */
.gradient-text[style*="inline-block"] {
  display: inline-block;
}

/* ─── Cursor aura sits behind all content ────────── */
body > div[style*="radial-gradient"] {
  mix-blend-mode: multiply;
}

/* ─── Section reveal: remove old animate-in class  ─ */
.animate-in { animation: none !important; opacity: 1 !important; transform: none !important; }

/* ─── FAQ: spring-like open animation ───────────── */
details.faq-item[open] .faq-answer {
  animation: faqOpen 0.28s cubic-bezier(0.22,1,0.36,1) both;
}
@keyframes faqOpen {
  from { opacity:0; transform:translateY(-6px); }
  to   { opacity:1; transform:translateY(0); }
}

/* ─── Active TOC link glass pill ─────────────────── */
.toc-list a.active {
  background:
    linear-gradient(90deg, rgba(0,102,204,0.08), rgba(0,102,204,0.04));
  color: var(--accent);
  border-left-color: var(--accent);
  font-weight: 600;
}

/* ─── Filter pill active: liquid press ──────────── */
.filter-pill {
  transition: background 0.18s ease, color 0.18s ease,
              transform 0.20s cubic-bezier(0.34,1.56,0.64,1),
              box-shadow 0.18s ease;
}
.filter-pill:active { transform: scale(0.94); }
.filter-pill.active {
  box-shadow: 0 2px 10px rgba(0,102,204,0.22),
              0 1px 0 rgba(255,255,255,0.40) inset;
}

/* ─── Button: prepare for spring magnetic ────────── */
.btn {
  will-change: transform;
  transform-origin: center;
}
.btn-primary {
  box-shadow:
    0 2px 10px rgba(0,102,204,0.30),
    0 1px 0 rgba(255,255,255,0.30) inset;
}
.btn-primary:hover {
  box-shadow:
    0 5px 20px rgba(0,102,204,0.38),
    0 1px 0 rgba(255,255,255,0.35) inset;
}

/* ─── Logo badge pulse on load ───────────────────── */
@keyframes logoPulse {
  0%   { box-shadow: 0 0 0 0 rgba(0,102,204,0.35); }
  60%  { box-shadow: 0 0 0 8px rgba(0,102,204,0); }
  100% { box-shadow: 0 0 0 0 rgba(0,102,204,0); }
}
.logo-badge {
  animation: logoPulse 1.8s cubic-bezier(0.22,1,0.36,1) 0.5s 2;
}

/* ─── Step number ring glow ──────────────────────── */
.step-num {
  box-shadow:
    0 4px 14px rgba(0,102,204,0.28),
    0 0 0 4px rgba(0,102,204,0.08);
}

/* ─── Back-to-top button exists via JS only ─────── */
/* (no static CSS needed; all inline in ui.js) */

/* ─── Performance: contain heavy sections ────────── */
.categories-section,
.featured-section,
.how-section {
  contain: layout style;
}

