/* Public pages. Fonts and colour tokens come from /brand.css. */
* { box-sizing: border-box; }
html { color: var(--ink); background: var(--paper); font: 17px/1.6 var(--sans); -webkit-text-size-adjust: 100%; }
body { margin: 0; -webkit-font-smoothing: antialiased; min-height: 100vh; display: flex; flex-direction: column; }
body > main { flex: 1 0 auto; }
body > header, body > main, body > footer { width: 100%; max-width: 77rem; margin-inline: auto; padding-inline: clamp(1.1rem, 4vw, 2rem); }
a { color: inherit; text-underline-offset: 0.2em; text-decoration-thickness: 1.5px; }
a:hover { color: var(--fox-deep); }
:focus-visible { outline: 3px solid var(--fox-deep); outline-offset: 3px; border-radius: 4px; }
img { max-width: 100%; height: auto; }

/* ---------- header ---------- */
body > header { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem 2rem; flex-wrap: wrap; padding-block: 1.1rem; }
.wordmark { display: inline-flex; align-items: center; gap: 0.6rem; font: 800 1.6rem/1 var(--display); letter-spacing: -0.045em; text-transform: lowercase; text-decoration: none; color: var(--ink); }
.wordmark img { width: 2.35rem; height: auto; flex: none; }
header nav { display: flex; align-items: center; gap: 0.35rem 1.5rem; flex-wrap: wrap; font-weight: 500; font-size: 0.95rem; }
header nav a { text-decoration: none; padding-block: 0.45rem; }
header nav a:hover { text-decoration: underline; }
.pill, header nav a.pill { background: var(--ink); color: #fff; border-radius: var(--pill); padding: 0.6rem 1.15rem; font-weight: 700; text-decoration: none; }
.pill:hover, header nav a.pill:hover { background: #3a322b; color: #fff; text-decoration: none; }
.locale-menu { position: relative; font-weight: 500; }
.locale-menu summary { cursor: pointer; list-style: none; border: 1.5px solid var(--line-strong); border-radius: var(--pill); padding: 0.5rem 1rem; }
.locale-menu summary::-webkit-details-marker { display: none; }
.locale-menu summary::after { content: "▾"; margin-inline-start: 0.4rem; font-size: 0.8em; }
.locale-menu[open] { flex-basis: 100%; }
.locale-menu[open] summary { display: inline-block; margin-block-end: 0.5rem; }
.locale-menu a { display: inline-block; margin-inline-end: 1.1rem; padding-block: 0.3rem; }
.locale-menu [aria-current="page"] { font-weight: 700; text-decoration: underline; }

/* ---------- article pages ---------- */
main { min-height: 60vh; padding-block: 2.5rem 4rem; }
h1, h2, h3, caption { font-family: var(--display); letter-spacing: -0.035em; line-height: 1.05; text-wrap: balance; }
h1 { font-size: clamp(2.5rem, 6.5vw, 4.4rem); font-weight: 800; letter-spacing: -0.045em; line-height: 0.98; max-width: 16ch; margin: 0.4em 0 0.45em; }
h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); font-weight: 800; margin: 2.4em 0 0.6em; }
h3 { font-size: 1.2rem; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 0.4em; }
p, main > ul, main > ol { max-width: 68ch; }
p { margin: 0 0 1em; }
.intro { font-size: 1.25rem; line-height: 1.5; max-width: 46ch; color: var(--ink-2); }
main > a, main > p > a:only-child { font-weight: 700; }
ul { padding-inline-start: 1.2rem; }
section { margin-block: 3.5rem; }
details > summary { cursor: pointer; font-weight: 700; }
[role="status"], #result { font-weight: 500; }
#result:not(:empty) { background: var(--oat); border-radius: var(--r-l); padding: 1.4rem 1.6rem; margin-block: 1.5rem; max-width: 48rem; }
#result h2 { margin-top: 0; }

