/* Cardshot homepage. One dark theme (the product's own), one accent (the
   product blue), two radii: --r-ui for controls, --r-box for containers. */
@font-face { font-family: Geist; src: url(../fonts/Geist-Variable.woff2) format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url(../fonts/GeistMono-Variable.woff2) format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  --bg: #0b0c10; --surface: #13151b; --surface-2: #1a1d25; --line: rgb(255 255 255 / .08); --line-2: rgb(255 255 255 / .14);
  --text: #eceef3; --muted: #9ba2b3; --accent: #4f7cff; --accent-2: #7b9bff; --on-accent: #ffffff;
  --r-ui: 10px; --r-box: 20px;
  --sans: Geist, -apple-system, BlinkMacSystemFont, "PingFang TC", "Noto Sans TC", "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --nav-h: 64px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--nav-h); }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.6 var(--sans); -webkit-font-smoothing: antialiased; overflow-x: clip; }
:lang(zh-Hant) body { line-height: 1.7; }
a { color: inherit; }
img, canvas { display: block; }
svg { width: 1em; height: 1em; flex: none; }
h1, h2 { margin: 0; font-weight: 640; letter-spacing: -.035em; line-height: 1.04; text-wrap: balance; }
:lang(zh-Hant) h1, :lang(zh-Hant) h2 { letter-spacing: -.01em; line-height: 1.18; }
p { margin: 0; text-wrap: pretty; }
kbd { font: 500 .85em var(--mono); padding: 1px 6px; margin: 0 1px; border-radius: 6px; border: 1px solid var(--line-2); background: var(--surface-2); }
.skip { position: absolute; left: -999px; top: 8px; z-index: 30; padding: 8px 14px; background: var(--accent); color: var(--on-accent); border-radius: var(--r-ui); }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 3px; border-radius: 4px; }

/* Film grain on a fixed layer, never on scrolling content. */
body::after { content: ""; position: fixed; inset: 0; z-index: 40; pointer-events: none; opacity: .05; mix-blend-mode: overlay;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }

/* ---------- Buttons ---------- */
.cta, .ghost { display: inline-flex; align-items: center; gap: 10px; font: 600 15px/1 var(--sans); text-decoration: none; white-space: nowrap; cursor: pointer;
  border-radius: var(--r-ui); padding: 14px 20px; border: 0; transition: transform .2s var(--ease), background .2s, box-shadow .2s; }
.cta { background: var(--accent); color: var(--on-accent); box-shadow: inset 0 1px 0 rgb(255 255 255 / .22), 0 10px 30px -12px rgb(79 124 255 / .8); }
.cta:hover { background: #5d88ff; }
.cta:active, .ghost:active { transform: translateY(1px) scale(.98); }
.cta svg { font-size: 18px; }
.cta.small { padding: 9px 14px; font-size: 14px; }
.cta.big { padding: 17px 24px; font-size: 16px; }
.cta.wide { width: 100%; justify-content: center; }
.cta[aria-disabled="true"] { background: var(--surface-2); color: var(--muted); box-shadow: inset 0 0 0 1px var(--line-2); cursor: default; }
.ghost { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }
.ghost:hover { background: var(--surface-2); }
.ghost svg { transition: transform .25s var(--ease); }
.ghost:hover svg { transform: translateX(3px); }
.text-link { color: var(--accent-2); text-underline-offset: 4px; }

/* ---------- Nav ---------- */
.nav { position: fixed; inset: 0 0 auto; z-index: 20; height: var(--nav-h); display: flex; align-items: center; gap: 28px; padding: 0 max(24px, calc(50vw - 640px));
  background: rgb(11 12 16 / .72); backdrop-filter: blur(16px) saturate(160%); -webkit-backdrop-filter: blur(16px) saturate(160%); border-bottom: 1px solid var(--line); }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 650; letter-spacing: -.02em; text-decoration: none; font-size: 17px; }
.logo img { border-radius: 7px; }
.links { display: flex; gap: 24px; margin-left: 12px; font-size: 14px; }
.links a { color: var(--muted); text-decoration: none; transition: color .2s; }
.links a:hover { color: var(--text); }
.lang { margin-left: auto; display: inline-flex; align-items: center; gap: 7px; font: 500 14px var(--sans); color: var(--muted); background: none; border: 0; cursor: pointer; padding: 8px 6px; border-radius: var(--r-ui); }
.lang:hover { color: var(--text); }
.lang svg { font-size: 17px; }
@media (prefers-reduced-transparency: reduce) { .nav { background: var(--bg); backdrop-filter: none; } }

