:root {
  color-scheme: dark;
  --champagne: #f8e7c9;
  --soft: #a9c6b7;
  --ink: #03251e;
  /* Page gutters; .stage pads by these or the device safe area, whichever is larger. */
  --gutter-x: 58px;
  --gutter-top: 47px;
  --gutter-bottom: 43px;
}

[hidden] { display: none !important; }
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--ink); }
body { font-family: Arial, Helvetica, sans-serif; color: var(--champagne); font-size: 16px; }
::selection { background: #f8e7c9; color: #064e3b; }

/* Flex column: header, orb (flexible), message, footer. Nothing is absolutely
   positioned except the canvas, so the message can never overlap the footer. */
.stage {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
  padding:
    max(var(--gutter-top), calc(env(safe-area-inset-top) + 16px))
    max(var(--gutter-x), calc(env(safe-area-inset-right) + 24px))
    max(var(--gutter-bottom), calc(env(safe-area-inset-bottom) + 16px))
    max(var(--gutter-x), calc(env(safe-area-inset-left) + 24px));
  background: radial-gradient(ellipse at 50% 42%, #0a3e2e 0%, #052c23 37%, #021e19 85%);
}
.stage:after { content: ''; position: absolute; inset: 18px; border: 1px solid rgba(175, 204, 174, .10); pointer-events: none; z-index: 3; }

header { position: relative; z-index: 4; display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.brand { display: flex; align-items: center; gap: 13px; color: #f3e8d1; text-decoration: none; }
a.brand:focus-visible { outline: 2px solid var(--champagne); outline-offset: 6px; border-radius: 4px; }
.brand img { display: block; height: 64px; width: auto; }
.brand-caption { font-size: 10px; text-transform: uppercase; letter-spacing: 2.3px; color: #a6bdad; }

#network { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; }

/* The orb band holds the sphere. site.js reads the .core label's centre and the
   band's edges, so the canvas sphere always sits on the label. */
.orb { position: relative; z-index: 1; flex: 1 0 auto; min-height: 260px; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.core { text-align: center; }
.core-name { font-size: clamp(27px, 3vw, 40px); font-weight: 400; letter-spacing: -1.6px; text-shadow: 0 0 30px #052e21; }
.core-name sup { font-size: 9px; letter-spacing: 0; position: relative; top: -12px; margin-left: 3px; }
.core-label { display: block; text-transform: uppercase; font-size: 9px; letter-spacing: 3.6px; margin-top: 10px; color: #a6c6b1; }

.message { position: relative; z-index: 2; text-align: center; margin-bottom: clamp(20px, 5vh, 56px); }
.eyebrow { font-size: 10px; letter-spacing: 3.5px; color: #9abca7; text-transform: uppercase; margin: 0 0 16px; }
.message h1 { font-family: Georgia, 'Times New Roman', serif; font-size: clamp(32px, 3.65vw, 55px); font-weight: 400; letter-spacing: -1.6px; line-height: 1.16; margin: 0; }
.message h1 em { font-weight: 400; }
.message p { font-size: 14px; color: #adc5b6; line-height: 1.7; margin: 17px 0 0; letter-spacing: .1px; }
.message a { color: var(--champagne); text-underline-offset: 4px; }
.message a:focus-visible { outline: 2px solid var(--champagne); outline-offset: 4px; }

.footer { position: relative; z-index: 4; display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.footer small { font-size: 10px; letter-spacing: .3px; color: #91ab9c; }
/* Same colour as the footer text (≥4.89:1 on the lightest gradient stop); underline marks it as a link. */
.footer a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.footer a:hover { color: var(--champagne); }
.footer a:focus-visible { outline: 2px solid var(--champagne); outline-offset: 3px; border-radius: 2px; }

.motion { background: rgba(4, 38, 28, .5); border: 1px solid #4c705b; border-radius: 50%; width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; cursor: pointer; color: #bdd2c2; padding: 0; transition: background .2s, border-color .2s; }
.motion:hover { background: #124535; border-color: #b1c5ac; }
.motion:focus-visible { outline: 2px solid var(--champagne); outline-offset: 5px; }
.motion svg { width: 13px; height: 13px; fill: currentColor; }

/* 404: no network, message centred in the space between header and footer. */
.stage-plain .message { margin: auto 0; }

.intro { animation: appear 1.8s ease both; }
.message { animation: appear 2.4s .45s ease both; }
.core { animation: core-in 2.5s .2s ease both; }
@keyframes appear { from { opacity: 0; } to { opacity: 1; } }
@keyframes core-in { from { opacity: 0; } to { opacity: 1; } }

@media (max-width: 700px) {
  :root { --gutter-x: 29px; --gutter-top: 32px; --gutter-bottom: 29px; }
  .stage:after { inset: 12px; }
  header { justify-content: center; }
  .brand-caption { display: none; }
  .brand img { height: 52px; }
  .orb { min-height: 240px; }
  .core-name { font-size: 32px; }
  .core-label { font-size: 8px; letter-spacing: 3px; }
  .eyebrow { font-size: 9px; letter-spacing: 2.6px; margin-bottom: 17px; }
  .message h1 { font-size: clamp(32px, 7.5vw, 45px); letter-spacing: -1.2px; max-width: 490px; margin: auto; }
  .message p { font-size: 13px; max-width: 270px; margin: 16px auto 0; }
  .footer small { font-size: 9px; }
  .motion { width: 35px; height: 35px; }
}
@media (max-height: 650px) and (min-width: 701px) {
  :root { --gutter-top: 32px; --gutter-bottom: 25px; }
  .message h1 { font-size: 37px; }
  .message p { margin-top: 10px; }
  .eyebrow { margin-bottom: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *:before, *:after { animation: none !important; transition: none !important; }
}
