@font-face {
  font-family: 'Cormorant Garamond';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('./assets/fonts/cormorant-garamond-medium.woff2') format('woff2');
}

@font-face {
  font-family: 'Cormorant Garamond';
  font-style: italic;
  font-weight: 500;
  font-display: swap;
  src: url('./assets/fonts/cormorant-garamond-medium-italic.woff2') format('woff2');
}

@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url('./assets/fonts/manrope-latin.woff2') format('woff2');
}

* { box-sizing: border-box; }

:root {
  color-scheme: light;
  --ink: #28312b;
  --paper: #fff;
  --copper: #8b5136;
  --forest: #254b3f;
  --edge: clamp(14px, 2.6vmin, 32px);
  --gutter: clamp(28px, 10.6vw, 180px);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Manrope', system-ui, sans-serif;
}

.gallery {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  min-height: 100vh;
  min-height: 100svh;
  padding: clamp(112px, 15svh, 160px) var(--gutter) clamp(64px, 9svh, 100px);
  overflow: clip;
  background: var(--paper);
}

.frame {
  position: absolute;
  inset: var(--edge);
  border: 1px solid #e5e9e4;
  pointer-events: none;
}

.mast {
  position: absolute;
  z-index: 1;
  top: clamp(28px, 6svh, 64px);
  left: var(--gutter);
}

.mast img { display: block; width: 36px; height: 36px; }

.invitation {
  position: relative;
  z-index: 3;
  width: min(38vw, 28rem);
}

.eyebrow {
  margin: 0 0 28px;
  color: var(--copper);
  font-size: .625rem;
  font-weight: 500;
  line-height: 1.6;
  letter-spacing: .2em;
  text-transform: uppercase;
}

.eyebrow span { margin: 0 5px; color: #8b7764; }

h1 {
  margin: 0;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(5.25rem, 8.4vw, 8.75rem);
  font-weight: 500;
  line-height: .9;
  letter-spacing: -.04em;
}

h1 em { display: block; color: var(--copper); font-weight: 500; }

.introduction {
  max-width: 34ch;
  margin: 28px 0 0;
  color: #535b54;
  font-size: 1rem;
  line-height: 1.75;
}

#join {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  min-height: 52px;
  min-width: 144px;
  margin-top: 28px;
  padding: 14px 25px;
  border: 1px solid var(--forest);
  border-radius: 40px;
  background: var(--forest);
  color: #fff;
  font-size: .875rem;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: .03em;
  text-decoration: none;
  transition: background-color 180ms ease, border-color 180ms ease;
}

#join svg { flex: none; width: 20px; stroke: #e9d4ad; stroke-width: 1; transition: transform 180ms ease; }
#join:focus-visible { outline: 2px solid var(--forest); outline-offset: 5px; }
#join:active { background: #193c30; }

@media (hover: hover) {
  #join:hover { background: #326251; border-color: #326251; }
  #join:hover svg { transform: translateX(2px); }
}

.membership {
  margin: 16px 0 0;
  color: #657066;
  font-size: .6875rem;
  line-height: 1.6;
  letter-spacing: .02em;
}

.art {
  position: absolute;
  top: 0;
  right: 0;
  width: min(56vw, 91svh);
  aspect-ratio: 1199 / 1312;
  pointer-events: none;
}

.specimen { display: block; width: 100%; height: 100%; object-fit: contain; }
.canopy-wind { position: absolute; inset: 0; width: 100%; height: 100%; }
.art.is-live .specimen { opacity: 0; }

/* Keep the sparse leaves behind the invitation and faint near its text. */
.windfall {
  position: absolute;
  inset: 0;
  display: none;
  overflow: hidden;
  pointer-events: none;
  mask-image: linear-gradient(90deg, #000 5%, #0003 12%, #0003 37%, #000 49%);
}

.fall { position: absolute; top: -40px; left: var(--x); width: var(--size); height: calc(var(--size) * 1.14); opacity: .67; }
.fall i { display: block; width: 100%; height: 100%; background: url('./assets/drifting-chinar.svg') center / contain no-repeat; }
.fall.sage i { filter: hue-rotate(48deg) saturate(.62); }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

@media (max-width: 800px) and (orientation: portrait) {
  :root { --mobile-canopy: min(69.7vw, 36.55svh); --gutter: 32px; }
  .gallery {
    flex-direction: column;
    justify-content: flex-start;
    padding-top: calc(var(--mobile-canopy) * 1312 / 1199 + 40px);
    padding-bottom: 56px;
  }
  .mast { top: calc(var(--edge) + 16px); left: var(--gutter); }
  .mast img { width: 30px; height: 30px; }
  .art { width: var(--mobile-canopy); }
  .invitation { width: 100%; max-width: 26rem; text-align: center; }
  .eyebrow { margin-bottom: 24px; font-size: .5625rem; letter-spacing: .16em; }
  h1 { font-size: clamp(2.8rem, 13.7vw, 4rem); line-height: 1.05; letter-spacing: -.035em; }
  h1 em { display: inline; }
  .introduction { margin: 24px auto 0; font-size: .875rem; line-height: 1.75; }
  #join { margin-top: 24px; }
  .windfall { mask-image: linear-gradient(90deg, #000, #0004 18%, #0003 78%, #000); }
}

@media (max-width: 700px) {
  .fall:nth-child(2n) { display: none; }
}

@media (max-height: 500px) and (orientation: landscape) {
  .gallery { padding-top: 96px; padding-bottom: 48px; }
  .mast { top: 28px; }
  .mast img { width: 26px; height: 26px; }
  .invitation { width: min(44vw, 28rem); }
  h1 { font-size: clamp(3.5rem, 9vw, 5.5rem); }
  .eyebrow { margin-bottom: 20px; }
  .art { width: min(48vw, 91svh); }
}

@media (prefers-reduced-motion: no-preference) {
  .windfall { display: block; }
}

@media (prefers-reduced-motion: reduce) {
  #join, #join svg { transition: none; }
  .canopy-wind { display: none; }
  .art.is-live .specimen { opacity: 1; }
}
