:root {
  --black: #000;
  --turquoise: #40e0d0;
  --teal: #0f9d9a;
  --teal-deep: #0a5f63;
  --teal-dark: #0a5559;
  --text: #dff9f6;
  --muted: #7fb5b2;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--black);
  color: var(--text);
  font-family: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  overflow: hidden;
}

#space {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* Soft galactic haze behind everything */
.nebula {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 60% 40% at 50% 50%, rgba(15, 157, 154, .16), transparent 70%),
    radial-gradient(ellipse 45% 30% at 22% 28%, rgba(64, 224, 208, .07), transparent 70%),
    radial-gradient(ellipse 50% 35% at 80% 78%, rgba(10, 95, 99, .22), transparent 70%);
  animation: breathe 14s ease-in-out infinite alternate;
}
@keyframes breathe { to { opacity: .65; transform: scale(1.06); } }

/* Orbital rings */
.rings {
  position: fixed;
  top: 50%; left: 50%;
  width: min(135vmax, 1500px);
  height: min(135vmax, 1500px);
  transform: translate(-50%, -50%);
  pointer-events: none;
  overflow: visible;
}
.ring {
  fill: none;
  stroke: var(--teal);
  stroke-width: 1;
  opacity: .35;
  vector-effect: non-scaling-stroke;
  transform-origin: 0 0;
}
.r1 { stroke: var(--teal-dark); opacity: .9; transform: rotate(-18deg); animation: spin 140s linear infinite; }
.r2 { stroke: var(--teal-dark); opacity: .75; transform: rotate(24deg); animation: spin 200s linear infinite reverse; }
.r3 { stroke-dasharray: 2 10; opacity: .6; animation: spin 260s linear infinite; }
.moon { fill: var(--turquoise); filter: drop-shadow(0 0 6px var(--turquoise)); }
.trail { fill: none; stroke-width: 1.8; stroke-linecap: round; opacity: .14; }
.m1, .m2 { transform-origin: 0 0; }
.m1 { transform: rotate(-18deg); animation: spin 140s linear infinite; }
.dot2 { fill: var(--teal); }
.m2 { transform: rotate(24deg); animation: spin 200s linear infinite reverse; }

/* Gravitational tug: the middle orbit's centre drifts on two out-of-phase
   axes, so its path never quite repeats, like a tide. */
.wobble-x, .wobble-y { transform-box: view-box; }
.wobble-x { animation: tug-x 23s ease-in-out infinite alternate; }
.wobble-y { animation: tug-y 31s ease-in-out infinite alternate; }
@keyframes tug-x { from { transform: translateX(-38px); } to { transform: translateX(38px); } }
@keyframes tug-y { from { transform: translateY(-26px); } to { transform: translateY(26px); } }
/* Four-pointed star at the centre of the orbits */
.star {
  fill: var(--turquoise);
  filter: drop-shadow(0 0 8px var(--turquoise)) drop-shadow(0 0 22px rgba(64, 224, 208, .55));
  transform-box: fill-box;
  transform-origin: center;
  animation: twinkle 6s ease-in-out infinite alternate;
}
@keyframes twinkle { from { opacity: .75; transform: scale(.9); } to { opacity: 1; transform: scale(1.08); } }
@keyframes spin { to { transform: rotate(360deg); } }

/* Landing content */
.stage {
  position: relative;
  z-index: 1;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 32px 16px;
}

