/* Design system after edolus.com, in ideaForge colours.
   Gilroy is used when installed locally; Urbanist is the web fallback. */
@font-face { font-family: "GF Display"; font-weight: 800; src: local("Gilroy-ExtraBold"), local("Gilroy ExtraBold"); }
@font-face { font-family: "GF Light"; font-weight: 300; src: local("Gilroy-Light"), local("Gilroy Light"); }
@font-face { font-family: "GF Text"; font-weight: 400; src: local("Gilroy-Regular"), local("Gilroy Regular"); }
@font-face { font-family: "GF Label"; font-weight: 500; src: local("Gilroy-SemiBold"), local("Gilroy SemiBold"); }

:root {
  --deep: #051F1E;
  --deep-2: #0B2D2A;
  --lime: #91C84F;
  --signal: #EEF4EA;
  --moss: #9DB3A6;
  --alert: #E5533D;
  --hair: rgba(238, 244, 234, .35);
  --display: "GF Display", "Urbanist", system-ui, sans-serif;
  --light: "GF Light", "Urbanist", system-ui, sans-serif;
  --text: "GF Text", "Urbanist", system-ui, sans-serif;
  --label: "GF Label", "Urbanist", system-ui, sans-serif; /* small uppercase labels and captions */
  --gutter: clamp(16px, 4.4vw, 64px);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--deep); color: var(--signal);
  font-family: var(--text); font-size: 1rem; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
