/* Content pages: landing, topic pages, rules, blog, legal, 404 */
body { overflow-x: hidden; }
.wrap { width: min(1200px, 100% - 2 * var(--gut)); margin-inline: auto; }

/* ── header + footer ── */
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px 0; }
.top nav { display: flex; align-items: center; gap: 24px; font-size: 16px; }
.top nav a:not(.btn) { text-decoration: none; }
.top nav a:not(.btn):hover, .top nav a[aria-current] { text-decoration: underline; text-decoration-thickness: 2px; }

.foot { margin-top: 40px; padding: 40px 0 48px; border-top: 2px solid var(--ink); display: grid; grid-template-columns: 1fr 2fr; gap: 28px 40px; font-size: 15px; }
.foot .logo { width: 120px; }
.foot p { margin: 14px 0 0; color: var(--ink-2); max-width: 30ch; }
.foot nav { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px 24px; align-content: start; }
.foot nav b { font: 400 18px/1.2 var(--display); margin-bottom: 4px; }
.foot nav div { display: flex; flex-direction: column; gap: 6px; }
.foot nav a { text-decoration: none; color: var(--ink-2); padding: 2px 0; }
.foot nav a:hover { color: var(--ink); text-decoration: underline; }
.foot small { grid-column: 1 / -1; color: var(--ink-2); }

/* ── shared type ── */
.h-display { font: 400 clamp(2.4rem, 6vw, 4.6rem)/.92 var(--display); letter-spacing: -.01em; margin: 0 0 12px; }
.intro { max-width: 42ch; color: var(--ink-2); margin: 0 0 40px; }
section { scroll-margin-top: 24px; }

/* ── hero ── */
.hero { display: grid; grid-template-columns: 7fr 5fr; gap: 40px; align-items: center; padding: 24px 0 88px; }
.hero h1 { margin: 0 0 30px; font: 400 clamp(3.2rem, 9vw, 8.4rem)/.86 var(--display); letter-spacing: -.02em; }
.hero h1 .l1 { transform: rotate(-2.2deg); }
.hero h1 .l2 { background: var(--lav); transform: rotate(1.4deg) translateX(.4em); }
.hero h1 .l3 { transform: rotate(-.6deg); font-size: .4em; padding: .12em .3em .18em; margin-top: .16em; background: var(--ink); color: var(--slip); }
.lede { font-size: clamp(1.1rem, 1.6vw, 1.3rem); max-width: 36ch; margin: 0 0 30px; }
.cta { display: flex; flex-wrap: wrap; gap: 16px 22px; align-items: center; }
.cta small { font-size: 15px; color: var(--ink-2); }