h1 {
  margin: 0;
  max-width: 100%;
  font-family: "Literata", Georgia, serif;
  font-weight: 200;
  font-size: clamp(2.4rem, 5.2vw, 4.6rem);
  line-height: 1.15;
  letter-spacing: .03em;
  background: linear-gradient(180deg, #eafffc 0%, var(--turquoise) 55%, var(--teal) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 28px rgba(64, 224, 208, .35));
}

/* Home layout: the star sits at the exact centre of the viewport, so the
   title (top row) and menu (bottom row) each get equal rows and equal
   clearance from the star's edge. */
body.home {
  --star-r: calc(min(135vmax, 1500px) * 0.031875); /* star half-size at rest */
  --star-gap: clamp(2.5rem, 7vh, 4.5rem);
}
body.home .stage {
  display: grid;
  grid-template-rows: 1fr 1fr;
  justify-items: center;
  align-content: stretch;
}
/* The small em/rem offsets cancel the text boxes' built-in space (descender
   overshoot under the title, link padding above the menu) so the visible gaps match. */
body.home h1 { align-self: end; padding-bottom: calc(var(--star-r) + var(--star-gap) + .091em); }
body.home nav { align-self: start; padding-top: calc(var(--star-r) + var(--star-gap) - .92rem); }

/* Navigation: destinations */
nav {
  margin-top: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .6rem 2.4rem;
}
nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  padding: .6rem .2rem;
  color: var(--text);
  text-decoration: none;
  font-size: .95rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  transition: color .3s, text-shadow .3s;
}
nav a i {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 0 rgba(64, 224, 208, .6);
  transition: background .3s, box-shadow .3s, transform .3s;
}
nav a:hover, nav a:focus-visible {
  color: var(--turquoise);
  text-shadow: 0 0 14px rgba(64, 224, 208, .6);
  outline: none;
}
nav a:hover i, nav a:focus-visible i {
  background: var(--turquoise);
  transform: scale(1.5);
  box-shadow: 0 0 0 6px rgba(64, 224, 208, .15), 0 0 16px var(--turquoise);
}
nav a:focus-visible { outline: 1px dashed var(--turquoise); outline-offset: 4px; }

/* Placeholder inner pages */
body.inner { overflow: auto; }
body.inner .stage h2 {
  margin: 0;
  font-family: "Literata", Georgia, serif;
  font-weight: 200;
  font-size: clamp(2rem, 6vw, 4rem);
  letter-spacing: .08em;
  color: var(--turquoise);
  text-shadow: 0 0 24px rgba(64, 224, 208, .35);
}
body.inner .stage p { color: var(--muted); letter-spacing: .1em; }
.back {
  margin-top: 2rem;
  color: var(--teal);
  text-decoration: none;
  letter-spacing: .2em;
  text-transform: uppercase;
  font-size: .85rem;
}
.back:hover, .back:focus-visible { color: var(--turquoise); }

@media (prefers-reduced-motion: reduce) {
  .nebula, .ring, .moon, .wobble-x, .wobble-y, .star { animation: none; }
}

/* ---------- Content pages (Mission & Values, etc.) ---------- */
body.page {
  height: auto;
  min-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
}

.site-header {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .8rem 2rem;
  max-width: 72rem;
  margin: 0 auto;
  padding: 1.4rem 1rem;
}
.home-link {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  color: var(--turquoise);
  text-decoration: none;
  font-family: "Literata", Georgia, serif;
  font-weight: 200;
  font-size: 1.05rem;
  letter-spacing: .03em;
}
.star-mark {
  width: 14px; height: 14px;
  background: var(--turquoise);
  clip-path: polygon(50% 0, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0 50%, 40% 40%);
  filter: drop-shadow(0 0 4px var(--turquoise));
}
.site-header nav { margin: 0; gap: .2rem 1.6rem; }
.site-header nav a { font-size: .78rem; letter-spacing: .16em; padding: .4rem 0; color: var(--muted); }
.site-header nav a[aria-current="page"] { color: var(--turquoise); }
.site-header nav a:hover, .site-header nav a:focus-visible { color: var(--turquoise); }

.content {
  position: relative;
  z-index: 1;
  max-width: 48rem;
  margin: 0 auto;
  padding: clamp(2rem, 6vh, 4.5rem) 1rem 6rem;
}
.page-title { text-align: center; margin-bottom: clamp(3rem, 8vh, 5rem); }
.page-title h1 {
  display: block;
  font-size: clamp(2.4rem, 6vw, 4rem);
  letter-spacing: .04em;
}
.lede { margin: 1.2rem 0 0; color: var(--muted); font-size: 1.1rem; letter-spacing: .04em; }

/* A single orbit line with a glowing node at each stop */
.course {
  position: relative;
  padding-left: clamp(1.6rem, 5vw, 3rem);
}
.course::before {
  content: "";
  position: absolute;
  left: 5px; top: .6rem; bottom: 0;
  width: 1px;
  background: linear-gradient(180deg, transparent, var(--teal-dark) 6%, var(--teal-dark) 94%, transparent);
}
.stop { position: relative; margin-bottom: clamp(3rem, 8vh, 4.5rem); }
.stop::before {
  content: "";
  position: absolute;
  left: calc(-1 * clamp(1.6rem, 5vw, 3rem));
  top: .55rem;
  width: 11px; height: 11px;
  border-radius: 50%;
  background: var(--turquoise);
  box-shadow: 0 0 0 5px rgba(64, 224, 208, .12), 0 0 16px var(--turquoise);
}
.course .stop:last-child { margin-bottom: 0; }
.course .stop:last-child p:last-child { margin-bottom: 0; }

