:root {
  --light: #fff;
  --dark: #333;
  --grey: #808080;
  --pink: #ff55a3;
  --surface: #fff;
  --foreground: #333;
  --particle-distant: #e6e6e6;
  --particle-far: #d9d9d9;
  --particle-middle: #ccc;
  --particle-near: #b3b3b3;
  color-scheme: light;
  --body-size: clamp(18px, 1.65vw, 24px);
  --body-font: 'QWQ Sans', sans-serif;
  --heading-font: 'Syncopate', sans-serif;
  --heading-weight: 700;
  --gutter: clamp(20px, 3vw, 64px);
}
:root[data-theme="dark"] { --surface: #333; --foreground: #fff; --particle-distant: #4d4d4d; --particle-far: #595959; --particle-middle: #666; --particle-near: #808080; color-scheme: dark; }
:root:lang(zh-Hans) { --body-font: 'QWQ Han CN', sans-serif; --heading-font: var(--body-font); --heading-weight: 900; }
:root:lang(zh-Hant) { --body-font: 'QWQ Han TW', sans-serif; --heading-font: var(--body-font); --heading-weight: 900; }
:root:lang(ja) { --body-font: 'QWQ Han JP', sans-serif; --heading-font: var(--body-font); --heading-weight: 900; }
:root:lang(ko) { --body-font: 'QWQ Han KR', sans-serif; --heading-font: var(--body-font); --heading-weight: 900; word-break: keep-all; }
* { box-sizing: border-box; }
body { position: relative; isolation: isolate; margin: 0; min-height: 100vh; min-height: 100svh; display: grid; grid-template-rows: auto 1fr auto; background: var(--surface); color: var(--foreground); font: 400 var(--body-size)/1.75 var(--body-font); font-synthesis: none; }
.particle-field { position: absolute; inset: 0; z-index: -1; overflow: hidden; contain: paint; pointer-events: none; }
.particle-definitions { position: absolute; width: 0; height: 0; }
.particle { position: absolute; top: 0; left: 0; transform-origin: center; will-change: transform; }
.particle svg { display: block; width: 100%; height: 100%; overflow: visible; }
.particle[data-depth="distant"] .particle-outline { filter: blur(2px); }
.particle[data-depth="far"] .particle-outline { filter: blur(1.1px); }
.particle[data-depth="middle"] .particle-outline { filter: blur(.35px); }
.particle[data-depth="near"] .particle-outline { filter: blur(3.5px); }
::selection { color: var(--dark); background: var(--pink); }
h1, p { margin: 0; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
a:focus-visible, select:focus-visible { outline: 2px solid var(--dark); outline-offset: 5px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: 12px; left: 20px; z-index: 10; padding: 8px 16px; background: var(--light); border: 2px solid var(--dark); transform: translateY(-160%); }
.skip-link:focus { transform: translateY(0); }
.site-header { gap: 12px; display: flex; justify-content: flex-end; align-items: center; min-height: 64px; padding: 8px var(--gutter); background: var(--dark); color: var(--light); }
:root[data-theme="dark"] .site-header { box-shadow: inset 0 -1px 0 var(--grey); }
.language-control { display: flex; align-items: center; gap: 12px; font-size: 14px; }
.language-control { position: relative; }
[hidden] { display: none !important; }
.ui-button { position: relative; isolation: isolate; display: inline-flex; align-items: center; justify-content: center; gap: 12px; min-width: 44px; min-height: 44px; padding: 10px 12px; border: 0; border-radius: 0; background: transparent; color: inherit; font: inherit; cursor: pointer; transition: color 180ms ease-out; }
.ui-button::before { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; background: var(--pink); opacity: 0; transition: opacity 180ms ease-out; pointer-events: none; }
@media (hover: hover) { .ui-button:hover::before { opacity: 1; } }
.ui-button:focus-visible::before { opacity: 1; }
.ui-button[aria-expanded="true"]::before, .language-option[aria-pressed="true"]::before { opacity: 1; }
@media (hover: hover) { .ui-button[aria-expanded="true"]:hover::before, .language-option[aria-pressed="true"]:hover::before { opacity: 1; } }
.ui-button[aria-expanded="true"]:focus-visible::before, .language-option[aria-pressed="true"]:focus-visible::before { opacity: 1; }
.ui-button:active::before { opacity: 1; }
.ui-button[aria-expanded="true"]:active::before, .language-option[aria-pressed="true"]:active::before { opacity: 1; }
.ui-button:focus-visible { outline: 2px solid currentColor; outline-offset: -3px; }
.ui-button--icon { width: 44px; padding: 10px; }
.button-chevron { width: 16px; height: 16px; filter: invert(1); }
.language-panel { position: absolute; top: calc(100% + 8px); right: 0; width: 224px; max-width: calc(100vw - 2 * var(--gutter)); max-height: calc(100svh - 84px); overflow-y: auto; padding: 4px; background: var(--dark); color: var(--light); box-shadow: 0 4px 12px #0003; }
.language-option { width: 100%; justify-content: space-between; text-align: left; }
.language-option[aria-pressed="true"]::after { content: "-"; font: 700 20px/1 "QWQ Mono", monospace; }
.language-control::before { content: ""; flex: 0 0 4px; width: 4px; height: 20px; background: var(--pink); pointer-events: none; }
.language-label { display: flex; align-items: center; cursor: pointer; }
.language-icon { width: 24px; height: 24px; filter: invert(1); }
select { max-width: 140px; min-height: 44px; background: transparent; border: 0; color: inherit; color-scheme: dark; font: inherit; padding: 8px; cursor: pointer; }
select option { background: var(--dark); color: var(--light); }
.site-header select:focus-visible { outline-color: var(--light); }
main { position: relative; z-index: 1; background: transparent; align-self: center; width: calc(100% - 2 * var(--gutter)); max-width: 1536px; margin-inline: auto; padding-block: 24px 56px; }
.site-header, .site-footer { position: relative; z-index: 2; }
.site-footer { background: var(--grey); }
:root[data-theme="dark"] .site-footer { background: var(--dark); box-shadow: inset 0 1px 0 var(--grey); }
.wordmark { filter: drop-shadow(0 0 3px var(--surface)); }
.welcome h1 { text-shadow: 0 0 5px var(--surface), 0 0 2px var(--surface); }
/* Side margins are ~15% of the central logo width, exceeding the final T width. */
.brand-clearspace { padding: clamp(56px, 6vw, 120px) 11.5%; }
.brand-stage { container: brand / inline-size; }
.wordmark { width: 100%; }
.wordmark.primary { display: none; }
.wordmark.primary svg { display: block; width: 100%; height: auto; fill: var(--foreground); }
/* The supplied primary uses 80% black to make #333 on white. Render that same
   brand color opaquely so background particles cannot show through its ink. */
.wordmark.primary g[opacity="0.8"] { opacity: 1; }
.wordmark.primary path[style*="stroke:black"] { stroke: var(--foreground) !important; }
.wordmark.primary text { font-family: 'QWQ Mono', monospace !important; }
.wordmark.symbol { max-width: 320px; margin-inline: auto; }
/* Primary keeps the PDF's 1024px minimum; compact is reserved for the corner. */
@container brand (min-width: 1024px) {
  .wordmark.symbol { display: none; }
  .wordmark.primary { display: block; }
}
.welcome { width: 100%; max-width: 560px; margin-inline: auto; text-align: center; padding-inline: 8px; }
.welcome-intro { margin: 16px auto 0; color: var(--foreground); font: 400 var(--body-size)/1.75 var(--body-font); overflow-wrap: anywhere; text-shadow: 0 0 5px var(--surface), 0 0 2px var(--surface); }
.project-button { margin-top: 16px; max-width: 100%; min-height: 48px; padding: 10px 20px; border: 2px solid transparent; background: var(--pink); color: var(--dark); font: 400 calc(var(--body-size) * .9)/1.5 var(--body-font); text-decoration: none; overflow-wrap: anywhere; transition: transform 180ms ease-out, border-color 180ms ease-out, box-shadow 180ms ease-out; }
.project-button::before { content: none; }
.project-icon { display: block; flex: 0 0 28px; width: 28px; height: 28px; background: currentColor; mask: url("assets/icons/carbon-next-filled.svg") center / contain no-repeat; -webkit-mask: url("assets/icons/carbon-next-filled.svg") center / contain no-repeat; transition: transform 180ms ease-out; }
/* Separate layers keep icon bounce independent from button movement. */
.project-icon-motion { display: block; flex: 0 0 28px; width: 28px; height: 28px; }
.footer-group { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: stretch; gap: 32px; }
@media (hover: hover) { .project-button:hover { border-color: var(--pink); box-shadow: 0 4px 10px #ff55a326; transform: translateY(-2px); } }
.project-button:focus-visible { outline: 2px solid var(--dark); outline-offset: 4px; }
.project-button:active { transform: translateY(0); box-shadow: none; border-color: var(--pink); }
@media (prefers-reduced-motion: reduce) { .project-button, .project-button:hover, .project-button:active { transform: none; transition: none; } }
.pink-line { display: block; width: 26px; height: 4px; margin: 0 auto 24px; background: var(--pink); }
h1 { font-family: var(--heading-font); font-size: calc(var(--body-size) * 2); font-weight: var(--heading-weight); line-height: 1.4; letter-spacing: -.035em; overflow-wrap: anywhere; }
html:lang(en) h1, html:lang(fr) h1 { text-transform: uppercase; }
.site-footer { display: flex; justify-content: center; align-items: center; gap: 0; min-height: 88px; padding: 8px var(--gutter); }
.copyright { color: var(--light); font: 400 16px/1.5 "QWQ Sans", sans-serif; }
.footer-content { width: 100%; max-width: 960px; color: var(--light); font: 400 16px/1.5 var(--body-font); }
.footer-info { padding: 8px 0; }
.footer-left { min-width: 0; }
.footer-brand { display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; gap: 8px; }
.footer-brand .copyright { margin-right: 34px; text-align: left; }
.footer-contact { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); gap: 24px 32px; min-width: 0; margin: 0; font-style: normal; text-align: left; }
.footer-contact p { max-width: 100%; }
.footer-contact p > span { margin-right: 8px; }
.footer-content a { font-weight: 700; text-decoration: underline; text-underline-offset: .2em; overflow-wrap: anywhere; }
.footer-content a:focus-visible, .footer-credits summary:focus-visible { outline: 2px solid var(--light); outline-offset: 3px; }
.footer-credits { margin: 4px 0 0; overflow-wrap: anywhere; }
.footer-credits summary { width: fit-content; max-width: 100%; padding: 10px 4px; cursor: pointer; }
.footer-credits-content { overflow: hidden; }
.footer-credits-content > p { padding-top: 8px; }
.footer-credits p { line-height: 1.75; }
.footer-credits ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 32px; margin: 16px 0 0; padding-left: 24px; }
@media (max-width: 900px) { .footer-contact { grid-template-columns: minmax(0, 1fr); gap: 12px; } }
@media (max-width: 600px) {
  .footer-group { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .footer-brand .copyright { align-self: flex-start; margin-right: 0; }
  .footer-credits ul { grid-template-columns: minmax(0, 1fr); gap: 12px; }
}
/* User-authorized exception: compact may be smaller in a corner; retain clear space. */
.corner-clearspace { width: fit-content; margin: 0; padding: 18px 34px; }
.corner-wordmark { width: 216px; }
.primary-visible .corner-wordmark { width: 88px; }
@media (max-width: 600px) {
  #language-toggle { width: 44px; padding: 10px; }
  #language-toggle .button-text, #language-toggle .button-chevron { display: none; }
  .site-header { min-height: 60px; }
  main { padding-block: 16px 40px; }
  .brand-clearspace { padding-block: 48px; }
  .wordmark.symbol { max-width: 240px; }
  .pink-line { margin-bottom: 20px; }
  .site-footer { flex-direction: column; align-items: center; gap: 0; padding-block: 12px 8px; }
  .copyright { text-align: center; }
  .corner-clearspace { padding: 14px 28px; }
  .footer-brand .corner-clearspace { align-self: center; }
  .corner-wordmark { width: 180px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .particle { will-change: auto; } .ui-button::before { transition: none; } }

/* Active controls use the undiluted brand pink with dark foregrounds. */
.ui-button:is(:focus-visible, :active, [aria-expanded="true"], [aria-pressed="true"]) { color: var(--dark); }
.ui-button:is(:focus-visible, :active, [aria-expanded="true"], [aria-pressed="true"]) :is(.language-icon, .button-chevron) { filter: invert(.2); }
@media (hover: hover) {
  .ui-button:hover { color: var(--dark); }
  .ui-button:hover :is(.language-icon, .button-chevron) { filter: invert(.2); }
}
.ui-button :is(.language-icon, .button-chevron) { transition: filter 180ms ease-out; }
.project-button, .project-button:hover, .project-button:focus-visible, .project-button:active { color: var(--light); border-radius: 999px; }
.project-button { transition: transform 180ms ease-out, border-color 180ms ease-out, box-shadow 180ms ease-out, background-color 180ms ease-out, color 180ms ease-out; }
@media (hover: hover) { .project-button:hover { background: var(--light); color: var(--pink); } }
.project-button:focus-visible, .project-button:active { background: var(--light); color: var(--pink); border-color: var(--pink); }
@media (prefers-reduced-motion: reduce) { .project-button { transition: none; } }
.site-footer::before { content: ""; position: absolute; top: 0; left: 50%; transform: translate(-50%, -50%); width: 48px; height: 6px; background: var(--pink); pointer-events: none; }
@media (prefers-reduced-motion: reduce) { .ui-button, .ui-button :is(.language-icon, .button-chevron) { transition: none; } }

.theme-icon { width: 24px; height: 24px; filter: invert(1); }
#language-toggle:active::before, .language-option:active::before { background: var(--light); opacity: 1; }
@media (hover: hover) {
  #language-toggle:hover:not(:active), .language-option:hover:not(:active) { color: var(--light); }
}
#language-toggle:active, .language-option:active { color: var(--dark); }
#language-toggle:active :is(.language-icon, .button-chevron) { filter: invert(.2); }
#language-toggle:is([aria-expanded="true"], :focus-visible):not(:active), .language-option:is([aria-pressed="true"], :focus-visible):not(:active) { color: var(--light); }
#language-toggle:is([aria-expanded="true"], :focus-visible):not(:active) :is(.language-icon, .button-chevron) { filter: invert(1); }
@media (hover: hover) {
  #language-toggle:hover:not(:active) :is(.language-icon, .button-chevron) { filter: invert(1); }
}
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
::view-transition-old(root) { z-index: 1; }
::view-transition-new(root) { z-index: 2; }
::view-transition { pointer-events: none; }
#theme-toggle[aria-disabled="true"] { cursor: wait; }
#theme-toggle:is(:focus-visible, :active) .theme-icon { filter: invert(.2); }
@media (hover: hover) { #theme-toggle:hover:not(:active) .theme-icon { filter: invert(1); } }
#theme-toggle:active::before { background: var(--light); opacity: 1; }
#theme-toggle:active { color: var(--dark); }
#theme-toggle[aria-disabled="true"]:not(:active)::before { background: var(--pink); opacity: 1; }
#theme-toggle[aria-disabled="true"]:not(:active) .theme-icon { filter: invert(1); }
.particle use:first-child { fill: var(--surface); }
.particle[data-depth="distant"] .particle-outline { stroke: var(--particle-distant); }
.particle[data-depth="far"] .particle-outline { stroke: var(--particle-far); }
.particle[data-depth="middle"] .particle-outline { stroke: var(--particle-middle); }
.particle[data-depth="near"] .particle-outline { stroke: var(--particle-near); }
.skip-link { background: var(--surface); color: var(--foreground); border-color: var(--foreground); }
.project-button:focus-visible { outline-color: var(--foreground); }
