/* ==========================================================================
   Precision Ink Design System
   A clean, typographic-first design system for Vibe Code U
   ========================================================================== */

/* --- Custom Properties --- */
:root {
  --ink: #0a1628;
  --ink-light: #131d33;
  --ink-mid: #1a2744;
  --surface: #f5f6f8;
  --surface-raised: #ffffff;
  --primary: #0062cc;
  --primary-light: #e8f1fd;
  --primary-bright: #3388ee;
  --accent: #00b4d8;
  --accent-warm: #e8960c;
  --text: #1a1f36;
  --text-muted: #5a6278;
  --text-light: #8892a8;
  --text-inverse: #e8eaf0;
  --border: rgba(10, 22, 40, 0.07);
  --border-strong: rgba(10, 22, 40, 0.14);
  --shadow-sm: 0 1px 3px rgba(10,22,40,0.05), 0 1px 2px rgba(10,22,40,0.03);
  --shadow-md: 0 4px 12px rgba(10,22,40,0.07), 0 2px 4px rgba(10,22,40,0.04);
  --shadow-lg: 0 12px 40px rgba(10,22,40,0.10), 0 4px 12px rgba(10,22,40,0.06);
  --shadow-glow: 0 0 30px rgba(0,98,204,0.15);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --duration-fast: 0.2s;
  --duration-normal: 0.35s;
  --duration-slow: 0.6s;
}

/* --- Base / Body --- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: "Plus Jakarta Sans", sans-serif;
  line-height: 1.65;
  color: var(--text);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --- Page Header --- */
.page-header {
  position: relative;
  padding: 7rem 0 5rem;
  background: radial-gradient(ellipse at 50% 0%, var(--ink-mid) 0%, var(--ink) 70%);
  color: white;
  text-align: center;
  overflow: hidden;
}

.page-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.03;
  pointer-events: none;
}

.page-header h1 {
  position: relative;
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 700;
  font-size: clamp(1.8rem, 4.5vw, 2.8rem);
  color: white;
  letter-spacing: -0.02em;
  margin: 0;
  z-index: 1;
  line-height: 1.2;
}

.page-header p {
  position: relative;
  z-index: 1;
  color: var(--text-inverse);
  opacity: 0.8;
  max-width: 600px;
  margin: 1rem auto 0;
  font-size: 1.05rem;
}

/* --- Navigation (.main-nav) --- */
.main-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background: rgba(10, 22, 40, 0.88);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  padding: 0 2rem;
  height: 3.5rem;
  display: flex;
  align-items: center;
  transition: transform 0.35s var(--ease-out);
}

.main-nav.hide {
  transform: translateY(-100%);
}

.main-nav ul {
  display: flex;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
  align-items: center;
}

.main-nav li {
  font-size: 0.9rem;
}

.main-nav a {
  color: var(--text-inverse);
  font-family: "Plus Jakarta Sans", sans-serif;
  font-weight: 500;
  font-size: 0.9rem;
  text-decoration: none;
  padding: 0.5em 1em;
  border-radius: var(--radius-sm);
  transition: all var(--duration-fast);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.main-nav a:hover {
  color: var(--accent);
  background: rgba(255,255,255,0.05);
}

/* Floating menu button (desktop) */
.floating-menu-btn {
  display: flex;
  position: fixed;
  top: 1rem;
  right: 2rem;
  z-index: 1001;
  background: rgba(10, 22, 40, 0.88);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  color: white;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 50%;
  width: 2.5rem;
  height: 2.5rem;
  box-shadow: var(--shadow-md);
  font-size: 1.1rem;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: opacity var(--duration-normal) var(--ease-out);
  opacity: 0;
  pointer-events: none;
}

.floating-menu-btn.show {
  opacity: 1;
  pointer-events: auto;
}

/* Nav toggle (mobile hamburger) */
.nav-toggle {
  display: none;
  position: fixed;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 1001;
  background: rgba(10, 22, 40, 0.88);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  color: white;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 50%;
  width: 2.5rem;
  height: 2.5rem;
  font-size: 1.2rem;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: opacity var(--duration-fast);
}

/* Mobile navigation overlay */
body.nav-open::before {
  content: '';
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 999;
}

/* --- Main Content --- */
.main-content {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 2rem 3rem;
  position: relative;
  z-index: 1;
}

/* --- Card Grid --- */
.card-grid {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  padding: 1.5rem 0 3rem;
  max-width: 840px;
  margin: 0 auto;
  overflow: visible;
}

/* --- Card Row (side-by-side layout) --- */
.card-row {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.card-half {
  flex: 1;
  min-width: 280px;
}

/* --- Navigation Cards (landing page) --- */
.nav-card {
  flex: 1;
  min-width: 180px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.5rem;
  padding: 1.75rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--text);
  background: var(--surface);
  transition: all var(--duration-normal) var(--ease-out);
}

.nav-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
  color: var(--primary);
}

