/* ===== HELPBOOK DESIGN SYSTEM ===== */
@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600&family=Inter:wght@400;500;600&display=swap");

:root {
  --bg-primary: #0d0f18;
  --bg-secondary: #131624;
  --bg-card: #181c2e;
  --bg-elevated: #1e2235;
  --border: #252a3d;
  --border-light: #2e354f;

  --text-primary: #eef0f8;
  --text-secondary: #8b91b0;
  --text-muted: #565d7e;

  --accent-blue: #4f7eff;
  --accent-purple: #9b5cff;
  --accent-cyan: #00d4c8;
  --accent-green: #2ecc71;
  --accent-orange: #ff7b45;
  --accent-pink: #ff4f9e;

  --gradient-hero: linear-gradient(
    135deg,
    #4f7eff 0%,
    #9b5cff 50%,
    #ff4f9e 100%
  );
  --gradient-card: linear-gradient(135deg, #1e2235 0%, #181c2e 100%);
  --gradient-btn: linear-gradient(135deg, #4f7eff, #9b5cff);

  --font-display: "Space Grotesk", sans-serif;
  --font-body: "Inter", sans-serif;
  --font-mono: "JetBrains Mono", monospace;

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;

  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.35);
  --shadow-glow: 0 0 40px rgba(79, 126, 255, 0.15);
}

[data-theme="light"] {
  --bg-primary: #f5f7ff;
  --bg-secondary: #eef0fa;
  --bg-card: #ffffff;
  --bg-elevated: #f0f2fc;
  --border: #dde1f5;
  --border-light: #c8cee8;
  --text-primary: #0d0f18;
  --text-secondary: #4a5080;
  --text-muted: #8b91b0;
  --shadow-card: 0 4px 24px rgba(79, 126, 255, 0.08);
  --shadow-glow: 0 0 40px rgba(79, 126, 255, 0.08);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  transition:
    background 0.3s,
    color 0.3s;
  overflow-x: hidden;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}
::-webkit-scrollbar-thumb {
  background: var(--accent-blue);
  border-radius: 3px;
}

/* ===== NAVBAR ===== */
.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
  background: rgba(13, 15, 24, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background 0.3s;
}
[data-theme="light"] .navbar {
  background: rgba(245, 247, 255, 0.85);
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.nav-logo {
  width: 36px;
  height: 36px;
  background: var(--gradient-btn);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  color: #fff;
  font-size: 16px;
}
.nav-brand-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--text-primary);
}
.nav-brand-text span {
  color: var(--accent-blue);
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
}
.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s;
}
.nav-links a:hover,
.nav-links a.active {
  color: var(--text-primary);
  background: var(--bg-elevated);
}
.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.btn-theme {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 0.45rem 0.7rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s;
  line-height: 1;
}
.btn-theme:hover {
  color: var(--text-primary);
  border-color: var(--accent-blue);
}
.btn-primary {
  background: var(--gradient-btn);
  color: #fff;
  padding: 0.5rem 1.2rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  font-family: var(--font-body);
}
.btn-primary:hover {
  opacity: 0.88;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(79, 126, 255, 0.4);
}
.hamburger {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
}

/* ===== MOBILE NAV ===== */
.mobile-menu {
  display: none;
  position: fixed;
  top: 64px;
  left: 0;
  right: 0;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  padding: 1rem 2rem;
  z-index: 999;
  flex-direction: column;
  gap: 0.5rem;
}
.mobile-menu.open {
  display: flex;
}
.mobile-menu a {
  color: var(--text-secondary);
  text-decoration: none;
  padding: 0.6rem 0;
  font-weight: 500;
  border-bottom: 1px solid var(--border);
}
.mobile-menu a:last-child {
  border-bottom: none;
}

/* ===== MAIN LAYOUT ===== */
main {
  padding-top: 64px;
}
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}
.section {
  padding: 5rem 0;
}
.section-sm {
  padding: 3rem 0;
}

