/* Funnel Display & Funnel Sans (SIL OFL 1.1, NORD ID), self-hosted Latin subsets. */
@font-face { font-family: 'Funnel Display'; src: url('/fonts/funnel-display-latin.woff2') format('woff2'); font-weight: 300 800; font-style: normal; font-display: swap; }
@font-face { font-family: 'Funnel Sans'; src: url('/fonts/funnel-sans-latin.woff2') format('woff2'); font-weight: 300 800; font-style: normal; font-display: swap; }

:root {
  --bg: #f8f6f6;
  --surface: #fff;
  --soft: #f3eeef;
  --ink: #2a1219;
  --ink-2: #54404a;
  --muted: #6d5961;
  --faint: #7d6a71;
  --line: #ede5e7;
  --line-2: #ddd0d4;
  --accent: #7a1f34;
  --accent-hover: #63172a;
  --accent-ink: #7a1f34;
  --accent-soft: #f7e9ec;
  --accent-line: #e3c3cb;
  --on-accent: #fff;
  /* Raised controls inside surfaces: chips, fields in focus, icon buttons over images. */
  --raised: #fff;
  /* Ink-filled pills: active tabs, dark button, dock, toast. */
  --inverse: #2a1219;
  --inverse-hover: #431621;
  --on-inverse: #fff;
  --on-inverse-muted: #cdb5bc;
  --code-bg: #2a1219;
  /* Browser mockup and screenshot frames. */
  --frame: #fff;
  --frame-bar: #fbf9f9;
  --stage-base: #f3eeef;
  --icon-tile: #fff;
  --glass: rgba(255, 255, 255, .94);
  --glass-soft: rgba(255, 255, 255, .7);
  --hairline: rgba(42, 18, 25, .08);
  --hairline-strong: rgba(42, 18, 25, .12);
  --backdrop: rgba(42, 18, 25, .42);
  --display: 'Funnel Display', ui-sans-serif, system-ui, sans-serif;
  --sans: 'Funnel Sans', ui-sans-serif, system-ui, sans-serif;
  --mono: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, monospace;
  --shadow-sm: 0 1px 2px rgba(42, 18, 25, .06);
  --shadow-md: 0 12px 28px -12px rgba(42, 18, 25, .18), 0 2px 6px -2px rgba(42, 18, 25, .06);
  --shadow-lg: 0 28px 64px -24px rgba(42, 18, 25, .34), 0 4px 12px -4px rgba(42, 18, 25, .08);
  --shadow-xs: 0 2px 6px -2px rgba(42, 18, 25, .08);
  --shadow-button: 0 6px 14px -8px rgba(42, 18, 25, .45);
  --shadow-mockup: 0 14px 32px -14px rgba(42, 18, 25, .45);
  color-scheme: light;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --gutter: 32px;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
  scrollbar-gutter: stable;
}

:root[data-theme="dark"] {
  --bg: #120c0e;
  --surface: #1b1316;
  --soft: #271c20;
  --ink: #f5eaed;
  --ink-2: #dac9ce;
  --muted: #b5a1a8;
  --faint: #9c878f;
  --line: #2d2226;
  --line-2: #413238;
  --accent: #a8344f;
  --accent-hover: #bb4160;
  --accent-ink: #f08fa6;
  --accent-soft: #3a1821;
  --accent-line: #6e2c3e;
  --raised: #241a1e;
  --inverse: #f5eaed;
  --inverse-hover: #e2d2d7;
  --on-inverse: #1b0f13;
  --on-inverse-muted: #6b5660;
  --code-bg: #0b0708;
  --frame: #241a1e;
  --frame-bar: #2c2125;
  --stage-base: #1d1418;
  --icon-tile: #f4edef;
  --glass: rgba(27, 19, 22, .9);
  --glass-soft: rgba(18, 12, 14, .55);
  --hairline: rgba(255, 255, 255, .08);
  --hairline-strong: rgba(255, 255, 255, .14);
  --backdrop: rgba(5, 2, 3, .66);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-md: 0 12px 28px -12px rgba(0, 0, 0, .6), 0 2px 6px -2px rgba(0, 0, 0, .35);
  --shadow-lg: 0 28px 64px -24px rgba(0, 0, 0, .75), 0 4px 12px -4px rgba(0, 0, 0, .4);
  --shadow-xs: 0 2px 6px -2px rgba(0, 0, 0, .45);
  --shadow-button: 0 6px 14px -8px rgba(0, 0, 0, .7);
  --shadow-mockup: 0 14px 32px -14px rgba(0, 0, 0, .7);
  color-scheme: dark;
}

/* Base */
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--bg); caret-color: var(--accent); }
::selection { background: var(--accent-soft); color: var(--ink); }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-family: var(--display); text-wrap: balance; }
p { text-wrap: pretty; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: not-allowed; opacity: .45; }
a { color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 3px; border-radius: 6px; }
/* Focus rings are for people moving with Tab; shortcuts, Escape and clicks leave no ring behind. */
:root:not(.tab-nav) :focus-visible, :root:not(.tab-nav) .field-check input:focus-visible + .field-check-box { outline: none; }
#detail-content:focus { outline: none; }
[hidden] { display: none !important; }
.icon { width: 18px; height: 18px; flex-shrink: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: -80px; left: 20px; z-index: 100; background: var(--inverse); color: var(--on-inverse); padding: 12px 18px; border-radius: 999px; }
.skip-link:focus { top: 12px; }
.wrap { max-width: 1360px; margin: 0 auto; padding: 0 var(--gutter); }
* { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }

