/* 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);
}

@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%);
  }
}

* {
  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;
}

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;
}

/* 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;
  }
}

/* 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;
  }

  .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);
  }
}
