/* Twisted Bears landing page.
   Principles: one typeface, one hairline, one accent detail per bear, strict columns,
   and no effect that competes with the artwork. Tokens are a starting point, not an
   approved brand system. */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/assets/fonts/bricolage-latin.woff2") format("woff2");
  font-weight: 300 800; font-style: normal; font-display: swap;
}

:root {
  --bg: #0a0a0a;
  --plate: #131313;
  --text: #efece6;        /* warm off-white, close to the BEARS lettering */
  --muted: #8f8b85;
  --line: rgba(239, 236, 230, .12);
  --accent: #9a6238;
  --gutter: clamp(20px, 5vw, 40px);
  --max: 1160px;
  --header-h: 64px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --font: "Bricolage Grotesque", -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); background: var(--bg); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 1rem/1.6 var(--font); font-feature-settings: "kern", "liga"; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
main { overflow-x: clip; }
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; }
button, input, textarea { font: inherit; color: inherit; }
::selection { background: var(--text); color: var(--bg); }
:focus-visible { outline: 2px solid var(--text); outline-offset: 4px; border-radius: 4px; }
.num { font-variant-numeric: tabular-nums; }

.sr-only, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: fixed; z-index: 200; top: 8px; left: 8px; background: var(--text); color: var(--bg); padding: 10px 14px; border-radius: 8px; }
.wrap { width: min(100% - var(--gutter) * 2, var(--max)); margin-inline: auto; }

/* ---------- reveal: one quiet fade ---------- */
[data-reveal] { transition: opacity .8s var(--ease), transform .8s var(--ease); }
.js [data-reveal]:not(.in) { opacity: 0; transform: translateY(12px); }

/* ---------- button ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; height: 48px; padding: 0 30px; border: 0; border-radius: 999px; background: var(--text); color: var(--bg); text-decoration: none; font-weight: 600; font-size: .95rem; cursor: pointer; transition: background-color .2s; }
.btn:hover { background: #fff; }

/* ---------- header: nav left, logo centred, contact right ---------- */
.site-header { position: fixed; inset: 0 0 auto; z-index: 100; border-bottom: 1px solid transparent; transition: background-color .3s, border-color .3s; }
.site-header.scrolled, .site-header.menu-open { background: rgba(10, 10, 10, .86); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom-color: var(--line); }
.bar { width: min(100% - var(--gutter) * 2, var(--max)); height: var(--header-h); margin-inline: auto; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; }
.brand { justify-self: center; display: block; }
.brand img { height: 48px; width: auto; transition: opacity .2s; }
.brand:hover img { opacity: .8; }
.nav ul { display: flex; gap: 32px; }
.nav-right { justify-self: end; }
.nav a { color: var(--muted); font-size: .9rem; text-decoration: none; padding: 8px 0; transition: color .2s; }
.nav a:hover, .nav a[aria-current] { color: var(--text); }
.menu-btn, .menu { display: none; }

@media (max-width: 760px) {
  :root { --header-h: 56px; }
  .nav { display: none; }
  .brand { grid-column: 2; }
  .brand img { height: 42px; }
  .menu-btn { display: block; grid-column: 3; justify-self: end; background: none; border: 0; padding: 10px 0 10px 16px; font-size: .9rem; cursor: pointer; }
  .menu { position: absolute; top: var(--header-h); left: 0; right: 0; background: rgba(10, 10, 10, .97); border-bottom: 1px solid var(--line); }
  .js .menu-open .menu { display: block; }
  .no-js .menu { display: block; position: static; }
  .no-js .menu-btn { display: none; }
  .menu ul { padding: 0 var(--gutter) 8px; }
  .menu li + li { border-top: 1px solid var(--line); }
  .menu a { display: block; padding: 18px 0; font-size: 1.35rem; font-weight: 500; letter-spacing: -.02em; text-decoration: none; }
}

/* ---------- loading + error ---------- */
.media { position: relative; }
.media img { transition: opacity .5s ease; }
.js .media:not(.is-loaded):not(.is-error) img { opacity: 0; }
.media-error { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: .85rem; background: var(--plate); border-radius: inherit; }

