/* Colours: light by default, dark when the visitor's device is set to dark mode. */
:root {
  --background: #fafaf7;
  --text: #1a1a1a;
  --muted: #555555;
  --line: #d9d9d4;
  /* Soft warm light fading in from the top-left corner. */
  --glow: rgba(255, 196, 120, 0.28);
  /* Full-page colour wash under the glow. None in light mode for now. */
  --wash: linear-gradient(transparent, transparent);
  /* Logo: dark on light. */
  --logo: #1a1a1a;
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: #121212;
    /* Warm ivory instead of pure white, to match the amber glow. */
    --text: #e6ddcd;
    --muted: #a59b8b;
    --line: #3a342c;
    --glow: rgba(255, 165, 70, 0.24);
    /* Warm brown at the top-left, fading to a cool blue-black at the bottom-right. */
    --wash: linear-gradient(155deg, #3a2814 0%, #1f1912 30%, #11141a 65%, #05070b 100%);
    /* Logo: white, as in the original. */
    --logo: #ffffff;
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 0 16px;
  background:
    radial-gradient(ellipse 90% 70% at 0% 0%, var(--glow), transparent 70%),
    var(--wash),
    var(--background);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
}

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  max-width: 40rem;
  margin: 0 auto;
  padding: 3rem 0;
}

/* Small logo in the top-right corner. */
.site-header {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: flex-end;
  padding-top: 1.25rem;
}

.site-logo {
  display: block;
  line-height: 0;
}

.logo-mark {
  display: block;
  width: 8.5rem;
  height: auto;
  color: var(--logo);
}

/* Logo glow (v4). The halo is drawn in layers; wider layers give off more light.
   Same widths in light and dark mode. In light mode the inner layers stay at full
   strength, so they cover the circle lines near the bright edges as in dark mode,
   and only the wide outer layers are faded: light looks weaker on white than on black. */
.logo-mark .halo1 {
  stroke-width: 20px;
}

.logo-mark .halo2 {
  stroke-width: 46px;
  opacity: 0.5;
}

.logo-mark .halo3 {
  stroke-width: 66px;
  opacity: 0.3;
}

h1 {
  margin: 0 0 1rem;
  font-size: clamp(2.25rem, 8vw, 3.5rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.lead {
  margin: 0 0 1.5rem;
  font-size: clamp(1.125rem, 3.5vw, 1.375rem);
}

.note {
  margin: 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

footer {
  width: 100%;
  max-width: 40rem;
  margin: 0 auto;
  padding: 1.5rem 0;
  color: var(--muted);
  font-size: 0.875rem;
}

footer p {
  margin: 0;
}

footer p + p {
  margin-top: 0.25rem;
}

/* Founder line: the link keeps the quiet footer colour, underlined so it reads as a link. */
footer a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

footer a:hover,
footer a:focus-visible {
  color: var(--text);
}

/* Wafer photo in the bottom-right corner, partly off the edge. */
main,
footer {
  position: relative;
  z-index: 1;
}

.wafer {
  --wafer-size: min(420px, 55vw);
  /* Fixed to the screen corner, so the part off the edge never adds scrolling. */
  position: fixed;
  right: calc(var(--wafer-size) * -0.25);
  bottom: calc(var(--wafer-size) * -0.3);
  width: var(--wafer-size);
  height: auto;
  aspect-ratio: 1;
  /* The photo is square; this trims it to the round wafer and hides the dark backdrop. */
  clip-path: circle(48.5%);
  opacity: 0.9;
  pointer-events: none;
  z-index: 0;
}

@media (prefers-color-scheme: dark) {
  .wafer {
    opacity: 0.75;
  }

  /* Dark mode: the full glow, all layers at full strength. */
  .logo-mark .halo2,
  .logo-mark .halo3 {
    opacity: 1;
  }
}

/* Large screens (wide laptops, desktop monitors, TVs): everything grows to fill the space.
   Phones and normal laptops are not affected. Colours are not changed here. */
@media (min-width: 1280px) {
  main,
  footer {
    max-width: min(60rem, 55vw);
  }

  h1 {
    font-size: clamp(3.5rem, 4.2vw, 5.5rem);
    margin-bottom: 1.5rem;
  }

  .site-header {
    padding: 2rem 1.5rem 0 0;
  }

  .logo-mark {
    width: 13rem;
  }

  .lead {
    font-size: clamp(1.375rem, 1.5vw, 1.875rem);
    margin-bottom: 2rem;
  }

  .note {
    font-size: 1.125rem;
    padding-top: 2rem;
  }

  footer {
    font-size: 1rem;
    padding: 2rem 0;
  }

  .wafer {
    --wafer-size: min(700px, 36vw);
  }
}
