:root {
  /* Black and off-white with one lime accent. --accent is for fills (buttons, chips); --accent-text is
     the readable version for text and outlines, which is darker on light backgrounds. */
  --bg: #f2f2f0;
  --surface: #e8e8e5;
  --paper: #ffffff;
  --ink: #0a0a0a;
  --muted: #545454;
  --accent: #c5f82a;
  --accent-ink: #0a0a0a;
  --accent-text: #3f6b00;
  --field: #dcdcd8;
  --band: #0a0a0a;
  --band-ink: #f2f2f0;
  --hero-bg: var(--field);
  --notice-bg: var(--surface);
  --card-edge: rgba(10, 10, 10, .08);
  --card-shadow: rgba(10, 10, 10, .12);
  --ease: cubic-bezier(.2, .7, .2, 1);
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --dots: "Doto", var(--mono);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --surface: #0e0e0e;
    --paper: #161616;
    --ink: #f2f2f0;
    --muted: #a6a6a6;
    --accent: #c5f82a;
    --accent-ink: #0a0a0a;
    --accent-text: #c5f82a;
    --field: #262626;
    --band: #000000;
    --band-ink: #f2f2f0;
    --hero-bg: #000000;
    --notice-bg: rgba(255, 255, 255, .04);
    --card-edge: rgba(255, 255, 255, .08);
    --card-shadow: rgba(0, 0, 0, .5);
  }
}
@font-face { font-family: "Newsreader"; font-style: normal; font-weight: 400 600; font-display: swap; src: url(/static/fonts/newsreader.woff2) format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 400 700; font-display: swap; src: url(/static/fonts/jetbrains-mono.woff2) format("woff2"); }
@font-face { font-family: "Doto"; font-style: normal; font-weight: 100 900; font-display: swap; src: url(/static/fonts/doto.woff2) format("woff2"); }
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", "Noto Sans", "Noto Sans Devanagari", "Noto Sans Bengali", "Noto Sans Telugu", "Noto Sans Tamil", "Noto Sans Gujarati", "Noto Sans Kannada", "Noto Sans Oriya", "Noto Sans Malayalam", "Noto Sans Gurmukhi", "Noto Naskh Arabic", "Noto Sans Arabic", sans-serif;
  font-size: 1.0625rem;
  line-height: 1.55;
}
a { color: inherit; text-underline-offset: .2em; }
:focus-visible { outline: 3px solid var(--accent-text); outline-offset: 3px; }
[hidden] { display: none !important; }
.skip { position: absolute; inset-inline-start: 0; top: 0; transform: translateY(-200%); background: var(--ink); color: var(--bg); padding: .6rem 1rem; z-index: 10; }
.skip:focus { transform: none; }

h1, h2, h3 { font-weight: 800; letter-spacing: -.02em; line-height: 1.05; text-wrap: balance; margin: 0; }
h1 { font-size: clamp(2.25rem, 1rem + 5.5vw, 4.5rem); }
h2 { font-size: clamp(1.9rem, 1rem + 3vw, 3.25rem); }
h3 { font-size: clamp(1.35rem, 1rem + 1.2vw, 1.9rem); line-height: 1.15; }
.lede { font-size: 1.2rem; color: var(--muted); margin: .75rem 0 0; max-width: 34rem; }
.meta { color: var(--muted); font-size: .9375rem; margin: .5rem 0; }

/* header, notice */
.bar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1rem clamp(1rem, 4vw, 2rem); }
.brand { font-weight: 800; font-size: 1.2rem; letter-spacing: -.02em; text-decoration: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.langmenu { position: relative; }
.langmenu summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: .5rem; background: var(--ink); color: var(--bg); padding: .45rem 1rem; border-radius: 99px; font-weight: 600; font-size: .9375rem; transition: transform .15s var(--ease); }
.langmenu summary::-webkit-details-marker { display: none; }
.langmenu summary::after { content: ""; border: .3rem solid transparent; border-top-color: currentColor; margin-top: .3rem; transition: rotate .2s var(--ease); }
.langmenu[open] summary::after { rotate: 180deg; margin-top: -.3rem; }
.langmenu summary:active { transform: scale(.97); }
.langmenu ul { position: absolute; inset-inline-end: 0; top: calc(100% + .5rem); z-index: 20; list-style: none; margin: 0; padding: .4rem; width: min(20rem, calc(100vw - 2rem)); max-height: 70vh; overflow: auto; background: var(--paper); color: var(--ink); display: grid; grid-template-columns: 1fr 1fr; gap: .1rem; filter: drop-shadow(0 0 .5px var(--card-edge)) drop-shadow(0 16px 28px var(--card-shadow)); }
.langmenu li a { display: block; padding: .6rem .8rem; text-decoration: none; font-weight: 600; transition: background .15s var(--ease); }
.langmenu li a:hover { background: var(--surface); }
.langmenu li a[aria-current] { color: var(--accent-text); }
.notice { background: var(--notice-bg); color: var(--ink); font-size: .9375rem; padding: .7rem clamp(1rem, 4vw, 2rem); }
.notice { max-width: none; }
.notice { display: flex; align-items: flex-start; gap: .6rem; }
.notice > span { max-width: 60ch; }
.notice::before { content: ""; display: inline-block; width: .6rem; height: .6rem; background: var(--accent-text); transform: rotate(45deg); flex: none; margin-top: .5em; }

main { max-width: 46rem; margin-inline: auto; padding: 1.5rem 1rem 3rem; }
main.wide { max-width: none; padding: 0; }

/* hero: the application form */
.hero { background: var(--hero-bg); padding: clamp(1.25rem, 4vw, 3.5rem) clamp(.75rem, 4vw, 2rem) clamp(2rem, 6vw, 5rem); }
.card-wrap {
  max-width: 44rem;
  margin-inline: auto;
  /* clip-path would cut off a border or box-shadow, so the edge and shadow are drawn around the clipped shape */
  filter: drop-shadow(0 0 .5px var(--card-edge)) drop-shadow(0 0 .5px var(--card-edge)) drop-shadow(0 22px 36px var(--card-shadow));
}
.card {
  background: var(--paper);
  padding: clamp(1.25rem, 4vw, 3rem);
  clip-path: polygon(0 22px, 22px 0, calc(100% - 22px) 0, 100% 22px, 100% calc(100% - 22px), calc(100% - 22px) 100%, 22px 100%, 0 calc(100% - 22px));
}
.finder { margin-top: 1.75rem; }
.finder label { display: block; font-weight: 700; margin-bottom: .5rem; }
.field { position: relative; }
.field input {
  width: 100%;
  font: inherit;
  font-size: 1.15rem;
  padding: .95rem 3rem .95rem 1rem;
  padding-inline: 1rem 3rem;
  color: var(--ink);
  background: var(--bg);
  border: 0;
  border-radius: 0;
  transition: background .2s var(--ease);
}
.field input::placeholder { color: var(--muted); }
.field input:focus-visible { outline-offset: 0; }
.field kbd { position: absolute; inset-inline-end: .9rem; top: 50%; translate: 0 -50%; background: var(--surface); color: var(--muted); font: inherit; font-size: .875rem; padding: .1rem .55rem; pointer-events: none; }
@media (hover: none) { .field kbd { display: none; } }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .9rem; }
.chip {
  font: inherit; font-size: .9375rem; font-weight: 600;
  background: var(--surface); color: var(--ink);
  border: 0; border-radius: 99px; padding: .45rem 1rem; cursor: pointer;
  transition: background .2s var(--ease), color .2s var(--ease), transform .15s var(--ease);
}
.chip:hover { background: var(--field); }
.chip:active { transform: scale(.96); }
.chip[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }

.results { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; gap: .5rem; }
.results a {
  display: grid; gap: .1rem; padding: 1rem 1.1rem;
  background: var(--surface); text-decoration: none;
  transition: background .2s var(--ease), transform .2s var(--ease);
}
.results a:hover { background: var(--field); transform: translateX(4px); }
.results a:active { transform: translateX(4px) scale(.995); }
.results strong { font-size: 1.15rem; line-height: 1.25; }
.results span { color: var(--muted); font-size: .9375rem; }
.results em { font-style: normal; font-size: .875rem; color: var(--accent-text); font-weight: 600; margin-top: .25rem; }
.empty { background: var(--surface); padding: 1rem 1.1rem; margin: 1rem 0 0; }

/* how it works: the slip */
.how { display: grid; gap: 2rem; padding: clamp(3rem, 8vw, 7rem) clamp(1rem, 4vw, 2rem); max-width: 72rem; margin-inline: auto; align-items: start; }
.how-text p { color: var(--muted); font-size: 1.15rem; max-width: 30rem; margin-top: 1rem; }
.slip {
  background: var(--paper);
  padding: 1.75rem 1.5rem 3rem;
  max-width: 30rem;
  -webkit-mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / 22px 100%;
  mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / 22px 100%;
}
.slip ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.25rem; }
.slip li { display: flex; align-items: baseline; gap: .5rem; font-variant-numeric: tabular-nums; }
.slip li span:first-child { font-weight: 600; }
.slip li span:last-child { color: var(--muted); white-space: nowrap; }
.dots { flex: 1; min-width: 1rem; height: 6px; background: radial-gradient(circle, var(--muted) 2px, transparent 2.5px) 0 50% / 9px 6px repeat-x; opacity: .6; }
.final { display: flex; justify-content: space-between; gap: 1rem; background: var(--ink); color: var(--bg); font-weight: 700; margin: 1.75rem -1.5rem 0; padding: .8rem 1.5rem; }

/* facts band */
.facts { background: var(--band); color: var(--band-ink); display: grid; gap: 2.5rem; padding: clamp(3rem, 8vw, 6rem) clamp(1rem, 4vw, 2rem); }
.facts h3 { font-size: clamp(1.3rem, 1rem + .9vw, 1.7rem); }
.facts > div { max-width: 26rem; }
.facts p { margin: .75rem 0 0; opacity: .8; }

/* faq */
.faq { max-width: 52rem; margin-inline: auto; padding: clamp(3rem, 8vw, 7rem) clamp(1rem, 4vw, 2rem); }
.faq h2 { margin-bottom: 2rem; }
.faq details { background: var(--surface); margin-bottom: .5rem; }
.faq summary { cursor: pointer; font-weight: 700; font-size: 1.1rem; padding: 1.1rem 1.25rem; padding-inline: 1.25rem 3rem; list-style: none; position: relative; transition: background .2s var(--ease); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary:hover { background: var(--field); }
.faq summary::after { content: "+"; position: absolute; inset-inline-end: 1.25rem; top: 50%; translate: 0 -50%; font-size: 1.5rem; font-weight: 400; transition: rotate .25s var(--ease); }
.faq details[open] summary::after { rotate: 45deg; }
.faq details p { margin: 0; padding: 0 1.25rem 1.25rem; color: var(--muted); max-width: 60ch; }

/* guide and text pages */
.langnote { background: var(--surface); border-inline-start: 6px solid var(--accent); padding: .75rem 1.1rem; margin: 0 0 1rem; font-size: .9375rem; }
.crumbs { margin-bottom: .75rem; font-size: .9375rem; }
.official { background: var(--surface); border-inline-start: 6px solid var(--accent); padding: .5rem 1.25rem 1rem; margin: 1.5rem 0; }
.official p { margin: .6rem 0; }
.button { display: inline-block; background: var(--accent); color: var(--accent-ink); padding: .7rem 1.3rem; text-decoration: none; font-weight: 700; transition: transform .15s var(--ease), filter .2s; }
.button:hover { filter: brightness(1.08); }
.button:active { transform: scale(.97); }
.prose h2 { font-size: 1.6rem; margin: 2.5rem 0 .75rem; }
.prose h3 { font-size: 1.2rem; line-height: 1.3; margin: 1.75rem 0 .5rem; letter-spacing: 0; }
.prose ol, .prose ul { padding-inline-start: 1.4rem; }
.prose li { margin: .5rem 0; }
/* Screenshots of official portals: framed like a browser window, captioned with their source. */
.prose .shot { margin: 1.25rem 0 1.75rem; }
.prose .shot a { display: block; border-radius: 12px; overflow: hidden; border: 1px solid var(--card-edge); box-shadow: 0 10px 30px -18px var(--card-shadow); background: #fff; }
.prose .shot img { display: block; width: 100%; height: auto; }
.prose .shot a:focus-visible { outline: 3px solid var(--accent-text); outline-offset: 3px; }
.prose .shot figcaption { margin-top: .5rem; font-size: .875rem; color: var(--muted); }
.prose li .shot { margin-top: .75rem; }

/* footer */

/* motion: content is visible without script; script opts in by adding .js */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s var(--ease), transform .7s var(--ease); transition-delay: var(--d, 0ms); }
.js .reveal.in { opacity: 1; transform: none; }
.js .hero .card-wrap { animation: rise .8s var(--ease) both; }
.js .results li { animation: rise .5s var(--ease) both; animation-delay: var(--d, 0ms); }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }
@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .js .hero .card-wrap, .js .results li { animation: none; }
  * { transition-duration: .01ms !important; }
}

@media (min-width: 52rem) {
  .how { grid-template-columns: 1fr 1fr; gap: 4rem; }
  .facts { grid-template-columns: repeat(3, 1fr); gap: 3rem; }
}

/* guide and text-page titles are read, not announced */
article h1 { font-size: clamp(2rem, 1rem + 3.2vw, 3.25rem); }

/* right-to-left (Urdu): only direction-specific motion needs a manual mirror */
[dir="rtl"] .results a:hover { transform: translateX(-4px); }
[dir="rtl"] .results a:active { transform: translateX(-4px) scale(.995); }
[dir="rtl"] .brand { letter-spacing: 0; }
/* Indic and Arabic scripts need more line height and no negative tracking */
:lang(hi), :lang(bn), :lang(mr), :lang(te), :lang(ta), :lang(gu), :lang(ur), :lang(kn), :lang(or), :lang(ml), :lang(pa) { line-height: 1.7; }
:lang(hi) :is(h1, h2, h3), :lang(bn) :is(h1, h2, h3), :lang(mr) :is(h1, h2, h3), :lang(te) :is(h1, h2, h3), :lang(ta) :is(h1, h2, h3), :lang(gu) :is(h1, h2, h3), :lang(ur) :is(h1, h2, h3), :lang(kn) :is(h1, h2, h3), :lang(or) :is(h1, h2, h3), :lang(ml) :is(h1, h2, h3), :lang(pa) :is(h1, h2, h3) { letter-spacing: 0; line-height: 1.25; }