/* Buttons */
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 22px; border-radius: 999px; font-size: 15px; font-weight: 600; white-space: nowrap; transition: background-color .2s, color .2s, border-color .2s, box-shadow .2s, transform .2s var(--ease); }
.button:active { transform: scale(.98); }
.button-primary { background: var(--accent); color: var(--on-accent); box-shadow: var(--shadow-button); }
.button-primary:hover { background: var(--accent-hover); }
.button-dark { background: var(--inverse); color: var(--on-inverse); }
.button-dark:hover { background: var(--inverse-hover); }
.button-outline { background: var(--surface); border: 1px solid var(--line-2); color: var(--ink); }
.button-outline:hover { border-color: var(--accent-line); background: var(--accent-soft); }
.button-light { background: #fff; color: var(--accent); }
.button-light:hover { background: #f7e9ec; }
.button-ghost { border: 1px solid rgba(255, 255, 255, .5); color: #fff; }
.button-ghost:hover { background: rgba(255, 255, 255, .12); border-color: #fff; }
.button-count { font-size: 12px; font-weight: 600; background: var(--soft); color: var(--muted); border-radius: 999px; padding: 3px 8px; }
.icon-button { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; color: var(--ink-2); background: var(--soft); flex-shrink: 0; transition: background-color .2s, color .2s; }
.icon-button:hover { background: var(--accent-soft); color: var(--accent-ink); }
.text-button { font-size: 13px; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-2); }
.text-button:hover { color: var(--ink); text-decoration-color: currentColor; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 20; padding: 14px var(--gutter) 0; max-width: 1360px; margin: 0 auto; }
.nav-bar { height: 64px; display: flex; align-items: center; gap: 24px; padding: 0 10px 0 18px; background: var(--glass); -webkit-backdrop-filter: blur(16px) saturate(1.2); backdrop-filter: blur(16px) saturate(1.2); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow-sm); }
.brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--display); font-size: 22px; font-weight: 700; letter-spacing: -.035em; color: var(--ink); }
.brand-mark { width: 32px; height: 32px; color: var(--accent); flex-shrink: 0; }
.brand-accent { color: var(--accent-ink); }
.nav-links { display: flex; align-items: center; gap: 4px; margin: 0 auto; }
.nav-links > a, .nav-links > button { font-size: 15px; font-weight: 500; color: var(--ink-2); padding: 9px 14px; border-radius: 999px; transition: background-color .2s, color .2s; }
.nav-links > a:hover, .nav-links > button:hover { background: var(--soft); color: var(--ink); }
.collection-button { display: inline-flex; align-items: center; gap: 10px; height: 44px; padding: 0 8px 0 16px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-size: 15px; font-weight: 600; transition: background-color .2s; }
.collection-button:hover { background: var(--accent-hover); }
.theme-toggle { margin-right: -14px; }
.theme-toggle .icon { width: 19px; height: 19px; }
.theme-toggle .icon-sun, :root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
.theme-switch { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
.theme-switch button { height: 28px; padding: 0 12px; border-radius: 999px; font-size: 12.5px; font-weight: 500; color: var(--muted); transition: background-color .2s, color .2s; }
.theme-switch button:hover { color: var(--ink); }
.theme-switch button[aria-pressed="true"] { background: var(--inverse); color: var(--on-inverse); }
.count-badge { min-width: 28px; height: 28px; padding: 0 8px; display: grid; place-items: center; border-radius: 999px; background: rgba(255, 255, 255, .2); font-size: 13px; font-variant-numeric: tabular-nums; }
.collection-button.has-items .count-badge { background: #fff; color: var(--accent); }

/* Hero */
.hero { text-align: center; padding-top: 56px; padding-bottom: 32px; }
.hero h1 { font-size: clamp(42px, 5.6vw, 76px); font-weight: 600; line-height: 1.02; letter-spacing: -.04em; }
.hero-accent { color: var(--accent-ink); white-space: nowrap; }
.hero > p { font-size: 19px; line-height: 1.55; color: var(--ink-2); max-width: 48ch; margin: 16px auto 28px; }
.nobr { white-space: nowrap; }
.search-box { display: flex; align-items: center; gap: 12px; max-width: 660px; height: 60px; margin: 0 auto; padding: 0 12px 0 22px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 999px; box-shadow: var(--shadow-xs); transition: border-color .2s, box-shadow .2s; cursor: text; }
.search-box .icon { color: var(--muted); width: 20px; height: 20px; }
.search-box input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font-size: 16px; text-overflow: ellipsis; }
.search-box input::placeholder { color: var(--faint); }
.search-box input::-webkit-search-cancel-button { filter: grayscale(1); }
.search-box:focus-within { border-color: var(--accent-line); box-shadow: 0 0 0 4px var(--accent-soft); }
.search-box input:focus-visible { outline: 0; }
.search-box kbd { font-family: var(--sans); font-size: 13px; color: var(--muted); background: var(--soft); border: 1px solid var(--line); border-radius: 8px; min-width: 30px; height: 30px; display: grid; place-items: center; }
.quick-styles { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 18px; min-height: 36px; }
.quick-styles > span { font-size: 14px; color: var(--muted); margin-right: 4px; }
.quick-style { font-size: 14px; color: var(--ink-2); padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); transition: border-color .2s, background-color .2s, color .2s; }
.quick-style:hover, .quick-style[aria-pressed="true"] { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent-ink); }

