@import url(https://fonts.googleapis.com/css?family=Unica+One);

/* Phones: no grey tap box; tapped links and buttons fade briefly instead */
html {
  -webkit-tap-highlight-color: transparent;
}

a,
button {
  -webkit-tap-highlight-color: transparent;
}

/* Tapped: text turns light blue with a soft glow for a moment */
.menu a.tapped {
  color: #b9d4f0;
  text-shadow: 0 0 16px rgba(185, 212, 240, 0.95), 0 0 4px rgba(185, 212, 240, 0.6);
}

:root {
  --navy: #123;
  --paper: whitesmoke;
  --ease: cubic-bezier(0.22, 0.8, 0.24, 1);
}

html, body {
  margin: 0;
  height: 100%;
}

body {
  font: 100%/1.4 "Unica One", sans-serif;
  text-transform: uppercase;
  background: var(--navy);
  color: var(--paper);
  overflow: hidden;
}

a:link,
a:visited {
  color: var(--paper);
  text-decoration: none;
}

/* ---------- Photos ---------- */
.hero {
  position: fixed;
  inset: 0;
  overflow: hidden;
}

.hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Darken where the menu sits so it stays readable on any photo */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to left, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0.15) 45%, rgba(0, 0, 0, 0) 70%);
}

/* ---------- Menu ---------- */
.menu {
  position: fixed;
  top: 50%;
  right: 9vw;
  transform: translateY(-50%);
  z-index: 1;
}

.menu ul {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: clamp(22px, 2.6vw, 42px);
  line-height: 2;
}

.menu a {
  display: inline-block;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.5);
  transition: color 0.2s, transform 0.3s var(--ease), text-shadow 0.15s;
}

/* Desktop: nudge with transform so the menu's width never changes (keeps every item moving the same) */
@media (hover: hover) and (pointer: fine) {
  .menu a:hover,
  .menu a:focus-visible {
    color: #c9d3dd;
    transform: translateX(10px);
  }
}



/* ---------- Hello card ---------- */
.card {
  position: fixed;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2vh;
  padding: 24px;
  box-sizing: border-box;
  background: var(--paper);
  color: var(--navy);
  text-align: center;
  transform: perspective(1200px) scale(1) translateX(0) rotateY(0);
  transform-origin: center;
  transition: transform 0.9s var(--ease), box-shadow 0.9s var(--ease);
  cursor: default;
}

.card h1 {
  margin: 0;
  font-weight: 400;
  font-size: clamp(44px, 7vw, 104px);
  line-height: 1;
  letter-spacing: 0.04em;
}

.signature {
  display: block;
  width: min(82vw, 980px);
  height: auto;
}

.welcome {
  margin: -0.5vh 0 1vh;
  font-size: clamp(18px, 2vw, 30px);
  letter-spacing: 0.12em;
  opacity: 0.8;
}

/* ---------- Desktop: mouse on the page tilts the card away ---------- */
@media (hover: hover) and (pointer: fine) {
  body:hover .card,
  body:has(.menu :focus-visible) .card,
  body.open .card {
    transform: perspective(1200px) scale(0.5) translateX(-16.66%) rotateY(25deg);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
  }
}

/* White signature that stays on the photo after the card flips away (phones only) */
.photo-sig {
  display: none;
}

/* ---------- Phones and touch: card flips up and away, signature stays on the photo ---------- */
@media not ((hover: hover) and (pointer: fine)) {
  .hero::after {
    background:
      linear-gradient(to bottom, rgba(0, 0, 0, 0.45) 0%, rgba(0, 0, 0, 0) 30%),
      linear-gradient(to top, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0.1) 45%, rgba(0, 0, 0, 0) 65%);
  }

  .menu {
    top: auto;
    right: 0;
    left: 0;
    bottom: max(6vh, 24px);
    transform: none;
    text-align: center;
  }

  .menu ul {
    font-size: clamp(22px, 6.5vw, 32px);
    line-height: 1.75;
  }

  /* The card slides straight up and off; its signature is handed to .photo-sig */
  .card {
    transform: translateY(0);
    transition: transform 0.9s var(--ease), box-shadow 0.9s var(--ease);
  }

  .card .signature {
    visibility: hidden; /* .photo-sig sits exactly on top of it */
  }

  body.open .card {
    transform: translateY(-100%);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
  }

  /* Where the signature ends up. home.js moves the image from the card's spot to here. */
  .photo-sig {
    display: block;
    position: fixed;
    top: max(9vh, 48px);
    left: calc(50% - min(84vw, 520px) / 2);
    width: min(84vw, 520px);
    z-index: 3;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
    pointer-events: none;
  }

  .photo-sig img {
    display: block;
    width: 100%;
    height: auto;
    transform-origin: top left;
    /* navy on the card ... */
    filter: brightness(1) invert(0) drop-shadow(0 2px 10px rgba(0, 0, 0, 0));
    transition: transform 0.9s var(--ease), filter 0.9s var(--ease);
  }

  /* ... white on the photo */
  body.open .photo-sig { pointer-events: auto; }
  body.open .photo-sig img {
    transform: none !important;
    filter: brightness(0) invert(1) drop-shadow(0 2px 10px rgba(0, 0, 0, 0.5));
  }
}

/* Short landscape phones: signature on the left, menu on the right */
@media (hover: none) and (max-height: 500px), (pointer: coarse) and (max-height: 500px) {
  .hero::after {
    background: linear-gradient(to left, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0.1) 45%, rgba(0, 0, 0, 0) 70%),
      linear-gradient(to right, rgba(0, 0, 0, 0.35) 0%, rgba(0, 0, 0, 0) 45%);
  }
  .menu {
    left: auto;
    right: 6vw;
    top: 50%;
    bottom: auto;
    transform: translateY(-50%);
    text-align: left;
  }
  .menu ul { line-height: 1.5; }
  .signature { width: min(70vw, 60vh * 3.1); }
  .photo-sig {
    top: calc(50% - min(46vw, 420px) * 0.16);
    left: 6vw;
    width: min(46vw, 420px);
  }
}

/* ---------- Reduced motion: instant tilt ---------- */
@media (prefers-reduced-motion: reduce) {
  .card,
  body.open .card,
  .photo-sig img,
  body.open .photo-sig img { transition: none; }
}
