/* ==========================================================================
   Silverhawk tWebLearn — stylesheet
   Design tokens: deep navy + electric blue + sky accent, editor/code motif
   ========================================================================== */

:root {
  /* Color tokens */
  --navy-950: #050b17;
  --navy-900: #0a1428;
  --navy-800: #0f1c38;
  --navy-700: #16274a;
  --blue-600: #2f5fff;
  --blue-500: #3f6bff;
  --blue-400: #5b8cff;
  --sky-300: #7fd3ff;
  --sky-200: #b3e6ff;
  --ice-50: #f4f8ff;
  --ice-100: #e8f0fe;
  --ink-900: #0a1224;
  --ink-700: #24304a;
  --slate-500: #5b6b8c;
  --slate-300: #9db1d6;
  --line: rgba(140, 170, 230, 0.16);
  --line-soft: rgba(140, 170, 230, 0.09);

  /* Typography */
  --font-display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;

  /* Fluid spacing */
  --space-section: clamp(3.5rem, 3rem + 3vw, 7rem);
  --space-gap: clamp(1rem, 0.8rem + 1vw, 2rem);
  --radius-lg: 22px;
  --radius-md: 14px;
  --radius-sm: 8px;
  --container: min(1180px, 92vw);
  --shadow-soft: 0 20px 60px -30px rgba(6, 14, 34, 0.55);
}

[data-theme="light"] {
  --bg-page: var(--ice-50);
  --bg-panel: #ffffff;
  --bg-panel-2: #eef3ff;
  --text-primary: var(--ink-900);
  --text-secondary: var(--slate-500);
  --border-color: rgba(47, 95, 255, 0.14);
  --nav-bg: rgba(244, 248, 255, 0.78);
  --editor-bg: #0a1428;
  --editor-text: var(--ice-100);
}

[data-theme="dark"] {
  --bg-page: var(--navy-950);
  --bg-panel: var(--navy-900);
  --bg-panel-2: var(--navy-800);
  --text-primary: var(--ice-100);
  --text-secondary: var(--slate-300);
  --border-color: var(--line);
  --nav-bg: rgba(5, 11, 23, 0.72);
  --editor-bg: #060d1c;
  --editor-text: var(--ice-100);
}

/* ==========================================================================
   Reset
   ========================================================================== */
*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  margin: 0;
  background: var(--bg-page);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.06rem);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background 0.35s ease, color 0.35s ease;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
ul { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4 { font-family: var(--font-display); margin: 0; line-height: 1.15; letter-spacing: -0.01em; }
p { margin: 0; }
input, textarea { font: inherit; }

:focus-visible {
  outline: 2px solid var(--sky-300);
  outline-offset: 3px;
  border-radius: 4px;
}

.container { width: var(--container); margin-inline: auto; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  color: var(--sky-300);
  background: rgba(63, 107, 255, 0.12);
  border: 1px solid rgba(63, 107, 255, 0.28);
  padding: 0.35em 0.85em;
  border-radius: 999px;
}
.eyebrow::before { content: "<"; opacity: 0.6; }
.eyebrow::after { content: "/>"; opacity: 0.6; }

.section-head { max-width: 640px; margin-bottom: clamp(2rem, 1.6rem + 1.6vw, 3.2rem); }
.section-head h2 { font-size: clamp(1.7rem, 1.4rem + 1.6vw, 2.6rem); margin-top: 0.6em; }
.section-head p { color: var(--text-secondary); margin-top: 0.9em; font-size: 1.02rem; }
.section-head.center { margin-inline: auto; text-align: center; }

section { padding-block: var(--space-section); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.96rem;
  padding: 0.85em 1.5em;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px) scale(0.99); }
.btn-primary {
  background: linear-gradient(135deg, var(--blue-600), var(--blue-400));
  color: #fff;
  box-shadow: 0 14px 30px -12px rgba(47, 95, 255, 0.65);
}
.btn-primary:hover { box-shadow: 0 18px 36px -12px rgba(47, 95, 255, 0.8); transform: translateY(-2px); }
.btn-ghost {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--border-color);
}
.btn-ghost:hover { border-color: var(--blue-400); color: var(--blue-400); }
.btn-sm { padding: 0.6em 1.1em; font-size: 0.86rem; }
.btn-block { width: 100%; justify-content: center; }

/* ==========================================================================
   Skip link
   ========================================================================== */