/* Toolbar */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.category-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.category-tab { height: 40px; padding: 0 16px; border-radius: 999px; font-size: 14px; font-weight: 500; color: var(--ink-2); background: var(--surface); border: 1px solid var(--line); white-space: nowrap; transition: background-color .2s, color .2s, border-color .2s; }
.category-tab:hover { border-color: var(--line-2); color: var(--ink); }
.category-tab.active { background: var(--inverse); border-color: var(--inverse); color: var(--on-inverse); }
.tab-count { margin-left: 6px; font-size: 12px; opacity: .8; font-variant-numeric: tabular-nums; }
.controls { display: flex; gap: 8px; flex-shrink: 0; }
.select-pill { position: relative; display: flex; align-items: center; }
.select-pill select { appearance: none; height: 40px; padding: 0 38px 0 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: 14px; font-weight: 500; color: var(--ink-2); cursor: pointer; max-width: 190px; transition: border-color .2s; }
.select-pill select:hover { border-color: var(--line-2); }
.select-pill .icon { position: absolute; right: 13px; width: 16px; height: 16px; color: var(--muted); pointer-events: none; }
.results-count { font-size: 13px; color: var(--muted); margin: 14px 0 14px 4px; font-variant-numeric: tabular-nums; }

/* Cards */
.site-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(272px, 1fr)); gap: 28px 22px; }
/* Hold the space until the catalog arrives so later sections don't jump. */
.site-grid[aria-busy="true"] { min-height: 120vh; }
.site-card { --tint: #7a1f34; position: relative; min-width: 0; padding: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; transition: box-shadow .35s var(--ease), border-color .35s, transform .35s var(--ease); }
.site-card.selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow-md); }
.card-stage { position: relative; aspect-ratio: 1.3; border-radius: 15px; overflow: hidden; background: color-mix(in oklab, var(--tint) 15%, var(--stage-base)); isolation: isolate; }
.card-open { position: absolute; inset: 0; display: block; width: 100%; text-align: left; }
.card-open:focus-visible { outline-offset: -3px; border-radius: 15px; }
.browser { position: absolute; left: 8%; width: 84%; bottom: -5%; background: var(--frame); border-radius: 8px 8px 0 0; box-shadow: var(--shadow-mockup), 0 0 0 1px var(--hairline); overflow: hidden; transition: transform .5s var(--ease); }
.browser-bar { height: 15px; display: flex; align-items: center; gap: 3px; padding: 0 7px; border-bottom: 1px solid var(--line); background: var(--frame-bar); }
.browser-bar i { width: 4px; height: 4px; border-radius: 50%; background: var(--line-2); }
.browser-bar b { flex: 0 1 46%; height: 6px; margin: 0 auto; border-radius: 4px; background: var(--soft); }
.browser img { display: block; width: 100%; aspect-ratio: 1.44; object-fit: cover; object-position: top; background: var(--soft); }
.card-add { position: absolute; z-index: 2; top: 10px; right: 10px; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: var(--glass); color: var(--ink); box-shadow: var(--shadow-sm), 0 0 0 1px var(--hairline); transition: background-color .2s, color .2s, transform .25s var(--ease); }
.card-add .icon { width: 18px; height: 18px; }
.card-add.selected { background: var(--accent); color: var(--on-accent); }
.card-meta { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 12px; align-items: start; padding: 14px 8px 4px; }
.site-monogram { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; font-family: var(--display); font-size: 14px; font-weight: 700; letter-spacing: -.02em; text-transform: uppercase; box-shadow: inset 0 0 0 1px var(--hairline); }
.site-icon { position: relative; overflow: hidden; background: var(--icon-tile); box-shadow: none; }
.site-icon img { display: block; width: 100%; height: 100%; object-fit: cover; }
.site-icon.is-glyph img { width: 26px; height: 26px; object-fit: contain; }
.site-icon.is-dark { background: #2a1219; }
/* Hairline drawn above the image so full-bleed icons keep the tile edge. */
.site-icon::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px var(--hairline); pointer-events: none; }
.card-title { min-width: 0; }
.card-title h3 { margin: 0; font: inherit; }
.site-name { display: block; max-width: 100%; font-family: var(--display); font-size: 17px; font-weight: 600; letter-spacing: -.02em; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: left; }
.site-name:hover { color: var(--accent-ink); }
.card-desc { font-size: 13.5px; line-height: 1.4; min-height: 2.8em; color: var(--muted); display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; margin-top: 2px; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 8px 6px; }
.site-tags { display: flex; gap: 6px; flex-wrap: wrap; min-width: 0; }
.site-tag { font-size: 12px; line-height: 1; padding: 6px 9px; border-radius: 999px; background: var(--soft); color: var(--ink-2); white-space: nowrap; }
.palette-dots { display: flex; flex-shrink: 0; }
.palette-dots i { width: 14px; height: 14px; border-radius: 50%; box-shadow: 0 0 0 2px var(--surface), inset 0 0 0 1px var(--hairline-strong); }
.palette-dots i + i { margin-left: -3px; }
.image-unavailable { height: 100%; min-height: 60px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 6px; padding: 12px; text-align: center; background: var(--soft); color: var(--muted); }
.image-unavailable strong { font-family: var(--display); font-size: 18px; font-weight: 600; color: var(--ink-2); }
.image-unavailable span { font-size: 11px; }
.image-unavailable.small strong { font-size: 11px; }
.image-unavailable.small span { display: none; }

