/* Blockchain Explained — Hand-drawn zine aesthetic */

:root {
  /* Palette from hand-drawn zine world */
  --paper: #F5F5F7;
  --ink: #2B2520;
  --ink-muted: #6B5F58;
  --yellow: #FDE047;
  --pink: #FDA4AF;
  --teal: #5EEAD4;
  --rule: #E0E0E2;

  scrollbar-color: var(--rule) transparent;
  caret-color: var(--ink);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #1C1917;
    --ink: #F5F5F4;
    --ink-muted: #A8A29E;
    --yellow: #FEF08A;
    --pink: #FCA5A5;
    --teal: #99F6E4;
    --rule: #2C2927;
  }
}

*,
*::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;
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--yellow);
  color: var(--ink);
}

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

p {
  text-wrap: pretty;
}

h1, h2, h3 {
  text-wrap: balance;
}

mark {
  background: var(--pink);
  color: var(--ink);
  padding: 0 0.2em;
}

/* Presentation container */
.presentation {
  max-width: 900px;
  margin: 0 auto;
  padding: 3rem 2rem;
}

/* Header */
.presentation-header {
  text-align: center;
  margin-bottom: 4rem;
}

.main-title {
  font-size: 3rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 1rem 0;
  position: relative;
  display: inline-block;
  padding-bottom: 0.5rem;
}

.main-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: repeating-linear-gradient(
    90deg,
    var(--ink) 0px,
    var(--ink) 8px,
    transparent 8px,
    transparent 16px
  );
  opacity: 0.3;
}

.mascot-header {
  display: inline-block;
  width: 80px;
  height: 80px;
  vertical-align: middle;
  margin-left: 1rem;
  color: var(--ink);
}

.intro {
  font-size: 1.125rem;
  color: var(--ink-muted);
  margin: 0 0 2rem 0;
}

/* Progress dots */
.progress-dots {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.progress-dot {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2.5px solid var(--ink);
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--ink);
}

.progress-dot:hover {
  background: var(--yellow);
  transform: scale(1.1);
}

.progress-dot.active {
  background: var(--ink);
  color: white;
}

.progress-dot span {
  display: block;
}

/* Slides container */
.slides-container {
  position: relative;
  min-height: 600px;
}

.slide {
  display: none;
  animation: slideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.slide.active {
  display: block;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .slide {
    animation: none;
  }
  .progress-dot {
    transition: none;
  }
}

/* Slide structure */
.slide-number {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--ink);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
}

.slide-title {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 1.5rem 0;
  position: relative;
  display: inline-block;
  padding-bottom: 0.25rem;
}

.slide-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: repeating-linear-gradient(
    90deg,
    var(--ink) 0px,
    var(--ink) 6px,
    transparent 6px,
    transparent 12px
  );
  opacity: 0.3;
}

.slide-content {
  line-height: 1.7;
}

.slide-intro {
  font-size: 1.125rem;
  margin: 0 0 2rem 0;
  line-height: 1.7;
}

/* Diagrams */
.diagram {
  padding: 2rem;
  margin: 2rem 0;
  position: relative;
}

/* Blockchain chain diagram */
.blockchain-chain-diagram {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.chain-block {
  background: white;
  border: 2.5px solid var(--ink);
  border-radius: 6px;
  padding: 1rem;
  min-width: 140px;
  text-align: center;
}

.block-label {
  font-weight: 700;
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
}

.block-data {
  font-size: 0.875rem;
  color: var(--ink-muted);
}

.chain-arrow {
  width: 60px;
  height: 20px;
  color: var(--ink);
  flex-shrink: 0;
}

/* Network diagram */
.network-comparison {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}

.network-label {
  font-weight: 700;
  margin-bottom: 1rem;
  font-size: 0.875rem;
}

.network-label.bad {
  color: var(--pink);
}

.network-label.good {
  color: var(--teal);
}

.central-network {
  position: relative;
  padding: 3rem 2rem;
}

.central-server {
  width: 80px;
  height: 80px;
  border: 2.5px solid var(--ink);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  background: white;
  font-size: 0.75rem;
  font-weight: 600;
}

.node-ring {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: space-around;
}

.node-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--ink);
  background: white;
}

.decentral-network {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  padding: 1rem;
}

.mesh-node {
  border: 2.5px solid var(--ink);
  border-radius: 6px;
  padding: 1rem;
  background: white;
  font-size: 0.75rem;
  font-weight: 600;
  text-align: center;
  position: relative;
}

.mesh-node:nth-child(3) {
  grid-column: span 2;
}