/* header navigation */
.bar { flex-wrap: wrap; row-gap: .5rem; }
.mainnav { display: flex; gap: .25rem; margin-inline-start: auto; }
.mainnav a { padding: .45rem .85rem; border-radius: 99px; text-decoration: none; font-weight: 600; font-size: .9375rem; transition: background .15s var(--ease); }
.mainnav a:hover { background: var(--surface); }
@media (max-width: 36rem) {
  .mainnav { order: 3; width: 100%; margin: 0; }
  .langmenu { margin-inline-start: auto; }
}

/* home: pointer to the free tools directory */
.cta { background: var(--field); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.5rem; padding: clamp(2rem, 6vw, 4rem) max(1rem, calc((100% - 72rem) / 2)); }
.cta h2 { font-size: clamp(1.6rem, 1rem + 2vw, 2.6rem); }
.cta p { color: var(--ink); max-width: 36rem; margin: .5rem 0 0; opacity: .8; }

/* free tools directory */
.ico { width: 1.25rem; height: 1.25rem; flex: none; }
.lhero { background: var(--hero-bg); padding: clamp(2rem, 6vw, 4.5rem) clamp(1rem, 4vw, 2rem) clamp(1.5rem, 4vw, 3rem); }
.lhero-in { max-width: 72rem; margin-inline: auto; }
.lhero h1 { font-size: clamp(2.5rem, 1rem + 6vw, 5.5rem); max-width: 14ch; }
.lhero .lede { color: var(--ink); opacity: .8; max-width: 40rem; }
.lhero .finder { max-width: 40rem; margin-top: 1.5rem; }
.lhero .field input { background: var(--paper); }
.lhero .meta { color: var(--ink); opacity: .75; }

.rail { position: sticky; top: 0; z-index: 6; background: var(--bg); }
.rail-in { display: flex; gap: .5rem; overflow-x: auto; scroll-snap-type: x proximity; scroll-padding-inline: clamp(1rem, 4vw, 2rem); scrollbar-width: thin; padding: .75rem clamp(1rem, 4vw, 2rem); max-width: 80rem; margin-inline: auto; }
.railchip { flex: none; display: inline-flex; align-items: center; gap: .5rem; padding: .5rem .9rem; border-radius: 99px; background: var(--surface); text-decoration: none; font-weight: 600; font-size: .9375rem; scroll-snap-align: start; transition: background .2s var(--ease), color .2s var(--ease), transform .15s var(--ease); }
.railchip .ico { width: 1.1rem; height: 1.1rem; }
.railchip b { font-size: .8125rem; font-weight: 700; padding: 0 .45rem; border-radius: 99px; background: var(--bg); color: var(--muted); transition: background .2s var(--ease), color .2s var(--ease); }
.railchip:hover { background: var(--field); }
.railchip:active { transform: scale(.96); }
.railchip[aria-current="true"] { background: var(--accent); color: var(--accent-ink); }
.railchip[aria-current="true"] b { background: rgba(255, 255, 255, .22); color: inherit; }

.lgroups { max-width: 80rem; margin-inline: auto; padding: .5rem clamp(1rem, 4vw, 2rem) 1rem; }
.lgroup { position: relative; isolation: isolate; padding-block: clamp(1.5rem, 4vw, 3rem); scroll-margin-top: 4.5rem; overflow: hidden; }
.lgroup header { position: relative; display: flex; align-items: center; gap: .9rem; margin-bottom: 1.25rem; }
.lgroup h2 { font-size: clamp(1.5rem, 1rem + 2vw, 2.4rem); }
.tile { display: grid; place-items: center; width: 3rem; height: 3rem; flex: none; background: var(--accent); color: var(--accent-ink); clip-path: polygon(0 10px, 10px 0, calc(100% - 10px) 0, 100% 10px, 100% calc(100% - 10px), calc(100% - 10px) 100%, 10px 100%, 0 calc(100% - 10px)); }
.tile .ico { width: 1.6rem; height: 1.6rem; }
.gcount { font-size: .875rem; font-weight: 700; color: var(--muted); background: var(--surface); padding: .1rem .65rem; border-radius: 99px; }
.mark { position: absolute; inset-inline-end: -.5rem; top: -.75rem; width: clamp(6rem, 16vw, 11rem); color: var(--ink); opacity: .06; pointer-events: none; z-index: -1; }
.mark .ico { width: 100%; height: 100%; stroke-width: 1; }