/* ===== HERO ===== */
.hero {
  min-height: calc(100vh - 64px);
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  background: var(--bg-primary);
}
.hero-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.hero-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.12;
}
.orb-1 {
  width: 600px;
  height: 600px;
  background: var(--accent-blue);
  top: -200px;
  right: -100px;
}
.orb-2 {
  width: 400px;
  height: 400px;
  background: var(--accent-purple);
  bottom: -100px;
  left: -50px;
}
.orb-3 {
  width: 300px;
  height: 300px;
  background: var(--accent-pink);
  top: 40%;
  right: 20%;
}
.hero-content {
  position: relative;
  z-index: 1;
  max-width: 780px;
}
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(79, 126, 255, 0.1);
  border: 1px solid rgba(79, 126, 255, 0.3);
  color: var(--accent-blue);
  padding: 0.35rem 1rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}
.hero-eyebrow::before {
  content: "✦";
  font-size: 0.7rem;
}
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5vw, 4rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
}
.hero-title .highlight {
  background: var(--gradient-hero);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-sub {
  font-size: 1.125rem;
  color: var(--text-secondary);
  max-width: 560px;
  margin-bottom: 2.5rem;
  line-height: 1.7;
}
.hero-cta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 3rem;
}
.btn-outline {
  background: transparent;
  border: 1px solid var(--border-light);
  color: var(--text-primary);
  padding: 0.6rem 1.4rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
  cursor: pointer;
  font-family: var(--font-body);
}
.btn-outline:hover {
  border-color: var(--accent-blue);
  color: var(--accent-blue);
  background: rgba(79, 126, 255, 0.05);
}
.btn-lg {
  padding: 0.75rem 1.8rem;
  font-size: 1rem;
  border-radius: var(--radius-md);
}
.hero-stats {
  display: flex;
  gap: 2.5rem;
  flex-wrap: wrap;
}
.hero-stat {
}
.hero-stat-num {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-primary);
}
.hero-stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ===== TECH PILLS ===== */
.tech-strip {
  padding: 2rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--bg-secondary);
  overflow: hidden;
}
.tech-pills {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
}
.tech-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 0.5rem 1rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  color: var(--text-secondary);
  transition: all 0.2s;
  white-space: nowrap;
}
.tech-pill:hover {
  border-color: var(--accent-blue);
  color: var(--accent-blue);
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}
.tech-pill .pill-icon {
  font-size: 1.1rem;
}

/* ===== SECTION HEADER ===== */
.section-header {
  text-align: center;
  margin-bottom: 3rem;
}
.section-label {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-blue);
  margin-bottom: 0.75rem;
}
.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}
.section-sub {
  color: var(--text-secondary);
  font-size: 1rem;
  max-width: 500px;
  margin: 0 auto;
}

/* ===== TUTORIAL CARDS ===== */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 1.5rem;
}
.tutorial-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all 0.25s;
  cursor: pointer;
  text-decoration: none;
  display: flex;
  flex-direction: column;
}
.tutorial-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-blue);
  box-shadow: var(--shadow-glow);
}
.card-banner {
  height: 140px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.5rem;
}
.card-banner::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 50%, var(--bg-card));
}
.card-body {
  padding: 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.card-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}
.badge {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
}
.badge-beginner {
  background: rgba(46, 204, 113, 0.15);
  color: var(--accent-green);
}
.badge-intermediate {
  background: rgba(255, 123, 69, 0.15);
  color: var(--accent-orange);
}
.badge-advanced {
  background: rgba(255, 79, 158, 0.15);
  color: var(--accent-pink);
}
.card-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}
.card-desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
  flex: 1;
}
.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border);
  margin-top: auto;
}
.card-info {
  display: flex;
  gap: 1rem;
}
.card-info-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.78rem;
  color: var(--text-muted);
}
.card-arrow {
  color: var(--accent-blue);
  font-size: 1.1rem;
  transition: transform 0.2s;
}
.tutorial-card:hover .card-arrow {
  transform: translateX(4px);
}