.content h2, .content h3 {
  font-family: "Literata", Georgia, serif;
  font-weight: 300;
  color: var(--turquoise);
  line-height: 1.25;
}
.content h2 { margin: 0 0 1rem; font-size: clamp(1.5rem, 3.4vw, 2rem); text-shadow: 0 0 22px rgba(64, 224, 208, .3); }
.content h3 { margin: 0 0 .8rem; font-size: 1.2rem; }
.content p { margin: 0 0 1.1rem; font-size: 1.05rem; line-height: 1.8; color: var(--text); }
.content a { color: var(--turquoise); text-underline-offset: 4px; text-decoration-color: var(--teal); }
.content a:hover, .content a:focus-visible { text-decoration-color: var(--turquoise); }
.content .closing {
  margin: clamp(4rem, 10vh, 6rem) 0 0;
  text-align: center;
  color: #fff;
  font-size: 1.1rem;
}

.values {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.2rem;
  margin-top: 2rem;
  padding-left: clamp(1.6rem, 5vw, 3rem); /* lines the boxes up with the text above */
}
.value {
  padding: 1.4rem 1.5rem .5rem;
  background: rgba(0, 0, 0, .5);
  border: 1px solid var(--teal-dark);
  border-radius: 6px;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  transition: border-color .3s, box-shadow .3s;
}
.value:hover { border-color: var(--teal); box-shadow: 0 0 24px rgba(15, 157, 154, .15); }
.value.wide { grid-column: 1 / -1; }
.value p { font-size: 1rem; line-height: 1.75; }

@media (max-width: 640px) {
  .values { grid-template-columns: 1fr; }
  .site-header { justify-content: center; text-align: center; }
  .site-header nav { justify-content: center; }
}

/* ---------- Services page ---------- */
.content.wide-content { max-width: 64rem; }
.intro { max-width: 44rem; margin: 0 auto clamp(2.5rem, 6vh, 4rem); text-align: center; }
.intro p { color: var(--muted); font-size: 1.1rem; }

.chips {
  list-style: none;
  margin: 2rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .6rem;
}
.chips a {
  display: inline-block;
  padding: .4rem .9rem;
  border: 1px solid var(--teal-dark);
  border-radius: 999px;
  color: var(--text);
  font-size: .82rem;
  text-decoration: none;
  transition: border-color .3s, color .3s, box-shadow .3s;
}
.chips a:hover, .chips a:focus-visible {
  color: var(--turquoise);
  border-color: var(--turquoise);
  box-shadow: 0 0 14px rgba(64, 224, 208, .25);
  outline: none;
}

.values.flush { padding-left: 0; margin-top: 0; }
.value h2 { margin: 0 0 1rem; font-size: 1.4rem; text-shadow: none; }
.value { scroll-margin-top: 1.5rem; }
.value ul { margin: 0 0 1.1rem; padding: 0; list-style: none; }
.value li {
  position: relative;
  margin: 0 0 .5rem;
  padding-left: 1.3rem;
  font-size: 1rem;
  line-height: 1.6;
}
.value li::before {
  content: "";
  position: absolute;
  left: 0; top: .6em;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 6px var(--teal);
}
.value strong { font-weight: 600; color: var(--turquoise); }
.value .label { margin-bottom: .7rem; color: var(--muted); }
.value .note { color: var(--muted); font-size: .95rem; font-style: italic; }
.value.wide ul { columns: 2; column-gap: 2.5rem; }
.value.wide li { break-inside: avoid; }

.outro { max-width: 44rem; margin: clamp(4rem, 10vh, 6rem) auto 0; text-align: center; }
.outro h3 { margin-top: 2.4rem; }

@media (max-width: 640px) {
  .value.wide ul { columns: 1; }
}

/* ---------- People page ---------- */
.content.people-content { max-width: 58rem; }
.people { display: grid; gap: 1.6rem; }
.person {
  display: grid;
  grid-template-columns: 11rem minmax(0, 1fr);
  gap: 2rem;
  align-items: start;
  padding: 1.8rem;
  background: rgba(0, 0, 0, .5);
  border: 1px solid var(--teal-dark);
  border-radius: 6px;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  transition: border-color .3s, box-shadow .3s;
}
.person:hover { border-color: var(--teal); box-shadow: 0 0 24px rgba(15, 157, 154, .15); }

