/* Pb28 Master — Code Tutorial Platform */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  --bg: #060810;
  --bg-card: #0d1117;
  --bg-elevated: #151b28;
  --surface: #ffffff;
  --surface-soft: #f4f7fc;
  --border: #1a2234;
  --border-light: #e4eaf4;
  --text: #0c1222;
  --text-muted: #5c6b82;
  --text-inv: #eef2ff;
  --text-inv-muted: #9aa8c4;
  --primary: #7055ff;
  --primary-dark: #5b3fd9;
  --primary-light: #9b8cff;
  --accent: #ff8a3d;
  --accent-gold: #fbbf24;
  --accent-glow: rgba(255, 138, 61, 0.28);
  --gradient-brand: linear-gradient(135deg, #7055ff 0%, #a855f7 45%, #ff8a3d 100%);
  --gradient-hero: radial-gradient(ellipse 90% 70% at 50% -15%, rgba(112, 85, 255, 0.42), transparent 55%),
                   radial-gradient(ellipse 55% 45% at 92% 15%, rgba(255, 138, 61, 0.18), transparent),
                   radial-gradient(ellipse 40% 35% at 8% 25%, rgba(168, 85, 247, 0.14), transparent);
  --code-bg: #0a0e14;
  --code-border: #2a3344;
  --green: #10b981;
  --red: #f04444;
  --radius: 14px;
  --radius-lg: 22px;
  --shadow: 0 4px 24px rgba(12, 18, 34, 0.08), 0 1px 3px rgba(12, 18, 34, 0.04);
  --shadow-lg: 0 24px 60px rgba(12, 18, 34, 0.14), 0 8px 20px rgba(112, 85, 255, 0.08);
  --shadow-glow: 0 12px 40px rgba(112, 85, 255, 0.22);
  --glass: rgba(255, 255, 255, 0.06);
  --font: 'Plus Jakarta Sans', system-ui, sans-serif;
  --mono: 'JetBrains Mono', monospace;
  --header-h: 72px;
  --max: 1200px;
  --content: 760px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  color: var(--text);
  background-color: var(--surface-soft);
  background-image:
    radial-gradient(ellipse 70% 45% at 50% -5%, rgba(112, 85, 255, 0.07), transparent),
    radial-gradient(ellipse 50% 35% at 100% 10%, rgba(255, 138, 61, 0.05), transparent);
  background-attachment: fixed;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--primary); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent); }
