:root {
  --paper: #f2efe9;
  --ink: #1d2226;
  --muted: #8a8a86;
  --line: rgba(29, 34, 38, 0.12);
  --bezel-hi: #fbfaf7;
  --bezel-lo: #dcd8d0;
  --frame: #c9c4bb;
  --shade: #ece8e0;
  --accent: #0f7f86;
  --white: #ffffff;
  /* the glass of the window: an aeroplane window is a tall rounded rectangle */
  --gh: min(52vh, 500px, calc(58vw * 1.42));
  --gw: calc(var(--gh) / 1.42);
  --gr: calc(var(--gw) * 0.42);
}

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

html, body { height: 100%; overflow-x: clip; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: "Mona Sans Variable", system-ui, sans-serif;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

.stage {
  position: relative;
  height: 100vh;
  overflow: clip;
}

/* ---- the header ---- */
.top {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 4;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: clamp(14px, 3.2vmin, 30px) clamp(16px, 4vmin, 40px);
  color: var(--ink);
  pointer-events: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 640;
  font-size: clamp(13px, 1.9vmin, 16px);
  letter-spacing: -0.01em;
}

.brand__mark { width: 1.15em; height: 1.15em; }

.top__nav {
  font-family: "JetBrains Mono Variable", ui-monospace, monospace;
  font-size: clamp(10px, 1.4vmin, 12px);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.7;
}

.top__nav span { margin-left: 1.4em; }

/* ---- the window ---- */
.win {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  align-content: center;
  gap: clamp(10px, 2.4vmin, 22px);
  pointer-events: none;
}

.win__bezel {
  /* the plastic surround: lighter at the top-left, a soft shadow on the wall */
  padding: calc(var(--gw) * 0.11);
  border-radius: calc(var(--gr) + var(--gw) * 0.15);
  background:
    radial-gradient(120% 90% at 30% 18%, var(--bezel-hi), var(--bezel-lo) 78%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 -1px 0 rgba(0, 0, 0, 0.06) inset,
    0 0 0 1px rgba(29, 34, 38, 0.05),
    0 30px 60px -34px rgba(40, 36, 28, 0.45),
    0 6px 14px -8px rgba(40, 36, 28, 0.2);
  will-change: transform, opacity;
}

.win__frame {
  /* the inner frame, a step down towards the glass */
  padding: calc(var(--gw) * 0.035);
  border-radius: calc(var(--gr) + var(--gw) * 0.035);
  background: linear-gradient(160deg, var(--frame), #e6e2da 60%, #d4cfc6);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12) inset, 0 1px 0 rgba(255, 255, 255, 0.7);
}

.win__glass {
  /* only the place of the glass: the photo is the hero, clipped to this shape and drawn above the bezel */
  width: var(--gw);
  height: var(--gh);
  border-radius: var(--gr);
}

.pane {
  /* laid by the script exactly on the glass, above the photo */
  position: absolute;
  z-index: 3;
  left: 0;
  top: 0;
  overflow: hidden;
  pointer-events: none;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08) inset, 0 6px 18px rgba(0, 0, 0, 0.2) inset;
}

.win__glint {
  position: absolute;
  inset: -20% -60%;
  background: linear-gradient(115deg, transparent 42%, rgba(255, 255, 255, 0.34) 48%, rgba(255, 255, 255, 0.08) 53%, transparent 58%);
  transform: translateX(-60%);
  opacity: 0;
}

.win__shade {
  /* the pull-down shade: off-white plastic with fine ribs and a lip at the bottom */
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #f4f1eb, var(--shade) 70%, #e2ddd3);
  will-change: transform;
}

.win__ribs {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(180deg, transparent 0 calc(var(--gh) / 26 - 1px), rgba(0, 0, 0, 0.045) calc(var(--gh) / 26 - 1px) calc(var(--gh) / 26));
  opacity: 0.8;
}

.win__lip {
  position: absolute;
  left: 50%;
  bottom: calc(var(--gh) * 0.035);
  width: calc(var(--gw) * 0.34);
  height: calc(var(--gh) * 0.022);
  min-height: 4px;
  translate: -50% 0;
  border-radius: 99px;
  background: linear-gradient(180deg, #d5d0c7, #c3bdb2);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8), 0 1px 2px rgba(0, 0, 0, 0.18) inset;
}

.win__seat {
  font-family: "JetBrains Mono Variable", ui-monospace, monospace;
  font-size: clamp(10px, 1.4vmin, 12px);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.win__seat b { color: var(--ink); font-weight: 600; }

/* ---- the hero: the whole page, clipped to the glass until the window opens ---- */
.hero {
  position: absolute;
  inset: 0;
  z-index: 2;
  overflow: hidden;
  clip-path: inset(50% 50% 50% 50%);
  background: #8fc3c5;
}

.hero__photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
  will-change: transform;
}

.hero__grain {
  /* a fine grain over the photo, so it reads as film and not as a flat screen */
  position: absolute;
  inset: 0;
  /* no blend mode: with mix-blend-mode Chrome lets the grain escape the clip-path of the hero */
  opacity: 0.07;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='160' height='160' filter='url(%23n)'/></svg>");
}

.hero__shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 20, 26, 0.32), transparent 30%, transparent 48%, rgba(0, 20, 26, 0.55));
  opacity: 0;
}

.dest {
  position: absolute;
  left: clamp(16px, 5vmin, 56px);
  right: clamp(16px, 5vmin, 56px);
  bottom: clamp(18px, 6vmin, 64px);
  color: var(--white);
}

.dest__kicker {
  font-family: "JetBrains Mono Variable", ui-monospace, monospace;
  font-size: clamp(10px, 1.5vmin, 13px);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.9;
  margin-bottom: clamp(6px, 1.4vmin, 14px);
}

.dest__title {
  font-size: clamp(38px, min(12.5vw, 15vh), 168px);
  line-height: 0.92;
  font-weight: 640;
  font-variation-settings: "wdth" 112;
  letter-spacing: -0.03em;
  white-space: nowrap;
  margin-bottom: clamp(12px, 3vmin, 28px);
}

.dest__title .m {
  /* each letter rises inside its own mask */
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
  padding: 0.06em 0 0.1em;
  margin: -0.06em 0 -0.1em;
}

.dest__title .c { display: inline-block; will-change: transform; }

.pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: clamp(38px, 6vmin, 50px);
  padding: 0 clamp(16px, 2.6vmin, 24px);
  color: var(--ink);
  text-decoration: none;
  font-size: clamp(13px, 1.9vmin, 15px);
  font-weight: 600;
  font-variation-settings: "wdth" 100;
  transition: font-variation-settings 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: auto;
}

.pill__bg {
  position: absolute;
  inset: 0;
  border-radius: 99px;
  background: var(--white);
  box-shadow: 0 10px 30px -12px rgba(0, 20, 26, 0.6);
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.pill__text, .pill__arrow { position: relative; }

.pill__arrow { width: 16px; height: 16px; color: var(--accent); transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1); }

@media (hover: hover) {
  .pill:hover { font-variation-settings: "wdth" 118; }
  .pill:hover .pill__bg { transform: scale(1.05, 1.08); }
  .pill:hover .pill__arrow { transform: translateX(3px); }
}

.pill:active .pill__bg { transform: scale(0.96); }

@media (max-width: 520px) {
  .top__nav span { display: none; }
}

/* on tall screens the wide photo is cropped on the shoreline, not on the sand in the middle */
@media (max-aspect-ratio: 1/1) {
  .hero__photo { object-position: 50% 50%; }
}