.load-more-wrap { text-align: center; padding: 48px 0 0; }
.load-more-wrap > p { font-size: 13px; color: var(--muted); margin-top: 12px; }
.empty-results, .catalog-error { text-align: center; padding: 80px 20px; }
.empty-results h2, .catalog-error h2 { font-size: 30px; font-weight: 600; letter-spacing: -.03em; }
.empty-results p, .catalog-error p { font-size: 16px; color: var(--muted); margin: 10px 0 24px; }

.fly-ghost { position: fixed; z-index: 60; object-fit: cover; object-position: top; border-radius: 10px; pointer-events: none; box-shadow: var(--shadow-lg); }

/* How it works */
.how { margin-top: 120px; padding: 112px 0; background: var(--surface); border-block: 1px solid var(--line); }
.how-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 80px; align-items: center; }
.how h2 { font-size: clamp(34px, 3.8vw, 52px); font-weight: 600; line-height: 1.04; letter-spacing: -.035em; max-width: 16ch; }
.how-lead { font-size: 18px; line-height: 1.6; color: var(--ink-2); max-width: 44ch; margin-top: 20px; }
.how-steps { list-style: none; margin: 40px 0 40px; padding: 0; display: grid; gap: 26px; }
.how-steps li { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 16px; }
.step-number { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); font-family: var(--display); font-weight: 700; font-size: 15px; }
.how-steps h3 { font-size: 19px; font-weight: 600; letter-spacing: -.02em; margin: 5px 0 6px; }
.how-steps p { font-size: 15.5px; line-height: 1.6; color: var(--muted); max-width: 46ch; }
.demo { margin: 0; padding: 22px; border-radius: 30px; background: color-mix(in oklab, var(--accent) 7%, var(--bg)); border: 1px solid var(--line); }
.demo figcaption { font-size: 13px; color: var(--muted); margin: 0 4px 16px; }
.demo-stack { display: grid; gap: 14px; }
.demo-card { background: var(--raised); border-radius: 18px; box-shadow: var(--shadow-md); padding: 6px 18px; }
.demo-row { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 14px; align-items: center; padding: 12px 0; }
.demo-row + .demo-row { border-top: 1px solid var(--line); }
.demo-row img { width: 64px; height: 44px; border-radius: 7px; object-fit: cover; object-position: top; box-shadow: 0 0 0 1px var(--line); }
.demo-row strong { display: block; font-family: var(--display); font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.demo-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.demo-chips span { font-size: 11.5px; padding: 4px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.demo-chips span.on { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-ink); }
.demo-prompt { position: relative; background: var(--code-bg); color: #ebdde0; border-radius: 18px; padding: 18px 20px 0; height: 230px; overflow: hidden; font-family: var(--mono); font-size: 12px; line-height: 1.75; white-space: pre-wrap; word-break: break-word; -webkit-mask-image: linear-gradient(#000 55%, transparent); mask-image: linear-gradient(#000 55%, transparent); }
.demo-prompt b { color: #fff; font-weight: 600; }
.demo-prompt em { font-style: normal; color: #f0a8b8; }

/* CTA */
.cta { padding-top: 120px; }
.cta-band { position: relative; overflow: hidden; text-align: center; color: #fff; background: var(--accent); border-radius: 36px; padding: 88px 40px 250px; }
.cta-band h2 { font-size: clamp(36px, 4.6vw, 64px); font-weight: 600; line-height: 1.02; letter-spacing: -.04em; max-width: 15ch; margin: 0 auto; }
.cta-band p { font-size: 18px; line-height: 1.55; color: #f8e9ec; max-width: 42ch; margin: 18px auto 32px; }
.cta-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; }
.cta-fan { position: absolute; left: 50%; bottom: -70px; width: 1000px; height: 270px; transform: translateX(-50%); pointer-events: none; }
.cta-fan img { position: absolute; bottom: 0; width: 240px; aspect-ratio: 1.44; object-fit: cover; object-position: top; border-radius: 12px; border: 4px solid #fff; box-shadow: var(--shadow-lg); background: var(--soft); transition: transform .8s var(--ease); }
.cta-fan img:nth-child(1) { left: 0; transform: rotate(-10deg) translateY(20px); }
.cta-fan img:nth-child(2) { left: 190px; transform: rotate(-5deg); z-index: 1; }
.cta-fan img:nth-child(3) { left: 380px; transform: translateY(-34px); z-index: 2; }
.cta-fan img:nth-child(4) { left: 570px; transform: rotate(5deg); z-index: 1; }
.cta-fan img:nth-child(5) { left: 760px; transform: rotate(10deg) translateY(20px); }

/* Footer */
.site-footer { padding: 88px 0 120px; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1.3fr; gap: 40px; }
.footer-brand p { font-size: 15px; color: var(--muted); margin-top: 14px; max-width: 28ch; line-height: 1.55; }
.footer-heading { color: var(--ink); font-family: var(--sans); font-size: 14px; font-weight: 600; margin-bottom: 14px; }
.footer-col a, .footer-col button { display: block; font-size: 14.5px; color: var(--muted); padding: 5px 0; text-align: left; transition: color .2s; }
.footer-col a:hover, .footer-col button:hover { color: var(--accent-ink); }
.footer-note p:not(.footer-heading) { font-size: 14px; color: var(--muted); line-height: 1.6; }
.footer-note p + p:not(.footer-heading) { margin-top: 10px; }
.footer-base { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 56px; padding-top: 24px; background: linear-gradient(var(--line), var(--line)) no-repeat var(--gutter) 0 / calc(100% - var(--gutter) * 2) 1px; font-size: 13px; color: var(--muted); }

/* Selection dock */
.selection-dock { position: fixed; z-index: 15; left: 50%; bottom: 20px; transform: translateX(-50%); display: flex; align-items: center; gap: 16px; padding: 8px 8px 8px 12px; max-width: calc(100% - 32px); background: var(--inverse); color: var(--on-inverse); border-radius: 999px; box-shadow: var(--shadow-lg); animation: dock-in .5s var(--ease); }
.dock-previews { display: flex; }
.dock-previews img, .dock-previews .image-unavailable { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; object-position: top; border: 2px solid var(--inverse); background: var(--soft); }
.dock-previews > * + * { margin-left: -12px; }
.dock-copy { white-space: nowrap; }
.dock-copy strong { display: block; font-size: 14px; font-weight: 600; }
.dock-copy > span { display: block; font-size: 12.5px; color: var(--on-inverse-muted); margin-top: 2px; }
.selection-dock .button { min-height: 44px; box-shadow: none; }

/* Dialogs */
dialog { border: 0; padding: 0; color: var(--ink); background: var(--surface); }
dialog::backdrop { background: var(--backdrop); backdrop-filter: blur(6px); }
body.modal-open { overflow: hidden; }
.detail-dialog { width: min(1200px, calc(100% - 48px)); height: min(820px, calc(100dvh - 48px)); max-height: none; border-radius: 28px; overflow: hidden; box-shadow: var(--shadow-lg); }
#detail-content { position: relative; height: 100%; }
.detail-dialog[open] { animation: pop-in .4s var(--ease); }
.detail-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); height: 100%; }
.detail-image-panel { --tint: #7a1f34; display: flex; flex-direction: column; gap: 14px; padding: 20px; background: color-mix(in oklab, var(--tint) 12%, var(--stage-base)); min-width: 0; min-height: 0; }
.viewer-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.viewer-actions { display: flex; align-items: center; gap: 6px; }
.viewer-actions a, .viewer-actions button { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 999px; font-size: 13.5px; font-weight: 500; color: var(--ink-2); background: var(--glass-soft); }
.viewer-actions a:hover, .viewer-actions button:hover { background: var(--raised); color: var(--ink); }
.viewer-actions .icon { width: 15px; height: 15px; }
.reference-preview-label { font-size: 13px; color: var(--ink-2); }
.detail-image-container { position: relative; flex: 1 1 auto; min-height: 0; overflow: auto; overscroll-behavior: contain; border-radius: 14px; background: var(--frame); box-shadow: 0 0 0 1px var(--hairline), var(--shadow-md); }
.detail-image-container > img { display: block; width: 100%; height: auto; }
.detail-image-container.full-page-viewer { scrollbar-gutter: stable; }
.detail-image-container:not(.full-page-viewer) { flex-grow: 0; }
.detail-image-container.actual-size > img { width: var(--capture-width); max-width: none; margin: 0; }
.capture-caption { font-size: 12.5px; line-height: 1.6; color: var(--ink-2); text-align: center; }
.detail-info { position: relative; display: flex; flex-direction: column; align-items: flex-start; padding: 36px 32px 28px; min-width: 0; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.detail-close-bar { position: absolute; top: 16px; right: 16px; z-index: 5; display: flex; align-items: center; gap: 8px; }
.detail-nav { display: flex; gap: 4px; }
.detail-step .icon { width: 18px; height: 18px; }
.detail-step:disabled { opacity: .4; pointer-events: none; }
.detail-info h2 { font-size: 38px; font-weight: 600; letter-spacing: -.035em; line-height: 1.05; margin: 4px 0 8px; padding-right: 140px; }
.detail-domain { display: inline-flex; align-items: center; gap: 5px; font-size: 14px; color: var(--accent-ink); }
.detail-domain:hover { text-decoration: underline; text-underline-offset: 3px; }
.detail-domain .icon { width: 14px; height: 14px; }
.detail-description { font-size: 16.5px; line-height: 1.6; color: var(--ink-2); margin: 20px 0 24px; }
.detail-label { font-size: 13px; font-weight: 600; color: var(--ink); margin: 0 0 10px; }
.detail-section { margin-bottom: 22px; width: 100%; }
.palette { display: flex; flex-wrap: wrap; gap: 14px; }
.swatch { display: flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 12px; color: var(--ink-2); }
.swatch i { width: 28px; height: 28px; border-radius: 9px; box-shadow: inset 0 0 0 1px var(--hairline-strong); }
.focus-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.focus-chip { display: inline-flex; align-items: center; gap: 5px; height: 34px; padding: 0 13px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--raised); font-size: 13.5px; font-weight: 500; color: var(--ink-2); transition: background-color .2s, border-color .2s, color .2s; }
.focus-chip:hover { border-color: var(--accent-line); }
.focus-chip .icon { width: 14px; height: 14px; margin-left: -3px; }
.focus-chip.active { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-ink); }
.detail-actions { display: flex; gap: 10px; flex-wrap: wrap; width: 100%; margin-top: auto; padding-top: 8px; }
.detail-actions .button { flex: 1; }
/* Keyboard shortcuts, shown only where a keyboard is the likely input. */
.detail-keys { display: none; margin: 12px 0 0; font-size: 12.5px; color: var(--muted); }
.detail-keys kbd { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; margin-right: 3px; border: 1px solid var(--line-2); border-radius: 6px; background: var(--bg); font-family: var(--sans); font-size: 12px; color: var(--ink-2); }
.detail-keys span { margin: 0 4px; color: var(--faint); }
@media (hover: hover) and (pointer: fine) and (min-width: 901px) { .detail-keys { display: block; } }
.source-link { font-size: 12px; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; margin-top: 14px; }

.collection-dialog { position: fixed; inset: 12px 12px 12px auto; margin: 0; width: 480px; max-width: calc(100% - 24px); height: calc(100dvh - 24px); max-height: none; border-radius: 26px; box-shadow: var(--shadow-lg); }
.collection-dialog[open] { display: flex; flex-direction: column; animation: drawer-in .45s var(--ease); }
.drawer-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 26px 26px 18px; }
.drawer-header h2 { font-size: 30px; font-weight: 600; letter-spacing: -.035em; }
.drawer-sub { font-size: 14px; color: var(--muted); margin-top: 4px; }
.drawer-body { flex: 1; overflow: auto; padding: 4px 26px 26px; overscroll-behavior: contain; }
.collection-empty { text-align: center; padding: 56px 8px; }
.empty-art { width: 140px; height: auto; }
.collection-empty h3 { font-size: 24px; font-weight: 600; letter-spacing: -.03em; margin: 22px 0 10px; }
.collection-empty p { font-size: 15px; line-height: 1.6; color: var(--muted); margin-bottom: 26px; }
.collection-heading { display: flex; align-items: center; justify-content: space-between; }
.collection-heading p { font-size: 15px; font-weight: 600; }
.field-help { font-size: 13px; line-height: 1.5; color: var(--muted); margin: 6px 0 14px; }
.collection-item { padding: 16px; border: 1px solid var(--line); border-radius: 18px; margin-bottom: 10px; }
.collection-item-top { display: flex; align-items: center; gap: 12px; }
.collection-thumb { width: 76px; height: 52px; border-radius: 9px; overflow: hidden; flex-shrink: 0; background: var(--soft); box-shadow: 0 0 0 1px var(--line); }
.collection-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.collection-item-info { flex: 1; min-width: 0; }
.collection-item-info h3 { font-size: 16px; font-weight: 600; letter-spacing: -.01em; }
.collection-item-info p { font-size: 13px; color: var(--muted); margin-top: 2px; }
.remove-item { width: 34px; height: 34px; background: transparent; }
.collection-item .focus-chips { margin-top: 12px; }
.collection-item .focus-chip { height: 30px; font-size: 12.5px; padding: 0 11px; }
.reference-note { display: block; width: 100%; min-height: 34px; margin-top: 10px; padding: 8px 0 0; border: 0; border-top: 1px dashed var(--line-2); background: transparent; font-size: 13.5px; line-height: 1.5; resize: none; outline: 0; field-sizing: content; }
.reference-note::placeholder { color: var(--faint); }
.project-fields { padding-top: 22px; }
.field-label { display: block; font-size: 15px; font-weight: 600; margin-bottom: 8px; }
.field-label span { font-weight: 400; font-size: 13px; color: var(--muted); }
.project-fields textarea { display: block; width: 100%; min-height: 110px; padding: 14px 16px; border: 1px solid var(--line-2); border-radius: 16px; background: var(--bg); font-size: 15px; line-height: 1.6; resize: vertical; transition: border-color .2s, box-shadow .2s; }
.project-fields textarea:focus { outline: 0; border-color: var(--accent-line); box-shadow: 0 0 0 4px var(--accent-soft); background: var(--raised); }
.project-fields textarea::placeholder, .prompt-panel textarea::placeholder { color: var(--faint); }
.field-select-wrap { position: relative; display: flex; align-items: center; }
.field-select { appearance: none; width: 100%; height: 48px; padding: 0 40px 0 16px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--bg); font-size: 15px; cursor: pointer; }
.field-check { position: relative; display: flex; align-items: flex-start; gap: 12px; margin-top: 16px; padding: 14px 16px; border: 1px solid var(--line-2); border-radius: 16px; background: var(--bg); cursor: pointer; transition: border-color .2s, background-color .2s; }
.field-check:has(input:checked) { border-color: var(--accent-line); background: var(--accent-soft); }
.field-check input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.field-check-box { flex: none; display: grid; place-items: center; width: 22px; height: 22px; margin-top: 1px; border: 1.5px solid var(--line-2); border-radius: 7px; background: var(--raised); color: var(--on-accent); transition: background-color .2s, border-color .2s; }
.field-check-box .icon { width: 15px; height: 15px; opacity: 0; transition: opacity .15s; }
.field-check input:checked + .field-check-box { background: var(--accent); border-color: var(--accent); }
.field-check input:checked + .field-check-box .icon { opacity: 1; }
.field-check input:focus-visible + .field-check-box { outline: 2px solid var(--accent-ink); outline-offset: 2px; }
.field-check-text strong { display: block; font-size: 15px; font-weight: 600; line-height: 1.4; }
.field-check-text small { display: block; margin-top: 3px; font-size: 13px; line-height: 1.5; color: var(--muted); }
.field-check-text a { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 2px; }
@media (hover: hover) { .field-check:hover { border-color: var(--accent-line); } }
.field-select-wrap .icon { position: absolute; right: 16px; width: 16px; height: 16px; color: var(--muted); pointer-events: none; }
.drawer-footer { padding: 16px 26px 20px; border-top: 1px solid var(--line); }
.generate-button { width: 100%; min-height: 52px; font-size: 16px; }
.drawer-footer p { text-align: center; font-size: 12.5px; color: var(--muted); margin-top: 10px; }
.back-button { display: inline-flex; align-items: center; gap: 4px; text-decoration: none; font-size: 14px; font-weight: 500; }
.back-button .icon { width: 16px; height: 16px; }
.prompt-ready { margin: 22px 0 16px; }
.prompt-ready h3 { font-size: 24px; font-weight: 600; letter-spacing: -.03em; }
.prompt-ready p { font-size: 14px; color: var(--muted); margin-top: 4px; }
.prompt-panel > textarea { display: block; width: 100%; height: 50dvh; min-height: 340px; padding: 18px; border: 1px solid var(--line-2); border-radius: 16px; background: var(--bg); font-family: var(--mono); font-size: 12.5px; line-height: 1.75; resize: vertical; }
.prompt-panel > textarea:focus { outline: 0; border-color: var(--accent-line); box-shadow: 0 0 0 4px var(--accent-soft); background: var(--raised); }

.info-dialog { width: 520px; max-width: calc(100% - 32px); max-height: calc(100dvh - 40px); padding: 44px 40px 40px; border-radius: 28px; box-shadow: var(--shadow-lg); }
.info-dialog[open] { animation: pop-in .4s var(--ease); }
.info-close { position: absolute; top: 16px; right: 16px; }
.info-dialog h2 { font-size: 34px; font-weight: 600; letter-spacing: -.035em; line-height: 1.08; margin-bottom: 18px; padding-right: 24px; }
.info-dialog p { font-size: 15.5px; line-height: 1.7; color: var(--ink-2); }
.info-dialog p + p { margin-top: 12px; }
.info-dialog .button { width: 100%; margin-top: 26px; }

.toast { position: fixed; z-index: 100; left: 50%; bottom: 96px; transform: translate(-50%, 10px); max-width: calc(100vw - 32px); padding: 12px 20px; border-radius: 999px; background: var(--inverse); color: var(--on-inverse); font-size: 14px; text-align: center; box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none; transition: opacity .25s, transform .35s var(--ease); }
.toast.visible { opacity: 1; transform: translate(-50%, 0); }
.noscript { position: fixed; inset: 96px 16px auto; padding: 18px; border-radius: 16px; background: var(--accent); color: var(--on-accent); text-align: center; }

@keyframes drawer-in { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes pop-in { from { transform: translateY(14px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes dock-in { from { transform: translate(-50%, 24px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }

@media (hover: hover) {
  .site-card:hover { box-shadow: var(--shadow-md); border-color: var(--line-2); transform: translateY(-2px); }
  .site-card:hover .browser { transform: translateY(-5px); }
  .card-add:hover { background: var(--accent); color: var(--on-accent); transform: scale(1.06); }
}

/* Responsive */
@media (max-width: 1100px) {
  .toolbar { flex-direction: column; align-items: stretch; }
  .controls { justify-content: flex-start; }
  .how-grid { grid-template-columns: minmax(0, 1fr); gap: 56px; }
  .how h2 { max-width: 18ch; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .detail-layout { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .detail-layout { display: flex; flex-direction: column; }
  .detail-dialog { height: calc(100dvh - 48px); }
  .detail-image-panel { flex: 1 1 0; min-height: 40%; }
  .detail-info { flex: 0 1 auto; padding: 22px 24px 20px; }
  .detail-info h2 { padding-right: 0; }
  .viewer-toolbar { padding-right: 140px; }
  .detail-description { margin: 12px 0 16px; }
  .detail-section { margin-bottom: 14px; }
  .detail-actions { flex-wrap: nowrap; }
  .caption-hint { display: none; }
  .capture-caption { font-size: 12px; }
  /* A one-screen capture has nothing to scroll, so the dialog hugs its content. */
  .detail-dialog:not(:has(.full-page-viewer)) { height: fit-content; max-height: calc(100dvh - 48px); }
  .detail-image-panel:not(:has(.full-page-viewer)) { flex: 0 0 auto; min-height: 0; }
}
@media (max-width: 760px) {
  :root { --gutter: 16px; scroll-padding-top: 84px; }
  .site-header { padding-top: 10px; }
  .nav-bar { height: 58px; padding: 0 7px 0 14px; gap: 10px; border-radius: 18px; }
  .brand { font-size: 20px; gap: 8px; }
  .brand-mark { width: 28px; height: 28px; }
  .nav-links { margin-left: auto; margin-right: 0; gap: 0; }
  .nav-links > a:first-child, .nav-links > button { display: none; }
  .nav-links > a { font-size: 14px; padding: 8px 10px; }
  .nav-links > a { white-space: nowrap; }
  .collection-button { height: 42px; padding: 0 6px 0 12px; gap: 8px; }
  .collection-label { display: none; }
  .theme-toggle { display: none; }
  .footer-base { align-items: center; }
  .hero { padding-top: 52px; padding-bottom: 32px; }
  .hero h1 { font-size: clamp(38px, 11vw, 48px); }
  .hero > p { font-size: 16.5px; margin: 16px auto 26px; }
  .search-box { height: 54px; padding: 0 8px 0 18px; }
  .search-box kbd { display: none; }
  .quick-styles { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; margin: 18px calc(var(--gutter) * -1) 0; padding: 2px var(--gutter); scrollbar-width: none; }
  .quick-styles::-webkit-scrollbar { display: none; }
  .quick-style { flex-shrink: 0; }
  .category-tabs { flex-wrap: nowrap; overflow-x: auto; margin: 0 calc(var(--gutter) * -1); padding: 2px var(--gutter); scrollbar-width: none; }
  .category-tabs::-webkit-scrollbar { display: none; }
  .controls > .select-pill { flex: 1; }
  .select-pill select { width: 100%; max-width: none; }
  .site-grid { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .how { margin-top: 80px; padding: 72px 0; }
  .how-steps { margin: 32px 0; }
  .demo { padding: 14px; border-radius: 24px; }
  .demo-card { padding: 4px 14px; }
  .demo-prompt { height: 190px; font-size: 11px; padding: 14px 16px 0; }
  .cta { padding-top: 72px; }
  .cta-band { border-radius: 26px; padding: 56px 20px 200px; }
  .cta-band p { font-size: 16px; }
  .cta-fan { width: 640px; height: 200px; bottom: -60px; }
  .cta-fan img { width: 170px; }
  .cta-fan img:nth-child(2) { left: 118px; }
  .cta-fan img:nth-child(3) { left: 236px; }
  .cta-fan img:nth-child(4) { left: 354px; }
  .cta-fan img:nth-child(5) { left: 472px; }
  .site-footer { padding: 64px 0 112px; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px 20px; }
  .footer-brand, .footer-note { grid-column: 1 / -1; }
  .selection-dock { bottom: 12px; gap: 12px; padding: 6px 6px 6px 10px; }
  .dock-previews img, .dock-previews .image-unavailable { width: 34px; height: 34px; }
  .dock-copy > span { display: none; }
  .selection-dock .button { min-height: 42px; padding: 0 16px; font-size: 14px; }
  .toast { bottom: 84px; font-size: 13px; }
  .detail-dialog { width: calc(100% - 16px); height: calc(100dvh - 16px); border-radius: 22px; }
  .detail-dialog:not(:has(.full-page-viewer)) { max-height: calc(100dvh - 16px); }
  .detail-image-panel { padding: 12px 12px 10px; gap: 10px; }
  .capture-caption { font-size: 11.5px; line-height: 1.45; }
  .detail-info { padding: 16px 18px 16px; }
  .detail-label { margin-bottom: 7px; }
  .swatch i { width: 22px; height: 22px; border-radius: 7px; }
  .palette { gap: 10px; }
  .detail-actions .button { padding: 0 14px; }
  .viewer-toolbar { flex-wrap: nowrap; }
  .viewer-actions a, .viewer-actions button { width: 34px; padding: 0; justify-content: center; }
  .viewer-actions .va-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
  .palette-section { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; }
  .palette-section .detail-label { margin: 0; }
  .detail-close-bar { top: 10px; right: 10px; gap: 6px; }
  .detail-close, .detail-step { background: var(--raised); box-shadow: var(--shadow-md); }
  .detail-info h2 { font-size: 26px; margin: 0 0 4px; }
  .detail-description { font-size: 14.5px; line-height: 1.5; margin: 8px 0 12px; }
  .collection-dialog { inset: 8px; width: auto; max-width: none; height: calc(100dvh - 16px); border-radius: 22px; }
  .drawer-header { padding: 20px 18px 14px; }
  .drawer-body { padding: 4px 18px 20px; }
  .drawer-footer { padding: 14px 18px 16px; }
  .info-dialog { padding: 36px 24px 26px; }
  .info-dialog h2 { font-size: 30px; }
}
/* Touch screens of any size: larger targets and 16px form text (prevents iOS focus zoom). */
@media (pointer: coarse), (max-width: 1100px) {
  .quick-style { min-height: 40px; }
  .card-add { width: 40px; height: 40px; }
  .footer-col a, .footer-col button { padding: 10px 0; }
  .select-pill select, .field-select, .project-fields textarea, .reference-note, .prompt-panel > textarea { font-size: 16px; }
  .collection-item .focus-chip, .focus-chip { height: 38px; }
  .theme-switch button { height: 36px; padding: 0 14px; }
}
/* Short phones (iPhone SE): tags and swatches explain themselves, so their labels go. */
@media (max-width: 760px) and (max-height: 720px) {
  .detail-section:not(:has(.focus-chips)) .detail-label { display: none; }
}
@media (max-width: 400px) {
  .dock-previews { display: none; }
  .viewer-actions a { display: inline-flex; }
}
@media (prefers-reduced-motion: reduce) {
  :root { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
.site-tag.tag-category { background: var(--accent-soft); color: var(--accent-ink); }
/* The wordmark needs the room on narrow phones; How it works stays reachable by scrolling and from the footer. */
@media (max-width: 440px) {
  .nav-links { display: none; }
  .collection-button { margin-left: auto; }
}
