/* EB Garamond stands in for the original's Adobe Typekit faces (minion-pro and
   mrs-eaves-roman-petite-caps), which were licensed through Squarespace. */
@font-face {
  font-family: 'EB Garamond';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/ebgaramond-regular.woff2') format('woff2');
}

@font-face {
  font-family: 'EB Garamond';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/ebgaramond-semibold.woff2') format('woff2');
}

:root {
  --ink: #000;
  --ink-muted: #444;
  --paper: #fff;
  --serif: 'EB Garamond', Georgia, 'Times New Roman', serif;
  --fade: 1s;
}

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

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

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  -webkit-font-smoothing: antialiased;
}

/* dvh so mobile browser chrome doesn't clip the panel. */
.page {
  display: grid;
  grid-template-columns: 1fr 1fr;
  height: 100dvh;
}

.copy {
  position: relative;
  grid-column: 1;
  grid-row: 1;
  background: var(--paper);
  text-align: center;
}

/* Logo pins to the top; the group centres on the panel's full height (not its
   content box), so both are positioned rather than laid out in flow. */
.copy__logo {
  position: absolute;
  top: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: block;
  width: 211px;
  height: auto;
}

.copy__group {
  position: absolute;
  top: 50%;
  left: 60px;
  right: 60px;
  transform: translateY(-50%);
}

/* The original's Mrs Eaves face draws A-Z as petite capitals: measured ink height
   is 0.465em, where a normal serif's caps are ~0.68em. EB Garamond's small caps
   come out at 0.470em, so lowercasing first (making every glyph a small cap, as
   the original renders them uniformly) reproduces it at the same 83px.
   The 0.6 line-height is what gives the heading its tight vertical crop. */
.copy__heading {
  margin: 0 0 30px;
  /* Tracked out to the original's 470px width; EB Garamond's small caps are
     narrower than Mrs Eaves'. padding-left offsets the trailing letter-space
     so the glyphs sit optically centred rather than 2px left. */
  padding-left: 4px;
  font-size: 83px;
  font-weight: 400;
  line-height: 0.6;
  letter-spacing: 4px;
  text-transform: lowercase;
  font-variant-caps: small-caps;
  color: var(--ink);
}

.copy__text {
  margin: 0;
  font-size: 18px;
  line-height: 1.1;
  color: var(--ink-muted);
}

.copy__button {
  display: inline-block;
  /* Right padding is 2px lighter than left to offset the trailing letter-space. */
  margin-top: 40px;
  padding: 16px 21px 16px 23px;
  border: 2px solid var(--ink);
  border-radius: 4px;
  background: transparent;
  color: var(--ink);
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 2px;
  text-transform: uppercase;
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.copy__button:hover,
.copy__button:focus-visible {
  background: var(--ink);
  color: var(--paper);
}

.gallery {
  position: relative;
  grid-column: 2;
  grid-row: 1;
  overflow: hidden;
  background: #454846; /* matches the original's gallery backdrop while images load */
}

.gallery__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity var(--fade) ease-in-out;
}

.gallery__img.is-active {
  opacity: 1;
}

/* Photos on top, copy below. The panel is content-height and the page scrolls
   past the fold, as the original does — the two halves aren't equal here. */
@media (max-width: 768px) {
  .page {
    grid-template-columns: 1fr;
    grid-template-rows: 50vh auto;
    height: auto;
    min-height: 100dvh;
  }

  .gallery {
    grid-column: 1;
    grid-row: 1;
  }

  .copy {
    grid-column: 1;
    grid-row: 2;
    padding: 60px 20px;
  }

  /* Both drop back into normal flow at this size. */
  .copy__logo {
    position: static;
    transform: none;
    margin: 0 auto 60px;
  }

  .copy__group {
    position: static;
    transform: none;
    left: auto;
    right: auto;
  }

  .copy__text {
    font-size: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gallery__img {
    transition: none;
  }

  .copy__button {
    transition: none;
  }
}
