/* AGORA site styles. Sizes follow the Figma artboard (1280 x 832).
   --u scales the artboard to fit the screen; --w scales to screen width only. */
:root {
  color-scheme: dark;
  --bg: #193420;
  --ink: #ffffff;
  --card: #66d684;
  --card-ink: #404040;
  --halo: calc(392 * var(--u));
  --glow: 232, 81, 255;   /* Figma glow #E851FF */
  --u: min(calc(100vw / 1280), calc(100vh / 832));
  --w: calc(100vw / 1280);
  --oy: calc((100vh - 832 * var(--u)) / 2);   /* centres the artboard vertically */
  --wide: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --head: "Sora", "Helvetica Neue", Arial, sans-serif;
  --body: "Helvetica Neue", Helvetica, "Inter", Arial, sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--bg); }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; }
a { color: inherit; }

/* Page-to-page: keep the old page on screen until the new one is drawn, and hold the
   building, AGORA and logo still between pages (Chrome, Edge, Safari 18.2+) */
@view-transition { navigation: auto; }
.nav { view-transition-name: nav; }
.hero__word { view-transition-name: agora; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .25s; }

/* ---------- Header: logo spins and reveals the three pages ---------- */
.nav {
  position: fixed; z-index: 50;
  left: calc(46 * var(--u)); top: calc(53 * var(--u));
  width: max(36px, calc(47 * var(--u))); height: max(36px, calc(47 * var(--u)));
}
.nav__logo { display: block; width: 100%; height: 100%; color: #fff; }
.nav__logo svg { width: 100%; height: 100%; transition: transform .7s cubic-bezier(.6,0,.2,1); }
.nav:hover .nav__logo svg,
.nav.is-open .nav__logo svg { transform: rotate(360deg); }
.nav__menu, .nav__current {
  position: absolute; top: 50%; left: calc(100% + max(26px, 49 * var(--u)));
  transform: translateY(-50%);
  display: flex; gap: max(18px, calc(32 * var(--u)));
  list-style: none; white-space: nowrap;
  font-family: var(--wide); font-stretch: 125%; font-weight: 500;
  font-size: max(10px, calc(12 * var(--u))); letter-spacing: .02em; text-transform: uppercase;
}
.nav__menu a { text-decoration: none; display: inline-block; padding: 8px 0; position: relative; }
.nav__menu a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 4px; height: 1px; background: currentColor;
  transform: scaleX(0); transform-origin: left; transition: transform .3s ease;
}
.nav__menu a:hover::after, .nav__menu a[aria-current="page"]::after { transform: scaleX(1); }
.nav__menu li {
  opacity: 0; transform: translateX(-14px);
  transition: opacity .35s ease, transform .35s ease;
  pointer-events: none;
}
.nav:hover .nav__menu li, .nav.is-open .nav__menu li, .nav:focus-within .nav__menu li {
  opacity: 1; transform: none; pointer-events: auto;
}
.nav:hover .nav__menu li:nth-child(2), .nav.is-open .nav__menu li:nth-child(2) { transition-delay: .07s; }
.nav:hover .nav__menu li:nth-child(3), .nav.is-open .nav__menu li:nth-child(3) { transition-delay: .14s; }
.nav__current { pointer-events: none; transition: opacity .25s ease; }
.nav:hover .nav__current, .nav.is-open .nav__current, .nav:focus-within .nav__current { opacity: 0; }

/* ---------- Scroll scenes ---------- */
.scene { position: relative; }
.stage { position: sticky; top: 0; height: 100vh; overflow: hidden; background: var(--bg); perspective: 1800px; perspective-origin: 75% 45%; }
.layer { position: absolute; inset: 0; will-change: transform; }

