/* Dobbin Wrapped's share page. The film is the renderer's own DOM (see share.js); this is the room around it.
   Sizes and positions that depend on the window come from share.js as custom properties on <body>. */

:root {
  --ink: #F5F5F5;
  --muted: rgba(245, 245, 245, .62);
  --red: #FF0000;
  --ease: cubic-bezier(.2, .75, .15, 1);
  --pull: .95s; /* the poster pulling back into its frame */
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  overflow: hidden;
  background: #101010;
  color: var(--ink);
  font: 400 15px/1.45 'Host Grotesk', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }

/* ── The room ── */
.wall, .flash { position: fixed; inset: 0; pointer-events: none; }
/* Flat and edge to edge: the film's grounds are dark, and a dark colour only reads as colour when it fills the page. */
.wall { background: var(--wall, #FF0000); transition: background-color var(--wall-for, .5s) cubic-bezier(.4, 0, .2, 1); }
body[data-state="loading"] .wall { transition: none; }
.flash { opacity: 0; background: radial-gradient(72% 82% at 50% 50%, rgba(255, 0, 0, .6), transparent 80%); }
body.is-stamped .flash { animation: flash 1.3s ease-out; }
@keyframes flash { 0% { opacity: 1; } 100% { opacity: 0; } }

.stage { position: fixed; inset: 0; z-index: 2; }
.jolt { position: absolute; inset: 0; }
body.is-stamped .jolt { animation: jolt .46s cubic-bezier(.3, .6, .3, 1); }
@keyframes jolt {
  0% { transform: none; }
  10% { transform: translateY(11px) scale(.984) rotate(-.25deg); }
  30% { transform: translateY(-5px) scale(1.003) rotate(.15deg); }
  52% { transform: translateY(3px); }
  75% { transform: translateY(-1px); }
  100% { transform: none; }
}

/* ── The film ── */
.film {
  position: absolute; left: 50%; top: 50%;
  width: var(--fw); height: var(--fh);
  margin: calc(var(--fh) / -2) 0 0 calc(var(--fw) / -2);
  transform: translate(var(--tx, 0px), var(--ty, 0px)) scale(var(--ts, 1));
  transition: transform var(--pull) var(--ease);
  z-index: 2;
}
body[data-state="loading"] .film { transition: none; opacity: 0; }
.film-clip {
  position: absolute; inset: 0; overflow: hidden; border-radius: 14px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .35), 0 40px 110px rgba(0, 0, 0, .7);
  transition: border-radius var(--pull) var(--ease), box-shadow var(--pull) var(--ease);
  cursor: pointer;
}
/* On the ending's bright wall the deep shadow of the dark scenes would smear it: a shorter, lighter one. */
body[data-state="ended"] .film-clip { box-shadow: 0 2px 6px rgba(0, 0, 0, .22), 0 16px 44px rgba(0, 0, 0, .3); }
/* A hairline of light, so the frame keeps its edge on a wall of its own colour. */
.film-clip::before { content: ''; position: absolute; inset: 0; z-index: 1; border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .09); pointer-events: none; transition: opacity .4s ease; }
body[data-state="opening"] .film-clip::before { opacity: 0; }
body[data-state="opening"] .film-clip { border-radius: 0; box-shadow: none; cursor: default; }
.film-host { position: absolute; left: 0; top: 0; width: 540px; height: 675px; transform: scale(var(--k)); transform-origin: 0 0; }
.paused {
  position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0, 0, 0, .28);
  opacity: 0; transition: opacity .18s ease; pointer-events: none;
}
.paused svg { width: 76px; height: 76px; color: #fff; filter: drop-shadow(0 4px 18px rgba(0, 0, 0, .5)); }
body.is-paused[data-state="playing"] .paused { opacity: 1; }

.progress { position: absolute; left: 0; right: 0; bottom: -14px; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, .1); overflow: hidden; opacity: 0; transition: opacity .5s ease .5s; }
/* White at half strength: it says how far along the film is without pulling the eye from it. */
.progress i { display: block; height: 100%; background: rgba(255, 255, 255, .5); transform: scaleX(0); transform-origin: 0 50%; }
body[data-state="playing"] .progress { opacity: 1; }

