/* the duk manual: a printed owner's manual for a duck. cream pages, a black pen, notes in the margin. */
.manual-page .manual-label { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 560px; margin: 30px 0 0; border: 2px solid #111; background: #fff9e7; border-radius: 2px 6px 3px 5px; transform: rotate(-1deg); }
.manual-page .manual-label > div { padding: 9px 14px 10px; min-width: 0; }
.manual-page .manual-label > div:nth-child(even) { border-left: 2px solid #111; }
.manual-page .manual-label > div:nth-child(n + 3) { border-top: 2px solid #111; }
.manual-page .manual-label dt { font-size: 12px; }
.manual-page .manual-label dd { margin: 0; font-size: 15px; font-weight: bold; line-height: 1.35; }

.manual-book { padding-block: 55px 90px; }
.manual-warning { border: 3px solid #111; background: #ff7f27; padding: 14px 20px; font-size: 16px; max-width: 760px; margin: 0 auto 34px; text-align: center; transform: rotate(-.6deg); border-radius: 3px 1px 6px 2px; }
.manual-sheet { background: #fff9e7; border: 3px solid #111; border-left-width: 9px; border-radius: 3px 8px 5px 2px; }

/* one chapter = one page */
.manual-chapter { padding: 48px 56px 40px; scroll-margin-top: 20px; }
.manual-chapter + .manual-chapter { border-top: 3px solid #111; }
.chapter-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 22px; padding-bottom: 14px; margin-bottom: 32px; border-bottom: 2px solid #111; }
.chapter-number { font-size: 76px; font-weight: bold; line-height: 1; min-width: 70px; text-align: center; transform: rotate(-6deg); border: 3px solid #111; border-radius: 48% 42% 50% 40%; padding: 4px 10px 8px; background: #00a2e8; }
.manual-chapter:target .chapter-number { background: #ff7f27; }
.chapter-head h2 { font-size: clamp(36px, 4.5vw, 58px); letter-spacing: -2px; overflow-wrap: anywhere; }
.chapter-page { font-size: 13px; transform: rotate(3deg); white-space: nowrap; }
.chapter-body { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 56px; align-items: start; }
.chapter-text { max-width: 720px; font-size: 18px; line-height: 1.65; min-width: 0; }
.chapter-text > * + * { margin-top: 18px; }
.chapter-text h3 { font-size: 26px; letter-spacing: -.8px; margin-top: 38px; }
.chapter-text a:not(.button):not(.text-link) { text-underline-offset: 4px; }
.chapter-text a:not(.button):not(.text-link):hover { background: #ff7f27; }
.chapter-lead { font-size: 24px; line-height: 1.4; letter-spacing: -.5px; font-weight: bold; }
.fine-print { font-size: 14px; border-top: 2px solid #111; padding-top: 12px; }
.chapter-top { display: inline-block; margin-top: 36px; font-size: 14px; text-underline-offset: 4px; }
.chapter-top:hover { background: #ff7f27; }

/* the margin */
.chapter-margin { display: flex; flex-direction: column; gap: 28px; border-left: 2px dashed #111; padding-left: 28px; min-width: 0; }
.margin-note { position: relative; padding-left: 20px; font-size: 15px; line-height: 1.5; transform: rotate(-1.5deg); }
.margin-note:nth-of-type(even) { transform: rotate(1.2deg); }
.margin-note::before { content: "*"; position: absolute; left: 0; top: -2px; font-size: 22px; font-weight: bold; color: #cc4200; }
.manual-fig { background: white; border: 2px solid #111; padding: 12px; border-radius: 2px 5px 3px 6px; transform: rotate(1deg); }
.chapter-margin .manual-fig:nth-of-type(even) { transform: rotate(-1.2deg); }
.manual-fig img { width: 100%; height: auto; object-fit: contain; }
.manual-fig img[src$="float.png"] { width: auto; max-height: 360px; margin-inline: auto; }
.manual-fig figcaption { font-size: 13px; line-height: 1.45; margin-top: 10px; }
.manual-fig figcaption b { margin-right: 5px; text-decoration: underline; text-underline-offset: 3px; }
.manual-fig-wide { max-width: 540px; margin-inline: auto; transform: rotate(-.8deg); }

/* 0. contents */
.toc { list-style: none; margin: 0; padding: 0; }
.toc a { display: flex; align-items: baseline; gap: 14px; padding: 9px 8px; text-decoration: none; font-size: clamp(20px, 2.4vw, 30px); letter-spacing: -.6px; border-radius: 3px 1px 4px 2px; }
.toc a:hover { background: #ff7f27; }
.toc-num { min-width: 34px; font-weight: bold; }
.toc-title { flex: none; }
.toc-dots { flex: 1; min-width: 20px; border-bottom: 3px dotted #111; transform: translateY(-7px); }
.toc-page { flex: none; font-size: 15px; }

/* 1. specifications */
.spec-sheet { margin: 28px 0 0; border: 2px solid #111; font-size: 16px; }
.spec-sheet > div { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 12px; padding: 8px 14px; }
.spec-sheet > div + div { border-top: 1px solid #111; }
.spec-sheet > div:nth-child(even) { background: white; }
.spec-sheet dt { font-weight: bold; }
.spec-sheet dd { margin: 0; }
.swatch { display: inline-block; width: 15px; height: 15px; border: 2px solid #111; vertical-align: -2px; margin-inline: 3px; }
.swatch-white { background: #ffffff; }
.swatch-orange { background: #ff7f27; }
.swatch-blue { background: #00a2e8; }

/* 2. the story, in order */
.narrative { list-style: none; counter-reset: story; padding: 0; margin-block: 22px 0; }
.narrative li { counter-increment: story; display: grid; grid-template-columns: 56px minmax(0, 1fr); align-items: baseline; padding-block: 12px; border-bottom: 1px dashed #111; }
.narrative li::before { content: counter(story) "."; font-size: 34px; font-weight: bold; transform: rotate(-6deg); }
.narrative li p { font-size: 21px; line-height: 1.5; letter-spacing: -.4px; }
.narrative li:last-child p { font-weight: bold; }
.incoming { margin-top: 30px; transform: rotate(-.5deg); }
.incoming-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 16px 14px; }
.incoming-list li { text-align: center; min-width: 0; }
.incoming-list li:nth-child(odd) { transform: rotate(-4deg); }
.incoming-list li:nth-child(even) { transform: rotate(3deg); }
.incoming-list img { width: 100%; height: 80px; object-fit: contain; }
.incoming-list span { display: block; font-size: 13px; margin-top: 6px; line-height: 1.3; }

/* 3. the position */
.manual-steps { list-style: none; counter-reset: step; padding: 0; }
.manual-steps li { counter-increment: step; position: relative; padding: 8px 0 8px 52px; }
.manual-steps li::before { content: counter(step); position: absolute; left: 0; top: 7px; width: 36px; height: 36px; line-height: 30px; text-align: center; border: 2px solid #111; border-radius: 48% 43% 50% 40%; font-weight: bold; background: white; transform: rotate(-8deg); }
.safety-box { border: 3px solid #111; background: white; padding: 18px 24px 22px; transform: rotate(-.5deg); border-radius: 2px 6px 3px 4px; }
.chapter-text .safety-box h3 { margin-top: 0; display: inline-block; background: #ff7f27; border: 2px solid #111; padding: 2px 12px 4px; font-size: 20px; transform: rotate(-2deg); }
.safety-box ul { margin: 12px 0 0; padding-left: 22px; font-size: 16px; }
.safety-box li + li { margin-top: 6px; }

/* 4. the pool */
.pool-flow { list-style: none; counter-reset: flow; padding: 0; }
.pool-flow li { counter-increment: flow; position: relative; border: 2px solid #111; background: white; padding: 12px 16px 13px 62px; border-radius: 3px 1px 5px 2px; font-size: 17px; }
.pool-flow li + li { margin-top: 26px; }
.pool-flow li::before { content: counter(flow); position: absolute; left: 14px; top: 8px; font-size: 30px; font-weight: bold; line-height: 1.2; transform: rotate(-6deg); }
.pool-flow li:not(:last-child)::after { content: "↓"; position: absolute; left: 22px; bottom: -27px; font-size: 20px; line-height: 1; }
.pool-flow li:last-child { background: #ff7f27; }
.plain-list { padding-left: 22px; font-size: 16px; }
.plain-list li + li { margin-top: 9px; }
.chapter-text strong { text-decoration: underline; text-underline-offset: 5px; }

/* 5. the cult */
.greeting-line { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; margin-block: 26px 10px; }
.greeting-line span:not(.greeting-arrow) { font-size: 44px; font-weight: bold; line-height: 1.2; border: 2px solid #111; padding: 0 18px 6px; background: #00a2e8; border-radius: 8px 4px 9px 1px; transform: rotate(-5deg); }
.greeting-line span:last-child { background: #ff7f27; transform: rotate(4deg); }
.greeting-arrow { font-size: 34px; }
.manual-glossary { margin: 18px 0 0; border-top: 2px solid #111; }
.manual-glossary > div { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 14px; padding-block: 10px; border-bottom: 1px solid #111; }
.manual-glossary dt { font-size: 20px; font-weight: bold; letter-spacing: -.5px; }
.manual-glossary dd { margin: 0; font-size: 16px; align-self: center; }
.house-rules { list-style: none; counter-reset: rule; padding: 0; }
.house-rules li { counter-increment: rule; position: relative; padding: 9px 0 9px 50px; border-bottom: 1px dashed #111; }
.house-rules li::before { content: counter(rule) "."; position: absolute; left: 4px; top: 4px; font-size: 26px; font-weight: bold; transform: rotate(-6deg); }

/* 6. how to join */
.join-steps { list-style: none; counter-reset: join; padding: 0; }
.join-steps li { counter-increment: join; position: relative; border: 2px solid #111; background: white; padding: 18px 22px 20px 78px; border-radius: 4px 1px 6px 2px; transform: rotate(-.4deg); }
.join-steps li:nth-child(even) { transform: rotate(.5deg); }
.join-steps li + li { margin-top: 16px; }
.join-steps li::before { content: counter(join); position: absolute; left: 22px; top: 10px; font-size: 46px; font-weight: bold; line-height: 1.1; transform: rotate(-7deg); }
.chapter-text .join-steps h3 { margin-top: 0; font-size: 23px; }
.join-steps p { font-size: 16px; margin-top: 6px; }
.join-steps .join-links { display: flex; flex-wrap: wrap; gap: 6px 20px; margin-top: 10px; }

/* 7. faq */
.faq-list { margin: 0; }
.faq-list > div { padding-block: 18px; border-top: 2px solid #111; }
.faq-list > div:first-child { border-top: 0; padding-top: 0; }
.faq-list dt { font-size: 22px; font-weight: bold; letter-spacing: -.5px; }
.faq-list dt::before { content: "q. "; color: #cc4200; }
.faq-list dd { margin: 8px 0 0; font-size: 17px; }
.faq-list dd::before { content: "a. "; font-weight: bold; }

/* 8. links */
.manual-index { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 2px solid #111; border-left: 2px solid #111; }
.manual-index a { display: block; height: 100%; padding: 13px 16px 15px; border-right: 2px solid #111; border-bottom: 2px solid #111; text-decoration: none; background: white; }
.manual-index li:nth-child(4n + 2) a, .manual-index li:nth-child(4n + 3) a { background: #fff9e7; }
.manual-index a:hover { background: #ff7f27; }
.manual-index b { display: block; font-size: 20px; letter-spacing: -.5px; }
.manual-index span { display: block; font-size: 14px; line-height: 1.4; }
.manual-socials { margin-top: 12px; }
.manual-end { font-size: 64px; font-weight: bold; line-height: 1; letter-spacing: -3px; transform: rotate(-6deg); }
.manual-end span { display: inline-block; margin-top: 10px; background: #ff7f27; border: 3px solid #111; padding: 0 14px 8px; transform: rotate(9deg); }

@media (max-width: 1000px) {
  .manual-chapter { padding: 40px 34px 34px; }
  .chapter-body { grid-template-columns: minmax(0, 1fr) 210px; gap: 34px; }
  .chapter-margin { padding-left: 22px; }
  .chapter-number { font-size: 60px; min-width: 58px; }
  .manual-glossary > div { grid-template-columns: 170px minmax(0, 1fr); }
}

@media (max-width: 700px) {
  .manual-page .manual-label { margin-top: 22px; transform: none; }
  .manual-page .manual-label dd { font-size: 13px; }
  .manual-book { padding-block: 34px 60px; }
  .manual-warning { font-size: 14px; padding: 12px 14px; margin-bottom: 24px; }
  .manual-sheet { border-left-width: 6px; }
  .manual-chapter { padding: 28px 18px 26px; }
  .chapter-head { grid-template-columns: auto minmax(0, 1fr); gap: 6px 16px; margin-bottom: 24px; }
  .chapter-number { font-size: 44px; min-width: 50px; padding: 2px 8px 6px; }
  .chapter-head h2 { font-size: 34px; letter-spacing: -1.4px; }
  .chapter-page { grid-column: 2; font-size: 11px; transform: none; }
  .chapter-body { display: block; }
  .chapter-text { font-size: 16px; line-height: 1.6; }
  .chapter-text > * + * { margin-top: 15px; }
  .chapter-text h3 { font-size: 22px; margin-top: 30px; }
  .chapter-lead { font-size: 20px; }
  .chapter-margin { border-left: 0; border-top: 2px dashed #111; padding: 24px 0 0; margin-top: 30px; gap: 22px; }
  .manual-fig { width: 100%; max-width: 300px; margin-inline: auto; }
  .manual-fig img[src$="float.png"] { max-height: 280px; }
  .manual-fig-wide { max-width: 100%; }
  .chapter-top { margin-top: 26px; }
  .toc a { font-size: 19px; gap: 10px; padding: 8px 4px; }
  .toc-num { min-width: 22px; }
  .toc-page { font-size: 12px; }
  .spec-sheet { font-size: 14px; }
  .spec-sheet > div { grid-template-columns: 112px minmax(0, 1fr); gap: 8px; padding: 7px 10px; }
  .narrative li { grid-template-columns: 38px minmax(0, 1fr); }
  .narrative li::before { font-size: 26px; }
  .narrative li p { font-size: 17px; }
  .incoming-list { grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 12px 8px; }
  .incoming-list img { height: 62px; }
  .incoming-list span { font-size: 11px; }
  .manual-steps li { padding-left: 46px; }
  .safety-box { padding: 16px 16px 18px; transform: none; }
  .safety-box ul { font-size: 14px; }
  .pool-flow li { font-size: 15px; padding-left: 48px; }
  .pool-flow li::before { left: 12px; font-size: 24px; }
  .pool-flow li:not(:last-child)::after { left: 18px; }
  .plain-list { font-size: 14px; }
  .greeting-line { gap: 12px; }
  .greeting-line span:not(.greeting-arrow) { font-size: 32px; padding: 0 14px 5px; }
  .greeting-arrow { font-size: 26px; }
  .manual-glossary > div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .manual-glossary dt { font-size: 18px; }
  .manual-glossary dd { font-size: 14px; }
  .house-rules li { padding-left: 40px; font-size: 15px; }
  .house-rules li::before { font-size: 21px; }
  .join-steps li { padding: 15px 15px 17px 58px; transform: none; }
  .join-steps li:nth-child(even) { transform: none; }
  .join-steps li::before { left: 15px; font-size: 36px; }
  .chapter-text .join-steps h3 { font-size: 20px; }
  .join-steps p { font-size: 14px; }
  .faq-list dt { font-size: 19px; }
  .faq-list dd { font-size: 15px; }
  .manual-index { grid-template-columns: minmax(0, 1fr); }
  .manual-index li:nth-child(n) a { background: white; }
  .manual-index li:nth-child(even) a { background: #fff9e7; }
  .manual-end { font-size: 48px; }
}

@media print {
  .site-header, .site-footer, .skip-link, .chapter-top, .page-hero-art { display: none; }
  body { background: white; }
  .manual-sheet { border-width: 2px; }
  .manual-chapter { break-inside: avoid-page; }
}