/* ---------- buttons and forms ---------- */
.cta, button { display: inline-block; background: var(--fox); color: var(--ink); border: 0; border-radius: var(--pill); padding: 0.85rem 1.5rem; font: 700 1rem/1.2 var(--sans); cursor: pointer; text-decoration: none; }
.cta:hover, button:hover { background: #ff7440; color: var(--ink); }
form { display: flex; align-items: end; flex-wrap: wrap; gap: 1rem; margin: 1.5rem 0; }
main > form { background: var(--oat); border-radius: var(--r-l); padding: 1.5rem; max-width: 48rem; }
label { display: grid; gap: 0.3rem; font-weight: 500; font-size: 0.95rem; }
form > label { min-width: 0; max-width: 100%; }
input, select { max-width: 100%; font: inherit; color: var(--ink); background: #fff; border: 1.5px solid var(--line-strong); border-radius: var(--r-s); padding: 0.6rem 0.75rem; min-height: 2.75rem; }
input[type="checkbox"], input[type="radio"] { min-height: 0; width: 1.15rem; height: 1.15rem; padding: 0; margin: 0 0.4rem 0 0; vertical-align: -0.15em; accent-color: var(--fox-deep); }
input:focus, select:focus { border-color: var(--ink); outline: 0; }
label:has(select[data-regions]) { grid-template-columns: minmax(0, 1fr); }
select[data-regions] { width: 100%; min-width: 0; }

/* ---------- tables ---------- */
table { width: 100%; max-width: 48rem; border-collapse: collapse; font-variant-numeric: tabular-nums; margin-block: 1.5rem; }
caption { text-align: start; font-size: 1.15rem; font-weight: 700; margin-bottom: 0.8rem; }
th, td { text-align: start; padding: 0.7rem 0.6rem; border-bottom: 1.5px solid var(--line); }
thead th { font-size: 0.85rem; color: var(--ink-3); font-weight: 500; }

/* ---------- card grids ---------- */
.tools { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 17.5rem), 1fr)); gap: 1rem; list-style: none; padding: 0; max-width: 100%; }
.tools li { border: 1.5px solid var(--line); border-radius: var(--r-l); padding: 1.4rem 1.5rem; display: flex; flex-direction: column; gap: 0.5rem; }
.tools li > a:first-child { font: 700 1.2rem/1.2 var(--display); letter-spacing: -0.02em; text-decoration: none; }
.tools li > a:first-child:hover { text-decoration: underline; }
.tools p { margin: 0; color: var(--ink-2); font-size: 0.95rem; }
.tools li ul { padding-inline-start: 1.1rem; margin: 0; font-variant-numeric: tabular-nums; }
.tools li p:last-child { margin-top: auto; padding-top: 0.5rem; font-weight: 500; color: var(--ink); }

.shelf-title { margin-top: 1.5em; }
.shelf-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin-block: 1.2rem 1rem; align-items: stretch; }
.shelf-cards article { border: 1.5px solid var(--line); border-radius: var(--r-l); padding: 1.1rem 1.1rem 1.3rem; }
.shelf-cards article > a { text-decoration: none; display: block; }
.shelf-cards h2 { margin: 1rem 0.3rem 0.3rem; font-size: 1.7rem; }
.shelf-cards article > a:hover h2 { text-decoration: underline; }
.shelf-cards p { margin: 0.2rem 0.3rem; color: var(--ink-2); font-size: 1rem; }
.shelf-art { display: block; height: 6.5rem; border-radius: var(--r-m); background-color: var(--oat); background-repeat: no-repeat; background-position: 1.2rem 100%; background-size: 62% 70%;
  background-image: repeating-linear-gradient(90deg, var(--ink) 0 1.35rem, transparent 1.35rem 1.7rem); }
.shelf-art.comics { background-image: repeating-linear-gradient(90deg, var(--ink) 0 0.42rem, transparent 0.42rem 0.68rem); background-size: 70% 62%; }
.shelf-art.manga { background-color: var(--butter); background-image: repeating-linear-gradient(90deg, var(--fox) 0 0.9rem, transparent 0.9rem 1.2rem); background-size: 68% 74%; }

