/* ===================================================================
   style.css — styles shared by every page
   Plain CSS, no preprocessor. Edit the design tokens in section 1 to
   change colours and fonts site-wide.

   Every page loads this file first, then its own file from pages/:
     index.html            pages/home.css
     projects/index.html   pages/projects.css
     about/index.html      pages/about.css
     contact/index.html    pages/contact.css
     404.html              pages/not-found.css
   Something used on two or more pages lives here. Something used on one
   page lives in that page's file.

   CONTENTS
    1. Design tokens
    2. Reset and base
    3. Background (blueprint canvas + ambient rings)
    4. Custom cursor
    5. Page-transition curtain
    6. Header and navigation
    7. Full-screen menu
    8. Text effects (headings, line masks, reveal-on-scroll)
    9. Page heading block
   10. Marquee strip (home, about)
   11. Project art (home, work)
   12. Call to action, large button, footer
   13. Logo shapes (home splash, contact backdrop)
   14. Responsive rules (shared parts)
   15. Reduced motion
   =================================================================== */

/* ---------- 1. Design tokens ---------- */
:root {
  --navy: #003252;
  --navy-dark: #00243b;
  --slate: #496c82;
  --slate-light: #668497;
  --muted: #8fa4b2;
  --white: #f1f2f2;
  --grey: #d1d3d4;
  --line: rgba(209, 211, 212, 0.2);
  --headline-face: #12496b;
  --status-open: #5dff8f;
  --status-busy: #ffc933;
  --status-closed: #ff5d5d;
  --font-display: 'Outfit', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------- 2. Reset and base ---------- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html {
  background: var(--navy);
  scroll-behavior: auto;
  -webkit-text-size-adjust: 100%;
}
body {
  background: var(--navy);
  color: var(--white);
  font-family: var(--font-display);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
a {
  color: inherit;
  text-decoration: none;
}
button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}
:focus-visible {
  outline: 2px solid var(--white);
  outline-offset: 4px;
}
main {
  position: relative;
  z-index: 2;
}

/* Small uppercase monospace labels */
.mono,
.eyebrow,
small {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.text-muted {
  color: var(--muted);
}
.eyebrow {
  color: var(--muted);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
}
.eyebrow::before {
  content: "";
  width: 2.2rem;
  height: 1px;
  background: var(--muted);
}

/* ---------- 3. Background ---------- */
#blueprint-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.ambient {
  position: fixed;
  z-index: 1;
  border-radius: 50%;
  border: 1px solid var(--line);
  pointer-events: none;
}
.ambient-1 {
  width: 60vmin;
  height: 60vmin;
  left: -18vmin;
  top: -14vmin;
  animation: drift-a 30s ease-in-out infinite alternate;
}
.ambient-2 {
  width: 38vmin;
  height: 38vmin;
  right: -8vmin;
  bottom: -6vmin;
  animation: drift-b 24s ease-in-out infinite alternate;
}
.ambient-3 {
  width: 22vmin;
  height: 22vmin;
  right: 18vw;
  top: 16vh;
  animation: drift-a 20s ease-in-out infinite alternate-reverse;
}
@keyframes drift-a {
  to {
    transform: translate(8vmin, 6vmin);
  }
}
@keyframes drift-b {
  to {
    transform: translate(-6vmin, -8vmin);
  }
}

/* ---------- 4. Custom cursor (mouse devices only; JS adds .has-custom-cursor) ---------- */
.has-custom-cursor body,
.has-custom-cursor a,
.has-custom-cursor button {
  cursor: none;
}
.cursor-dot,
.cursor-ring {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 300;
  pointer-events: none;
  display: none;
}
.has-custom-cursor .cursor-dot,
.has-custom-cursor .cursor-ring {
  display: block;
}
.cursor-dot::after {
  content: "";
  display: block;
  width: 8px;
  height: 8px;
  margin: -4px;
  border-radius: 50%;
  background: var(--white);
}
.cursor-ring::after {
  content: "";
  display: block;
  width: 44px;
  height: 44px;
  margin: -22px;
  border-radius: 50%;
  border: 1px solid var(--white);
  transition: transform 0.35s var(--ease-out), background 0.3s;
}
.is-hovering-link .cursor-ring::after {
  transform: scale(1.6);
  background: rgba(241, 242, 242, 0.1);
}

/* ---------- 5. Page-transition curtain ---------- */

/* Covers the screen until the page is ready, and again while leaving. */
.curtain {
  position: fixed;
  inset: 0;
  z-index: 250;
  background: var(--headline-face);
  transition: transform 0.9s var(--ease-out);
  pointer-events: none;
  transform: translateY(-101%);
}
.js .curtain {
  transform: translateY(0);
}
.js.is-ready .curtain {
  transform: translateY(-101%);
}

/* ---------- 6. Header and navigation ---------- */

/* Three-column grid keeps the centre links centred on the screen, whatever the side widths. */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 1rem 2rem;
  transition: background 0.4s, padding 0.4s;
}
.site-header.is-solid {
  background: rgba(0, 36, 59, 0.87);
  backdrop-filter: blur(6px);
  padding-block: 0.6rem;
  border-bottom: 1px solid var(--line);
}
.brand {
  display: block;
  width: 76px;
  padding: 2px 0;
  grid-column: 1;
  justify-self: start;
  position: relative;
}
.brand img {
  display: block;
  width: 100%;
  height: auto;
  transition: transform 0.6s var(--ease-out);
}
.brand:hover img {
  transform: translateX(4px);
  filter: saturate(1.2);
}
.brand .brand-mark-filled {
  position: absolute;
  top: 2px;
  left: 0;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.6s var(--ease-out);
}
.brand:hover .brand-mark-filled,
.brand:focus-visible .brand-mark-filled {
  opacity: .35;
}
.nav-links {
  grid-column: 2;
  display: flex;
  gap: 0.3rem;
}
.nav-links a {
  font: 0.75rem var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.55rem 1.1rem;
  border-radius: 99px;
  border: 1px solid transparent;
  transition: border-color 0.3s, background 0.3s;
}
.nav-links a:hover {
  border-color: var(--line);
}
.nav-links a[aria-current="page"] {
  background: var(--white);
  color: var(--navy);
}
.header-right {
  grid-column: 3;
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 1.2rem;
}
.clock {
  font: 0.7rem var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}
