/* The Geoa Protocol. Black, paper and one amber accent that means "you / act".
   The four layer colours appear only on the eye and on its chips. */

@font-face {
  font-family: "Cormorant Garamond";
  src: url("fonts/cormorant-garamond-latin-wght-normal.woff2") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "DM Sans";
  src: url("fonts/dm-sans-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 1000;
  font-style: normal;
  font-display: swap;
}

:root {
  --black: #000;
  --paper: #F3EFE7;
  --muted: #A8A49B;
  --line: rgba(243, 239, 231, 0.16);
  --line-strong: rgba(243, 239, 231, 0.4);
  --amber: #FFA31A;
  --l0: #4C6FFF;
  --l1: #2F9BFF;
  --l2: #22D3EE;
  --l3: #2EE6B0;
  --serif: "Cormorant Garamond", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: "DM Sans", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --gx: max(24px, env(safe-area-inset-left), env(safe-area-inset-right));
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html {
  background: var(--black);
  color: var(--paper);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  margin: 0;
  font: 400 16px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
h1, h2, p { margin: 0; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--paper); outline-offset: 3px; border-radius: 4px; }

/* The 3D stage: one canvas behind everything. */
.stage { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.stage canvas { display: block; width: 100%; height: 100%; opacity: 0; transition: opacity 1200ms var(--ease); }
.gl-ready .stage canvas { opacity: 1; }

/* Phone first: one column, the eye takes whatever height is left. */
.page {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto minmax(200px, 1fr) auto auto auto;
  grid-template-areas: "top" "copy" "eye" "layers" "act" "foot";
  row-gap: 16px;
  padding: env(safe-area-inset-top) var(--gx) 0;
}
.main { display: contents; }

.top { grid-area: top; display: flex; align-items: center; justify-content: space-between; min-height: 64px; }
.mark {
  padding: 16px 0;
  font: 600 13px/1 var(--sans);
  letter-spacing: 0.32em;
  text-transform: uppercase;
  text-decoration: none;
}
.tg {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font: 500 13px/1 var(--sans);
  letter-spacing: 0.02em;
  text-decoration: none;
  transition: border-color 200ms var(--ease), background-color 200ms var(--ease);
}
.tg:hover { border-color: var(--line-strong); background-color: rgba(243, 239, 231, 0.06); }

.copy { grid-area: copy; }
.eyebrow {
  font: 500 12px/1.2 var(--sans);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted);
}
h1 {
  margin-top: 12px;
  font: 500 clamp(32px, 20px + 3.4vw, 72px)/1.04 var(--serif);
  /* Cormorant's default old-style 1 reads as a small I ("ı %"). After the shorthand, which resets it. */
  font-variant-numeric: lining-nums;
  letter-spacing: -0.012em;
  text-wrap: balance;
}
.sub {
  margin-top: 12px;
  max-width: 34em;
  font: 400 15px/1.5 var(--sans);
  color: var(--muted);
  text-wrap: pretty;
}

.eyebox { grid-area: eye; position: relative; min-height: 200px; touch-action: pan-y; }
.still { display: none; position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.no-gl .still { display: block; }

.layers { grid-area: layers; }
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.chip {
  --c: var(--paper);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  font: 500 13px/1 var(--sans);
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: border-color 200ms var(--ease), background-color 200ms var(--ease), transform 200ms var(--ease);
}
.chip::before {
  content: "";
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--c);
  box-shadow: 0 0 8px var(--c);
}
.c0 { --c: var(--l0); }
.c1 { --c: var(--l1); }
.c2 { --c: var(--l2); }
.c3 { --c: var(--l3); }
.c4 { --c: var(--amber); }
.chip:hover { border-color: var(--c); transform: translateY(-1px); }
.chip[aria-pressed="true"] {
  border-color: var(--c);
  background-color: rgba(243, 239, 231, 0.06);
  background-color: color-mix(in srgb, var(--c) 16%, transparent);
}
.caption {
  margin-top: 12px;
  min-height: 3em;
  font: 400 14px/1.5 var(--sans);
  color: var(--muted);
  text-align: center;
  text-wrap: balance;
}
.no-gl .chips { display: none; }

.act { grid-area: act; display: grid; }
.act > * { grid-area: 1 / 1; }
.enter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  min-height: 52px;
  padding: 0 28px;
  border: 0;
  border-radius: 999px;
  background: var(--amber);
  color: #000;
  font: 600 15px/1 var(--sans);
  letter-spacing: 0.02em;
  text-decoration: none;
  cursor: pointer;
  transition: transform 240ms var(--ease), box-shadow 240ms var(--ease), opacity 600ms var(--ease), visibility 0s linear 0s;
}
.enter:hover { transform: translateY(-1px) scale(1.02); box-shadow: 0 10px 36px -10px rgba(255, 163, 26, 0.6); }
.enter:active { transform: scale(0.98); }
.enter:focus-visible { outline-color: var(--amber); }
.enter .arr { display: inline-block; transition: transform 240ms var(--ease); }
.enter:hover .arr { transform: translateX(3px); }
.enter.wait { opacity: 0; visibility: hidden; }

.foot {
  grid-area: foot;
  position: relative;
  z-index: 3;
  display: flex;
  justify-content: center;
  gap: 24px;
  padding: 0 0 calc(8px + env(safe-area-inset-bottom));
  font: 400 12px/1 var(--sans);
  color: var(--muted);
}
.foot a { display: inline-flex; align-items: center; min-height: 48px; text-decoration: none; transition: color 200ms var(--ease); }
.foot a:hover, .foot a[aria-current="page"] { color: var(--paper); }

/* The panel inside the network. */
.join {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  display: grid;
  justify-items: center;
  gap: 16px;
  padding: 96px var(--gx) calc(64px + env(safe-area-inset-bottom));
  text-align: center;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.66) 55%, rgba(0, 0, 0, 0) 100%);
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px);
  transition: opacity 500ms var(--ease), transform 500ms var(--ease), visibility 0s linear 500ms;
}
.is-inside .join {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity 800ms var(--ease) 100ms, transform 800ms var(--ease) 100ms, visibility 0s linear 0s;
}
.join h2 {
  font: 500 clamp(30px, 18px + 3vw, 56px)/1.06 var(--serif);
  font-variant-numeric: lining-nums;
  letter-spacing: -0.01em;
  text-wrap: balance;
  outline: none;
}
.join p { max-width: 30em; font: 400 15px/1.5 var(--sans); color: var(--muted); text-wrap: pretty; }
.join-act { display: grid; gap: 8px; width: min(100%, 360px); margin-top: 8px; }
.back {
  min-height: 48px;
  border: 0;
  background: none;
  font: 500 14px/1 var(--sans);
  color: var(--muted);
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 4px;
  transition: color 200ms var(--ease);
}
.back:hover { color: var(--paper); }

