/* ================================================================
   Margarita – Tutorial / Guide stylesheet
   Same design tokens as index3.css; brutalist aesthetic throughout.
   ================================================================ */

/* ─── TOKENS ─── */
:root {
  --bg:        #EDE9DC;
  --surface:   #F7F4EC;
  --black:     #111111;
  --white:     #FEFEFE;
  --lime:      #CBFF4D;
  --lime-muted:#B0E000;
  --muted:     #6B6555;
  --border-w:  2px;
  --shadow:    4px 4px 0 var(--black);
  --shadow-lg: 6px 6px 0 var(--black);
  --font:      'Space Grotesk', system-ui, sans-serif;
  --mono:      'JetBrains Mono', 'Fira Code', monospace;
  --max:       1080px;
}

/* ─── RESET ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body { font-family: var(--font); background: var(--bg); color: var(--black); line-height: 1.6; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
img { display: block; }

/* ─── CONTAINER ─── */
.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ─── NAV ─── */
.site-nav {
  background: var(--white);
  border-bottom: var(--border-w) solid var(--black);
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  height: 3.5rem;
  position: relative;
}
.nav-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--black);
  padding: 0.3rem 0.75rem 0.3rem 0.45rem;
  flex-shrink: 0;
  margin-right: auto;
}
.nav-logo-img  { width: 20px; height: 20px; }
.nav-logo-text {
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--lime);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* Nav links */
.nav-links {
  display: flex;
  align-items: stretch;
  height: 3.5rem;
}
.nav-links > li { display: flex; align-items: stretch; }
.nav-links > li > a {
  display: flex;
  align-items: center;
  padding: 0 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--black);
  border-left: 1px solid var(--black);
  white-space: nowrap;
  transition: background 0.1s;
}
.nav-links > li > a:hover { background: var(--lime); }

/* Dropdown */
.nav-dropdown { position: relative; display: flex; align-items: stretch; }
.nav-dropdown-toggle {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0 1rem;
  height: 100%;
  background: none;
  border: none;
  border-left: 1px solid var(--black);
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--black);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.1s;
}
.nav-dropdown-toggle:hover { background: var(--lime); }
.nav-dropdown-arrow { font-size: 0.65rem; }
.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 2px);
  right: 0;
  min-width: 230px;
  background: var(--white);
  border: var(--border-w) solid var(--black);
  box-shadow: var(--shadow);
  z-index: 200;
}
.nav-dropdown.open .nav-dropdown-menu { display: block; }
.nav-dropdown-menu li a {
  display: block;
  padding: 0.65rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  border-bottom: 1px solid #E0DCD0;
  transition: background 0.1s;
}
.nav-dropdown-menu li:last-child a { border-bottom: none; }
.nav-dropdown-menu li a:hover { background: var(--lime); }

/* CTA nav link */
.nav-cta {
  display: flex;
  align-items: center;
  padding: 0 1.25rem;
  font-size: 0.85rem;
  font-weight: 700;
  background: var(--lime);
  color: var(--black);
  border-left: var(--border-w) solid var(--black);
  transition: background 0.1s;
}
.nav-cta:hover { background: var(--lime-muted); }

/* Hamburger */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 2.25rem;
  height: 2.25rem;
  background: none;
  border: var(--border-w) solid var(--black);
  cursor: pointer;
  padding: 0.45rem;
  flex-shrink: 0;
}
.nav-hamburger span { display: block; height: 2px; background: var(--black); }

/* ─── HERO ─── */
.hero {
  background: var(--bg);
  border-bottom: var(--border-w) solid var(--black);
  padding: 5rem 0 4rem;
  clip-path: none !important;
  margin-bottom: 0 !important;
}
/* Hide decorative lime image overlays from old design */
.hero-mg-bg { display: none !important; }

