@import url('https://fonts.googleapis.com/css2?family=Fira+Sans+Condensed:wght@400;500;600;700&family=Neucha&display=swap');

:root {
  color-scheme: light;
  --paper: #ffffff;
  --paper-alt: #eef1ed;
  --ink: #161a1b;
  --ink-soft: #364142;
  --line: #b7c0bd;
  --teal: #00a8ae;
  --teal-dark: #006c71;
  --coral: #b72f40;
  --yellow: #f7bd3c;
  --mint: #bfe5d0;
  --white: #ffffff;
  --shadow: 0 10px 22px rgb(22 26 27 / 14%);
  --display: "Fira Sans Condensed", Arial, sans-serif;
  --body: "Fira Sans Condensed", Arial, sans-serif;
  --hand: "Neucha", "Comic Sans MS", cursive;
  --max-width: 1240px;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #172224;
  --paper-alt: #203234;
  --ink: #f6f3e9;
  --ink-soft: #c8d2cc;
  --line: #526365;
  --teal: #42cdd1;
  --teal-dark: #a3ecdf;
  --coral: #ff837b;
  --yellow: #ffd263;
  --mint: #80bda9;
  --white: #263638;
  --shadow: 0 16px 42px rgb(0 0 0 / 24%);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 18px;
  font-weight: 500;
  line-height: 1.42;
}

button, a { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }

.skip-link {
  background: var(--yellow);
  color: #161a1b;
  left: 16px;
  padding: 10px 14px;
  position: fixed;
  top: -60px;
  z-index: 20;
}

.skip-link:focus { top: 16px; }

.section-shell {
  margin: 0 auto;
  max-width: var(--max-width);
  padding-left: 32px;
  padding-right: 32px;
}

.site-header {
  align-items: center;
  border-bottom: 2px solid var(--ink);
  display: flex;
  justify-content: space-between;
  margin: 0 auto;
  max-width: var(--max-width);
  min-height: 84px;
  padding: 12px 32px;
}

.brand {
  align-items: center;
  display: inline-flex;
  font-family: var(--display);
  font-size: 25px;
  font-weight: 700;
  gap: 10px;
  letter-spacing: 0;
  text-decoration: none;
}

.brand-mark {
  align-items: center;
  background: var(--teal);
  border: 2px solid var(--ink);
  color: var(--ink);
  display: inline-flex;
  font-family: var(--hand);
  font-size: 31px;
  height: 39px;
  justify-content: center;
  line-height: 1;
  transform: rotate(-5deg);
  width: 39px;
}

.header-controls { align-items: center; display: flex; gap: 18px; }

.theme-switch, .mode-switch { align-items: center; display: flex; }

.theme-switch { border: 1px solid var(--line); }
.theme-switch button, .mode-switch button {
  background: transparent;
  border: 0;
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  padding: 9px 10px;
}

.theme-switch button[aria-pressed="true"] {
  background: var(--ink);
  color: var(--paper);
}

.mode-switch { gap: 3px; }
.mode-switch button { border-bottom: 2px solid transparent; padding: 8px 8px 6px; }
.mode-switch button[aria-pressed="true"] { border-bottom-color: var(--coral); color: var(--ink); }

button:focus-visible, a:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; }

.hero {
  align-items: center;
  display: grid;
  gap: 44px;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.95fr) minmax(180px, 0.55fr);
  min-height: calc(100vh - 84px);
  padding-bottom: 72px;
  padding-top: 60px;
}

.hero-copy { max-width: 515px; }
.hand-note {
  color: var(--teal-dark);
  font-family: var(--hand);
  font-size: 27px;
  line-height: 1.05;
  margin: 0 0 18px;
  transform: rotate(-2deg);
}

h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { font-family: var(--display); }
h1 {
  font-size: clamp(3.8rem, 7vw, 6.8rem);
  font-weight: 700;
  letter-spacing: 0;
  line-height: 0.98;
  margin-bottom: 27px;
}
h2 {
  font-size: clamp(2.4rem, 4.5vw, 4.75rem);
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.02;
  margin-bottom: 24px;
}
h3 { font-size: 22px; line-height: 1.3; margin-bottom: 8px; }
p { max-width: 66ch; }

.hero-lede { color: var(--ink-soft); font-size: 22px; line-height: 1.38; margin-bottom: 27px; }
.microcopy { color: var(--ink-soft); font-size: 14px; line-height: 1.3; margin: 12px 0 0; }

.telegram-action {
  align-items: center;
  background: var(--teal);
  border: 2px solid var(--ink);
  box-shadow: 4px 5px 0 var(--ink);
  color: var(--ink);
  display: inline-flex;
  font-size: 17px;
  font-weight: 700;
  gap: 12px;
  padding: 14px 17px;
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease;
}
.telegram-action:hover { box-shadow: 1px 2px 0 var(--ink); transform: translate(3px, 3px); }

