@font-face {
  font-family: 'Libre Bodoni';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/libre-bodoni-latin-ext-400.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Libre Bodoni';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/libre-bodoni-latin-400.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Raleway';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url(fonts/raleway-latin-ext-300.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Raleway';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url(fonts/raleway-latin-300.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Raleway';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(fonts/raleway-latin-ext-500.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Raleway';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(fonts/raleway-latin-500.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---- Site ---- */
:root {
  --text: #fff;
  --accent: #ffd1ae;
  --dark: rgba(0, 0, 0, 0.86);      /* how dark the page is from the second screen on */
  --serif: 'Libre Bodoni', Georgia, serif;
  --sans: 'Raleway', Arial, sans-serif;
  --side: clamp(20px, 17vw, 256px); /* left edge of the text */
  --pad: 64px;                      /* logo's distance from the screen edges */
  --h: 1px;                         /* logo size in the header: 1px = as drawn in the design */
  --glide: cubic-bezier(0.16, 1, 0.3, 1);  /* fast start, long soft landing: things arriving */
  --sweep: cubic-bezier(0.7, 0, 0.2, 1);   /* slow start and end: things travelling */
  --open: cubic-bezier(0, 0, 0.58, 1);     /* off at once, slowing to a stop: the pace set for everything in the Figma file */
}

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

/* Always show the scrollbar's space, so nothing jumps sideways when the opening ends and the page can scroll. */
html { overflow-y: scroll; }

body {
  margin: 0;
  background: #000;
  color: var(--text);
  font: 300 20px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

/* ---- Background ----
   The photo (the glass dome from the Figma file), the glass doors and the shading are drawn by the graphics
   card on the <canvas> (see app.js). .photo is only the stand-in for browsers that cannot do that: the plain photo, darkened. */
.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: #000; }
.bg canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.photo { position: absolute; inset: 0; background: linear-gradient(#000, rgba(0, 0, 0, 0.5) 31%, rgba(0, 0, 0, 0.7) 76%, #000), url(img/room.webp) center 40% / cover; }
.gl .photo { display: none; }

/* ---- Logo: five pieces, so they can move from the middle of the screen up into the header ---- */
.logo img {
  position: absolute;
  z-index: 30;
  left: calc(var(--pad) + var(--hx) * var(--h));
  top: calc(var(--hy) * var(--h));
  width: calc(var(--hw) * var(--h));
  height: auto;
}
/* --hx/--hy/--hw: place and width in the header. --x/--y/--w: in the big logo, measured from the screen's centre.
   --n: the order the pieces appear in. */
.logo .the     { --hx: 0;   --hy: 30; --hw: 37.4;  --x: -250;   --y: -143;  --w: 113.2; --n: 0; }
.logo .private { --hx: 0;   --hy: 50; --hw: 168;   --x: -249.3; --y: -80.2; --w: 499.3; --n: 1; }
.logo .room    { --hx: 183; --hy: 50; --hw: 121.4; --x: -250;   --y: 18.2;  --w: 360.9; --n: 2; }
.logo .key     { --hy: 50; --hw: 65;  --x: 129;    --y: 36;    --w: 121;   --n: 4; left: calc(50% - 32.5 * var(--h)); }
.logo .by      { --hy: 61; --hw: 247; --x: -237.4; --y: 125.9; --w: 487.4; --n: 6; left: calc(100% - var(--pad) - 247 * var(--h)); }

/* ---- Screens ---- */
.screen { position: relative; }
.screen, .pin { min-height: 100vh; min-height: 100svh; }
/* The text sits in the middle of the screen's height, as in the Figma file (there the block's middle is the frame's middle). */
.pin {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 110px var(--side);
}

/* Going down into the dark: the black at the bottom of the first screen rises as you scroll, and every screen
   after the second is that dark all over. Only a hint of the room is left behind the text. */
.screen + .screen { background: linear-gradient(transparent, rgba(0, 0, 0, 0.12) 12%, rgba(0, 0, 0, 0.42) 30%, rgba(0, 0, 0, 0.72) 48%, var(--dark) 64%); }
.screen + .screen ~ .screen { background: var(--dark); }

h1, h2 {
  margin: 0;
  max-width: 9.25em;
  font: 400 clamp(34px, 5.3vw, 80px)/1 var(--serif);
  text-transform: uppercase;
}

/* Small peach capitals above each heading. */
.label {
  margin: 0 0 23px 5px;
  color: var(--accent);
  font: 500 14px/20px var(--sans);
  text-transform: uppercase;
}
/* Light capitals under a heading. */
.lead {
  margin: clamp(32px, 8.7vh, 86px) 0 0 6px;
  max-width: 21.4em;
  font-size: clamp(18px, 2vw, 30px);
  line-height: 1;
  text-transform: uppercase;
}
/* Running text. */
.body { margin: 33px 0 0 5px; max-width: 500px; line-height: 1.25; }
.lead + .body { margin-top: 24px; }

/* A short list under a heading: one row per point, the peach term on the left and one line of text beside it.
   As wide as the headings (740 in the design). */
.points { margin: 44px 0 0 5px; max-width: 735px; }
.points div { display: grid; grid-template-columns: 200px 1fr; gap: 2px 24px; align-items: baseline; padding: 13px 0 14px; border-top: 1px solid rgba(255, 255, 255, 0.16); }
.points dt { color: var(--accent); font: 500 14px/20px var(--sans); text-transform: uppercase; }
.points dd { margin: 0; line-height: 1.25; }

/* The last screen: everything in the middle. The key, twice the size it has in the header (130 x 60), and under it
   two ways in, one above the other: pill-shaped buttons, 350 wide and 10 apart in the design. */
.end .pin { align-items: center; }
.end .door img { display: block; width: 130px; height: auto; }
.ways { display: grid; gap: 10px; width: min(100%, 350px); margin-top: clamp(56px, 13vh, 125px); }
.pill {
  position: relative;
  height: 50px;
  border-radius: 25px;
  background: rgb(204 188 173 / 0.8);
  color: #533f2e;
  font: 500 15px/50px var(--sans);
  text-align: center;
  text-transform: uppercase;
  text-decoration: none;
  transition: background 0.3s, color 0.3s;
}
.pill:hover { background: #ccbcad; }
/* The second choice: only an edge, light at the top and bronze at the bottom. */
.pill.quiet { background: none; color: #d3c4b9; }
.pill.quiet::before {
  content: ''; position: absolute; inset: 0; padding: 1px; border-radius: inherit;
  background: linear-gradient(#ccbcad, #70563f);
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  pointer-events: none;
}
.pill.quiet:hover { background: none; color: var(--text); }
/* The "page not found" page. */
.note { margin: 24px 0 0; }

/* ---- Pinned screens (motion on, and a screen tall enough to fit a whole screen of text) ----
   The text of every screen sits at the same fixed place; scrolling only decides which one is showing.
   Each <section> is then just an empty stretch of scrolling. The script marks the one in view with "on"
   and the ones already passed with "past". */
@media (min-height: 640px) {
  .motion .logo img { position: fixed; }
  .motion .screen { height: 110vh; min-height: 0; }
  .motion .pin {
    position: fixed;
    inset: 0;
    visibility: hidden;
    transition: visibility 0s 0.7s;
  }
  .motion .on .pin { visibility: visible; transition-delay: 0s; }
  /* Text grows into place, as the logo does in the Figma file: from a little smaller and see-through to full size.
     On the way out it fades while growing a touch more, as if you walk past it. */
  .motion .pin > * {
    opacity: 0;
    scale: 0.84;
    transform-origin: 0 50%;
    transition: opacity 0.6s ease, scale 0.7s ease;
  }
  .motion .past .pin > * { scale: 1.08; }
  .motion:not(.intro) .on .pin > * {
    opacity: 1;
    scale: 1;
    transition: opacity 1s var(--open), scale 1s var(--open);   /* 1 s in the design, the whole block at once */
    transition-delay: 0.35s;
  }
  .motion .end .pin > * { transform-origin: 50% 50%; }
  /* On the last screen the key is in the middle, so the one in the header steps aside.
     (Not during the opening: there the key moves with the rest of the logo, see below.) */
  .motion:not(.intro) .logo .key { transition: opacity 0.3s var(--open), visibility 0s; }
  .motion:has(.end.on) .logo .key { opacity: 0; visibility: hidden; transition-delay: 0s, 0.3s; }
  .pin > :nth-child(2) { --i: 1; } .pin > :nth-child(3) { --i: 2; } .pin > :nth-child(4) { --i: 3; } .pin > :nth-child(5) { --i: 4; }
}

/* On touch screens the browser stops the scrolling on each screen by itself. (With a mouse or trackpad the script
   does it, so it can set the pace: see "go" in app.js.) */
@media (min-height: 640px) and (hover: none) and (pointer: coarse) {
  .motion { scroll-snap-type: y mandatory; scroll-behavior: smooth; }
  .motion .screen { scroll-snap-align: start; scroll-snap-stop: always; }
}

/* ---- Opening: glass doors with the key, doors slide apart, logo shows, then moves up into the header ----
   The script sets these on <html>: intro + is-loading → is-open → is-in, then removes them all.
   Without them (no script, or motion turned off) the page is simply the finished page above.
   The doors themselves are drawn on the canvas (app.js); here is everything that sits on top of them. */
.loader, .glow { display: none; }

.intro body { position: fixed; inset: 0; overflow: hidden; } /* no scrolling during the opening */
.intro .loader, .intro .glow { display: block; position: fixed; }

/* The key, breathing while the photo loads. When the doors start to part it shrinks away quickly (0.2 s in the design). */
.intro .loader {
  z-index: 25;
  left: calc(50% - 61px);
  top: calc(50% - 28px);
  width: 123px;
  animation: breathe 1.6s ease-in-out infinite alternate;
  transition: filter 0.2s var(--open), scale 0.2s var(--open);
}
.intro:not(.is-loading) .loader { filter: opacity(0); scale: 0.39; }
@keyframes breathe { from { opacity: 1; } to { opacity: 0.2; } }

/* Behind the big logo, only while it is in the middle: the design's soft black ellipse (50% black, blurred far out). */
.intro .glow {
  z-index: 10;
  inset: 0;
  background: radial-gradient(ellipse 47% 43% at center, rgba(0, 0, 0, 0.4), transparent);
  opacity: 0;
  transition: opacity 2s var(--open);
}
.intro.is-open:not(.is-in) .glow { opacity: 1; transition-delay: 0.5s; }

/* Big logo in the middle: --u is the size of one design pixel (the logo is 500 of them wide).
   As in the design it grows into place as one piece: from two thirds of its size, a little lower, and see-through,
   to full size, over 2 s, starting half a second after the doors. */
.intro .logo img {
  --u: calc(min(72vw, 500px, 120vh) / 500);
  position: fixed;
  left: calc(50% + var(--x) * var(--u));
  top: calc(50% + var(--y) * var(--u));
  width: calc(var(--w) * var(--u));
  transform-origin: 0 0;
  transition: opacity 2s var(--open), translate 2s var(--open), scale 2s var(--open), transform 2s var(--open);
  transition-delay: 0.5s;
}
.intro.is-loading .logo img {
  opacity: 0;
  scale: 0.657;
  translate: calc((var(--x) * -0.343 + 14) * var(--u)) calc((var(--y) * -0.343 + 49) * var(--u));
}
/* Up into the header: the script works out how far each piece has to travel and shrink, and sets it as a transform.
   (.measure is on for an instant, only so the script can read where the header puts each piece.) */
.intro.is-in .logo img { transition-delay: 0s; }
.intro.measure .logo img {
  left: calc(var(--pad) + var(--hx) * var(--h));
  top: calc(var(--hy) * var(--h));
  width: calc(var(--hw) * var(--h));
}
.intro.measure .logo .key { left: calc(50% - 32.5 * var(--h)); }
.intro.measure .logo .by  { left: calc(100% - var(--pad) - 247 * var(--h)); }

/* The text of the first screen grows in once the logo is on its way up. */
.intro .pin > * {
  opacity: 0;
  scale: 0.84;
  transform-origin: 0 50%;
  transition: opacity 1s var(--open), scale 1s var(--open);   /* 1 s in the design */
}
.intro.is-in .hero .pin > * { opacity: 1; scale: 1; transition-delay: 1.4s; }

/* ---- Small screens: smaller logo and text, key on the right, "hosted by Sevron" only in the big logo ---- */
@media (max-width: 900px) {
  :root { --pad: 20px; --h: 0.7px; --side: 20px; }
  body { font-size: 16px; }
  .logo .key, .intro.measure .logo .key { left: calc(100% - var(--pad) - 65 * var(--h)); }
  .logo .by { opacity: 0; }
  .intro.is-open:not(.is-in) .logo .by { opacity: 1; }
  .pin { padding: 90px var(--side) 50px; }
  .label { margin-bottom: 14px; }
  .lead { line-height: 1.1; margin-top: 28px; }
  .body { margin-top: 24px; }
  .points { margin-top: 24px; }
  .points div { grid-template-columns: 1fr; padding: 9px 0 10px; }
  .end .door img { width: 98px; }
  .ways { margin-top: 48px; }
}

/* ---- Low screens (small laptops): tighter gaps, so the fullest screens stay clear of the logo ---- */
@media (max-height: 800px) and (min-width: 901px) {
  .lead { margin-top: 36px; }
  .points { margin-top: 30px; }
}