/* Leaving for the network: the copy steps aside, the eye takes the screen. */
.copy, .layers, .act { transition: opacity 600ms var(--ease), transform 600ms var(--ease), visibility 0s linear 0s; }
.is-leaving .copy, .is-leaving .layers, .is-leaving .act {
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity 350ms ease, transform 350ms ease, visibility 0s linear 350ms;
}

/* Entrance: the words rise while the fibres grow. */
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.eyebrow, h1, .sub, .chips, .caption { animation: rise 900ms var(--ease) backwards; }
h1 { animation-delay: 80ms; }
.sub { animation-delay: 160ms; }
.chips { animation-delay: 400ms; }
.caption { animation-delay: 480ms; }

@media (pointer: coarse) {
  .chip { min-height: 44px; }
}

/* Short portrait phones: the eye keeps its room, the chips go. */
@media (orientation: portrait) and (max-height: 720px) {
  .chips { display: none; }
  .caption { margin-top: 0; min-height: 0; }
  h1 { font-size: 30px; }
}

/* Landscape phones: two columns, no chips. */
@media (orientation: landscape) and (max-height: 540px) {
  .page {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: auto 1fr auto auto 1fr auto;
    grid-template-areas: "top top" ". eye" "copy eye" "act eye" ". eye" "foot foot";
    column-gap: 24px;
    row-gap: 0;
  }
  .top { min-height: 52px; }
  .layers { display: none; }
  h1 { font-size: clamp(26px, 14px + 2.6vw, 40px); }
  .sub { font-size: 14px; }
  .act { margin-top: 16px; justify-items: start; }
  .act .enter { width: auto; }
  .join { padding: 24px var(--gx) calc(48px + env(safe-area-inset-bottom)); gap: 8px; }
  .join h2 { font-size: 30px; }
}

/* Desktop: the words on the left, the eye on the right. */
@media (min-width: 960px) and (min-height: 560px) {
  :root { --gx: max(48px, env(safe-area-inset-left), env(safe-area-inset-right)); }
  .page {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    grid-template-rows: auto 1fr auto auto auto 1fr auto;
    grid-template-areas: "top top" ". eye" "copy eye" "layers eye" "act eye" ". eye" "foot foot";
    column-gap: 64px;
    row-gap: 0;
  }
  .top { min-height: 80px; }
  .sub { margin-top: 24px; font-size: 17px; }
  .layers { margin-top: 40px; }
  .chips { justify-content: flex-start; }
  .caption { min-height: 1.5em; text-align: left; }
  .act { margin-top: 32px; justify-items: start; }
  .act .enter { width: auto; }
  .eyebox { min-height: 420px; }
  .foot { justify-content: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition-duration: 1ms !important;
    transition-delay: 0ms !important;
  }
}

/* Legal pages. */
.legal-page {
  background:
    radial-gradient(1100px 520px at 85% -12%, rgba(76, 111, 255, 0.14), transparent 62%),
    radial-gradient(700px 360px at 0% 110%, rgba(255, 163, 26, 0.06), transparent 60%),
    var(--black);
}
.legal {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  grid-template-areas: "top" "main" "foot";
  max-width: 760px;
  margin: 0 auto;
  padding: env(safe-area-inset-top) var(--gx) 0;
}
.legal-main { grid-area: main; padding: 40px 0 64px; }
.legal-main h1 { margin: 0 0 24px; font-size: clamp(36px, 24px + 3vw, 56px); animation: none; }
.legal-main h2 {
  margin: 40px 0 8px;
  font: 600 13px/1.3 var(--sans);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.legal-main p { max-width: 38em; font-size: 16px; line-height: 1.65; }
.legal-main p + p { margin-top: 12px; }
.legal-main .lede { font-size: 18px; color: var(--paper); }
.legal-main .stand { margin-top: 40px; font-size: 13px; color: var(--muted); }
.legal-main a { text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.todo { color: var(--amber); }
.legal .foot { justify-content: flex-start; }
