:root {
  --bg: #ffffff;
  --surface: #f8f8f6;
  --surface-2: #eeeeea;
  --surface-elev: rgba(255, 255, 255, 0.94);
  --ink: #0a0a0a;
  --blue: #2600ff;
  --blue-bright: #2600ff;
  --blue-soft: rgba(38, 0, 255, 0.1);
  --blue-faint: rgba(38, 0, 255, 0.04);
  --green: #0a8754;
  --line: rgba(10, 10, 10, 0.14);
  --line-soft: rgba(10, 10, 10, 0.08);
  --muted: #5e5e58;
  --font: "Inter Tight", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SFMono-Regular", Consolas, Menlo, Monaco, monospace;
}

html[data-theme="dark"] {
  --bg: #0b0b0b;
  --surface: #141414;
  --surface-2: #1c1c1c;
  --surface-elev: rgba(11, 11, 11, 0.94);
  --ink: #f7f7f2;
  --blue: #2600ff;
  --blue-bright: #4422ff;
  --blue-soft: rgba(38, 0, 255, 0.22);
  --blue-faint: rgba(38, 0, 255, 0.08);
  --green: #47e0a3;
  --line: rgba(255, 255, 255, 0.15);
  --line-soft: rgba(255, 255, 255, 0.08);
  --muted: #999994;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-weight: 400;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button,
input,
a {
  font: inherit;
  letter-spacing: inherit;
  color: inherit;
}

a {
  text-decoration: none;
}

/* =========================================================
   TOP MINIMAL BAR (FIXED, NEVER SCROLLS AWAY)
   ========================================================= */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: 50px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: var(--surface-elev);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.wordmark {
  font-size: 15px;
  font-weight: 600;
  text-transform: lowercase;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.quiet-button {
  border: 0;
  border-bottom: 1px solid var(--ink);
  padding: 0 0 1px;
  background: none;
  font-size: 13px;
  font-weight: 600;
  text-transform: lowercase;
  cursor: pointer;
  opacity: 0.85;
  transition: opacity 0.18s, color 0.18s, border-color 0.18s;
}

.quiet-button:hover {
  opacity: 1;
  color: var(--blue-bright);
  border-bottom-color: var(--blue-bright);
}

/* =========================================================
   PAGE CONTAINER
   ========================================================= */
.guide-shell {
  max-width: 820px;
  margin: 0 auto;
  padding: 80px 24px 120px;
}

/* =========================================================
   SECTION 0: LEAD MAGNET INTRO
   ========================================================= */
.lead-intro {
  margin-bottom: 40px;
}

.lead-p {
  font-size: 17px;
  line-height: 1.55;
  margin: 0 0 16px;
  color: var(--ink);
}

.th32-brand-link {
  color: var(--blue);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--blue);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
  transition: opacity 0.18s;
}

.th32-brand-link:hover {
  opacity: 0.75;
}

/* =========================================================
   8 STUDENT WORKS: 4x2 on desktop, 2x4 on mobile
   ========================================================= */
.student-grid-8 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 20px 0 28px;
}

.stu-item {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stu-card {
  position: relative;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--line);
  background: #000;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.22s cubic-bezier(0.2, 0.9, 0.3, 1), border-color 0.2s, box-shadow 0.22s;
}

.stu-card:hover {
  transform: translateY(-2px);
  border-color: var(--blue);
  box-shadow: 0 8px 20px rgba(38, 0, 255, 0.2);
}

.stu-card video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}


