/* fourreck.com countdown. The scene styles below are copied from the new site (app/assets/css/main.css). */

/* ---------- Previews (SVG scenes) ---------- */
.viz {
  display: block;
  width: 100%;
  height: 100%;
}
.viz-img {
  object-fit: cover;
}
.viz text {
  font-family: var(--f-sans);
}
.viz .ann,
.viz .erl,
.viz .st,
.viz .sc-m,
.viz .ind-n,
.viz .chip-t,
.viz .seal-t,
.viz .mono-t {
  font-family: var(--f-mono);
}
.viz .ann {
  font-size: 11px;
  letter-spacing: 0.14em;
  fill: #8e8e93;
}
.viz .mono-t {
  font-size: 10px;
  letter-spacing: 0.14em;
  fill: #a1a1a6;
}
.v-lib .erl {
  font-size: 10px;
  letter-spacing: 0.04em;
  fill: #161616;
}
.v-lib .beam {
  animation: libBeam 6s linear infinite;
}
.v-lib .tag {
  fill: rgba(255, 255, 255, 0.06);
  stroke: rgba(255, 255, 255, 0.16);
  stroke-width: 1;
  animation: libRead 6s linear infinite;
}
@keyframes libBeam {
  from {
    transform: translateX(-80px);
  }
  to {
    transform: translateX(980px);
  }
}
@keyframes libRead {
  0% {
    fill: rgba(245, 245, 243, 0.95);
    stroke: rgba(245, 245, 243, 0.95);
  }
  12%,
  100% {
    fill: rgba(255, 255, 255, 0.06);
    stroke: rgba(255, 255, 255, 0.16);
  }
}
.v-acc .flap {
  fill: rgba(255, 255, 255, 0.07);
  stroke: rgba(255, 255, 255, 0.34);
  stroke-width: 1;
  transform-box: fill-box;
  animation: flap 5.6s cubic-bezier(0.65, 0, 0.35, 1) infinite;
}
.v-acc .fl {
  transform-origin: left center;
}
.v-acc .fr {
  transform-origin: right center;
}
.v-acc .st {
  font-size: 10px;
  letter-spacing: 0.16em;
  fill: #f5f5f3;
}
.v-acc .st-open {
  animation: stOpen 5.6s linear infinite;
}
.v-acc .st-shut {
  animation: stShut 5.6s linear infinite;
}
.v-acc .led {
  animation: led 2.4s ease-in-out infinite;
}
@keyframes flap {
  0%,
  10% {
    transform: scaleX(1);
  }
  22%,
  58% {
    transform: scaleX(0.05);
  }
  70%,
  100% {
    transform: scaleX(1);
  }
}
@keyframes stOpen {
  0%,
  18% {
    opacity: 0;
  }
  24%,
  56% {
    opacity: 1;
  }
  62%,
  100% {
    opacity: 0;
  }
}
@keyframes stShut {
  0%,
  18% {
    opacity: 1;
  }
  24%,
  56% {
    opacity: 0;
  }
  62%,
  100% {
    opacity: 1;
  }
}
@keyframes led {
  0%,
  100% {
    opacity: 0.35;
  }
  50% {
    opacity: 0.95;
  }
}
.v-sig .sc-h {
  font-weight: 300;
  font-size: 28px;
  letter-spacing: -0.02em;
  fill: #f5f5f3;
}
.v-sig .sc-m {
  font-size: 10px;
  letter-spacing: 0.14em;
  fill: #8e8e93;
}
.v-sig .sc-clock {
  font-weight: 300;
  font-size: 48px;
  letter-spacing: -0.03em;
  fill: #f5f5f3;
}
.v-sig .sc-xl {
  font-weight: 300;
  font-size: 58px;
  letter-spacing: -0.04em;
  fill: #f5f5f3;
}
.v-sig .lay-a {
  animation: layA 9s ease-in-out infinite;
}
.v-sig .lay-b {
  animation: layB 9s ease-in-out infinite;
}
@keyframes layA {
  0%,
  44% {
    opacity: 1;
  }
  50%,
  94% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}
@keyframes layB {
  0%,
  44% {
    opacity: 0;
  }
  50%,
  94% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}