/* ---------- home ---------- */
main.home { padding-top: 0.5rem; }
.hero { background: var(--butter); border-radius: var(--r-xl); padding: clamp(1.6rem, 5vw, 4rem) clamp(1.3rem, 5vw, 4rem) 0; display: flex; gap: 2rem 3rem; flex-wrap: wrap; align-items: flex-end; margin-block: 0 1rem; }
.hero-copy { flex: 1 1 32rem; min-width: 0; padding-bottom: clamp(1.6rem, 5vw, 4rem); }
.hero h1 { font-size: clamp(2.7rem, 7vw, 4.9rem); max-width: 12ch; margin: 0 0 0.3em; }
.hero .intro { color: var(--ink); max-width: 34rem; }
.eyebrow { font-weight: 700; font-size: 0.9rem; margin-bottom: 1.2rem; }
.budget { display: block; background: #fff; border-radius: var(--r-l); padding: 1.3rem 1.5rem; max-width: 33rem; margin: 1.8rem 0 0; }
.budget label { font-weight: 700; font-size: 1rem; }
.budget div { display: flex; gap: 0.8rem; align-items: center; margin-top: 0.6rem; flex-wrap: wrap; }
.budget input { flex: 1 1 7rem; font: 800 2.2rem/1 var(--display); letter-spacing: -0.03em; border: 0; border-bottom: 3px solid var(--ink); border-radius: 0; padding: 0.1rem 0.2rem; min-width: 0; width: 7rem; background: transparent; }
.budget p { margin: 0.7rem 0 0; font-size: 0.85rem; color: var(--ink-3); }
.hero-scout { flex: 1 1 18rem; display: flex; flex-direction: column; align-items: center; min-width: 0; }
.hero-scout img { width: min(20rem, 70%); display: block; }
.bubble { background: #fff; border: 2.5px solid var(--ink); border-radius: 1.7rem 1.7rem 1.7rem 0.4rem; padding: 0.9rem 1.3rem; font: 700 1.45rem/1.15 var(--display); letter-spacing: -0.02em; max-width: 19rem; align-self: flex-end; transform: rotate(2deg); margin: 0 0 0.6rem; }
html[dir="rtl"] .bubble { border-radius: 1.7rem 1.7rem 0.4rem 1.7rem; }

.ways { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); gap: 1rem; margin-block: 1rem 0; }
.way { border: 1.5px solid var(--line); border-radius: var(--r-xl); padding: clamp(1.5rem, 4vw, 2.5rem); display: flex; flex-direction: column; gap: 0.8rem; text-decoration: none; }
.way h2 { margin: 0; font-size: clamp(1.8rem, 3.5vw, 2.5rem); }
.way p { margin: 0; color: var(--ink-2); max-width: 28rem; }
.way .tag { font-weight: 700; font-size: 0.85rem; color: var(--fox-deep); }
.way .more { margin-top: auto; padding-top: 0.6rem; font-weight: 700; }
.way .more::after { content: " →"; }
html[dir="rtl"] .way .more::after { content: " ←"; }
.way:hover { color: inherit; border-color: var(--ink); }
.way.dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.way.dark p { color: #d9d2c7; }
.way.dark .tag { color: var(--butter); }
.way.dark:hover { color: #fff; background: #2a231d; }

.steps { margin-block: 3.5rem 4rem; }
.steps h2 { margin: 0 0 1.6rem; }
.steps ol { list-style: none; padding: 0; margin: 0; max-width: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); gap: 2rem 3rem; counter-reset: step; }
.steps li { counter-increment: step; }
.steps li::before { content: counter(step); display: grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: 50%; background: var(--butter); color: var(--ink); font: 800 1.3rem/1 var(--display); }
.steps h3 { margin: 0.6rem 0 0.4rem; font-size: 1.35rem; }
.steps ol p { margin: 0; color: var(--ink-2); }
.start { margin: 2.2rem 0 0; }
.guides ul { list-style: none; padding: 0; display: grid; gap: 0; max-width: 48rem; }
.guides li { border-top: 1.5px solid var(--line); }
.guides li a { display: block; padding: 0.9rem 0; font-weight: 500; text-decoration: none; }
.guides li a::after { content: " →" / ""; color: var(--fox-deep); }
.guides li a:hover { text-decoration: underline; }
.trust { display: flex; gap: 2rem; align-items: center; flex-wrap: wrap; background: var(--oat); border-radius: var(--r-xl); padding: clamp(1.5rem, 4vw, 2.8rem); }
.trust img { width: 7rem; flex: none; }
.trust div { flex: 1 1 22rem; }
.trust h2 { margin: 0 0 0.5rem; }
.trust a { font-weight: 700; }

/* ---------- shared collection card ---------- */
.collection-card { background: var(--butter); border-radius: var(--r-xl); padding: 1.8rem 2.2rem; max-width: 42rem; }
.collection-card h2 { margin: 0 0 0.5rem; }
.collection-card ul { columns: 2; }

main > .reader { margin-top: 2.5rem; padding-top: 1.6rem; border-top: 1.5px solid var(--line); }
main > p + .reader { margin-top: 1.5rem; }
label:has(> input[type="checkbox"]) { display: flex; align-items: center; gap: 0.2rem; font-weight: 500; }
.guide-card { border: 1.5px solid var(--line); border-radius: var(--r-l); padding: 1.4rem 1.5rem; max-width: 48rem; margin-block: 1.5rem; }
.guide-card h2 { font-size: 1.35rem; margin: 0 0 0.4rem; }
.guide-card h2 a { text-decoration: none; }
.guide-card h2 a:hover { text-decoration: underline; }
.guide-card p { margin: 0; color: var(--ink-2); }
.hero.local h1 { font: 700 0.85rem/1.2 var(--sans); letter-spacing: 0.08em; text-transform: uppercase; max-width: none; margin: 0 0 0.9rem; }
.hero .headline { font: 800 clamp(2.5rem, 6.5vw, 4.6rem)/0.98 var(--display); letter-spacing: -0.045em; max-width: 13ch; margin: 0 0 0.3em; text-wrap: balance; }
html:lang(ja) .hero .headline, html:lang(ko) .hero .headline, html:lang(zh-Hans) .hero .headline, html:lang(zh-Hant) .hero .headline, html:lang(th) .hero .headline, html:lang(hi) .hero .headline, html:lang(ar) .hero .headline { letter-spacing: 0; line-height: 1.15; font-size: clamp(2.1rem, 5.5vw, 3.6rem); }
.hero.local { margin-bottom: 2rem; }
.hero-scout:only-child, .hero-scout:not(:has(.bubble)) { justify-content: flex-end; }

.trust { margin-block: 3.5rem 0; }
.more { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr)); gap: 1.5rem 4rem; margin-block: 3.5rem 0; padding-top: 2.2rem; border-top: 1.5px solid var(--line); }
.more h2 { font: 700 0.85rem/1.2 var(--sans); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 0.6rem; }
.more ul { list-style: none; padding: 0; margin: 0; max-width: none; }
.more li a { display: inline-block; padding: 0.4rem 0; text-decoration: none; font-weight: 500; }
.more li a:hover { text-decoration: underline; }
html[dir="rtl"] .more ul { padding-inline-start: 0; }
.shelf-title { margin-top: 0; }

