/* Studio Bebecito — concept kit.
   Layout: one full-bleed scene per page, quiet mono chrome pinned to the four corners. */
:root {
  --paper: #f3f3f1;      /* cool off-white, Amira's gallery white */
  --ink: #0b0b0c;        /* Kacper's black */
  --mute: #86868c;       /* tick marks, numbers */
  --line: rgba(11, 11, 12, .14);
  --pink: #ff5fa2;       /* bubblegum, concept C only */
  --bg: var(--paper);
  --fg: var(--ink);

  --display: "Bricolage Grotesque", "Helvetica Neue", Arial, sans-serif;
  --sans: "Geist", "Helvetica Neue", Arial, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --serif: "Instrument Serif", "Times New Roman", serif;

  --gut: max(16px, env(safe-area-inset-left, 0px));
  --gutR: max(16px, env(safe-area-inset-right, 0px));
  --edge: clamp(16px, 2.2vw, 28px);
  color-scheme: light;
}
.bb-dark { --bg: var(--ink); --fg: var(--paper); --mute: #77777d; --line: rgba(243, 243, 241, .16); color-scheme: dark; }

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font: 400 15px/1.45 var(--sans);
  overflow: hidden; overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
  transition: background-color .6s ease, color .6s ease;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 1.5px solid currentColor; outline-offset: 3px; border-radius: 2px; }

/* ---------- chrome ---------- */
.bb-mono { font: 500 11px/1.3 var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.bb-corner { position: fixed; z-index: 40; display: flex; gap: 18px; align-items: center; pointer-events: auto; }
.bb-tl { top: calc(var(--edge) + env(safe-area-inset-top, 0px)); left: calc(var(--edge) + env(safe-area-inset-left, 0px)); }
.bb-tr { top: calc(var(--edge) + env(safe-area-inset-top, 0px)); right: calc(var(--edge) + env(safe-area-inset-right, 0px)); }
.bb-bl { bottom: calc(var(--edge) + env(safe-area-inset-bottom, 0px)); left: calc(var(--edge) + env(safe-area-inset-left, 0px)); }
.bb-br { bottom: calc(var(--edge) + env(safe-area-inset-bottom, 0px)); right: calc(var(--edge) + env(safe-area-inset-right, 0px)); }
.bb-corner a, .bb-corner button { text-decoration: none; }
.bb-corner a:hover, .bb-corner button:hover { opacity: .55; }
.bb-mark { font: 700 15px/1 var(--display); letter-spacing: -.02em; text-transform: none; }
.bb-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; display: inline-block; animation: bb-pulse 1.6s ease-in-out infinite; }
@keyframes bb-pulse { 50% { transform: scale(.45); opacity: .4; } }

.bb-badge {
  position: fixed; z-index: 41; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--edge) + env(safe-area-inset-bottom, 0px));
  padding: 7px 12px 7px 10px; border-radius: 99px;
  background: var(--fg); color: var(--bg); text-decoration: none; white-space: nowrap;
}
.bb-badge:hover { opacity: .8; }

/* ---------- gooey morph text ---------- */
.bb-morph { display: inline-grid; vertical-align: baseline; }
.bb-morph > span { grid-area: 1 / 1; white-space: nowrap; }
.bb-morph.bb-plain > span { opacity: 0; filter: blur(.35em); transition: opacity .55s ease, filter .55s ease; }
.bb-morph.bb-plain > span.on { opacity: 1; filter: blur(0); }
.bb-morph.bb-fixed { display: inline-block; position: relative; height: 1.3em; vertical-align: top; }
.bb-morph.bb-fixed > span { position: absolute; right: 0; top: 0; line-height: 1.3em; }

/* ---------- grain ---------- */
.bb-grain {
  position: fixed; inset: -80px; z-index: 60; pointer-events: none; opacity: .045;
  background-size: 160px 160px; will-change: transform;
  animation: bb-grain .9s steps(5) infinite;
}
.bb-dark .bb-grain { opacity: .06; }
@keyframes bb-grain { 0%{transform:translate(0,0)} 20%{transform:translate(-37px,23px)} 40%{transform:translate(29px,-41px)} 60%{transform:translate(-53px,-17px)} 80%{transform:translate(43px,31px)} 100%{transform:translate(0,0)} }

/* ---------- case-study sheet ---------- */
.bb-sheet-scrim { position: fixed; inset: 0; z-index: 70; background: rgba(11,11,12,.25); opacity: 0; pointer-events: none; transition: opacity .5s; }
.bb-sheet {
  position: fixed; z-index: 71; top: 0; right: 0; bottom: 0; width: min(580px, 100%);
  background: var(--paper); color: var(--ink);
  transform: translateX(104%); transition: transform .7s cubic-bezier(.7, 0, .2, 1);
  overflow-y: auto; overscroll-behavior: contain;
  padding: calc(var(--edge) + env(safe-area-inset-top, 0px)) var(--gutR) calc(40px + env(safe-area-inset-bottom, 0px)) max(var(--gut), 28px);
  display: grid; gap: 28px; align-content: start;
}
.bb-sheet-open .bb-sheet { transform: none; }
.bb-sheet-open .bb-sheet-scrim { opacity: 1; pointer-events: auto; }
.bb-sheet-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.bb-sheet-nav { display: flex; gap: 16px; }
.bb-sheet h2 { margin: 0; font: 800 clamp(40px, 7vw, 76px)/.92 var(--display); letter-spacing: -.04em; text-wrap: balance; }
.bb-sheet .bb-what { font: italic 400 26px/1.15 var(--serif); margin: -12px 0 0; }
.bb-meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; border-top: 1px solid rgba(11,11,12,.14); padding-top: 14px; }
.bb-meta dt { color: #86868c; margin-bottom: 4px; }
.bb-meta dd { margin: 0; font-size: 14px; }
.bb-sheet p { margin: 0; max-width: 60ch; font-size: 16px; }
.bb-plates { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.bb-plate { aspect-ratio: 4 / 5; max-width: 100%; border-radius: 2px; display: flex; align-items: flex-end; padding: 10px; color: rgba(243,243,241,.8);
  background: radial-gradient(120% 90% at 30% 20%, #3a3a3e, #0b0b0c 70%); }
.bb-plate:first-child { grid-column: 1 / -1; aspect-ratio: 16 / 10; }
.bb-plate:nth-child(3) { background: radial-gradient(120% 90% at 70% 30%, #d9d9d6, #8f8f93 80%); color: #0b0b0c; }

/* ---------- helpers ---------- */
.bb-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.bb-toast { position: fixed; z-index: 90; left: 50%; top: calc(var(--edge) + env(safe-area-inset-top, 0px) + 36px); transform: translate(-50%, -8px);
  background: var(--fg); color: var(--bg); padding: 7px 12px; border-radius: 99px; opacity: 0; transition: .3s; pointer-events: none; }
.bb-toast.on { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 640px) {
  .bb-hide-sm { display: none !important; }
  .bb-corner { gap: 12px; }
  .bb-badge { bottom: calc(var(--edge) + env(safe-area-inset-bottom, 0px) + 30px); }
}
@media (prefers-reduced-motion: reduce) {
  .bb-grain, .bb-dot { animation: none; }
  .bb-sheet { transition-duration: .01s; }
}
