/* Blink Blink website. "Sunny cat": tokens and sticker primitives from docs/design/sunny-cat-mockup.html. */

@font-face {
  font-family: Nunito;
  src: url("../fonts/Nunito-wght.woff2") format("woff2");
  font-weight: 200 1000;
  font-style: normal;
  font-display: swap;
}

/* ------------------------------------------------------------------ tokens (mockup :root) */
:root {
  --sun: #F7D163; --sun-deep: #EBBE48; --cream: #FFF6D8; --ink: #231A15; --ink-2: #4E3F2E;
  --leaf: #A8DB9C; --cat: #141110; --eye: #FFF7D1;

  --bg: var(--sun); --surface: var(--cream); --inset: #FCEAB2;
  --text: var(--ink); --text-2: var(--ink-2);
  --line: var(--ink); --shadow: var(--ink);
  --btn-bg: var(--ink); --btn-fg: var(--cream);
  --track: rgba(35, 26, 21, .14); --hair: rgba(35, 26, 21, .18); --hover: rgba(35, 26, 21, .07);
  --code-bg: #FCEAB2;

  --ease-gaze: cubic-bezier(.65, 0, .35, 1);
  --ease-out: cubic-bezier(.33, 1, .68, 1);
  --ease-in: cubic-bezier(.32, 0, .67, 0);
  --sine: cubic-bezier(.37, 0, .63, 1);

  --r-card: 20px; --r-board: 28px;
  --wrap: 1180px;
  color-scheme: light;
}
[data-theme="night"] {
  --bg: #221C18; --surface: #2F2722; --inset: #29221D;
  --text: #FFF1C9; --text-2: #D8C597;
  --line: #C9A94E; --shadow: #0B0908;
  --btn-bg: #F7D163; --btn-fg: #231A15;
  --track: rgba(255, 241, 201, .16); --hair: rgba(255, 241, 201, .16); --hover: rgba(255, 241, 201, .08);
  --code-bg: #1A1512;
  color-scheme: dark;
}

/* ------------------------------------------------------------------ base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 16px; }
body {
  margin: 0; font-family: Nunito, ui-rounded, "Segoe UI", system-ui, sans-serif; font-size: 1.0625rem; line-height: 1.55;
  background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased;
  transition: background-color .4s var(--sine), color .4s var(--sine);
  overflow-x: hidden;
}
img, video, canvas { max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 2px; }
a:hover { text-decoration-color: var(--line); }
button { font-family: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--text); outline-offset: 2px; border-radius: 12px; }
[hidden] { display: none !important; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; text-wrap: balance; }
h1 { font-weight: 900; letter-spacing: -.5px; }
h2 { font-weight: 900; font-size: clamp(1.75rem, 1.2rem + 1.8vw, 2.5rem); letter-spacing: -.3px; }
h3 { font-weight: 800; font-size: 1.1875rem; }
p { margin: 0 0 1em; }
b, strong { font-weight: 800; }
.skip {
  position: absolute; left: 12px; top: -80px; z-index: 50; padding: 10px 18px; border-radius: 999px;
  background: var(--btn-bg); color: var(--btn-fg); font-weight: 800; text-decoration: none; border: 2.5px solid var(--line);
}
.skip:focus { top: 12px; }
.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; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.muted { color: var(--text-2); }
.cap { font-size: .8125rem; line-height: 1.4; color: var(--text-2); }

/* ------------------------------------------------------------------ sticker primitives (mockup) */
.card {
  position: relative; background: var(--surface); border: 2.5px solid var(--line); border-radius: var(--r-card);
  box-shadow: 0 4px 0 var(--shadow); padding: 20px;
  transition: background-color .4s var(--sine), border-color .4s var(--sine);
}
.card > :last-child { margin-bottom: 0; }
.card-title { font-weight: 800; font-size: 1.0625rem; margin: 0 0 8px; }
.board {
  position: relative; background: var(--surface); border: 3px solid var(--line); border-radius: var(--r-board);
  box-shadow: 0 8px 0 var(--shadow); padding: clamp(24px, 4vw, 48px);
  transition: background-color .4s var(--sine), border-color .4s var(--sine);
}
.board.has-shelf { padding-bottom: calc(clamp(24px, 4vw, 48px) + 96px); }
.shelf { position: absolute; left: 0; right: 0; bottom: 0; height: 200px; overflow: hidden; border-radius: 0 0 25px 25px; pointer-events: none; }
.shelf::before { content: ""; position: absolute; left: 24px; right: 24px; bottom: 22px; border-top: 2px dashed var(--hair); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 12px 26px;
  border-radius: 999px; background: var(--btn-bg); color: var(--btn-fg); font: 800 1.0625rem/1.4 Nunito, sans-serif;
  border: 2.5px solid var(--line); box-shadow: 0 4px 0 var(--shadow); cursor: pointer; text-decoration: none; text-align: center;
  transition: transform .12s var(--ease-out), box-shadow .12s var(--ease-out), background-color .3s, color .3s;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--shadow); }