.stu-play-indicator {
  position: absolute;
  bottom: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  background: rgba(11, 11, 11, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 10px;
  pointer-events: none;
  transition: transform 0.18s, background 0.18s;
}

.stu-card:hover .stu-play-indicator {
  background: var(--blue);
  transform: scale(1.08);
}

.stu-handle {
  overflow-wrap: anywhere;
  line-height: 1.4;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: -0.01em;
  padding: 0 2px;
}

@media (max-width: 680px) {
  .student-grid-8 {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
}

/* Callout block for early list registration (NO BORDER, CLEAN INLINE) */
.early-list-block {
  margin: 24px 0 32px;
  padding: 0;
  border: none;
  background: transparent;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.early-list-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  text-transform: lowercase;
  color: var(--ink);
}

.early-list-bullets {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.early-list-bullets li {
  position: relative;
  padding-left: 18px;
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
}

.early-list-bullets li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--blue);
  font-weight: 700;
}

.cta-button {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 8px;
  padding: 11px 20px;
  border: 1px solid var(--blue);
  background: var(--blue);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  text-transform: lowercase;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.14s ease, box-shadow 0.14s ease, opacity 0.14s ease;
  margin-top: 4px;
}

.cta-button:hover {
  transform: translateY(-1px);
  box-shadow: 2px 2px 0 var(--ink);
  opacity: 0.95;
}

/* Clean instruction divider */
.instruction-divider {
  padding-top: 28px;
  border-top: 1px solid var(--line);
  margin-top: 24px;
  margin-bottom: 24px;
}

/* UNIFIED SECTION HEADINGS (01. Подключение коннекторов / Инструкция) */
.section-heading,
.instruction-divider h2,
.step-header h3 {
  font-family: var(--font);
  font-size: 19px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0;
}

/* =========================================================
   SEQUENTIAL VERTICAL STEPS (01 — 05)
   ========================================================= */
.step-section {
  padding: 28px 0;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.step-section:first-of-type {
  border-top: 0;
  padding-top: 0;
}

/* Clean step header */
.step-header {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.step-number {
  font-size: 19px;
  font-weight: 600;
  color: var(--blue);
  font-variant-numeric: tabular-nums;
  line-height: 1.35;
}

.step-lead-text {
  margin: 0;
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
}

.step-lead-text strong {
  font-weight: 600;
}

/* =========================================================
   STEP 01: 3 MINI CARDS (Chrome, Notion, Figma)
   ========================================================= */
.connectors-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 4px;
}

.conn-mini-card {
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.conn-mini-top {
  display: flex;
  align-items: center;
  gap: 10px;
}

.conn-mini-top b {
  font-size: 14.5px;
  font-weight: 600;
}

.conn-icon-box {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--ink);
}

.conn-icon-box svg {
  width: 20px;
  height: 20px;
}

.conn-mini-card p {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--muted);
}

/* =========================================================
   STEP 02: 2 ACTION BULLETS + FOLDER TREE
   ========================================================= */
.step-actions-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.step-action-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.step-action-num {
  font-size: 14px;
  font-weight: 600;
  color: var(--blue);
  line-height: 1.4;
  padding-top: 1px;
}

.step-action-item b {
  display: block;
  font-size: 15px;
  font-weight: 600;
  text-transform: lowercase;
  margin-bottom: 3px;
}

.step-action-item p {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--muted);
}

.step-action-item code {
  font-family: var(--mono);
  font-size: 12.5px;
  padding: 2px 6px;
  background: var(--surface-2);
  color: var(--ink);
}

.micro-folder-tree {
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 14px 18px;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.micro-folder-tree b {
  font-weight: 600;
}

.sb-row {
  color: var(--blue);
}

/* =========================================================
   STEP 03: 2 TOGGLE CHIPS
   ========================================================= */
.checkbox-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 4px;
}

.toggle-chip {
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 14px 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  user-select: none;
  transition: border-color 0.16s, background-color 0.16s, transform 0.14s;
}

.toggle-chip:hover {
  border-color: var(--blue);
  transform: translateY(-1px);
}

.toggle-chip.is-active {
  border-color: var(--blue);
  background: var(--blue-soft);
}

.toggle-box-ui {
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: transparent;
  flex-shrink: 0;
  margin-top: 2px;
  transition: all 0.15s;
}

.toggle-chip.is-active .toggle-box-ui {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

.toggle-chip-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.toggle-chip-copy b {
  font-size: 15px;
  font-weight: 600;
  text-transform: lowercase;
  color: var(--ink);
}

.toggle-chip-copy span {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.4;
}

/* =========================================================
   PROMPT TERMINAL BLOCKS (Steps 3 & 4)
   ========================================================= */
.prompt-container {
  border: 1px solid var(--line);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  margin-top: 4px;
}

.prompt-header {
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.prompt-badge-wrap {
  display: flex;
  align-items: center;
}

.prompt-badge {
  font-size: 13px;
  text-transform: lowercase;
  color: var(--muted);
  font-weight: 600;
}

.prompt-badge b {
  color: var(--blue);
}

.prompt-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.download-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--blue);
  background: var(--blue);
  color: #fff;
  padding: 7px 14px;
  font-size: 12.5px;
  font-weight: 600;
  text-transform: lowercase;
  cursor: pointer;
  transition: transform 0.14s ease, opacity 0.14s ease, box-shadow 0.14s ease;
}

.download-button:hover {
  transform: translateY(-1px);
  opacity: 0.94;
  box-shadow: 2px 2px 0 var(--ink);
}

.download-button.downloaded {
  background: var(--green);
  border-color: var(--green);
  color: #0b0b0b;
}