.nav-card i {
  font-size: 1.5rem;
  color: var(--primary);
}

.nav-card strong {
  font-family: "Bricolage Grotesque", sans-serif;
  font-size: 1.05rem;
}

.nav-card span {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* --- Nav Brand --- */
.nav-brand {
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
  margin-right: auto;
}

.nav-brand a {
  color: white;
  text-decoration: none;
  transition: color var(--duration-fast);
}

.nav-brand a:hover {
  color: var(--accent);
}

/* --- Footer Brand --- */
.footer-brand {
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  color: white;
  margin-bottom: 1rem;
  position: relative;
  z-index: 2;
}

/* --- Cards --- */
.card {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 2.5rem;
  box-shadow: var(--shadow-sm);
  transition: transform var(--duration-normal) var(--ease-out), box-shadow var(--duration-normal) var(--ease-out);
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.card h2 {
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 700;
  font-size: 1.45rem;
  color: var(--ink);
  margin-top: 0;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.card h3 {
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 600;
  font-size: 1.15rem;
  color: var(--text);
  margin-top: 1.8rem;
}

.card p {
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 0.75rem;
}

.card a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1px solid transparent;
  transition: border-color var(--duration-fast);
}

.card a:hover {
  border-bottom-color: var(--primary);
}

/* Card overlap */
.card-overlap {
  margin-top: -3.5rem;
  position: relative;
  z-index: 2;
}

/* --- Buttons --- */
.vibe-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  border-radius: var(--radius-sm);
  font-family: "Plus Jakarta Sans", sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.7em 1.6em;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
  text-decoration: none;
  border: none;
}

.vibe-btn,
.vibe-btn:link,
.vibe-btn:visited,
.vibe-btn:active,
.vibe-btn:focus,
.vibe-btn:hover,
.vibe-btn-primary,
.vibe-btn-secondary {
  text-decoration: none !important;
}

.vibe-btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 2px 8px rgba(0,98,204,0.25);
}

.vibe-btn-primary:hover {
  filter: brightness(1.12);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0,98,204,0.3);
}

.vibe-btn-secondary {
  background: transparent;
  border: 1.5px solid var(--border-strong);
  color: var(--text);
}

.vibe-btn-secondary:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* --- Chat UI --- */
.vibe-chat-demo {
  padding: 2rem;
}

.vibe-chat-container {
  display: flex;
  flex-direction: column;
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: visible;
}

.vibe-chat-title {
  font-family: "Bricolage Grotesque", sans-serif;
  padding: 0 0 1rem;
  border-bottom: none;
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0;
}

.vibe-chat-body {
  padding: 1.25rem;
  max-height: 420px;
  overflow-y: auto;
  background: transparent;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  flex: 1 1 auto;
  min-height: 180px;
}

.vibe-chat-body::-webkit-scrollbar {
  width: 5px;
}

