/* Global Compute Observatory — Coming soon
   Figma: GCO · MVP Website › "V7 · Coming soon · Map layer" (192:1068), 1920×1080 frame. */

:root {
  --ink: #222;
  --ink-soft: #5a5a5a;
  --ink-mute: #8e8e8e;
  --accent: #4565f5;
  --bg: #fff;
  --font-sans: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --s: 1;            /* scale, set by main.js */
  --art-w: 580.5px;  /* art stage = plates only */
  --art-h: 985.5px;
  --edge-top: 67.5px;    /* desktop: screen top → logo (as in Figma) */
  --edge-bottom: 56px;   /* desktop: footer text → screen bottom (as in Figma) */
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: none; }
h1, p, ol { margin: 0; padding: 0; }
ol { list-style: none; }
a { color: inherit; }

/* ---------- Type ---------- */

.launch {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 18px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--ink);
}
.launch img { width: 10px; height: 10px; animation: pulse 2.4s ease-in-out infinite; }

h1 {
  font-weight: 500;
  font-size: 90px;
  line-height: 1.06;
  letter-spacing: -0.035em;
  color: var(--ink);
}
.subheading {
  max-width: 490px;
  font-weight: 500;
  font-size: 44px;
  line-height: 1.12;
  letter-spacing: -0.025em;
  color: var(--accent);
}
.lead {
  font-size: 24px;
  line-height: 1.5;
  color: var(--ink-soft);
}

.label { display: flex; flex-direction: column; gap: 8px; font-size: 18px; }
.label-title {
  display: flex;
  gap: 12px;
  font-family: var(--font-mono);
  font-weight: 600;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--ink);
}
.label-title span { color: var(--ink-mute); }
.label-text { width: 276px; line-height: 1.4; color: var(--ink-soft); }

.footer {
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: 0.02em;
  color: var(--ink-mute);
}

/* ---------- Logo ---------- */

.logo a { position: relative; display: block; width: 212.5px; height: 95.41px; }
.logo-mark { position: absolute; left: 0; top: 0; width: 90.94px; height: 95.41px; }
.logo-mark img { position: absolute; left: -0.82%; top: -0.79%; width: 101.64%; height: 101.58%; }
.logo-wordmark { position: absolute; left: 106.41px; top: 17.57px; width: 106.094px; height: 54.173px; }

/* ---------- Isometric layer stack ---------- */

.art-wrap { position: relative; }
.art {
  position: absolute;
  left: 0;
  top: 0;
  width: var(--art-w);
  height: var(--art-h);
  transform-origin: 0 0;
}
.art > *,
.layer > *,
.plate > * { position: absolute; }
.layer { position: absolute; inset: 0; }

.plate {
  width: 580.455px;
  height: 357.3px;
  -webkit-mask: url("assets/surface-mask.svg") 0 0 / 100% 100% no-repeat;
          mask: url("assets/surface-mask.svg") 0 0 / 100% 100% no-repeat;
}
.plate .surface { inset: 0; width: 100%; height: 100%; }
.art img { width: 100%; height: 100%; }
.art div > img { position: absolute; }

.guide { width: 1px; height: 612px; }
.guide img { position: absolute; left: 1px; top: 0; width: 612px !important; height: 1px !important;
  transform: rotate(90deg); transform-origin: 0 0; }
.art .vertex { width: 6px; height: 6px; }
.leader { width: 61px; height: 0; }
.leader img { left: 0; top: -0.5px; width: 100%; height: 1px; }

/* ---------- Motion ----------
   1. Reveal: plates settle one by one (01 → 05); each label, leader and vertex fades in with its plate.
      Once everything is in, it stays.
   2. Ambient loops (subtle, out of phase per element; delays set in main.js via --d):
      01 network wave · 02 cubes light up · 03 dashes step forward · 04 investment flows · 05 ground ripples. */
/* Mobile/tablet: the labels are a list below the visual, so the stack builds in one smooth go
   (plates overlap almost fully) instead of making people wait for each layer. Desktop overrides below. */
:root {
  --reveal-start: 0.3s;  /* first plate */
  --reveal-dur: 1.4s;    /* each plate */
  --reveal-gap: 0.12s;   /* between plates */
}
.layer,
.label,
.mark,
.art .vertex,
.leader {
  --delay: calc(var(--reveal-start) + (var(--i) - 1) * var(--reveal-gap));
}
.layer { animation: settle var(--reveal-dur) cubic-bezier(0.2, 0.7, 0.2, 1) var(--delay) both; }
.label, .mark { animation: rise calc(var(--reveal-dur) * 0.8) cubic-bezier(0.2, 0.7, 0.2, 1) calc(var(--delay) + var(--reveal-dur) * 0.2) both; }
.art .vertex, .leader { animation: fade calc(var(--reveal-dur) * 0.6) ease calc(var(--delay) + var(--reveal-dur) * 0.2) both; }
.label:nth-child(1), .mark:nth-child(1) { --i: 5; }
.label:nth-child(2), .mark:nth-child(2) { --i: 4; }
.label:nth-child(3), .mark:nth-child(3) { --i: 3; }
.label:nth-child(4), .mark:nth-child(4) { --i: 2; }
.label:nth-child(5), .mark:nth-child(5) { --i: 1; }
.intro, .logo, .incubation, .footer { animation: fade 1.2s ease both; }