/* Hero (shared entry on every page) */
.building {
  /* 3% larger than the Figma, lifted as high as it can go (spire kept on screen) so it sits above AGORA */
  --bh: calc(856 * var(--u) * 1.03);
  position: absolute; right: 0;
  top: max(calc(-0.015 * var(--bh)), calc(100vh - 130 * var(--w) - var(--bh)));
  height: var(--bh); width: auto; aspect-ratio: 979 / 856;
  rotate: 0.371 -0.928 0 5.39deg;        /* same starting tilt the script uses, so nothing jumps on load */
  view-transition-name: building;
}
.building__img { display: block; width: 100%; height: 100%; }
/* The pink window light: pre-rendered pieces faded in on a canvas over the drawing */
.building__glow { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.hero__sub {
  position: absolute; left: calc(70 * var(--w));
  top: calc(100vh - 266 * var(--w));
  font-family: var(--body); font-weight: 300;
  font-size: max(16px, calc(23 * var(--w)));
}
.hero__word {
  position: absolute; left: 0; width: 100vw;
  top: calc(100vh - 240 * var(--w));
  font-family: var(--wide); font-stretch: 110%; font-weight: 500;
  line-height: 1; white-space: nowrap; text-align: center;
  font-size: calc(22.5 * 1vw); letter-spacing: -0.01em;
  visibility: hidden;
}
.hero__word.is-fit { visibility: visible; }
.building, .hero__sub, .hero__word, .slide__head, .slide__body, .contact-wrap { will-change: transform; }

/* Content that scrolls in starts below the screen, so it can't flash before the script places it */
.js .ap, .js .problems, .js .about-copy, .js .card, .js .contact-wrap, .js .slide__head, .js .slide__body { transform: translate3d(0, 110vh, 0); }

/* Landing text slides */
.slide__head {
  position: absolute; left: calc(46 * var(--u)); top: calc(var(--oy) + 147 * var(--u));
  width: calc(428 * var(--u)); height: calc(166 * var(--u));
  display: flex; align-items: center;
  font-family: var(--head); font-weight: 300;
  font-size: calc(54 * var(--u)); line-height: 1.17; letter-spacing: -0.01em;
}
.slide__body {
  position: absolute; left: calc(34 * var(--u)); width: calc(551 * var(--u));
  display: flex; align-items: center; justify-content: center; text-align: center;
  font-size: calc(22 * var(--u)); line-height: 1.2; font-weight: 400;
}
.slide__body--bridge { top: calc(var(--oy) + 437 * var(--u)); height: calc(96 * var(--u)); }
.slide__body--plan { top: calc(var(--oy) + 203 * var(--u)); height: calc(533 * var(--u)); }

/* Services cards */
.cards { position: absolute; inset: 0; }
.card {
  position: absolute; top: calc(var(--oy) + 176 * var(--u));
  width: calc((100vw - 2 * 11 * var(--w)) / 3); height: calc(572 * var(--u));
  background: var(--card); color: var(--card-ink);
  border-radius: calc(18 * var(--u));
  padding: calc(60 * var(--u)) calc(10 * var(--u)) 0;
  will-change: transform;
}
.card:nth-child(1) { left: 0; }
.card:nth-child(2) { left: calc((100vw + 11 * var(--w)) / 3 ); }
.card:nth-child(3) { right: 0; }
.card h2 {
  font-family: var(--head); font-weight: 300; text-align: center;
  font-size: calc(46 * var(--u)); line-height: 1.3; letter-spacing: 0;
  min-height: calc(120 * var(--u));
}
.card ul {
  margin-top: calc(14 * var(--u)); padding-left: calc(36 * var(--u)); padding-right: calc(4 * var(--u));
  font-size: calc(22 * var(--u)); line-height: 1.3; font-weight: 300; letter-spacing: -0.012em;
}
.card li::marker { font-size: .8em; }

/* About: APs, beams, mesh */
.art {
  position: absolute; left: calc((100vw - 1280 * var(--u)) / 2); top: var(--oy);
  width: calc(1280 * var(--u)); height: calc(832 * var(--u));
}
.ap { position: absolute; z-index: 1; isolation: isolate; will-change: transform; }
.ap::before {
  /* every AP gets the same size of glow, centred on it */
  content: ""; position: absolute; left: 50%; top: 50%; z-index: -1; border-radius: 50%;
  width: var(--halo); height: var(--halo); transform: translate(-50%, -50%);
  background: radial-gradient(closest-side, rgba(var(--glow), .8), rgba(var(--glow), .32) 40%, rgba(var(--glow), 0));
  opacity: 0; transition: opacity 1s ease;
}
.ap.is-lit::before { opacity: 1; }
.ap__fallback { width: 100%; height: 100%; object-fit: contain; }
.ap.has-3d .ap__fallback { display: none; }
.ap__3d { position: absolute; left: -25%; top: -25%; width: 150%; height: 150%; }
.ap--glow { left: calc(42 * var(--u)); top: calc(612 * var(--u)); width: calc(169 * var(--u)); height: calc(169 * var(--u)); }
.ap--side { left: calc(1150 * var(--u)); top: calc(585 * var(--u)); width: calc(66 * var(--u)); height: calc(190 * var(--u)); }
.ap--roof { left: calc(554 * var(--u)); top: calc(6 * var(--u)); width: calc(162 * var(--u)); height: calc(112 * var(--u)); }
.beams { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; visibility: hidden; }
/* fine film grain over the glows so the soft gradients don't show steps (banding) */
.grain { position: absolute; inset: -10%; pointer-events: none; mix-blend-mode: overlay; opacity: .4; background-size: 160px 160px; }
.problems {
  position: absolute; left: 0; right: 0; top: calc(var(--oy) + 435 * var(--u));
  text-align: center; font-family: var(--wide); font-stretch: 125%; font-weight: 600;
  font-size: calc(31 * var(--u)); letter-spacing: .01em; will-change: transform, opacity;
}
.about-copy {
  position: absolute; left: calc(340 * var(--u)); top: calc(420 * var(--u));
  width: calc(600 * var(--u));
  text-align: center; font-size: calc(21 * var(--u)); line-height: 1.3;
  will-change: transform, opacity;
}

/* Contact card: turns slightly on hover */
.contact-wrap { position: absolute; left: calc(46 * var(--u)); top: calc(var(--oy) + 267 * var(--u)); perspective: 900px; }
.bcard {
  position: relative; width: calc(420 * var(--u)); height: calc(297 * var(--u));
  background: #fff; color: #000; border-radius: calc(22 * var(--u));
  padding: calc(21 * var(--u));
  display: flex; flex-direction: column; justify-content: flex-end;
  transition: transform .45s cubic-bezier(.2,.7,.2,1), box-shadow .45s ease;
  transform-style: preserve-3d;
  box-shadow: 0 0 0 rgba(0,0,0,0);
}
.bcard:hover { box-shadow: 0 calc(30 * var(--u)) calc(60 * var(--u)) rgba(0,0,0,.35); }
.bcard__logo { position: absolute; right: calc(17 * var(--u)); top: calc(20 * var(--u)); width: calc(46 * var(--u)); height: calc(46 * var(--u)); color: #000; }
.bcard__name { font-family: var(--wide); font-stretch: 112%; font-weight: 600; font-size: calc(24 * var(--u)); line-height: 1.1; }
.bcard__role { font-size: calc(13 * var(--u)); margin-top: calc(2 * var(--u)); }
.bcard__lines { font-size: calc(13 * var(--u)); line-height: 1.25; margin-top: calc(16 * var(--u)); }
.bcard__lines a { text-decoration: none; border-bottom: 1px solid rgba(0,0,0,.3); }
.bcard__lines a:hover { border-bottom-color: #000; }
.bcard__actions { display: flex; flex-wrap: wrap; gap: calc(8 * var(--u)); margin-top: calc(12 * var(--u)); }
.bcard__btn {
  display: inline-block; text-decoration: none; white-space: nowrap;
  font-size: calc(12 * var(--u)); line-height: 1; padding: calc(8 * var(--u)) calc(13 * var(--u));
  border-radius: 999px; background: #000; color: #fff; border: 1px solid #000;
  transition: background .2s ease, color .2s ease;
}
.bcard__btn:hover { background: var(--bg); border-color: var(--bg); }
.bcard__btn--ghost { background: transparent; color: #000; }
.bcard__btn--ghost:hover { background: #000; color: #fff; border-color: #000; }
.bcard__btn:focus-visible, .bcard__lines a:focus-visible { outline: 2px solid var(--bg); outline-offset: 2px; }

/* Footer (Alex's design: card green, email bottom-left in large white Helvetica) */
.site-footer {
  position: relative; z-index: 1;
  min-height: max(220px, calc(400 * var(--w)));
  background: var(--card);
  display: flex; align-items: flex-end;
  padding: 0 calc(26 * var(--w)) max(20px, calc(30 * var(--w)));
}
.site-footer__email {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-weight: 400;
  font-size: max(26px, calc(46 * var(--w))); line-height: 1.1; letter-spacing: -0.005em;
  color: #fff; text-decoration: none;
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0% 2px; background-repeat: no-repeat; background-position: 0 100%;
  transition: color .25s ease, background-size .35s ease;
  overflow-wrap: anywhere;
}
.site-footer__email:hover { color: var(--bg); background-size: 100% 2px; }
.site-footer__email:focus-visible { outline: 2px solid #fff; outline-offset: 6px; }

/* ---------- Phones and narrow screens ---------- */
@media (max-width: 760px) {
  :root { --u: calc(100vw / 640); --halo: 195px; }
  .hero__sub { top: calc(100vh - 262 * var(--w) - 12px); }
  .building { height: 56vh; top: auto; bottom: 0; right: -4vw; }
  .slide__head { left: 24px; width: calc(100vw - 48px); top: 18vh; height: auto; font-size: 38px; }
  .slide__body { left: 24px; width: calc(100vw - 48px); font-size: 18px; height: auto; top: 30vh; }
  .slide__body--plan { top: 30vh; }
  .slide__head, .slide__body { text-shadow: 0 1px 12px rgba(25,52,32,.9); }
  .card { width: calc(100vw - 32px); left: 16px !important; right: auto !important; height: auto; padding: 28px 16px 28px; border-radius: 16px; top: 16vh; }
  .card h2 { font-size: 30px; min-height: 0; }
  .card ul { font-size: 16px; padding-left: 22px; margin-top: 16px; }
  .problems { font-size: 22px; top: 44vh; }
  .about-copy { width: calc(100vw - 48px); font-size: 16px; }
  .art { left: 0; width: 100vw; top: 0; height: 100vh; }
  .ap--glow { left: 20px; top: auto; bottom: 7vh; width: 84px; height: 84px; }
  .ap--side { left: auto; right: 24px; top: auto; bottom: 7vh; width: 34px; height: 100px; }
  .ap--roof { left: auto; right: 20px; top: 18px; width: 96px; height: 66px; }
  .contact-wrap { left: 16px; top: 30vh; }
  .bcard { width: calc(100vw - 32px); max-width: 420px; height: auto; aspect-ratio: 420 / 297; padding: 18px; border-radius: 18px; }
  .bcard__logo { width: 40px; height: 40px; right: 16px; top: 16px; }
  .bcard__name { font-size: 22px; } .bcard__role, .bcard__lines { font-size: 13px; }
  .bcard__btn { font-size: 13px; padding: 9px 14px; } .bcard__actions { gap: 8px; margin-top: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .nav__logo svg { transition: none; }
}
