/* Page defaults, type and the shared shell. */
* { box-sizing:border-box; }
html { -webkit-text-size-adjust:100%; }
body { margin:0; background:var(--bg); color:var(--fg); font:calc(1.0625rem * var(--ts))/1.6 var(--sans); text-rendering:optimizeLegibility;
       -webkit-font-smoothing:antialiased; overflow-wrap:break-word; }
a { color:var(--link); text-underline-offset:3px; text-decoration-thickness:1px; }
/* Focus: a ring for keyboard focus only (:focus-visible), never for a mouse click. A label shows
   the ring when the control inside it has keyboard focus. */
:focus { outline:none; }
:focus-visible, label:has(:focus-visible) { outline:2px solid var(--accent); outline-offset:2px; }
/* A plain <button> has no look of its own; components give it one. */
button { font:inherit; color:inherit; background:none; border:0; padding:0; cursor:pointer; }
/* Sticky bars never hide the element that has focus. */
html { scroll-padding-top:calc(var(--subnav-h, 0px) + 72px); scroll-padding-bottom:calc(var(--tabs-h) + 16px); }
.wrap { max-width:728px; margin:0 auto; padding:0 var(--gutter); }
.sr { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }

/* Header: brand + subscribe on one row, theme pills scroll underneath on phones. */
/* Header: logo left; subscribe and language top right. Themes live in the pinned sub-menu below. */
header.site { padding:12px 0; }
.bar { display:flex; align-items:center; justify-content:space-between; gap:10px; }
.bar .right { display:flex; align-items:center; gap:6px; }
a.brand { display:inline-flex; align-items:center; gap:7px; font:700 1.25rem/1 var(--serif); color:var(--fg);
           text-decoration:none; letter-spacing:-0.01em; white-space:nowrap; }
/* The snail is drawn through a mask in the current text colour, so it follows light, dark and the inverted footer. */
.logo-mark { display:inline-block; flex:none; width:44px; height:31px; background:currentColor;
             -webkit-mask:url("/static/snail.svg?v=2") no-repeat center / contain; mask:url("/static/snail.svg?v=2") no-repeat center / contain; }
/* The wordmark ends in the amber full stop, attached to the words so it follows them when they wrap. */
.brand-name::after { content:"."; color:var(--accent); }
.brand-name { min-width:0; }
.pill-link { font-size:0.875rem; font-weight:600; color:var(--bg); background:var(--fg); text-decoration:none; white-space:nowrap;
             border-radius:var(--round); padding:0 14px; min-height:38px; display:inline-flex; align-items:center; }
.langmenu { position:relative; }
.langmenu summary { list-style:none; cursor:pointer; display:inline-flex; align-items:center; gap:5px; min-height:38px;
                    padding:0 10px; border-radius:var(--round); border:1px solid var(--control); font:600 0.8125rem/1 var(--sans); color:var(--fg); }
.langmenu summary::-webkit-details-marker { display:none; }
.langmenu[open] summary { border-color:var(--fg); }
.langmenu .chev { opacity:.6; }
.langmenu ul { position:absolute; right:0; top:calc(100% + 6px); z-index:40; list-style:none; margin:0; padding:6px;
               min-width:170px; background:var(--bg); border:1px solid var(--rule); border-radius:12px;
               box-shadow:0 10px 30px rgba(0,0,0,.12); }
.langmenu li a { display:block; padding:10px 12px; border-radius:8px; color:var(--fg); text-decoration:none; font-size:0.9375rem; }
@media (hover:hover) { .langmenu li a:hover { background:var(--surface); } }
.langmenu li a[aria-current] { font-weight:600; }
.langmenu li a[aria-current]::after { content:" ✓"; }
.m-only, .icon-btn.m-only { display:none; }
.icon-btn { display:inline-flex; align-items:center; justify-content:center; position:relative; width:44px; height:44px;
            min-height:44px; padding:0; border-radius:var(--round); background:transparent; color:var(--fg); border:0; text-decoration:none; }
@media (hover:hover) { .icon-btn:hover { background:var(--surface); } }
.icon-btn .n { position:absolute; top:4px; right:2px; min-width:18px; height:18px; padding:0 5px; border-radius:var(--round);
               background:var(--fg); color:var(--bg); font:600 0.6875rem/1.125rem var(--sans); text-align:center; }
/* Sheets: a native <dialog>, so focus, Esc and screen readers behave. */
dialog.sheet { border:0; padding:12px 18px 28px; background:var(--bg); color:var(--fg); margin:0 0 0 auto;
               width:min(88vw, 380px); max-width:100vw; height:100dvh; max-height:100dvh; overflow-y:auto; }