/* ---------- footer ---------- */
body > footer { margin-top: 2rem; padding-block: 1.6rem 2.6rem; border-top: 1.5px solid var(--line); font-size: 0.9rem; color: var(--ink-3); display: flex; flex-wrap: wrap; gap: 0.5rem 2rem; justify-content: space-between; }
body > footer p { margin: 0; max-width: none; }
body > footer .locale-menu { display: inline-block; margin-inline-start: 1rem; }
body > footer .locale-menu summary { display: inline-block; padding: 0.3rem 0.8rem; }

html[dir="rtl"] ul { padding-left: 0; padding-inline-start: 1.2rem; }
html[dir="rtl"] .tools, html[dir="rtl"] .guides ul, html[dir="rtl"] .steps ol { padding-inline-start: 0; }

@media (max-width: 720px) {
  html { font-size: 16px; }
  .shelf-cards { grid-template-columns: 1fr; }
  .shelf-cards article { display: grid; grid-template-columns: 5.5rem 1fr; column-gap: 0.4rem; align-items: start; }
  .shelf-cards article > a { display: contents; }
  .shelf-art { grid-row: span 3; height: 100%; min-height: 5.5rem; background-position: 0.6rem 100%; background-size: 78% 66%; }
  .shelf-cards h2 { margin-top: 0.2rem; }
  .hero-scout img { width: 11rem; }
  .bubble { font-size: 1.15rem; }
  header nav { gap: 0.2rem 1.1rem; }
  .collection-card ul { columns: 1; }
}
@media print {
  header nav, footer, #card > a, #card > button { display: none; }
  .collection-card { border: 1.5px solid var(--ink); break-inside: avoid; }
}