.hero-eyebrow {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1rem;
}
.hero-heading {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: -0.02em;
  margin-bottom: 1.1rem;
}
.hero-accent { color: var(--lime-muted); }
.hero-sub {
  font-size: 1.05rem;
  color: var(--muted);
  line-height: 1.7;
  max-width: 56ch;
  margin-bottom: 2rem;
}
.hero-sub code {
  font-family: var(--mono);
  font-size: 0.85em;
  background: rgba(0,0,0,0.06);
  padding: 0.1em 0.4em;
  border: 1px solid #C8C4B4;
}
.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Chips */
.tut-model-chips {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}
.tut-chip {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 0.25rem 0.65rem;
  border: var(--border-w) solid var(--black);
}
.tut-chip--claude { background: var(--lime); color: var(--black); }
.tut-chip--gemini { background: var(--black); color: var(--lime); }
.tut-chip--plus   { background: transparent; border: none; padding: 0 0.1rem; font-size: 0.9rem; }

/* ─── BUTTONS ─── */
.btn-primary {
  display: inline-block;
  padding: 0.75rem 1.75rem;
  background: var(--lime);
  color: var(--black);
  font-family: var(--font);
  font-weight: 700;
  font-size: 0.9rem;
  border: var(--border-w) solid var(--black);
  box-shadow: var(--shadow);
  transition: transform 0.1s, box-shadow 0.1s;
  cursor: pointer;
}
.btn-primary:hover { transform: translate(-2px,-2px); box-shadow: 6px 6px 0 var(--black); }
.btn-primary:active { transform: translate(2px,2px); box-shadow: 2px 2px 0 var(--black); }

.btn-ghost {
  display: inline-block;
  padding: 0.75rem 1.75rem;
  background: transparent;
  color: var(--black);
  font-family: var(--font);
  font-weight: 700;
  font-size: 0.9rem;
  border: var(--border-w) solid var(--black);
  box-shadow: var(--shadow);
  transition: transform 0.1s, box-shadow 0.1s, background 0.1s, color 0.1s;
  cursor: pointer;
}
.btn-ghost:hover {
  background: var(--black);
  color: var(--white);
  transform: translate(-2px,-2px);
  box-shadow: 6px 6px 0 var(--black);
}

/* Ghost on dark backgrounds (CTA / dark sections) */
.tut-section--cta .btn-ghost,
.tut-section--dark .btn-ghost {
  color: var(--white);
  border-color: var(--white);
  box-shadow: 4px 4px 0 rgba(255,255,255,0.25);
}
.tut-section--cta .btn-ghost:hover,
.tut-section--dark .btn-ghost:hover {
  background: var(--white);
  color: var(--black);
  box-shadow: 6px 6px 0 rgba(255,255,255,0.25);
}

/* ─── TUTORIAL SECTIONS ─── */
.tut-section {
  padding: 4.5rem 0;
  border-bottom: var(--border-w) solid var(--black);
}
.tut-section--surface { background: var(--bg); }
.tut-section--light   { background: var(--white); }
.tut-section--dark    { background: var(--black); color: var(--white); }
.tut-section--cta     { background: var(--black); color: var(--white); }