.lcards { list-style: none; margin: 0; padding: 0; display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); }
.av { grid-area: av; display: grid; place-items: center; width: 2.75rem; height: 2.75rem; border-radius: .6rem; font-weight: 800; font-size: 1.2rem; }
.cardtext { grid-area: text; display: grid; gap: .15rem; min-width: 0; }
.cardtext strong { font-size: 1.05rem; line-height: 1.25; overflow-wrap: anywhere; }
.cardtext span { color: var(--muted); font-size: .9375rem; line-height: 1.45; }
.tmeta { grid-area: badge; display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin-top: .5rem; }
.badge { justify-self: start; font-size: .8125rem; font-weight: 700; padding: .12rem .65rem; border-radius: 99px; }
.b-free { background: color-mix(in srgb, var(--accent) 30%, transparent); color: var(--accent-text); }
.b-tier { background: var(--surface); color: var(--ink); }
.b-oss { background: var(--ink); color: var(--bg); }
.tone0 { background: var(--accent); color: var(--accent-ink); }
.tone1 { background: var(--ink); color: var(--bg); }
.tone2 { background: var(--field); color: var(--ink); }
.tone3 { background: color-mix(in srgb, var(--accent) 35%, var(--paper)); color: var(--ink); }
.tone4 { background: color-mix(in srgb, var(--ink) 14%, var(--paper)); color: var(--ink); }
.tone5 { background: color-mix(in srgb, var(--accent) 60%, var(--ink)); color: var(--accent-ink); }
.lempty { max-width: 40rem; margin: 1rem auto; }
.ldisc { max-width: 48rem; margin: 1.5rem auto 3.5rem; padding-inline: 1rem; color: var(--muted); font-size: .9375rem; }
html { scroll-behavior: auto; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

/* guide toolbar */
:root {
  --tb-bg: #e8e8e5;
  --tb-btn: #ffffff;
  --tb-ink: #0a0a0a;
  --tb-hover: #f5f5f3;
  --tb-edge: rgba(10, 10, 10, .12);
  --tb-primary: #c5f82a;
  --tb-primary-ink: #0a0a0a;
}
@media (prefers-color-scheme: dark) {
  :root {
    --tb-bg: #161616;
    --tb-btn: #262626;
    --tb-ink: #f2f2f0;
    --tb-hover: #333333;
    --tb-edge: rgba(255, 255, 255, .1);
    --tb-primary: #c5f82a;
    --tb-primary-ink: #0a0a0a;
  }
}
.gwrap { position: sticky; top: .5rem; z-index: 15; max-width: 90rem; margin: 1rem auto 0; padding-inline: clamp(.75rem, 2.5vw, 2rem); }
.gtoolbar { transition: box-shadow .25s var(--ease); }
/* Only once it is pinned and content slides under it does the bar float above the page. */
.gwrap.is-stuck .gtoolbar { box-shadow: 0 6px 20px rgba(0, 0, 0, .12), 0 0 0 1px var(--tb-edge); }
.gsentinel { height: 1px; margin-bottom: -1px; }
.gcol { max-width: 46rem; margin-inline: auto; padding: 1.5rem 1rem 3rem; }
/* Three columns: the outer two share the leftover space equally, so the centre stays centred,
   but each is at least as wide as its content, so nothing wraps on a normal desktop. */
.gtoolbar { display: grid; grid-template-columns: minmax(max-content, 1fr) auto minmax(max-content, 1fr); align-items: center; gap: .75rem 1rem; padding: .875rem 1.5rem; background: var(--tb-bg); color: var(--tb-ink); border-radius: 1.125rem; }
.tb-left, .tb-center, .tb-right { display: flex; align-items: center; gap: .5rem; min-width: 0; }
.tb-right { justify-content: flex-end; }
.tb-center { justify-content: center; }
.tb-label { font-weight: 600; font-size: .9375rem; padding-inline: .5rem; }

.tb-circle { display: inline-grid; place-items: center; width: 1.875rem; height: 1.875rem; flex: none; border-radius: 50%; background: var(--tb-btn); color: var(--tb-ink); text-decoration: none; transition: background .15s var(--ease), transform .15s var(--ease); }
.tb-circle .ico { width: .95rem; height: .95rem; stroke-width: 2; }
[dir="rtl"] .tb-circle .ico { transform: scaleX(-1); }
a.tb-circle:hover, .tb-btn:hover, .tb-pill:hover { background: var(--tb-hover); }
a.tb-circle:active, .tb-btn:active { transform: scale(.95); }
.tb-circle.is-disabled { opacity: .4; cursor: not-allowed; }

.tb-pill { position: relative; display: inline-flex; align-items: center; height: 2.25rem; padding: 0 .35rem 0 1rem; background: var(--tb-btn); color: var(--tb-ink); border-radius: 99px; font-weight: 600; font-size: .9375rem; text-decoration: none; transition: background .15s var(--ease); }
a.tb-pill { padding-inline: 1rem; }
.tb-pill summary { display: inline-flex; align-items: center; gap: .6rem; height: 100%; cursor: pointer; list-style: none; border-radius: 99px; }
.tb-pill summary::-webkit-details-marker { display: none; }
.tb-pill summary::after { content: ""; border: .28rem solid transparent; border-top-color: currentColor; margin-top: .28rem; margin-inline-end: .65rem; transition: rotate .2s var(--ease); }
.tb-pill[open] summary::after { rotate: 180deg; margin-top: -.28rem; }
.tb-pill b { display: inline-grid; place-items: center; min-width: 1.5rem; height: 1.5rem; padding: 0 .4rem; border-radius: 99px; background: var(--tb-bg); font-size: .8125rem; font-weight: 700; }
.tb-sections ul { position: absolute; inset-inline-start: 0; top: calc(100% + .5rem); z-index: 20; margin: 0; padding: .4rem; list-style: none; min-width: 16rem; max-width: min(24rem, calc(100vw - 2rem)); background: var(--tb-btn); border-radius: .875rem; filter: drop-shadow(0 0 .5px var(--tb-edge)) drop-shadow(0 14px 24px rgba(0, 0, 0, .18)); }
.tb-sections li a { display: block; padding: .6rem .8rem; border-radius: .5rem; color: var(--tb-ink); font-weight: 500; text-decoration: none; }
.tb-sections li a:hover { background: var(--tb-hover); }

.tb-group { display: inline-flex; }
.tb-group[hidden] { display: none; }
.tb-btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; height: 2.25rem; padding: 0 1rem; border: 1px solid var(--tb-edge); background: var(--tb-btn); color: var(--tb-ink); font: inherit; font-size: .9375rem; font-weight: 600; text-decoration: none; cursor: pointer; border-radius: .625rem; transition: background .15s var(--ease), transform .15s var(--ease); }
.tb-btn .ico { width: 1rem; height: 1rem; }
.tb-group .tb-btn:first-child { border-start-end-radius: 0; border-end-end-radius: 0; }
.tb-group .tb-btn:last-child { border-start-start-radius: 0; border-end-start-radius: 0; margin-inline-start: -1px; }
.tb-primary { background: var(--tb-primary); border-color: var(--tb-primary); color: var(--tb-primary-ink); }
.tb-primary:hover { background: var(--tb-primary); filter: brightness(1.08); }
.gtoolbar :focus-visible { outline: 3px solid var(--accent-text); outline-offset: 2px; }
.prose h2, .gcol [id] { scroll-margin-top: calc(var(--tb-h, 5rem) + 1.5rem); }

@media (max-width: 64rem) {
  .gtoolbar { display: flex; flex-wrap: wrap; }
  .tb-left { flex: 1 1 auto; }
  .tb-right { flex: 0 1 auto; margin-inline-start: auto; }
  .tb-center { order: 3; flex-basis: 100%; justify-content: flex-start; flex-wrap: wrap; }
}
@media (max-width: 36rem) {
  /* Phone: navigation and the primary action share the first row, the jump pills the second,
     copy and print the third. */
  .gtoolbar { padding: .75rem 1rem; gap: .6rem; }
  .tb-right { display: contents; }
  .tb-primary { order: 2; margin-inline-start: auto; }
  .tb-label { display: none; }
  .tb-group { order: 4; }
  .tb-btn { padding: 0 .8rem; }
}