.vibe-chat-body::-webkit-scrollbar-track {
  background: transparent;
}

.vibe-chat-body::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 3px;
}

.vibe-chat-msg {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}

.vibe-chat-msg-user {
  flex-direction: row-reverse;
}

.vibe-chat-avatar {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  color: var(--primary);
  flex-shrink: 0;
}

.vibe-chat-msg-user .vibe-chat-avatar {
  background: var(--primary);
  color: white;
}

.vibe-chat-msg-ai .vibe-chat-avatar {
  background: var(--primary-light);
  color: var(--primary);
}

.vibe-chat-bubble {
  padding: 0.85rem 1.15rem;
  border-radius: 16px;
  max-width: 80%;
  line-height: 1.6;
  font-size: 0.95rem;
  word-break: break-word;
}

.vibe-chat-bubble-user {
  background: var(--primary);
  color: white;
  border-radius: 16px 16px 4px 16px;
}

.vibe-chat-bubble-ai {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 16px 16px 16px 4px;
  white-space: pre-wrap;
}

.vibe-chat-art {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.9em;
  margin: 0.5em 0 0;
  padding: 0;
  background: transparent;
  white-space: pre;
}

.vibe-chat-error {
  color: #dc3545;
}

/* Chat form */
.vibe-chat-form {
  border-top: none;
  padding: 0;
  background: transparent;
}

.vibe-chat-input-area {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm) var(--radius-sm) var(--radius-sm) var(--radius-sm);
  margin: 0 -1px -1px;
}

.vibe-chat-prompt-row {
  flex: 1;
}

.vibe-chat-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-shrink: 0;
}

.vibe-chat-prompt-row {
  flex: 1;
  display: flex;
  align-items: center;
}

.vibe-chat-input {
  width: 100%;
  border: none;
  border-radius: 0;
  padding: 0.5rem 0;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 0.95rem;
  background: transparent;
  color: var(--text);
  outline: none;
}

.vibe-chat-input:focus {
  outline: none;
}

.vibe-chat-input::placeholder {
  color: var(--text-light);
  opacity: 1;
}

.vibe-chat-send {
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  width: 2.5rem;
  height: 2.5rem;
  cursor: pointer;
  transition: all var(--duration-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}

.vibe-chat-send:hover {
  filter: brightness(1.15);
}

/* Vibe tone selector */
.vibe-chat-vibe-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 0.75rem;
  height: 2.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: all var(--duration-fast);
}

.vibe-chat-vibe-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.vibe-chat-vibe-emoji {
  font-size: 1em;
}

.vibe-chat-vibe-arrow {
  margin-left: 0.2em;
  font-size: 0.9em;
  color: var(--text-light);
}

.vibe-chat-vibe-menu {
  position: absolute;
  bottom: 3.5rem;
  right: 1rem;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 0.5rem;
  display: none;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 180px;
  z-index: 200;
  z-index: 100;
}

.vibe-chat-vibe-menu.open {
  display: flex;
  animation: menuFadeIn 0.2s var(--ease-out);
}

@keyframes menuFadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.vibe-chat-vibe-menu-option {
  background: transparent;
  border: none;
  padding: 0.55rem 0.85rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: left;
  font-size: 0.9rem;
  color: var(--text);
  transition: background var(--duration-fast);
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
}

.vibe-chat-vibe-menu-option i {
  font-size: 1.2em;
  width: 1.5em;
  text-align: center;
}

.vibe-chat-vibe-menu-option:hover {
  background: var(--surface);
}

.vibe-chat-vibe-menu-option.selected {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}

/* --- Typing Indicator --- */
.vibe-chat-typing {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
}

.typing-dot {
  width: 0.45em;
  height: 0.45em;
  background: var(--text-light);
  border-radius: 50%;
  display: inline-block;
  animation: typingBounce 1.2s infinite ease-in-out;
}