.skip-link {
  position: absolute;
  left: 1rem; top: -3rem;
  background: var(--blue-600);
  color: #fff;
  padding: 0.7em 1.2em;
  border-radius: var(--radius-sm);
  z-index: 200;
  transition: top 0.2s ease;
}
.skip-link:focus { top: 1rem; }

/* ==========================================================================
   Progress bar
   ========================================================================== */
.progress-bar {
  position: fixed; top: 0; left: 0; height: 3px; width: 0%;
  background: linear-gradient(90deg, var(--blue-500), var(--sky-300));
  z-index: 999;
  transition: width 0.1s linear;
}

/* ==========================================================================
   Navbar
   ========================================================================== */
.navbar {
  position: sticky; top: 0; z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--border-color);
}
.navbar .container {
  display: flex; align-items: center; justify-content: space-between;
  padding-block: 0.9rem;
}
.brand { display: flex; align-items: center; gap: 0.6rem; font-family: var(--font-display); }
.brand-mark {
  width: 38px; height: 38px; border-radius: 10px;
  background: linear-gradient(135deg, var(--blue-600), var(--sky-300));
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 20px -8px rgba(47, 95, 255, 0.7);
  flex-shrink: 0;
}
.brand-name { font-weight: 700; font-size: 1.08rem; color: var(--text-primary); }
.brand-name small { display: block; font-family: var(--font-mono); font-weight: 400; font-size: 0.66rem; color: var(--sky-300); letter-spacing: 0.05em; }

.nav-links {
  display: flex; align-items: center; gap: clamp(0.6rem, 1vw, 1.7rem);
}
.nav-links a {
  font-size: 0.92rem; color: var(--text-secondary);
  padding: 0.4em 0.2em; position: relative;
  transition: color 0.2s ease;
}
.nav-links a::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: -2px; height: 2px;
  background: var(--sky-300); transition: right 0.25s ease;
}
.nav-links a:hover, .nav-links a.active { color: var(--text-primary); }
.nav-links a:hover::after, .nav-links a.active::after { right: 0; }

.nav-actions { display: flex; align-items: center; gap: 0.6rem; }

.theme-toggle {
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--border-color); background: var(--bg-panel);
  display: flex; align-items: center; justify-content: center; color: var(--text-primary);
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.theme-toggle:hover { border-color: var(--blue-400); transform: rotate(12deg); }
.theme-toggle svg { width: 18px; height: 18px; }
[data-theme="dark"] .icon-sun { display: block; }
[data-theme="dark"] .icon-moon { display: none; }
[data-theme="light"] .icon-sun { display: none; }
[data-theme="light"] .icon-moon { display: block; }