/* ── getting people into the chat ── */
.btn-big { min-height: 80px; padding: 0 40px; font-size: clamp(1.6rem, 2.6vw, 2.2rem); box-shadow: 6px 6px 0 var(--ink); }
.btn-big:hover { box-shadow: 9px 9px 0 var(--ink); }
.btn .arr { display: inline-block; transition: transform .15s var(--ease); }
.btn:hover .arr, .dock:hover .arr { transform: translateX(5px); }
.cta-hero { flex-direction: column; align-items: flex-start; gap: 18px; }
.perks-list { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 0; padding: 0; list-style: none; font-size: 15px; color: var(--ink-2); }
.perks-list li::before { content: "✓ "; color: var(--violet); font-weight: 700; }
a.collage { display: block; text-decoration: none; color: inherit; transition: transform .2s var(--ease); }
a.collage:hover { transform: rotate(-1deg) scale(1.02); }
/* One floating button, centred at the bottom, following the reader down every page. */
body { padding-bottom: 120px; }
.dock {
  position: fixed; z-index: 20; left: 50%; bottom: max(20px, env(safe-area-inset-bottom));
  display: grid; grid-template-columns: auto auto; align-items: center; column-gap: 14px; justify-content: center;
  min-width: min(440px, calc(100vw - 24px)); padding: 14px 40px 12px;
  border: 2px solid var(--ink); border-radius: 999px; background: var(--violet); color: #fff;
  box-shadow: 5px 6px 0 var(--ink); text-decoration: none; text-align: center;
  font: 400 clamp(1.5rem, 2.2vw, 1.9rem)/1 var(--display);
  translate: -50% 0; transition: box-shadow .15s var(--ease), scale .15s var(--ease);
}
.dock:hover { scale: 1.04; box-shadow: 7px 9px 0 var(--ink); }
.dock:active { scale: .98; box-shadow: 2px 2px 0 var(--ink); }
.dock small { grid-column: 1 / -1; margin-top: 6px; font: 14px/1 var(--text); opacity: .85; }
.dock::before { content: ""; position: absolute; inset: -2px; border-radius: inherit; border: 2px solid var(--violet); animation: halo 2.4s var(--ease) infinite; pointer-events: none; }
@keyframes halo { 0% { opacity: .7; transform: scale(1); } 70%, 100% { opacity: 0; transform: scale(1.12, 1.4); } }
@media (prefers-reduced-motion: reduce) { .dock::before { animation: none; } }
/* On the home page the hero already has the big button: bring the dock in once that has scrolled away. */
@supports (animation-timeline: scroll()) {
  body:has(.hero) .dock { animation: dock-in linear both; animation-timeline: scroll(); animation-range: 0 480px; }
  @keyframes dock-in { 0%, 70% { opacity: 0; translate: -50% 160%; } 100% { opacity: 1; translate: -50% 0; } }
}


