/* Moonlight Lilies: the key visual's palace night. Trajan capitals, Goudy narrative,
   lamplight and lotus as light on a night-slate ground. */

@font-face {
  font-family: "Cinzel";
  src: url("../fonts/cinzel-latin.woff2") format("woff2");
  font-weight: 400 900;
  font-display: swap;
}
@font-face {
  font-family: "Sorts Mill Goudy";
  src: url("../fonts/sorts-mill-goudy-italic-latin.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

:root {
  color-scheme: dark;

  /* The sky over the palace, from the key visual. */
  --night-950: #121118;
  --night-900: #1b1a23;

  /* Lamplight and lotus: used as light, never as large fields. */
  --lotus-500: #f97983;
  --lotus-300: #fcb6a0;

  /* The title lettering. */
  --gold-50: #fef3ca;
  --gold-100: #f6e3aa;
  --gold-300: #e3c47a;

  --ink: #2a1012;
  --text: #ecdfc9;
  --text-soft: #c9b79c;
  --rule-strong: rgb(211 175 55 / 0.55);

  /* Trajan for the labels, Goudy for the note. Licensed faces win when installed;
     Cinzel and Sorts Mill Goudy are the self-hosted stand-ins. */
  --font-display: "Trajan Pro 3", "Trajan Pro", Trajan, "Cinzel", "Times New Roman", serif;
  --font-body: Goudos, "Goudy Old Style", "Sorts Mill Goudy", Georgia, serif;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --gutter: clamp(1rem, 4vw, 3rem);
  --vh: 100vh;
}

/* Small viewport height, so phone browser bars never cover the screen. */
@supports (height: 100svh) {
  :root {
    --vh: 100svh;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--night-900);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.1875rem;
  line-height: 1.6;
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img,
svg {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  color: var(--gold-50);
}

p {
  margin: 0;
  text-wrap: pretty;
}

a {
  color: inherit;
}

::selection {
  background: var(--lotus-500);
  color: var(--night-950);
}

:focus-visible {
  outline: 2px solid var(--gold-300);
  outline-offset: 4px;
}

.arrow {
  width: 1.85em;
  height: 0.92em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.1;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.45s var(--ease-out);
}

/* Buttons ----------------------------------------------------------------- */

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  /* Sized in em so the whole button grows with its fluid label on large displays. */
  gap: 1.05em;
  min-height: 4.15em;
  padding: 1.17em 2.34em 1.05em;
  border: 1px solid transparent;
  border-radius: 2px;
  font-family: var(--font-display);
  font-size: clamp(0.8125rem, 0.7rem + 0.25vw, 1.125rem);
  letter-spacing: 0.2em;
  line-height: 1.2;
  text-transform: uppercase;
  text-decoration: none;
  transition:
    background-color 0.3s,
    border-color 0.3s,
    color 0.3s,
    box-shadow 0.5s var(--ease-out),
    transform 0.5s var(--ease-out);
}
.btn:hover .arrow {
  transform: translateX(4px);
}
.btn:active {
  transform: translateY(1px);
}

/* Cream-gold like the title lettering, with a fine printed inner rule. */
.btn--primary {
  background: var(--gold-100);
  color: var(--ink);
  /* Lamplight on the water beneath it: offset, warm, low. */
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 0.4),
    0 16px 28px -18px rgb(252 182 160 / 0.45);
}
.btn--primary::after {
  content: "";
  position: absolute;
  inset: 4px;
  border: 1px solid rgb(42 16 18 / 0.22);
  border-radius: 1px;
  pointer-events: none;
}
.btn--primary:hover {
  background: var(--gold-50);
  transform: translateY(-2px);
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 0.5),
    0 20px 34px -18px rgb(252 182 160 / 0.6);
}

.btn--quiet {
  background: rgb(18 17 24 / 0.8);
  border-color: var(--rule-strong);
  color: var(--gold-50);
}
.btn--quiet:hover {
  background: rgb(211 175 55 / 0.12);
  border-color: var(--gold-300);
}

/* Hero: the key visual on its own night, filling one screen ---------------------- */

/* The banner takes the widest size that still leaves room for the actions and note,
   so a short laptop screen keeps them in view and a tall one gets a larger plate. It
   may overscan the width by up to 12%, which trims only the feathered curtain edges,
   and never upscales past the artwork's own 2400px. */
.hero {
  --hero-reserve: clamp(9rem, calc(var(--vh) * 0.26), 14rem);
  --hero-w: min(112%, 150rem, calc((var(--vh) - var(--hero-reserve)) * 3));
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: var(--vh);
  padding: clamp(1rem, 4vh, 3rem) 0;
  text-align: center;
  background:
    radial-gradient(55% 45% at 50% 62%, rgb(252 182 160 / 0.1), transparent 72%),
    var(--night-900);
  overflow: hidden;
}

.hero__title {
  flex: none;
  width: var(--hero-w);
}

.hero__title picture {
  display: block;
}

.hero__art {
  width: 100%;
  aspect-ratio: 3 / 1;
  object-fit: cover;
  -webkit-mask-image:
    linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent),
    linear-gradient(transparent, #000 6%, #000 66%, transparent 99%);
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent),
    linear-gradient(transparent, #000 6%, #000 66%, transparent 99%);
  mask-composite: intersect;
}

.hero__actions {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(1rem, 0.6rem + 0.5vw, 1.5rem);
  /* Overlap the banner's lower fade by a fixed share of the banner's own width. */
  margin-top: clamp(-5rem, calc(var(--hero-w) * -0.05), -1.25rem);
  padding-inline: var(--gutter);
}

.hero__note {
  max-width: 48ch;
  margin: clamp(1.25rem, 2.5vh, 2rem) auto 0;
  padding-inline: var(--gutter);
  font-style: italic;
  font-size: clamp(1.0625rem, 0.95rem + 0.3vw, 1.5rem);
  color: var(--text-soft);
}

@media (prefers-reduced-motion: no-preference) {
  .hero__art {
    animation: unveil 2.4s var(--ease-out) both;
  }
  .hero__actions,
  .hero__note {
    animation: rise 1.4s var(--ease-out) 0.8s both;
  }
}

/* The lamps come up on the palace. */
@keyframes unveil {
  from {
    filter: brightness(0.4) saturate(0.7);
    transform: scale(1.03);
  }
}

@keyframes rise {
  from {
    opacity: 0.3;
    transform: translateY(10px);
  }
}

/* Responsive ---------------------------------------------------------------- */

/* Portrait screens (phones, tablets held upright) load the 2:1 mobile key visual and
   show it at 1.6:1. The crop trims only the curtain edges and leans right (62%) so the
   queen's face stays clear of the edge while the gifts and lettering stay whole.
   Near-square windows narrow it so the actions still fit. */
@media (orientation: portrait) {
  .hero {
    --hero-w: min(100%, calc((var(--vh) - var(--hero-reserve)) * 1.6));
  }
  .hero__art {
    aspect-ratio: 1.6;
    object-position: 62% 50%;
    -webkit-mask-image:
      linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent),
      linear-gradient(transparent, #000 5%, #000 72%, transparent 99%);
    -webkit-mask-composite: source-in;
    mask-image:
      linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent),
      linear-gradient(transparent, #000 5%, #000 72%, transparent 99%);
    mask-composite: intersect;
  }
}

@media (max-width: 760px) {
  body {
    font-size: 1.125rem;
  }
  .hero__actions {
    flex-direction: column;
    align-items: stretch;
    width: min(100%, 24rem);
    margin: -1.5rem auto 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