/* ===== SEARCH BAR ===== */
.search-wrap {
  position: relative;
  max-width: 560px;
  margin: 0 auto 3rem;
}
.search-input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 0.85rem 1.25rem 0.85rem 3rem;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-family: var(--font-body);
  transition: border-color 0.2s;
  outline: none;
}
.search-input::placeholder {
  color: var(--text-muted);
}
.search-input:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(79, 126, 255, 0.1);
}
.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1rem;
  pointer-events: none;
}
.search-clear {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  display: none;
  padding: 0;
  line-height: 1;
}
.search-clear.visible {
  display: block;
}

/* ===== FILTER TABS ===== */
.filter-tabs {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}
.filter-tab {
  padding: 0.45rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}
.filter-tab:hover,
.filter-tab.active {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
  color: #fff;
}

/* ===== RECENT SECTION ===== */
.recent-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.recent-item {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  text-decoration: none;
  transition: all 0.2s;
  color: var(--text-primary);
}
.recent-item:hover {
  border-color: var(--accent-blue);
  transform: translateX(4px);
}
.recent-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}
.recent-content {
  flex: 1;
  min-width: 0;
}
.recent-title {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.2rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.recent-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
}
.recent-arrow {
  color: var(--text-muted);
  transition: all 0.2s;
}
.recent-item:hover .recent-arrow {
  color: var(--accent-blue);
  transform: translateX(3px);
}

/* ===== TUTORIAL PAGE ===== */
.tutorial-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 2rem;
  align-items: start;
}
.tutorial-content {
  min-width: 0;
}
.tutorial-sidebar {
  position: sticky;
  top: 80px;
}

.toc-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.toc-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 1rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.toc-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.toc-list a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  padding: 0.3rem 0.5rem;
  border-radius: var(--radius-sm);
  display: block;
  transition: all 0.15s;
  border-left: 2px solid transparent;
}
.toc-list a:hover,
.toc-list a.active {
  color: var(--accent-blue);
  background: rgba(79, 126, 255, 0.06);
  border-left-color: var(--accent-blue);
}

.tutorial-header {
  margin-bottom: 2.5rem;
}
.tutorial-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.tutorial-breadcrumb a {
  color: var(--text-muted);
  text-decoration: none;
}
.tutorial-breadcrumb a:hover {
  color: var(--accent-blue);
}
.tutorial-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}
.tutorial-desc {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.7;
  margin-bottom: 1.5rem;
}
.tutorial-meta-bar {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding: 1rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 2rem;
}
.tmeta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.825rem;
  color: var(--text-muted);
}
.tmeta-val {
  color: var(--text-secondary);
  font-weight: 500;
}

/* ===== PROSE ===== */
.prose h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  margin: 2.5rem 0 1rem;
  letter-spacing: -0.01em;
  border-left: 3px solid var(--accent-blue);
  padding-left: 1rem;
}
.prose h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  margin: 2rem 0 0.75rem;
  color: var(--text-secondary);
}
.prose p {
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 1.25rem;
}
.prose ul,
.prose ol {
  color: var(--text-secondary);
  padding-left: 1.5rem;
  margin-bottom: 1.25rem;
  line-height: 1.8;
}
.prose li {
  margin-bottom: 0.35rem;
}
.prose strong {
  color: var(--text-primary);
  font-weight: 600;
}
.prose a {
  color: var(--accent-blue);
  text-decoration: none;
}
.prose a:hover {
  text-decoration: underline;
}

/* ===== CODE BLOCKS ===== */
.code-block {
  background: #0a0c14;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin: 1.5rem 0;
  overflow: hidden;
}
.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 1rem;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--border);
}
.code-lang {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}
.code-copy {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font-body);
}
.code-copy:hover {
  color: var(--text-primary);
  border-color: var(--accent-blue);
}
.code-copy.copied {
  color: var(--accent-green);
  border-color: var(--accent-green);
}
pre {
  padding: 1.25rem;
  overflow-x: auto;
}
code {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.7;
}
.prose code:not(pre code) {
  background: rgba(79, 126, 255, 0.1);
  color: var(--accent-blue);
  padding: 0.1em 0.4em;
  border-radius: 4px;
  font-size: 0.875em;
}