/* Section typography */
.section-heading {
  font-size: clamp(1.6rem, 3.5vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.08;
  margin-bottom: 0.85rem;
  color: var(--black);
}
.section-sub {
  font-size: 1rem;
  color: var(--muted);
  max-width: 60ch;
  line-height: 1.65;
}
.tut-dark-heading { color: var(--white); }
.tut-dark-sub     { color: #888; }
.tut-section--dark .section-heading,
.tut-section--cta  .section-heading { color: var(--white); }
.tut-section--dark .section-sub,
.tut-section--cta  .section-sub     { color: #888; }

.tut-inline-code {
  font-family: var(--mono);
  font-size: 0.82em;
  background: rgba(255,255,255,0.1);
  padding: 0.1em 0.4em;
  border: 1px solid rgba(255,255,255,0.2);
}

/* Badge */
.mg-badge {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.25rem 0.65rem;
  background: var(--lime);
  color: var(--black);
  border: 1px solid var(--black);
  margin-bottom: 0.85rem;
}

/* Problem / Intro block */
.tut-intro { margin-bottom: 3rem; }

/* ─── TUTORIAL STEP ─── */
.tut-step {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}
.tut-step-label {
  display: grid;
  grid-template-columns: 4.5rem 1fr;
  gap: 1.5rem;
  align-items: start;
}
.tut-step-number {
  font-family: var(--mono);
  font-size: 3.5rem;
  font-weight: 700;
  color: var(--lime-muted);
  line-height: 1;
  padding-top: 0.15rem;
}
.tut-step-title {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 0.5rem;
  margin-top: 0.6rem;
  line-height: 1.3;
}
.tut-step-title code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: var(--bg);
  padding: 0.1em 0.4em;
  border: 1px solid #D0CCC0;
  font-weight: 400;
}
.tut-step-desc {
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.65;
}
.tut-step-desc code {
  font-family: var(--mono);
  font-size: 0.85em;
  background: var(--bg);
  padding: 0.1em 0.35em;
  border: 1px solid #D0CCC0;
  color: var(--black);
}
.tut-step-desc a {
  color: var(--black);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ─── CODE CARD ─── */
.tut-code-card {
  background: var(--white);
  border: var(--border-w) solid var(--black);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.tut-code-filename {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--white);
  background: var(--black);
  padding: 0.45rem 1rem;
}

/* ─── RENDER GRID (before/after two-column) ─── */
.tut-render-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}
.tut-render-card {
  background: var(--white);
  border: var(--border-w) solid var(--black);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.tut-render-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.5rem 1rem;
  border-bottom: var(--border-w) solid var(--black);
}
.tut-render-card--claude .tut-render-card-header { background: var(--black); }
.tut-render-card--gemini .tut-render-card-header { background: var(--surface); }

.tut-model-badge {
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.2rem 0.55rem;
  border: 1px solid;
}
.tut-render-card--claude .tut-model-badge,
.tut-model-badge--claude {
  background: var(--lime);
  color: var(--black);
  border-color: transparent;
}
.tut-render-card--gemini .tut-model-badge,
.tut-model-badge--gemini {
  background: var(--black);
  color: var(--lime);
  border-color: var(--black);
}
.tut-render-target {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: #888;
}
.tut-render-card--gemini .tut-render-target { color: var(--muted); }

.tut-highlight-line {
  font-size: 0.7em;
  font-family: var(--mono);
  color: var(--lime-muted);
  padding-left: 0.75rem;
}

/* ─── PAIN CARDS ─── */
.tut-pain-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}
.tut-pain-card {
  background: var(--white);
  border: var(--border-w) solid var(--black);
  box-shadow: var(--shadow);
  padding: 1.5rem;
}
.tut-pain-icon { font-size: 1.75rem; margin-bottom: 0.75rem; }
.tut-pain-card h3 { font-size: 0.95rem; font-weight: 700; margin-bottom: 0.4rem; }
.tut-pain-card p  { font-size: 0.875rem; color: var(--muted); line-height: 1.6; }

/* ─── SOLUTION BANNER ─── */
.tut-solution-banner { max-width: 700px; }

/* ─── INSIGHT GRID ─── */
.tut-insight-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}
.tut-insight-card {
  background: var(--white);
  border: var(--border-w) solid var(--black);
  box-shadow: var(--shadow);
  padding: 1.5rem;
}
.tut-insight-icon { font-size: 1.75rem; margin-bottom: 0.75rem; }
.tut-insight-card h3 { font-size: 0.95rem; font-weight: 700; margin-bottom: 0.4rem; }
.tut-insight-card p  { font-size: 0.875rem; color: var(--muted); line-height: 1.6; }
.tut-insight-card code {
  font-family: var(--mono);
  font-size: 0.85em;
  background: var(--bg);
  padding: 0.1em 0.35em;
  border: 1px solid #D0CCC0;
}

/* ─── CTA ─── */
.tut-cta { text-align: center; max-width: 600px; margin: 0 auto; }
.tut-cta .hero-actions { justify-content: center; margin-top: 2rem; }