/* Behind a sheet or panel: the page dims and blurs, so the panel reads as the only thing in focus. */
dialog.sheet::backdrop { background:rgba(0,0,0,.28); -webkit-backdrop-filter:blur(8px); backdrop-filter:blur(8px); }
.sheet-head { display:flex; align-items:center; justify-content:space-between; margin:0 0 6px; }
.sheet-head .brand { display:inline-flex; align-items:center; gap:8px; font:700 1.1875rem/1 var(--serif); }
.sheet-head .logo-mark { width:36px; height:26px; }
.sheet-label { font:600 0.75rem/1.4 var(--sans); letter-spacing:.1em; text-transform:uppercase; color:var(--faint); margin:18px 0 6px; }
.sheet-nav a { display:flex; align-items:center; gap:14px; min-height:50px; padding:0 10px; margin:0 -10px; border-radius:12px;
               color:var(--fg); text-decoration:none; font-size:1.0625rem; }
@media (hover:hover) { .sheet-nav a:hover, .sheet-nav a[aria-current] { background:var(--surface); } }
.sheet-nav a[aria-current] { font-weight:600; }
.sheet-nav .ic { width:20px; text-align:center; font-size:1.0625rem; }
.sheet-nav .newcount { margin-left:auto; }
.sheet-cta { width:100%; margin:20px 0 0; }
.sheet-langs { display:flex; flex-wrap:wrap; gap:8px; }
.sheet-langs a { min-height:40px; display:inline-flex; align-items:center; padding:0 14px; border-radius:var(--round);
                 border:1px solid var(--control); color:var(--fg); text-decoration:none; font-size:0.9375rem; }
.sheet-langs a[aria-current] { background:var(--fg); color:var(--bg); border-color:var(--fg); }
@media (prefers-reduced-motion:no-preference) {
  dialog.sheet[open] { animation:sheet-in .22s ease-out; }
  @keyframes sheet-in { from { transform:translateX(100%); } to { transform:none; } }
}
.newcount { display:inline-flex; align-items:center; justify-content:center; min-width:18px; height:18px; padding:0 5px;
            border-radius:999px; background:var(--fg); color:var(--bg); font:600 0.6875rem/1 var(--sans); }
/* Phones: an app bar. Logo, a page action, a menu; everything else is in the sheet. */
@media (max-width:44.9375em) {
  .m-only, .icon-btn.m-only { display:inline-flex; }
  .d-only { display:none !important; }
  :root { --subnav-h:57px; }
  header.site { position:sticky; top:0; z-index:35; margin:0 calc(-1 * var(--gutter)); padding:6px calc(var(--gutter) - 11px) 6px var(--gutter);
                background:color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter:blur(8px); border-bottom:1px solid var(--rule); }
  header.site .pill-link, header.site .langmenu { display:none; }
  .bar .right { gap:0; }
  a.brand { font-size:1.1875rem; } a.brand .logo-mark { width:40px; height:28px; }
  nav.subnav { display:none; }
  main { padding-top:20px; }
}
/* Theme sub-menu: pinned under the header while you scroll. */
:root { --subnav-h:55px; }
nav.subnav { position:sticky; top:0; z-index:30; margin:0 calc(-1 * var(--gutter)) 26px; padding:8px var(--gutter);
             background:color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter:blur(8px);
             border-top:1px solid var(--rule); border-bottom:1px solid var(--rule); }
nav.subnav .in { display:flex; gap:6px; overflow-x:auto; scrollbar-width:none; }
nav.subnav .in::-webkit-scrollbar { display:none; }
nav.subnav a { flex:none; display:inline-flex; align-items:center; gap:7px; min-height:38px; padding:0 13px; font-size:0.9062rem;
               color:var(--muted); text-decoration:none; border:1px solid transparent; border-radius:var(--round); }
@media (hover:hover) { nav.subnav a:hover { color:var(--fg); background:var(--surface); } }
nav.subnav a[aria-current="page"] { color:var(--bg); background:var(--fg); }
nav.subnav .all { margin-left:auto; border-color:var(--rule); }
nav.subnav a[aria-current="page"] .newcount { background:var(--bg); color:var(--fg); }
/* Anchors land below the pinned menu (and the filter bar on theme pages). */
[id] { scroll-margin-top:calc(var(--subnav-h) + 64px); }
.theme-icon { flex:none; vertical-align:-3px; }

