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

:root {
  --black: #000;
  --white: #fff;
}

body {
  background: #000;
  font-family: "objektiv-mk1", sans-serif;
  overflow: hidden;
  width: 100vw;
  height: 100dvh;
  font-weight: 200;
  text-transform: uppercase;
}

/* ── CANVAS STACK ── */
#video-el {
  display: none;
}

#foil-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

/* ── CONTENT OVERLAY ── */
#content {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  max-width: 1200px;
  margin: 0 auto;
  z-index: 10;
  display: flex;
  flex-direction: column;
  padding: 48px 16px;
  pointer-events: none;
}

/* ── LOGO ── */
#logo {
  background-image: url("images/set-of-all-sets.webp");
  background-position: center center;
  background-repeat: no-repeat;
  background-size: cover;
  position: fixed;
  inset: 0;
  top: var(--content-height, 0px);
  z-index: 2;
  mix-blend-mode: multiply;

  filter: drop-shadow(0 0 0px #000);
  opacity: 0;
  transition: opacity 0.8s ease;
}

#logo.loaded {
  opacity: 1;
}

/* ── FIT-TO-WIDTH LINE (shared, via kizu.dev/fit-to-width) ── */
@property --captured-length {
  syntax: "<length>";
  initial-value: 0px;
  inherits: true;
}

.fit-line {
  display: flex;
  container-type: inline-size;
  --captured-length: initial;
  --support-sentinel: var(--captured-length, 9999px);

  & > [aria-hidden] {
    visibility: hidden;
  }

  & > :not([aria-hidden]) {
    flex-grow: 1;
    container-type: inline-size;
    --captured-length: 100cqi;
    --available-space: var(--captured-length);

    & > span {
      --support-sentinel: inherit;
      --captured-length: 100cqi;
      --ratio: tan(
        atan2(
          var(--available-space),
          var(--available-space) - var(--captured-length)
        )
      );
      --font-size: clamp(
        0.1em,
        1em * var(--ratio),
        var(--max-font-size, infinity * 1px) - var(--support-sentinel)
      );
      inline-size: var(--available-space);
      display: block;
      white-space: nowrap;
      font-size: var(--font-size);
      text-align: center;
    }
  }
}

/* ── HEADING ── */
#heading {
  display: flex;
  flex-direction: column;
  gap: 0.5em;
  font-weight: 200;
  letter-spacing: 0.08em;
  color: #000;
  mix-blend-mode: multiply;

  line-height: 1;
  padding-top: 0.15em;
}

/* ── SUBHEADING ── */
#subheading {
  display: flex;
  flex-direction: column;
  gap: 0.5em;
  font-weight: 200;
  letter-spacing: 0.08em;
  color: #000;
  mix-blend-mode: multiply;

  line-height: 1;
  padding-top: 0.15em;

  & .fit-line > :not([aria-hidden]) > span {
    font-size: calc(var(--font-size) * 0.955);
  }

  & a {
    color: inherit;
    text-decoration: none;
    pointer-events: all;
  }

  & a:hover {
    animation: rainbow-flash 0.4s linear infinite;
  }
}

/* ── SOCIAL LINKS ── */
#social-links {
  display: block;
  text-align: center;
  padding-top: 20px;
  pointer-events: all;
}

#social-links a,
#mail-btn {
  display: inline-flex;
  margin: 0 10px;
  opacity: 0.8;
  transition: opacity 0.2s;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

#social-links a:hover,
#mail-btn:hover {
  opacity: 1;
}

#social-links a:hover img,
#mail-btn:hover img {
  mix-blend-mode: normal;
  animation: rainbow-flash 0.4s linear infinite;
}

@keyframes rainbow-flash {
  from {
    filter: invert(1) sepia(1) saturate(10) hue-rotate(0deg);
  }
  to {
    filter: invert(1) sepia(1) saturate(10) hue-rotate(360deg);
  }
}