.typing-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typingBounce {
  0%, 80%, 100% {
    opacity: 0.3;
    transform: scale(0.8);
  }
  40% {
    opacity: 1;
    transform: scale(1);
  }
}

.chat-typing-indicator {
  padding: 0.3em 1em;
  color: var(--text-light);
  font-size: 0.9em;
}

/* --- Quiz UI --- */
.vibe-quiz-intro,
.vibe-quiz-card,
.vibe-quiz-result {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 2.5rem;
  box-shadow: var(--shadow-sm);
  min-height: 260px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  animation: fadeIn 0.7s;
  overflow: visible;
}

.vibe-quiz-card.animate,
.vibe-quiz-result.animate {
  animation: popIn 0.5s var(--ease-spring);
}

@keyframes popIn {
  0% {
    transform: scale(0.95);
    opacity: 0.2;
  }
  60% {
    transform: scale(1.05);
    opacity: 1;
  }
  100% {
    transform: scale(1);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.vibe-quiz-q {
  font-family: "Bricolage Grotesque", sans-serif;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 1.5rem;
  display: flex;
}

.vibe-quiz-options {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 1.2rem;
  width: 100%;
}

.vibe-quiz-opt {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  cursor: pointer;
  font-size: 0.95rem;
  text-align: left;
  transition: all var(--duration-fast) var(--ease-out);
  font-family: "Plus Jakarta Sans", sans-serif;
  color: var(--text);
  outline: none;
}

.vibe-quiz-opt:hover {
  border-color: var(--primary);
  background: var(--primary-light);
  transform: translateX(4px);
}

.vibe-quiz-opt:disabled {
  opacity: 0.6;
  cursor: default;
  transform: none;
}

.vibe-quiz-feedback {
  min-height: 2.2rem;
  font-size: 0.95rem;
  margin-top: 0.5rem;
  display: none;
}

.vibe-quiz-feedback.show {
  display: block;
}

.vibe-quiz-feedback-msg {
  padding: 1rem 1.25rem;
  border-radius: var(--radius-sm);
  margin-top: 1rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.6em;
  justify-content: center;
}

.vibe-quiz-feedback-msg.correct {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.vibe-quiz-feedback-msg.wrong {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.vibe-quiz-wit {
  margin-top: 1.2rem;
  font-style: italic;
  color: var(--text-light);
  animation: fadeIn 0.7s;
}

#vibe-quiz-next-row {
  display: none;
  justify-content: flex-end;
  margin-top: 1rem;
}

.vibe-quiz-badge {
  text-align: center;
  font-size: 2.5rem;
  margin: 1rem 0;
}

.vibe-quiz-score {
  text-align: center;
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0.5rem 0;
}

.vibe-quiz-result-msg {
  text-align: center;
  color: var(--text-muted);
  margin: 0.5rem 0 1.5rem;
}

.vibe-quiz-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  align-items: stretch;
  margin-top: 0.5rem;
}

.vibe-quiz-actions .vibe-btn-secondary {
  border-color: rgba(10, 22, 40, 0.28);
}

.vibe-quiz-actions .vibe-btn-secondary:hover {
  border-color: var(--primary);
}

.vibe-quiz-card:hover,
.vibe-quiz-result:hover,
.vibe-quiz-intro:hover,
.vibe-next-lesson:hover {
  transform: none;
  box-shadow: var(--shadow-sm);
}

/* Animate.css compatibility */
.animate {
  animation-duration: 0.4s;
}

/* --- Key Concepts List --- */
.vibe-key-concepts {
  list-style: none;
  padding: 0;
  margin: 1rem 0;
}

.vibe-key-concepts li {
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.vibe-key-concepts li:last-child {
  border-bottom: none;
}

.vibe-key-concepts li i {
  color: var(--primary);
  font-size: 1rem;
  margin-top: 0.2rem;
  flex-shrink: 0;
}

.vibe-key-concepts li strong {
  color: var(--text);
  font-weight: 600;
}

/* --- Terminal / Shell --- */
.vibe-syntax-shell-frame,
.vibe-example-shell-frame {
  background: var(--ink);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.06);
  margin: 1.5rem 0;
}

.vibe-shell-bar {
  display: flex;
  align-items: center;
  background: rgba(255,255,255,0.04);
  padding: 0.6em 1em;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.vibe-shell-dot {
  width: 0.6em;
  height: 0.6em;
  border-radius: 50%;
  display: inline-block;
  margin-right: 0.4em;
}

.vibe-shell-dot-red { background: #ff5f56; }
.vibe-shell-dot-yellow { background: #ffbd2e; }
.vibe-shell-dot-green { background: #27c93f; }

.vibe-shell-title {
  color: var(--text-light);
  font-size: 0.85em;
  margin-left: 0.7em;
  font-family: "Plus Jakarta Sans", sans-serif;
}

.vibe-shell-code {
  color: #e8eaf0;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.95em;
  padding: 1.25em 1.5em;
  margin: 0;
  white-space: pre-line;
  background: transparent;
}

.vibe-shell-code code {
  background: transparent;
  color: inherit;
  border: none;
  padding: 0;
  margin: 0;
  box-shadow: none;
}

/* Twin terminals */
.vibe-example-terminals {
  display: flex;
  gap: 1.5rem;
  margin: 1.5rem 0;
  flex-wrap: wrap;
}

.vibe-example-terminals .vibe-syntax-shell-frame {
  flex: 1;
  min-width: 250px;
}

/* --- Inline Code --- */
.vibe-inline-code,
code {
  font-family: "JetBrains Mono", monospace;
  background: var(--surface);
  color: var(--text);
  border-radius: 5px;
  padding: 0.15em 0.45em;
  font-size: 0.88em;
  border: 1px solid var(--border);
}

/* --- Video Embed --- */
.vibe-video-embed {
  border-radius: var(--radius-md);
  overflow: hidden;
  margin: 1.5rem 0;
  box-shadow: var(--shadow-sm);
  background: #000;
  aspect-ratio: 16 / 9;
}

.vibe-video-embed iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* --- Card Note --- */
.vibe-card-note {
  background: var(--primary-light);
  border-left: 3px solid var(--primary);
  padding: 1rem 1.25rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 1.25rem 0;
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* --- Playground Layout --- */
.vibe-playground-intro-split {
  display: flex;
  gap: 2rem;
  align-items: stretch;
  overflow: visible;
}

.vibe-playground-main {
  flex: 1;
  min-width: 0;
  background: var(--surface-raised);
  padding: 2rem;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.vibe-playground-samples-aux {
  width: 220px;
  flex-shrink: 0;
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.vibe-sample-prompts-title {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  cursor: pointer;
  user-select: none;
}

.vibe-sample-prompts-arrow {
  margin-left: 0.5em;
  color: var(--text-light);
  font-size: 1em;
  transition: transform 0.2s;
}

.vibe-sample-prompts-arrow.up {
  transform: rotate(180deg);
}

.vibe-sample-prompts {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
}

.vibe-sample-prompts.open {
  display: flex;
}

.vibe-sample-btn {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.85rem;
  margin-bottom: 0.5rem;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: all var(--duration-fast);
}

.vibe-sample-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateX(3px);
}

/* Legacy sample prompt section styles */
.sample-prompts-section {
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 1.2em 1.5em 1em;
  margin-bottom: 2em;
  box-shadow: var(--shadow-sm);
}

.sample-prompts-section h3 {
  font-size: 1.1em;
  font-weight: 600;
  margin-bottom: 0.7em;
  display: flex;
  align-items: center;
  gap: 0.5em;
}

.sample-prompts-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sample-prompt-item {
  margin-bottom: 0.5em;
  display: flex;
  align-items: flex-start;
  gap: 0.7em;
}

.sample-prompt-topic {
  font-weight: 500;
  color: var(--text);
  min-width: 180px;
  display: flex;
  align-items: center;
  gap: 0.3em;
}

.sample-prompt-text {
  color: var(--text-muted);
  font-style: italic;
}

/* --- Callouts --- */
.vibe-playground-callout,
.vibe-nested-callout {
  background: linear-gradient(135deg, var(--primary-light) 0%, rgba(0,180,216,0.08) 100%);
  border: 1px solid rgba(0,98,204,0.12);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin: 1.5rem 0;
}

.vibe-playground-callout h3,
.vibe-playground-callout p,
.vibe-playground-callout a {
  color: var(--text);
}

/* Spacing between callout/tip and chat component */
.callout + .vibe-chat-demo,
.vibe-playground-callout + .vibe-chat-demo,
.vibe-nested-callout + .vibe-chat-demo {
  margin-top: 1.5rem;
}

/* --- Lesson Navigation --- */
.vibe-next-lesson {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  gap: 1rem;
  padding: 1.5rem 2rem;
  margin: 1.5rem auto 2.5rem;
  max-width: 840px;
  background: var(--surface-raised);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.vibe-next-lesson .vibe-btn,
.vibe-next-lesson .vibe-btn:link,
.vibe-next-lesson .vibe-btn:visited,
.vibe-next-lesson .vibe-btn:active,
.vibe-next-lesson .vibe-btn:focus,
.vibe-next-lesson .vibe-btn:hover {
  text-decoration: none !important;
}

/* --- Footer --- */
.page-footer {
  background: var(--ink);
  color: var(--text-inverse);
  padding: 3rem 0 2rem;
}

.footer-content {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 2rem;
  text-align: center;
}

.footer-links {
  list-style: none;
  display: flex;
  justify-content: center;
  gap: 2rem;
  padding: 0;
  margin: 0 0 1.5rem;
  flex-wrap: wrap;
}

.footer-links li {
  margin: 0;
}

.footer-links a {
  color: var(--text-light);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--duration-fast);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.footer-links a:hover {
  color: var(--accent);
}

.footer-links i {
  font-size: 0.875rem;
}

.copyright {
  color: var(--text-light);
  font-size: 0.85rem;
  opacity: 0.6;
}

/* --- Welcome Section --- */
.welcome {
  padding: 3rem;
}

/* --- Git Simulator --- */
.git-sim-wrapper {
  position: relative;
  margin-top: 1.5rem;
}

.git-sim-frame {
  position: relative;
}

.git-sim-output {
  padding: 1rem 1.25rem 0.5rem;
  max-height: 420px;
  overflow-y: auto;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.88em;
  color: #e8eaf0;
  line-height: 1.6;
}

.git-sim-output::-webkit-scrollbar { width: 5px; }
.git-sim-output::-webkit-scrollbar-track { background: transparent; }
.git-sim-output::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 3px; }

.git-sim-line { white-space: pre-wrap; word-break: break-word; }
.git-sim-line-cmd { color: #27c93f; }
.git-sim-line-error { color: #ff5f56; }
.git-sim-line-warn { color: #ffbd2e; }
.git-sim-line-info { color: #7ec8e3; }
.git-sim-line-success { color: #27c93f; }
.git-sim-line-diff-add { color: #27c93f; }
.git-sim-line-diff-del { color: #ff5f56; }
.git-sim-line-muted { color: rgba(232,234,240,0.5); }

.git-sim-input-form {
  display: flex;
  align-items: center;
  padding: 0.5rem 1.25rem 1rem;
}

.git-sim-prompt {
  color: #27c93f;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.88em;
  white-space: nowrap;
  margin-right: 0.5em;
}

.git-sim-input {
  flex: 1;
  background: transparent;
  border: none;
  color: #e8eaf0;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.88em;
  outline: none;
  caret-color: #27c93f;
}

.git-sim-input::placeholder { color: rgba(232,234,240,0.3); }

/* Nano editor overlay */
.git-sim-nano-overlay {
  position: absolute;
  inset: 0;
  z-index: 10;
}

.git-sim-nano-frame {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.git-sim-nano-editor {
  flex: 1;
  min-height: 200px;
  background: transparent;
  border: none;
  color: #e8eaf0;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.88em;
  padding: 1rem 1.25rem;
  resize: none;
  outline: none;
  line-height: 1.6;
}

.git-sim-nano-bar {
  display: flex;
  gap: 1.5rem;
  padding: 0.5rem 1.25rem;
  background: rgba(255,255,255,0.06);
  border-top: 1px solid rgba(255,255,255,0.08);
}

.git-sim-nano-btn {
  background: none;
  border: none;
  color: #e8eaf0;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.82em;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  transition: color 0.15s;
}

.git-sim-nano-btn:hover { color: #27c93f; }
.git-sim-nano-btn kbd {
  color: #ffbd2e;
  font-weight: bold;
}

/* --- Scroll Reveal --- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}

.reveal.visible {
  opacity: 1;
  transform: none;
}

.card-grid .reveal:nth-child(2) {
  transition-delay: 0.1s;
}

.card-grid .reveal:nth-child(3) {
  transition-delay: 0.2s;
}

.card-grid .reveal:nth-child(4) {
  transition-delay: 0.3s;
}

/* --- Fix: intro card corners when no aside present --- */
.vibe-playground-intro-split:not(:has(.vibe-playground-samples-aux)) .vibe-playground-main {
  border-radius: var(--radius-md);
}

/* ==========================================================================
   Mobile Responsive (max-width: 768px)
   ========================================================================== */
@media (max-width: 768px) {
  .page-header {
    padding: 5rem 0 3rem;
  }

  .page-header h1 {
    font-size: 1.6rem;
  }

  .card {
    padding: 1.75rem;
  }

  .card-grid {
    padding: 1rem 0 3rem;
  }

  .main-content {
    padding: 0 1.25rem;
  }

  .vibe-chat-body {
    max-height: 350px;
  }

  .vibe-example-terminals {
    flex-direction: column;
  }

  .card-overlap {
    margin-top: -2rem;
  }

  .vibe-next-lesson {
    flex-direction: row;
    max-width: 100%;
    padding: 1em 1em;
  }

  .vibe-next-lesson .vibe-btn {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
  }
}

/* ==========================================================================
   Mobile Navigation (max-width: 768px)
   ========================================================================== */
@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }

  .main-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    flex-direction: column;
    padding: 5rem 1.5rem 2rem;
    transform: translateX(-100%);
    transition: transform 0.4s var(--ease-out);
  }

  .main-nav.active {
    transform: translateX(0);
  }

  .main-nav ul {
    flex-direction: column;
    gap: 0.5rem;
  }

  .floating-menu-btn {
    display: none !important;
  }
}

/* ==========================================================================
   Mobile Playground (max-width: 900px)
   ========================================================================== */
@media (max-width: 900px) {
  .vibe-playground-intro-split {
    flex-direction: column;
  }

  .vibe-playground-main {
    border-radius: var(--radius-md) var(--radius-md) 0 0;
  }

  .vibe-playground-samples-aux {
    width: 100%;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    padding: 0;
  }

  .vibe-sample-prompts-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 1.2rem 1rem;
    cursor: pointer;
    user-select: none;
    font-size: 0.9rem;
    background: var(--surface);
    border-radius: 0;
  }

  .vibe-sample-prompts {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s;
    padding: 0 1rem;
  }

  .vibe-sample-prompts.open {
    max-height: 500px;
    padding: 0 1rem 1rem;
  }
}

/* ==========================================================================
   Reduced Motion
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