body.is-loading { overflow: hidden; }
a { color: inherit; }
:focus-visible { outline: 1px solid var(--lime); outline-offset: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
.shade {
  position: fixed; inset: 0; pointer-events: none;
  background:
    radial-gradient(80% 34% at 50% 100%, rgba(5,31,30,.8) 0%, rgba(5,31,30,.45) 50%, rgba(5,31,30,0) 100%),
    linear-gradient(0deg, rgba(5,31,30,.45) 0%, rgba(5,31,30,0) 30%);
}

/* ---------- loader: the thermal frame reads out row by row (--p = 0..1) ---------- */
.loader {
  position: fixed; inset: 0; z-index: 20; display: grid; place-content: center; justify-items: center; gap: 14px;
  background: var(--deep); transition: opacity .9s ease, visibility .9s;
}
.readout-frame { position: relative; width: min(320px, 70vw); aspect-ratio: 320 / 256; }
.readout-frame img {
  display: block; width: 100%; height: 100%; image-rendering: pixelated;
  clip-path: inset(0 0 calc((1 - var(--p)) * 100%) 0);
  filter: contrast(1.15);
}
.readout-frame .scan {
  position: absolute; left: 0; right: 0; height: 1px; background: var(--lime);
  top: calc(var(--p) * 100%); opacity: calc(1 - var(--p));
}
.loader-pct { margin: 0; font-size: .82rem; font-variant-numeric: tabular-nums; color: var(--moss); }
body:not(.is-loading) .loader { opacity: 0; visibility: hidden; }

/* ---------- viewfinder (edolus HUD frame) ---------- */
.viewfinder { position: fixed; inset: 40px var(--gutter) 40px; pointer-events: none; z-index: 1; opacity: 0; transition: opacity .6s; }
.viewfinder.on { opacity: 1; }
.viewfinder i { position: absolute; width: 22px; height: 22px; border: 0 solid var(--hair); }
.viewfinder i:nth-child(1) { left: 0; top: 0; border-left-width: 1px; border-top-width: 1px; }
.viewfinder i:nth-child(2) { right: 0; top: 0; border-right-width: 1px; border-top-width: 1px; }
.viewfinder i:nth-child(3) { left: 0; bottom: 0; border-left-width: 1px; border-bottom-width: 1px; }
.viewfinder i:nth-child(4) { right: 0; bottom: 0; border-right-width: 1px; border-bottom-width: 1px; }
.viewfinder b { position: absolute; top: 50%; width: 3px; height: 64px; margin-top: -32px; background: rgba(238,244,234,.5); }
.viewfinder b:nth-of-type(1) { left: -1px; }
.viewfinder b:nth-of-type(2) { right: -1px; }

/* ---------- 3D tags: + crosshair with a hairline leader ---------- */
.tags { position: fixed; inset: 0; pointer-events: none; z-index: 3; }
.tag {
  position: absolute; left: 0; top: 0; display: flex; align-items: center; gap: 0;
  font-family: var(--label); font-weight: 500; font-size: .66rem; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap;
  color: var(--signal); opacity: 0; will-change: transform, opacity;
}
.tag .x { position: relative; width: 13px; height: 13px; margin: -6.5px 0 0 -6.5px; align-self: flex-start; }
.tag .x::before, .tag .x::after { content: ""; position: absolute; background: var(--signal); }
.tag .x::before { left: 6px; top: 0; width: 1px; height: 13px; }
.tag .x::after { top: 6px; left: 0; height: 1px; width: 13px; }
.tag .lead { width: 38px; height: 1px; background: var(--hair); margin: -6px 8px 0 4px; transform: rotate(-28deg); transform-origin: left center; align-self: flex-start; }
.tag .t { margin-top: -30px; }
.tag.left { flex-direction: row-reverse; }
.tag.left .x { margin: -6.5px -6.5px 0 0; }
.tag.left .lead { transform: rotate(28deg); transform-origin: right center; margin: -6px 4px 0 8px; }
.tag.alert .t { color: var(--alert); }
.tag.good .t { color: var(--lime); }

/* ---------- steps ---------- */
main { position: relative; z-index: 2; }
.step { min-height: 160vh; position: relative; }
/* One headline at a time: each step's copy is pinned bottom-centre and cross-faded by scroll (main.js). */
.step .copy {
  position: fixed; left: 0; right: 0; bottom: 7vh; margin: 0 auto; text-align: center;
  opacity: 0; visibility: hidden; will-change: opacity, transform;
}
.step .copy.live { visibility: visible; }
.step.hero { min-height: 140vh; }
.copy { width: min(880px, calc(100vw - 2 * var(--gutter))); }
.copy.wide { width: min(820px, calc(100vw - 2 * var(--gutter))); }
h1, h2, h3 { margin: 0; font-family: var(--display); font-weight: 800; text-transform: uppercase; }
h1, h2 { letter-spacing: -.005em; line-height: .9; color: rgba(238,244,234,.94); }
h1 span, h2 span { display: block; }
/* Headings sit in the band under the scene; kept modest so they never cover the 3D subject. */
h1 { font-size: clamp(2.4rem, 4.6vw, 4.8rem); }
h2 { font-size: clamp(2rem, 3.8vw, 4rem); }
.body { margin: 18px auto 0; max-width: 58ch; font-size: 1.04rem; line-height: 1.6; color: rgba(238,244,234,.84); }

/* edolus-style button: solid block with corner ticks */
.cta {
  position: relative; margin-top: 30px; padding: 15px 30px; border: 0; cursor: pointer;
  background: var(--signal); color: var(--deep);
  font-family: var(--label); font-weight: 500; font-size: .74rem; letter-spacing: .12em; text-transform: uppercase;
}
.cta::before, .cta::after, .cta span::before, .cta span::after { content: ""; position: absolute; width: 4px; height: 4px; background: var(--signal); }
.cta::before { left: -7px; top: -7px; }
.cta::after { right: -7px; top: -7px; }
.cta span::before { left: -7px; bottom: -7px; }
.cta span::after { right: -7px; bottom: -7px; }
.cta:hover { background: var(--lime); }
.cta:hover::before, .cta:hover::after, .cta:hover span::before, .cta:hover span::after { background: var(--lime); }
/* ---------- ending ---------- */
.credit { margin: 26px auto 0; font-size: .7rem; letter-spacing: .02em; color: rgba(157,179,166,.7); }

/* ---------- small screens ---------- */
@media (max-width: 860px) {
  .step .copy { bottom: 6vh; }
  .viewfinder { display: none; }
  .tag .t { font-size: .58rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .loader, .viewfinder { transition: none; }
}