/* ---------- hero: Teddy, and nothing else ---------- */
.hero { position: relative; isolation: isolate; min-height: 100svh; display: grid; align-content: center; justify-items: center; row-gap: clamp(20px, 3.5svh, 36px); padding: calc(var(--header-h) + 8px) var(--gutter) 72px; }
.hero::before { content: ""; position: absolute; z-index: -1; left: 50%; top: 52%; width: min(120vw, 1000px); aspect-ratio: 1; transform: translate(-50%, -50%); background: radial-gradient(closest-side, rgba(255, 255, 255, .06), transparent 70%); pointer-events: none; }
.teddy { position: relative; width: min(88vw, 64svh, 640px); aspect-ratio: 1; touch-action: manipulation; }
.teddy-base { width: 100%; filter: drop-shadow(0 30px 40px rgba(0, 0, 0, .6)); user-select: none; -webkit-user-drag: none; }
.eye { position: absolute; overflow: hidden; -webkit-mask-image: var(--mask); mask-image: var(--mask); -webkit-mask-size: 100% 100%; mask-size: 100% 100%; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; pointer-events: none; transition: opacity .5s ease; }
.js .teddy:not(.is-loaded) .eye { opacity: 0; }
.lid { position: absolute; inset: -2px; border-radius: 0 0 50% 50% / 0 0 38% 38%; box-shadow: 0 2px 4px rgba(0, 0, 0, .35); background: linear-gradient(#262425, #1e1c1d); transform: scaleY(0); transform-origin: top; pointer-events: none; }
.eye.blink .lid { animation: blink .2s ease-in-out; }
@keyframes blink { 45% { transform: scaleY(1.02); } 100% { transform: scaleY(0); } }
.teddy.poke { animation: poke .45s var(--ease); }
@keyframes poke { 35% { transform: translateY(3px) scale(1.012, .988); } }
.iris { position: absolute; height: auto; max-width: none; transform: translate(var(--dx, 0px), var(--dy, 0px)); transition: transform .16s var(--ease); will-change: transform; }
.hero-line { max-width: 22em; text-align: center; color: var(--muted); font-size: clamp(.95rem, 1.7vw, 1.1rem); letter-spacing: -.01em; text-wrap: balance; transition: opacity 1.2s .5s var(--ease); }
.js .hero:not(.in) .hero-line { opacity: 0; }
.hero-cue { position: absolute; left: 50%; bottom: 24px; display: grid; place-items: center; width: 44px; height: 44px; margin-left: -22px; color: var(--muted); transition: color .2s, opacity 1s 1.4s; }
.hero-cue:hover { color: var(--text); }
.hero-cue svg { animation: cue 2.6s var(--ease) infinite; }
.js .hero:not(.in) .hero-cue { opacity: 0; }
@keyframes cue { 0%, 100% { transform: translateY(-2px); } 50% { transform: translateY(3px); } }

/* ---------- sections ---------- */
.section { padding: clamp(72px, 11vw, 144px) 0 0; }
.sec-bar { display: flex; gap: 20px; padding-top: 14px; border-top: 1px solid var(--line); margin-bottom: clamp(32px, 5vw, 56px); color: var(--muted); font-size: .75rem; letter-spacing: .14em; text-transform: uppercase; }
.sec-bar .num { color: var(--text); }
h1, h2 { font-size: clamp(2rem, 5.2vw, 3.5rem); font-weight: 600; letter-spacing: -.04em; line-height: 1.02; text-wrap: balance; }
.lead { margin-top: 16px; max-width: 30em; color: var(--muted); font-size: 1.0625rem; text-wrap: pretty; }
.head { max-width: 40rem; margin-bottom: clamp(32px, 5vw, 56px); }

/* ---------- the cast: tabs above the bears ---------- */
.tabs-wrap { margin-bottom: clamp(36px, 6vw, 72px); }
.tabs { --accent: #9a6238; position: relative; display: flex; gap: clamp(24px, 3.4vw, 44px); overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); scroll-padding-inline: var(--gutter); border-bottom: 1px solid var(--line); }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: none; scroll-snap-align: center; display: flex; align-items: flex-start; gap: 6px; padding: 14px 0 16px; background: none; border: 0; cursor: pointer; color: var(--muted); font-size: clamp(1.15rem, 1.9vw, 1.55rem); font-weight: 500; letter-spacing: -.025em; line-height: 1.2; transition: color .25s; }
.tab .num { margin-top: .35em; font-size: .6rem; letter-spacing: .1em; opacity: .65; }
.tab:hover, .tab[aria-selected="true"] { color: var(--text); }
.ink { position: absolute; left: 0; bottom: -1px; height: 2px; width: var(--w, 0px); transform: translateX(var(--x, 0px)); background: var(--accent); transition: transform .5s var(--ease), width .5s var(--ease), background-color .5s; }
.no-js .tabs-wrap { display: none; }
.no-js .stage { display: grid; gap: 96px; }
@media (min-width: 900px) {
  .tabs { margin-inline: 0; padding-inline: 0; overflow: visible; justify-content: space-between; }
}

.stage { touch-action: pan-y; }
.panel { display: grid; gap: 28px; justify-items: center; text-align: center; }
.panel[hidden] { display: none; }
.panel-art { order: -1; position: relative; width: min(100%, 500px); aspect-ratio: 1; }
.panel-art::before { content: ""; position: absolute; z-index: -1; inset: 8% 6% 0; background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 16%, transparent), transparent 75%); transition: background .5s; }
.panel-art::after { content: ""; position: absolute; z-index: -1; left: 14%; right: 14%; bottom: 3%; height: 7%; background: radial-gradient(closest-side, rgba(0, 0, 0, .6), transparent); filter: blur(4px); }
.panel-art img { width: 100%; }
.trait { display: inline-flex; align-items: center; gap: 10px; color: var(--muted); font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; }
.trait i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.panel-line { margin-top: 14px; font-size: clamp(1.4rem, 5vw, 2.4rem); font-weight: 600; letter-spacing: -.035em; line-height: 1.08; text-wrap: balance; }
.panel-name { font-size: clamp(2.2rem, 8vw, 3.25rem); font-weight: 600; letter-spacing: -.045em; line-height: .95; }
.panel-bio { margin-top: 16px; max-width: 26em; color: var(--muted); text-wrap: pretty; }
.count { margin-top: 28px; padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: .75rem; letter-spacing: .14em; font-variant-numeric: tabular-nums; }
.count span { color: var(--text); }
.panel:not([hidden]) { animation: fade .5s ease both; }
@keyframes fade { from { opacity: 0; } }

@media (min-width: 900px) {
  .panel { grid-template-columns: minmax(0, 1fr) minmax(0, 520px) minmax(0, 1fr); gap: clamp(32px, 5vw, 80px); align-items: center; }
  .panel-art { order: 0; width: 100%; }
  .panel-left { justify-self: end; text-align: right; max-width: 20rem; }
  .panel-right { justify-self: start; text-align: left; max-width: 20rem; }
  .panel-line { font-size: clamp(1.8rem, 2.9vw, 2.6rem); }
  .count { margin-top: 36px; }
}

/* ---------- film (vertical episodes) ---------- */
.head-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.ep-nav { display: none; gap: 8px; margin-bottom: clamp(32px, 5vw, 56px); }
.ep-nav button { width: 44px; height: 44px; display: grid; place-items: center; background: none; border: 1px solid var(--line); border-radius: 50%; cursor: pointer; transition: border-color .2s, background-color .2s; }
.ep-nav button:hover { border-color: var(--text); background: rgba(239, 236, 230, .06); }
.eps-scroll { overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding-inline: var(--gutter); scroll-padding-inline: var(--gutter); }
.eps-scroll::-webkit-scrollbar { display: none; }
.eps { display: flex; gap: 14px; width: max-content; }
.ep { flex: none; width: clamp(168px, 56vw, 232px); scroll-snap-align: start; }
.ep-card { position: relative; display: block; width: 100%; aspect-ratio: 9 / 16; padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: linear-gradient(#181818, #101010); color: var(--text); }
button.ep-card { cursor: pointer; transition: border-color .25s; }
button.ep-card:hover { border-color: rgba(239, 236, 230, .4); }
.ep-card img { width: 100%; height: 100%; object-fit: cover; }
.ep-card .num { position: absolute; left: 12px; top: 10px; z-index: 1; font-size: .72rem; letter-spacing: .1em; }
.ep-play { position: absolute; inset: 0; display: grid; place-items: center; transition: transform .35s var(--ease); }
button.ep-card:hover .ep-play { transform: scale(1.1); }
.is-soon { display: grid; place-items: center; align-content: center; gap: 6px; color: var(--muted); }
.is-soon .num { color: var(--muted); }
.is-soon small { font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; }
@media (min-width: 900px) {
  .ep-nav { display: flex; }
  .eps-scroll { padding-inline: max(var(--gutter), calc((100vw - var(--max)) / 2)); scroll-padding-inline: max(var(--gutter), calc((100vw - var(--max)) / 2)); }
}

/* phone-shaped player */
.player { width: 100vw; height: 100dvh; max-width: none; max-height: none; padding: 0; border: 0; background: transparent; color: var(--text); }
.player::backdrop { background: rgba(5, 5, 5, .94); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.player[open] { display: grid; place-content: center; justify-items: center; gap: 14px; }
.player-frame { height: min(80svh, 820px); aspect-ratio: 9 / 16; max-width: 92vw; overflow: hidden; border-radius: 16px; background: #000; border: 1px solid var(--line); }
.player-frame video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.player-bar { display: flex; align-items: center; justify-content: space-between; width: 100%; max-width: min(92vw, calc(min(80svh, 820px) * 9 / 16)); }
.player-title { font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.player-step, .player-close { width: 44px; height: 44px; display: grid; place-items: center; background: none; border: 1px solid var(--line); border-radius: 50%; cursor: pointer; transition: border-color .2s; }
.player-step:hover, .player-close:hover { border-color: var(--text); }
.player-close { position: fixed; top: 16px; right: 16px; }

/* ---------- signup ---------- */
.signup { max-width: 30rem; margin: calc(-1 * clamp(8px, 2vw, 24px)) 0 clamp(40px, 6vw, 64px); }
.signup-label { display: block; margin-bottom: 12px; color: var(--muted); font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; }
.signup-row { display: flex; gap: 10px; flex-wrap: wrap; }
.signup input[type="email"] { flex: 1 1 220px; min-width: 0; height: 48px; padding: 0 22px; background: none; border: 1px solid var(--line); border-radius: 999px; font-size: 1rem; transition: border-color .2s; }
.signup input[type="email"]:focus-visible { outline: none; border-color: var(--text); }
.signup input[aria-invalid="true"] { border-color: #d98a7a; }
.consent { margin-top: 12px; color: var(--muted); font-size: .8rem; line-height: 1.5; max-width: 30em; }
.consent a { text-underline-offset: 3px; }
.signup .status { margin-top: 12px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

/* ---------- merch: eight blurred tiles, 4 x 2 ---------- */
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(8px, 1.6vw, 16px); }
.tile { aspect-ratio: 1; overflow: hidden; border-radius: 6px; background: var(--plate); border: 1px solid var(--line); }
.tile img { width: 100%; height: 100%; object-fit: cover; }
.tile .num { position: absolute; left: 12px; bottom: 10px; font-size: .7rem; letter-spacing: .1em; opacity: .8; }
@media (min-width: 760px) { .grid { grid-template-columns: repeat(4, 1fr); } }

/* ---------- footer: room to breathe ---------- */
.site-footer { margin-top: clamp(80px, 12vw, 160px); padding: clamp(120px, 20vw, 280px) var(--gutter) calc(clamp(40px, 5vw, 64px) + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); text-align: center; }
.slogan { max-width: 20em; margin-inline: auto; font-size: clamp(1.2rem, 2.6vw, 1.75rem); font-weight: 500; letter-spacing: -.025em; line-height: 1.25; text-wrap: balance; }
.foot-nav { display: flex; justify-content: center; gap: 32px; margin-top: clamp(96px, 14vw, 200px); font-size: .85rem; color: var(--muted); }
.foot-nav a, .social a { text-decoration: none; transition: color .2s; }
.foot-nav a:hover, .social a:hover { color: var(--text); }
.social { display: flex; justify-content: center; gap: 28px; margin-top: 18px; font-size: .85rem; color: var(--muted); }
.blvck { display: inline-block; margin-top: clamp(40px, 6vw, 72px); opacity: .55; transition: opacity .25s; }
.blvck:hover { opacity: 1; }
.blvck img { width: 104px; height: auto; }
.credit { margin-top: 20px; color: var(--muted); font-size: .75rem; letter-spacing: .04em; }
@media (min-width: 700px) { .slogan { max-width: none; white-space: nowrap; } }

/* ---------- privacy / prose ---------- */
.prose-body { max-width: 40rem; }
.prose-body h2 { margin-top: 40px; font-size: 1.15rem; letter-spacing: -.02em; line-height: 1.2; }
.prose-body p { margin-top: 12px; color: var(--muted); text-wrap: pretty; }
.prose-body .lead { margin-top: 16px; }
.prose-body a { color: var(--text); text-underline-offset: 3px; }

/* ---------- contact ---------- */
.contact { padding-top: calc(var(--header-h) + clamp(40px, 7vw, 88px)); }
.contact-grid { display: grid; gap: 48px; }
.contact .head { margin-bottom: 0; }
.mail { margin-top: 24px; }
.mail a { text-underline-offset: 4px; }
.form { display: grid; gap: 28px; }
.form label { display: grid; gap: 6px; }
.form label span { color: var(--muted); font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; }
.form input, .form textarea { width: 100%; padding: 10px 0 12px; background: none; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; font-size: 1.0625rem; transition: border-color .2s; resize: vertical; }
.form input:focus-visible, .form textarea:focus-visible { outline: none; border-bottom-color: var(--text); }
.form [aria-invalid="true"] { border-bottom-color: #d98a7a; }
.form-row { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.status { font-size: .875rem; color: var(--muted); max-width: 26em; }
.status.is-error { color: #d98a7a; }
@media (min-width: 900px) { .contact-grid { grid-template-columns: 1fr 1.1fr; column-gap: clamp(48px, 8vw, 128px); } }


/* ---------- the swat: Teddy's raised paw (a small cut-out overlay, loaded only when the fly appears) ---------- */
.smash-arm { position: absolute; z-index: 3; opacity: 0; pointer-events: none; will-change: transform, opacity; user-select: none; -webkit-user-drag: none; }
.smash-arm.slam { animation: slam .62s linear both; }
/* in fast (impact at ~150ms), then straight back out: lift, tuck, gone. The splat stays behind (below). */
@keyframes slam {
  0%   { opacity: 0; transform: translate(-26%, -55%) rotate(-40deg) scale(.8); animation-timing-function: linear; }
  4%   { opacity: 1; transform: translate(-25%, -53%) rotate(-39deg) scale(.8); animation-timing-function: cubic-bezier(.3, 0, .6, 1); }
  14%  { opacity: 1; transform: translate(-20%, -46%) rotate(-34deg) scale(.86); animation-timing-function: cubic-bezier(.5, 0, 1, .6); }
  25%  { opacity: 1; transform: translate(2%, 3%) rotate(4deg) scale(1.07); animation-timing-function: cubic-bezier(.2, .7, .3, 1); }
  31%  { opacity: 1; transform: none; animation-timing-function: cubic-bezier(.3, 0, .4, 1); }
  52%  { opacity: 1; transform: translate(1%, -10%) rotate(-9deg) scale(1.03); animation-timing-function: cubic-bezier(.6, 0, .9, .5); }
  90%  { opacity: 1; transform: translate(12%, 9%) rotate(22deg) scale(.58); animation-timing-function: cubic-bezier(.5, 0, 1, 1); }
  100% { opacity: 0; transform: translate(18%, 14%) rotate(34deg) scale(.16); }
}
/* the smashed fly stays where the paw hit, then goes after 2 seconds */
.smash-fly { position: absolute; z-index: 4; opacity: 0; pointer-events: none; user-select: none; -webkit-user-drag: none; }
.smash-fly.show { animation: splat 2.3s linear both; }
@keyframes splat {
  0%   { opacity: 0; transform: scale(.6); animation-timing-function: cubic-bezier(.2, .8, .3, 1.3); }
  4%   { opacity: 1; transform: scale(1.06); animation-timing-function: ease-out; }
  8%   { opacity: 1; transform: scale(1); }
  87%  { opacity: 1; transform: scale(1); animation-timing-function: ease-in; }
  100% { opacity: 0; transform: scale(.97); }
}

/* ---------- the fly ---------- */
.fly { position: fixed; left: 0; top: 0; z-index: 120; width: 76px; height: 76px; pointer-events: none; will-change: transform; filter: drop-shadow(0 6px 8px rgba(0, 0, 0, .45)); }
.fly-in { position: absolute; inset: 0; }
.fly-in img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; user-select: none; -webkit-user-drag: none; }
.fly-far { transform-origin: 44.33% 33%; animation: flap-far .055s ease-in-out infinite alternate; }
.fly-near { transform-origin: 52.33% 46.67%; animation: flap-near .055s ease-in-out infinite alternate; }
@keyframes flap-far { from { transform: rotate(-17deg) scaleY(1.04); } to { transform: rotate(13deg) scaleY(.9); } }
@keyframes flap-near { from { transform: rotate(16deg) scaleY(1.04); } to { transform: rotate(-12deg) scaleY(.9); } }
@media (hover: none), (max-width: 899px) { .fly { display: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
