/* Benivant coming soon page. Palette and type follow the Benivant brand:
   midnight blues, copper, cream; Playfair Display, Source Serif 4, DM Sans. */

:root {
  --midnight-deep: oklch(0.11 0.04 258);
  --midnight: oklch(0.16 0.04 258);
  --midnight-mid: oklch(0.2 0.04 258);
  --copper: oklch(0.62 0.12 55);
  --copper-light: oklch(0.72 0.1 55);
  --copper-dark: oklch(0.5 0.12 55);
  --cream: oklch(0.98 0.01 80);
  --cream-dark: oklch(0.94 0.015 80);

  --text-soft: oklch(0.94 0.015 80 / 0.8);
  --text-quiet: oklch(0.94 0.015 80 / 0.62);
  --hairline: oklch(0.62 0.12 55 / 0.3);

  --font-display: "Playfair Display", "Iowan Old Style", "Times New Roman", serif;
  --font-serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-sans: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  --frame-inset: clamp(0.75rem, 1.6vw, 1.5rem);
  --gutter: clamp(1.5rem, 6vw, 4.5rem);

  /* Desktop scale unit: a share of the width, held back by the height left after
     the credits and footer, so every desktop fills its screen without scrolling. */
  --u: min(1.15vw, calc((100svh - 10rem) / 42));

  /* Phone spacing, which fades to nothing by 64rem wide so desktops run on --u alone. */
  --phone: max(0px, calc((64rem - 100vw) * 0.2));

  --gap-top: max(calc(1.8 * var(--u)), min(7svh, 3.5rem, var(--phone)));
  --gap-logo: max(calc(2 * var(--u)), min(5svh, 2.75rem, var(--phone)));
  --gap-lede: max(calc(1.3 * var(--u)), min(3svh, 1.75rem, var(--phone)));
  --gap-status: max(calc(1.9 * var(--u)), min(5svh, 2.8rem, var(--phone)));
  --gap-founders: max(calc(1.6 * var(--u)), min(4.5svh, 2.6rem, var(--phone)));
  --gap-bottom: max(calc(0.9 * var(--u)), min(3svh, 1.75rem, var(--phone)));
  --lede-leading: 1.62;
  --credits-leading: 1.65;
}

/* Short screens: tighter phone spacing so the whole page still fits. */
@media (max-height: 700px) {
  :root {
    --gap-top: max(calc(1.8 * var(--u)), min(5svh, 3.5rem, var(--phone)));
    --gap-logo: max(calc(2 * var(--u)), min(3.5svh, 2.75rem, var(--phone)));
    --gap-lede: max(calc(1.3 * var(--u)), min(2.25svh, 1.75rem, var(--phone)));
    --gap-status: max(calc(1.9 * var(--u)), min(3.5svh, 2.8rem, var(--phone)));
    --gap-founders: max(calc(1.6 * var(--u)), min(3svh, 2.6rem, var(--phone)));
    --gap-bottom: max(calc(0.9 * var(--u)), min(2svh, 1.75rem, var(--phone)));
    --lede-leading: 1.55;
    --credits-leading: 1.55;
  }
}

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

html {
  background-color: var(--midnight);
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-rows: 1fr auto;
  color: var(--cream);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* A soft pool of light above the logo, falling off to the deepest midnight at the edges. */
  background:
    radial-gradient(ellipse 72% 58% at 50% 24%, oklch(0.25 0.05 258 / 0.85), transparent 72%),
    radial-gradient(ellipse 140% 100% at 50% 110%, var(--midnight-deep), transparent 62%),
    var(--midnight);
}

/* Fine grain keeps the large gradients from banding on big screens. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.07;
  mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* The copper rule around the page, like the border on an engraved card. */
body::after {
  content: "";
  position: absolute;
  inset: var(--frame-inset);
  border: 1px solid var(--hairline);
  pointer-events: none;
}

p {
  margin: 0;
}