.collage { position: relative; aspect-ratio: 5 / 6; width: 100%; max-width: 460px; justify-self: end; }
.collage > * { position: absolute; }
.collage .sheet-a { inset: 6% 4% 14% 10%; background: var(--lav); clip-path: var(--torn); transform: rotate(3deg); }
.collage .sheet-b { inset: 18% 14% 4% 0; background: var(--slip); clip-path: var(--torn); transform: rotate(-4deg); display: grid; place-items: center; }
.collage .sheet-b svg { width: 78%; color: var(--ink); transform: rotate(4deg); }
.collage .tape { width: 34%; height: 9%; top: 14%; left: 30%; background: #ffffff8c; border: 1px solid #ffffffaa; transform: rotate(-12deg); }
.collage .tape + .tape { top: auto; bottom: 6%; left: auto; right: 8%; width: 26%; transform: rotate(18deg); }
.collage .sticker { right: 0; top: 0; }
.collage .label { left: -4%; bottom: 18%; background: var(--ink); color: var(--slip); padding: 8px 14px; font-size: 14px; transform: rotate(-6deg); }

/* ── things we cut out ── */
.cut { padding: 24px 0 110px; }
.board { display: grid; grid-template-columns: repeat(12, 1fr); gap: 22px; list-style: none; margin: 0; padding: 0; }
.board li { position: relative; padding: 22px 22px 26px; background: var(--slip); clip-path: var(--torn); }
.board li:nth-child(1) { grid-column: 1 / 5; transform: rotate(-2deg); }
.board li:nth-child(2) { grid-column: 5 / 8; transform: rotate(1.5deg) translateY(28px); background: var(--lav); }
.board li:nth-child(3) { grid-column: 8 / 13; transform: rotate(-1deg); }
.board li:nth-child(4) { grid-column: 2 / 6; transform: rotate(1deg) translateY(10px); background: var(--lav); }
.board li:nth-child(5) { grid-column: 7 / 12; transform: rotate(-2.4deg) translateY(30px); }
.board h3 { position: relative; display: inline-block; margin: 0; font: 400 clamp(1.6rem, 2.6vw, 2.1rem)/1 var(--display); }
.board h3 svg { position: absolute; left: -4%; top: 38%; width: 108%; height: 40%; color: var(--violet); overflow: visible; }
.board h3 svg path { stroke-width: 3.4; }
.board p { margin: 8px 0 0; font-size: 15px; color: var(--ink-2); }
.whats-left { position: relative; margin: 130px 0 0 auto; max-width: 22ch; font: 400 clamp(1.6rem, 3vw, 2.4rem)/1.05 var(--display); text-align: right; }
.whats-left em { font-style: normal; color: var(--violet); }

/* ── steps ── */
.steps-sec { padding: 0 0 100px; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; list-style: none; margin: 0; padding: 0; counter-reset: s; }
.steps li { counter-increment: s; position: relative; padding: 76px 22px 24px; background: var(--slip); border: 2px solid var(--ink); }
.steps li:nth-child(2) { transform: translateY(24px); }
.steps li::before {
  content: counter(s); position: absolute; top: -18px; left: 18px; width: 70px; height: 70px; border-radius: 50%;
  display: grid; place-items: center; background: var(--lav); border: 2px solid var(--ink); font: 400 2.2rem/1 var(--display); transform: rotate(-8deg);
}
.steps h3 { margin: 0 0 6px; font: 400 1.5rem/1.05 var(--display); }
.steps p { margin: 0; color: var(--ink-2); font-size: 16px; }

/* ── FAQ ── */
.faq { padding: 0 0 100px; max-width: 820px; }
.faq details { border-top: 2px solid var(--ink); }
.faq details:last-of-type { border-bottom: 2px solid var(--ink); }
.faq summary { list-style: none; cursor: pointer; position: relative; padding: 20px 52px 20px 0; font: 400 1.45rem/1.15 var(--display); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: 4px; top: 50%; width: 34px; height: 34px; margin-top: -17px; border-radius: 50%;
  display: grid; place-items: center; background: var(--lav); font: 400 24px/1 var(--display); transition: transform .25s var(--ease);
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details > :not(summary) { margin: -4px 0 22px; color: var(--ink-2); max-width: 60ch; }

/* ── links to topic pages ── */
.ways { padding: 0 0 100px; }
.ways ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.ways li a { display: block; height: 100%; padding: 18px 20px 20px; background: var(--slip); border: 2px solid var(--ink); text-decoration: none; transition: transform .15s var(--ease), box-shadow .15s var(--ease); }
.ways li a:hover { transform: translate(-2px, -2px); box-shadow: 5px 5px 0 var(--violet); }
.ways b { display: block; font: 400 1.35rem/1.05 var(--display); margin-bottom: 6px; }
.ways span { color: var(--ink-2); font-size: 15px; }

/* ── closing ── */
.closing { position: relative; margin: 0 0 40px; padding: 72px var(--gut) 80px; background: var(--lav); clip-path: var(--torn-wide); text-align: center; }
.closing p { margin: 0 auto 28px; font: 400 clamp(2rem, 5.4vw, 4rem)/.95 var(--display); max-width: 16ch; }


/* ── article pages (topic, rules, blog, legal) ── */
.page-head { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: end; padding: 28px 0 40px; }
.page-head h1 { margin: 0; font: 400 clamp(2.8rem, 7.6vw, 6.4rem)/.88 var(--display); letter-spacing: -.015em; max-width: 14ch; }
.page-head h1 .strip { background: var(--lav); }
.head-pic { position: relative; }
.head-pic .head-art { width: clamp(220px, 24vw, 300px); height: auto; }
.head-pic .sticker { position: absolute; left: -34px; bottom: 30px; width: 84px; height: 84px; font-size: 1.05rem; }
.head-pic:not(:has(svg)) .sticker { position: static; width: 112px; height: 112px; font-size: 1.4rem; margin: 0 12px 0 0; }

/* ── drawings (tools/site/art.py) ── */
.art { overflow: visible; color: var(--ink); }
.art text { font-family: var(--display); fill: var(--ink); }
.art .ts { font-family: var(--text); fill: var(--ink-2); }
.art .tw { fill: #fff; }
.art .tv { fill: var(--violet); }
.art .f-slip { fill: var(--slip); } .art .f-paper { fill: var(--paper); } .art .f-paper2 { fill: var(--paper-2); }
.art .f-lav { fill: var(--lav); } .art .f-vio { fill: var(--violet); } .art .f-ink { fill: var(--ink); }
.art .f-yellow { fill: #ffe58a; } .art .f-red { fill: var(--danger); }
.art .s-vio { stroke: var(--violet); } .art .s-red { stroke: var(--danger); } .art .s-ink2 { stroke: var(--ink-2); } .art .s-slip { stroke: var(--slip); }
.art .w1 { stroke-width: 1.5; } .art .w3 { stroke-width: 3.2; } .art .w4 { stroke-width: 4; } .art .w5 { stroke-width: 5.5; }
.art .dash { stroke-dasharray: 7 7; }
.fig { margin: 2em 0; padding: 22px 20px 16px; background: var(--slip); border: 2px solid var(--ink); }
.fig svg { width: 100%; height: auto; }
.fig figcaption { margin-top: 12px; font-size: 15px; color: var(--ink-2); }
.posts .art { width: 100%; max-width: 220px; height: auto; margin: 0 auto 16px; }
.ways .art { width: 64px; height: auto; float: right; margin: -4px -6px 4px 10px; }
.steps .art { position: absolute; right: 14px; top: 14px; width: 96px; height: auto; }
/* breadcrumbs */
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 0; margin: 0 0 10px; padding: 0; font-size: 14px; color: var(--ink-2); }
.crumbs li::after { content: "/"; margin: 0 8px; opacity: .5; }
.crumbs a { color: inherit; }
.kicker { display: inline-block; margin: 0 0 14px; padding: 4px 10px; background: var(--ink); color: var(--slip); font-size: 14px; transform: rotate(-1.5deg); }
.byline { margin: 18px 0 0; color: var(--ink-2); font-size: 15px; }

.doc { display: grid; grid-template-columns: minmax(0, 680px) minmax(0, 1fr); gap: 56px; padding: 0 0 80px; }
.prose { font-size: 18px; min-width: 0; }
.prose > :first-child { margin-top: 0; }
.prose h2 { margin: 2.2em 0 .4em; font: 400 clamp(1.7rem, 3vw, 2.2rem)/1.02 var(--display); }
.prose h3 { margin: 1.6em 0 .3em; font: 400 1.35rem/1.1 var(--display); }
.prose p, .prose li { color: var(--ink); }
.prose ul, .prose ol { padding-left: 1.2em; }
.prose li { margin: .35em 0; }
.prose li::marker { color: var(--violet); }
.prose strong { font: 400 1.1em/1 var(--display); letter-spacing: .01em; background: linear-gradient(transparent 74%, var(--lav) 74%); }
.prose .lead { font-size: 1.2em; line-height: 1.45; }
.todo { background: #ffe58a; padding: 0 4px; }
.prose blockquote { margin: 1.6em 0; padding: 18px 22px; background: var(--slip); clip-path: var(--torn); font: 400 1.45rem/1.15 var(--display); }
/* comparison tables */
.table-wrap { overflow-x: auto; margin: 1.4em 0; border: 2px solid var(--ink); background: var(--slip); }
.prose table { width: 100%; border-collapse: collapse; font-size: 15px; min-width: 560px; }
.prose th, .prose td { padding: 10px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid #18141f26; }
.prose thead th { font: 400 1.05rem/1.1 var(--display); background: var(--lav); border-bottom: 2px solid var(--ink); }
.prose tbody th { font-weight: 600; }
.prose tr.us { background: #c4b5f455; }
.prose .src { font-size: 14px; color: var(--ink-2); }
.prose .faq { padding: 0; margin-top: 1em; }
.prose .faq summary { font-size: 1.25rem; }
.prose .cta-box { margin: 2.4em 0 0; padding: 26px 24px 28px; background: var(--slip); border: 2px solid var(--ink); }
.prose .cta-box p { margin: 0 0 16px; font: 400 1.6rem/1.05 var(--display); }

.notes { align-self: start; position: sticky; top: 24px; display: grid; gap: 22px; }
.note { padding: 18px 20px 20px; background: var(--slip); clip-path: var(--torn); font-size: 15px; }
.note:nth-child(odd) { transform: rotate(1.2deg); }
.note:nth-child(even) { transform: rotate(-1.4deg); background: var(--lav); }
.note b { display: block; font: 400 1.25rem/1.1 var(--display); margin-bottom: 6px; }
.note p { margin: 0; color: var(--ink-2); }
.note ul { margin: 0; padding-left: 1.1em; }
.note a { color: var(--ink); }

/* blog list */
.posts { list-style: none; margin: 0 0 80px; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
.posts li { position: relative; }
.posts a { display: flex; flex-direction: column; height: 100%; padding: 24px 22px 26px; background: var(--slip); border: 2px solid var(--ink); text-decoration: none; transition: transform .15s var(--ease), box-shadow .15s var(--ease); }
.posts li:nth-child(2) a { background: var(--lav); }
.posts a:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink); }
.posts h2 { margin: 0 0 10px; font: 400 1.8rem/1 var(--display); }
.posts p { margin: 0 0 18px; color: var(--ink-2); flex: 1; }
.posts span { font-size: 14px; color: var(--ink-2); }

/* 404 */
.lost { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; padding: 40px 0 100px; }
.lost h1 { margin: 0 0 16px; font: 400 clamp(3rem, 9vw, 7rem)/.86 var(--display); }
.lost p { margin: 0 0 28px; max-width: 34ch; color: var(--ink-2); }
.lost .eye { color: var(--ink); background: var(--slip); clip-path: var(--torn); padding: 12% 10%; transform: rotate(-3deg); }
.lost .pupil { animation: look 4s var(--ease) infinite alternate; }
@keyframes look { 0%, 30% { transform: translateX(-16px); } 70%, 100% { transform: translateX(16px); } }

@media (max-width: 860px) {
  .top nav .hide-m { display: none; }
  .btn-big { width: 100%; min-height: 72px; }
  .cta-hero { align-items: stretch; }
  .hero .collage { order: 0; max-width: 260px; }
  .logo { width: 116px; }
  .hero { grid-template-columns: 1fr; gap: 24px; padding: 6px 0 72px; }
  .collage { order: -1; max-width: 330px; justify-self: center; aspect-ratio: 6 / 5; }
  .collage .sheet-a { inset: 4% 8% 8% 18%; }
  .collage .sheet-b { inset: 14% 22% 0 4%; }
  .collage .sticker { width: 92px; height: 92px; font-size: 1.15rem; }
  .board { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  .board h3 { hyphens: auto; overflow-wrap: break-word; }
  .board li:nth-child(n) { grid-column: auto; transform: rotate(-1.5deg); }
  .board li:nth-child(even) { transform: rotate(1.6deg) translateY(14px); }
  .board li:nth-child(5) { grid-column: 1 / -1; width: 84%; justify-self: center; }
  .board p { font-size: 14px; }
  .whats-left { margin-top: 72px; }
  .steps { grid-template-columns: 1fr; gap: 40px; }
  .steps li:nth-child(2) { transform: none; margin-left: 10%; }
  .page-head { grid-template-columns: 1fr; padding-top: 12px; }
  .head-pic { justify-self: center; }
  .head-pic .head-art { width: 210px; }
  .head-pic .sticker { width: 66px; height: 66px; font-size: .85rem; left: -26px; }
  .head-pic:not(:has(svg)) .sticker { display: none; }
  .fig { padding: 14px 10px 12px; margin-inline: -6px; overflow-x: auto; }
  .fig svg { min-width: 470px; }
  .doc { grid-template-columns: 1fr; gap: 36px; }
  .notes { position: static; }
  .prose { font-size: 17px; }
  .posts { grid-template-columns: 1fr; }
  .lost { grid-template-columns: 1fr; padding-top: 8px; }
  .lost .eye { order: -1; width: 80%; justify-self: center; }
  .foot { grid-template-columns: 1fr; }
  .foot nav { grid-template-columns: 1fr 1fr; gap: 20px; }
}
@media (max-width: 420px) {
  .foot nav { grid-template-columns: 1fr 1fr; }
  .faq summary { font-size: 1.25rem; }
}

/* ── languages: the list in every footer, and Japanese in its own system font ── */
/* system font here, so the accented names don't pull the extra-letters font into English pages */
.foot .langs { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Hiragino Sans", "Noto Sans JP", "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", "Geeza Pro", "Noto Sans Arabic", Tahoma, Arial, sans-serif; grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0; padding-top: 18px; border-top: 1px dashed #18141f40; font-size: 15px; max-width: none; }
.foot .langs a { color: var(--ink-2); text-decoration: none; }
.foot .langs a:hover { color: var(--ink); text-decoration: underline; }
.foot .langs a[aria-current="page"] { color: var(--ink); font-weight: 700; }
:lang(ja) { --display: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", Meiryo, sans-serif; --text: var(--display); word-break: auto-phrase; line-break: strict; }
:lang(ja) .hero h1, :lang(ja) .h-display { font-weight: 800; letter-spacing: 0; }
:lang(ja) .hero h1 { font-size: clamp(2.3rem, 6.4vw, 6rem); line-height: 1.05; }
:lang(ja) .board h3 { font-size: clamp(1.2rem, 2vw, 1.7rem); }
:lang(ja) .btn { font-weight: 700; }
/* Korean: system Korean fonts, and lines break between words, not inside them */
:lang(ko) { --display: "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif; --text: var(--display); word-break: keep-all; }
:lang(ko) .hero h1, :lang(ko) .h-display { font-weight: 800; letter-spacing: 0; }
:lang(ko) .hero h1 { font-size: clamp(2.4rem, 6.8vw, 6.4rem); line-height: 1.02; }
:lang(ko) .board h3 { font-size: clamp(1.2rem, 2vw, 1.7rem); }
:lang(ko) .btn { font-weight: 700; }
/* Arabic: right to left, system Arabic fonts, no letter-spacing (it breaks the joined letters) */
:lang(ar) { --display: "Geeza Pro", "SF Arabic", "Noto Sans Arabic", "Segoe UI", Tahoma, sans-serif; --text: var(--display); }
:lang(ar) .hero h1, :lang(ar) .h-display, :lang(ar) .page-head h1 { font-weight: 700; letter-spacing: 0; }
:lang(ar) .hero h1 { font-size: clamp(2.4rem, 6.6vw, 6.2rem); line-height: 1.2; }
:lang(ar) .h-display { line-height: 1.2; }
:lang(ar) .board h3 { font-size: clamp(1.2rem, 2vw, 1.7rem); }
:lang(ar) .whats-left { line-height: 1.35; }
:lang(ar) .btn { font-weight: 700; }
[dir="rtl"] .arr { scale: -1 1; }
:lang(ar) .hero h1 .strip { padding-inline: .32em; }
:lang(ar) .hero h1 .l3 { padding-inline: .7em; }
[dir="rtl"] .hero h1 .l2 { transform: rotate(-1.4deg) translateX(-.3em); }
[dir="rtl"] .whats-left { margin: 130px auto 0 0; text-align: left; }
[dir="rtl"] .faq summary { padding: 20px 0 20px 52px; }
[dir="rtl"] .faq summary::after { right: auto; left: 4px; }
[dir="rtl"] .steps li::before { left: auto; right: 18px; }
[dir="rtl"] .steps .art { right: auto; left: 14px; }
@media (max-width: 860px) {
  [dir="rtl"] .whats-left { margin-top: 72px; }
  [dir="rtl"] .steps li:nth-child(2) { margin-left: 0; margin-right: 10%; }
}