/* Syntax highlighting */
.kw {
  color: #c792ea;
}
.fn {
  color: #82aaff;
}
.str {
  color: #c3e88d;
}
.cmt {
  color: #546e7a;
  font-style: italic;
}
.num {
  color: #f78c6c;
}
.tag {
  color: #f07178;
}
.attr {
  color: #ffcb6b;
}
.val {
  color: #c3e88d;
}
.prop {
  color: #82aaff;
}
.pun {
  color: #89ddff;
}

/* ===== TRY IT EDITOR ===== */
.editor-section {
  margin: 2.5rem 0;
}
.editor-tabs {
  display: flex;
  gap: 0;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-bottom: none;
}
.editor-tab {
  flex: 1;
  padding: 0.65rem 1rem;
  background: var(--bg-elevated);
  border: none;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-family: var(--font-mono);
  cursor: pointer;
  transition: all 0.15s;
  border-right: 1px solid var(--border);
  font-weight: 500;
}
.editor-tab:last-child {
  border-right: none;
}
.editor-tab.active {
  background: var(--bg-card);
  color: var(--text-primary);
}
.editor-panes {
  display: none;
}
.editor-panes.active {
  display: block;
}
.editor-pane textarea {
  width: 100%;
  height: 200px;
  background: #0a0c14;
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  padding: 1rem;
  resize: vertical;
  outline: none;
  line-height: 1.6;
}
.editor-run {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-top: none;
}
.editor-output {
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  overflow: hidden;
}
.editor-output iframe {
  width: 100%;
  height: 300px;
  border: none;
  background: #fff;
}

/* ===== RATING ===== */
.rating-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin: 2.5rem 0;
  display: flex;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
}
.rating-label {
  font-weight: 600;
  font-size: 0.9rem;
}
.rating-btns {
  display: flex;
  gap: 0.75rem;
}
.btn-like,
.btn-dislike {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 600;
  transition: all 0.2s;
  font-family: var(--font-body);
}
.btn-like:hover,
.btn-like.active {
  background: rgba(46, 204, 113, 0.1);
  border-color: var(--accent-green);
  color: var(--accent-green);
}
.btn-dislike:hover,
.btn-dislike.active {
  background: rgba(255, 79, 158, 0.1);
  border-color: var(--accent-pink);
  color: var(--accent-pink);
}

/* ===== COMMENTS ===== */
.comments-section {
  margin: 2.5rem 0;
}
.comments-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
}
.comment-form {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 2rem;
}
.comment-form textarea {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.9rem;
  resize: none;
  height: 100px;
  outline: none;
  transition: border-color 0.2s;
  margin-bottom: 1rem;
}
.comment-form textarea:focus {
  border-color: var(--accent-blue);
}
.comment-item {
  display: flex;
  gap: 1rem;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border);
}
.comment-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--gradient-btn);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
  color: #fff;
}
.comment-body-wrap {
  flex: 1;
}
.comment-author {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}
.comment-date {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-left: 0.5rem;
  font-weight: 400;
}
.comment-text {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ===== PROGRESS ===== */
.progress-bar-wrap {
  background: var(--border);
  border-radius: 999px;
  height: 6px;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  border-radius: 999px;
  background: var(--gradient-btn);
  transition: width 0.5s ease;
}

/* ===== ABOUT PAGE ===== */
.about-hero {
  padding: 5rem 0;
}
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}
.about-feature-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-top: 2rem;
}
.about-feature {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}
.about-feature-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}
.about-feature-title {
  font-weight: 600;
  margin-bottom: 0.25rem;
}
.about-feature-desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
}
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-top: 3rem;
}
.team-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  text-align: center;
  transition: all 0.2s;
}
.team-card:hover {
  border-color: var(--accent-blue);
  transform: translateY(-3px);
}
.team-avatar {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: var(--gradient-btn);
  margin: 0 auto 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
}
.team-name {
  font-family: var(--font-display);
  font-weight: 700;
  margin-bottom: 0.25rem;
}
.team-role {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ===== DASHBOARD ===== */
.dash-grid {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 2rem;
  align-items: start;
}
.dash-nav {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem;
  position: sticky;
  top: 80px;
}
.dash-nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.9rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s;
  cursor: pointer;
  background: none;
  border: none;
  width: 100%;
  font-family: var(--font-body);
}
.dash-nav-item:hover,
.dash-nav-item.active {
  background: var(--bg-elevated);
  color: var(--text-primary);
}
.dash-nav-item.active {
  color: var(--accent-blue);
}
.dash-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}
.dash-stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}
.dash-stat-icon {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}
.dash-stat-val {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
}
.dash-stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}
.dash-section-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 1.25rem;
}
.dash-panel {
  display: none;
}
.dash-panel.active {
  display: block;
}