/* Type */
h1, h2, h3 { font-family:var(--serif); font-weight:700; letter-spacing:-0.01em; }
h1 { font-size:2.25rem; line-height:1.12; margin:6px 0 14px; text-wrap:balance; }
h2 { font-size:1.4375rem; line-height:1.22; margin:0 0 8px; }
h3 { font-size:1.1875rem; line-height:1.3; margin:0 0 6px; }
h2 a, h3 a { color:var(--fg); text-decoration:none; }
/* Chinese and Japanese headings keep phrases together, and break inside one only when it cannot fit. */
:lang(ja) :is(h1, h2, h3), :lang(zh) :is(h1, h2, h3) { word-break:auto-phrase; overflow-wrap:anywhere; text-wrap:balance; }
h1, h2, h3 { overflow-wrap:anywhere; }
/* On phones a Japanese theme title beside its icon can be one phrase wider than the space left (at large text sizes); there it breaks between characters, as Japanese normally does. */
@media (max-width:44.9375em) { :lang(ja) h1.with-icon { word-break:normal; } }
@media (hover:hover) { h2 a:hover, h3 a:hover { text-decoration:underline; text-decoration-color:var(--accent); } }
.lead { font:400 calc(1.1875rem * var(--ts))/1.55 var(--serif); color:var(--muted); margin:0 0 20px; }
.eyebrow { font:600 0.75rem/1.4 var(--sans); letter-spacing:0.12em; text-transform:uppercase; color:var(--faint); margin:0; }
.muted { color:var(--muted); font-size:0.9375rem; } .faint { color:var(--faint); font-size:0.8125rem; }
/* The brand motif as a divider: a line of text that ends in a full stop. */
.section-title { display:flex; align-items:center; gap:12px; font:600 0.8125rem/1.4 var(--sans); letter-spacing:0.1em;
                 text-transform:uppercase; color:var(--fg); margin:56px 0 8px; }
/* A section's action ("See all …") sits on the title's row, after the line. */
.section-title .section-action { order:2; flex:none; font:600 0.875rem/1 var(--sans); letter-spacing:0; text-transform:none;
                                 color:var(--fg); text-decoration:none; white-space:nowrap; }
@media (hover:hover) { .section-title .section-action:hover { text-decoration:underline; } }
.section-title::after { order:1; content:""; flex:1; min-width:24px; height:8px;
  background:linear-gradient(var(--rule), var(--rule)) left center / calc(100% - 14px) 1px no-repeat,
             radial-gradient(circle, var(--accent) 2.6px, transparent 3px) right center / 8px 8px no-repeat; }

/* Stars and tags */
.stars { color:var(--star); letter-spacing:2px; font-size:0.9375rem; line-height:1; }
.stars .e { color:var(--star-empty); }
.tags { display:flex; flex-wrap:wrap; gap:2px 0; margin:12px 0 0; padding:0; list-style:none; }
.tags li { font-size:0.8125rem; line-height:1.5; color:var(--faint); }
.tags li + li::before { content:"·"; margin:0 7px; color:var(--faint); }
.tags .t-free{color:var(--free)} .tags .t-paid{color:var(--paid)} .tags .t-lang{color:var(--lang)} .t-form{color:var(--faint)} .t-effort{color:var(--faint)}
.tags .t-frame { color:var(--frame); font-style:italic; }

/* Buttons and forms */
/* Buttons are styled through state tokens: each variant (components.css) sets every one of
   --btn-bg, --btn-fg, --btn-border and their -hover and -active forms, so a state can never
   fall back to another variant's colours. */
.btn { --btn-bg:var(--fg); --btn-fg:var(--bg); --btn-border:var(--fg);
       --btn-bg-hover:color-mix(in srgb, var(--fg) 84%, var(--bg)); --btn-fg-hover:var(--bg); --btn-border-hover:var(--btn-bg-hover);
       --btn-bg-active:color-mix(in srgb, var(--fg) 74%, var(--bg)); --btn-fg-active:var(--bg); --btn-border-active:var(--btn-bg-active);
       display:inline-flex; align-items:center; justify-content:center; gap:8px; min-height:48px;
       padding:0 20px; border-radius:var(--round); font:600 1rem/1 var(--sans); text-decoration:none; cursor:pointer;
       background:var(--btn-bg); color:var(--btn-fg); border:1px solid var(--btn-border); }
@media (hover:hover) { .btn:hover { background:var(--btn-bg-hover); color:var(--btn-fg-hover); border-color:var(--btn-border-hover); } }
.btn:active { background:var(--btn-bg-active); color:var(--btn-fg-active); border-color:var(--btn-border-active); }
.btn.small { min-height:40px; padding:0 14px; font-size:0.875rem; }
input[type=email], input[type=text], input[type=url], select, textarea {
  width:100%; min-height:50px; background:var(--surface); color:var(--fg); border:1px solid var(--control);
  border-radius:12px; padding:12px 14px; font:inherit; }
