/* Pixtopia's brand pages (pixtopia.net/brand). The English source is written by hand; scripts/brand-site.ts makes
   the translations and shared files.
   The tokens are the app's (src/theme/tokens.ts, DESIGN.md), as the changelog's are: charcoal steps and ink, the Prism only
   in the mark and its swatches. It follows the reader's own light or dark setting. A logo's tile keeps its own background
   whatever the page's, since that's the background it's for. */

@font-face { font-family: Geist; src: url(/keychain/fonts/Geist_400Regular.woff2) format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: Geist; src: url(/keychain/fonts/Geist_500Medium.woff2) format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: Geist; src: url(/keychain/fonts/Geist_600SemiBold.woff2) format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: Geist; src: url(/keychain/fonts/Geist_700Bold.woff2) format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Geist Mono'; src: url(/keychain/fonts/GeistMono_400Regular.woff2) format('woff2'); font-weight: 400; font-display: swap; }

:root {
  color-scheme: dark;
  --canvas: #0b0b0c;
  --surface: #151515;
  --raised: #1c1c1c;
  --hover: #232323;
  --border: #262626;
  --border-strong: #363636;
  --ink: #f5f5f5;
  --ink-2: #a3a3a3;
  --ink-3: #737373;
  --primary: #f5f5f5;
  --on-primary: #0b0b0c;
  --glass: rgba(11, 11, 12, 0.8);
  --focus: rgba(76, 168, 255, 0.55);
  --gutter: clamp(16px, 4vw, 48px);
  --sans: Geist, ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, monospace;
}
@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --canvas: #fafafa;
    --surface: #ffffff;
    --raised: #f4f4f5;
    --hover: #ededee;
    --border: #e7e7e9;
    --border-strong: #d4d4d8;
    --ink: #0b0b0c;
    --ink-2: #52525b;
    --ink-3: #71717a;
    --primary: #0b0b0c;
    --on-primary: #fafafa;
    --glass: rgba(250, 250, 250, 0.8);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; background: var(--canvas); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body { margin: 0; background: var(--canvas); color: var(--ink); font: 400 16px/1.6 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
img { display: block; }

.wrap { width: 100%; max-width: 1040px; margin: 0 auto; padding: 0 var(--gutter); }

.top { position: sticky; top: 0; z-index: 2; background: var(--glass); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
.top-inner { min-height: 64px; padding-top: 12px; padding-bottom: 12px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; }
.home { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; letter-spacing: -0.01em; text-decoration: none; }
.home svg { width: 28px; height: 28px; flex: none; }
.mark-ink { fill: var(--ink); }
.prism-a { fill: #ff4f8b; }
.prism-b { fill: #ffb547; }
.prism-c { fill: #3ee0a1; }
.prism-d { fill: #4ca8ff; }
.top nav { display: flex; align-items: center; gap: 24px; }
.top nav a { font-size: 14px; font-weight: 500; color: var(--ink-2); text-decoration: none; white-space: nowrap; }
.top nav a:hover { color: var(--ink); }
.top nav .button { height: 34px; padding: 0 14px; display: inline-flex; align-items: center; border-radius: 10px; background: var(--raised); border: 1px solid var(--border); color: var(--ink); }
.top nav .button:hover { background: var(--hover); }
@media (max-width: 720px) { .top nav .wide { display: none; } }

/* The opening: what the page is and the one download most people want, beside the mark drawn on its own grid. */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 380px); gap: 40px 64px; align-items: center; padding: clamp(48px, 9vw, 104px) 0 clamp(48px, 8vw, 96px); }
h1 { margin: 0; font-size: clamp(40px, 8vw, 72px); line-height: 1.02; letter-spacing: -0.035em; font-weight: 700; }
.lead { margin: 16px 0 0; max-width: 30em; font-size: clamp(17px, 2.2vw, 20px); line-height: 1.5; color: var(--ink-2); }
.button.primary { margin-top: 32px; height: 46px; padding: 0 20px; display: inline-flex; align-items: center; border-radius: 12px; background: var(--primary); color: var(--on-primary); font-weight: 600; font-size: 15px; text-decoration: none; }
.button.primary:hover { opacity: 0.88; }
.note { margin: 12px 0 0; font-size: 13px; color: var(--ink-3); }

.construction { margin: 0; }
.construction svg { display: block; width: 100%; height: auto; }
.construction .room { fill: var(--raised); }
.construction .lines { fill: none; stroke: rgba(128, 128, 128, 0.42); stroke-width: 1px; vector-effect: non-scaling-stroke; }
.construction figcaption { margin-top: 14px; font-size: 13px; line-height: 1.5; color: var(--ink-3); max-width: 34em; }

/* The four colours land on the grid one after another, a square at a time, once. */
@media (prefers-reduced-motion: no-preference) {
  .construction .hop { transform-box: fill-box; animation: hop 480ms both; }
  .construction .prism-a { animation-delay: 300ms; }
  .construction .prism-b { animation-delay: 420ms; }
  .construction .prism-c { animation-delay: 540ms; }
  .construction .prism-d { animation-delay: 660ms; }
}
@keyframes hop {
  0% { transform: translateY(-3px); opacity: 0; animation-timing-function: steps(1, end); }
  34% { transform: translateY(-2px); opacity: 1; animation-timing-function: steps(1, end); }
  67% { transform: translateY(-1px); opacity: 1; animation-timing-function: steps(1, end); }
  100% { transform: none; opacity: 1; }
}

.part { padding: 48px 0 24px; border-top: 1px solid var(--border); }
.part-head { margin-bottom: 8px; }
h2 { margin: 0; font-size: clamp(28px, 4vw, 36px); line-height: 1.1; letter-spacing: -0.025em; font-weight: 700; }
.part-head p { margin: 10px 0 0; max-width: 38em; color: var(--ink-2); }

/* A logo, colour or rule: what it is held to the left on a wide page, the thing itself beside it. */
.item { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 16px 48px; padding: 32px 0; }
.item + .item { border-top: 1px solid var(--border); }
h3 { margin: 0; font-size: 17px; line-height: 1.3; letter-spacing: -0.01em; font-weight: 600; }
.about p { margin: 6px 0 0; font-size: 15px; line-height: 1.5; color: var(--ink-2); }
.body > p { margin: 0 0 12px; max-width: 38em; color: var(--ink-2); }
.body > p:last-child { margin-bottom: 0; }

.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.tiles.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
/* A token's ZIP, beside what's in it. */
.get { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 16px 0 0; font-size: 13px; line-height: 1.4; color: var(--ink-3); }
.tile { margin: 0; min-width: 0; }
.field { height: 184px; display: grid; place-items: center; padding: 16px; border-radius: 14px; border: 1px solid var(--border); overflow: hidden; }
.on-dark { background: #0b0b0c; }
.on-light { background: #fafafa; }
.on-plain { background: var(--surface); }
.field img { max-width: 100%; height: auto; }
.field .square { width: 96px; height: 96px; }
/* A token's round icon is 256 to a mark's 64, so at twice the size its pixels match the marks beside it. */
.field .round { width: 128px; height: 128px; }
/* Covers fill their tile edge to edge. Shown smaller than they are, so smoothed rather than pixelated. */
.field.cover { height: auto; padding: 0; display: block; }
.field.cover img { display: block; width: 100%; height: auto; }
.tile.profile .field { height: auto; aspect-ratio: 3 / 1; padding: 8px; }
/* As big as the cover beside it is tall: a third of the tile's width, less its room. */
.field .avatar { width: 26%; height: auto; aspect-ratio: 1 / 1; border-radius: 50%; }
.cover-sizes { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.cover-sizes li { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 12px; font-size: 15px; line-height: 1.5; color: var(--ink-2); }
.cover-sizes strong { color: var(--ink); font-weight: 600; }
.tiles.covers .files { flex-wrap: wrap; }
@media (max-width: 860px) { .tiles.covers { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 480px) { .cover-sizes li { grid-template-columns: minmax(0, 1fr); gap: 2px; } }
.wide-logo img { width: auto; max-height: 48px; }
.app-icon { width: 112px; height: 112px; border-radius: 26px; }
.tile figcaption { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin-top: 10px; font-size: 13px; line-height: 1.4; color: var(--ink-2); }
.files { display: flex; gap: 6px; }
.file { height: 32px; min-width: 52px; padding: 0 12px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; border: 1px solid var(--border); background: var(--raised); color: var(--ink); font-size: 13px; font-weight: 500; text-decoration: none; }
.file:hover { background: var(--hover); border-color: var(--border-strong); }

.swatches { list-style: none; margin: 32px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px 16px; }
.swatch { display: flex; flex-direction: column; min-width: 0; }
.chip { display: block; aspect-ratio: 4 / 3; border-radius: 14px; border: 1px solid var(--border); margin-bottom: 14px; }
.swatch-name { font-weight: 600; font-size: 16px; line-height: 1.3; }
.where { margin-top: 2px; font-size: 13px; line-height: 1.4; color: var(--ink-3); }
.code { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 10px; min-height: 30px; }
code { font: 400 14px/1.4 var(--mono); color: var(--ink); }
.copy { height: 28px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--raised); color: var(--ink-2); font: 500 12px/1 var(--sans); cursor: pointer; }
.copy:hover { background: var(--hover); color: var(--ink); }
.copy[data-done] { color: var(--ink); border-color: var(--border-strong); }
.rgb { margin-top: 2px; font: 400 12px/1.4 var(--mono); color: var(--ink-3); }
.said { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.sizes { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 16px; margin-top: 20px; }
.sizes figure { margin: 0; min-width: 0; }
.sizes .with-name { grid-column: span 2; }
.at-size { height: 88px; display: grid; place-items: center; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); }
.at-size svg { display: block; }
.sizes figcaption { margin-top: 8px; font-size: 13px; color: var(--ink-3); }

.donts { list-style: none; margin: 20px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.donts .field { height: 132px; }
.donts .field svg { width: 64px; height: 64px; }
.donts .field .stretched { width: 104px; height: 44px; }
.donts .glow { filter: drop-shadow(0 0 4px rgba(76, 168, 255, 0.9)) drop-shadow(0 0 12px rgba(255, 79, 139, 0.7)); }
.donts p { display: flex; gap: 8px; align-items: flex-start; margin: 10px 0 0; font-size: 13px; line-height: 1.4; color: var(--ink-2); }
.cross { flex: none; width: 12px; height: 12px; margin-top: 3px; fill: none; stroke: var(--ink); stroke-width: 1.75; stroke-linecap: round; }

@media (max-width: 860px) {
  .hero { grid-template-columns: minmax(0, 1fr); }
  .construction { max-width: 360px; }
  .item { grid-template-columns: minmax(0, 1fr); gap: 16px; padding: 28px 0; }
  .swatches { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 16px; }
  .donts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* On a phone a token's round icon, with its three files, takes the row, and its two marks share the next. */
@media (max-width: 560px) {
  .tiles.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tiles.three .tile:first-child { grid-column: 1 / -1; }
}
@media (max-width: 480px) {
  .field { height: 140px; }
  .field .square { width: 64px; height: 64px; }
  .field .round { width: 85.333px; height: 85.333px; }
  .wide-logo img { max-height: 32px; }
  .app-icon { width: 88px; height: 88px; border-radius: 20px; }
}

.foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; margin-top: 48px; padding-top: 28px; padding-bottom: 48px; border-top: 1px solid var(--border); color: var(--ink-3); font-size: 13px; }
.foot p { margin: 0; }
.foot nav { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.foot a { color: var(--ink-2); text-decoration: none; }
.foot a:hover { color: var(--ink); }

/* These links work before JavaScript loads, and keep each language's own name. */
.languages { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; padding-top: 20px; font-size: 13px; color: var(--ink-2); }
.languages a { text-decoration: none; text-underline-offset: 4px; }
.languages a:hover, .languages [aria-current="page"] { color: var(--ink); text-decoration: underline; }
.languages [aria-current="page"] { font-weight: 600; }

/* Geist has no Chinese or Thai glyphs; the system supplies them without another font download. */
:root:lang(zh-Hans), :root:lang(th) { --sans: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif; }
html:lang(th) * { letter-spacing: 0; }
html:lang(th) body { line-height: 1.8667; }
html:lang(th) h1 { line-height: 1.19; }
html:lang(th) h2 { line-height: 1.2833; }
html:lang(th) h3, html:lang(th) .swatch-name { line-height: 1.5167; }
html:lang(th) .lead, html:lang(th) .construction figcaption, html:lang(th) .about p { line-height: 1.75; }
html:lang(th) .tile figcaption, html:lang(th) .where, html:lang(th) .donts p { line-height: 1.6333; }
html:lang(th) .copy { line-height: 1.1667; }

/* Each language's flag beside its name. Our own pixels (src/lib/flags.ts, written to /flags by scripts/flags-site.ts),
   not emoji: flag emoji differ from system to system and Windows has none. */
.languages a::before { content: ""; display: inline-block; width: 18px; height: 12px; margin-right: 6px; vertical-align: -1px; background: center / 100% 100% no-repeat; image-rendering: pixelated; }
.languages a[hreflang="en"]::before { background-image: url("/flags/en.svg"); }
.languages a[hreflang="es"]::before { background-image: url("/flags/es.svg"); }
.languages a[hreflang="de"]::before { background-image: url("/flags/de.svg"); }
.languages a[hreflang="fr"]::before { background-image: url("/flags/fr.svg"); }
.languages a[hreflang^="zh"]::before { background-image: url("/flags/zh.svg"); }
.languages a[hreflang="th"]::before { background-image: url("/flags/th.svg"); }