/* ===== FOOTER ===== */
footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 4rem 0 2rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
}
.footer-brand-desc {
  color: var(--text-muted);
  font-size: 0.875rem;
  line-height: 1.7;
  margin-top: 0.75rem;
}
.footer-heading {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}
.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  transition: color 0.2s;
}
.footer-links a:hover {
  color: var(--accent-blue);
}
.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}
.footer-copy {
  font-size: 0.8rem;
  color: var(--text-muted);
}
.footer-socials {
  display: flex;
  gap: 0.75rem;
}
.social-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  text-decoration: none;
  transition: all 0.2s;
}
.social-btn:hover {
  border-color: var(--accent-blue);
  color: var(--accent-blue);
}

/* ===== TOAST ===== */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 9999;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  box-shadow: var(--shadow-card);
  font-size: 0.875rem;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.toast.show {
  transform: translateY(0);
  opacity: 1;
}
.toast-icon {
  font-size: 1.1rem;
}

/* ===== UTILS ===== */
.hidden {
  display: none !important;
}
.text-gradient {
  background: var(--gradient-hero);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.mt-1 {
  margin-top: 0.5rem;
}
.mt-2 {
  margin-top: 1rem;
}
.mt-3 {
  margin-top: 1.5rem;
}
.mt-4 {
  margin-top: 2rem;
}
.no-results {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-muted);
}
.no-results h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .tutorial-layout {
    grid-template-columns: 1fr;
  }
  .tutorial-sidebar {
    position: static;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
  }
  .dash-grid {
    grid-template-columns: 1fr;
  }
  .dash-nav {
    position: static;
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
  }
  .dash-nav-item {
    flex: 1;
    min-width: 130px;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 768px) {
  .navbar {
    padding: 0 1rem;
  }
  .nav-links,
  .nav-actions .btn-primary {
    display: none;
  }
  .hamburger {
    display: block;
  }
  .hero-stats {
    gap: 1.5rem;
  }
  .cards-grid {
    grid-template-columns: 1fr;
  }
  .about-grid {
    grid-template-columns: 1fr;
  }
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }
  .tutorial-sidebar {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 480px) {
  .container {
    padding: 0 1rem;
  }
  .section {
    padding: 3rem 0;
  }
  .hero {
    min-height: auto;
    padding: 3rem 0;
  }
  .hero-cta {
    flex-direction: column;
  }
  .btn-lg {
    text-align: center;
  }
}

