/* social.bakers.studio. The Bakers document language, same chrome as the project hubs:
   #171717, system sans 14/24, white headings, grey body, no rules or boxes, 8px unit, filled grey pills.
   The films are the only loud thing on the page. */
:root {
  color-scheme: dark;
  --background: #171717;
  --text: #f5f5f5;
  --muted: #a8a8a8;
  --hover: #2c2c2c;
  --pill-hover: #383838;
  --stage: #111;
  --veil: rgb(23 23 23 / 0.72);
  --s1: 8px; --s2: 16px; --s3: 24px; --s4: 32px; --s5: 40px; --s6: 48px; --s8: 64px; --s9: 72px; --s12: 96px; --s16: 128px; --s20: 160px;
  --gutter: 48px;
  --radius: 8px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--background); color: var(--muted); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 14px; line-height: 24px; -webkit-font-smoothing: antialiased; }
::selection { background: #d5d5d5; color: #181818; }
p, h1, h2, ol { margin: 0; padding: 0; }
ol { list-style: none; }
h1, h2 { color: var(--text); font-size: 14px; line-height: 24px; font-weight: 600; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:focus { outline: none; }
:focus-visible { outline: 2px solid #fff; outline-offset: 4px; border-radius: 4px; }
/* Rings only after Tab: a ring left on a tile after a click or Escape reads as a bug. */
html:not([data-kbd]) :focus-visible { outline: none; }
img, video { display: block; }
i { font-style: normal; }
.ic { display: block; flex: none; width: 10px; height: 10px; }

.frame { width: min(1600px, 100% - 2 * var(--gutter)); margin: 0 auto; }
main { padding-bottom: var(--s20); }

/* ---------- intro: the wordmark, then the title and one line ---------- */
.intro { padding-top: var(--s12); max-width: 480px; }
.logo { display: block; width: 104px; height: 13px; margin-bottom: var(--s8); }
.logo path { fill: var(--text); }
.intro h1 { margin-bottom: var(--s1); }

/* ---------- grid: every film playing, quietly ---------- */
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s6) var(--s4); margin-top: var(--s9); }
.cover { position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: var(--stage); cursor: pointer; transition: transform .55s var(--spring); }
.cover video { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.cover:hover video { transform: scale(1.03); }
.cover:active { transform: scale(0.98); transition-duration: .12s; }
.cover:focus-visible { outline-offset: 4px; border-radius: var(--radius); }
/* The invite to open a film: a frosted pill that rises in on hover. */
.hint { position: absolute; left: 12px; bottom: 12px; display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 14px 0 12px; border-radius: 999px; background: var(--veil); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); color: var(--text); opacity: 0; transform: translateY(6px); transition: opacity .2s var(--ease), transform .45s var(--ease); pointer-events: none; }
.cover:hover .hint, .cover:focus-visible .hint { opacity: 1; transform: none; }
.film .t { display: flex; align-items: center; gap: var(--s1); margin-top: var(--s2); }
.m { color: var(--muted); font-variant-numeric: tabular-nums; }
.tag { padding: 0 8px; border-radius: 999px; background: var(--hover); color: var(--text); font-size: 12px; line-height: 20px; font-weight: 500; }

/* Every download is a grey pill: what it is, its size in grey, then the arrow. */
.acts { display: flex; flex-wrap: wrap; gap: var(--s1); margin-top: 12px; }
.acts a, .pill { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px 0 14px; border-radius: 999px; background: var(--hover); color: var(--text); white-space: nowrap; transition: background-color .2s var(--ease), transform .35s var(--spring); }
.acts a:hover, .pill:hover { background: var(--pill-hover); }
.acts a:active, .pill:active { transform: scale(0.95); transition-duration: .1s; }
.acts a .ic { margin-left: 2px; transition: transform .3s var(--ease); }
.acts a:hover .ic { transform: translateY(2px); }

/* ---------- entry: content arrives in reading order, top-down ---------- */
.rise { animation: rise .7s var(--ease) backwards; animation-delay: calc(var(--i, 0) * 45ms + 60ms); }
@keyframes rise { from { clip-path: inset(0 0 100% 0); transform: translateY(12px); } to { clip-path: inset(0 0 0 0); transform: none; } }

/* ---------- viewer: one film, full screen, grown out of its tile ---------- */
.viewer { position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: transparent; color: var(--muted); overflow: hidden; }
.viewer[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.viewer::backdrop { background: transparent; }
.viewer::before { content: ""; position: absolute; inset: 0; z-index: -1; background: #0b0b0b; opacity: 0; transition: opacity .35s var(--ease); }
.viewer.shown::before { opacity: 1; }
/* The chrome comes in after the film has grown, and leaves before it shrinks back. */
.v-top, .v-bottom { position: relative; display: flex; align-items: center; gap: var(--s1); padding: var(--s2) var(--gutter); opacity: 0; transform: translateY(-8px); transition: opacity .25s var(--ease), transform .45s var(--ease); }
.v-bottom { transform: translateY(8px); }
.viewer.shown .v-top, .viewer.shown .v-bottom { opacity: 1; transform: none; transition-delay: .12s; }
.v-label { display: flex; align-items: center; gap: var(--s1); min-width: 0; margin-right: var(--s2); }
.v-title { color: var(--text); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.v-count { color: var(--muted); font-variant-numeric: tabular-nums; }
.v-acts { margin: 0 0 0 auto; }
.v-mute { width: 92px; justify-content: center; padding: 0 14px; }
.v-mute .ic { width: 12px; }
.v-close .m { margin-left: 2px; }

/* A selection is one pill that slides between the options. */
.v-ratio { position: relative; display: inline-flex; padding: 2px; border-radius: 999px; background: var(--hover); }
.v-ratio[hidden] { display: none; }
.v-ratio button { position: relative; z-index: 1; height: 28px; padding: 0 12px; border-radius: 999px; color: var(--muted); font-variant-numeric: tabular-nums; transition: color .25s var(--ease); }
.v-ratio button[aria-checked="true"] { color: var(--background); }
.v-glide { position: absolute; z-index: 0; top: 2px; bottom: 2px; left: 0; width: 0; border-radius: 999px; background: var(--text); transition: transform .45s var(--spring), width .45s var(--spring); }

.v-stage { position: relative; display: grid; place-items: center; min-height: 0; margin: 0 var(--gutter); }
.v-frame { position: relative; overflow: hidden; border-radius: var(--radius); background: var(--stage); transform-origin: 0 0; cursor: pointer; will-change: transform; }
/* The frame always has the film's shape at rest; while it morphs (9:16 ⇄ 16:9) the film crops rather than squashes. */
.v-frame video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: var(--stage); }
.v-frame video.in { animation: wipe .42s var(--ease); }
@keyframes wipe { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0 0 0 0); } }
.v-paused { position: absolute; left: 50%; top: 50%; display: grid; place-items: center; width: 64px; height: 64px; margin: -32px 0 0 -32px; border-radius: 999px; background: var(--veil); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); color: var(--text); opacity: 0; transform: scale(0.8); transition: opacity .2s var(--ease), transform .4s var(--spring); pointer-events: none; }
.v-paused .ic { width: 16px; height: 16px; margin-left: 3px; }
.viewer.paused .v-paused { opacity: 1; transform: none; }