.nav-toggle {
  display: none;
  width: 40px; height: 40px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-color); background: var(--bg-panel);
  flex-direction: column; align-items: center; justify-content: center; gap: 4px;
}
.nav-toggle span { width: 18px; height: 2px; background: var(--text-primary); border-radius: 2px; transition: 0.25s ease; }
.nav-toggle.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  padding-block: clamp(3rem, 2.4rem + 3vw, 6rem) clamp(3rem, 2rem + 4vw, 6.5rem);
  position: relative;
  overflow: clip;
  background:
    radial-gradient(60% 55% at 85% 0%, rgba(47, 95, 255, 0.22), transparent 60%),
    radial-gradient(45% 45% at 5% 15%, rgba(127, 211, 255, 0.14), transparent 60%);
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(2rem, 1.5rem + 2.5vw, 4rem);
  align-items: center;
}
.hero-copy h1 {
  font-size: clamp(2.1rem, 1.6rem + 2.6vw, 3.6rem);
  margin-top: 0.7em;
}
.hero-copy h1 .accent {
  background: linear-gradient(100deg, var(--blue-500), var(--sky-300));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-copy p.lead {
  margin-top: 1.1em; color: var(--text-secondary); font-size: 1.08rem; max-width: 46ch;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.9rem; margin-top: 2rem; }

.tech-pills { display: flex; flex-wrap: wrap; gap: 0.55rem; margin-top: 2.2rem; }
.tech-pill {
  font-family: var(--font-mono); font-size: 0.76rem; color: var(--text-secondary);
  border: 1px solid var(--border-color); padding: 0.4em 0.8em; border-radius: 999px;
  background: var(--bg-panel);
}

.hero-stats {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 0.8rem; margin-top: clamp(2rem, 1.6rem + 1.5vw, 3rem);
  padding-top: clamp(1.4rem, 1.2rem + 1vw, 2rem);
  border-top: 1px solid var(--border-color);
}
.stat b {
  display: block; font-family: var(--font-display); font-size: clamp(1.3rem, 1.1rem + 1vw, 1.9rem);
  color: var(--text-primary);
}
.stat span { font-size: 0.78rem; color: var(--text-secondary); }

/* --- Editor mockup (signature element) --- */
.editor-window {
  background: var(--editor-bg);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(127, 211, 255, 0.18);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  transform: perspective(1200px) rotateY(-6deg) rotateX(2deg);
  transition: transform 0.4s ease;
}
.editor-window:hover { transform: perspective(1200px) rotateY(-2deg) rotateX(1deg); }
.editor-titlebar {
  display: flex; align-items: center; gap: 1rem;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(127, 211, 255, 0.12);
}
.editor-dots { display: flex; gap: 6px; }
.editor-dots span { width: 10px; height: 10px; border-radius: 50%; display: block; }
.editor-dots span:nth-child(1) { background: #ff6159; }
.editor-dots span:nth-child(2) { background: #ffbd2e; }
.editor-dots span:nth-child(3) { background: #28ca41; }
.editor-tabs { display: flex; gap: 0.4rem; font-family: var(--font-mono); font-size: 0.74rem; color: var(--slate-300); }
.editor-tabs span {
  padding: 0.3em 0.7em; border-radius: 6px 6px 0 0;
}
.editor-tabs span.current { background: var(--navy-800); color: var(--sky-200); }
.editor-body { padding: 1.4rem 1.5rem 1.6rem; font-family: var(--font-mono); font-size: 0.86rem; color: var(--editor-text); }
.editor-body .ln { color: rgba(179, 230, 255, 0.28); display: inline-block; width: 1.4em; user-select: none; }
.editor-body .key { color: #7fd3ff; }
.editor-body .str { color: #9be59b; }
.editor-body .punc { color: rgba(232, 240, 254, 0.5); }
.editor-body .cursor {
  display: inline-block; width: 2px; height: 1em; background: var(--sky-300);
  vertical-align: text-bottom; animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
.editor-body pre { margin: 0; white-space: pre-wrap; word-break: break-word; }

/* ==========================================================================
   Marquee
   ========================================================================== */
.marquee-wrap {
  padding-block: 1.6rem;
  border-block: 1px solid var(--border-color);
  overflow: hidden;
  background: var(--bg-panel);
}
.marquee-track {
  display: flex; gap: clamp(1.4rem, 1rem + 2vw, 3rem);
  width: max-content;
  animation: scroll-left 26s linear infinite;
}
.marquee-wrap:hover .marquee-track { animation-play-state: paused; }
.marquee-track span {
  font-family: var(--font-mono); font-size: 0.88rem; color: var(--text-secondary);
  display: flex; align-items: center; gap: 0.6rem; white-space: nowrap;
}
.marquee-track span::before { content: "•"; color: var(--sky-300); }
@keyframes scroll-left {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ==========================================================================
   Video gallery (browser-chrome carousel)
   ========================================================================== */
.gallery-frame {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}
.gallery-frame .editor-titlebar { background: var(--bg-panel-2); }
.gallery-frame .editor-tabs span.current { background: var(--bg-panel); color: var(--blue-500); }

.carousel { position: relative; }
.carousel-viewport {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
}
.carousel-slide {
  position: absolute; inset: 0;
  opacity: 0; visibility: hidden;
  transition: opacity 0.45s ease;
}
.carousel-slide.is-active { opacity: 1; visibility: visible; z-index: 2; }
.carousel-slide iframe, .carousel-slide .thumb-btn { width: 100%; height: 100%; border: 0; display: block; }
.thumb-btn {
  position: relative; background-size: cover; background-position: center;
  color: #fff; display: flex; align-items: center; justify-content: center;
}
.thumb-btn::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(5,11,23,0.15), rgba(5,11,23,0.65)); }
.play-icon {
  position: relative; z-index: 1;
  width: clamp(56px, 8vw, 76px); height: clamp(56px, 8vw, 76px);
  border-radius: 50%;
  background: rgba(47, 95, 255, 0.85);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 12px 30px -8px rgba(47, 95, 255, 0.8);
  transition: transform 0.2s ease;
}
.thumb-btn:hover .play-icon { transform: scale(1.08); }
.play-icon svg { width: 40%; height: 40%; fill: #fff; margin-left: 4px; }
.slide-meta {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 1;
  padding: clamp(1rem, 0.8rem + 1vw, 1.6rem);
  background: linear-gradient(0deg, rgba(5,11,23,0.85), transparent);
  color: #fff;
}
.slide-meta .vtag {
  font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.05em;
  background: rgba(127, 211, 255, 0.18); border: 1px solid rgba(127, 211, 255, 0.4);
  color: var(--sky-200); padding: 0.25em 0.7em; border-radius: 999px;
}
.slide-meta h3 { font-size: clamp(1.05rem, 0.95rem + 0.6vw, 1.35rem); margin-top: 0.5em; }
.slide-meta p { font-size: 0.86rem; opacity: 0.82; margin-top: 0.35em; max-width: 60ch; }

.carousel-nav {
  position: absolute; top: 50%; translate: 0 -50%; z-index: 3;
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(5, 11, 23, 0.55); border: 1px solid rgba(255,255,255,0.25);
  color: #fff; display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(6px);
  transition: background 0.2s ease, transform 0.2s ease;
}
.carousel-nav:hover { background: var(--blue-600); transform: translateY(-50%) scale(1.05); }
.carousel-nav.prev { left: clamp(0.6rem, 1.5vw, 1.2rem); }
.carousel-nav.next { right: clamp(0.6rem, 1.5vw, 1.2rem); }
.carousel-nav svg { width: 20px; height: 20px; }

.carousel-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1rem clamp(1rem, 0.8rem + 1vw, 1.6rem);
  flex-wrap: wrap;
}
.carousel-dots { display: flex; gap: 0.5rem; }
.carousel-dots button {
  width: 9px; height: 9px; border-radius: 50%; background: var(--border-color); border: 0; padding: 0;
  transition: background 0.2s ease, width 0.2s ease;
}
.carousel-dots button.is-active { background: var(--blue-500); width: 22px; border-radius: 6px; }
.carousel-thumbs { display: flex; gap: 0.6rem; overflow-x: auto; padding-bottom: 2px; }
.carousel-thumbs button {
  flex: 0 0 auto; width: 84px; aspect-ratio: 16/9; border-radius: 8px; border: 2px solid transparent;
  background-size: cover; background-position: center; opacity: 0.55; transition: 0.2s ease;
}
.carousel-thumbs button.is-active { opacity: 1; border-color: var(--blue-500); }
.carousel-thumbs button:hover { opacity: 0.9; }

/* ==========================================================================
   Features
   ========================================================================== */
.feature-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-gap);
}
.feature-card {
  background: var(--bg-panel); border: 1px solid var(--border-color); border-radius: var(--radius-md);
  padding: clamp(1.4rem, 1.2rem + 1vw, 2rem);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.feature-card:hover { transform: translateY(-4px); border-color: rgba(63,107,255,0.4); box-shadow: var(--shadow-soft); }
.feature-icon {
  width: 46px; height: 46px; border-radius: 12px;
  background: linear-gradient(135deg, rgba(47,95,255,0.18), rgba(127,211,255,0.18));
  display: flex; align-items: center; justify-content: center; color: var(--blue-500);
  margin-bottom: 1rem;
}
.feature-icon svg { width: 22px; height: 22px; }
.feature-card h3 { font-size: 1.08rem; }
.feature-card p { color: var(--text-secondary); margin-top: 0.6em; font-size: 0.94rem; }
.file-badge {
  display: inline-block; margin-top: 1rem; font-family: var(--font-mono); font-size: 0.72rem;
  color: var(--slate-500); background: var(--bg-panel-2); padding: 0.25em 0.6em; border-radius: 6px;
}

/* ==========================================================================
   Articles / materials
   ========================================================================== */
.filter-bar { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-bottom: 2rem; }
.filter-btn {
  font-family: var(--font-mono); font-size: 0.82rem;
  border: 1px solid var(--border-color); background: var(--bg-panel); color: var(--text-secondary);
  padding: 0.5em 1em; border-radius: 999px; transition: 0.2s ease;
}
.filter-btn:hover { color: var(--text-primary); }
.filter-btn.is-active { background: var(--blue-600); border-color: var(--blue-600); color: #fff; }

.article-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: var(--space-gap);
}
.article-card {
  background: var(--bg-panel); border: 1px solid var(--border-color); border-radius: var(--radius-md);
  overflow: hidden; display: flex; flex-direction: column;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.article-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-soft); }
.article-thumb { aspect-ratio: 16/10; overflow: hidden; position: relative; }
.article-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.article-card:hover .article-thumb img { transform: scale(1.06); }
.article-level {
  position: absolute; top: 0.7rem; left: 0.7rem;
  font-size: 0.68rem; font-family: var(--font-mono); color: #fff;
  background: rgba(5,11,23,0.65); padding: 0.3em 0.7em; border-radius: 999px; backdrop-filter: blur(4px);
}
.article-body { padding: clamp(1.1rem, 1rem + 0.5vw, 1.5rem); display: flex; flex-direction: column; gap: 0.7rem; flex: 1; }
.article-meta { display: flex; align-items: center; justify-content: space-between; font-size: 0.74rem; font-family: var(--font-mono); color: var(--slate-500); }
.article-meta .tag { color: var(--blue-500); }
.article-body h3 { font-size: 1.06rem; }
.article-body p.excerpt { color: var(--text-secondary); font-size: 0.9rem; }
.article-body .full { color: var(--text-secondary); font-size: 0.9rem; display: none; }
.article-card.is-open .full { display: block; }
.article-card.is-open .excerpt { display: none; }
.article-toggle {
  margin-top: auto; align-self: flex-start;
  font-family: var(--font-mono); font-size: 0.82rem; color: var(--blue-500);
  display: inline-flex; align-items: center; gap: 0.35em;
}
.article-toggle svg { width: 14px; height: 14px; transition: transform 0.2s ease; }
.article-card.is-open .article-toggle svg { transform: rotate(90deg); }

/* ==========================================================================
   Roadmap
   ========================================================================== */
.roadmap {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 1.4rem; counter-reset: step;
  position: relative;
}
.roadmap-item {
  background: var(--bg-panel); border: 1px solid var(--border-color); border-radius: var(--radius-md);
  padding: 1.4rem; position: relative;
}
.roadmap-step { font-family: var(--font-mono); font-size: 0.78rem; color: var(--sky-300); }
.roadmap-file { font-family: var(--font-mono); font-size: 0.7rem; color: var(--slate-500); margin-top: 0.3rem; }
.roadmap-item h3 { font-size: 1.02rem; margin-top: 0.6rem; }
.roadmap-item p { font-size: 0.86rem; color: var(--text-secondary); margin-top: 0.5rem; }

/* ==========================================================================
   Community / discussion
   ========================================================================== */
.community-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-gap); align-items: start;
}
.community-panel {
  background: var(--bg-panel); border: 1px solid var(--border-color); border-radius: var(--radius-lg);
  overflow: hidden; box-shadow: var(--shadow-soft);
}
.community-panel .editor-titlebar { background: var(--bg-panel-2); }
.community-body { padding: clamp(1.2rem, 1rem + 1vw, 1.8rem); }

.comment-list { display: flex; flex-direction: column; gap: 1.1rem; max-height: 360px; overflow-y: auto; padding-right: 0.4rem; }
.comment {
  display: flex; gap: 0.8rem;
  animation: rise 0.35s ease both;
}
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.comment img { width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0; border: 1px solid var(--border-color); }
.comment-content { background: var(--bg-panel-2); border-radius: var(--radius-sm); padding: 0.7rem 0.9rem; flex: 1; }
.comment-head { display: flex; justify-content: space-between; gap: 0.6rem; font-size: 0.82rem; }
.comment-head b { font-family: var(--font-display); }
.comment-head span { color: var(--slate-500); font-size: 0.74rem; }
.comment-content p { font-size: 0.9rem; margin-top: 0.3rem; color: var(--text-primary); }

.comment-form { margin-top: 1.4rem; padding-top: 1.2rem; border-top: 1px solid var(--border-color); display: grid; gap: 0.7rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.7rem; }
.comment-form input, .comment-form textarea, .newsletter-form input {
  width: 100%; background: var(--bg-panel-2); border: 1px solid var(--border-color); color: var(--text-primary);
  border-radius: var(--radius-sm); padding: 0.75em 0.9em; font-size: 0.92rem;
  transition: border-color 0.2s ease;
}
.comment-form textarea { resize: vertical; min-height: 84px; }
.comment-form input:focus, .comment-form textarea:focus, .newsletter-form input:focus { border-color: var(--blue-500); }
.form-note { font-size: 0.76rem; color: var(--slate-500); }

.faq-list { display: flex; flex-direction: column; gap: 0.7rem; }
.faq-item {
  background: var(--bg-panel); border: 1px solid var(--border-color); border-radius: var(--radius-md);
  padding: 1rem 1.2rem;
}
.faq-item summary {
  cursor: pointer; font-family: var(--font-display); font-weight: 600; font-size: 0.98rem;
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; font-size: 1.3rem; color: var(--blue-500); transition: transform 0.2s ease; }
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item p { margin-top: 0.7rem; color: var(--text-secondary); font-size: 0.9rem; }

/* ==========================================================================
   Newsletter CTA band
   ========================================================================== */
.cta-band {
  background: linear-gradient(135deg, var(--navy-900), var(--navy-800));
  border-radius: var(--radius-lg);
  padding: clamp(2rem, 1.6rem + 2vw, 3.2rem);
  display: grid; grid-template-columns: 1.2fr 1fr; gap: 2rem; align-items: center;
  color: var(--ice-100);
  position: relative; overflow: hidden;
  border: 1px solid rgba(127,211,255,0.14);
}
.cta-band::before {
  content: ""; position: absolute; inset: -40% -10% auto auto; width: 60%; aspect-ratio: 1;
  background: radial-gradient(circle, rgba(63,107,255,0.35), transparent 65%);
}
.cta-band h2 { font-size: clamp(1.4rem, 1.2rem + 1.2vw, 2rem); }
.cta-band p { color: var(--slate-300); margin-top: 0.7em; }
.newsletter-form { display: flex; gap: 0.6rem; flex-wrap: wrap; position: relative; z-index: 1; }
.newsletter-form input { flex: 1; min-width: 180px; }
.form-msg { font-size: 0.82rem; margin-top: 0.6rem; color: var(--sky-300); min-height: 1.2em; }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer { background: var(--navy-950); color: var(--ice-100); padding-top: var(--space-section); }
.site-footer a { color: var(--slate-300); }
.footer-grid {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 2.4rem;
  padding-bottom: 2.5rem; border-bottom: 1px solid rgba(127,211,255,0.12);
}
.footer-brand p { color: var(--slate-300); font-size: 0.9rem; margin-top: 0.9rem; max-width: 32ch; }
.footer-col h4 { font-size: 0.86rem; color: var(--ice-100); margin-bottom: 1rem; font-family: var(--font-mono); }
.footer-col ul { display: grid; gap: 0.65rem; }
.footer-col a { font-size: 0.88rem; transition: color 0.2s ease; }
.footer-col a:hover { color: var(--sky-300); }
.footer-bottom {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem;
  padding-block: 1.6rem; font-size: 0.8rem; color: var(--slate-500);
}
.footer-badges { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.footer-badges span {
  font-family: var(--font-mono); font-size: 0.7rem; border: 1px solid rgba(127,211,255,0.2);
  padding: 0.3em 0.7em; border-radius: 999px; color: var(--sky-300);
}

.back-to-top {
  position: fixed; right: clamp(1rem, 3vw, 2.2rem); bottom: clamp(1rem, 3vw, 2.2rem); z-index: 90;
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--blue-600); color: #fff; border: 0;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 14px 30px -10px rgba(47,95,255,0.8);
  opacity: 0; visibility: hidden; transform: translateY(10px);
  transition: 0.25s ease;
}
.back-to-top.show { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top svg { width: 20px; height: 20px; }

/* ==========================================================================
   Reveal-on-scroll utility
   ========================================================================== */
[data-reveal] { opacity: 0; transform: translateY(18px); transition: opacity 0.6s ease, transform 0.6s ease; }
[data-reveal].in-view { opacity: 1; transform: translateY(0); }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; }
  .editor-window { transform: none; order: -1; }
  .community-grid { grid-template-columns: 1fr; }
  .cta-band { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 760px) {
  .nav-links { position: fixed; inset: 64px 0 0 0; height: calc(100dvh - 64px); flex-direction: column;
    background: var(--bg-page); padding: 2rem 1.5rem; gap: 1.4rem; align-items: flex-start;
    transform: translateX(100%); transition: transform 0.3s ease; overflow-y: auto; }
  .nav-links.open { transform: translateX(0); }
  .nav-links a { font-size: 1.1rem; }
  .nav-toggle { display: flex; }
  .hero-stats { grid-template-columns: repeat(2, 1fr); }
  .form-row { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 1.8rem; }
}

@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; }
  .carousel-nav { width: 38px; height: 38px; }
}