.menu-button {
  width: 46px;
  height: 46px;
  position: relative;
  border: 1px solid var(--line);
  border-radius: 50%;
}
.menu-button i {
  position: absolute;
  left: 14px;
  right: 14px;
  height: 1.5px;
  background: var(--white);
  transition: transform 0.5s var(--ease-out);
}
.menu-button i:first-child {
  top: 19px;
}
.menu-button i:last-child {
  top: 26px;
}
.menu-open .menu-button i:first-child {
  transform: translateY(3.5px) rotate(45deg);
}
.menu-open .menu-button i:last-child {
  transform: translateY(-3.5px) rotate(-45deg);
}

/* ---------- 7. Full-screen menu ---------- */
.menu {
  position: fixed;
  inset: 0;
  z-index: 150;
  background: var(--navy-dark);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.4rem;
  padding: 0 2rem;
  clip-path: circle(0 at calc(100% - 3.2rem) 2.4rem);
  transition: clip-path 0.9s var(--ease-out);
  visibility: hidden;
}
.menu-open .menu {
  clip-path: circle(150% at calc(100% - 3.2rem) 2.4rem);
  visibility: visible;
}
.menu-link {
  display: flex;
  align-items: center;
  gap: 1.4rem;
  width: fit-content;
  font-size: clamp(2.8rem, 10vw, 8.5rem);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1.05;
  color: var(--white);
}
.menu-link span {
  color: var(--slate-light);
  transition: color 0.3s, transform 0.5s var(--ease-out);
}
.menu-number {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.1rem;
  height: 3.1rem;
  border: 1px solid var(--slate-light);
  border-radius: 50%;
  font: 500 1rem/1 var(--font-mono);
  font-style: normal;
  letter-spacing: 0;
  color: var(--white);
  transition: background 0.3s, color 0.3s, border-color 0.3s;
}
.menu-link:hover span,
.menu-link[aria-current="page"] span {
  color: var(--white);
}
.menu-link:hover span {
  transform: translateX(0.6rem);
}
.menu-link:hover .menu-number,
.menu-link[aria-current="page"] .menu-number {
  background: var(--white);
  color: var(--navy);
  border-color: var(--white);
}
.menu-footer {
  position: absolute;
  bottom: 2rem;
  left: 2rem;
  display: flex;
  gap: 2rem;
  font: 0.75rem var(--font-mono);
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- 8. Text effects ---------- */

/* Line mask: text slides up from behind a clipping edge. */
.line-mask {
  display: block;
  overflow: hidden;
  padding: 0.06em 0.1em 0.26em;
  margin: -0.06em -0.1em -0.26em;
}
.line-mask-inner {
  display: block;
}
.js .line-mask-inner {
  transform: translateY(118%);
  transition: transform 1.1s var(--ease-out);
}
.js .line-mask.is-visible .line-mask-inner {
  transform: none;
}

/* Reveal: fades and rises when scrolled into view. */
.js .reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 1s var(--ease-out), transform 1s var(--ease-out);
}
.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}
.heading-xl {
  font-size: clamp(3.4rem, 12.5vw, 12.5rem);
  line-height: 0.92;
  letter-spacing: -0.04em;
  font-weight: 700;
}
.heading-lg {
  font-size: clamp(2.4rem, 6.5vw, 6.5rem);
  line-height: 0.98;
  letter-spacing: -0.045em;
  font-weight: 700;
}
.heading-md {
  font-size: clamp(2rem, 4.6vw, 4.2rem);
  line-height: 0.98;
  letter-spacing: -0.045em;
  font-weight: 700;
}