code { font-family: var(--mono); font-size: 0.88em; background: rgba(112, 85, 255, 0.1); color: #5b3fd9; padding: 0.15rem 0.45rem; border-radius: 6px; }

/* Download bar — visible on every tutorial page */
.download-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  background: linear-gradient(135deg, #12082a 0%, #2d1b69 50%, #1a1040 100%);
  border: 1px solid rgba(112, 85, 255, 0.35); border-radius: var(--radius);
  padding: 1rem 1.25rem; margin: 1.5rem 0 2rem;
  box-shadow: 0 8px 32px rgba(112, 85, 255, 0.15);
}
.download-bar p { margin: 0; color: #c4b5fd; font-size: 0.92rem; }
.download-btn {
  display: inline-flex !important; align-items: center; gap: 0.45rem;
  background: linear-gradient(135deg, var(--accent), #e86a1a); color: #fff !important; font-weight: 700;
  padding: 0.65rem 1.25rem; border-radius: 10px; font-size: 0.88rem;
  border: none; cursor: pointer; font-family: var(--font);
  transition: 0.25s; white-space: nowrap;
  box-shadow: 0 4px 16px var(--accent-glow);
}
.download-btn:hover { transform: translateY(-2px); color: #fff !important; box-shadow: 0 8px 24px var(--accent-glow); }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 1000;
  background: rgba(6, 8, 16, 0.82);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.25);
  height: var(--header-h);
}
.header-inner {
  max-width: var(--max); margin: 0 auto; padding: 0 1.25rem;
  height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.logo {
  display: flex; align-items: center; gap: 0.65rem;
  font-weight: 800; font-size: 1.25rem; color: #fff;
}
.logo-icon {
  width: 40px; height: 40px; border-radius: 11px; flex-shrink: 0;
  display: block; box-shadow: 0 4px 18px rgba(112, 85, 255, 0.45);
}
.logo-mark {
  width: 40px; height: 40px; border-radius: 11px;
  background: var(--gradient-brand);
  display: grid; place-items: center; font-size: 0.85rem; font-weight: 800; color: #fff;
  box-shadow: 0 4px 18px rgba(112, 85, 255, 0.4);
}
.logo span {
  background: linear-gradient(90deg, var(--primary-light), var(--accent));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.nav { display: flex; align-items: center; gap: 1.75rem; list-style: none; }
.nav a { color: var(--text-inv-muted); font-weight: 500; font-size: 0.92rem; transition: color 0.2s, opacity 0.2s; }
.nav a:hover, .nav a.active { color: #fff; }
.nav a.active { position: relative; }
.nav a.active::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -6px; height: 2px;
  background: var(--gradient-brand); border-radius: 2px;
}
.menu-btn { display: none; background: none; border: none; cursor: pointer; padding: 0.5rem; }
.menu-btn span { display: block; width: 22px; height: 2px; background: #fff; margin: 5px 0; }

/* Hero */
.hero {
  background: var(--bg);
  color: #fff; padding: 5rem 1.25rem 5.5rem;
  position: relative; overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; inset: 0;
  background: var(--gradient-hero);
}
.hero::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 75% 65% at 50% 25%, black 20%, transparent 75%);
}
.hero-inner { max-width: var(--max); margin: 0 auto; position: relative; z-index: 1; text-align: center; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 0.45rem;
  background: rgba(112, 85, 255, 0.12);
  border: 1px solid rgba(155, 140, 255, 0.25);
  padding: 0.45rem 1.1rem; border-radius: 50px; font-size: 0.82rem; font-weight: 600;
  color: var(--primary-light); margin-bottom: 1.35rem;
  box-shadow: 0 0 24px rgba(112, 85, 255, 0.15);
}
.hero h1 {
  font-size: clamp(2.1rem, 5vw, 3.45rem); font-weight: 800; line-height: 1.12;
  margin-bottom: 1.1rem; letter-spacing: -0.02em;
}
.hero h1 em {
  font-style: normal;
  background: linear-gradient(120deg, #c4b5fd 0%, #7055ff 35%, #ff8a3d 85%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.hero p { max-width: 640px; margin: 0 auto 2.25rem; color: var(--text-inv-muted); font-size: 1.1rem; line-height: 1.75; }
.hero-actions { display: flex; gap: 0.85rem; justify-content: center; flex-wrap: wrap; }

.home-stats {
  position: relative;
  z-index: 5;
  margin-top: -3.25rem;
  padding: 0 0 0.5rem;
}
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}
.stat-card {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: var(--radius-lg);
  padding: 1.65rem 1rem;
  text-align: center;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
  transition: transform 0.25s, box-shadow 0.25s;
}
.stat-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--gradient-brand);
}
.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}
.stat-num {
  display: block;
  font-size: clamp(1.85rem, 3vw, 2.35rem);
  font-weight: 800;
  line-height: 1.15;
  background: var(--gradient-brand);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  margin-bottom: 0.35rem;
}
.stat-label {
  display: block;
  font-size: 0.88rem;
  line-height: 1.4;
  color: var(--text-muted);
}
.section-home { padding-top: 2rem; }
.section-team { padding-top: 2.5rem; padding-bottom: 2.5rem; }
.section-team .team-grid { margin-top: 0; }

.btn {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.85rem 1.6rem; border-radius: 12px;
  font-weight: 600; font-size: 0.92rem; border: none; cursor: pointer;
  transition: transform 0.25s, box-shadow 0.25s, background 0.25s;
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff; box-shadow: 0 4px 16px rgba(112, 85, 255, 0.35);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 32px rgba(112, 85, 255, 0.45);
  color: #fff;
}
.btn-ghost {
  background: rgba(255, 255, 255, 0.06); color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(8px);
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.12); color: #fff; border-color: rgba(255, 255, 255, 0.28); }
.btn-accent {
  background: linear-gradient(135deg, var(--accent) 0%, #e86a1a 100%);
  color: #fff; box-shadow: 0 4px 16px var(--accent-glow);
}
.btn-accent:hover { color: #fff; transform: translateY(-2px); box-shadow: 0 10px 28px var(--accent-glow); }

/* Sections */
.section { padding: 4rem 0; }
.section-dark { background: var(--bg); color: #fff; }
.container { max-width: var(--max); margin: 0 auto; padding: 0 1.25rem; }
.section-head { text-align: center; margin-bottom: 2.75rem; }
.section-head h2 {
  font-size: clamp(1.65rem, 3vw, 2.25rem); font-weight: 800; margin-bottom: 0.65rem;
  letter-spacing: -0.02em; position: relative; display: inline-block;
}
.section-head h2::after {
  content: ''; display: block; width: 48px; height: 4px; margin: 0.65rem auto 0;
  background: var(--gradient-brand); border-radius: 4px;
}
.section-head p { color: var(--text-muted); max-width: 560px; margin: 0 auto; font-size: 1.02rem; }
.section-dark .section-head p { color: var(--text-inv-muted); }

/* Category pills */
.categories { display: flex; gap: 0.5rem; flex-wrap: wrap; justify-content: center; margin-bottom: 2rem; }
.cat-pill {
  padding: 0.45rem 1rem; border-radius: 50px; font-size: 0.85rem; font-weight: 600;
  background: var(--surface); border: 1px solid var(--border-light); color: var(--text-muted);
  cursor: pointer; transition: 0.2s;
}
.cat-pill:hover, .cat-pill.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff; border-color: transparent;
  box-shadow: 0 4px 14px rgba(112, 85, 255, 0.3);
}

/* Tutorial cards */
.tutorial-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1.5rem; }
.t-card {
  background: var(--surface); border: 1px solid var(--border-light); border-radius: var(--radius-lg);
  overflow: hidden; transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow);
}
.t-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(112, 85, 255, 0.12);
  border-color: rgba(112, 85, 255, 0.25);
}
.t-card-thumb {
  height: 180px;
  background: linear-gradient(145deg, #12082a 0%, #2d1b69 45%, #1a1040 100%);
  display: flex; align-items: center; justify-content: center; font-size: 3rem;
  position: relative;
}
.t-card-thumb::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 30% 20%, rgba(112, 85, 255, 0.35), transparent 55%);
  pointer-events: none;
}
.t-card-tag {
  position: absolute; top: 1rem; left: 1rem;
  background: rgba(0,0,0,0.5); backdrop-filter: blur(4px);
  color: #fff; font-size: 0.72rem; font-weight: 700; padding: 0.25rem 0.7rem; border-radius: 50px;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.t-card-body { padding: 1.35rem; flex: 1; display: flex; flex-direction: column; }
.t-card-meta { display: flex; gap: 0.75rem; font-size: 0.78rem; color: var(--text-muted); margin-bottom: 0.6rem; }
.t-card h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 0.5rem; line-height: 1.35; }
.t-card h3 a { color: var(--text); }
.t-card h3 a:hover { color: var(--primary); }
.t-card p { font-size: 0.9rem; color: var(--text-muted); flex: 1; margin-bottom: 1rem; }
.t-card-footer { display: flex; align-items: center; justify-content: space-between; }
.read-link { font-weight: 600; font-size: 0.88rem; color: var(--primary); }
.level { font-size: 0.75rem; font-weight: 600; padding: 0.2rem 0.6rem; border-radius: 6px; }
.level-inter { background: #fef3c7; color: #b45309; }
.level-begin { background: #dcfce7; color: #15803d; }
.level-adv { background: #fee2e2; color: #b91c1c; }

/* Features strip */
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.25rem; }
.feat {
  background: linear-gradient(160deg, var(--bg-elevated) 0%, rgba(21, 27, 40, 0.6) 100%);
  border: 1px solid rgba(255, 255, 255, 0.06); border-radius: var(--radius);
  padding: 1.65rem; text-align: center;
  transition: transform 0.25s, border-color 0.25s;
}
.feat:hover { transform: translateY(-3px); border-color: rgba(112, 85, 255, 0.25); }
.feat-icon { font-size: 2rem; margin-bottom: 0.75rem; }
.feat h3 { color: #fff; font-size: 1rem; margin-bottom: 0.4rem; }
.feat p { color: var(--text-inv-muted); font-size: 0.88rem; }

/* ===== TUTORIAL PAGE ===== */
.tutorial-layout {
  max-width: calc(var(--max) + 280px); margin: 0 auto; padding: 2rem 1.25rem 4rem;
  display: grid; grid-template-columns: 240px 1fr; gap: 2.5rem; align-items: start;
}
.toc {
  position: sticky; top: calc(var(--header-h) + 1.5rem);
  background: var(--surface); border: 1px solid var(--border-light);
  border-radius: var(--radius); padding: 1.25rem;
}
.toc h4 { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); margin-bottom: 0.75rem; }
.toc ol { list-style: none; counter-reset: toc; }
.toc li { counter-increment: toc; margin-bottom: 0.35rem; }
.toc a {
  display: block; font-size: 0.85rem; color: var(--text-muted); padding: 0.35rem 0.5rem;
  border-radius: 8px; border-left: 2px solid transparent;
}
.toc a:hover, .toc a.active { color: var(--primary); background: rgba(112, 85, 255, 0.08); border-left-color: var(--primary); }

.tutorial-article { min-width: 0; }
.tutorial-header { margin-bottom: 2rem; }
.tutorial-header .tags { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.tag { font-size: 0.75rem; font-weight: 700; padding: 0.3rem 0.75rem; border-radius: 50px; background: rgba(112, 85, 255, 0.1); color: var(--primary-dark); }
.tutorial-header h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); font-weight: 800; line-height: 1.2; margin-bottom: 0.75rem; }
.tutorial-meta { display: flex; gap: 1.25rem; flex-wrap: wrap; font-size: 0.85rem; color: var(--text-muted); }
.author-chip { display: flex; align-items: center; gap: 0.5rem; }
.author-av {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: grid; place-items: center; color: #fff; font-size: 0.75rem; font-weight: 700;
}

.tutorial-body h2 {
  font-size: 1.5rem; font-weight: 800; margin: 2.5rem 0 1rem;
  padding-top: 1rem; scroll-margin-top: calc(var(--header-h) + 1rem);
}
.tutorial-body h3 { font-size: 1.15rem; font-weight: 700; margin: 1.75rem 0 0.75rem; }
.tutorial-body p { margin-bottom: 1.1rem; color: #334155; }
.tutorial-body img {
  max-width: 100%; height: auto; border-radius: var(--radius);
  margin: 1.5rem 0; box-shadow: var(--shadow); border: 1px solid var(--border-light);
}
.tutorial-body pre:not(.code-block pre) {
  background: var(--code-bg); color: #e6edf3; padding: 1rem 1.25rem;
  border-radius: var(--radius); overflow-x: auto; font-family: var(--mono); font-size: 0.82rem;
  margin: 1.25rem 0; border: 1px solid var(--code-border);
}
.tutorial-body table { width: 100%; border-collapse: collapse; margin: 1.25rem 0; font-size: 0.9rem; }
.tutorial-body th, .tutorial-body td { border: 1px solid var(--border-light); padding: 0.6rem 0.85rem; text-align: left; }
.tutorial-body th { background: #f1f5f9; font-weight: 600; }
.tutorial-body ul, .tutorial-body ol { margin: 0.75rem 0 1.25rem 1.5rem; color: #334155; }
.tutorial-body li { margin-bottom: 0.4rem; }
.tutorial-body strong { color: var(--text); }

/* Code blocks */
.code-block {
  margin: 1.5rem 0; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--code-border); background: var(--code-bg);
}
.code-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.6rem 1rem; background: #161b22; border-bottom: 1px solid var(--code-border);
}
.code-file { font-family: var(--mono); font-size: 0.78rem; color: #8b949e; }
.copy-btn {
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1);
  color: #c9d1d9; font-size: 0.75rem; padding: 0.3rem 0.7rem; border-radius: 6px; cursor: pointer;
  font-family: var(--font); transition: 0.2s;
}
.copy-btn:hover { background: rgba(255,255,255,0.12); }
.code-block pre {
  padding: 1.15rem 1.25rem; overflow-x: auto;
  font-family: var(--mono); font-size: 0.82rem; line-height: 1.65; color: #e6edf3;
}
.code-block code { background: none; padding: 0; color: inherit; font-size: inherit; }
.kw { color: #ff7b72; } .fn { color: #d2a8ff; } .str { color: #a5d6ff; } .cm { color: #8b949e; } .tag { color: #7ee787; } .attr { color: #79c0ff; }

/* Demo / reference visuals */
.demo-box {
  margin: 1.75rem 0; border-radius: var(--radius-lg); overflow: hidden;
  border: 1px solid var(--border-light); background: var(--surface);
  box-shadow: var(--shadow);
}
.demo-label {
  padding: 0.55rem 1rem; background: #f1f5f9; border-bottom: 1px solid var(--border-light);
  font-size: 0.78rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em;
}
.demo-content { padding: 2rem; display: flex; align-items: center; justify-content: center; min-height: 160px; }
.demo-caption { padding: 0.75rem 1rem; font-size: 0.82rem; color: var(--text-muted); border-top: 1px solid var(--border-light); background: #fafafa; }

/* UI mockups inside demos */
.mock-btn {
  padding: 0.75rem 1.75rem; border-radius: 10px; border: none; font-weight: 600;
  background: linear-gradient(135deg, var(--primary), #4f46e5); color: #fff; cursor: pointer;
  transition: transform 0.15s; font-size: 0.95rem;
}
.mock-btn:active { transform: scale(0.95); }
.mock-form { width: 100%; max-width: 360px; }
.mock-form label { display: block; font-size: 0.82rem; font-weight: 600; margin-bottom: 0.3rem; color: #475569; }
.mock-form input {
  width: 100%; padding: 0.65rem 0.85rem; border: 1px solid #cbd5e1; border-radius: 8px;
  margin-bottom: 0.75rem; font-size: 0.9rem;
}
.mock-form input.error { border-color: var(--red); background: #fef2f2; }
.field-err { color: var(--red); font-size: 0.78rem; margin: -0.5rem 0 0.5rem; }
.mock-loader { display: flex; align-items: center; gap: 0.6rem; color: var(--primary); font-size: 0.88rem; font-weight: 600; }
.spinner { width: 20px; height: 20px; border: 2px solid #c7d2fe; border-top-color: var(--primary); border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.mock-success { color: var(--green); font-weight: 600; display: flex; align-items: center; gap: 0.4rem; }
.mock-error { color: var(--red); font-weight: 600; display: flex; align-items: center; gap: 0.4rem; }
.mock-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.6rem; width: 100%; max-width: 400px; }
.mock-ctrl { padding: 0.55rem; border-radius: 8px; border: 1px solid #e2e8f0; background: #f8fafc; font-size: 0.8rem; font-weight: 600; text-align: center; cursor: default; transition: 0.2s; }
.mock-ctrl:hover { border-color: var(--primary); box-shadow: 0 4px 12px rgba(99,102,241,0.15); transform: translateY(-2px); }
.ripple-demo {
  position: relative; overflow: hidden; padding: 1rem 2rem; border-radius: 10px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6); color: #fff; font-weight: 600; cursor: pointer;
}

/* Info boxes */
.info-box {
  padding: 1rem 1.25rem; border-radius: var(--radius); margin: 1.25rem 0;
  border-left: 4px solid var(--primary); background: #eef2ff; font-size: 0.92rem; color: #3730a3;
}
.info-box.tip { border-color: var(--green); background: #f0fdf4; color: #166534; }

/* Related */
.related { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--border-light); }
.related h3 { font-size: 1.2rem; font-weight: 800; margin-bottom: 1.25rem; }
.related-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; }
.related-card {
  padding: 1rem 1.15rem; border: 1px solid var(--border-light); border-radius: var(--radius);
  transition: 0.2s;
}
.related-card:hover { border-color: var(--primary); background: #fafbff; }
.related-card span { font-size: 0.72rem; font-weight: 700; color: var(--primary); text-transform: uppercase; }
.related-card h4 { font-size: 0.95rem; margin-top: 0.3rem; }
.related-card h4 a { color: var(--text); }
.related-card h4 a:hover { color: var(--primary); }

/* Footer */
.site-footer {
  background: var(--bg); color: var(--text-inv-muted); padding: 3.5rem 0 1.5rem;
  position: relative; overflow: hidden;
}
.site-footer::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(112, 85, 255, 0.5), rgba(255, 138, 61, 0.4), transparent);
}
.site-footer::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 60% 50% at 50% 0%, rgba(112, 85, 255, 0.08), transparent);
}
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 2rem; margin-bottom: 2rem; position: relative; z-index: 1; }
.footer-brand .logo { margin-bottom: 0.75rem; }
.footer-brand p { font-size: 0.88rem; line-height: 1.6; }
.footer-col h4 { color: #fff; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 1rem; }
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 0.5rem; }
.footer-col a { color: var(--text-inv-muted); font-size: 0.88rem; }
.footer-col a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid var(--border); padding-top: 1.25rem; text-align: center; font-size: 0.82rem; position: relative; z-index: 1; }
.footer-registration { margin-top: 0.35rem; color: var(--text-inv-muted); font-size: 0.78rem; }

/* Page header (inner) */
.page-hero {
  background: var(--bg); color: #fff; padding: 3.5rem 1.25rem; text-align: center;
  position: relative; overflow: hidden;
}
.page-hero::before {
  content: ''; position: absolute; inset: 0;
  background: var(--gradient-hero);
  opacity: 0.85;
}
.page-hero .container,
.page-hero > * { position: relative; z-index: 1; }
.page-hero h1 {
  font-size: clamp(1.85rem, 4vw, 2.55rem); font-weight: 800;
  letter-spacing: -0.02em;
}
.page-hero p { color: var(--text-inv-muted); margin-top: 0.65rem; font-size: 1.05rem; }

/* Contact form */
.form-group { margin-bottom: 1.15rem; }
.form-group label { display: block; font-weight: 600; font-size: 0.88rem; margin-bottom: 0.35rem; }
.form-group input, .form-group textarea, .form-group select {
  width: 100%; padding: 0.75rem 1rem; border: 1px solid var(--border-light);
  border-radius: 10px; font-family: var(--font); font-size: 0.92rem;
}
.form-group input:focus, .form-group textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(112, 85, 255, 0.15); }
.form-group textarea { min-height: 140px; resize: vertical; }
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: start; }

