/* AGC film player (2026-10-26). Adam: "the video player that pops up when you click on any video needs to be designed
   better with more intention and agc branding i want it to be smooth and i want it to look amazing with a cool design".
   One player for every [data-film] link on Home, Work and the Film collection (assets/js/agc-player.js). The film sits
   in a gold-edged frame at its own shape, the card's picture glides into it on open and back on close, and the
   controls are the site's own: amber progress, mono time, round buttons. */
.agp {
  --agp-ink: #f4efe4; --agp-soft: #c2c5cb; --agp-dim: #8f95a0; --agp-amber: #ffb56b; --agp-gold: #c9a46a;
  --agp-ground: #05070b; --agp-glass: rgba(10, 14, 20, .72); --agp-rule: rgba(201, 164, 106, .32);
  --agp-ease: cubic-bezier(.2, .8, .2, 1);
  position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0;
  border: 0; background: transparent; color: var(--agp-ink); overflow: hidden;
  font: 400 16px/1.5 Inter, Arial, sans-serif;
}
.agp::backdrop { background: transparent; }
html.agp-lock { overflow: hidden; scrollbar-gutter: stable; } /* the page doesn't shift sideways when its scrollbar goes */
/* minmax(0, 1fr): the column may never grow to the frame's width, or the frame is measured against itself (phones). */
.agp[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; grid-template-columns: minmax(0, 1fr); }
.agp-scrim {
  position: absolute; inset: 0; z-index: 0;
  background:
    radial-gradient(60% 50% at 50% 0%, rgba(80, 98, 160, .22), transparent 70%),
    radial-gradient(40% 35% at 85% 100%, rgba(255, 181, 107, .10), transparent 70%),
    rgba(5, 7, 11, .94);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  opacity: 0; transition: opacity .35s ease;
}
.agp.is-in .agp-scrim { opacity: 1; }

/* Top bar: the brand on the left, where you are and the close button on the right. */
.agp-bar {
  position: relative; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: clamp(12px, 2.2vw, 22px) clamp(16px, 3vw, 36px);
  opacity: 0; transform: translateY(-8px); transition: opacity .35s ease .08s, transform .45s var(--agp-ease) .08s;
}
.agp.is-in .agp-bar { opacity: 1; transform: none; }
.agp-brand { display: flex; align-items: center; gap: 12px; color: var(--agp-ink); text-decoration: none; }
.agp-brand img { display: block; width: 148px; height: auto; aspect-ratio: 1020 / 216; }
.agp-count { font: 500 11px/1 'JetBrains Mono', Consolas, monospace; letter-spacing: .14em; color: var(--agp-dim); }
.agp-right { display: flex; align-items: center; gap: 14px; }
.agp-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px; padding: 0; border-radius: 50%;
  border: 1px solid var(--agp-rule); background: rgba(255, 255, 255, .03); color: var(--agp-ink); cursor: pointer;
  transition: background .2s ease, border-color .2s ease, transform .2s var(--agp-ease);
}
.agp-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.agp-btn:hover { background: rgba(255, 181, 107, .12); border-color: var(--agp-amber); }
.agp-btn:active { transform: scale(.94); }
.agp :focus-visible { outline: 2px solid var(--agp-amber); outline-offset: 3px; }

/* Stage: the frame keeps the film's own shape and fits the screen. */
.agp-stage { position: relative; z-index: 1; display: grid; place-items: center; min-height: 0; min-width: 0; padding: 0 clamp(12px, 6vw, 96px); }
.agp-brand img { width: 168px; }
.agp-frame {
  position: relative; width: var(--agp-w, 160px); height: var(--agp-h, 90px); max-width: 100%; border-radius: 14px; overflow: hidden;
  background: #000 var(--agp-poster, none) center / contain no-repeat;
  box-shadow: 0 0 0 1px var(--agp-rule), 0 30px 80px rgba(0, 0, 0, .55), 0 0 60px rgba(255, 181, 107, .06);
  opacity: 0; transition: opacity .25s ease;
}
.agp.is-in .agp-frame { opacity: 1; }
.agp.is-flying .agp-frame { opacity: 0; transition: none; }
.agp-frame video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: transparent; opacity: 0; transition: opacity .4s ease; }
.agp-frame.is-ready video { opacity: 1; }
.agp-loader {
  position: absolute; left: 50%; top: 50%; width: 42px; height: 42px; margin: -21px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .12); border-top-color: var(--agp-amber); animation: agp-spin .9s linear infinite;
  opacity: 0; transition: opacity .2s ease; pointer-events: none;
}
.agp-frame.is-waiting .agp-loader { opacity: 1; }
@keyframes agp-spin { to { transform: rotate(360deg); } }
.agp-big {
  position: absolute; left: 50%; top: 50%; width: 76px; height: 76px; margin: -38px; border-radius: 50%; border: 0;
  background: rgba(8, 11, 16, .62); color: var(--agp-ink); cursor: pointer; display: grid; place-items: center;
  box-shadow: 0 0 0 1px var(--agp-rule); backdrop-filter: blur(6px);
  opacity: 0; transform: scale(.9); transition: opacity .25s ease, transform .3s var(--agp-ease); pointer-events: none;
}
.agp-big svg { width: 26px; height: 26px; fill: currentColor; margin-left: 4px; }
.agp-frame.is-paused .agp-big { opacity: 1; transform: none; pointer-events: auto; }