@keyframes settle { from { opacity: 0; transform: translateY(-32px); } to { opacity: 1; transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pulse { 50% { opacity: 0.35; } }

/* Inlined SVGs (main.js swaps <img> for <svg> where the parts need to move) */
.art div > svg { position: absolute; display: block; }

/* 01 · Resources — a pulse of energy sweeps the network west → east every 8s.
   Lines rest dimmed and light up as it passes; hubs swell and fill in at the same moment.
   Tune: --wave-rest (how dim at rest), SWEEP in main.js (crossing time). */
:root { --wave-rest: 0.22; }
.fx-submarine-cables path,
.fx-backbone path { animation: wave-line 8s ease-in-out calc(var(--delay, 0s) + var(--d, 0s)) infinite both; }
@keyframes wave-line {
  0%, 38%, 100% { opacity: var(--wave-rest); }
  12%, 18%      { opacity: 1; }
}
.fx-hubs path {
  transform-box: fill-box;
  transform-origin: center;
  animation: wave-hub 8s ease-in-out calc(var(--delay, 0s) + var(--d, 0s)) infinite;
}
@keyframes wave-hub {
  0%, 34%, 100% { transform: none; fill: #fff; }
  13%, 17%      { transform: scale(1.3); fill: #4565F5; }
}

/* 02 · Compute — processing load: a few cubes at a time light up and rise slightly */
.layer[data-layer="2"] div.el { animation: load-cube 9s ease-in-out calc(var(--delay, 0s) + var(--d, 0s)) infinite; }
@keyframes load-cube {
  0%, 14%, 100% { filter: none; transform: none; }
  5%, 8%        { filter: brightness(1.45) saturate(1.1); transform: translateY(-2px); }
}

/* 03 · Access — gated: dashes advance a short step, then wait, like access granted on request
   (dash pattern rebuilt in main.js, --dash-p = one dash + gap) */
.fx-access-links path { animation: dash-step 5s ease-in-out calc(var(--delay, 0s) + var(--d, 0s)) infinite; }
@keyframes dash-step {
  0%        { stroke-dashoffset: 0; }
  22%, 100% { stroke-dashoffset: calc(var(--dash-p, 6px) * -2); }
}

/* 04 · Policy — flows (12s cycle, timing set in main.js): the flows rest as faint traces and are
   drawn again from investor to partner; investors pulse as money leaves, partners when it arrives */
.fx-partners path,
.fx-investors path { transform-box: fill-box; transform-origin: center; }
.fx-investors .depart,
.fx-partners .arrive { animation: dot-ping 12s ease-out calc(var(--delay, 0s) + var(--d, 0s)) infinite; }
@keyframes dot-ping {
  0%, 9%, 100% { transform: none; }
  3%           { transform: scale(1.5); }
}
.fx-investment-flows .ghost { opacity: 0.25; }
.fx-investment-flows .draw {
  stroke-dasharray: 100 100;
  stroke-dashoffset: 100;
  animation: flow-draw 12s ease-in-out calc(var(--delay, 0s) + var(--d, 0s)) infinite;
}
@keyframes flow-draw {
  0%        { stroke-dashoffset: 100; opacity: 1; }
  15%, 38%  { stroke-dashoffset: 0;   opacity: 1; }
  48%, 100% { stroke-dashoffset: 0;   opacity: 0; }
}

/* 05 · Public benefits — a faint ring spreads on the ground from one icon at a time (rings added in main.js).
   Tune: --ripple-color, --ripple-peak (max opacity). */
:root { --ripple-color: #819DF0; --ripple-peak: 0.45; }
.layer[data-layer="5"] .ripple {
  border: 1px solid var(--ripple-color);
  border-radius: 50%;
  opacity: 0;
  animation: ripple 12s ease-out calc(var(--delay, 0s) + var(--d, 0s)) infinite;
}
@keyframes ripple {
  0%        { opacity: 0; transform: scale(0.7); }
  7%        { opacity: var(--ripple-peak); }
  24%, 100% { opacity: 0; transform: scale(2); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; }
}

/* ---------- Small / portrait screens: stacked layout ----------
   Figma: "V7 · Coming soon · Mobile" (192:1491), 390px wide. */

.page {
  display: flex;
  flex-direction: column;
  gap: 40px;
  max-width: 640px;
  margin: 0 auto;
  padding: 32px 24px;
}
/* Logo is the desktop lockup at 0.847 (77×81 mark) */
.logo a { transform: scale(0.8471); transform-origin: 0 0; margin-bottom: -14.6px; }

.intro, .copy, .heading { display: flex; flex-direction: column; gap: 20px; }
.launch { gap: 10px; font-size: 14px; letter-spacing: 0.06em; }
.launch img { width: 8px; height: 8px; }
h1 { font-size: clamp(46px, 11.8vw, 72px); line-height: 1.04; }
.subheading { max-width: none; font-size: clamp(26px, 6.67vw, 36px); line-height: 1.18; letter-spacing: -0.02em; }
.lead { font-size: clamp(17px, 4.36vw, 20px); }

/* Layer stack: a 342×507 visual (the desktop art at 0.514 + short leaders and numbers),
   scaled by --s to the column width. */
.art-wrap {
  width: min(100%, 480px);
  height: calc(507px * var(--s));
  margin-bottom: -16px; /* 24px to the list */
  overflow: hidden; /* scaled boxes keep their unscaled layout size */
  overflow: clip;
  overflow-clip-margin: 4px;
}
.visual { position: relative; width: 342px; height: 507px; transform: scale(var(--s)); transform-origin: 0 0; }
.art { transform: scale(0.514139); }
.leader { display: none; }

.marks { position: absolute; inset: 0; }
.mark { position: absolute; left: 302.46px; width: 10px; height: 0; }
.mark img { position: absolute; left: 0; top: -1px; width: 10px; height: 1px; }
.mark span {
  position: absolute;
  left: 14px;
  top: -8px;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 12px;
  line-height: normal;
  color: var(--ink);
}

.labels { display: flex; flex-direction: column-reverse; } /* 01 → 05 on mobile */
.label { gap: 6px; padding: 16px 0; border-top: 1px solid #d0d0d0; font-size: 16px; }
.label-title { font-size: 15px; letter-spacing: 0.04em; white-space: normal; }
.label-text { width: auto; line-height: 1.45; }

/* Figma mobile: "V7 · Coming soon · Mobile · Mila (B&W)" (220:429) */
.incubation { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; }
.incubation .mila { width: 101.77px; height: 30px; }
.incubation .divider { display: none; width: 1px; height: 36px; background: var(--ink-mute); }
.incubation p { font-size: 15px; line-height: 1.5; color: var(--ink-mute); }
.incubation strong { font-weight: 500; color: var(--ink-mute); }

.footer { font-size: 12px; }

/* ---------- Desktop: the 1920×1080 composition, scaled to fit ---------- */

@media (min-width: 1024px) and (min-aspect-ratio: 5/4) {
  /* Plates still arrive one by one next to their labels, a bit quicker (was 0.6s / 2s / 1.2s) */
  :root {
    --reveal-start: 0.5s;
    --reveal-dur: 1.6s;
    --reveal-gap: 0.85s;
    --edge-top: 40px;  /* logo sits higher than in Figma (67.5px) to give the text more room */
  }
  html, body { height: 100%; overflow: hidden; }
  .page {
    position: absolute;
    left: 50%;
    top: 50%;
    display: block;
    width: 1920px;
    height: 1080px;
    max-width: none;
    margin: 0;
    padding: 0;
    transform: translate(-50%, -50%) scale(var(--s));
  }
  .page > * { position: absolute; }

  /* Header & footer keep a fixed distance from the viewport edges, whatever the
     letterboxing: convert screen px to page coords (page is centred and scaled by --s). */
  .page { --gap: calc((100vh - 1080px * var(--s)) / 2); }
  .logo { left: 80.5px; top: calc((var(--edge-top) - var(--gap)) / var(--s)); }
  .logo a { transform: none; margin: 0; }

  .intro { left: 80px; top: 211px; width: 633px; gap: 32px; } /* Figma: 261px; moved up to clear the Mila credit */

  /* Mila credit sits 36px above the footer, so it moves with it */
  .incubation {
    left: 83px;
    bottom: calc((var(--edge-bottom) - var(--gap)) / var(--s) + 54px);
    flex-direction: row;
    align-items: center;
    gap: 24px;
    margin: 0;
  }
  .incubation .mila { width: 95px; height: 28px; }
  .incubation .divider { display: block; }
  .incubation p { width: 361px; font-size: 14px; color: var(--ink-soft); }
  .copy { gap: 40px; }
  .heading { gap: 24px; }
  h1 { font-size: 90px; }
  .subheading { font-size: 44px; }
  .lead { font-size: 24px; }
  .launch { gap: 12px; font-size: 18px; letter-spacing: 0.02em; }
  .launch img { width: 10px; height: 10px; }
  h1 { line-height: 1.06; }
  .subheading { max-width: 490px; line-height: 1.12; letter-spacing: -0.025em; }

  .art-wrap { left: 828px; top: 59.5px; width: var(--art-w); height: var(--art-h); margin: 0; overflow: visible; }
  .visual { width: auto; height: auto; transform: none; }
  .art { transform: none; }
  .leader { display: block; }
  .marks { display: none; }

  .labels { left: 1488px; top: 0; display: block; }
  .label { position: absolute; top: var(--top); left: 0; gap: 8px; padding: 0; border: 0; font-size: 18px; }
  .label-title { font-size: 18px; letter-spacing: 0; white-space: nowrap; }
  .label-text { width: 276px; line-height: 1.4; }

  .footer { font-size: 14px; left: 83px; bottom: calc((var(--edge-bottom) - var(--gap)) / var(--s)); line-height: 18px; }
}