/* Hash diagram */
.hash-example {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.hash-input,
.hash-output {
  background: white;
  border: 2.5px solid var(--ink);
  border-radius: 6px;
  padding: 1rem;
  width: 100%;
  max-width: 400px;
}

.hash-input.small,
.hash-output.small {
  max-width: 500px;
}

.input-label,
.output-label {
  font-weight: 700;
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
}

.input-text,
.output-text {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.875rem;
  word-break: break-all;
}

.hash-function {
  background: var(--yellow);
  border: 2.5px solid var(--ink);
  border-radius: 6px;
  padding: 1rem 1.5rem;
  font-weight: 700;
}

.hash-arrow-down {
  width: 20px;
  height: 40px;
  color: var(--ink);
}

.hash-change-example {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 2px dashed var(--rule);
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.change-note {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--ink-muted);
}

.highlight-pink {
  color: #E11D48;
  font-weight: 600;
}

/* Block structure diagram */
.detailed-block {
  background: white;
  border: 2.5px solid var(--ink);
  border-radius: 6px;
  padding: 1.5rem;
  max-width: 500px;
  margin: 0 auto 2rem;
}

.block-header {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  text-align: center;
}

.block-field {
  padding: 0.75rem;
  margin-bottom: 0.5rem;
  border-radius: 4px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
  font-size: 0.875rem;
}

.block-field.highlight-teal {
  background: var(--teal);
  font-weight: 600;
}

.field-label {
  font-weight: 600;
}

.field-value {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  word-break: break-all;
}

.chain-explanation {
  text-align: center;
}

.pointer-arrow {
  width: 100px;
  height: 60px;
  color: var(--ink);
  margin: 0 auto;
  display: block;
}

.note-text {
  font-size: 0.875rem;
  font-weight: 600;
  margin: 0.5rem 0 0;
}

/* Consensus diagram */
.consensus-flow {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.consensus-step {
  background: white;
  border: 2.5px solid var(--ink);
  border-radius: 6px;
  padding: 1rem 1.5rem;
  text-align: center;
  width: 100%;
  max-width: 400px;
}

.step-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

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

.flow-arrow {
  width: 20px;
  height: 40px;
  color: var(--ink);
}

.consensus-types {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
}

.consensus-card {
  background: white;
  border: 2.5px solid var(--ink);
  border-radius: 6px;
  padding: 1.5rem;
}

.consensus-card strong {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 1.125rem;
}

.consensus-card p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--ink-muted);
}

/* Mining diagram */
.mining-process {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  align-items: center;
}

.mining-box {
  background: white;
  border: 2.5px solid var(--ink);
  border-radius: 6px;
  padding: 1.5rem;
  width: 100%;
  max-width: 500px;
}

.mining-label {
  font-weight: 700;
  margin-bottom: 1rem;
  text-align: center;
}

.mining-equation {
  background: var(--yellow);
  border: 2px solid var(--ink);
  border-radius: 4px;
  padding: 1rem;
  text-align: center;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  margin-bottom: 1rem;
  font-weight: 600;
}

