/* Thy Veils — placeholder styles.
   Deep, nocturnal, slowly moving. Text stays legible at every moment:
   the colour fields are kept dark and within a restrained range of hues. */

:root {
  color-scheme: dark;
  --base: #04050b;
  --ink: #efeaf8;
  --ink-soft: #cdc6df;
  /* Hues of the three colour fields. atmosphere.js varies them on each visit;
     these are the values used when scripts do not run. */
  --h1: 262;
  --h2: 222;
  --h3: 298;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
}

* { box-sizing: border-box; }

html { background: var(--base); }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  background: var(--base);
  color: var(--ink);
  font-family: var(--serif);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ---------- The moving background ---------- */

.field {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

/* The colour is flat, with no gradient: the whole night slowly turns from one
   deep hue to another and back, taking minutes over each change. */
.field { background-color: hsl(var(--h1) 42% 8%); animation: tint 150s ease-in-out infinite alternate; }
@keyframes tint {
  0%   { background-color: hsl(var(--h1) 42% 8%); }
  50%  { background-color: hsl(var(--h2) 42% 9%); }
  100% { background-color: hsl(var(--h3) 42% 8%); }
}

/* ---------- The stars ---------- */

.stars { position: absolute; inset: 0; }
.star {
  position: absolute;
  width: var(--s);
  height: var(--s);
  border-radius: 50%;
  background: #f4f1ff;
  box-shadow: 0 0 calc(var(--s) * 2.5) rgba(220, 215, 255, .6);
  opacity: var(--lo);
  /* Slow and gentle: each star takes seconds to brighten and fade, never a rapid flash. */
  animation: twinkle var(--d) ease-in-out infinite alternate;
}
@keyframes twinkle {
  from { opacity: var(--lo); }
  to   { opacity: var(--hi); }
}

/* ---------- The words ---------- */

main {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-content: center;
  justify-items: center;
  padding: clamp(1.5rem, 6vw, 4rem);
  text-align: center;
}

h1 {
  margin: 0;
  font-weight: 400;
  font-size: clamp(1.7rem, 7.4vw, 5.2rem);
  line-height: 1.05;
  letter-spacing: .42em;
  margin-right: -.42em; /* offsets the trailing space so the word stays centred */
  color: var(--ink);
}

.message {
  margin: 1.7rem 0 0;
  font-size: clamp(1.25rem, 3.4vw, 1.9rem);
  font-style: italic;
  letter-spacing: .02em;
}

.note {
  margin: 1.9rem 0 0;
  font-size: clamp(1.05rem, 2.4vw, 1.25rem);
  color: var(--ink-soft);
}

.contact {
  margin: clamp(2.5rem, 8vh, 4.5rem) 0 0;
  font-size: 1.1rem;
}

.elsewhere {
  margin: .2rem 0 0;
  font-size: 1.05rem;
  font-style: italic;
}

/* Read aloud by assistive technologies in place of the spaced capitals. */
.sr {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: .28em;
  text-decoration-thickness: 1px;
  display: inline-block;
  padding: .55rem .4rem;
}
a:hover { text-decoration-thickness: 2px; }
a:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---------- Gentler settings ---------- */

@media (prefers-reduced-motion: reduce) {
  .field { animation: none; }
  .star { animation: none; opacity: var(--hi); }
}

@media (forced-colors: active) {
  .field { display: none; }
  h1 { color: CanvasText; }
}