/* About — founder profile */
.about-content { max-width: 820px; margin: 0 auto; }
.founder-card {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 2rem;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin-bottom: 2.5rem;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}
.founder-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--gradient-brand);
}
.founder-photo {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--radius-lg);
  border: 3px solid var(--border-light);
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.15);
}
.founder-badge {
  display: inline-block;
  background: rgba(99, 102, 241, 0.1);
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.35rem 0.75rem;
  border-radius: 50px;
  margin-bottom: 0.65rem;
}
.founder-name { font-size: 1.75rem; font-weight: 800; margin-bottom: 0.35rem; color: var(--text); }
.founder-meta { color: var(--text-muted); font-size: 0.92rem; margin-bottom: 1rem; line-height: 1.6; }
.founder-meta span { display: inline-flex; align-items: center; gap: 0.35rem; }
.founder-bio { color: #334155; line-height: 1.75; margin: 0; }
.about-block { margin-bottom: 2.25rem; }
.about-block h2 { font-size: 1.35rem; font-weight: 800; margin-bottom: 0.85rem; }
.about-block p { color: #334155; margin-bottom: 0.85rem; }
.about-list { margin-left: 1.5rem; color: #334155; }
.about-list li { margin-bottom: 0.45rem; }
.about-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-top: 2.5rem;
}
.about-stat {
  text-align: center;
  padding: 1.35rem 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
}
.about-stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.about-stat strong {
  display: block; font-size: 1.55rem; font-weight: 800;
  background: var(--gradient-brand);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.about-stat span { font-size: 0.82rem; color: var(--text-muted); }

/* About — team section */
.team-section { margin-top: 2.5rem; }
.team-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  justify-content: center;
  margin-top: 1.25rem;
}
.team-card {
  flex: 1 1 140px;
  max-width: 220px;
  min-width: 0;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1rem 1.25rem;
  box-shadow: var(--shadow);
  transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
}
.team-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(112, 85, 255, 0.1);
  border-color: rgba(112, 85, 255, 0.2);
}
.team-photo {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 1rem;
  display: block;
  border: 3px solid rgba(112, 85, 255, 0.15);
  box-shadow: 0 8px 24px rgba(112, 85, 255, 0.2);
}
.team-photo-placeholder {
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  font-size: 2rem;
  font-weight: 800;
}
.team-name {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  color: var(--text);
}
.team-role {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.45;
}

/* Contact page */
.contact-layout { max-width: 960px; margin: 0 auto; }
.contact-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 2.5rem;
}
.contact-card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 1.35rem;
  text-align: center;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.contact-card:hover { border-color: var(--primary); box-shadow: var(--shadow); }