.video-figure { margin: 0; }
.video-paper {
  background: var(--white);
  border: 2px solid var(--ink);
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
  transform: rotate(1.5deg);
}
.video-paper::before, .video-paper::after {
  border-color: var(--coral);
  border-style: solid;
  content: "";
  height: 18px;
  position: absolute;
  width: 18px;
  z-index: 1;
}
.video-paper::before { border-width: 3px 0 0 3px; left: 15px; top: 15px; }
.video-paper::after { border-width: 0 3px 3px 0; bottom: 15px; right: 15px; }
.hero-video { aspect-ratio: 1; display: block; object-fit: cover; width: 100%; }
.video-toggle {
  background: var(--paper);
  border: 1px solid var(--ink);
  bottom: 14px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  padding: 7px 9px;
  position: absolute;
  right: 14px;
  z-index: 2;
}
.video-corner { bottom: 17px; color: var(--ink-soft); font-size: 12px; left: 18px; position: absolute; }
.video-figure figcaption { color: var(--ink-soft); font-size: 13px; line-height: 1.35; margin: 16px 5px 0; }

.hero-index { align-self: stretch; border-left: 1px solid var(--line); display: flex; flex-direction: column; justify-content: center; }
.hero-index a { border-bottom: 1px solid var(--line); font-size: 15px; padding: 12px 0 12px 18px; text-decoration: none; }
.hero-index a:hover { color: var(--coral); }
.hero-index span { color: var(--coral); font-size: 12px; margin-right: 8px; }