.download-button svg,
.copy-button svg {
  flex-shrink: 0;
}

.copy-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  padding: 7px 13px;
  font-size: 12.5px;
  font-weight: 600;
  text-transform: lowercase;
  cursor: pointer;
  transition: transform 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}

.copy-button:hover {
  transform: translateY(-1px);
  border-color: var(--blue);
  color: var(--blue);
}

.copy-button.copied {
  background: var(--green);
  border-color: var(--green);
  color: #0b0b0b;
}

.prompt-hint-bar {
  padding: 9px 16px;
  background: var(--surface-elev);
  border-bottom: 1px solid var(--line-soft);
  font-size: 13px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.45;
}

.prompt-hint-icon {
  font-size: 13px;
  flex-shrink: 0;
}

.prompt-hint-bar strong {
  color: var(--ink);
  font-weight: 600;
}

.prompt-box-text {
  margin: 0;
  padding: 16px 18px;
  height: 300px;
  overflow-y: auto;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--ink);
  background: var(--surface);
}

.prompt-highlight {
  display: block;
  background: var(--blue-soft);
  border-left: 3px solid var(--blue);
  padding: 8px 12px;
  margin: 10px 0;
  color: var(--ink);
}

/* =========================================================
   STEP 05: USE CASES (3 Cards)
   ========================================================= */
.use-cases-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}

.use-case-card {
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.use-case-card > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.use-case-card span {
  font-size: 13px;
  font-weight: 600;
  color: var(--blue);
  text-transform: lowercase;
}

.use-case-card p {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.45;
  color: var(--ink);
}

.copy-case-btn {
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 600;
  text-transform: lowercase;
  cursor: pointer;
  flex-shrink: 0;
  white-space: nowrap;
  transition: all 0.14s ease;
}

.copy-case-btn:hover {
  border-color: var(--blue);
  color: var(--blue);
  transform: translateY(-1px);
}

.copy-case-btn.copied {
  background: var(--green);
  border-color: var(--green);
  color: #0b0b0b;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 860px) {
  .connectors-row,
  .checkbox-row {
    grid-template-columns: 1fr;
  }

  .topbar {
    padding: 0 16px;
  }

  .guide-shell {
    padding: 68px 16px 80px;
  }

  .lead-p {
    font-size: 16px;
  }

  .step-header h3 {
    font-size: 17px;
  }

  .step-number {
    font-size: 17px;
  }

  .step-lead-text {
    font-size: 15.5px;
  }

  .prompt-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .prompt-actions {
    width: 100%;
    display: flex;
    gap: 8px;
  }

  .download-button,
  .copy-button {
    flex: 1 1 auto;
    justify-content: center;
    padding: 8px 10px;
    font-size: 12px;
  }

  .use-case-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .copy-case-btn {
    align-self: flex-start;
    width: 100%;
    text-align: center;
    padding: 8px;
  }
}

/* =========================================================
   LIGHTBOX MODAL
   ========================================================= */
.lightbox[hidden] {
  display: none !important;
}

.lightbox {
  position: fixed;
  z-index: 220;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.lightbox-card {
  position: relative;
  z-index: 2;
  width: min(92vw, 640px);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  background: var(--bg);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
}

.lightbox-head {
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

.lightbox-head button {
  border: 0;
  background: none;
  cursor: pointer;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: lowercase;
  padding: 2px 6px;
}

.lightbox-head button:hover {
  color: var(--blue-bright);
}

.lightbox-stage {
  position: relative;
  display: grid;
  place-items: center;
  background: #000;
  overflow: hidden;
}

.lightbox-stage video {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  max-height: 70vh;
  outline: none;
}

.lightbox-foot {
  overflow-wrap: anywhere;
  padding: 10px 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.closing-section {
  border-top: 1px solid var(--line);
  margin-top: 40px;
  padding-top: 28px;
}

.closing-copy {
  font-size: 17px;
  line-height: 1.55;
  margin: 18px 0;
}

.closing-copy p { margin: 0 0 16px; }
.closing-copy p:last-child { margin-bottom: 0; }
.closing-section .cta-button { max-width: 100%; }

.video-status {
  position: absolute;
  left: 12px;
  right: 12px;
  top: 12px;
  margin: 0;
  padding: 10px 12px;
  color: #fff;
  background: rgba(0, 0, 0, 0.8);
  font-size: 13px;
  pointer-events: auto;
}
.video-status a { color: inherit; text-decoration: underline; }
.stu-card:focus-visible { outline: 3px solid var(--blue-bright); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) {
  .stu-card { transition: none; }
  .stu-card:hover { transform: none; }
}