/* ===== ANIMATIONS ===== */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes pulse {
  0%,
  100% {
    opacity: 0.12;
  }
  50% {
    opacity: 0.2;
  }
}
.orb-1,
.orb-2,
.orb-3 {
  animation: pulse 6s ease-in-out infinite;
}
.orb-2 {
  animation-delay: -2s;
}
.orb-3 {
  animation-delay: -4s;
}
.fade-up {
  animation: fadeUp 0.6s ease both;
}
.fade-up-1 {
  animation-delay: 0.1s;
}
.fade-up-2 {
  animation-delay: 0.2s;
}
.fade-up-3 {
  animation-delay: 0.3s;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ===== FONT AWESOME ICON SPACING ===== */
.fa,
.fas,
.far,
.fab {
  margin-right: 0.25rem;
}

.btn-theme .fa,
.btn-theme .fas,
.btn-theme .far,
.btn-theme .fab,
.hamburger .fa,
.hamburger .fas,
.search-icon .fa,
.search-icon .fas,
.card-arrow .fa,
.card-arrow .fas,
.recent-arrow .fa,
.recent-arrow .fas {
  margin-right: 0;
}

.card-banner span i {
  font-size: 3rem;
  margin-right: 0;
}

.recent-icon i {
  font-size: 1.4rem;
  margin-right: 0;
}

.dash-stat-icon i {
  font-size: 1.5rem;
  margin-right: 0;
}

.tech-pill .pill-icon i {
  margin-right: 0;
}

.about-feature-icon i {
  font-size: 1.25rem;
  margin-right: 0;
}

/* --- Base responsive adjustments --- */
@media (max-width: 768px) {

    /* Container padding for all pages */
    .container {
        padding: 0 1rem !important;
    }

    /* Reduce section padding */
    .section {
        padding: 2rem 0 !important;
    }

    /* Better touch targets */
    button,
    .btn-primary,
    .btn-outline,
    .filter-tab,
    .dash-nav-item {
        cursor: pointer;
        min-height: 44px;
        /* Apple's recommended minimum touch target */
    }
    
    /* Dashboard grid to single column */
    .dash-grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }

    /* Dashboard nav - horizontal scrollable */
    .dash-nav {
        position: static !important;
        display: flex !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        gap: 0.5rem !important;
        padding: 0.6rem !important;
        margin-bottom: 0.5rem !important;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        background: var(--bg-card);
        border-radius: var(--radius-md);
    }

    .dash-nav::-webkit-scrollbar {
        height: 3px;
    }

    .dash-nav-item {
        flex-shrink: 0 !important;
        white-space: nowrap !important;
        min-width: auto !important;
        padding: 0.5rem 1rem !important;
        font-size: 0.85rem !important;
        border-radius: 40px !important;
        border: 1px solid var(--border) !important;
    }

    /* Stat cards - 2 column grid */
    .dash-stat-grid {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.75rem !important;
        margin-bottom: 1.25rem !important;
    }

    .dash-stat-card {
        padding: 1rem !important;
        text-align: center !important;
    }

    .dash-stat-icon {
        font-size: 1.25rem !important;
        margin-bottom: 0.25rem !important;
    }

    .dash-stat-val {
        font-size: 1.5rem !important;
    }

    .dash-stat-label {
        font-size: 0.7rem !important;
    }

    /* Progress bar cards */
    div[style*="background:var(--bg-card)"][style*="border-radius:var(--radius-md)"] {
        padding: 1rem !important;
        margin-bottom: 1rem !important;
    }

    .dash-section-title {
        font-size: 1rem !important;
        margin-bottom: 0.75rem !important;
    }

    /* Tech breakdown */
    #techBreakdown {
        gap: 0.75rem !important;
    }

    /* All tutorials list items */
    #allTutorialsProgress>div,
    #bookmarksList>div {
        flex-wrap: wrap !important;
        gap: 0.75rem !important;
        padding: 0.85rem !important;
    }

    #allTutorialsProgress>div>div:first-child,
    #bookmarksList>div>div:first-child {
        flex: 1 !important;
        min-width: 120px;
    }

    #allTutorialsProgress>div>div:last-child,
    #bookmarksList>div>div:last-child {
        width: 100% !important;
        display: flex !important;
        gap: 0.5rem !important;
        justify-content: flex-end !important;
    }

    #allTutorialsProgress .btn-outline,
    #bookmarksList .btn-outline {
        flex: 1 !important;
        text-align: center !important;
        justify-content: center !important;
        padding: 0.5rem !important;
        font-size: 0.8rem !important;
    }

    /* Activity log items */
    #activityLog>div {
        padding: 0.7rem !important;
        gap: 0.6rem !important;
    }

    #activityLog>div>span:first-child {
        font-size: 1rem !important;
    }

    #activityLog>div>div {
        flex: 1;
    }

    /* Settings panel */
    #panel-settings>div {
        padding: 1rem !important;
        margin-bottom: 1rem !important;
    }

    #panel-settings>div>div:first-child {
        font-size: 1rem !important;
    }

    #panel-settings>div p {
        font-size: 0.8rem !important;
        margin-bottom: 0.75rem !important;
    }

    #panel-settings>div>div:last-child {
        flex-direction: column !important;
        gap: 0.5rem !important;
    }

    #setDark,
    #setLight,
    #resetProgressBtn,
    #clearBookmarksBtn {
        width: 100% !important;
        justify-content: center !important;
        padding: 0.6rem !important;
    }

    /* Empty states */
    .no-results {
        padding: 2rem 1rem !important;
    }

    .no-results h3 {
        font-size: 1rem !important;
    }

    /* Page header */
    .container.section>div:first-child {
        margin-bottom: 1.25rem !important;
    }

    .container.section>div:first-child h1 {
        font-size: 1.6rem !important;
        line-height: 1.2;
    }

    /* Recent completed items */
    #recentCompleted>div {
        flex-wrap: wrap !important;
        gap: 0.6rem !important;
        padding: 0.8rem !important;
    }

    #recentCompleted>div>div:first-child {
        width: 36px !important;
        height: 36px !important;
        font-size: 1rem !important;
    }

    #recentCompleted>div>div:nth-child(2) {
        flex: 1 !important;
        min-width: 120px;
    }

    /* Toast positioning */
    .toast {
        bottom: 1rem !important;
        right: 1rem !important;
        left: 1rem !important;
        font-size: 0.8rem !important;
        padding: 0.7rem 1rem !important;
    }

    /* Footer adjustments */
    .footer-bottom {
        flex-direction: column !important;
        text-align: center !important;
        gap: 0.75rem !important;
    }
}