.contact-card-icon { font-size: 1.75rem; margin-bottom: 0.65rem; }
.contact-card h3 { font-size: 0.95rem; font-weight: 700; margin-bottom: 0.35rem; }
.contact-card p { font-size: 0.88rem; color: var(--text-muted); margin: 0; line-height: 1.5; }
.contact-card a { color: var(--primary); font-weight: 600; font-size: 0.88rem; word-break: break-word; }
.contact-form-wrap {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow);
}
.contact-form-wrap h2 { font-size: 1.35rem; font-weight: 800; margin-bottom: 0.35rem; }
.contact-form-wrap > p { color: var(--text-muted); font-size: 0.92rem; margin-bottom: 1.5rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-success {
  display: none;
  background: #f0fdf4;
  border: 1px solid #86efac;
  color: #166534;
  padding: 1rem 1.15rem;
  border-radius: var(--radius);
  margin-bottom: 1.25rem;
  font-size: 0.92rem;
}
.form-success.show { display: block; }
.contact-founder-note {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 2rem;
  padding: 1.15rem 1.25rem;
  background: var(--surface-soft);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
}
.contact-founder-note img {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border-light);
  flex-shrink: 0;
}
.contact-founder-note p { margin: 0; font-size: 0.88rem; color: var(--text-muted); line-height: 1.55; }
.contact-founder-note strong { color: var(--text); }