/* ─── FEATURE EXPLORER (tutorial variant) ─── */
.feature-explorer {
  border: var(--border-w) solid var(--black);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.tut-explorer { box-shadow: var(--shadow); }

.feature-tab-list {
  display: flex;
  flex-wrap: wrap;
  background: var(--surface);
  border-bottom: var(--border-w) solid var(--black);
}
.feature-tab {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  background: transparent;
  border: none;
  border-right: 1px solid var(--black);
  color: var(--muted);
  cursor: pointer;
  font-family: var(--font);
  font-size: 0.82rem;
  font-weight: 600;
  transition: background 0.1s, color 0.1s;
}
.feature-tab:hover { background: var(--lime); color: var(--black); }
.feature-tab.is-active { background: var(--black); color: var(--lime); }

.ftab-icon {
  font-family: var(--mono);
  font-size: 0.8rem;
  min-width: 1.25rem;
  flex-shrink: 0;
}
.tut-ftab-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}
.tut-ftab-icon--claude { background: var(--lime); color: var(--black); }
.tut-ftab-icon--gemini { background: var(--black); color: var(--lime); }
.feature-tab.is-active .tut-ftab-icon--claude { background: var(--lime); }
.feature-tab.is-active .tut-ftab-icon--gemini { background: var(--lime); color: var(--black); }

.ftab-text { display: flex; flex-direction: column; line-height: 1.25; }
.ftab-name { font-size: 0.82rem; font-weight: 600; }
.ftab-desc { font-size: 0.71rem; color: var(--muted); font-weight: 400; }
.feature-tab.is-active .ftab-desc { color: rgba(203,255,77,0.65); }

.feature-panels { background: var(--white); }
.feature-panel { display: none; }
.feature-panel.is-active { display: block; }

.fpanel-header {
  padding: 1.5rem 1.5rem 1rem;
  border-bottom: 1px solid #E0DCD0;
}
.fpanel-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--black);
  margin-bottom: 0.35rem;
}
.fpanel-header p { font-size: 0.875rem; color: var(--muted); line-height: 1.6; }
.fpanel-header code {
  font-family: var(--mono);
  font-size: 0.82em;
  background: var(--bg);
  padding: 0.1em 0.4em;
  border: 1px solid #D0CCC0;
}