/* ── The opening: one button on the poster ── */
.open {
  position: absolute; left: calc(30px * var(--k)); top: var(--open-top, 22%);
  transition: opacity .28s ease, transform .5s var(--ease);
}
body:not([data-state="opening"]) .open { opacity: 0; transform: translateY(10px); pointer-events: none; }
.open-btn {
  display: inline-flex; align-items: center; gap: calc(10px * var(--k));
  height: max(48px, calc(54px * var(--k))); padding: 0 max(22px, calc(26px * var(--k))) 0 max(24px, calc(28px * var(--k)));
  border: 0; border-radius: 999px; background: var(--btn-bg, #fff); color: var(--btn-ink, #0A0A0A);
  font: 600 max(17px, calc(19px * var(--k))) / 1 'Host Grotesk', system-ui, sans-serif; letter-spacing: -.01em;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .22);
  transition: transform .18s var(--ease), box-shadow .18s ease;
  animation: nudge 2.6s ease-in-out 1.2s infinite;
}
.open-btn svg { width: max(20px, calc(22px * var(--k))); height: max(20px, calc(22px * var(--k))); transition: transform .18s var(--ease); }
.open-btn:hover { transform: scale(1.04); box-shadow: 0 14px 40px rgba(0, 0, 0, .3); animation-play-state: paused; }
.open-btn:hover svg { transform: translateX(4px); }
.open-btn:active { transform: scale(.98); }
.open-btn:focus-visible, .btn:focus-visible, .again:focus-visible, .sound:focus-visible { outline: 3px solid var(--focus, #fff); outline-offset: 3px; }
@keyframes nudge { 0%, 86%, 100% { transform: none; } 91% { transform: scale(1.045); } 96% { transform: scale(.995); } }
.open-hint { margin: max(10px, calc(12px * var(--k))) 0 0 4px; font: 500 max(13px, calc(13px * var(--k))) / 1.2 'Host Grotesk', system-ui, sans-serif; color: var(--hint, rgba(0, 0, 0, .72)); }

/* ── Reactions leaving the frame ── */
.fx { position: fixed; inset: 0; pointer-events: none; z-index: 5; overflow: hidden; }
.fx i { position: absolute; left: 0; top: 0; font: normal 34px/1 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif; will-change: transform, opacity; }

/* ── The ending: their post ── */
.share {
  position: absolute; left: var(--sx); top: var(--sy, 0); width: var(--sw); bottom: 0;
  display: flex; flex-direction: column; justify-content: center; gap: 14px;
  opacity: 0; transform: translateX(34px); pointer-events: none;
  transition: opacity .55s ease, transform .8s var(--ease);
  z-index: 3;
}
body[data-state="ended"] .share { opacity: 1; transform: none; pointer-events: auto; transition-delay: .35s; }
.note { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 12px; background: #fff; color: #1F1F1F; font: 400 16px/1.4 'Lato', sans-serif; box-shadow: var(--card-shadow); }
.note-av { flex: none; width: 30px; height: 30px; border-radius: 50%; background: #000; overflow: hidden; }
.note-av img { display: block; width: 100%; height: 100%; }
.note b { font: 700 15px/1 'Lato', sans-serif; margin-right: 8px; }
.note small { font: 400 12px/1 'Lato', sans-serif; color: #5F6368; }
.note p { margin: 5px 0 0; }

/* Their post, as it will look where it is going: a white card. The ending is the page's bright moment (the wall is
   back on the title card's ground), so nothing here is dark but the film beside it. */
.post { border-radius: 14px; background: #fff; color: #1F1F1F; box-shadow: var(--card-shadow); overflow: hidden; }
.post-head { display: flex; align-items: center; gap: 11px; padding: 14px 16px 6px; }
.post-av { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: #101010; color: #fff; font: 600 14px/1 'Host Grotesk', sans-serif; letter-spacing: .02em; }
/* A company's logo is a square tile, as on a company's own LinkedIn page, and sits whole inside it on white: nothing
   of it is cut to a circle. */
.post-av.has-logo { width: 44px; height: 44px; border-radius: 7px; background: #fff; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .1); }
.post-av.has-logo img { display: block; width: 34px; height: 34px; object-fit: contain; }
.post-head b { display: block; font: 600 15px/1.2 'Host Grotesk', sans-serif; }
.post-head small { font-size: 12.5px; color: #5F6368; }
.post-text {
  display: block; width: 100%; height: 156px; padding: 8px 16px 12px; border: 0; outline: 0; resize: none;
  background: transparent; color: #1F1F1F; font: 400 15px/1.48 'Host Grotesk', system-ui, sans-serif;
}
.post-text:focus { background: rgba(0, 0, 0, .04); }
.post-media { position: relative; height: var(--cover-h, 220px); background: #F1EFEA; border-top: 1px solid rgba(0, 0, 0, .08); overflow: hidden; }
.cover { position: absolute; left: 50%; top: 0; width: calc(var(--cover-h, 220px) * .8); height: 100%; margin-left: calc(var(--cover-h, 220px) * -.4); overflow: hidden; }
.cover-host { position: absolute; left: 0; top: 0; width: 540px; height: 675px; transform: scale(var(--cover-k, .3)); transform-origin: 0 0; pointer-events: none; }
.post-len { position: absolute; right: 10px; bottom: 10px; padding: 4px 7px; border-radius: 5px; background: rgba(0, 0, 0, .7); color: #fff; font: 500 12px/1 'Host Grotesk', sans-serif; font-variant-numeric: tabular-nums; }

/* The buttons sit on the wall, so they take their colours from its ground (`data-tc`, the title card's style): solid
   on red, where an outline would be lost. */
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn { height: 46px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--b2-line); background: var(--b2-bg); color: var(--b2-ink); font: 600 15px/1 'Host Grotesk', sans-serif; white-space: nowrap; transition: background .15s ease, transform .15s var(--ease); }
.btn:hover { background: var(--b2-hover); }
.btn:active { transform: scale(.97); }
.btn-main { flex: 1 1 auto; border-color: var(--b1-bg); background: var(--b1-bg); color: var(--b1-ink); }
.btn-main:hover { background: var(--b1-hover); }
/* One line high whatever it says, so the buttons above never move. */
.status { height: 20px; margin: -4px 2px 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 13.5px; line-height: 20px; color: var(--on-wall); }
body { --card-shadow: 0 2px 6px rgba(0, 0, 0, .16), 0 14px 38px rgba(0, 0, 0, .22); }
body[data-tc="red"] { --b1-bg: #fff; --b1-ink: #0A0A0A; --b1-hover: #F0F0F0; --b2-bg: #101010; --b2-line: #101010; --b2-ink: #fff; --b2-hover: #2A2A2A; --on-wall: #fff; }
body[data-tc="dark"] { --b1-bg: #FF0000; --b1-ink: #fff; --b1-hover: #E00000; --b2-bg: transparent; --b2-line: rgba(255, 255, 255, .28); --b2-ink: #fff; --b2-hover: rgba(255, 255, 255, .1); --on-wall: rgba(245, 245, 245, .7); }
body[data-tc="light"] { --b1-bg: #101010; --b1-ink: #fff; --b1-hover: #2A2A2A; --b2-bg: transparent; --b2-line: rgba(0, 0, 0, .26); --b2-ink: #101010; --b2-hover: rgba(0, 0, 0, .06); --on-wall: rgba(0, 0, 0, .62); --card-shadow: 0 0 0 1px rgba(0, 0, 0, .08), 0 14px 38px rgba(0, 0, 0, .14); }

/* Watch again: on the film itself, once it has ended. */
.again {
  position: absolute; left: 50%; bottom: 7%; z-index: 2; display: inline-flex; align-items: center; gap: 8px;
  height: 42px; padding: 0 18px 0 15px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .24);
  background: rgba(255, 255, 255, .1); color: #fff; font: 600 15px/1 'Host Grotesk', sans-serif; white-space: nowrap;
  backdrop-filter: blur(8px); transform: translateX(-50%) translateY(8px); opacity: 0; pointer-events: none;
  transition: opacity .4s ease, transform .5s var(--ease), background .15s ease;
}
.again svg { width: 17px; height: 17px; }
.again:hover { background: rgba(255, 255, 255, .2); }
body[data-state="ended"] .again { opacity: 1; transform: translateX(-50%); pointer-events: auto; transition-delay: .9s, .9s, 0s; }
body[data-state="ended"] .film-clip { cursor: pointer; }

/* ── Small controls ── */
.sound {
  position: fixed; right: 18px; top: 16px; z-index: 6; display: inline-flex; align-items: center; gap: 7px;
  height: 34px; padding: 0 12px 0 10px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .16);
  background: rgba(20, 20, 22, .6); color: var(--muted); font: 500 13px/1 'Host Grotesk', sans-serif;
  backdrop-filter: blur(8px); opacity: 0; pointer-events: none; transition: opacity .4s ease, color .15s ease;
}
.sound svg { width: 18px; height: 18px; }
.sound span { min-width: 62px; text-align: left; }
.sound:hover { color: #fff; }
.sound .cross, .sound[aria-pressed="false"] .waves { display: none; }
.sound[aria-pressed="false"] .cross { display: inline; }
body[data-state="playing"] .sound, body[data-state="ended"] .sound { opacity: 1; pointer-events: auto; }

.proto {
  position: fixed; left: 14px; bottom: 12px; z-index: 6; display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 6px 5px 11px; border-radius: 8px; background: rgba(0, 0, 0, .55); color: rgba(255, 255, 255, .7);
  font: 500 12px/1 'Host Grotesk', sans-serif; backdrop-filter: blur(8px);
}
.proto select { max-width: 240px; padding: 4px 6px; border-radius: 5px; border: 1px solid rgba(255, 255, 255, .2); background: #1B1B1D; color: #fff; font-size: 12px; }

/* ── Phones and narrow windows: the film fills the width, the ending stacks under it ── */
body.is-narrow .film-clip { border-radius: 0; }
body.is-narrow[data-state="ended"] .film-clip { border-radius: 10px; }
body.is-narrow .progress { bottom: -10px; left: 12px; right: 12px; }
body.is-narrow .share { right: 0; bottom: auto; justify-content: flex-start; padding: 0 16px 40px; transform: translateY(26px); }
body.is-narrow[data-state="ended"] { overflow-y: auto; }
body.is-narrow[data-state="ended"] .stage { position: absolute; min-height: 100%; height: auto; }
body.is-narrow .post-media, body.is-narrow .post-head { display: none; }
body.is-narrow .post-text { height: 158px; padding-top: 14px; }
body.is-narrow .share { gap: 12px; }
body.is-narrow .btn { flex: 1 1 auto; }
body.is-narrow .btn-main { flex-basis: 100%; }
/* The film is a thumbnail here: the button keeps its own size on it (undoing the film's scale), as an icon alone. */
body.is-narrow .again { bottom: 50%; width: 46px; height: 46px; padding: 0; justify-content: center; background: rgba(0, 0, 0, .55); transform: translate(-50%, 50%) scale(calc(1 / var(--ts, 1))); }
body.is-narrow[data-state="ended"] .again { transform: translate(-50%, 50%) scale(calc(1 / var(--ts, 1))); }
body.is-narrow .again span { display: none; }
body.is-narrow .sound span { display: none; }
body.is-narrow .sound { padding: 0 9px; right: 10px; top: 10px; }
body.is-narrow .proto { opacity: .85; }

[hidden] { display: none !important; }

/* ── The empty state: wrapped.dobbin.ai itself, and a link that opens no film ──
   The film's red title card at the size of the window: Dobbin's mark and the name up top, one line in Anton, a sentence
   and the one way on, to dobbin.ai. Nothing of the film is drawn. */
.empty { display: none; }
body[data-state="empty"] { overflow: auto; background: var(--red); }
body[data-state="empty"] .wall, body[data-state="empty"] .flash, body[data-state="empty"] .stage,
body[data-state="empty"] .fx, body[data-state="empty"] .sound, body[data-state="empty"] .proto { display: none; }
body[data-state="empty"] .empty {
  position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: 56px;
  min-height: 100%; padding: clamp(22px, 4vw, 44px) clamp(20px, 4vw, 48px) clamp(28px, 6vh, 64px);
  background: var(--red); color: #fff;
}
.empty-kick { display: flex; align-items: center; gap: 14px; font: 400 clamp(20px, 2.4vw, 28px)/1 'Anton', sans-serif; text-transform: uppercase; letter-spacing: .02em; }
.empty-d { position: relative; flex: none; width: 44px; height: 44px; border-radius: 12.6px; background: #000; }
.empty-d svg { position: absolute; left: 11.5px; top: 10.5px; width: 21px; height: 21px; }
.empty-body { max-width: 1100px; }
.empty-h { margin: 0; font: 400 clamp(64px, 13vw, 190px)/.88 'Anton', sans-serif; text-transform: uppercase; letter-spacing: -.005em; }
.empty-p { max-width: 560px; margin: clamp(18px, 3vh, 28px) 0 0; font: 500 clamp(17px, 1.7vw, 21px)/1.4 'Host Grotesk', system-ui, sans-serif; color: #0A0A0A; }
.empty-btn {
  display: inline-flex; align-items: center; gap: 10px; margin-top: clamp(22px, 4vh, 36px);
  height: 54px; padding: 0 24px 0 28px; border-radius: 999px; background: #fff; color: #0A0A0A; text-decoration: none;
  font: 600 19px/1 'Host Grotesk', system-ui, sans-serif; letter-spacing: -.01em; box-shadow: 0 10px 30px rgba(0, 0, 0, .22);
  transition: transform .18s var(--ease), box-shadow .18s ease;
}
.empty-btn svg { width: 22px; height: 22px; transition: transform .18s var(--ease); }
.empty-btn:hover { transform: scale(1.04); box-shadow: 0 14px 40px rgba(0, 0, 0, .3); }
.empty-btn:hover svg { transform: translateX(4px); }
.empty-btn:active { transform: scale(.98); }
.empty-btn:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.empty .when-home, .empty .when-missing { display: none; }
body[data-empty="home"] .empty .when-home, body[data-empty="missing"] .empty .when-missing { display: inline; }
.empty-h .when-home, .empty-h .when-missing { display: none; }
body[data-empty="home"] .empty-h .when-home, body[data-empty="missing"] .empty-h .when-missing { display: block; }