/* The flying picture: the card's own image, moved from the card into the frame. */
.agp-fly { position: fixed; z-index: 3; margin: 0; border-radius: 10px; object-fit: contain; background: #000; pointer-events: none;
  transform-origin: 0 0; box-shadow: 0 30px 80px rgba(0, 0, 0, .5); }

/* Controls: a glass strip along the bottom of the frame, hidden while the film plays and the pointer rests. */
.agp-controls {
  position: absolute; left: 10px; right: 10px; bottom: 10px; display: flex; align-items: center; gap: 12px;
  padding: 8px 12px; border-radius: 12px; background: var(--agp-glass); backdrop-filter: blur(10px);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .06); transition: opacity .3s ease, transform .3s var(--agp-ease);
}
.agp-frame.is-idle .agp-controls { opacity: 0; transform: translateY(6px); pointer-events: none; }
.agp-controls .agp-btn { width: 36px; height: 36px; border-color: transparent; background: transparent; }
.agp-controls .agp-btn:hover { background: rgba(255, 255, 255, .08); border-color: transparent; }
.agp-controls .agp-btn svg { width: 16px; height: 16px; }
.agp-controls .agp-btn svg.is-solid { fill: currentColor; stroke: none; }
.agp-time { font: 500 11px/1 'JetBrains Mono', Consolas, monospace; letter-spacing: .06em; color: var(--agp-soft); white-space: nowrap; min-width: 9.5ch; }
.agp-track { position: relative; flex: 1; height: 28px; cursor: pointer; touch-action: none; }
.agp-track::before { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 3px; margin-top: -1.5px; border-radius: 3px; background: rgba(255, 255, 255, .16); }
.agp-buffer, .agp-fill { position: absolute; left: 0; top: 50%; height: 3px; margin-top: -1.5px; border-radius: 3px; width: 0; }
.agp-buffer { background: rgba(255, 255, 255, .22); }
.agp-fill { background: linear-gradient(90deg, var(--agp-gold), var(--agp-amber)); }
.agp-knob { position: absolute; top: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: var(--agp-amber);
  box-shadow: 0 0 0 4px rgba(255, 181, 107, .2); transform: scale(0); transition: transform .2s var(--agp-ease); left: 0; }
.agp-track:hover .agp-knob, .agp-track.is-dragging .agp-knob { transform: scale(1); }
.agp-track:hover::before, .agp-track.is-dragging::before { height: 5px; margin-top: -2.5px; }

/* Prev / next sit beside the frame on wide screens and under it on phones. */
.agp-nav { position: absolute; top: 50%; z-index: 2; margin-top: -22px; }
.agp-prev { left: clamp(12px, 2.5vw, 32px); }
.agp-next { right: clamp(12px, 2.5vw, 32px); }
.agp-nav[hidden] { display: none; }

/* Words under the frame. */
.agp-meta {
  position: relative; z-index: 2; display: grid; justify-items: center; gap: 6px; text-align: center;
  padding: clamp(14px, 2.4vh, 26px) clamp(16px, 6vw, 96px) clamp(18px, 3.4vh, 36px);
  opacity: 0; transform: translateY(10px); transition: opacity .4s ease .12s, transform .5s var(--agp-ease) .12s;
}
.agp.is-in .agp-meta { opacity: 1; transform: none; }
.agp-cat { font: 500 11px/1.3 'JetBrains Mono', Consolas, monospace; letter-spacing: .14em; text-transform: uppercase; color: var(--agp-amber); }
.agp-title { margin: 0; font: 400 clamp(22px, 3vw, 34px)/1.1 Fraunces, Georgia, serif; letter-spacing: -.015em; color: var(--agp-ink); }
.agp-cap { margin: 0; max-width: 46rem; color: var(--agp-soft); font-size: 15px; line-height: 1.5; }
.agp-cap:empty, .agp-cat:empty { display: none; }
.agp-link { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; margin-top: 4px; padding: 0 16px; border-radius: 999px;
  border: 1px solid var(--agp-amber); color: var(--agp-amber); text-decoration: none; font: 500 12px/1 'JetBrains Mono', Consolas, monospace; letter-spacing: .06em; }
.agp-link:hover { background: var(--agp-amber); color: #14100a; }
.agp-link[hidden] { display: none; }

@media (max-width: 700px) {
  .agp-brand img { width: 118px; }
  .agp-count { display: none; }
  .agp-stage { padding: 0 10px; }
  /* Phones: prev / next move down beside the title, clear of the film's own controls. */
  .agp-nav { position: fixed; top: auto; bottom: clamp(18px, 3.4vh, 36px); margin-top: 0; }
  .agp-prev { left: 12px; } .agp-next { right: 12px; }
  .agp-meta { padding-left: 64px; padding-right: 64px; }
  .agp-cap { font-size: 14px; }
  .agp-time { min-width: 0; }
  .agp-controls { gap: 6px; padding: 6px 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .agp-scrim, .agp-bar, .agp-meta, .agp-frame, .agp-controls, .agp-frame video { transition: opacity .2s ease !important; transform: none !important; }
}