/* Outlined word: white outline layer (::before) sits behind an opaque navy-blue face. */
.outlined {
  position: relative;
  display: inline-block;
  isolation: isolate;
  white-space: nowrap;
  color: var(--headline-face);
}
.outlined::before {
  content: attr(data-text);
  position: absolute;
  left: 0;
  top: 0;
  z-index: -1;
  color: var(--white);
  white-space: nowrap;
  -webkit-text-stroke: max(4px, 0.018em) var(--white);
  paint-order: stroke fill;
}

/* Small circle used as a full stop after headings */
.dot-mark {
  display: inline-block;
  width: 0.17em;
  height: 0.17em;
  border-radius: 50%;
  background: var(--headline-face);
  border: max(2px, 0.012em) solid var(--white);
  margin-left: 0.04em;
}

/* ---------- 9. Page heading block (work, about, contact) ---------- */
.page-head {
  padding: 10rem 2rem 3rem;
  position: relative;
}

/* ---------- 10. Marquee strip ---------- */
.marquee-wrap {
  overflow: hidden;
  padding: 2.5rem 0;
}
.marquee {
  --gap: clamp(1.5rem, 3.2vw, 3rem);
  width: 104%;
  margin-left: -2%;
  transform: rotate(-1.4deg);
  background: var(--slate);
  color: var(--white);
  padding: 1.15rem 0 1.05rem;
  overflow: hidden;
  border-block: 1px solid var(--line);
}
.marquee--flat {
  transform: none;
  background: none;
  border-color: var(--line);
  width: 100%;
  margin: 0;
}