.statement-band { background: var(--ink); color: var(--paper); padding: 100px 0 108px; }
.statement-layout { display: grid; gap: 24px 50px; grid-template-columns: 180px minmax(0, 1.5fr) minmax(220px, 0.65fr); }
.statement-layout h2 { margin: 0; }
.statement-layout > p:last-child { color: #bfd0ca; font-size: 20px; margin: 5px 0 0; }
.statement-band .section-mark { color: #ffd263; }
.section-mark { color: var(--coral); font-size: 12px; font-weight: 700; letter-spacing: 0.04em; margin: 0 0 16px; }

.mechanic { padding-bottom: 120px; padding-top: 120px; }
.section-heading > p:not(.section-mark) { color: var(--ink-soft); font-size: 20px; line-height: 1.33; }
.commitment-grid { align-items: start; display: grid; gap: 80px; grid-template-columns: minmax(0, 1.1fr) minmax(315px, 0.85fr); margin-top: 54px; }
.story-steps { counter-reset: steps; list-style: none; margin: 0; padding: 0; }
.story-steps li { border-top: 2px solid var(--ink); display: grid; gap: 20px; grid-template-columns: 42px 1fr; padding: 21px 0 24px; }
.story-steps li:last-child { border-bottom: 2px solid var(--ink); }
.story-steps li > span { color: var(--coral); font-family: var(--hand); font-size: 36px; line-height: 0.75; }
.story-steps p { color: var(--ink-soft); margin: 0; }

.telegram-scene { background: var(--white); border: 2px solid #161a1b; color: #161a1b; min-width: 0; padding: 21px; position: relative; }
.telegram-top { align-items: center; border-bottom: 1px solid #d5dbd9; display: flex; font-size: 13px; gap: 8px; justify-content: flex-start; padding-bottom: 12px; }
.telegram-top > span:last-child { color: #6c7777; margin-left: auto; }
.telegram-dot { background: var(--teal); border-radius: 50%; height: 11px; width: 11px; }
.bubble-label { color: var(--teal-dark); font-family: var(--hand); font-size: 20px; margin: 19px 0 3px; }
.telegram-scene h3 { font-size: 25px; line-height: 1.3; margin: 0 0 20px; }
.telegram-scene dl { border-top: 1px solid #d5dbd9; margin: 0; }
.telegram-scene dl > div { display: flex; font-size: 14px; justify-content: space-between; padding: 8px 0; }
.telegram-scene dt { color: #65706f; }
.telegram-scene dd { font-weight: 700; margin: 0; }
.scene-note { color: #44504f; font-size: 14px; line-height: 1.4; margin: 16px 0; }
.scene-actions { display: flex; gap: 8px; }
.scene-actions button { background: #f0f3f1; border: 1px solid #bcc7c3; color: #61706a; font-size: 13px; padding: 8px 10px; }
.illustration-label { color: #52605d; display: block; font-size: 11px; margin-top: 18px; }

.mechanic-ink { background: var(--teal); color: #142023; }
.mechanic-ink .section-mark { color: #4b1821; }
.mechanic-ink .section-heading > p:not(.section-mark) { color: #142f31; }
.forecast-layout { align-items: center; display: grid; gap: 80px; grid-template-columns: minmax(0, 1fr) minmax(320px, 0.85fr); }
.ink-list { list-style: none; margin: 30px 0 0; padding: 0; }
.ink-list li { border-top: 1px solid rgb(20 32 35 / 40%); padding: 11px 0; }
.ink-list li::before { color: #b61f39; content: "↳"; font-family: var(--hand); font-size: 24px; margin-right: 10px; }
.deadline-line { font-size: 14px; margin-bottom: 19px; }
.vote-row { display: flex; gap: 8px; margin-bottom: 11px; }
.vote-button, .roster-button { background: transparent; border: 1px solid #aebbb6; color: #253131; font-size: 14px; padding: 9px 11px; }
.vote-button span { background: #e6ece8; border-radius: 50%; display: inline-grid; height: 19px; margin-left: 4px; place-items: center; width: 19px; }
.vote-button[aria-pressed="true"] { background: #f8d86e; border-color: #161a1b; color: #161a1b; }
.roster-button { margin-top: 9px; }
.vote-status { color: #526362; font-size: 13px; margin: 0; min-height: 20px; }
.roster { border-top: 1px dashed #aebbb6; font-size: 13px; margin-top: 13px; padding-top: 10px; }
.roster p { margin-bottom: 5px; }

.deadline-layout { display: grid; gap: 28px 70px; grid-template-columns: 250px minmax(0, 1fr); }
.deadline-drawing { align-self: center; color: var(--coral); text-align: center; transform: rotate(-4deg); }
.clock-face { border: 4px solid var(--ink); border-radius: 50%; height: 170px; margin: 0 auto 20px; position: relative; width: 170px; }
.clock-face span { font-family: var(--hand); font-size: 26px; left: 50%; position: absolute; top: 9px; transform: translateX(-50%); }
.clock-face b, .clock-face i { background: var(--ink); border-radius: 5px; display: block; left: 50%; position: absolute; transform-origin: bottom; width: 4px; }
.clock-face b { height: 49px; top: 38px; transform: rotate(35deg); }
.clock-face i { height: 60px; top: 25px; transform: rotate(138deg); }
.deadline-drawing p { font-family: var(--hand); font-size: 28px; line-height: 1.3; margin: 0; }
.ledger-strip { border-top: 2px solid var(--ink); display: grid; gap: 16px; grid-column: 1 / -1; grid-template-columns: repeat(4, 1fr); margin-top: 26px; padding-top: 15px; }
.ledger-strip div { min-width: 0; }
.ledger-strip strong { display: block; font-family: var(--display); font-size: 20px; line-height: 1; }
.ledger-strip span { color: var(--ink-soft); display: block; font-size: 14px; line-height: 1.2; margin-top: 6px; }

.coin-section { background: var(--yellow); color: #161a1b; }
.coin-layout { align-items: center; display: grid; gap: 72px; grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.85fr); }
.coin-copy .section-mark { color: #6e202a; }
.coin-copy .section-heading > p:not(.section-mark), .coin-copy p { color: #34270f; }
.coin-clarification { font-family: var(--hand); font-size: 25px; line-height: 1.3; margin-bottom: 0; }
.coin-ledger { background: #fffdf5; border: 2px solid #161a1b; box-shadow: 6px 7px 0 #161a1b; padding: 17px 20px; transform: rotate(1deg); }
.ledger-head { border-bottom: 2px solid #161a1b; display: flex; font-family: var(--display); font-weight: 700; justify-content: space-between; padding-bottom: 10px; }
.ledger-head span:last-child { color: #6b675d; font-family: var(--body); font-size: 12px; font-weight: 500; }
.ledger-row { border-bottom: 1px solid #dfded7; display: grid; font-size: 13px; gap: 8px; grid-template-columns: 0.75fr 1fr auto; padding: 11px 0; }
.ledger-row strong { color: #b61f39; }
.ledger-reset strong { color: var(--teal-dark); }
.coin-total { align-items: end; display: flex; font-family: var(--display); justify-content: space-between; padding: 19px 0 15px; }
.coin-total span { font-size: 18px; font-weight: 700; }
.coin-total b { font-size: 29px; line-height: 1; }
.coin-ledger > p { border-top: 1px dashed #979993; color: #3c453e; font-size: 13px; line-height: 1.35; margin: 0; padding-top: 13px; }

.pinok-layout { display: grid; gap: 72px; grid-template-columns: minmax(0, 0.75fr) minmax(0, 1.25fr); }
code { background: var(--paper-alt); border: 1px solid var(--line); font-family: inherit; font-size: 0.91em; padding: 0 4px; }
.pinok-notes { border-top: 2px solid var(--ink); }
.pinok-notes article { border-bottom: 1px solid var(--line); padding: 20px 0; }
.pinok-notes article:nth-child(1) h3 { color: var(--teal-dark); }
.pinok-notes article:nth-child(2) h3 { color: var(--coral); }
.pinok-notes article:nth-child(3) h3 { color: #74600b; }
.pinok-notes p { color: var(--ink-soft); margin: 0; }

.scope-band { background: var(--paper-alt); padding: 95px 0; }
.scope-layout { display: grid; gap: 70px; grid-template-columns: minmax(250px, 0.7fr) minmax(0, 1.3fr); }
.scope-layout h2 { margin-bottom: 0; }
.scope-columns { display: grid; gap: 45px; grid-template-columns: 1fr 1fr; }
.scope-columns h3 { border-bottom: 2px solid var(--ink); padding-bottom: 9px; }
.scope-columns ul { color: var(--ink-soft); margin: 0; padding-left: 18px; }
.scope-columns li { margin-bottom: 10px; }

.closing { padding-bottom: 130px; padding-top: 128px; text-align: center; }
.closing .hand-note { margin-left: auto; margin-right: auto; transform: rotate(1deg); }
.closing h2 { font-size: clamp(3rem, 6vw, 6rem); }
.closing > p:last-child { color: var(--ink-soft); font-size: 15px; margin: 26px auto 0; }
.telegram-action-large { font-size: 21px; padding: 18px 23px; }

.mode-dialog { background: var(--paper); border: 2px solid var(--ink); box-shadow: 10px 10px 0 var(--coral); color: var(--ink); max-width: 540px; padding: 31px; }
.mode-dialog::backdrop { background: rgb(22 26 27 / 58%); }
.mode-dialog h2 { font-size: 39px; }
.mode-dialog p:not(.section-mark) { color: var(--ink-soft); }
.dialog-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; margin-top: 25px; }
.dialog-actions button { border: 2px solid var(--ink); font-size: 15px; font-weight: 700; padding: 11px 13px; }
.dialog-cancel { background: transparent; color: var(--ink); }
.dialog-confirm { background: var(--coral); color: #ffffff; }

@media (max-width: 980px) {
  .site-header { align-items: flex-start; flex-direction: column; gap: 14px; }
  .header-controls { flex-wrap: wrap; gap: 8px 15px; }
  .hero { grid-template-columns: 1fr 0.9fr; min-height: auto; padding-top: 72px; }
  .hero-index { border-left: 0; border-top: 1px solid var(--line); flex-direction: row; grid-column: 1 / -1; justify-content: flex-start; overflow-x: auto; }
  .hero-index a { border-bottom: 0; min-width: max-content; padding: 13px 18px 13px 0; }
  .statement-layout, .commitment-grid, .forecast-layout, .coin-layout, .pinok-layout, .scope-layout { grid-template-columns: 1fr; }
  .statement-layout { gap: 20px; }
  .statement-layout > p:last-child { max-width: 600px; }
  .pinok-title { max-width: 680px; }
}

@media (max-width: 680px) {
  body { font-size: 17px; }
  .section-shell { padding-left: 20px; padding-right: 20px; }
  .site-header { min-height: 0; padding: 13px 20px; }
  .brand { font-size: 23px; }
  .header-controls { align-items: flex-start; flex-direction: column; }
  .mode-switch { overflow-x: auto; width: 100%; }
  .mode-switch button { font-size: 13px; min-width: max-content; }
  .hero { display: flex; flex-direction: column; gap: 36px; padding-bottom: 47px; padding-top: 48px; }
  .hero-copy { max-width: none; }
  h1 { font-size: clamp(3.55rem, 18vw, 5.2rem); }
  h2 { font-size: clamp(2.55rem, 13vw, 3.65rem); }
  .hero-lede { font-size: 19px; }
  .video-figure { max-width: 500px; width: 100%; }
  .hero-index { align-self: stretch; width: 100%; }
  .statement-band { padding: 72px 0 77px; }
  .mechanic { padding-bottom: 77px; padding-top: 77px; }
  .commitment-grid, .forecast-layout, .coin-layout, .pinok-layout, .scope-layout { gap: 40px; margin-top: 32px; }
  .deadline-layout { grid-template-columns: 1fr; }
  .deadline-drawing { justify-self: start; text-align: left; }
  .clock-face { margin-left: 8px; }
  .ledger-strip { grid-template-columns: 1fr 1fr; }
  .coin-ledger { box-shadow: 4px 5px 0 #161a1b; padding: 15px; }
  .ledger-row { font-size: 12px; grid-template-columns: 0.78fr 1fr auto; line-height: 1.35; }
  .scope-band { padding: 70px 0; }
  .scope-columns { grid-template-columns: 1fr; }
  .closing { padding-bottom: 82px; padding-top: 80px; }
  .telegram-action-large { font-size: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; }
  .hero-video { display: none; }
  .video-paper { background: center / cover no-repeat url("assets/pinok-prompt.png"); aspect-ratio: 1; }
  .video-toggle { display: none; }
}
