@font-face {
  font-family: Space;
  src: url('/assets/fonts/space-grotesk-700.ttf');
  font-weight: 700;
  font-display: swap;
}

:root {
  color-scheme: dark;
  font-family: Space, system-ui, sans-serif;
  background: #18212a;
  color: #fff9ee;
}

body {
  margin: 0;
}

.hero {
  position: relative;
  isolation: isolate;
  box-sizing: border-box;
  display: grid;
  align-items: center;
  min-height: 100svh;
  padding: 2rem clamp(2rem, 8vw, 9rem) 5rem;
  background: url('/assets/tallinn-waterfront.webp') center / cover no-repeat;
}

.hero-video {
  position: absolute;
  z-index: -2;
  inset: 0 4% 0 auto;
  width: 64%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center 24%;
  mask-image: linear-gradient(90deg, transparent, black 20%, black 82%, transparent);
}

.hero::after {
  content: '';
  position: absolute;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, rgb(13 20 27 / 85%), rgb(13 20 27 / 47%) 42%, transparent 64%),
    linear-gradient(0deg, rgb(13 20 27 / 64%), transparent 25%);
}

.hero-content {
  justify-self: start;
}

h1 {
  margin: 0 0 1.5rem;
  font-size: clamp(4rem, 9vw, 8rem);
  line-height: 0.9;
  letter-spacing: -0.085em;
}

h1 span {
  display: block;
  margin-top: 0.8rem;
  padding-inline-start: 0.28em;
  font-size: clamp(0.8rem, 1.6vw, 1.2rem);
  line-height: 1.2;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}

.calendar-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-height: 3rem;
  padding: 0.65rem 1.5rem;
  border-radius: 999px;
  background: #fff2dc;
  color: #1b252d;
  text-decoration: none;
}

.calendar-link:hover {
  background: #fffaf0;
}

.calendar-link:focus-visible {
  outline: 2px solid white;
  outline-offset: 4px;
}

@media (max-width: 700px) and (orientation: portrait) {
  .hero {
    align-items: end;
    justify-items: center;
    padding: 2rem 1rem max(5rem, calc(env(safe-area-inset-bottom) + 4.25rem));
  }

  .hero-video {
    inset: 0;
    width: 100%;
    mask-image: none;
  }

  .hero::after {
    background: linear-gradient(0deg, rgb(13 20 27 / 93%), rgb(13 20 27 / 64%) 23%, transparent 49%);
  }

  .hero-content {
    justify-self: center;
    text-align: center;
  }
}

html, body { height: 100%; overflow: hidden; }
.hero-content { transition: opacity .45s ease, transform .65s cubic-bezier(.22,1,.36,1), filter .45s ease; }
.calendar-open .hero-content { opacity: 0; transform: translateY(-20px) scale(.96); filter: blur(10px); pointer-events: none; }
.calendar-overlay { position: fixed; inset: 0; width: 100%; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: transparent; overflow: hidden; }
.calendar-overlay::backdrop { background: rgb(6 12 22 / 24%); animation: veil-in .65s ease both; }
.calendar-frame { display: block; width: 100%; height: 100%; border: 0; background: transparent; }
.calendar-overlay[open] .calendar-frame { animation: calendar-in .85s cubic-bezier(.16,1,.3,1) both; }
.calendar-close { position: absolute; z-index: 10; top: max(12px, env(safe-area-inset-top)); right: max(16px, env(safe-area-inset-right)); width: 42px; height: 42px; border: 1px solid rgb(210 216 255 / 28%); border-radius: 50%; color: #f1f2ff; background: rgb(23 30 47 / 80%); backdrop-filter: blur(16px); font: 28px/1 system-ui; cursor: pointer; transition: background .2s, transform .2s; }
.calendar-close:hover { background: #474b78; transform: rotate(90deg); }
.calendar-close:focus-visible { outline: 2px solid #b1b5ff; outline-offset: 4px; }
.calendar-overlay.is-closing { animation: calendar-out .32s ease both; }
@keyframes calendar-in { from { opacity: 0; transform: translateY(40px) scale(.93); filter: blur(12px); } to { opacity: 1; transform: none; filter: blur(0); } }
@keyframes calendar-out { to { opacity: 0; transform: translateY(18px) scale(.98); } }
@keyframes veil-in { from { background: transparent; } }
@media (prefers-reduced-motion: reduce) { .hero-content, .calendar-close { transition: none; } .calendar-overlay, .calendar-overlay::backdrop, .calendar-overlay[open] .calendar-frame { animation: none; } }
