/* =============================================================================
   BLOCKCHAIN EXPLAINED - Brick Build Instruction Manual Aesthetic
   ============================================================================= */

:root {
  /* Brick instruction palette - LEGO manual inspired */
  --sky-blue: #4DABF7;
  --true-black: #000000;
  --block-red: #E03131;
  --inventory-yellow: #FAB005;
  --content-white: #FFFFFF;

  /* Semantic mappings */
  --bg: var(--sky-blue);
  --ink: var(--true-black);
  --surface: var(--content-white);
  --new-piece: var(--block-red);
  --established-piece: var(--inventory-yellow);

  /* Grid and spacing */
  --grid-unit: 20px;

  scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
  caret-color: var(--true-black);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    /* Dark mode palette - desaturated and lifted */
    --sky-blue: #1A1F26;
    --true-black: #E8E8E8;
    --block-red: #FF7777;
    --inventory-yellow: #FFD43B;
    --content-white: #252A31;

    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
    caret-color: var(--true-black);
    color-scheme: dark;
  }
}

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

html {
  overflow-x: clip;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
}

/* =============================================================================
   SLIDE DECK
   ============================================================================= */

.deck {
  position: relative;
  width: 100%;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.slide {
  display: none;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 2rem;
}

.slide:first-child {
  display: block;
}

/* =============================================================================
   STEP NUMBER & TITLE
   ============================================================================= */

.step-number {
  font-size: 5rem;
  font-weight: 900;
  color: var(--true-black);
  line-height: 1;
  margin: 0 0 1rem 0;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.step-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--true-black);
  margin: 0 0 2rem 0;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  line-height: 1.2;
  text-wrap: balance;
}

/* =============================================================================
   DIAGRAMS (SVG)
   ============================================================================= */

.diagram {
  display: block;
  width: 100%;
  max-width: 800px;
  height: auto;
  margin: 0 auto 2rem;
  background: var(--bg);
}

/* SVG text styling */
.label-text {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 20px;
  font-weight: 700;
  fill: var(--true-black);
  text-anchor: middle;
  dominant-baseline: middle;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.label-text.small {
  font-size: 16px;
  font-weight: 600;
}

.label-text.tiny {
  font-size: 12px;
  font-weight: 600;
}

/* New pieces highlighted in red */
.new-piece rect,
.new-piece circle {
  stroke: var(--block-red);
  stroke-width: 3;
}

.new-piece text {
  fill: var(--block-red);
}

/* Established pieces in yellow/black */
.established-piece rect,
.established-piece circle {
  stroke: var(--true-black);
}

.established-piece text {
  fill: var(--true-black);
}

/* =============================================================================
   CONTENT WINDOW (WHITE PANEL)
   ============================================================================= */

.content-window {
  background: var(--content-white);
  border: 3px solid var(--true-black);
  padding: 2rem;
  margin: 0 auto;
  max-width: 700px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.content-window p {
  margin: 0 0 1rem 0;
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--true-black);
  text-wrap: pretty;
}

.content-window p:last-child {
  margin-bottom: 0;
}

.content-window strong {
  font-weight: 700;
}

.content-window dl {
  margin: 0 0 1.5rem 0;
}

.content-window dt {
  font-weight: 700;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 1rem 0 0.25rem 0;
  color: var(--true-black);
}

.content-window dt:first-child {
  margin-top: 0;
}

.content-window dd {
  margin: 0 0 0.5rem 0;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--true-black);
}

/* =============================================================================
   PROGRESS INDICATOR
   ============================================================================= */

.progress-indicator {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.75rem;
  padding: 1rem;
  background: var(--content-white);
  border: 2px solid var(--true-black);
  border-radius: 2rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 100;
}

.progress-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--true-black);
  background: transparent;
  cursor: pointer;
  padding: 0;
  transition: background-color 0.2s ease, transform 0.2s ease;
  min-width: auto;
  min-height: auto;
}

