/* Playfair Display, embedded from the project's variable font
     (instanced at 400/700 and subset to the glyphs the page uses) */
  @font-face {
    font-family: 'Playfair Display';
    font-style: normal;
    font-weight: 400;
    src: url('../fonts/PlayfairDisplay-Regular.woff2') format('woff2');
  }
  @font-face {
    font-family: 'Playfair Display';
    font-style: normal;
    font-weight: 700;
    src: url('../fonts/PlayfairDisplay-Bold.woff2') format('woff2');
  }

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #000;
    cursor: url("../imgs/cursor.svg") 10 10, auto;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
  }
  #bgc, #gl, #noise {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
  }
  #noise {
    opacity: 0.07;
    mix-blend-mode: overlay;
  }
  #tvbox {
    position: fixed;
    pointer-events: none;
    /* mask shorthand: iOS Safari drops mask-size when prefixed and
       unprefixed longhands are mixed, leaving the mask at natural size */
    -webkit-mask: url("../imgs/tv-mask.png") 0 0 / 100% 100% no-repeat;
    mask: url("../imgs/tv-mask.png") 0 0 / 100% 100% no-repeat;
  }
  .tvvid {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #000;
    pointer-events: none;
  }
  .tvvid.hidden { visibility: hidden; }
  #tvblack {
    position: absolute;
    inset: 0;
    background: #000;
    opacity: 0;
    pointer-events: none;
  }
  #tvblack.on { opacity: 1; }
  /* ------- loading screen + reveal (Figma node 92:221) ------- */
  #scene {
    position: fixed;
    inset: 0;
  }
  #scene.zooming {
    transition: transform 1.8s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: transform;
  }
  #loader {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.6s ease 0.15s;
  }
  #loader.done {
    opacity: 0;
    pointer-events: none;
  }
  #loadLogo {
    position: relative;
    width: min(475px, 60vw);
  }
  #loadLogo > img {
    display: block;
    width: 100%;
  }
  #loadFill {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0%;
    overflow: hidden;
  }
  #loadFill img {
    display: block;
    width: min(475px, 60vw);
    height: 100%;
  }
  #loadLogo {
    transition: opacity 0.45s ease;
  }
  #loadLogo.out {
    opacity: 0;
  }
  /* tap-to-play hint: sits below the TV, above the copyright line */
  #tapHint {
    position: fixed;
    left: 50%;
    bottom: 68px;
    transform: translateX(-50%);
    width: 40px;
    height: 40px;
    z-index: 31;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.6s ease;
  }
  #tapHint.show { opacity: 0.9; }
  #tapHint svg {
    display: block;
    width: 24px;
    height: 24px;
    margin: 8px auto 0;
    color: #fff;
    filter: drop-shadow(0 1px 3px rgba(0,0,0,0.5));
    animation: tapPress 1.9s ease-in-out infinite;
    transform-origin: 50% 70%;
  }
  #tapHint::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 60%;
    width: 34px;
    height: 34px;
    margin: -17px 0 0 -17px;
    border: 1.5px solid rgba(255,255,255,0.85);
    border-radius: 50%;
    opacity: 0;
    animation: tapRipple 1.9s ease-out infinite;
  }
  @keyframes tapPress {
    0%, 22%  { transform: translateY(0) scale(1); }
    32%      { transform: translateY(3px) scale(0.88); }
    46%      { transform: translateY(0) scale(1); }
    100%     { transform: translateY(0) scale(1); }
  }
  @keyframes tapRipple {
    0%, 30%  { transform: scale(0.3); opacity: 0; }
    38%      { opacity: 0.7; }
    68%      { transform: scale(1.4); opacity: 0; }
    100%     { transform: scale(1.4); opacity: 0; }
  }
  @media (prefers-reduced-motion: reduce) {
    #tapHint svg, #tapHint::after { animation: none; }
  }
  /* header/footer arrive after the zoom, with a gentle fade */
  #hdr {
    opacity: 0;
    transform: translateY(-8px);
  }
  #ftr {
    opacity: 0;
    transform: translateY(8px);
  }
  #hdr.in, #ftr.in {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.7s ease, transform 0.7s ease;
  }
  #ftr.in { transition-delay: 0.15s; }
  @media (prefers-reduced-motion: reduce) {
    #scene.zooming { transition: none; }
    #hdr.in, #ftr.in { transition: none; }
  }

  /* ------- splash chrome (Figma node 90:56: header 90:154, footer 90:157) ------- */
  #hdr, #ftr {
    position: fixed;
    left: 0;
    width: 100vw;
    z-index: 31;
    color: #fff;
    font-family: 'Playfair Display', Georgia, serif;
    pointer-events: none;
  }
  #hdr { top: 0; height: 150px; }
  #ftr { bottom: 0; height: 100px; }
  /* the black gradient arrives after the bars have animated in and the
     blur is in place, then gently fades in (.grad is added by script) */
  #hdr::after, #ftr::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.9s ease;
    pointer-events: none;
  }
  #hdr::after {
    background: linear-gradient(to bottom, rgba(0,0,0,0.5) 0%, rgba(0,0,0,0) 100%);
  }
  #ftr::after {
    background: linear-gradient(to top, rgba(0,0,0,0.5) 0%, rgba(0,0,0,0) 100%);
  }
  #hdr.grad::after, #ftr.grad::after { opacity: 1; }
  /* gradient blur: 20px fading to 0 (header downwards, footer upwards) */
  #hdr::before, #ftr::before {
    content: '';
    position: absolute;
    inset: 0;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    pointer-events: none;
  }
  #hdr::before {
    -webkit-mask-image: linear-gradient(to bottom, #000 0%, transparent 100%);
    mask-image: linear-gradient(to bottom, #000 0%, transparent 100%);
  }
  #ftr::before {
    -webkit-mask-image: linear-gradient(to top, #000 0%, transparent 100%);
    mask-image: linear-gradient(to top, #000 0%, transparent 100%);
  }
  #bar {
    position: absolute;
    top: 20px;
    left: 30px;
    right: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  #logo {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 204px;
    height: 30px;
    display: block;
  }
  #coming {
    visibility: hidden;   /* revealed span-by-span by the typewriter */
    position: absolute;
    top: 56px;
    left: 0;
    width: 100%;
    margin: 0;
    text-align: center;
    font-weight: 700;
    font-size: 20px;
    line-height: 24px;
  }
  #ctl, #social {
    display: flex;
    gap: 16px;
    align-items: center;
  }
  #ctl button, #social a, #socialM a {
    width: 20px;
    height: 20px;
    padding: 0;
    border: 0;
    background: none;
    color: #fff;
    display: block;
    cursor: pointer;
    opacity: 0.95;
    transition: opacity 0.15s ease, transform 0.15s ease;
    pointer-events: auto;
  }
  #ctl button:hover, #social a:hover, #socialM a:hover { opacity: 1; transform: scale(1.1); }
  #ctl button svg, #social a svg, #socialM a svg { display: block; width: 20px; height: 20px; }
  #copy {
    position: absolute;
    bottom: 26px;
    left: 0;
    width: 100%;
    margin: 0;
    text-align: center;
    font-size: 16px;
    line-height: 24px;
    color: #fff;
  }
  #icoSoundOn { display: none; }
  #socialM { display: none; }
  @media (max-width: 640px) {
    /* stacked layout from the Figma phone frame (93:266): full-size logo
       and text; logo + Coming Soon centred, controls centred beneath,
       socials centred in the footer above the centred copyright */
    #logo { top: 20px; }
    #coming { top: 60px; font-size: 16px; line-height: 16px; }
    #social { display: none; }
    #ctl {
      position: absolute;
      top: 76px;                 /* 96px in the viewport: bar sits at 20px */
      left: 50%;
      transform: translateX(-50%);
    }
    #ftr { height: 124px; }
    #socialM {
      display: flex;
      position: absolute;
      bottom: 54px;
      left: 50%;
      transform: translateX(-50%);
      gap: 16px;
      align-items: center;
    }
    #copy { bottom: 20px; font-size: 14px; line-height: 14px; }
    #tapHint { bottom: 116px; }   /* icon lands at the frame's y726 */
  }