/* Two identical groups side by side; the track slides left by exactly one group, then loops. */
.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee-slide 36s linear infinite;
}
.marquee:hover .marquee-track {
  animation-play-state: paused;
}
.marquee-group {
  display: flex;
  align-items: center;
  gap: var(--gap);
  padding-right: var(--gap);
  flex: none;
}
.marquee-group span {
  font-size: clamp(1.8rem, 4.5vw, 4rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.1;
  white-space: nowrap;
  text-transform: lowercase;
}
.marquee-dot {
  flex: none;
  width: clamp(0.5rem, 0.9vw, 0.8rem);
  aspect-ratio: 1;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.7;
}
@keyframes marquee-slide {
  to {
    transform: translateX(-50%);
  }
}

/* ---------- 11. Project art ---------- */

/* Animated placeholder art for each project (swap for real screenshots when ready) */
.project-art {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  isolation: isolate;
  border: 1px solid var(--line);
}
.project-art i {
  position: absolute;
  display: block;
}
.project-art--servers {
  background: linear-gradient(160deg, #00406b, #00243b);
}
.project-art--servers i {
  left: 10%;
  right: 10%;
  height: 12%;
  border-radius: 8px;
  border: 1.5px solid var(--white);
  background: rgba(73, 108, 130, 0.35);
  animation: server-sway 3.2s ease-in-out infinite;
}
.project-art--servers i:nth-child(1) {
  top: 12%;
}
.project-art--servers i:nth-child(2) {
  top: 32%;
  animation-delay: -0.8s;
}
.project-art--servers i:nth-child(3) {
  top: 52%;
  animation-delay: -1.6s;
}
.project-art--servers i:nth-child(4) {
  top: 72%;
  animation-delay: -2.4s;
}
.project-art--servers i::after {
  content: "";
  position: absolute;
  right: 5%;
  top: 38%;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--status-open);
}
@keyframes server-sway {
  50% {
    transform: translateX(4%);
    background: rgba(102, 132, 151, 0.55);
  }
}
.project-art--buildings {
  background: #00314f;
  background-image: linear-gradient(rgba(209, 211, 212, 0.16) 1px, transparent 1px), linear-gradient(90deg, rgba(209, 211, 212, 0.16) 1px, transparent 1px);
  background-size: 36px 36px;
}
.project-art--buildings i {
  bottom: 0;
  border: 1.5px solid var(--white);
  border-bottom: 0;
  background: rgba(73, 108, 130, 0.55);
  transform-origin: bottom;
  animation: building-breathe 5s var(--ease-out) infinite alternate;
}
.project-art--buildings i:nth-child(1) {
  left: 12%;
  width: 28%;
  height: 52%;
}
.project-art--buildings i:nth-child(2) {
  left: 44%;
  width: 22%;
  height: 74%;
  animation-delay: -1.3s;
}
.project-art--buildings i:nth-child(3) {
  left: 70%;
  width: 16%;
  height: 36%;
  animation-delay: -2.6s;
}
.project-art--buildings i:nth-child(4) {
  display: none;
}
@keyframes building-breathe {
  to {
    transform: scaleY(0.72);
  }
}
.project-art--orbits {
  background: radial-gradient(circle, #0b4a70, #00243b 72%);
}
.project-art--orbits i {
  left: 50%;
  top: 50%;
  border-radius: 50%;
  border: 1.5px solid var(--white);
  transform: translate(-50%, -50%);
  animation: orbit-spin 9s linear infinite;
}
.project-art--orbits i:nth-child(1) {
  width: 18%;
  aspect-ratio: 1;
  background: var(--slate);
}
.project-art--orbits i:nth-child(2) {
  width: 42%;
  aspect-ratio: 1;
  border-style: dashed;
  animation-direction: reverse;
}
.project-art--orbits i:nth-child(3) {
  width: 68%;
  aspect-ratio: 1;
}
.project-art--orbits i:nth-child(4) {
  width: 94%;
  aspect-ratio: 1;
  border-style: dashed;
  animation-duration: 14s;
}
@keyframes orbit-spin {
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

/* ---------- 12. Call to action, large button, footer ---------- */
.cta {
  padding: 7rem 2rem 2rem;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  border-top: 1px solid var(--line);
}
.button-large {
  align-self: flex-start;
  margin: 3rem 0;
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  background: var(--white);
  color: var(--navy);
  padding: 1.5rem 2.8rem;
  border-radius: 99px;
  font-size: 1.4rem;
  font-weight: 600;
  transition: background 0.3s, color 0.3s;
}
.button-large svg {
  width: 26px;
  transition: transform 0.4s var(--ease-out);
}
.button-large:hover {
  background: var(--slate);
  color: var(--white);
}
.button-large:hover svg {
  transform: translate(4px, -4px);
}
.footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  font: 0.72rem var(--font-mono);
  text-transform: uppercase;
  color: var(--muted);
  padding-top: 1.8rem;
  border-top: 1px solid var(--line);
}
.footer a:hover {
  color: var(--white);
}

/* ---------- 13. Logo shapes ---------- */

/* Class names come from the Illustrator export of the "gridwork" logo.
   gw-1 / gw-12 are solid fills, gw-2 to gw-9 are strokes. Groups gw-10 and gw-11
   give the fills and thin grid lines their translucency. Avoid editing by hand. */
.gridwork {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}
.gw-1 {
  fill: #f1f2f2;
}
.gw-12 {
  fill: #d1d3d4;
}
.gw-2,
.gw-3,
.gw-4,
.gw-5,
.gw-6,
.gw-7,
.gw-8,
.gw-9 {
  fill: none;
  stroke-miterlimit: 10;
}
.gw-2,
.gw-3,
.gw-6,
.gw-7,
.gw-8,
.gw-9 {
  stroke: #d1d3d4;
}
.gw-4,
.gw-5 {
  stroke: #f1f2f2;
}
.gw-2 {
  stroke-linecap: round;
}
.gw-3,
.gw-4 {
  stroke-linecap: square;
}
.gw-2,
.gw-3,
.gw-4,
.gw-5,
.gw-7,
.gw-8 {
  stroke-width: 0.84px;
}
.gw-6 {
  stroke-width: 4.47px;
}
.gw-9 {
  stroke-width: 2.24px;
}
.gw-10 {
  opacity: 0.3;
}
.gw-11 {
  opacity: 0.4;
}

/* ---------- 14. Responsive rules (shared parts) ---------- */

/* Hide centre links and clock; the menu button remains */
@media(max-width:900px) {
  .nav-links,
  .clock {
    display: none;
  }
  .site-header {
    grid-template-columns: 1fr auto;
  }
  .header-right {
    grid-column: 2;
  }
}

/* Phones */
@media(max-width:800px) {
  .site-header {
    padding: 0.8rem 1.2rem;
  }
  .brand {
    width: 64px;
  }
  .page-head,
  .cta {
    padding-inline: 1.2rem;
  }
  .menu-number {
    width: 2.5rem;
    height: 2.5rem;
    font-size: 0.9rem;
  }
}

/* ---------- 15. Reduced motion ---------- */
@media(prefers-reduced-motion:reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01s!important;
    animation-iteration-count: 1!important;
    transition-duration: 0.01s!important;
  }
  .marquee-track {
    animation: none!important;
  }
}
