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

:root {
  --bg: #07090c;
  --fg: #e9eef3;
  --muted: #8b98a7;
  --accent: #8fbcd9;
  --rule: rgba(143, 188, 217, 0.22);
  --panel: rgba(143, 188, 217, 0.045);
  --measure: 62rem;
}

html { height: 100%; }

body {
  margin: 0;
  min-height: 100svh;
  background: var(--bg);
  color: var(--fg);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  display: flex;
  flex-direction: column;
}

/* Drifting mist. Three slow, offset layers reading as depth rather than motion.
   The container clips them so the oversized layers never widen the page. */
.mist {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.mist span {
  position: absolute;
  inset: -25%;
  background-repeat: no-repeat;
  will-change: transform;
}

.mist span:nth-child(1) {
  background-image: radial-gradient(38% 30% at 22% 30%, rgba(94, 141, 176, 0.20), transparent 70%);
  animation: drift-a 61s ease-in-out infinite alternate;
}

.mist span:nth-child(2) {
  background-image: radial-gradient(45% 34% at 78% 62%, rgba(120, 164, 196, 0.14), transparent 72%);
  animation: drift-b 83s ease-in-out infinite alternate;
}

.mist span:nth-child(3) {
  background-image: radial-gradient(60% 40% at 50% 108%, rgba(58, 92, 122, 0.30), transparent 68%);
  animation: drift-c 97s ease-in-out infinite alternate;
}

@keyframes drift-a {
  from { transform: translate3d(-3%,  1%, 0) scale(1); }
  to   { transform: translate3d( 5%, -3%, 0) scale(1.12); }
}
@keyframes drift-b {
  from { transform: translate3d( 3%, -2%, 0) scale(1.08); }
  to   { transform: translate3d(-5%,  3%, 0) scale(1); }
}
@keyframes drift-c {
  from { transform: translate3d(-2%, 0, 0) scale(1); }
  to   { transform: translate3d( 4%, -2%, 0) scale(1.15); }
}

/* A faint vignette to keep the edges from feeling flat. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(120% 90% at 50% 45%, transparent 40%, rgba(0, 0, 0, 0.55) 100%);
}

main {
  position: relative;
  z-index: 2;
  flex: 1;
}

/* Pages with a single centred block: the 404, and anything else short. */
.centered {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
  text-align: center;
}

.lockup {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.35rem;
  animation: rise 1.1s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}

.glyph {
  width: 42px;
  height: 42px;
  opacity: 0.9;
}

/* Home page opening screen. */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 5rem 1.5rem 3rem;
  text-align: center;
}

.wordmark {
  margin: 0;
  font-size: clamp(1.9rem, 6.2vw, 3.6rem);
  font-weight: 300;
  letter-spacing: 0.24em;
  text-indent: 0.24em; /* offsets the trailing letter-space so the text stays optically centred */
  line-height: 1.1;
  text-transform: uppercase;
}

.wordmark .labs {
  font-weight: 600;
  color: var(--accent);
}

.rule {
  width: min(280px, 58vw);
  height: 1px;
  border: 0;
  margin: 0.15rem 0 0;
  background: linear-gradient(90deg, transparent, var(--rule) 22%, var(--rule) 78%, transparent);
}

.tagline {
  margin: 0;
  font-size: clamp(0.86rem, 2.4vw, 1.06rem);
  font-weight: 400;
  letter-spacing: 0.15em;
  line-height: 1.9;
  text-transform: uppercase;
  text-wrap: balance; /* the list is long enough to wrap on phones; keep the lines even */
  color: var(--muted);
}

/* Sits at the foot of the opening screen to signal there is more below. */
.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: 2.1rem;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7rem;
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  text-indent: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  opacity: 0.5;
}

.scroll-cue::after {
  content: "";
  width: 1px;
  height: 2.4rem;
  background: linear-gradient(180deg, var(--rule), transparent);
  animation: breathe 4.5s ease-in-out infinite;
}

@keyframes breathe {
  0%, 100% { opacity: 0.35; transform: scaleY(0.72); transform-origin: top; }
  50%      { opacity: 1;    transform: scaleY(1);    transform-origin: top; }
}

/* Content sections below the opening screen. */
.section {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 4.5rem 1.5rem;
}

.section + .section {
  border-top: 1px solid rgba(143, 188, 217, 0.10);
}

/* Sections surface as they scroll in. Scroll-driven animations keep this in CSS,
   so the page still needs no JavaScript and the policy can stay script-src 'none'.
   Guarded by @supports: browsers without a view timeline simply show the content,
   rather than leaving it stuck at opacity 0. */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .section {
      animation: emerge linear both;
      animation-timeline: view();
      animation-range: entry 10% entry 70%;
    }
  }
}

@keyframes emerge {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: none; }
}

.eyebrow {
  margin: 0 0 1.4rem;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-indent: 0.24em;
  text-transform: uppercase;
  color: var(--accent);
  opacity: 0.75;
}

.lede {
  margin: 0;
  max-width: 46ch;
  font-size: clamp(1.05rem, 2.6vw, 1.4rem);
  font-weight: 300;
  line-height: 1.6;
  color: var(--fg);
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
  gap: 1.25rem;
}

.card {
  padding: 1.9rem 1.75rem;
  border: 1px solid rgba(143, 188, 217, 0.13);
  border-radius: 3px;
  background: var(--panel);
}

.card h3 {
  margin: 1rem 0 0.75rem;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-indent: 0.18em;
  text-transform: uppercase;
  color: var(--fg);
}

.card p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--muted);
}

.card-mark {
  width: 22px;
  height: 22px;
  opacity: 0.8;
}

/* 404 page. */
.code {
  margin: 0;
  font-size: clamp(3rem, 13vw, 6rem);
  font-weight: 200;
  letter-spacing: 0.1em;
  text-indent: 0.1em;
  line-height: 1;
  color: var(--accent);
  opacity: 0.85;
}

.title {
  margin: 0;
  font-size: clamp(0.95rem, 2.6vw, 1.15rem);
  font-weight: 400;
  letter-spacing: 0.18em;
  text-indent: 0.18em;
  text-transform: uppercase;
  color: var(--fg);
}

.blurb {
  margin: 0;
  max-width: 34ch;
  font-size: 0.92rem;
  line-height: 1.65;
  color: var(--muted);
}

/* Single trailing link line: contact address, return-home, and the like. */
.linkline {
  margin: 2.4rem 0 0;
  font-size: clamp(0.88rem, 2.2vw, 1rem);
  letter-spacing: 0.04em;
}

.linkline a {
  color: var(--accent);
  text-decoration: none;
  padding-bottom: 3px;
  border-bottom: 1px solid rgba(143, 188, 217, 0.28);
  transition: color 0.25s ease, border-color 0.25s ease;
}

.linkline a:hover,
.linkline a:focus-visible {
  color: #cfe4f2;
  border-bottom-color: #cfe4f2;
}

.linkline a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 6px;
  border-radius: 2px;
}

footer {
  position: relative;
  z-index: 2;
  padding: 1.75rem 1.5rem 2.25rem;
  text-align: center;
  font-size: 0.76rem;
  letter-spacing: 0.05em;
  color: var(--muted);
  opacity: 0.62;
}

@media (prefers-reduced-motion: reduce) {
  .mist span,
  .lockup,
  .scroll-cue::after { animation: none; }
}