/* Legal pages */
.legal-content { max-width: 780px; margin: 0 auto; }
.legal-content h2 { font-size: 1.25rem; font-weight: 800; margin: 2rem 0 0.75rem; color: var(--text); }
.legal-content h3 { font-size: 1.05rem; font-weight: 700; margin: 1.25rem 0 0.5rem; color: var(--text); }
.legal-content p, .legal-content li { color: #334155; line-height: 1.75; }
.legal-content ul { margin: 0.75rem 0 1.25rem 1.5rem; }
.legal-content li { margin-bottom: 0.4rem; }
.last-updated { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 1.5rem; }
.breadcrumb { font-size: 0.88rem; margin-bottom: 0.75rem; opacity: 0.75; }
.breadcrumb a { color: var(--text-inv-muted); }
.breadcrumb a:hover { color: #fff; }
.footer-legal-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 1.25rem;
  padding-bottom: 1.25rem;
  position: relative;
  z-index: 1;
}
.footer-legal-links a {
  color: var(--text-inv-muted);
  font-size: 0.85rem;
  font-weight: 500;
}
.footer-legal-links a:hover { color: #fff; }

/* Cookie consent banner */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--border-light);
  padding: 1.15rem 1.25rem;
  box-shadow: 0 -8px 40px rgba(12, 18, 34, 0.1);
  z-index: 9999;
  display: none;
}
.cookie-banner.show { display: block; }
.cookie-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  flex-wrap: wrap;
}
.cookie-inner p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  flex: 1;
  min-width: 220px;
  line-height: 1.55;
}
.cookie-inner a { color: var(--primary); font-weight: 600; }
.cookie-buttons {
  display: flex;
  gap: 0.65rem;
  flex-shrink: 0;
}
.cookie-buttons .btn { padding: 0.65rem 1.25rem; font-size: 0.88rem; }
.cookie-decline {
  background: #f1f5f9;
  color: var(--text);
  border: 1px solid var(--border-light);
  border-radius: 50px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font);
  transition: 0.2s;
}
.cookie-decline:hover { background: #e2e8f0; }
body.has-cookie-banner { padding-bottom: 5.75rem; }

@media (min-width: 768px) {
  .team-grid {
    flex-wrap: nowrap;
    justify-content: stretch;
  }
  .team-card {
    flex: 1 1 0;
    max-width: none;
  }
}
@media (max-width: 960px) {
  .tutorial-layout { grid-template-columns: 1fr; }
  .toc { position: static; }
  .footer-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .founder-card { grid-template-columns: 1fr; text-align: center; }
  .founder-photo { max-width: 200px; margin: 0 auto; }
  .about-stats { grid-template-columns: repeat(2, 1fr); }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .contact-cards { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .menu-btn { display: block; }
  .nav {
    display: none; position: absolute; top: var(--header-h); left: 0; right: 0;
    background: var(--bg); flex-direction: column; padding: 1rem 1.25rem 1.5rem; gap: 0;
    border-bottom: 1px solid var(--border);
  }
  .nav.open { display: flex; }
  .nav li { width: 100%; }
  .nav a { display: block; padding: 0.75rem 0; border-bottom: 1px solid var(--border); }
  .hero { padding: 3rem 1.25rem; }
}

/* Live tutorial search */
.tutorial-search-wrap {
  max-width: 640px;
  margin: 0 auto 2rem;
}
.search-box {
  position: relative;
  display: flex;
  align-items: center;
}
.search-icon {
  position: absolute;
  left: 1rem;
  font-size: 1.1rem;
  pointer-events: none;
  opacity: 0.55;
}
.tutorial-search-input {
  width: 100%;
  padding: 0.95rem 2.75rem;
  border: 2px solid var(--border-light);
  border-radius: 14px;
  font-size: 1rem;
  font-family: var(--font);
  background: var(--surface);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.tutorial-search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12);
}
.search-clear {
  position: absolute;
  right: 0.75rem;
  background: #e2e8f0;
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
}
.search-clear:hover { background: #cbd5e1; color: var(--text); }
.search-status {
  text-align: center;
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-top: 0.65rem;
  min-height: 1.25rem;
}
#search-results:not([hidden]) + #pagination-wrap,
#tutorial-list[hidden] ~ #pagination-wrap { display: none !important; }
.search-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}
.search-empty strong { display: block; font-size: 1.1rem; color: var(--text); margin-bottom: 0.35rem; }

/* Pagination */
#pagination-wrap {
  margin-top: 2.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
}
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  width: 100%;
}
.page-numbers {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
  justify-content: center;
}
.page-btn,
.page-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  height: 2.5rem;
  padding: 0 0.75rem;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-light);
  transition: border-color 0.2s, background 0.2s, color 0.2s, transform 0.15s;
  text-decoration: none;
}
.page-num:hover,
.page-btn:not(.disabled):hover {
  border-color: var(--primary);
  color: var(--primary);
  background: #fafbff;
  transform: translateY(-1px);
}
.page-num.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  cursor: default;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}
.page-btn.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}
.page-ellipsis {
  min-width: 1.5rem;
  text-align: center;
  color: var(--text-muted);
  font-weight: 700;
  user-select: none;
}
.pagination-info {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-muted);
  text-align: center;
}
@media (max-width: 480px) {
  .stat-grid { grid-template-columns: 1fr; }
  .page-btn { min-width: auto; padding: 0 0.6rem; font-size: 0.82rem; }
  .page-num, .page-btn { min-width: 2.25rem; height: 2.25rem; }
}