.progress-dot:hover {
  transform: scale(1.2);
  background: rgba(0, 0, 0, 0.1);
}

.progress-dot.active {
  background: var(--true-black);
}

.progress-dot:focus-visible {
  outline: 2px solid var(--block-red);
  outline-offset: 3px;
}

/* =============================================================================
   NAVIGATION CONTROLS
   ============================================================================= */

.nav-controls {
  position: fixed;
  top: 50%;
  left: 0;
  right: 0;
  transform: translateY(-50%);
  display: flex;
  justify-content: space-between;
  padding: 0 2rem;
  pointer-events: none;
  z-index: 50;
}

.nav-button {
  pointer-events: auto;
  width: 60px;
  height: 60px;
  border: 3px solid var(--true-black);
  background: var(--content-white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  color: var(--true-black);
}

.nav-button:hover:not(:disabled) {
  background: var(--block-red);
  border-color: var(--block-red);
  color: var(--content-white);
  transform: scale(1.1);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

.nav-button:hover:not(:disabled) svg {
  stroke: var(--content-white);
}

.nav-button:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.nav-button:focus-visible {
  outline: 2px solid var(--block-red);
  outline-offset: 4px;
}

.nav-button svg {
  stroke: var(--true-black);
  transition: stroke 0.2s ease;
}

/* =============================================================================
   BROWSER SURFACES
   ============================================================================= */

::selection {
  background: var(--block-red);
  color: var(--content-white);
}

:focus-visible {
  outline: 2px solid var(--block-red);
  outline-offset: 3px;
}

/* =============================================================================
   RESPONSIVE
   ============================================================================= */

@media (max-width: 900px) {
  .deck {
    padding: 1.5rem;
  }

  .slide {
    padding: 2rem 1rem;
  }

  .step-number {
    font-size: 3.5rem;
  }

  .step-title {
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
  }

  .content-window {
    padding: 1.5rem;
  }

  .content-window p {
    font-size: 1rem;
  }

  .nav-button {
    width: 50px;
    height: 50px;
  }

  .nav-controls {
    padding: 0 1rem;
  }
}

@media (max-width: 600px) {
  .step-number {
    font-size: 2.5rem;
  }

  .step-title {
    font-size: 1.5rem;
  }

  .diagram {
    margin-bottom: 1.5rem;
  }

  .content-window {
    padding: 1.25rem;
  }

  .content-window p {
    font-size: 0.9375rem;
  }

  .progress-indicator {
    bottom: 1rem;
    gap: 0.5rem;
    padding: 0.75rem;
  }

  .progress-dot {
    width: 12px;
    height: 12px;
  }

  .nav-button {
    width: 44px;
    height: 44px;
  }

  .nav-button svg {
    width: 20px;
    height: 20px;
  }
}

/* =============================================================================
   MOTION
   ============================================================================= */

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }

  .progress-dot,
  .nav-button {
    transition: all 0.2s ease;
  }
}

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

/* =============================================================================
   PRINT
   ============================================================================= */

@media print {
  body {
    background: white;
    color: black;
  }

  .slide {
    display: block !important;
    page-break-after: always;
    max-width: 100%;
    padding: 1rem;
  }

  .slide:last-child {
    page-break-after: auto;
  }

  .progress-indicator,
  .nav-controls {
    display: none;
  }

  .diagram {
    max-width: 100%;
    page-break-inside: avoid;
  }

  .content-window {
    border: 2px solid black;
    box-shadow: none;
    page-break-inside: avoid;
  }
}
@media (max-width: 480px) {
  /* --impeccable-mobile-pad */
  body { padding-inline: max(1rem, 16px); }
  .container, [class*="container"], section, header, footer, nav, main, article {
    padding-inline: max(1rem, 16px);
  }
}
/* --impeccable-measure */
p, li, dt, dd, blockquote, figcaption, td, th { max-width: min(75ch, 100%); }