.btn.alt { background: var(--surface); color: var(--text); }
.btn svg { width: 20px; height: 20px; flex: none; }
.tbtn {
  min-height: 44px; padding: 0 12px; border: none; background: none; border-radius: 999px; color: var(--text-2);
  font: 700 .9375rem/1 Nunito, sans-serif; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; text-decoration: none;
}
.tbtn:hover { background: var(--hover); color: var(--text); }
.chip-btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 0 14px; border-radius: 999px;
  border: 2.5px solid var(--line); background: var(--surface); color: var(--text); font: 700 .875rem/1 Nunito, sans-serif;
  box-shadow: 0 3px 0 var(--shadow); cursor: pointer; transition: transform .12s var(--ease-out), box-shadow .12s var(--ease-out), background-color .3s;
}
.chip-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--shadow); }
.chip-btn[aria-pressed="true"] { background: var(--btn-bg); color: var(--btn-fg); }
.chip-btn svg { width: 18px; height: 18px; }
.seg { display: inline-flex; border: 2.5px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--surface); box-shadow: 0 3px 0 var(--shadow); }
.seg button { flex: 1; min-height: 40px; border: none; background: none; font: 700 .875rem/1 Nunito, sans-serif; color: var(--text); cursor: pointer; padding: 0 14px; }
.seg button + button { border-left: 2px solid var(--line); }
.seg button[aria-pressed="true"] { background: var(--btn-bg); color: var(--btn-fg); }
.seg button:focus-visible { outline-offset: -5px; border-radius: 999px; }
.tag { display: inline-block; padding: 4px 10px; border-radius: 999px; border: 2px solid currentColor; font: 700 .75rem/1 Nunito, sans-serif; vertical-align: middle; }
.tag.leaf { background: var(--leaf); color: #231A15; border-color: var(--line); }
.sec-h { font: 800 .8125rem/1.4 Nunito, sans-serif; letter-spacing: .4px; color: var(--text-2); margin: 0 0 8px; text-transform: uppercase; }

/* ------------------------------------------------------------------ header */
.site-h { position: relative; z-index: 20; }
.site-h .wrap { display: flex; align-items: center; gap: 16px; min-height: 76px; flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 900; font-size: 1.375rem; text-decoration: none; letter-spacing: -.3px; border-radius: 14px; }
.brand img { width: 46px; height: auto; display: block; }
[data-theme="night"] .brand img, [data-theme="night"] .keyline { filter: drop-shadow(1.5px 0 0 #F7D163) drop-shadow(-1.5px 0 0 #F7D163) drop-shadow(0 1.5px 0 #F7D163) drop-shadow(0 -1.5px 0 #F7D163); }
.nav { margin-left: auto; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.nav a { font-weight: 800; font-size: .9375rem; text-decoration: none; padding: 10px 12px; border-radius: 999px; min-height: 44px; display: inline-flex; align-items: center; }
.nav a:hover { background: var(--hover); }
.nav a[aria-current="page"] { background: var(--surface); border: 2px solid var(--line); padding: 8px 12px; }
.theme-seg button { min-height: 36px; padding: 0 12px; font-size: .8125rem; }
.nav-toggle { display: none; margin-left: auto; }
@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; }
  .nav { display: none; width: 100%; margin: 0; padding: 8px 0 12px; flex-direction: column; align-items: stretch; }
  .nav.open { display: flex; }
  .nav a { justify-content: flex-start; }
  .nav .theme-seg { align-self: flex-start; margin: 8px 12px 0; }
}

/* ------------------------------------------------------------------ hero */
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, 380px); gap: clamp(24px, 4vw, 56px); align-items: center; padding-top: clamp(16px, 4vw, 48px); padding-bottom: clamp(40px, 6vw, 80px); }
.hero h1 { font-size: clamp(2.25rem, 1.3rem + 3.6vw, 4rem); line-height: 1.05; margin-bottom: 18px; }
.hero .lede { font-size: clamp(1.125rem, 1rem + .5vw, 1.375rem); line-height: 1.5; color: var(--text-2); max-width: 36em; margin-bottom: 28px; }
.ctas { display: flex; flex-wrap: wrap; gap: 14px 16px; align-items: center; }
.cta-note { margin-top: 14px; font-size: .9375rem; color: var(--text-2); }
.facts { list-style: none; padding: 0; margin: 26px 0 0; display: flex; flex-wrap: wrap; gap: 10px; }
.facts li { font: 700 .875rem/1 Nunito, sans-serif; padding: 9px 14px; border-radius: 999px; border: 2px solid var(--line); background: var(--surface); }
.hero-cat { position: relative; width: 100%; max-width: 380px; justify-self: center; }
.cat-full { position: relative; }
.cat-full canvas { position: relative; z-index: 1; display: block; width: 100%; height: auto; aspect-ratio: 430 / 460; }
.cat-full::after { content: ""; position: absolute; left: 22%; width: 78%; top: 86.5%; height: 7%; border-radius: 50%; background: var(--shadow); opacity: .13; }
[data-theme="night"] .cat-full canvas, [data-theme="night"] .companion canvas { filter: drop-shadow(1.5px 0 0 #F7D163) drop-shadow(-1.5px 0 0 #F7D163) drop-shadow(0 1.5px 0 #F7D163) drop-shadow(0 -1.5px 0 #F7D163); }
[data-theme="night"] .cat-full::after { opacity: .5; }
.cat-full img.fallback { display: block; width: 100%; }
@media (max-width: 760px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .hero-cat { order: -1; max-width: 240px; }
}

/* companion: one canvas that moves from shelf to shelf */
.companion { position: absolute; bottom: 16px; left: 0; width: 200px; height: 150px; will-change: transform; }
.companion canvas { display: block; width: 200px; height: 150px; }
@media (max-width: 560px) { .companion { transform-origin: 0 100%; } }

/* ------------------------------------------------------------------ sections */
.sec { padding: clamp(28px, 5vw, 56px) 0; }
.sec-intro { max-width: 46em; margin-bottom: 28px; }
.sec-intro p { font-size: 1.125rem; color: var(--text-2); }
.grid { display: grid; gap: 20px; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.g3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); }
.g4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); }
.step-n { display: inline-grid; place-items: center; min-width: 34px; height: 28px; padding: 0 9px; border-radius: 999px; background: var(--btn-bg); color: var(--btn-fg); font-weight: 900; font-size: .875rem; margin-bottom: 10px; }
.card ul, .board ul { padding-left: 1.2em; margin: 0 0 1em; }
.card li, .board li { margin: 4px 0; }
.split { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: clamp(24px, 4vw, 48px); align-items: center; }
.split.rev { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); }
@media (max-width: 860px) { .split, .split.rev { grid-template-columns: 1fr; } }