/* Square, softly rounded portrait with a thin frame and one dot travelling around it */
.portrait { position: relative; aspect-ratio: 1; margin: 6px; }
.portrait img {
  display: block;
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--teal);
  box-shadow: 0 0 22px rgba(15, 157, 154, .35);
}
.portrait::before {
  content: "";
  position: absolute;
  inset: -9px;
  border: 1px solid var(--teal-dark);
  border-radius: 18px;
}
.portrait::after {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--turquoise);
  filter: drop-shadow(0 0 5px var(--turquoise));
  offset-path: inset(-9px round 18px);
  offset-anchor: center;
  offset-rotate: 0deg;
  animation: frame-orbit 24s linear infinite;
}
.person:nth-child(even) .portrait::after { animation-duration: 32s; }
@keyframes frame-orbit { from { offset-distance: 0%; } to { offset-distance: 100%; } }

.bio h2 { margin: 0 0 .5rem; font-size: 1.7rem; text-shadow: none; }
.roles {
  display: flex;
  flex-wrap: wrap;
  margin: 0 0 1.2rem;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: .8rem;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.roles li:not(:last-child)::after { content: "|"; margin: 0 .8em; color: var(--teal); }
.bio p { font-size: 1rem; }
.bio .social { margin: 1.4rem 0 0; }

@media (max-width: 640px) {
  .person { grid-template-columns: 1fr; gap: 1.4rem; padding: 1.4rem; }
  .portrait { width: 9rem; justify-self: center; }
  .bio h2, .roles { justify-content: center; text-align: center; }
}
@media (prefers-reduced-motion: reduce) { .portrait::after { animation: none; } }

/* ---------- Contact page ---------- */
.content.contact-content { max-width: 40rem; }
.contact-intro { text-align: center; color: var(--muted); margin-bottom: 2.5rem; }

.contact-form {
  padding: 2rem;
  background: rgba(0, 0, 0, .5);
  border: 1px solid var(--teal-dark);
  border-radius: 6px;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.field { margin-bottom: 1.5rem; }
.field label {
  display: block;
  margin-bottom: .5rem;
  color: var(--turquoise);
  font-size: .85rem;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.field input, .field textarea {
  width: 100%;
  padding: .8rem .9rem;
  background: rgba(0, 0, 0, .6);
  border: 1px solid var(--teal-dark);
  border-radius: 4px;
  color: var(--text);
  font: inherit;
  font-size: 1rem;
  line-height: 1.5;
  transition: border-color .25s, box-shadow .25s;
}
.field textarea { resize: vertical; min-height: 9rem; }
.field input:hover, .field textarea:hover { border-color: var(--teal); }
.field input:focus, .field textarea:focus {
  outline: none;
  border-color: var(--turquoise);
  box-shadow: 0 0 0 3px rgba(64, 224, 208, .18), 0 0 16px rgba(64, 224, 208, .15);
}
.field [aria-invalid="true"] { border-color: #ff8a7a; }
.hint { margin: .45rem 0 0; color: var(--muted); font-size: .85rem; }
.counter { text-align: right; }
.error { margin: .45rem 0 0; min-height: 0; color: #ff9d8f; font-size: .88rem; }
.error:empty { display: none; }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.captcha { min-height: 4rem; }

.actions { display: flex; justify-content: flex-end; }
.actions button {
  padding: .85rem 2.2rem;
  background: transparent;
  color: var(--turquoise);
  border: 1px solid var(--turquoise);
  border-radius: 4px;
  font: inherit;
  font-size: .9rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background .25s, box-shadow .25s, color .25s;
}
.actions button:hover, .actions button:focus-visible {
  background: rgba(64, 224, 208, .12);
  box-shadow: 0 0 20px rgba(64, 224, 208, .3);
  outline: none;
}
.actions button:disabled { opacity: .5; cursor: progress; }

.status { margin: 1.4rem 0 0; font-size: .98rem; line-height: 1.6; }
.status:empty { display: none; }
.status.ok { color: var(--turquoise); }
.status.warn { color: #f2d28b; }
.status.bad { color: #ff9d8f; }

@media (max-width: 640px) {
  .contact-form { padding: 1.4rem; }
  .actions { justify-content: stretch; }
  .actions button { width: 100%; }
}