/* 404 Error Page */
.error-page {
  min-height: calc(100vh - var(--header-h) - 120px);
  display: flex;
  align-items: center;
  padding: 3rem 0 4rem;
  background: linear-gradient(180deg, #eef2ff 0%, var(--surface-soft) 45%);
}
.error-inner {
  max-width: 560px;
  margin: 0 auto;
  text-align: center;
}
.error-code {
  font-size: clamp(4rem, 14vw, 7rem);
  font-weight: 800;
  line-height: 1;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.error-page h1 {
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 800;
  margin-bottom: 0.75rem;
  color: var(--text);
}
.error-lead {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-bottom: 1.75rem;
  line-height: 1.7;
}
.error-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 2.5rem;
}
.error-search p {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-bottom: 0.75rem;
}
.error-links {
  display: flex;
  gap: 0.65rem;
  justify-content: center;
  flex-wrap: wrap;
}
.error-links a {
  padding: 0.45rem 0.9rem;
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary);
}
.error-links a:hover {
  border-color: var(--primary);
  color: var(--accent);
}

/* Full Projects */
.project-featured {
  margin: 1.5rem 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border-light);
}
.project-featured img {
  width: 100%;
  height: auto;
  display: block;
}
.project-thumb.has-img {
  font-size: 0;
  padding: 0;
}
.project-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.project-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
}
.project-actions .btn { text-decoration: none; }

/* Full project detail page */
.tutorial-layout.project-layout {
  grid-template-columns: 1fr;
  max-width: var(--max);
}
.project-featured {
  margin: 0 0 1.5rem;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow);
}
.project-featured img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 420px;
  object-fit: cover;
}
.project-action-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin: 0 0 2rem;
  padding: 1.35rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}
.project-action-bar::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--gradient-brand);
}
.project-action-bar .btn {
  text-decoration: none;
  min-width: 10rem;
  justify-content: center;
}
.project-content h1 {
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  margin: 2rem 0 1rem;
}
.project-content li p { margin: 0.25rem 0; }
.project-content thead td {
  background: #f1f5f9;
  font-weight: 700;
  color: var(--text);
}
.project-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0 1.5rem;
  font-size: 0.92rem;
}
.project-content th,
.project-content td {
  border: 1px solid var(--border-light);
  padding: 0.65rem 0.85rem;
  text-align: left;
  vertical-align: top;
}
