/* Visa Christmas film page. Built from the Claude Design canvas "Visa: Christmas video page".
   Desktop sizes are the 1440 x 900 board, phone sizes the 390 wide boards; --u scales them. */

:root {
  --blue: #0055A7;
  --blue-dark: #003E7A;
  --paper: #EFEBE0;
  --screen: #1E2733;
  --font: 'Albert Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html, body { margin: 0; }

body {
  background: var(--paper);
  color: var(--blue);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

img, svg, video { display: block; }

/* ---------- Page and paper ---------- */

.page {
  --u: min(1px, 100vw / 1440);
  position: relative;
  overflow: hidden;
  min-height: 100vh;
  min-height: 100svh;
  background-color: var(--paper);
  background-image: url(../assets/background-paper-map.jpg);
  background-image: image-set(url(../assets/background-paper-map.webp) type('image/webp'), url(../assets/background-paper-map.jpg) type('image/jpeg'));
  background-size: cover;
  background-position: center;
}

/* ---------- Stamps (decoration) ---------- */

.stamps { position: absolute; inset: 0; pointer-events: none; }
.stamp { position: absolute; height: auto; }

.s-v        { left: calc(64 * var(--u));  top: calc(80 * var(--u));  width: calc(190 * var(--u)); }
.s-departed { left: calc(24 * var(--u));  top: calc(376 * var(--u)); width: calc(256 * var(--u)); }
.s-oval     { left: calc(48 * var(--u));  bottom: calc(65 * var(--u)); width: calc(248 * var(--u)); }
.s-arrival  { right: calc(56 * var(--u)); top: calc(70 * var(--u));  width: calc(203 * var(--u)); }
.s-foot     { right: calc(180 * var(--u)); top: calc(300 * var(--u)); width: calc(90 * var(--u)); }
.s-tilted   { right: calc(44 * var(--u)); top: calc(440 * var(--u)); width: calc(193 * var(--u)); }
.s-june     { right: calc(36 * var(--u)); bottom: calc(48 * var(--u)); width: calc(311 * var(--u)); }

/* ---------- Content: 12 columns, film on columns 3 to 10 ---------- */

.content {
  --pad: clamp(40px, 11.5svh, 104px);
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  padding: var(--pad) clamp(40px, 5.6vw, 80px);
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 24px;
  row-gap: 40px;
  align-content: center;
}

.wordmark {
  grid-column: 1 / -1;
  justify-self: center;
  width: 172px;
  height: auto;
}

.film {
  grid-column: 3 / 11;
  justify-self: center;
  width: 100%;
  /* keep wordmark, film and headline on one screen */
  max-width: max(520px, calc((100svh - 2 * var(--pad) - 201px) * 16 / 9 + 20px));
  padding: 8px;
  border: 2px solid var(--blue);
  border-radius: 18px;
}

.headline {
  grid-column: 3 / 11;
  margin: 0;
  text-align: center;
  font-size: 32px;
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.005em;
  text-transform: uppercase;
  text-wrap: balance;
  color: var(--blue);
}

/* ---------- The screen ---------- */

.film__screen {
  container-type: inline-size;
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
  background: var(--screen);
}

.is-vertical .film__screen { aspect-ratio: 9 / 16; }
.is-vertical .film {
  max-width: max(240px, calc((100svh - 2 * var(--pad) - 201px) * 9 / 16 + 20px));
}

.film__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: transparent;
}

.film__note {
  position: absolute;
  left: 20px;
  top: 16px;
  margin: 0;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: #C9C3B4;
}

/* Play button: a dotted ring round a cream disc */
.film__play {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 168px;
  height: 168px;
  margin: -84px 0 0 -84px;
  padding: 0;
  border: 2px dotted var(--paper);
  border-radius: 50%;
  background: transparent;
  color: var(--blue);
  font: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.film__play-disc {
  width: 128px;
  height: 128px;
  border-radius: 50%;
  background: var(--paper);
  box-shadow: inset 0 0 0 3px var(--paper), inset 0 0 0 5px var(--blue);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.film__play svg { width: 28px; height: 28px; }

.film__play-label {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.film__play:hover .film__play-disc { transform: scale(1.05); }
.film__play:active .film__play-disc { transform: scale(0.98); }
.film__play:focus-visible { outline: 3px solid var(--paper); outline-offset: 4px; }

.film.is-started .film__play,
.film.is-started .film__note { display: none; }

/* ---------- Control bar ---------- */

.film__bar {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  height: 40px;
  padding: 0 4px;
  border-radius: 20px;
  background: var(--blue);
  color: var(--paper);
  display: flex;
  align-items: center;
  gap: 4px;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.film__bar[hidden] { display: none; }

.film.is-idle .film__bar { opacity: 0; transform: translateY(6px); }
.film.is-idle .film__screen { cursor: none; }

.ctl {
  position: relative;
  flex: none;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease;
}

.ctl svg { width: 18px; height: 18px; }
/* the tap area stays bigger than the drawn button */
.ctl::before { content: ''; position: absolute; inset: -4px; }
.ctl:hover { background: rgba(239, 235, 224, 0.15); }
.ctl:focus-visible, .seek:focus-visible { outline: 2px solid var(--paper); outline-offset: -2px; }

.ctl--play .i-play,
.film.is-paused .ctl--play .i-pause { display: none; }
.film.is-paused .ctl--play .i-play { display: block; }

.ctl--mute .i-muted,
.film.is-muted .ctl--mute .i-sound { display: none; }
.film.is-muted .ctl--mute .i-muted { display: block; }

.time {
  flex: none;
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.time--now { display: none; }

.seek {
  flex: 1 1 auto;
  height: 32px;
  margin: 0 6px;
  display: flex;
  align-items: center;
  cursor: pointer;
  touch-action: none;
  border-radius: 8px;
}

.seek__track {
  position: relative;
  width: 100%;
  height: 3px;
  border-radius: 2px;
  background: rgba(239, 233, 216, 0.3);
}

.seek__fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--p, 0%);
  border-radius: 2px;
  background: var(--paper);
}

.seek__knob {
  position: absolute;
  left: var(--p, 0%);
  top: 50%;
  width: 11px;
  height: 11px;
  margin: -5.5px 0 0 -5.5px;
  border-radius: 50%;
  background: var(--paper);
}

/* Small screens (the phone player board): slimmer bar, current time only, after the slider */
@container (max-width: 560px) {
  .film__bar { left: 6px; right: 6px; bottom: 6px; height: 34px; padding: 0 2px; border-radius: 17px; gap: 2px; }
  .ctl { width: 30px; height: 30px; }
  .ctl svg { width: 16px; height: 16px; }
  .ctl--mute .i-sound-far { display: none; }
  .time { font-size: 11px; letter-spacing: 0; }
  .time--full { display: none; }
  .time--now { display: inline; margin-right: 2px; }
  .seek { height: 30px; margin: 0 4px; }
  .seek__knob { width: 10px; height: 10px; margin: -5px 0 0 -5px; }
}

/* Full screen */
.film:fullscreen { max-width: none; padding: 0; border: 0; border-radius: 0; background: #000; display: flex; align-items: center; }
.film:fullscreen .film__screen { width: 100%; max-height: 100vh; margin: auto; border-radius: 0; }
.film:-webkit-full-screen { max-width: none; padding: 0; border: 0; border-radius: 0; background: #000; display: flex; align-items: center; }
.film:-webkit-full-screen .film__screen { width: 100%; max-height: 100vh; margin: auto; border-radius: 0; }

/* ---------- Phones and small tablets (the 390 wide boards) ---------- */

@media (max-width: 899px) {
  .page {
    --u: min(100vw / 390, 1.25px);
    background-position: 42% center;
    min-height: max(100svh, 844 * var(--u));
  }

  .s-v        { left: calc(14 * var(--u));  top: calc(116 * var(--u)); width: calc(111 * var(--u)); }
  .s-arrival  { right: calc(14 * var(--u)); top: calc(104 * var(--u)); width: calc(118 * var(--u)); }
  .s-foot     { left: calc(50% - 29.5 * var(--u)); right: auto; top: calc(200 * var(--u)); width: calc(53 * var(--u)); }
  .s-departed { left: calc(12 * var(--u));  top: auto; bottom: calc(94 * var(--u)); width: calc(149 * var(--u)); }
  .s-oval     { left: auto; right: calc(12 * var(--u)); bottom: calc(92 * var(--u)); width: calc(145 * var(--u)); }
  .s-june     { left: calc(50% - 92.5 * var(--u)); right: auto; bottom: calc(12 * var(--u)); width: calc(181 * var(--u)); }
  .s-tilted   { display: none; }

  .content {
    min-height: inherit;
    padding: calc(40 * var(--u)) 16px calc(180 * var(--u));
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
  }

  .wordmark { width: calc(126 * var(--u)); }

  .film {
    max-width: 560px;
    /* 227 below the wordmark on an 844 tall phone; taller phones share the extra height */
    margin-top: calc(227 * var(--u) + max(0px, (100svh - 844 * var(--u)) / 2));
    padding: 6px;
    border-radius: 14px;
  }

  .film__screen { border-radius: 8px; }

  .film__note { left: 12px; top: 10px; font-size: 11px; }

  .film__play { width: 112px; height: 112px; margin: -56px 0 0 -56px; }
  .film__play-disc { width: 86px; height: 86px; gap: 2px; }
  .film__play svg { width: 20px; height: 20px; }
  .film__play-label { font-size: 12px; }

  .headline {
    margin-top: 28px;
    max-width: 300px;
    font-size: 24px;
    letter-spacing: 0;
  }

  /* Vertical film (the 9:16 phone board) */
  .is-vertical.page { min-height: max(100svh, 960 * var(--u)); }
  .is-vertical .content { padding-top: calc(32 * var(--u)); padding-bottom: calc(150 * var(--u)); }
  .is-vertical .film { max-width: 420px; margin-top: 25px; }
  .is-vertical .headline { margin-top: 24px; }
  .is-vertical .s-v       { left: calc(-10 * var(--u)); top: calc(12 * var(--u)); }
  .is-vertical .s-arrival { right: calc(-12 * var(--u)); top: calc(4 * var(--u)); }
  .is-vertical .s-departed { bottom: calc(22 * var(--u)); }
  .is-vertical .s-june    { left: auto; right: calc(12 * var(--u)); bottom: calc(30 * var(--u)); }
  .is-vertical .s-foot,
  .is-vertical .s-oval { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .film__play-disc, .film__bar, .ctl { transition: none; }
}
