/* ================= Sticky "workday" video ================= */
:root { --reel-w: min(39vw, 680px); }

.reel {
  position: fixed; z-index: 40;
  pointer-events: none;
}
.reel__card {
  position: relative; overflow: hidden;
  border-radius: 26px;
  background: #111115;
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 30px 80px rgba(0,0,0,.55), 0 0 0 1px rgba(0,0,0,.4), 0 0 60px rgba(198,255,61,.06);
  pointer-events: auto;
  transition: box-shadow .4s;
}
.reel.is-working .reel__card { box-shadow: 0 30px 80px rgba(0,0,0,.55), 0 0 0 1px rgba(198,255,61,.35), 0 0 70px rgba(198,255,61,.14); }
.reel video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: 0% 50%; /* keep the laptop + me, trim the right-hand wall */
  display: block;
}
.reel__shade {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(8,8,10,.55) 0%, transparent 22%, transparent 62%, rgba(8,8,10,.85) 100%);
}

.reel__top { position: absolute; top: 14px; left: 14px; right: 14px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.reel__status {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: 99px;
  background: rgba(10,10,12,.72); border: 1px solid rgba(255,255,255,.12);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  font-size: .72rem; color: var(--text); white-space: nowrap;
}
.reel__status i { width: 8px; height: 8px; border-radius: 50%; background: #6b6b75; flex: none; transition: background .3s, box-shadow .3s; }
.reel.is-working .reel__status i { background: var(--accent); box-shadow: 0 0 0 4px rgba(198,255,61,.18); animation: pulse 2s infinite; }
.reel.is-waking .reel__status i, .reel.is-bye .reel__status i { background: #ffd166; }
.reel__status b { font-weight: 500; }
.reel__clock { padding: 6px 10px; border-radius: 99px; background: rgba(10,10,12,.72); border: 1px solid rgba(255,255,255,.12); font-size: .72rem; color: #cfcfd6; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }

.reel__task {
  position: absolute; left: 18px; right: 18px; bottom: 26px;
  font-family: var(--display); font-weight: 500; font-size: clamp(1rem, 1.5vw, 1.35rem); line-height: 1.25; letter-spacing: -0.01em;
  color: #fff; text-shadow: 0 2px 12px rgba(0,0,0,.6);
  transition: opacity .3s, transform .3s;
}
.reel__task.is-swap { opacity: 0; transform: translateY(6px); }
.reel__progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255,255,255,.1); }
.reel__progress span { display: block; height: 100%; width: 0; background: var(--accent); }

.reel__toggle {
  display: none;
  position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; border-radius: 50%;
  border: 0; cursor: pointer; font-size: 1rem; line-height: 28px; color: #fff;
  background: rgba(10,10,12,.7);
}

/* ---------- desktop: pinned on the right for the whole page ---------- */
@media (min-width: 1024px) {
  .reel { top: 0; right: 0; bottom: 0; width: var(--reel-w); padding: 92px var(--pad) 32px 0; display: flex; flex-direction: column; justify-content: center; gap: 18px; }
  /* full height, right ~15% of the frame trimmed (3:2) */
  .reel__card { width: 100%; aspect-ratio: 3 / 2; height: auto; flex: none; }
  .reel__days { display: flex; }

  main, .sitelinks, .footer { margin-right: var(--reel-w); }
  .stack { margin-right: 0; }

  /* the hero's right side is now the video */
  .hero__photo { display: none; }
  .hero__content { max-width: none !important; }
  .hero__name { font-size: clamp(3.6rem, 8.4vw, 10.5rem); }
  .hero__role { font-size: clamp(1.15rem, 2.1vw, 2rem); }

  /* sections now live in the left ~60% */
  .steps, .products, .clients, .contact__grid { grid-template-columns: repeat(2, 1fr); }
  .about__grid { margin-left: 0; }
  .build { grid-template-columns: 1fr; }
  .build:nth-child(even) .build__visual { order: 0; }
  .build__visual { aspect-ratio: 16 / 9; }
  .contact__title { font-size: clamp(2.8rem, 6.4vw, 7rem); }
  .section__title { font-size: clamp(2.4rem, 4.6vw, 4.6rem); }
}
@media (min-width: 1024px) and (max-width: 1699px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .stat { padding: 32px clamp(20px, 3vw, 48px); }
  .stat:nth-child(2) { border-right: 0; }
  .stat:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .job { grid-template-columns: 170px 1fr; gap: 24px; }
}

/* ---------- phones & tablets: video pinned right under the header ---------- */
@media (max-width: 1023px) {
  /* solid header so the pinned video sits flush under it */
  .nav { padding-top: 14px; padding-bottom: 14px; background: rgba(10,10,12,.94); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom-color: var(--line); }

  .reel {
    top: var(--nav-h, 62px); left: 0; right: 0; width: auto;
    padding: 10px 16px 12px;
    background: rgba(10,10,12,.94); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line);
  }
  /* 3:2 frame, capped so it never eats more than ~32% of the screen */
  .reel__card { aspect-ratio: 3 / 2; width: min(100%, calc(32svh * 1.5)); margin: 0 auto; border-radius: 18px; }
  .reel__top { top: 10px; left: 10px; right: 48px; }
  .reel__clock { display: none; }
  .reel__status { font-size: .66rem; padding: 5px 10px; gap: 6px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
  .reel__task { left: 12px; right: 12px; bottom: 12px; font-size: .82rem; }
  .reel__toggle { display: block; }
  .reel__days { display: none; }

  /* minimised: a small live circle in the top-right corner, just under the header */
  .reel.is-min {
    left: auto; right: 12px; top: calc(var(--nav-h, 62px) + 10px);
    padding: 0; background: none; border: 0; backdrop-filter: none; -webkit-backdrop-filter: none;
  }
  .reel.is-min .reel__card {
    aspect-ratio: 1; width: 64px; height: 64px; margin: 0; border-radius: 50%;
    box-shadow: 0 0 0 2px #6b6b75, 0 10px 28px rgba(0,0,0,.6);
  }
  .reel.is-min.is-working .reel__card { box-shadow: 0 0 0 2px var(--accent), 0 0 0 6px rgba(198,255,61,.18), 0 10px 28px rgba(0,0,0,.6); }
  .reel.is-min.is-waking .reel__card, .reel.is-min.is-bye .reel__card { box-shadow: 0 0 0 2px #ffd166, 0 10px 28px rgba(0,0,0,.6); }
  .reel.is-min video { object-position: 64% 30%; transform: scale(1.6); transform-origin: 64% 30%; }
  .reel.is-min .reel__shade, .reel.is-min .reel__task, .reel.is-min .reel__top, .reel.is-min .reel__progress { display: none; }
  .reel.is-min .reel__toggle { inset: 0; width: 100%; height: 100%; border-radius: 50%; background: transparent; font-size: 0; }

  /* no circle photo on phones; the hero starts below header + video */
  .hero__photo { display: none !important; }
  .hero { min-height: auto; padding-top: calc(var(--stack-h, 340px) + 28px); }
  section[id], main > section { scroll-margin-top: var(--stack-h, 340px); }
  .footer { padding-bottom: 28px; }
}

/* day stages under the video (desktop) */
.reel__days { justify-content: space-between; gap: 6px; pointer-events: auto; }
.reel__days span {
  flex: 1; text-align: center; padding: 9px 4px; border-radius: 12px;
  font-family: var(--mono); font-size: .7rem; color: var(--muted);
  border: 1px solid var(--line); background: rgba(255,255,255,.02);
  transition: color .3s, border-color .3s, background .3s;
}
.reel__days span.is-on { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
.reel__days span.is-done { color: #cfcfd6; border-color: rgba(198,255,61,.35); }

/* hidden while the AI intro runs */
body.intro-on .reel { opacity: 0; }
.reel { transition: opacity .5s; }