@media print {
  .bar, .notice, .gwrap, footer, .langnote, .meta a[href^="mailto"] { display: none !important; }
  body { background: #fff; color: #000; }
  .gcol { max-width: none; padding: 0; }
  .official .button { background: none; color: #000; padding: 0; }
  .prose a[href^="http"]::after, .official .button::after { content: " (" attr(href) ")"; font-size: .85em; }
  .official .button::after { content: " " attr(href); }
}

/* ---------- free tools directory: interactive layer ---------- */
.tcard { position: relative; display: flex; flex-direction: column; background: var(--paper); transition: transform .2s var(--ease), box-shadow .2s var(--ease), background .2s var(--ease); }
.tcard:hover, .tcard:focus-within { transform: translateY(-3px); background: var(--surface); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent), 0 10px 24px rgba(0, 0, 0, .12); }
.js .tcard:not([hidden]) { animation: dx-in .18s var(--ease) both; }
@keyframes dx-in { from { opacity: 0; transform: translateY(6px); } }
.tmain { flex: 1; display: grid; grid-template-columns: auto 1fr; grid-template-areas: "av text" "av badge"; gap: .2rem .9rem; align-items: start; padding: 1rem 3.25rem 0 1.1rem; padding-inline: 1.1rem 3.25rem; text-decoration: none; color: inherit; }
.tmain:focus-visible { outline-offset: -3px; }
.tsave { position: absolute; top: .75rem; inset-inline-end: .75rem; display: grid; place-items: center; width: 2.1rem; height: 2.1rem; border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; transition: background .15s var(--ease), color .15s var(--ease), transform .15s var(--ease); }
.tsave:hover { background: var(--bg); color: var(--ink); }
.tsave:active { transform: scale(.9); }
.tsave[aria-pressed="true"] { color: var(--accent-text); }
.tsave[aria-pressed="true"] .ico path, [data-act="save"][aria-pressed="true"] .ico path { fill: currentColor; }
.tsave .ico { width: 1.15rem; height: 1.15rem; }
.tactions { display: flex; flex-wrap: wrap; gap: .4rem; padding: .75rem 1.1rem 1rem; opacity: .0; transform: translateY(4px); transition: opacity .18s var(--ease), transform .18s var(--ease); }
.tcard:hover .tactions, .tcard:focus-within .tactions { opacity: 1; transform: none; }
@media (hover: none) { .tactions { opacity: 1; transform: none; } }
.tact { display: inline-flex; align-items: center; gap: .35rem; height: 2rem; padding: 0 .7rem; border: 0; border-radius: 99px; background: var(--bg); color: var(--ink); font: inherit; font-size: .8125rem; font-weight: 600; text-decoration: none; cursor: pointer; transition: background .15s var(--ease), color .15s var(--ease); }
.tact .ico { width: .95rem; height: .95rem; }
.tact:hover { background: var(--field); }
.tact[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.no-js .tactions, html:not(.js) .tactions { opacity: 1; transform: none; }

/* list view and compact density */
.lgroups.is-list .lcards { grid-template-columns: 1fr; gap: .5rem; }
.lgroups.is-list .tcard { flex-direction: row; align-items: center; }
.lgroups.is-list .tmain { grid-template-columns: auto 1fr auto; grid-template-areas: "av text badge"; align-items: center; padding-block: .8rem; }
.lgroups.is-list .tmeta { margin-top: 0; }
.lgroups.is-list .tactions { padding: 0 3.5rem 0 0; padding-inline: 0 3.5rem; flex-wrap: nowrap; }
.lgroups.is-list .tsave { top: 50%; translate: 0 -50%; }
.lgroups.is-compact .tmain { padding-top: .65rem; gap: .1rem .7rem; }
.lgroups.is-compact .av { width: 2.1rem; height: 2.1rem; font-size: .95rem; border-radius: .45rem; }
.lgroups.is-compact .cardtext span { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.lgroups.is-compact .tmeta { margin-top: .3rem; }
.lgroups.is-compact .tactions { padding: .45rem 1.1rem .65rem; }
.lgroups.is-compact .lcards { gap: .5rem; }
@media (max-width: 40rem) {
  .lgroups.is-list .tcard { flex-direction: column; align-items: stretch; }
  .lgroups.is-list .tmain { grid-template-columns: auto 1fr; grid-template-areas: "av text" "av badge"; }
  .lgroups.is-list .tactions { padding: .5rem 1.1rem .9rem; }
  .lgroups.is-list .tsave { top: .75rem; translate: none; }
}

/* search row, filter bar, active filters */
.dx-finder { display: flex; gap: .5rem; align-items: stretch; }
.dx-finder .field { flex: 1; }
.dx-palette-btn { display: inline-flex; align-items: center; gap: .5rem; padding: 0 .9rem; border: 0; background: var(--paper); color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; transition: background .15s var(--ease); }
.dx-palette-btn:hover { background: var(--surface); }
.dx-palette-btn kbd { font: inherit; font-size: .8125rem; color: var(--muted); background: var(--surface); padding: .1rem .45rem; border-radius: .3rem; }
@media (hover: none) { .dx-palette-btn kbd { display: none; } }
.dx-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .75rem 1rem; margin-top: 1rem; max-width: 72rem; }
.dx-filters, .dx-controls { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.dx-chip { display: inline-flex; align-items: center; gap: .4rem; height: 2.25rem; padding: 0 .95rem; border: 0; border-radius: 99px; background: var(--paper); color: var(--ink); font: inherit; font-size: .9375rem; font-weight: 600; cursor: pointer; transition: background .15s var(--ease), color .15s var(--ease), transform .15s var(--ease); }
.dx-chip .ico { width: 1rem; height: 1rem; }
.dx-chip b { font-size: .8125rem; color: var(--muted); }
.dx-chip:hover { background: var(--surface); }
.dx-chip:active { transform: scale(.96); }
.dx-chip[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.dx-chip[aria-pressed="true"] b { color: inherit; opacity: .8; }
.dx-sort { display: inline-flex; align-items: center; gap: .5rem; font-weight: 600; font-size: .9375rem; }
.dx-sort select { height: 2.25rem; padding: 0 .75rem; border: 0; border-radius: .6rem; background: var(--paper); color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; }
.dx-seg { display: inline-flex; padding: .2rem; border-radius: .7rem; background: var(--paper); }
.dx-seg button { display: inline-flex; align-items: center; gap: .35rem; height: 1.85rem; padding: 0 .7rem; border: 0; border-radius: .5rem; background: transparent; color: var(--muted); font: inherit; font-size: .875rem; font-weight: 600; cursor: pointer; transition: background .15s var(--ease), color .15s var(--ease); }
.dx-seg button .ico { width: 1rem; height: 1rem; }
.dx-seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); }
.dx-active { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .5rem; margin-top: .5rem; }
.dx-active-label { font-weight: 600; font-size: .9375rem; }
.dx-active-list { display: contents; }
.dx-tag { display: inline-flex; align-items: center; height: 1.9rem; padding: 0 .75rem; border: 0; border-radius: 99px; background: var(--paper); color: var(--ink); font: inherit; font-size: .875rem; font-weight: 600; cursor: pointer; transition: background .15s var(--ease); }
.dx-tag:hover { background: var(--surface); }
.dx-clear { border: 0; background: none; color: var(--ink); font: inherit; font-size: .875rem; font-weight: 700; text-decoration: underline; text-underline-offset: .2em; cursor: pointer; padding: .25rem .4rem; }
.lempty { text-align: center; padding: 2rem 1rem; }
.lempty .tb-btn { margin-top: .5rem; }
.dx-try { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: .4rem; color: var(--muted); }
.dx-try-list { display: contents; }

/* category bar overflow buttons */
.rail-btn { position: absolute; top: 50%; translate: 0 -50%; z-index: 2; display: grid; place-items: center; width: 2.25rem; height: 2.25rem; border: 0; border-radius: 50%; background: var(--paper); color: var(--ink); cursor: pointer; box-shadow: 0 2px 10px rgba(0, 0, 0, .15); transition: background .15s var(--ease); }
.rail-btn:hover { background: var(--surface); }
.rail-btn.prev { inset-inline-start: .35rem; }
.rail-btn.next { inset-inline-end: .35rem; }
[dir="rtl"] .rail-btn .ico { transform: scaleX(-1); }

/* comparison tray */
.dx-tray { position: fixed; z-index: 30; bottom: 1rem; left: 50%; translate: -50% 0; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; width: max-content; max-width: calc(100vw - 2rem); padding: .6rem .7rem .6rem 1.1rem; padding-inline: 1.1rem .7rem; border-radius: 1rem; background: var(--tb-bg); color: var(--tb-ink); box-shadow: 0 10px 30px rgba(0, 0, 0, .25), 0 0 0 1px var(--tb-edge); animation: dx-in .2s var(--ease) both; }
.dx-tray-count { font-weight: 700; font-size: .9375rem; }
.dx-tray-list { display: flex; flex-wrap: wrap; gap: .35rem; margin: 0; padding: 0; list-style: none; }
.dx-tray-list li { display: inline-flex; align-items: center; gap: .2rem; padding: .2rem .25rem .2rem .7rem; padding-inline: .7rem .25rem; border-radius: 99px; background: var(--tb-btn); font-size: .875rem; font-weight: 600; }
.dx-tag-x { display: grid; place-items: center; width: 1.5rem; height: 1.5rem; border: 0; border-radius: 50%; background: transparent; color: inherit; cursor: pointer; }
.dx-tag-x:hover { background: var(--tb-hover); }
.dx-tag-x .ico { width: .8rem; height: .8rem; }
body.has-tray { padding-bottom: 5.5rem; }
@media (max-width: 36rem) {
  /* On phones the tray is a single row: the count and the two actions. Names are in the comparison itself. */
  .dx-tray { flex-wrap: nowrap; width: calc(100vw - 1.5rem); bottom: .75rem; padding: .5rem .5rem .5rem .9rem; padding-inline: .9rem .5rem; }
  .dx-tray-list { display: none; }
  .dx-tray-count { flex: 1; font-size: .875rem; }
}

/* dialogs */
.dx-dialog { width: min(32rem, calc(100vw - 2rem)); max-height: calc(100vh - 3rem); padding: 0; border: 0; border-radius: 1.1rem; background: var(--paper); color: var(--ink); box-shadow: 0 24px 60px rgba(0, 0, 0, .35); }
.dx-dialog[open] { animation: dx-pop .18s var(--ease) both; }
@keyframes dx-pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.dx-dialog::backdrop { background: rgba(5, 10, 20, .55); }
.dx-wide { width: min(60rem, calc(100vw - 2rem)); }
.dx-dhead { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.1rem 1.25rem .5rem; }
.dx-dhead h2 { font-size: 1.4rem; }
.dx-x { display: grid; place-items: center; width: 2.2rem; height: 2.2rem; flex: none; border: 0; border-radius: 50%; background: var(--surface); color: var(--ink); cursor: pointer; }
.dx-x:hover { background: var(--field); }
.dx-x .ico { width: 1rem; height: 1rem; }
.dx-dbody { padding: .25rem 1.25rem 1.25rem; }
.dx-dmeta { display: flex; align-items: center; gap: .75rem; }
.dx-dmeta .meta { margin: 0; }
.dx-ddesc { margin: .9rem 0; }
.dx-facts { display: grid; grid-template-columns: auto 1fr; gap: .5rem 1rem; margin: 0 0 1.25rem; }
.dx-facts dt { color: var(--muted); font-size: .9375rem; }
.dx-facts dd { margin: 0; font-weight: 600; }
.dx-facts .badge { margin: 0; }
.dx-dactions { display: flex; flex-wrap: wrap; gap: .5rem; }
.dx-dialog .tb-btn { --tb-btn: var(--surface); }
.dx-dialog .tb-btn[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.dx-table-wrap { overflow-x: auto; padding: 0 1.25rem 1.25rem; }
.dx-table { width: 100%; border-collapse: collapse; min-width: 32rem; }
.dx-table th, .dx-table td { padding: .75rem; text-align: start; vertical-align: top; }
.dx-table tbody tr:nth-child(odd) { background: var(--surface); }
.dx-table tbody th { color: var(--muted); font-weight: 600; font-size: .9375rem; white-space: nowrap; }
.dx-table td { font-size: .9375rem; }
.dx-table td .badge { margin: 0; }
.dx-table td a { font-weight: 600; }
.dx-table td a .ico { width: .85rem; height: .85rem; vertical-align: -.1em; }
.dx-th { display: flex; flex-direction: column; align-items: flex-start; gap: .4rem; }
.dx-small { height: 1.8rem; padding: 0 .65rem; font-size: .8125rem; }

/* command palette */
.dx-palette { width: min(36rem, calc(100vw - 2rem)); margin-top: 12vh; }
.dx-palette .field { display: flex; align-items: center; gap: .6rem; padding: .75rem 1rem; background: var(--surface); }
.dx-palette .field .ico { width: 1.2rem; height: 1.2rem; color: var(--muted); }
.dx-palette .field input { flex: 1; padding: .4rem 0; background: transparent; font-size: 1.1rem; }
.dx-palette .field input:focus-visible { outline: none; }
#dx-plist { list-style: none; margin: 0; padding: .4rem; max-height: min(26rem, 55vh); overflow-y: auto; }
.dx-opt { display: flex; align-items: center; gap: .75rem; padding: .55rem .7rem; border-radius: .6rem; cursor: pointer; }
.dx-opt[aria-selected="true"] { background: var(--surface); box-shadow: inset 3px 0 0 var(--accent); }
[dir="rtl"] .dx-opt[aria-selected="true"] { box-shadow: inset -3px 0 0 var(--accent); }
.dx-opt .av { width: 2rem; height: 2rem; font-size: .9rem; border-radius: .45rem; }
.dx-opt-ico { display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: .45rem; background: var(--accent); color: var(--accent-ink); }
.dx-opt-ico .ico { width: 1.05rem; height: 1.05rem; }
.dx-opt-text { display: grid; }
.dx-opt-text small { color: var(--muted); font-size: .8125rem; }
.dx-hint { padding: .5rem 1.1rem .8rem; margin: 0; }

/* toast */
.dx-toast { position: fixed; z-index: 40; left: 50%; bottom: 1.25rem; translate: -50% 1rem; padding: .65rem 1.1rem; border-radius: .8rem; background: var(--ink); color: var(--bg); font-weight: 600; font-size: .9375rem; opacity: 0; pointer-events: none; transition: opacity .2s var(--ease), translate .2s var(--ease); }
.dx-toast.show { opacity: 1; translate: -50% 0; }
body.has-tray .dx-toast { bottom: 6rem; }
.dx-toast:empty { display: none; }

@media (prefers-reduced-motion: reduce) {
  .js .tcard:not([hidden]), .dx-dialog[open], .dx-tray { animation: none; }
  .tcard:hover, .tcard:focus-within { transform: none; }
}

/* real tool icons: a light tile so dark logos stay visible on navy, plus a small lift on hover */
.av { transition: transform .25s var(--ease); }
.av-img { background: #ffffff; padding: .4rem; }
@media (prefers-color-scheme: dark) { .av-img { background: #f2f2f0; } }
.av-img img { display: block; width: 100%; height: 100%; object-fit: contain; border-radius: .3rem; }
.tcard:hover .av, .tcard:focus-within .av { transform: translateY(-2px) scale(1.08) rotate(-4deg); }
[dir="rtl"] .tcard:hover .av, [dir="rtl"] .tcard:focus-within .av { transform: translateY(-2px) scale(1.08) rotate(4deg); }
.lgroups.is-compact .av-img, .dx-opt .av-img { padding: .25rem; }
.dx-dmeta .av-img { width: 3.25rem; height: 3.25rem; }
@media (prefers-reduced-motion: reduce) { .tcard:hover .av, .tcard:focus-within .av { transform: none; } }

/* category pictures: overlapping real logos from the category, fanning out on hover */
.stack { display: inline-flex; align-items: center; flex: none; }
.slogo { display: grid; place-items: center; flex: none; background: #ffffff; border-radius: 28%; box-shadow: 0 0 0 2px var(--bg); transition: transform .25s var(--ease), margin .25s var(--ease); }
@media (prefers-color-scheme: dark) { .slogo { background: #f2f2f0; } }
.slogo img { display: block; width: 72%; height: 72%; object-fit: contain; }
.slogo + .slogo { margin-inline-start: var(--overlap); }
.stack-lg { --overlap: -.95rem; }
.stack-lg .slogo { width: 3rem; height: 3rem; }
.stack-lg .s0 { transform: rotate(-6deg); z-index: 3; }
.stack-lg .s1 { transform: translateY(2px); z-index: 2; }
.stack-lg .s2 { transform: rotate(6deg); z-index: 1; }
.lgroup header:hover .stack-lg { --overlap: -.35rem; }
.lgroup header:hover .stack-lg .slogo { transform: none; }
.stack-sm { --overlap: -.45rem; }
.stack-sm .slogo { width: 1.35rem; height: 1.35rem; border-radius: 30%; box-shadow: 0 0 0 1.5px var(--surface); }
.railchip:hover .stack-sm { --overlap: -.15rem; }
.railchip[aria-current="true"] .stack-sm .slogo { box-shadow: 0 0 0 1.5px var(--accent); }
.stack-fallback .ico { width: 1.25rem; height: 1.25rem; }
.dx-opt .stack-sm .slogo { width: 1.4rem; height: 1.4rem; }
@media (prefers-reduced-motion: reduce) { .stack-lg .slogo, .lgroup header:hover .stack-lg .slogo { transform: none; } }

/* GitHub stars, category previews and category pages */
.stars { font-size: .8125rem; font-weight: 700; color: var(--muted); white-space: nowrap; }
.lgroups[data-page="index"] .tcard.extra { display: none; }
.lgroup h2 a { color: inherit; text-decoration: none; background-image: linear-gradient(currentColor, currentColor); background-size: 0 2px; background-position: 0 100%; background-repeat: no-repeat; transition: background-size .25s var(--ease); }
.lgroup h2 a:hover, .lgroup h2 a:focus-visible { background-size: 100% 2px; }
.seeall { display: inline-flex; align-items: center; gap: .35rem; margin-top: 1rem; padding: .55rem 1rem; border-radius: 99px; background: var(--surface); color: var(--ink); font-weight: 700; font-size: .9375rem; text-decoration: none; transition: background .15s var(--ease), transform .15s var(--ease); }
.seeall:hover { background: var(--field); transform: translateX(3px); }
[dir="rtl"] .seeall:hover { transform: translateX(-3px); }
.lcrumbs { margin: 0 0 .5rem; }
.lcrumbs a { color: var(--ink); font-weight: 600; text-decoration: none; opacity: .85; }
.lcrumbs a:hover { opacity: 1; text-decoration: underline; }

/* directory hero: a full-bleed background photo under a dark shade, so the heading stays readable */
.lhero { position: relative; overflow: hidden; isolation: isolate; }
.lhero-in { position: relative; z-index: 2; }
.lhero.has-photo {
  /* The hero is always dark over its photo, in light and dark mode alike. */
  --bg: #000000; --surface: #161616; --paper: #1c1c1c; --ink: #f2f2f0; --muted: #c4c4c4;
  --field: #2a2a2a; --accent: #c5f82a; --accent-ink: #0a0a0a; --accent-text: #c5f82a;
  background: #000000; color: var(--ink); padding-bottom: clamp(2.5rem, 5vw, 4rem);
}
.lhero-photo { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; object-fit: cover; }
.lhero.has-photo::after { content: ""; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(90deg, rgba(0, 0, 0, .94) 0%, rgba(0, 0, 0, .8) 42%, rgba(0, 0, 0, .45) 100%),
              linear-gradient(0deg, rgba(0, 0, 0, .75) 0%, rgba(0, 0, 0, 0) 40%); }
[dir="rtl"] .lhero.has-photo::after { background: linear-gradient(270deg, rgba(0, 0, 0, .94) 0%, rgba(0, 0, 0, .8) 42%, rgba(0, 0, 0, .45) 100%), linear-gradient(0deg, rgba(0, 0, 0, .75) 0%, rgba(0, 0, 0, 0) 40%); }
.lhero.has-photo .lede, .lhero.has-photo .meta, .lhero.has-photo .lcrumbs a { color: var(--ink); opacity: .88; }
.lhero.has-photo .field input { background: rgba(0, 0, 0, .72); }
.photo-credit { position: absolute; z-index: 2; bottom: .6rem; inset-inline-end: 1rem; max-width: min(36rem, 90%); margin: 0; font-size: .75rem; color: rgba(242, 242, 240, .72); text-align: end; }
.photo-credit a { color: inherit; }
@media (prefers-reduced-motion: no-preference) { .lhero-photo { animation: hero-zoom 40s ease-in-out infinite alternate; } }
@keyframes hero-zoom { from { transform: scale(1); } to { transform: scale(1.08); } }
@media (max-width: 48rem) {
  .lhero.has-photo::after { background: rgba(0, 0, 0, .82); }
  .photo-credit { position: static; padding: 1rem 0 0; text-align: start; max-width: none; }
  .lhero.has-photo { padding-bottom: 1.25rem; }
}

/* front page: headline, two choices, popular tools and categories */
.front { background: var(--hero-bg); padding: clamp(2.5rem, 7vw, 5.5rem) clamp(1rem, 4vw, 2rem) clamp(3rem, 8vw, 6rem); }
.front-in { max-width: 72rem; margin-inline: auto; text-align: center; }
.front h1 { font-size: clamp(2.5rem, 1rem + 5.5vw, 5rem); max-width: 18ch; margin-inline: auto; }
.front .lede { margin: 1rem auto 0; max-width: 44rem; font-size: clamp(1.05rem, 1rem + .4vw, 1.3rem); }
.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); gap: clamp(1rem, 2.5vw, 2rem); margin-top: clamp(2rem, 5vw, 3.5rem); text-align: start; }
.choice { display: flex; flex-direction: column; overflow: hidden; border-radius: 1.25rem; background: var(--paper); color: var(--ink); text-decoration: none; box-shadow: 0 1px 0 var(--card-edge), 0 18px 40px var(--card-shadow); transition: transform .25s var(--ease), box-shadow .25s var(--ease); }
.choice:hover, .choice:focus-visible { transform: translateY(-6px); box-shadow: 0 0 0 2px var(--accent), 0 26px 50px var(--card-shadow); }
.choice-img { display: block; aspect-ratio: 16 / 7; overflow: hidden; }
.choice-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.choice:hover .choice-img img { transform: scale(1.06); }
.choice-body { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: .6rem; padding: 1.5rem clamp(1.25rem, 3vw, 2rem) 1.75rem; }
.choice-body .stack, .choice-count { margin-top: -3rem; }
.choice-count { display: inline-flex; align-items: center; height: 2.6rem; padding: 0 1rem; border-radius: 99px; background: var(--accent); color: var(--accent-ink); font-weight: 800; box-shadow: 0 0 0 3px var(--paper); }
.choice-body strong { font-size: clamp(1.5rem, 1rem + 1.5vw, 2.1rem); font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }
.choice-body > span:not(.button):not(.stack):not(.choice-count) { color: var(--muted); font-size: 1.05rem; }
.choice-body .button { margin-top: .5rem; }
.front-credit { margin: 1.25rem 0 0; font-size: .75rem; color: var(--muted); text-align: center; }
.front-credit a { color: inherit; }

.popular { position: relative; background: var(--surface); padding: clamp(2rem, 5vw, 3.5rem) clamp(1rem, 4vw, 2rem) clamp(3rem, 7vw, 5rem); margin-top: 3rem; }
.popular .wave { position: absolute; left: 0; right: 0; bottom: 100%; width: 100%; height: clamp(2.5rem, 6vw, 5rem); fill: var(--surface); }
.popular-in { max-width: 72rem; margin-inline: auto; }
.popular h2 { font-size: clamp(1.5rem, 1rem + 1.6vw, 2.2rem); margin: 0 0 1.25rem; }
.popular h2 + ul { margin-bottom: clamp(2.5rem, 5vw, 3.5rem); }
.ptiles, .ctiles { list-style: none; margin: 0; padding: 0; display: grid; gap: .9rem; }
.ptiles { grid-template-columns: repeat(auto-fill, minmax(min(100%, 15.5rem), 1fr)); }
.ctiles { grid-template-columns: repeat(auto-fill, minmax(min(100%, 13rem), 1fr)); }
.ptiles a, .ctiles a { height: 100%; display: flex; gap: .85rem; padding: 1rem 1.1rem; border-radius: .9rem; background: var(--paper); color: var(--ink); text-decoration: none; transition: transform .2s var(--ease), box-shadow .2s var(--ease); }
.ptiles a:hover, .ctiles a:hover, .ptiles a:focus-visible, .ctiles a:focus-visible { transform: translateY(-3px); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 50%, transparent), 0 10px 24px var(--card-shadow); }
.ptiles a:hover .av { transform: scale(1.08) rotate(-4deg); }
.ptext { display: grid; gap: .2rem; }
.ptext strong { font-size: 1.05rem; }
.ptext span { color: var(--muted); font-size: .9rem; line-height: 1.45; }
.ctiles a { flex-direction: column; gap: .4rem; }
.ctiles strong { font-size: 1.05rem; line-height: 1.25; }
.ctiles a > span:last-child { color: var(--muted); font-size: .875rem; }
.ctiles .stack-sm .slogo { width: 1.9rem; height: 1.9rem; }
.ctiles a:hover .stack-sm { --overlap: -.15rem; }
.card-title { font-size: clamp(2rem, 1rem + 4vw, 3.5rem); }
#guides { scroll-margin-top: 1rem; }
@media (prefers-reduced-motion: reduce) { .choice:hover, .choice:hover .choice-img img, .ptiles a:hover .av { transform: none; } }
.ptiles .av { flex: none; width: 2.75rem; height: 2.75rem; }

/* Always-dark bands: the front page top and the footer stay black in light and dark mode. */
.front, footer {
  --bg: #000000; --surface: #161616; --paper: #161616; --ink: #f2f2f0; --muted: #a6a6a6;
  --field: #2a2a2a; --accent-text: #c5f82a; --card-edge: rgba(255, 255, 255, .08); --card-shadow: rgba(0, 0, 0, .6);
  color: var(--ink);
}

/* Front page: a dot-matrix wordmark over a faint dot grid. */
.front {
  background-color: #000;
  background-image: radial-gradient(rgba(255, 255, 255, .16) 1px, transparent 1.6px);
  background-size: 26px 26px;
  background-position: center top;
}
.dotmark {
  margin: 0 0 clamp(1.25rem, 4vw, 2.75rem);
  font-family: var(--dots); font-weight: 900; font-variation-settings: "ROND" 100; text-transform: uppercase;
  font-size: clamp(3.25rem, 1rem + 11vw, 11rem); line-height: .85; letter-spacing: .02em;
  color: var(--ink); white-space: nowrap;
}

/* Serif headlines on Latin-script pages. The serif has no Indian-script letters, so other languages
   keep the bold sans headings. */
:root:lang(en) h1, :root:lang(en) h2, :root:lang(en) .choice-body strong, :root:lang(en) .foot-title {
  font-family: var(--serif); font-weight: 500; font-optical-sizing: auto; letter-spacing: -.025em; line-height: 1.04;
}
:root:lang(en) .front h1 { font-size: clamp(2.6rem, 1rem + 5.5vw, 5.25rem); }

/* Monospace capital labels for buttons, chips and small tags. */
.button, .chip, .seeall, .choice-count, .mainnav a, .results em, .copy-btn {
  font-family: var(--mono); text-transform: uppercase; letter-spacing: .04em;
}
.button { border-radius: .55rem; font-size: .9rem; font-weight: 600; }
.mainnav a, .results em { font-size: .8125rem; }

/* Footer: say hello, copy the email, big dot-matrix links, then the legal links. */
footer { background: #000; padding: clamp(3rem, 8vw, 6rem) clamp(1rem, 4vw, 2rem) clamp(1.25rem, 3vw, 2.25rem); color: var(--muted); font-size: .9375rem; text-align: center; overflow: hidden; }
.foot-title { margin: 0; color: var(--ink); font-size: clamp(2.75rem, 1rem + 6vw, 5.5rem); font-weight: 800; }
.copybox { display: flex; align-items: center; justify-content: space-between; gap: .75rem; max-width: 34rem; margin: 1.75rem auto 0; padding: .45rem .45rem .45rem 1.1rem; padding-inline: 1.1rem .45rem; border-radius: .8rem; background: #1c1c1c; }
.copybox a { color: var(--ink); font-family: var(--mono); font-size: clamp(.875rem, .8rem + .4vw, 1.05rem); text-decoration: none; overflow-wrap: anywhere; text-align: start; }
.copybox a:hover { text-decoration: underline; }
.copy-btn { border: 0; cursor: pointer; padding: .6rem 1rem; flex: none; }
.dotnav { display: flex; flex-direction: column; align-items: center; gap: .1em; margin: clamp(3rem, 7vw, 5rem) auto 0; padding-top: clamp(2rem, 5vw, 3rem); border-top: 1px solid rgba(255, 255, 255, .12); max-width: 76rem; font-size: clamp(2.1rem, 1rem + 4.5vw, 4.25rem); }
.dotnav a { font-family: var(--dots); font-weight: 900; font-variation-settings: "ROND" 100; text-transform: uppercase; line-height: 1.05; color: var(--ink); text-decoration: none; transition: color .2s var(--ease); }
.dotnav a:hover, .dotnav a:focus-visible { color: var(--accent); }
.legal { margin-top: clamp(2.5rem, 6vw, 4rem); }
.legal a { margin: 0 .6rem; color: var(--ink); font-weight: 600; }
footer > p { margin: 1rem 0 0; }
