@font-face {
  font-family: "Cormorant Garamond";
  src: url("/fonts/cormorant-garamond-300.woff2") format("woff2");
  font-weight: 300;
  font-style: normal;
  /* Preloaded and tiny: wait for it rather than flashing a fallback serif. */
  font-display: block;
}

:root {
  --bg: #f8f4ee;
  --ink: #3a332d;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1c1a18;
    --ink: #ece4d8;
  }
}

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

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

body {
  margin: 0;
  /* Fill exactly the visible viewport (dvh accounts for mobile browser bars). */
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  /* Keep clear of notches / rounded corners, e.g. phones in landscape. */
  padding:
    env(safe-area-inset-top) env(safe-area-inset-right)
    env(safe-area-inset-bottom) env(safe-area-inset-left);
  background: var(--bg);
  color: var(--ink);
  font-family: "Cormorant Garamond", Garamond, "Palatino Linotype", Palatino, Georgia, serif;
}

h1 {
  margin: 0;
  font-weight: 300;
  /* Scale with the viewport's smaller side so it fits portrait and landscape alike. */
  font-size: clamp(3rem, 30vmin, 24rem);
  line-height: 1;
  letter-spacing: 0.04em;
  /* Letter-spacing (which trails the last letter) and the glyphs' side bearings
     nudge the visible letters off-centre; this indent compensates (measured). */
  text-indent: 0.01em;
  animation: fade-in 1.6s ease-out both;
}

/* "soon" has no ascenders or descenders, so centre the actual letter shapes
   (baseline to x-height) rather than the font's full line box. */
@supports (text-box: trim-both ex alphabetic) {
  h1 {
    text-box: trim-both ex alphabetic;
  }
}

@supports not (text-box: trim-both ex alphabetic) {
  h1 {
    /* Same optical centring for browsers without text-box (measured). */
    transform: translateY(-0.125em);
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  h1 {
    animation: none;
  }
}