.announcement {
  position: relative;
  z-index: 1;
  width: 100%;
  padding:
    var(--gap-top)
    calc(var(--gutter) + var(--frame-inset))
    var(--gap-bottom);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

/* Logo: rebuild the files in assets/ with tools/make-brand-assets.py. */
.logo-slot {
  position: relative;
  margin-bottom: var(--gap-logo);
}

a.logo-slot:focus-visible {
  outline: 2px solid var(--copper-light);
  outline-offset: 6px;
  border-radius: 2px;
}

/* Phones get a 288 pixel floor so the tagline reads; desktops size by the scale unit. */
.logo {
  display: block;
  width: max(clamp(18rem, 46vw, 22rem), calc(38 * var(--u)));
  max-width: 100%;
  height: auto;
}

.headline {
  margin: 0;
  max-width: 17em;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: max(clamp(2.125rem, 1.15rem + 3.3vw, 2.6rem), calc(4.7 * var(--u)));
  line-height: 1.08;
  letter-spacing: -0.012em;
  color: var(--cream);
  text-wrap: balance;
}

.lede {
  max-width: 34em;
  margin-top: var(--gap-lede);
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: max(clamp(1.0625rem, 0.97rem + 0.42vw, 1.1875rem), calc(1.3 * var(--u)));
  line-height: var(--lede-leading);
  color: var(--text-soft);
  text-wrap: balance;
}

.nowrap {
  white-space: nowrap;
}

.status {
  display: flex;
  align-items: center;
  gap: 0.6em;
  margin-top: var(--gap-status);
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: max(clamp(1.375rem, 1.1rem + 0.9vw, 1.6rem), calc(1.9 * var(--u)));
  line-height: 1.2;
  color: var(--copper-light);
}

.status::before,
.status::after {
  content: "";
  width: max(clamp(2.25rem, 7vw, 3rem), calc(3.6 * var(--u)));
  height: 1px;
  background: linear-gradient(to right, transparent, var(--copper));
}

.status::after {
  background: linear-gradient(to left, transparent, var(--copper));
}

/* Credits and footer stay at least about 18 pixels on any desktop. */
.founders {
  margin-top: var(--gap-founders);
  font-size: clamp(0.9375rem, 0.75rem + 0.42vw, 1.5rem);
  line-height: var(--credits-leading);
  letter-spacing: 0.005em;
  color: var(--text-quiet);
  text-wrap: balance;
}

.founders a,
.text-link {
  /* The padding makes a thumb-sized tap target; the matching negative margin keeps the layout the same. */
  display: inline-block;
  padding-block: 0.625rem;
  margin-block: -0.625rem;
  color: var(--copper-light);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: oklch(0.72 0.1 55 / 0.45);
  text-underline-offset: 0.32em;
  transition: text-decoration-color 0.2s ease, color 0.2s ease;
}

.founders a:hover,
.text-link:hover {
  color: var(--cream);
  text-decoration-color: var(--copper-light);
}

.founders a:focus-visible,
.text-link:focus-visible {
  outline: 2px solid var(--copper-light);
  outline-offset: 0;
  border-radius: 2px;
}

.site-footer {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  text-align: center;
  padding:
    0.5rem
    calc(var(--frame-inset) + clamp(1.25rem, 3vw, 2.25rem))
    calc(var(--frame-inset) + 0.75rem);
  font-size: clamp(0.8125rem, 0.75rem + 0.42vw, 1.5rem);
  letter-spacing: 0.01em;
  color: var(--text-quiet);
}

/* One arrival on load: the page settles in, then light runs once across the copper. */
@media (prefers-reduced-motion: no-preference) {
  .announcement {
    animation: settle 1.1s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  }

  .logo-slot::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(
      105deg,
      transparent 38%,
      oklch(0.97 0.04 80 / 0.7) 50%,
      transparent 62%
    );
    background-size: 320% 100%;
    background-repeat: no-repeat;
    -webkit-mask: url("/assets/logo.webp") center / contain no-repeat;
    mask: url("/assets/logo.webp") center / contain no-repeat;
    mix-blend-mode: soft-light;
    animation: sheen 2.2s 0.7s ease-in-out both;
  }

  @keyframes settle {
    from {
      opacity: 0;
      transform: translateY(0.5rem);
    }
    to {
      opacity: 1;
      transform: none;
    }
  }

  @keyframes sheen {
    0% {
      background-position: 100% 0;
      opacity: 0;
    }
    20% {
      opacity: 1;
    }
    80% {
      opacity: 1;
    }
    100% {
      background-position: 0% 0;
      opacity: 0;
    }
  }
}