.notice.success { border-left-color:var(--free); } .notice.warning { border-left-color:var(--paid); }
.notice { border-left:2px solid var(--accent); background:var(--surface);
          border-radius:0 8px 8px 0; padding:12px 14px; margin:0 0 22px; font-size:0.9375rem; }

details.fold { border-top:1px solid var(--rule); padding:4px 0; }
details.fold:last-of-type { border-bottom:1px solid var(--rule); }
details.fold summary { cursor:pointer; list-style:none; display:flex; justify-content:space-between; align-items:center;
                       min-height:52px; font-weight:600; }
details.fold summary::-webkit-details-marker { display:none; }
details.fold summary::after { content:"+"; font-size:1.375rem; color:var(--faint); }
details.fold[open] summary::after { content:"–"; }
details.fold > div { padding:0 0 18px; color:var(--muted); font-size:0.9375rem; }

/* Footer: part of the page, quiet, under one hairline. */
footer.site { margin-top:96px; color:var(--muted); }
footer.site .in { max-width:728px; margin:0 auto; padding:32px var(--gutter) calc(32px + var(--tabs-h) + env(safe-area-inset-bottom)); }
footer.site .in { border-top:1px solid var(--rule); }
footer.site a { color:var(--muted); }
footer.site .brand { color:var(--fg); font-size:1.25rem; }
footer.site .brand .logo-mark { width:44px; height:31px; }
footer.site .tagline { font:400 1.125rem/1.4 var(--serif); margin:10px 0 32px; color:var(--muted); }
footer.site .cols { display:grid; grid-template-columns:1fr 1fr; gap:24px; margin:0 0 28px; }
footer.site h4 { font:600 0.75rem/1.4 var(--sans); letter-spacing:.1em; text-transform:uppercase; margin:0 0 10px; color:var(--faint); }
footer.site ul { list-style:none; margin:0; padding:0; display:grid; gap:8px; font-size:0.9375rem; }
@media (hover:hover) { footer.site ul a { text-decoration:none; } footer.site ul a:hover { color:var(--fg); text-decoration:underline; } }
footer.site .langs { display:flex; flex-wrap:wrap; gap:6px 14px; font-size:0.875rem; margin:0 0 22px; }
footer.site .langs a { text-decoration:none; } footer.site .langs a[aria-current] { color:var(--fg); text-decoration:underline; }
/* Appearance: System, Light, Dark. A segmented control; it needs JavaScript. */
.modes, .js-only { display:none; }
.js .modes { display:inline-flex; gap:2px; padding:3px; border-radius:var(--round); border:1px solid var(--control); }
.js .js-only { display:block; }
.modes button { display:inline-flex; align-items:center; gap:6px; min-height:36px; padding:0 12px; border:0; border-radius:var(--round);
                background:transparent; color:var(--muted); font:500 0.8438rem/1 var(--sans); cursor:pointer; }
.modes button[aria-checked="true"] { background:var(--fg); color:var(--bg); }
.sheet .modes { display:flex; width:100%; } .sheet .modes button { flex:1; justify-content:center; min-height:44px; padding:0 6px; }
.foot-modes { margin:0 0 22px; }
/* How we rate, and what we do and don't do: in the footer on every page. */
footer.site .about { display:grid; gap:28px; margin:0 0 32px; padding-bottom:28px; border-bottom:1px solid var(--rule); }
footer.site .about ul { gap:9px; font-size:0.9062rem; line-height:1.5; }
footer.site .rate li { display:grid; grid-template-columns:max-content 1fr; gap:10px; align-items:baseline; }
footer.site .rate .stars { letter-spacing:1px; white-space:nowrap; }
footer.site .rate .note-line { display:block; color:var(--faint); font-size:0.8438rem; margin-top:2px; }
footer.site .dodont li { display:flex; gap:10px; } footer.site .dodont li::before { flex:none; width:14px; font-weight:700; }
footer.site .dodont.do li::before { content:"✓"; color:var(--free); }
footer.site .dodont.dont li::before { content:"✕"; color:var(--paid); }
footer.site .fine { font-size:0.7812rem; line-height:1.6; color:var(--faint); margin:0; border-top:1px solid var(--rule); padding-top:16px; }

@media (min-width:45em) {
  :root { --gutter:24px; }
  header.site { padding:16px 0; }
  h1 { font-size:2.75rem; }
  a.brand { font-size:1.4375rem; gap:10px; } a.brand .logo-mark { width:52px; height:37px; }
  footer.site .cols { grid-template-columns:repeat(3, 1fr); }
  footer.site .about { grid-template-columns:1.3fr 1fr 1fr; gap:28px; }
  h2 { font-size:1.5625rem; }
}
@media (prefers-reduced-motion:no-preference) {
  a, button, .btn { transition:border-color .15s, background-color .15s, color .15s, opacity .15s; }
}