/* screens: Sunny/Night pairs swap with the theme */
.shots { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.shot { margin: 0; width: min(100%, 240px); }
.shot img, .frame-img {
  display: block; width: 100%; border: 3px solid var(--line); border-radius: 22px; box-shadow: 0 6px 0 var(--shadow); background: var(--bg);
}
.shot figcaption { font: 700 .875rem/1.35 Nunito, sans-serif; color: var(--text-2); margin-top: 12px; text-align: center; }
.split .shots .shot { width: min(47%, 230px); }
.wide-shot { margin: 0; }
.wide-shot img { border-radius: 22px; }
.theme-img [data-for="night"] { display: none; }
[data-theme="night"] .theme-img [data-for="night"] { display: block; }
[data-theme="night"] .theme-img [data-for="sunny"] { display: none; }

/* problem list */
.pain { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.pain li { display: flex; gap: 12px; align-items: flex-start; }
.pain li::before { content: ""; flex: none; width: 14px; height: 14px; margin-top: .45em; border-radius: 50%; background: var(--leaf); border: 2.5px solid var(--line); }

/* friction picker demo */
.split > * { min-width: 0; }
.friction .seg { display: flex; flex-wrap: wrap; margin: 4px 0 14px; max-width: 100%; width: fit-content; border-radius: 26px; }
.friction .seg button { flex: 1 1 auto; }
.friction .seg button { min-height: 44px; font-size: .9375rem; padding: 0 18px; }
.friction output { display: block; min-height: 3em; font-size: 1.0625rem; }

/* stats table */
.tbl { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.tbl th, .tbl td { text-align: left; padding: 10px 8px; border-bottom: 2px dashed var(--hair); vertical-align: top; }
.tbl th { font-weight: 800; }
.tbl-scroll { overflow-x: auto; }

/* video */
.video-box { position: relative; border: 3px solid var(--line); border-radius: 24px; overflow: hidden; box-shadow: 0 8px 0 var(--shadow); background: #231A15; aspect-ratio: 16 / 9; }
.video-box video { display: block; width: 100%; height: 100%; }

/* platforms */
.plat h3 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.plat .btn { margin-top: 6px; }

/* downloads */
.dl h3, .doc .dl h3 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 0; }
.dl .btn { margin-top: 2px; }
.dl code.hash { overflow-wrap: anywhere; word-break: break-all; font-size: .75rem; }
.dl-grid { margin-bottom: 16px; }
.doc .dl-grid .card { margin: 0; }

/* FAQ */
.faq details { background: var(--surface); border: 2.5px solid var(--line); border-radius: var(--r-card); box-shadow: 0 4px 0 var(--shadow); margin-bottom: 14px; }
.faq summary { cursor: pointer; list-style: none; padding: 16px 52px 16px 20px; font-weight: 800; font-size: 1.0625rem; position: relative; border-radius: 18px; min-height: 44px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; position: absolute; right: 22px; top: 50%; width: 10px; height: 10px; margin-top: -7px; border-right: 3px solid var(--text); border-bottom: 3px solid var(--text); transform: rotate(45deg); transition: transform .3s var(--ease-out); }
.faq details[open] summary::after { transform: rotate(225deg); margin-top: -2px; }
.faq .ans { padding: 0 20px 18px; }
.faq .ans > :last-child { margin-bottom: 0; }

/* final CTA */
.final { text-align: center; }
.final .ctas { justify-content: center; }
.final p { max-width: 36em; margin-left: auto; margin-right: auto; }

/* ------------------------------------------------------------------ footer */
.site-f { padding: 40px 0 56px; margin-top: 24px; border-top: 2px dashed var(--hair); font-size: .9375rem; }
.site-f .wrap { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 24px; }
.site-f h2 { font-size: 1rem; font-weight: 800; margin-bottom: 8px; }
.site-f ul { list-style: none; padding: 0; margin: 0; }
.site-f li { margin: 6px 0; }
.site-f a { display: inline-block; padding: 2px 0; }
.disclaimer { font-weight: 800; }

/* ------------------------------------------------------------------ docs */
.docs .wrap { max-width: 1320px; }
.docs-grid > * { min-width: 0; }
.docs-grid { display: grid; grid-template-columns: 240px minmax(0, 1fr) 210px; gap: 36px; align-items: start; padding-top: 12px; padding-bottom: 40px; }
.side { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow: auto; padding: 16px; }
.side ul { list-style: none; margin: 0 0 14px; padding: 0; }
.side a { display: block; padding: 8px 12px; border-radius: 12px; text-decoration: none; font-weight: 700; }
.side a:hover { background: var(--hover); }
.side a[aria-current="page"] { background: var(--btn-bg); color: var(--btn-fg); }
.side-toggle { display: none; }
.toc { position: sticky; top: 16px; font-size: .9375rem; }
.toc ul { list-style: none; margin: 0; padding: 0 0 0 12px; border-left: 2px dashed var(--hair); }
.toc a { display: block; padding: 5px 8px; text-decoration: none; color: var(--text-2); border-radius: 8px; }
.toc a:hover, .toc a.on { color: var(--text); background: var(--hover); }
.toc-m { display: none; margin-bottom: 20px; }
.doc { min-width: 0; }
.doc h1 { font-size: clamp(2rem, 1.4rem + 2.4vw, 3rem); margin-bottom: 12px; }
.doc .lede { font-size: 1.1875rem; color: var(--text-2); }
.doc h2 { font-size: clamp(1.4rem, 1.1rem + 1vw, 1.75rem); margin-top: 2em; padding-top: .2em; }
.doc h3 { margin-top: 1.6em; }
.doc ol, .doc ul { padding-left: 1.4em; }
.doc li { margin: 6px 0; }
.doc li > ol, .doc li > ul { margin-top: 6px; }
.doc .card { margin: 18px 0; }
.doc table { width: 100%; border-collapse: collapse; margin: 12px 0 20px; font-variant-numeric: tabular-nums; }
.doc th, .doc td { text-align: left; padding: 10px 10px; border-bottom: 2px dashed var(--hair); vertical-align: top; }
.doc th { font-weight: 800; }
.doc .tbl-scroll { margin: 12px 0 20px; }
.doc .tbl-scroll table { margin: 0; min-width: 560px; }
.note { border-left: 6px solid var(--leaf); }
.note.warn { border-left-color: var(--sun-deep); }
.note .card-title { display: flex; gap: 8px; align-items: center; }
code, kbd, pre { font-family: ui-monospace, "Cascadia Code", Consolas, "SFMono-Regular", Menlo, monospace; font-size: .9em; }
:not(pre) > code { background: var(--code-bg); border: 1.5px solid var(--hair); padding: 1px 6px; border-radius: 7px; overflow-wrap: anywhere; }
kbd { background: var(--surface); border: 2px solid var(--line); border-bottom-width: 3px; padding: 0 6px; border-radius: 7px; font-size: .85em; }
.code { position: relative; margin: 14px 0 20px; }
.code pre {
  margin: 0; background: var(--code-bg); border: 2.5px solid var(--line); border-radius: 16px; box-shadow: 0 4px 0 var(--shadow);
  padding: 16px 18px; padding-right: 88px; overflow-x: auto; line-height: 1.55; white-space: pre;
}
.copy { position: absolute; top: 9px; right: 9px; min-height: 34px; padding: 0 12px; font-size: .8125rem; }
/* prev/next: the .card is a <span>, so it must be made a block or its border/radius render as broken inline fragments */
.pn { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 48px; clear: both; }
.pn a { display: flex; min-width: 0; text-decoration: none; border-radius: var(--r-card); }
.pn a .card { display: flex; flex-direction: column; justify-content: center; gap: 2px; width: 100%; min-height: 76px; padding: 16px 20px; overflow-wrap: anywhere; }
.pn a:hover .card { background: var(--inset); }
.pn a:active .card { transform: translateY(3px); box-shadow: 0 1px 0 var(--shadow); }
.pn .next { grid-column: 2; text-align: right; }
@media (max-width: 560px) {
  .pn { grid-template-columns: minmax(0, 1fr); }
  .pn .next { grid-column: 1; }
}
.pn .k { display: block; font-size: .8125rem; font-weight: 700; color: var(--text-2); }
.pn .t { display: block; font-weight: 800; font-size: 1.0625rem; }
.search { position: relative; margin-bottom: 14px; }
.search input {
  width: 100%; min-height: 44px; padding: 8px 14px; border-radius: 999px; border: 2.5px solid var(--line); background: var(--surface);
  color: var(--text); font: 600 .9375rem Nunito, sans-serif;
}
.search input::placeholder { color: var(--text-2); opacity: 1; }
.search-res { list-style: none; margin: 8px 0 0; padding: 0; }
.search-res a { padding: 8px 12px; }
.search-res .s { display: block; font-weight: 400; font-size: .8125rem; color: var(--text-2); }
.search-res .none { padding: 8px 12px; font-size: .875rem; color: var(--text-2); }
.doc figure { margin: 20px 0; }
.doc figure .shot { margin: 0 auto; }
.src { font-size: .8125rem; color: var(--text-2); }
@media (max-width: 1180px) {
  .docs-grid { grid-template-columns: 220px minmax(0, 1fr); }
  .toc { display: none; }
  .toc-m { display: block; }
}
@media (max-width: 860px) {
  .docs-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .side { position: static; max-height: none; padding: 12px; }
  .side-toggle { display: flex; width: 100%; justify-content: space-between; }
  .side .side-body { display: none; margin-top: 10px; }
  .side.open .side-body { display: block; }
}
.toc-m summary { cursor: pointer; font-weight: 800; min-height: 44px; display: flex; align-items: center; }
.toc-m ul { list-style: none; padding: 0 0 0 4px; margin: 6px 0 0; }
.toc-m a { display: block; padding: 6px 4px; }

/* 404 */
.lost { text-align: center; padding: 40px 0 80px; }
.lost .hero-cat { margin: 0 auto 20px; max-width: 240px; }

/* ------------------------------------------------------------------ motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 1ms !important; animation-duration: 1ms !important; scroll-behavior: auto !important; }
}
@media (forced-colors: active) {
  .card, .board, .btn, .seg, .chip-btn { border-color: CanvasText; }
}
@media print {
  .site-h .nav, .nav-toggle, .companion, .shelf, .side, .toc, .copy { display: none !important; }
  .docs-grid { display: block; }
}