/* ─── SHARED CODE STYLES ─── */
.fpanel-code {
  padding: 1.25rem 1.5rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  line-height: 1.8;
  background: var(--white);
  color: #2C2C2C;
  overflow-x: auto;
  white-space: pre;
  margin: 0;
}
.code-keyword  { color: #1A7A3F; font-weight: 700; }
.code-comment  { color: #9A9585; font-style: italic; }
.code-string   { color: #6B5A00; }
.code-var      { color: #1A5FA0; }
.code-meta     { color: #B0AA98; }
.code-function { color: #1A7A3F; font-weight: 700; }

/* ─── FOOTER ─── */
.site-footer {
  background: var(--black);
  padding: 3rem 0;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.footer-logo-img { width: 20px; height: 20px; }
.footer-brand-name {
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--lime);
  letter-spacing: 0.15em;
  text-transform: uppercase;
}
.footer-links { display: flex; gap: 2rem; }
.footer-links a {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--white);
  border-bottom: 2px solid transparent;
  padding-bottom: 2px;
  transition: color 0.15s, border-color 0.15s;
}
.footer-links a:hover { color: var(--lime); border-color: var(--lime); }
.footer-copy {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: #555;
}

/* ─── MG TERMINAL ─── */
.mg-terminal {
  background: #0D0F0E;
  border: var(--border-w) solid var(--black);
  box-shadow: var(--shadow);
  padding: 1.25rem 1.5rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  line-height: 1.7;
  color: #d1d5db;
  margin-top: 1.5rem;
  overflow-x: auto;
}
.mg-terminal-ascii {
  color: var(--lime);
  margin: 0 0 1.1rem;
  font-size: 0.62rem;
  line-height: 1.2;
}
.mg-terminal-started { color: #22d3ee; font-weight: 600; margin: 0 0 1rem; }
.mg-terminal-run-block {
  border-left: 2px solid #7c3aed;
  padding-left: 1rem;
  margin-bottom: 1rem;
}
.mg-run-header    { margin-bottom: 0.25rem; }
.mg-run-arrow     { color: #7B8A9A; margin-right: 0.35rem; }
.mg-run-label     { color: #f3f4f6; font-weight: 600; margin-right: 0.4rem; }
.mg-run-dot       { color: #4ade80; margin-right: 0.3rem; }
.mg-run-dot-running { color: #f97316; margin-right: 0.3rem; }
.mg-run-completed { color: #4ade80; font-weight: 600; margin-right: 0.4rem; }
.mg-run-running   { color: #f97316; font-weight: 600; }
.mg-run-time      { color: #9ca3af; }
.mg-response-label { color: #a78bfa; font-weight: 600; }
.mg-response-text  { color: #f3f4f6; }
.mg-state-updated  { color: #4ade80; font-size: 0.75rem; margin-top: 0.2rem; }
.mg-meta           { color: #6b7280; }
.mg-terminal-footer { color: #6b7280; margin-top: 0.25rem; }
.mg-footer-dot  { color: #4ade80; margin-right: 0.4rem; }
.mg-footer-key  { color: #f3f4f6; }

.mg-question-box {
  border: 1px solid #374151;
  padding: 0.75rem 1rem;
  margin: 0.5rem 0 0.75rem;
  background: #111714;
  color: #f3f4f6;
}
.mg-question-box-list { margin: 0.4rem 0 0 0.25rem; padding: 0; list-style: none; }
.mg-question-box-list li::before { content: "• "; color: #d1d5db; }

.mg-executing-line {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  border-top: 1px solid #22d3ee;
  padding-top: 0.6rem;
  margin: 0.25rem 0 1rem;
  color: #22d3ee;
  font-size: 0.75rem;
}
.mg-executing-dot    { font-size: 0.6rem; }
.mg-executing-detail { font-style: italic; }

.mg-input-prompt-line {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  color: #4ade80;
  margin-bottom: 0.5rem;
}
.mg-input-arrow    { color: #4ade80; font-weight: 600; }
.mg-input-question { color: #4ade80; font-weight: 600; }
.mg-input-box {
  border: 2px solid #7c3aed;
  padding: 0.75rem 1rem;
  color: #6b7280;
  font-style: italic;
}

/* ─── RESPONSIVE ─── */
@media (max-width: 860px) {
  .nav-hamburger { display: flex; }

  .nav-links {
    display: none;
    position: absolute;
    top: 3.5rem;
    left: 0;
    right: 0;
    background: var(--white);
    border-bottom: var(--border-w) solid var(--black);
    flex-direction: column;
    height: auto;
    z-index: 99;
  }
  .nav-links.open { display: flex; }
  .nav-links > li { height: auto; }
  .nav-links > li > a {
    height: auto;
    padding: 0.85rem 1.5rem;
    border-left: none;
    border-top: 1px solid #E0DCD0;
  }
  .nav-dropdown { flex-direction: column; }
  .nav-dropdown-toggle {
    height: auto;
    padding: 0.85rem 1.5rem;
    border-left: none;
    border-top: 1px solid #E0DCD0;
    width: 100%;
    justify-content: space-between;
  }
  .nav-dropdown-menu {
    position: static;
    box-shadow: none;
    border: none;
    border-top: 1px solid #E0DCD0;
    min-width: unset;
    width: 100%;
  }
  .nav-dropdown-menu li a { padding-left: 2.5rem; }
  .nav-cta {
    height: auto;
    padding: 0.85rem 1.5rem;
    border-left: none;
    border-top: 1px solid #E0DCD0;
  }

  .tut-render-grid { grid-template-columns: 1fr; }
  .tut-pain-cards  { grid-template-columns: 1fr; }
  .tut-insight-grid { grid-template-columns: 1fr; }
  .tut-step-label  { grid-template-columns: 3rem 1fr; gap: 1rem; }
  .tut-step-number { font-size: 2.25rem; }
}

@media (max-width: 600px) {
  .hero  { padding: 3rem 0 2.5rem; }
  .tut-section { padding: 3rem 0; }
  .hero-actions { flex-direction: column; align-items: flex-start; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}