.v-bottom { gap: 12px; padding-bottom: max(var(--s2), env(safe-area-inset-bottom)); }
.v-prev, .v-next, .v-play { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 999px; background: var(--hover); color: var(--text); transition: background-color .2s var(--ease), transform .35s var(--spring); }
.v-prev:hover, .v-next:hover, .v-play:hover { background: var(--pill-hover); }
.v-prev:active, .v-next:active, .v-play:active { transform: scale(0.92); transition-duration: .1s; }
.v-prev .ic, .v-next .ic { width: 12px; height: 12px; }
.v-time, .v-dur { flex: none; min-width: 36px; font-variant-numeric: tabular-nums; }
.v-dur { text-align: right; }
/* The scrubber is a fill, not a line: a soft grey track that thickens under the pointer. */
.v-track { position: relative; flex: 1; height: 24px; cursor: pointer; touch-action: none; }
.v-track::before, .v-fill { content: ""; position: absolute; left: 0; top: 50%; height: 4px; margin-top: -2px; border-radius: 999px; transition: height .25s var(--ease), margin-top .25s var(--ease); }
.v-track::before { right: 0; background: var(--hover); }
.v-fill { width: calc(var(--p, 0) * 100%); background: var(--text); }
.v-track:hover::before, .v-track:hover .v-fill, .v-track.drag::before, .v-track.drag .v-fill { height: 8px; margin-top: -4px; }
.v-track:focus-visible { outline-offset: 2px; }

/* ---------- narrower: two films a row ---------- */
@media (max-width: 1079px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .v-acts { display: none; }
  .v-ratio { margin-left: auto; }
  .v-ratio[hidden] + .v-acts + .v-mute { margin-left: auto; }
}

/* ---------- phone: one film a row, the viewer keeps only what a thumb needs ---------- */
@media (max-width: 600px) {
  :root { --gutter: 16px; }
  main { padding-bottom: var(--s12); }
  .intro { padding-top: var(--s8); }
  .logo { margin-bottom: var(--s5); }
  .grid { grid-template-columns: minmax(0, 1fr); gap: var(--s5); margin-top: var(--s6); }
  .cover { border-radius: 12px; }
  .v-top { padding-top: max(12px, env(safe-area-inset-top)); padding-bottom: 12px; }
  .v-count, .v-close .m, .v-mute span { display: none; }
  .v-mute { width: 40px; padding: 0; }
  .v-close { padding: 0 14px; }
  .v-label { margin-right: auto; }
  .v-ratio { margin-left: 0; }
  .v-bottom { gap: var(--s1); }
  .v-time, .v-dur { min-width: 32px; font-size: 13px; }
}
@media (hover: none) { .hint { display: none; } }
/* Phone held sideways: the film takes the height, the chrome shrinks to strips. */
@media (orientation: landscape) and (max-height: 500px) {
  .v-top, .v-bottom { padding: 4px max(16px, env(safe-area-inset-left)); }
  .v-stage { margin: 0 max(16px, env(safe-area-inset-left)); }
}

@media (prefers-reduced-motion: reduce) {
  .rise, .v-frame video.in { animation: none; }
  .cover, .cover video, .hint, .acts a, .pill, .v-glide, .v-top, .v-bottom, .viewer::before { transition: none; }
}