.v-vis .float {
  animation: float 7s ease-in-out infinite;
}
.v-vis .prog {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: progress 8s linear infinite;
}
.v-vis .node-t {
  font-size: 14px;
  letter-spacing: -0.01em;
  fill: #f5f5f3;
}
@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}
@keyframes progress {
  0% {
    stroke-dashoffset: 1;
    opacity: 1;
  }
  70% {
    stroke-dashoffset: 0;
    opacity: 1;
  }
  90% {
    stroke-dashoffset: 0;
    opacity: 1;
  }
  100% {
    stroke-dashoffset: 0;
    opacity: 0;
  }
}
.v-jud .seal {
  transform-box: fill-box;
  transform-origin: center;
  animation: stamp 7s cubic-bezier(0.2, 0.8, 0.2, 1) infinite;
}
.v-jud .ring-t {
  transform-box: fill-box;
  transform-origin: center;
  animation: spin 40s linear infinite;
}
.v-jud .seal-t {
  font-size: 8.5px;
  letter-spacing: 2.2px;
  fill: #d1d1d6;
}
.v-jud .check {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: draw 7s ease-out infinite;
}
.v-jud .sig {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: sig 7s ease-out infinite;
}
.v-jud .row-t {
  font-size: 14px;
  fill: #f5f5f3;
}
@keyframes stamp {
  0%,
  10% {
    opacity: 0;
    transform: scale(1.4);
  }
  16% {
    opacity: 1;
    transform: scale(1);
  }
  90% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(1);
  }
}
@keyframes draw {
  0%,
  16% {
    stroke-dashoffset: 1;
  }
  28%,
  100% {
    stroke-dashoffset: 0;
  }
}
@keyframes sig {
  0% {
    stroke-dashoffset: 1;
  }
  12%,
  100% {
    stroke-dashoffset: 0;
  }
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.v-crm .flow {
  stroke-dasharray: 2 22;
  stroke-linecap: round;
  animation: flow 1.8s linear infinite;
}
.v-crm .pulse {
  transform-box: fill-box;
  transform-origin: center;
  animation: pulse 3.2s cubic-bezier(0.2, 0.8, 0.2, 1) infinite;
}
.v-crm .orbit {
  transform-box: view-box;
  transform-origin: 400px 262px;
  animation: spin 70s linear infinite;
}
.v-crm .node-t {
  font-size: 15px;
  letter-spacing: -0.01em;
  fill: #f5f5f3;
}
.v-crm .core-t {
  font-size: 18px;
  letter-spacing: -0.02em;
  fill: #f5f5f3;
}
@keyframes flow {
  to {
    stroke-dashoffset: -48;
  }
}
@keyframes pulse {
  0% {
    transform: scale(1);
    opacity: 0.55;
  }
  100% {
    transform: scale(1.8);
    opacity: 0;
  }
}

/* ---------- Finale card ---------- */
.v-fin .fin-bar {
  transform-box: fill-box;
  transform-origin: left center;
  animation: finBar 1s cubic-bezier(0.77, 0, 0.18, 1) both;
}
.v-fin .b1 { animation-delay: 0.2s; }
.v-fin .b2 { animation-delay: 0.34s; }
.v-fin .fin-word {
  font-weight: 500;
  font-size: 44px;
  letter-spacing: 0.26em;
  fill: #f5f5f3;
  animation: finWord 1.8s cubic-bezier(0.16, 1, 0.3, 1) 0.35s both;
}
.v-fin .fin-date {
  font-family: var(--f-mono);
  font-size: 13px;
  letter-spacing: 0.32em;
  fill: #a1a1a6;
  animation: finDate 1.2s ease 1.3s both;
}
@keyframes finBar { from { transform: scaleX(0); } }
@keyframes finWord { from { opacity: 0; letter-spacing: 0.6em; } }
@keyframes finDate { from { opacity: 0; transform: translateY(8px); } }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------- Countdown, in the holding page's own style ---------- */
.cd { width: fit-content; max-width: 100%; margin-top: 44px; }
.cd-title {
  margin: 0;
  font-family: var(--f-mono);
  font-weight: 400;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.cd-grid { display: grid; grid-template-columns: repeat(4, max-content); margin-top: 14px; }
.cd-unit {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding-inline: clamp(16px, 2.6vw, 34px);
}
.cd-unit:first-child { padding-left: 0; }
.cd-unit:last-child { padding-right: 0; }
.cd-unit + .cd-unit::before {
  content: '';
  position: absolute;
  left: 0;
  top: 12%;
  height: 54%;
  width: 1px;
  background: var(--hair-2);
}
.cd-num {
  display: flex;
  font-weight: 200;
  font-size: clamp(40px, 6vw, 80px);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
/* Each digit rolls inside a soft-edged window, so the outgoing digit fades instead of being cut. */
.cd-num .d {
  position: relative;
  display: block;
  width: 0.62em;
  height: 1.4em;
  margin-block: -0.19em;
  -webkit-mask-image: linear-gradient(transparent, #000 20%, #000 80%, transparent);
  mask-image: linear-gradient(transparent, #000 20%, #000 80%, transparent);
}
.cd-num .d span {
  position: absolute;
  inset: 0;
  line-height: 1.4;
  text-align: center;
  background: linear-gradient(180deg, #ffffff 30%, #a9a9ae 72%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.cd-num .d .in { animation: digitIn 0.7s cubic-bezier(0.16, 1, 0.3, 1) both; }
.cd-num .d .out { animation: digitOut 0.7s cubic-bezier(0.16, 1, 0.3, 1) both; }
@keyframes digitIn { from { opacity: 0; transform: translateY(55%); filter: blur(5px); } }
@keyframes digitOut { to { opacity: 0; transform: translateY(-55%); filter: blur(5px); } }
.cd-lab,
.cd-meta {
  font-family: var(--f-mono);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.cd-meta { display: flex; align-items: center; gap: 16px; margin-top: 22px; }
.cd-bar { position: relative; flex: 1; height: 1px; background: var(--hair-2); }
.cd-bar i { position: absolute; left: 0; top: 0; bottom: 0; width: calc(var(--p, 0) * 100%); background: var(--ink); }
.cd-bar i::after {
  content: '';
  position: absolute;
  right: -3px;
  top: -2px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--ink);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.08);
}
.cd-date,
.cd-arrived {
  display: none;
  margin: 10px 0 0;
  font-weight: 200;
  font-size: clamp(36px, 5vw, 64px);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

/* ---------- The sneak-peek button ---------- */
.btn-peek {
  gap: 12px;
  padding-left: 8px;
  border: 0;
  font-family: inherit;
  cursor: pointer;
}
.btn-peek .dot {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--obsidian);
  color: var(--ink);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.btn-peek .dot svg { width: 10px; height: 10px; margin-left: 2px; fill: currentColor; }
.btn-peek:hover .dot { transform: scale(1.1); }

/* ---------- The full-screen player ---------- */
html.is-peeking { overflow: hidden; }
.peek {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0 max(24px, env(safe-area-inset-right, 0px)) 0 max(24px, env(safe-area-inset-left, 0px));
  border: 0;
  background: var(--black);
  color: var(--ink);
  overflow: auto;
  overscroll-behavior: contain;
}
.peek[open] { display: flex; flex-direction: column; }
.peek::backdrop { background: transparent; }
.peek-top {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1200px;
  height: 72px;
  margin-inline: auto;
  border-bottom: 1px solid var(--hair);
}
.peek-close {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--hair-2);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink-2);
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.peek-close:hover { color: var(--ink); border-color: rgba(255, 255, 255, 0.3); }
.peek-close svg { width: 14px; height: 14px; }

.film-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding-block: 32px 40px;
  text-align: center;
}
.film-box { width: min(100%, 1180px, max(480px, (100svh - 330px) * 1.875)); }
.peek[open] .film-box { animation: filmIn 1.5s cubic-bezier(0.16, 1, 0.3, 1) 0.2s both; }
.peek[open] .peek-top { animation: fadeIn 0.8s ease 0.35s both; }
@keyframes filmIn { from { opacity: 0; transform: scale(0.94); } }
@keyframes fadeIn { from { opacity: 0; } }
.frame { position: relative; }
.film {
  position: relative;
  aspect-ratio: 900 / 480;
  overflow: hidden;
  border-radius: 12px;
  background: var(--obsidian);
  box-shadow: 0 0 0 1px var(--hair), 0 40px 120px -50px rgba(255, 255, 255, 0.06);
  isolation: isolate;
}
.film::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: radial-gradient(120% 95% at 50% 45%, transparent 62%, rgba(0, 0, 0, 0.5));
}
.film .layers,
.film .layer { position: absolute; inset: 0; }
.film .layer svg { transform-origin: 50% 50%; }
.film .slit {
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.8) 16%, rgba(255, 255, 255, 0.8) 84%, transparent);
}
.crop {
  position: absolute;
  width: 14px;
  height: 14px;
  border: 0 solid rgba(255, 255, 255, 0.26);
  pointer-events: none;
}
.crop.tl { top: -12px; left: -12px; border-top-width: 1px; border-left-width: 1px; }
.crop.tr { top: -12px; right: -12px; border-top-width: 1px; border-right-width: 1px; }
.crop.bl { bottom: -12px; left: -12px; border-bottom-width: 1px; border-left-width: 1px; }
.crop.br { bottom: -12px; right: -12px; border-bottom-width: 1px; border-right-width: 1px; }

/* Chapters, with pause / replay at the end of the row, as apple.com does for its films. */
.film-bar { display: flex; align-items: center; gap: 14px; margin-top: 22px; }
.chapters {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.chapters li { height: 2px; overflow: hidden; border-radius: 1px; background: rgba(255, 255, 255, 0.12); }
.chapters i { display: block; height: 100%; background: var(--ink); transform: scaleX(0); transform-origin: left center; }
.chapters .is-done i { transform: scaleX(1); }
.chapters .is-on i { animation: chapter var(--dur, 5.2s) linear both; }
@keyframes chapter { to { transform: scaleX(1); } }
.film-pause {
  flex: none;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--hair-2);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink-2);
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}
.film-pause:hover { color: var(--ink); border-color: rgba(255, 255, 255, 0.3); background: rgba(255, 255, 255, 0.08); }
.film-pause svg { width: 12px; height: 12px; fill: currentColor; }
.film-pause .i-play,
.film-pause .i-replay,
.film-wrap.is-paused .film-pause .i-pause,
.film-wrap.is-ended .film-pause .i-pause,
.film-wrap.is-ended .film-pause .i-play { display: none; }
.film-wrap.is-paused:not(.is-ended) .film-pause .i-play,
.film-wrap.is-ended .film-pause .i-replay { display: block; }
.film-wrap.is-paused .film *,
.film-wrap.is-paused .chapters i { animation-play-state: paused !important; }

.film-cap { display: block; margin-top: clamp(18px, 3vh, 30px); }
.shot-label {
  display: block;
  min-height: 1.4em;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.shot-line {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-content: center;
  column-gap: 0.26em;
  min-height: 2.3em;
  max-width: 24ch;
  margin: 6px auto 0;
  font-weight: 300;
  font-size: clamp(24px, min(3vw, 5vh), 44px);
  line-height: 1.1;
  letter-spacing: -0.035em;
}
@media (min-width: 1100px) {
  .shot-line { max-width: none; min-height: 1.2em; }
}
.shot-line .w { display: inline-block; overflow: hidden; padding-bottom: 0.08em; }
.shot-line .w > span { display: inline-block; }
.shot-line.is-in .w > span {
  animation: wordUp 0.95s cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: calc(var(--i) * 70ms + 80ms);
}
@keyframes wordUp { from { opacity: 0; transform: translateY(100%); filter: blur(6px); } }

/* Without scripts there is no film and no clock: show the date. */
html:not(.js) .cd-grid,
html:not(.js) .cd-meta,
html:not(.js) .cd-in,
html:not(.js) .btn-peek { display: none; }
html:not(.js) .cd-date { display: block; }
.is-arrived .cd-grid,
.is-arrived .cd-meta,
.is-arrived .cd-in { display: none; }
.is-arrived .cd-arrived { display: block; }

@media (max-width: 640px) {
  .cd { margin-top: 36px; }
  .cd-unit { gap: 6px; }
  .cd-lab { font-size: 9px; letter-spacing: 0.14em; }
  .cd-meta { flex-wrap: wrap; gap: 10px 14px; }
  .cd-bar { flex-basis: 100%; order: 3; }
  .film-box { width: 100%; }
  .film { aspect-ratio: 900 / 520; border-radius: 8px; }
  .film-bar { gap: 10px; margin-top: 20px; }
  .chapters { gap: 4px; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .chapters,
  .v-lib .beam { visibility: hidden; }
}