@keyframes rainbow-bg {
  0% {
    background-color: #ff0080;
  }
  16% {
    background-color: #ff8c00;
  }
  33% {
    background-color: #ffe100;
  }
  50% {
    background-color: #00ff88;
  }
  66% {
    background-color: #00cfff;
  }
  83% {
    background-color: #a020f0;
  }
  100% {
    background-color: #ff0080;
  }
}

#social-links img {
  width: 24px;
  height: 24px;
  mix-blend-mode: multiply;
}

@media (orientation: portrait) and (max-width: 599px) {
  #logo {
    background-size: 200%;
    background-position: center 55%;
  }
}

/* ── RESPONSIVE BREAKPOINT ── */
.wide-only {
  display: flex;
}
.narrow-only {
  display: none;
}

@media (max-width: 999px) {
  .wide-only {
    display: none;
  }
  .narrow-only {
    display: flex;
  }
}

#silver-screen {
  background: linear-gradient(
    to bottom,
    rgba(153, 153, 153, 0.95) 0%,
    rgba(153, 153, 153, 0.85) 25%,
    rgba(153, 153, 153, 0.65) 40%,
    rgba(153, 153, 153, 0.45) 100%
  );
  position: fixed;
  inset: 0;
  z-index: 1;
}

/* ── CONTACT SCREEN ── */
#content,
#logo {
  transition: opacity 0.6s ease;
}

.contact-open #content {
  opacity: 0;
  pointer-events: none;
}

.contact-open #logo.loaded {
  opacity: 0;
}

#contact-screen {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease;
}

#contact-screen.visible,
#contact-screen:target {
  opacity: 1;
  pointer-events: all;
}

body:has(#contact-screen:target) #content {
  opacity: 0;
  pointer-events: none;
}

body:has(#contact-screen:target) #logo.loaded,
body:has(#contact-screen:target) #logo {
  opacity: 0;
}

#contact-close {
  position: absolute;
  top: 24px;
  right: 24px;
  background: none;
  border: none;
  color: #000;
  text-decoration: none;
  font-size: 36px;
  font-weight: 300;
  cursor: pointer;
  padding: 8px;
  line-height: 1;
  font-family: inherit;
  mix-blend-mode: multiply;
}

#contact-close:hover {
  animation: rainbow-flash 0.4s linear infinite;
}

#contact-body {
  width: 100%;
  max-width: 1200px;
  padding: 48px 16px;
  display: flex;
  flex-direction: column;
  gap: 1em;
  overflow-y: auto;
}

.contact-entry {
  display: flex;
  flex-direction: column;
  gap: 0.5em;
  font-weight: 200;
  letter-spacing: 0.08em;
  color: #000;
  line-height: 1;
  padding-top: 0.5em;
}

.contact-label-line {
  --max-font-size: 30px;
  font-size: 10px;
}

.contact-label-line > :not([aria-hidden]) > span {
  font-size: calc(var(--font-size) * 0.955);
  opacity: 0.75;
}

.contact-entry .fit-line:not(.contact-label-line) {
  --max-font-size: 60px;
  font-size: 10px;
}

.contact-entry a {
  color: inherit;
  text-decoration: none;
}

.contact-entry a:hover {
  animation: rainbow-flash 0.4s linear infinite;
}

@media (max-width: 599px) {
  .contact-entry {
    font-weight: 400;
  }
}

/* ── PERMISSION SCREEN ── */
#permission-screen {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 100;
  display: var(--perm-display, none);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 32px;
  transition: opacity 0.8s ease;
}

#permission-screen.hidden {
  opacity: 0;
  pointer-events: none;
}

#perm-sub {
  font-size: 14px;
  color: #999;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-align: center;
  max-width: 380px;
  line-height: 1.8;
}

#perm-btn {
  font-size: 14px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: #000;
  background: #fff;
  border: none;
  padding: 16px 40px;
  cursor: pointer;
}
#perm-btn:hover {
  animation: rainbow-bg 0.4s linear infinite;
  color: #000;
}

#no-cam-btn {
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #999;
  background: none;
  border: none;
  cursor: pointer;
  margin-top: -10px;
}
#no-cam-btn:hover {
  animation: rainbow-flash 0.4s linear infinite;
}