.mining-tries {
  font-size: 0.875rem;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

.try-line {
  padding: 0.5rem;
  margin-bottom: 0.25rem;
}

.try-line.dots {
  text-align: center;
  color: var(--ink-muted);
}

.try-line.success {
  background: var(--teal);
  border-radius: 4px;
  font-weight: 600;
}

.reward-box {
  background: white;
  border: 2.5px solid var(--ink);
  border-radius: 6px;
  padding: 1.5rem;
  text-align: center;
}

.reward-box p {
  margin: 0.5rem 0 0;
  font-size: 0.875rem;
}

.highlight-teal {
  color: var(--teal);
  background: var(--teal);
  color: var(--ink);
  font-weight: 700;
}

/* Immutability diagram */
.tamper-attempt {
  width: 100%;
}

.attempt-label {
  font-weight: 700;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  margin-bottom: 1.5rem;
  text-align: center;
}

.attempt-label.highlight-pink {
  background: var(--pink);
}

.chain-tamper {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.tamper-block {
  background: white;
  border: 2.5px solid var(--ink);
  border-radius: 6px;
  padding: 1rem;
  min-width: 140px;
  flex: 1;
  text-align: center;
}

.tamper-block.changed {
  background: var(--yellow);
}

.tamper-block.broken {
  background: var(--pink);
}

.mini-label {
  font-weight: 700;
  font-size: 0.75rem;
  margin-bottom: 0.5rem;
}

.mini-hash {
  font-size: 0.75rem;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

.edit-mark,
.break-mark {
  font-size: 0.75rem;
}

.changed-hash {
  color: #E11D48;
  font-weight: 700;
}

.tamper-result {
  background: white;
  border: 2.5px solid var(--ink);
  border-radius: 6px;
  padding: 1.5rem;
}

.result-text {
  margin: 0;
  font-size: 0.875rem;
}

/* Smart contract diagram */
.contract-example {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  align-items: center;
}

.contract-box {
  background: white;
  border: 2.5px solid var(--ink);
  border-radius: 6px;
  padding: 1.5rem;
  width: 100%;
  max-width: 400px;
}

.contract-header {
  font-weight: 700;
  text-align: center;
  margin-bottom: 1rem;
  font-size: 1.125rem;
}

.contract-code {
  background: var(--yellow);
  border: 2px solid var(--ink);
  border-radius: 4px;
  padding: 1rem;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.875rem;
}

.code-line {
  margin-bottom: 0.5rem;
}

.code-line:last-child {
  margin-bottom: 0;
}

.contract-flow {
  width: 100%;
  max-width: 400px;
}

.flow-step {
  background: white;
  border: 2.5px solid var(--ink);
  border-radius: 6px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.flow-step.highlight-teal {
  background: var(--teal);
  font-weight: 600;
}

.flow-step:last-child {
  margin-bottom: 0;
}

.step-num {
  font-weight: 700;
  margin-right: 0.5rem;
}

/* Public vs Private diagram */
.blockchain-types {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.type-card {
  background: white;
  border: 2.5px solid var(--ink);
  border-radius: 6px;
  padding: 1.5rem;
}

.type-header {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 1rem;
  text-align: center;
}

.type-features {
  list-style: none;
  padding: 0;
  margin: 0;
}

.type-features li {
  padding-left: 1.5rem;
  margin-bottom: 0.75rem;
  position: relative;
  font-size: 0.875rem;
}

.type-features li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--teal);
  font-weight: 700;
}

.type-features li:last-child {
  margin-bottom: 0;
}

.middle-ground {
  background: white;
  border: 2.5px solid var(--ink);
  border-radius: 6px;
  padding: 1.5rem;
}

.hybrid-note {
  font-size: 0.875rem;
  text-align: center;
}

/* Use cases diagram */
.use-cases-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
}

.use-case-card {
  background: white;
  border: 2.5px solid var(--ink);
  border-radius: 6px;
  padding: 1.5rem;
  text-align: center;
}

.use-case-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
}

.use-case-title {
  font-weight: 700;
  font-size: 1.125rem;
  margin-bottom: 0.5rem;
}

.use-case-card p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--ink-muted);
}

.conclusion {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 2px dashed var(--rule);
}

.conclusion-text {
  font-size: 1.125rem;
  margin: 0;
  text-align: center;
}

/* Key points */
.key-points {
  list-style: none;
  padding: 0;
  margin: 2rem 0 0;
}

.key-points li {
  padding-left: 1.5rem;
  margin-bottom: 0.75rem;
  position: relative;
}

.key-points li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--teal);
  font-weight: 700;
}

.key-points li:last-child {
  margin-bottom: 0;
}

/* Navigation controls */
.slide-controls {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  margin-top: 4rem;
}

.nav-button {
  background: white;
  border: 2.5px solid var(--ink);
  border-radius: 8px;
  padding: 1rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  min-height: 48px;
  min-width: 140px;
}

.nav-button:hover:not(:disabled) {
  background: var(--yellow);
  transform: translateY(-2px);
}

.nav-button:active:not(:disabled) {
  transform: translateY(0);
}

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

.nav-button svg {
  width: 24px;
  height: 24px;
  color: var(--ink);
}

.prev-button {
  justify-content: flex-start;
}

.next-button {
  justify-content: flex-end;
}

/* Responsive */
@media (max-width: 768px) {
  .presentation {
    padding: 2rem 1.5rem;
  }

  .main-title {
    font-size: 2rem;
  }

  .mascot-header {
    width: 60px;
    height: 60px;
  }

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

  .diagram {
    padding: 1.5rem;
  }

  .blockchain-chain-diagram {
    flex-direction: column;
  }

  .chain-arrow {
    transform: rotate(90deg);
  }

  .network-comparison,
  .blockchain-types,
  .consensus-types {
    grid-template-columns: 1fr;
  }

  .use-cases-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }

  .slide-controls {
    gap: 1rem;
  }

  .nav-button {
    min-width: 100px;
    padding: 0.75rem 1rem;
  }
}

@media (max-width: 480px) {
  body {
    font-size: 16px;
  }

  .presentation {
    padding: 1.5rem 1rem;
  }

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

  .mascot-header {
    display: block;
    margin: 1rem auto 0;
  }

  .slide-number {
    width: 40px;
    height: 40px;
    font-size: 1.25rem;
  }

  .diagram {
    padding: 1rem;
  }

  .use-cases-grid {
    grid-template-columns: 1fr;
  }
}

/* Print styles */
@media print {
  body {
    background: white;
    color: black;
  }

  .progress-dots,
  .slide-controls {
    display: none;
  }

  .slide {
    display: block !important;
    page-break-after: always;
  }

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

  .diagram {
    border-color: black;
    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%); }
