:root {
  --page: #ffffff;
  --red: #e7362d;
  --ink: #000000;
  --gold: #f2c14e;
  --cream: #fff6e8;
  --cream-dim: rgba(255, 246, 232, 0.72);

  --serif: "Instrument Serif", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  /* How far the ornaments sit in from the envelope edge */
  --corner-inset: clamp(0.75rem, 2vw, 1.75rem);
  --corner-size: clamp(2.5rem, 8vw, 7.5rem);

  /* Content is padded clear of the ornaments' full footprint, so the two can
     never collide however the viewport is sized. */
  --envelope-pad: calc(
    var(--corner-inset) + var(--corner-size) + clamp(0.5rem, 1.5vw, 1rem)
  );
}

/* Fixed brand palette — opt out of browser auto-darkening. */
:root {
  color-scheme: only light;
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  padding: clamp(0.5rem, 1.4vw, 1.25rem);
  background: var(--page);
  color: var(--cream);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration-color: rgba(255, 246, 232, 0.4);
  text-underline-offset: 0.25em;
}

a:hover {
  text-decoration-color: currentColor;
}

/* ---------------------------------------------------------------
   The envelope — a red square sitting on the white page
   --------------------------------------------------------------- */

.envelope {
  position: relative;
  flex: 1;
  background: var(--red);
  display: flex;
  flex-direction: column;
  padding: var(--envelope-pad);
}

/* Corner ornaments -------------------------------------------------- */

.corner {
  position: absolute;
  width: var(--corner-size);
  height: var(--corner-size);
  background-color: var(--ink);
  pointer-events: none;

  -webkit-mask-image: url("/public/corner-decoration.webp?v=1");
  mask-image: url("/public/corner-decoration.webp?v=1");
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}

/* The source art is drawn for the top-left corner; rotate it round. */

.corner--tl {
  top: var(--corner-inset);
  left: var(--corner-inset);
}

.corner--tr {
  top: var(--corner-inset);
  right: var(--corner-inset);
  transform: rotate(90deg);
}

.corner--br {
  bottom: var(--corner-inset);
  right: var(--corner-inset);
  transform: rotate(180deg);
}

.corner--bl {
  bottom: var(--corner-inset);
  left: var(--corner-inset);
  transform: rotate(270deg);
}

/* Header ------------------------------------------------------------ */

.site-header {
  position: relative;
  z-index: 1;
}

.brand {
  font-family: var(--sans);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-decoration: none;
  color: var(--cream-dim);
}

.brand .dim {
  opacity: 0.65;
}

/* Main -------------------------------------------------------------- */

main {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  /* The envelope now spans the viewport, so the text needs its own measure. */
  max-width: 38rem;
  padding: 2.5rem 0;
}

.hero h1 {
  margin: 0 0 1.25rem;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.5rem, 9vw, 4rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--cream);
}

.hero h1 .accent {
  color: var(--gold);
  font-style: italic;
}

.lede {
  font-family: var(--serif);
  font-size: clamp(1.2rem, 3.6vw, 1.5rem);
  line-height: 1.4;
  margin: 0 0 1.25rem;
  color: var(--cream);
}

.hero p {
  color: var(--cream-dim);
  max-width: 30rem;
}

/* Coming soon ------------------------------------------------------- */

.soon {
  position: relative;
  z-index: 1;
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255, 246, 232, 0.25);
}

.soon .label {
  margin: 0;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
}

/* Footer ------------------------------------------------------------ */

.site-footer {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.5rem;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--cream-dim);
}

.site-footer p {
  margin: 0;
}

/* Browsers without CSS masking would paint four solid gold squares,
   which is worse than no ornament at all. */
@supports not ((-webkit-mask-image: url("#m")) or (mask-image: url("#m"))) {
  .corner {
    display: none;
  }
}