/* ---------- Hero ---------- */
.hero { position: relative; overflow-x: clip; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 56px; align-items: center;
  padding: calc(var(--nav-h) + 56px) max(24px, calc(50vw - 640px)) 72px; }
/* The glow behind the stage uses the extension's own "lagoon" wallpaper colours. */
.hero::before { content: ""; position: absolute; z-index: -1; right: -10vw; top: 6vh; width: 70vw; height: 90vh; filter: blur(70px); opacity: .42;
  background: radial-gradient(circle at 25% 30%, #7fc4ff, transparent 45%), radial-gradient(circle at 75% 25%, #b3f0e4, transparent 40%),
    radial-gradient(circle at 30% 80%, #9aa8ff, transparent 45%), radial-gradient(circle at 80% 75%, #e2c9ff, transparent 40%); }
.hero h1 { font-size: clamp(44px, 5.6vw, 80px); }
:lang(zh-Hant) .hero h1 { font-size: clamp(40px, 4.4vw, 66px); }
.hero-copy p { margin-top: 24px; font-size: clamp(17px, 1.35vw, 20px); color: var(--muted); max-width: 30em; }
.ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }

.stage { position: relative; perspective: 1600px; container-type: inline-size; }
.window { position: relative; border-radius: 14px; overflow: hidden; background: #fff; box-shadow: 0 0 0 1px rgb(255 255 255 / .1), 0 40px 80px -30px rgb(0 0 0 / .8), 0 20px 40px -20px rgb(40 60 120 / .5);
  transform: rotateX(4deg) rotateY(-7deg); transform-origin: 60% 50%; transition: transform .9s var(--ease), filter .6s var(--ease); }
.stage:hover .window, .stage.captured .window { transform: none; }
.window-bar { height: 34px; display: flex; align-items: center; gap: 7px; padding: 0 14px; background: #eceef1; border-bottom: 1px solid #dcdfe4; }
.window-bar i { width: 11px; height: 11px; border-radius: 50%; background: #ff5f57; }
.window-bar i:nth-child(2) { background: #febc2e; } .window-bar i:nth-child(3) { background: #28c840; }
.window-bar span { margin: 0 auto; transform: translateX(-24px); font: 500 12px var(--sans); color: #6b7280; background: #fff; padding: 3px 40px; border-radius: 6px; }
.viewport { position: relative; aspect-ratio: 16 / 10.4; overflow: hidden; background: #f6f7f4; }
.viewport[data-layout="tablet"] { aspect-ratio: 4 / 3.4; }
.viewport[data-layout="mobile"] { aspect-ratio: 3 / 4.2; }
.viewport iframe { color-scheme: light; /* the demo page follows the embedder's scheme otherwise */ position: absolute; left: 0; top: 0; width: 1280px; /* set by main.js to the layout shown */ border: 0; transform-origin: 0 0; transform: scale(var(--s, .5)); height: calc(100% / var(--s, .5)); }
/* The extension's picker bar, as it floats over a page. */
.picker-bar { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); display: flex; gap: 10px; align-items: center; padding: 6px 8px 6px 6px; border-radius: 12px;
  background: rgb(22 24 29 / .92); color: #fff; font: 500 12px var(--sans); box-shadow: 0 10px 30px -8px rgb(0 0 0 / .5); pointer-events: none; transition: opacity .3s; white-space: nowrap; }
.pb-mode { background: #2a2c33; padding: 4px 9px; border-radius: 7px; }
.pb-hint { color: #aab0bf; padding-right: 4px; }
.stage.captured .picker-bar { opacity: 0; }

.result { position: absolute; inset: 34px 0 0; /* below the window bar */ display: grid; place-items: center; align-content: center; gap: 18px; pointer-events: none; }
.result-card { position: relative; }
.result-card canvas { max-width: 82cqw; max-height: calc(var(--vh, 50cqw) - 96px); width: auto; height: auto; margin: 0 auto; }
.result-actions { display: flex; gap: 10px; justify-content: center; opacity: 0; transform: translateY(8px); transition: opacity .4s var(--ease), transform .4s var(--ease); }
.result-actions .ghost { background: rgb(11 12 16 / .7); backdrop-filter: blur(10px); padding: 11px 16px; font-size: 14px; }
.stage.captured .result { pointer-events: auto; }
.stage.captured .result-actions { opacity: 1; transform: none; transition-delay: .35s; }
.stage.captured .viewport iframe { filter: brightness(.38) saturate(.6) blur(1.5px); transition: filter .6s var(--ease); }

.cursor { position: absolute; left: 0; top: 0; width: 26px; height: 26px; opacity: 0; pointer-events: none; z-index: 2; color: #111;
  background: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256'%3E%3Cpath fill='%23111' stroke='%23fff' stroke-width='14' d='M220.49,207.8,207.8,220.49a12,12,0,0,1-17,0l-56.57-56.57L115,214.08l-.13.33A15.84,15.84,0,0,1,100.26,224l-.78,0a15.82,15.82,0,0,1-14.41-11L32.8,52.92A15.95,15.950,0,0,1,52.92,32.8L213,85.07a16,16,0,0,1,1.41,29.8l-.33.13-50.16,19.27,56.57,56.56A12,12,0,0,1,220.49,207.8Z'/%3E%3C/svg%3E");
  filter: drop-shadow(0 2px 4px rgb(0 0 0 / .35)); }

/* ---------- Devices ---------- */
.devices { position: relative; }
.pin { min-height: 100dvh; display: grid; grid-template-rows: auto 1fr auto; gap: 28px; padding: calc(var(--nav-h) + 40px) max(24px, calc(50vw - 640px)) 48px; }
.devices-copy { max-width: 820px; }
.devices h2 { font-size: clamp(34px, 4vw, 58px); }
.devices-copy p { margin-top: 16px; color: var(--muted); font-size: 18px; max-width: 40em; }
.devices-row { display: flex; align-items: flex-end; justify-content: center; gap: clamp(16px, 3vw, 44px); min-height: 0; perspective: 2000px; }
.dev { margin: 0; display: grid; justify-items: center; gap: 14px; height: min(52vh, 520px); grid-template-rows: minmax(0, 1fr) auto; }
.dev[data-device="desktop"] { position: relative; z-index: 1; }
.dev[data-device="mobile"] { height: min(46vh, 460px); }
.dev[data-device="tablet"] { height: min(44vh, 440px); }
.flip { position: relative; height: 100%; transform-style: preserve-3d; transition: transform .8s var(--ease); }
.face { height: 100%; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.face.dark { position: absolute; inset: 0; transform: rotateY(180deg); }
.face canvas { height: 100%; width: auto; filter: drop-shadow(0 30px 40px rgb(0 0 0 / .45)); }
.dev figcaption { font: 500 13px var(--mono); color: var(--muted); letter-spacing: .02em; }
.scheme { justify-self: center; position: relative; display: grid; grid-template-columns: 1fr 1fr; padding: 4px; border-radius: 99px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); font: 500 13px var(--sans); }
.scheme button { position: relative; z-index: 1; padding: 6px 18px; text-align: center; color: var(--muted); transition: color .3s; font: inherit; background: none; border: 0; cursor: pointer; }
.scheme button:hover { color: var(--text); }
.scheme::before { content: ""; position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px); border-radius: 99px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line-2); transition: transform .5s var(--ease); }
.scheme [aria-pressed="true"] { color: var(--text); }
.devices.dark .scheme::before { transform: translateX(100%); }
.devices.dark .flip { transform: rotateY(180deg); }
.dev[data-device="desktop"] .flip { transition-delay: .08s; } .dev[data-device="mobile"] .flip { transition-delay: .16s; }

@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) and (min-width: 900px) {
    .devices { height: 360vh; view-timeline: --devices block; }
    .pin { position: sticky; top: 0; height: 100dvh; }
    .scheme button { pointer-events: none; } /* scrolling drives it */
    .dev { animation: linear both; animation-timeline: --devices; animation-range: contain 0% contain 28%; }
    .dev[data-device="desktop"] { animation-name: dev-center; }
    .dev[data-device="tablet"] { animation-name: dev-from-right; }
    .dev[data-device="mobile"] { animation-name: dev-from-left; }
    .flip { animation: flip linear both; animation-timeline: --devices; }
    .dev[data-device="tablet"] .flip { animation-range: contain 46% contain 66%; }
    .dev[data-device="desktop"] .flip { animation-range: contain 52% contain 72%; }
    .dev[data-device="mobile"] .flip { animation-range: contain 58% contain 78%; }
    .scheme::before { animation: scheme-pill linear both; animation-timeline: --devices; animation-range: contain 58% contain 66%; }
    .scheme .s-light { animation: fade-out linear both; animation-timeline: --devices; animation-range: contain 58% contain 66%; }
    .scheme .s-dark { animation: fade-in linear both; animation-timeline: --devices; animation-range: contain 58% contain 66%; }
    .devices-copy { animation: rise linear both; animation-timeline: --devices; animation-range: contain 0% contain 14%; }
  }
}
@keyframes dev-center { from { transform: translateY(6%) scale(1.12); } to { transform: none; } }
@keyframes dev-from-right { from { transform: translateX(80%) scale(.7) rotateY(-25deg); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes dev-from-left { from { transform: translateX(-90%) scale(.7) rotateY(25deg); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes flip { from { transform: none; } to { transform: rotateY(180deg); } }
@keyframes scheme-pill { to { transform: translateX(100%); } }
@keyframes fade-out { to { color: var(--muted); } }
@keyframes fade-in { from { color: var(--muted); } to { color: var(--text); } }
@keyframes rise { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: none; } }

/* ---------- Studio ---------- */
.studio { padding: 120px max(24px, calc(50vw - 640px)); }
.studio-head { max-width: 720px; }
.studio h2 { font-size: clamp(34px, 4vw, 58px); }
.studio-head p { margin-top: 16px; color: var(--muted); font-size: 18px; }
.studio-grid { margin-top: 48px; display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: stretch; }
.studio-canvas { position: relative; min-height: 600px; border-radius: var(--r-box); display: grid; place-items: center; padding: 32px; overflow: hidden;
  background: conic-gradient(#191b22 25%, #15171d 0 50%, #191b22 0 75%, #15171d 0) 0 0 / 22px 22px; box-shadow: inset 0 0 0 1px var(--line); }
.studio-canvas canvas { max-width: 100%; max-height: 640px; width: auto; height: auto; transition: opacity .2s; }
.panel { display: grid; gap: 20px; align-content: start; padding: 22px; border-radius: var(--r-box); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.panel fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
.panel legend { padding: 0; margin-bottom: 9px; font-size: 13px; color: var(--muted); }
.panel fieldset.two { display: grid; grid-template-columns: 1.5fr 1fr; gap: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button, .tools button { font: 500 13px var(--sans); color: var(--muted); background: var(--surface-2); border: 0; border-radius: 99px; padding: 7px 13px; cursor: pointer; transition: background .2s, color .2s, box-shadow .2s; box-shadow: inset 0 0 0 1px var(--line); }
.chips button:hover, .tools button:hover { color: var(--text); }
.chips button[aria-pressed="true"], .tools button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); box-shadow: none; }
/* The extension's segmented strips. */
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 3px; gap: 2px; border-radius: var(--r-ui); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
.seg button { font: 500 13px var(--sans); color: var(--muted); background: none; border: 0; padding: 6px 4px; border-radius: 7px; cursor: pointer; display: grid; place-items: center; white-space: nowrap; }
.seg button:hover { color: var(--text); }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
.seg.icons svg { width: 22px; height: 22px; }
.swatches { display: grid; grid-template-columns: repeat(9, 1fr); gap: 6px; }
.swatches button { aspect-ratio: 1; border-radius: 50%; border: 0; cursor: pointer; box-shadow: inset 0 0 0 1px rgb(255 255 255 / .2); outline: 2px solid transparent; outline-offset: 2px; transition: outline-color .2s, transform .2s var(--ease); }
.swatches button:hover { transform: scale(1.08); }
.swatches button[aria-pressed="true"] { outline-color: var(--text); }
.sliders { display: grid; gap: 10px; }
.sliders label { display: grid; grid-template-columns: 64px 1fr; align-items: center; font-size: 13px; color: var(--muted); }
input[type=range] { accent-color: var(--accent); width: 100%; margin: 0; }

/* ---------- Annotate ---------- */
.annotate { padding: 100px max(24px, calc(50vw - 640px)) 120px; display: grid; justify-items: center; text-align: center; gap: 36px; }
.annotate h2 { font-size: clamp(34px, 4vw, 58px); }
.annotate-stage { width: min(100%, 760px); min-height: 200px; display: grid; place-items: center; }
.annotate-stage canvas { max-width: 100%; height: auto; }
.tools { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.tools button { padding: 9px 16px; font-size: 14px; }
.annotate-sub { color: var(--muted); max-width: 40em; }

/* ---------- Privacy ---------- */
.privacy { padding: 140px 24px; display: grid; justify-items: center; text-align: center; gap: 22px;
  background: radial-gradient(ellipse 60% 50% at 50% 40%, rgb(79 124 255 / .14), transparent 70%); border-block: 1px solid var(--line); }
.privacy .lock { font-size: 40px; color: var(--accent-2); }
.privacy h2 { font-size: clamp(36px, 5.2vw, 76px); max-width: 15em; }
.privacy p { color: var(--muted); font-size: 18px; max-width: 34em; }

/* ---------- Install ---------- */
.install { padding: 140px max(24px, calc(50vw - 640px)); display: grid; grid-template-columns: auto 1fr; gap: 64px; align-items: center; }
.install-icon { perspective: 800px; }
.install-icon img { width: clamp(140px, 16vw, 220px); height: auto; border-radius: 22%; box-shadow: 0 40px 80px -20px rgb(79 124 255 / .55), inset 0 0 0 1px rgb(255 255 255 / .2);
  transform: rotateY(-18deg) rotateX(8deg); transition: transform .8s var(--ease); }
.install-icon:hover img { transform: none; }
.install h2 { font-size: clamp(34px, 4vw, 58px); }
.install p { margin: 18px 0 30px; color: var(--muted); font-size: 18px; max-width: 34em; }
.install .desktop-only { display: none; margin-top: -14px; font-size: 15px; }
@media (pointer: coarse) { .install .desktop-only { display: block; } }

.foot { display: flex; flex-wrap: wrap; gap: 24px; padding: 32px max(24px, calc(50vw - 640px)); border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.foot a { text-decoration: none; } .foot a:hover { color: var(--text); }
.foot span { margin-right: auto; }

/* ---------- Reveal on scroll ---------- */
@media (prefers-reduced-motion: no-preference) {
  .reveal { opacity: 0; transform: translateY(28px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
  .reveal.in { opacity: 1; transform: none; }
  .hero-copy > * { animation: rise .9s var(--ease) both; }
  .hero-copy > :nth-child(2) { animation-delay: .08s; } .hero-copy > :nth-child(3) { animation-delay: .16s; }
  .stage { animation: stage-in 1.2s var(--ease) .1s both; }
}
@keyframes stage-in { from { opacity: 0; transform: translateY(40px) scale(.97); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .window { transform: none; } }

/* ---------- Narrow screens ---------- */
@media (max-width: 900px) {
  .links { display: none; }
  .hero { grid-template-columns: 1fr; gap: 40px; padding-top: calc(var(--nav-h) + 40px); min-height: auto; }
  .window { transform: none; }
  .pin { min-height: auto; gap: 24px; padding: 72px 20px 48px; }
  .devices-row { flex-wrap: wrap; align-items: flex-end; row-gap: 28px; }
  .dev[data-device="desktop"] { order: -1; flex-basis: 100%; }
  .dev, .dev[data-device="mobile"], .dev[data-device="tablet"] { height: 300px; }
  .studio { padding-block: 72px; }
  .studio-grid { margin-top: 32px; }
  .annotate { padding: 64px 20px 72px; gap: 24px; }
  .privacy { padding: 88px 20px; }
  .install { padding-block: 80px; }
  .studio-grid { grid-template-columns: 1fr; }
  .studio-canvas { min-height: 360px; padding: 20px; }
  .install { grid-template-columns: 1fr; gap: 36px; justify-items: start; }
}
@media (max-width: 560px) {
  .nav { gap: 12px; }
  .nav .cta.small span { display: none; }
  .lang span { display: none; }
  .pb-hint { display: none; }
  .picker-bar { top: 8px; font-size: 11px; }
  .dev[data-device="desktop"] { height: 280px; }
  .dev[data-device="mobile"], .dev[data-device="tablet"] { height: 230px; }
  .hero { padding-inline: 20px; padding-bottom: 32px; gap: 32px; }
  .studio, .install { padding-inline: 20px; }
  .studio-canvas { min-height: 300px; padding: 14px; }
  .panel { padding: 18px; }
}