/* --- Extra small devices (≤ 480px) --- */
@media (max-width: 480px) {

    /* Even tighter spacing */
    .container {
        padding: 0 0.75rem !important;
    }

    .tutorial-title {
        font-size: 1.35rem !important;
    }

    .prose h2 {
        font-size: 1.15rem !important;
    }

    .prose h3 {
        font-size: 0.95rem !important;
    }

    /* Editor tabs - even smaller text */
    .editor-tab {
        font-size: 0.65rem !important;
        padding: 0.5rem 0.2rem !important;
    }

    /* Stat cards - single column on very tiny? keep 2 but shrink */
    .dash-stat-grid {
        gap: 0.5rem !important;
    }

    .dash-stat-card {
        padding: 0.7rem !important;
    }

    .dash-stat-val {
        font-size: 1.25rem !important;
    }

    /* Button text */
    .btn-primary,
    .btn-outline {
        font-size: 0.8rem !important;
        padding: 0.5rem 0.75rem !important;
    }
}

/* --- Fix for iPhone notch / dynamic island --- */
@supports (padding: max(0px)) {
    .navbar {
        padding-left: max(1rem, env(safe-area-inset-left)) !important;
        padding-right: max(1rem, env(safe-area-inset-right)) !important;
    }

    .container {
        padding-left: max(1rem, env(safe-area-inset-left)) !important;
        padding-right: max(1rem, env(safe-area-inset-right)) !important;
    }

    .toast {
        bottom: max(1rem, env(safe-area-inset-bottom)) !important;
        right: max(1rem, env(safe-area-inset-right)) !important;
        left: max(1rem, env(safe-area-inset-left)) !important;
    }
}

/* --- Landscape orientation fixes for mobile --- */
@media (max-width: 896px) and (orientation: landscape) {

    /* Reduce heights in landscape */
    .editor-pane textarea {
        height: 100px !important;
    }

    .editor-output iframe {
        height: 150px !important;
    }

    .comment-form textarea {
        height: 60px !important;
    }

    .hero {
        min-height: auto !important;
        padding: 2rem 0 !important;
    }
}
