/* Clean white pages, near-black ink, dark pill buttons and a lime accent used sparingly. */
@font-face { font-family: "Albert Sans"; font-style: normal; font-display: swap; font-weight: 100 900; src: url(/fonts/albert-sans.woff2) format("woff2"); }
:root {
  color-scheme: light;
  --ink: #262626; --ink-soft: #434343; --ink-mute: #595959; --ink-faint: #8c8c8c;
  --line: #e6e6e6; --line-soft: #ededed; --mist: #f6f6f4;
  --lime: #63fe13; --olive: #218c00;
  --shadow: 0 30px 60px -30px rgba(38, 38, 38, .22);
  --font: "Albert Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, "PingFang SC", "Microsoft YaHei", sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: #fff; color: var(--ink); font: 16px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--olive); text-underline-offset: 3px; }
a:focus-visible, .button:focus-visible { outline: 2px solid var(--olive); outline-offset: 3px; border-radius: 999px; }
h1, h2, h3, p { margin: 0; }
img[src*='/characters/'], .brand img, .button .badge img { image-rendering: pixelated; }

.site-header, main, .site-footer { width: min(1080px, 100% - 32px); margin: 0 auto; }

/* Header: brand, quiet links, and the dark pill on the right. */
/* Above the cats, which the extension's renderer layers at z-index 58. */
.site-header { position: sticky; top: 0; z-index: 100; display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 64px; background: color-mix(in srgb, #fff 82%, transparent); backdrop-filter: saturate(1.4) blur(12px); }
.brand { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; }
.wordmark { font-size: 18px; font-weight: 800; letter-spacing: -.02em; }
.wordmark-cat { padding: 0 .06em; background: linear-gradient(transparent 64%, var(--lime) 64%, var(--lime) 92%, transparent 92%); }
.site-header nav { display: flex; align-items: center; gap: 4px; font-size: 14px; font-weight: 500; }
.site-header nav a { padding: 6px 12px; border-radius: 999px; color: var(--ink-soft); text-decoration: none; }
.site-header nav a:hover { background: var(--line-soft); color: var(--ink); }
.site-header nav a.nav-cta { margin-left: 8px; background: var(--ink); color: #fafafa; }
/* GitHub: a plain icon link in the header and at the end of the footer. */
.github-link { display: inline-flex; align-items: center; justify-content: center; color: var(--ink-soft); }
.github-link svg { width: 20px; height: 20px; fill: currentColor; }
.site-header nav a.github-link { padding: 6px; }
.footer-links { display: flex; align-items: center; gap: 6px; }
.site-footer .github-link { margin-left: 4px; color: var(--ink-mute); }
.site-footer .github-link:hover, .site-header nav a.github-link:hover { color: var(--ink); }

/* Language menu: a globe that opens a small list; the current language is ticked. */
.lang-menu { position: relative; }
.lang-menu summary { display: flex; align-items: center; gap: 2px; padding: 6px 8px; border-radius: 999px; color: var(--ink-soft); cursor: pointer; list-style: none; }
.lang-menu summary::-webkit-details-marker { display: none; }
.lang-menu summary:hover, .lang-menu[open] summary { background: var(--line-soft); color: var(--ink); }
.lang-menu summary:focus-visible { outline: 2px solid var(--olive); outline-offset: 2px; }
.lang-menu svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.lang-menu .lang-caret { width: 14px; height: 14px; stroke-width: 2; transition: transform .15s; }
.lang-menu[open] .lang-caret { transform: rotate(180deg); }
.lang-menu ul { position: absolute; right: 0; top: calc(100% + 6px); min-width: 140px; margin: 0; padding: 6px; list-style: none; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: 0 12px 30px -12px rgba(38, 38, 38, .25); }
.site-header .lang-menu a { display: flex; justify-content: space-between; align-items: center; padding: 7px 10px; border-radius: 8px; color: var(--ink-soft); }
.site-header .lang-menu a[aria-current] { color: var(--ink); font-weight: 650; }
.site-header .lang-menu a[aria-current]::after { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--lime); }

/* The dark pill with a lime badge. */
.button { display: inline-flex; align-items: center; gap: 10px; padding: 8px 20px 8px 8px; border-radius: 999px; background: var(--ink); color: #fff; font-size: 15px; font-weight: 700; text-decoration: none; box-shadow: 0 16px 30px -16px rgba(38, 38, 38, .5); }
.button .badge { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--lime); }
.button .badge img { width: 20px; height: 20px; }
.button[aria-disabled='true'] { cursor: default; }

/* Hero: heavy tight headline. */
.hero { padding: 72px 0 0; text-align: center; }
.hero h1 { font-size: clamp(34px, 5.6vw, 56px); font-weight: 800; line-height: 1.02; letter-spacing: -.035em; text-wrap: balance; }
.lede { max-width: 560px; margin: 22px auto 0; color: var(--ink-mute); font-size: 18px; text-wrap: balance; }
.actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-top: 32px; }

/* A YouTube-style player: video, captions in YouTube's default look, and the control bar.
   The cat is positioned on the caption line by the extension's renderer. */
.player { margin: 56px auto 0; max-width: 920px; }
.yt { position: relative; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 16px; background: #000; box-shadow: var(--shadow), 0 0 0 1px rgba(38, 38, 38, .06); font-family: Roboto, Arial, sans-serif; }
.yt-scene { position: absolute; inset: 0; width: 100%; height: 100%; }
/* The host only moves while a line is being spoken. */
.yt-host { transform-box: view-box; transform-origin: 810px 900px; animation: talk 3.6s ease-in-out infinite paused; }
.yt.is-talking .yt-host { animation-play-state: running; }
@keyframes talk { 0%, 100% { transform: rotate(0); } 30% { transform: rotate(-.8deg) translateY(-3px); } 60% { transform: rotate(.6deg); } }
.yt::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 28%; background: linear-gradient(transparent, rgba(0, 0, 0, .55)); pointer-events: none; }
.yt-captions { position: absolute; z-index: 2; left: 0; right: 0; bottom: 17%; text-align: center; font-size: clamp(13px, 2.3vw, 22px); }
.yt-caption { display: block; line-height: 0; }
.yt-caption > span { display: inline-block; max-width: 86%; padding: .08em .3em; color: #fff; background: rgba(8, 8, 8, .75); line-height: 1.35; }
.yt-chrome { position: absolute; z-index: 3; left: 0; right: 0; bottom: 0; padding: 0 clamp(10px, 1.6vw, 14px); color: #fff; }
.yt-progress { position: relative; height: 3px; background: rgba(255, 255, 255, .2); }
.yt-buffered, .yt-played { position: absolute; left: 0; top: 0; bottom: 0; }
.yt-buffered { width: 41%; background: rgba(255, 255, 255, .4); }
.yt-played { width: 26%; background: #f00; }
.yt-scrubber { position: absolute; top: 50%; left: 26%; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: #f00; }
.yt-controls { display: flex; align-items: center; gap: clamp(8px, 1.8vw, 18px); height: clamp(34px, 5.4vw, 48px); }
.yt-controls svg { width: clamp(18px, 2.6vw, 24px); height: clamp(18px, 2.6vw, 24px); fill: currentColor; flex: none; }
.yt-time { font-size: clamp(11px, 1.5vw, 13px); white-space: nowrap; opacity: .92; }
.yt-spacer { flex: 1; }
.yt-cc { position: relative; display: inline-flex; }
.yt-scene { cursor: pointer; }
.yt-button { display: inline-flex; padding: 0; border: 0; background: none; color: inherit; }
.yt-play, .yt.is-paused .yt-pause, .yt-silent, .yt.is-muted .yt-sound { display: none; }
.yt.is-paused .yt-play, .yt.is-muted .yt-silent { display: block; }
/* Volume: the slider slides out next to the speaker on hover, as on YouTube. --level (0–1) is set by script. */
.yt-volume { display: flex; align-items: center; }
.yt-slider { width: 0; height: 3px; margin: 0; padding: 0; opacity: 0; appearance: none; border-radius: 2px; cursor: pointer; transition: width .2s, margin .2s, opacity .2s;
  background: linear-gradient(#fff, #fff) 0 0 / calc(var(--level, 1) * 100%) 100% no-repeat, rgba(255, 255, 255, .3); }
.yt-volume:hover .yt-slider, .yt-volume:focus-within .yt-slider { width: clamp(48px, 7vw, 64px); margin-left: 8px; opacity: 1; }
.yt-slider::-webkit-slider-thumb { appearance: none; width: 12px; height: 12px; border-radius: 50%; background: #fff; }
.yt-slider::-moz-range-thumb { width: 12px; height: 12px; border: 0; border-radius: 50%; background: #fff; }
/* After the clip, a replay button. */
.yt button { font: inherit; cursor: pointer; }
/* Below the player, under the play button: shown only while the clip is not playing. */
.yt-tip { display: none; align-items: flex-end; gap: 2px; margin: 8px 0 0; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
/* Based on whether the audio is really playing (the browser may hold it back), not on what was asked for. */
.yt.is-paused:not([data-state='idle']):not([data-state='held']):not([data-state='ended']) + .yt-tip { display: flex; }
/* The bubble starts under the play button, with the hand inside pointing up at it; the cat sits to its right, facing it. */
.yt-tip-bubble { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 10px; padding: 7px 14px 7px 6px; border-radius: 14px 14px 3px 14px; background: var(--mist); color: var(--ink); box-shadow: 0 1px 2px rgba(38, 38, 38, .06), 0 4px 14px -4px rgba(38, 38, 38, .18); font-size: 14px; font-weight: 600; white-space: nowrap; }
.yt-tip-hand { width: 20px; height: 20px; fill: var(--ink); stroke: none; animation: point 1.2s ease-in-out infinite; }
.yt-tip img { width: 48px; height: auto; transform: scaleX(-1); }
.yt-tip:hover .yt-tip-bubble { box-shadow: 0 1px 2px rgba(38, 38, 38, .08), 0 6px 18px -4px rgba(38, 38, 38, .24); }
.yt-tip:focus-visible { outline: 2px solid var(--olive); outline-offset: 3px; border-radius: 14px; }
@keyframes point { 0%, 100% { transform: translateY(2px); } 50% { transform: translateY(-3px); } }

/* Dead buttons: the cat pops up above the control bar to say so. */
.yt-hint { position: absolute; z-index: 5; bottom: clamp(44px, 7vw, 60px); left: 0; display: flex; align-items: flex-end; gap: 2px; opacity: 0; transform: translateY(8px); pointer-events: none; transition: opacity .2s, transform .2s; }
.yt-hint.is-shown { opacity: 1; transform: none; }
.yt-hint img { width: clamp(36px, 5vw, 48px); height: auto; }
.yt-hint span { margin-bottom: 18px; padding: 6px 10px; border-radius: 10px 10px 10px 2px; background: #fff; color: #1a1a1a; font: 600 13px/1.4 var(--font); white-space: nowrap; box-shadow: 0 6px 16px rgba(0, 0, 0, .3); }
.yt-replay { position: absolute; z-index: 4; left: 50%; top: 42%; display: none; place-items: center; width: clamp(48px, 8vw, 68px); height: clamp(48px, 8vw, 68px); margin: calc(clamp(48px, 8vw, 68px) / -2) 0 0 calc(clamp(48px, 8vw, 68px) / -2); border: 0; border-radius: 50%; background: rgba(0, 0, 0, .6); color: #fff; }
.yt-replay svg { width: 55%; height: 55%; fill: currentColor; }
.yt-replay:hover { background: rgba(0, 0, 0, .8); }
.yt[data-state='ended'] .yt-replay { display: grid; }
.yt button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.yt-cc::after { content: ''; position: absolute; left: 2px; right: 2px; bottom: -4px; height: 3px; border-radius: 2px; background: #f00; }

/* The story: a cat beside a few honest paragraphs. */
.story { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 48px; align-items: start; max-width: 860px; margin: 0 auto; padding: 128px 0 0; }
.story-cat { position: sticky; top: 120px; display: grid; place-items: center; aspect-ratio: 1; border-radius: 50%; background: var(--mist); }
.story-cat img { width: 80%; height: auto; }
.story h2 { font-size: clamp(30px, 4.4vw, 44px); font-weight: 800; line-height: 1.08; letter-spacing: -.03em; }
.story-text > p { margin-top: 18px; color: var(--ink-soft); font-size: 18px; line-height: 1.7; }

/* Extras: three small players, each acting out one feature on its own loop (and on hover or click). */
.extras { padding: 128px 0 0; }
.extras h2 { font-size: clamp(28px, 4vw, 40px); font-weight: 800; line-height: 1.1; letter-spacing: -.03em; }
.extras-lede { margin-top: 12px; max-width: 560px; color: var(--ink-mute); font-size: 17px; }
.extras-lede:empty { display: none; }
.extras-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin-top: 36px; }
.extra h3 { margin-top: 18px; font-size: 18px; font-weight: 750; letter-spacing: -.015em; }
.extra p { margin-top: 6px; color: var(--ink-mute); font-size: 15px; }
/* Each demo plays once when scrolled into view; the replay button appears after. */
.mini-frame { position: relative; }
.mini-replay { position: absolute; z-index: 3; right: 10px; bottom: 10px; display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px 4px 8px; border: 0; border-radius: 999px; background: rgba(255, 255, 255, .92); color: var(--ink); font: 600 12px/1.4 var(--font); cursor: pointer; opacity: 0; pointer-events: none; transition: opacity .2s; }
.mini-replay svg { width: 14px; height: 14px; fill: currentColor; }
.mini-frame.has-played:not(.is-playing) .mini-replay { opacity: 1; pointer-events: auto; }
.mini-replay:hover { background: #fff; }
.mini-replay:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; }
.mini { position: relative; aspect-ratio: 16 / 10; overflow: hidden; border-radius: 14px; background: radial-gradient(120% 90% at 30% 20%, #4a4038, #1d1a17 70%); font-family: Roboto, Arial, sans-serif; user-select: none; }
.mini-captions { position: absolute; left: 0; right: 0; bottom: 14%; margin: 0; text-align: center; font-size: 13px; line-height: 0; }
.mini-line { display: inline-block; max-width: 88%; padding: .1em .3em; color: #fff; background: rgba(8, 8, 8, .75); line-height: 1.4; transition: background .25s, color .25s, padding .25s; }
.mini[data-skin='paper'] .mini-line, .mini[data-demo='translate'] .mini-line, .mini[data-demo='words'] .mini-line { padding: .12em .75em; color: #2b2927; background: rgba(246, 244, 238, .97); border-radius: .08em; box-shadow: inset 0 0 0 1px rgba(43, 41, 39, .1); font-weight: 500; }
.mini-key { position: absolute; top: 10px; left: 10px; padding: 2px 8px; border-radius: 4px; background: rgba(255, 255, 255, .12); color: rgba(255, 255, 255, .7); font-size: 11px; transition: background .2s, color .2s; }
.mini-key.is-pressed { background: var(--lime); color: #10200a; }
/* The extension's own tooltip and word pill, at a smaller scale. */
.mini-tip { position: absolute; left: 50%; bottom: calc(14% + 34px); max-width: 86%; width: max-content; padding: 6px 10px; border: 1px solid #555; border-radius: 6px; background: #242424; color: #fff; font: 13px/1.45 -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', sans-serif; text-align: center; opacity: 0; transform: translate(-50%, 4px); transition: opacity .2s, transform .2s; pointer-events: none; }
.mini.is-hovering .mini-tip { opacity: 1; transform: translate(-50%, 0); }
.mini[data-demo='translate'] .mini-line, .mini[data-demo='words'] .mini-line span { cursor: pointer; }
.mini[data-demo='words'] .mini-line span { border-radius: 2px; transition: background .15s; }
.mini[data-demo='words'] .mini-line span.is-picked { background: var(--lime); }
.mini-pill { position: absolute; top: 10px; right: 10px; padding: 3px 9px; border-radius: 999px; background: rgba(25, 25, 25, .8); color: #fff; font: 12px/1.5 -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; opacity: .75; transition: background .2s, opacity .2s; }
.mini-pill.is-flash { background: #3a4b3e; opacity: 1; }
.mini-cursor { position: absolute; z-index: 2; width: 16px; height: 16px; fill: #fff; stroke: #111; stroke-width: 1; opacity: 0; transition: left .5s ease, top .5s ease, opacity .2s; pointer-events: none; }
.mini.is-pointing .mini-cursor { opacity: 1; }

/* Closing call to action, with a cat asleep on top of the card. */
.closing { position: relative; margin-top: 160px; padding: 72px 24px 64px; border-radius: 32px; background: var(--mist); text-align: center; }
.closing-cat { position: absolute; left: 50%; top: 0; width: 144px; margin: -139px 0 0 -72px; } /* the art sits at the bottom of its canvas, so this rests it on the edge */
.closing-cat img { display: block; width: 100%; height: auto; }
.closing h2 { max-width: 640px; margin: 0 auto; font-size: clamp(28px, 4.4vw, 44px); font-weight: 800; letter-spacing: -.03em; line-height: 1.08; }
.closing p { margin-top: 14px; color: var(--ink-mute); }
.closing .actions { margin-top: 28px; }

/* Chinese reads better without the tight Latin tracking, and a touch more line height. */
:lang(zh) h1, :lang(zh) h2, :lang(zh) h3, :lang(zh) .wordmark { letter-spacing: 0; }
:lang(zh) .story-text > p, :lang(zh) .lede { line-height: 1.85; }
:lang(zh) .hero h1 { font-size: clamp(30px, 4.6vw, 48px); line-height: 1.2; word-break: keep-all; }

/* Text pages such as the privacy policy. */
.prose { max-width: 700px; padding: 56px 0 0; }
.prose h1 { font-size: clamp(34px, 5vw, 48px); font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.prose .updated { margin-top: 10px; color: var(--ink-faint); font-size: 14px; }
.prose h2 { margin-top: 40px; font-size: 22px; font-weight: 750; letter-spacing: -.02em; }
.prose p, .prose ul { margin-top: 12px; color: var(--ink-soft); }
.prose ul { padding-left: 20px; }
.prose li + li { margin-top: 6px; }

/* Footer: a cat strolls along the footer rule on the home page. */
.site-footer { margin-top: 96px; padding-bottom: 40px; color: var(--ink-faint); font-size: 14px; }
.stroll { position: relative; height: 64px; overflow: hidden; }
.stroll-line { position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--line); font-size: 12px; }
.footer-row { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-top: 24px; }
.site-footer a { color: var(--ink-mute); }
/* Text pages have no strolling cat, so the footer row draws its own rule. */
.prose ~ .site-footer .footer-row { border-top: 1px solid var(--line); }

@media (max-width: 760px) {
  .hero { padding-top: 40px; }
  .lede { font-size: 16px; }
  .player { margin-top: 36px; }
  .yt { border-radius: 10px; }
  .yt-time { display: none; }
  .yt-slider { display: none; }
  .yt-captions { bottom: 28%; font-size: 12px; }
  .yt-caption > span { max-width: 92%; }
  .story { grid-template-columns: 1fr; gap: 24px; padding-top: 88px; }
  .story-cat { position: static; width: 160px; }
  .story-text > p { font-size: 16px; }
  .extras { padding-top: 88px; }
  .extras-grid { grid-template-columns: 1fr; }
  .closing { margin-top: 128px; padding: 64px 20px 48px; border-radius: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .yt-host, .yt-tip-hand { animation: none; }
  .yt-hint { transition: none; }
  .yt-slider { transition: none; }
  .mini-line, .mini-tip, .mini-cursor, .mini-pill, .mini-key, .mini-replay { transition: none; }
}
