@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/fonts/bricolage.woff2") format("woff2");
  font-weight: 200 800;
  font-stretch: 75% 100%;
  font-display: swap;
}

@font-face {
  font-family: "Geist Mono";
  src: url("/fonts/geist-mono.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: #060709;
  --fg: #edeae4;
  --soft: #c4c2bd;
  --muted: #868890;
  --line: rgba(237, 234, 228, .14);
  --accent: #ff5c2e;
  --ok: #79dfa0;

  --pad: clamp(20px, 4.2vw, 60px);
  --sans: "Bricolage Grotesque", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --ease: cubic-bezier(.19, .78, .14, 1);
}

*, *::before, *::after { box-sizing: border-box; }

[hidden] { display: none !important; }

html {
  background: var(--bg);
  color: var(--fg);
  color-scheme: dark;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }

::selection { background: var(--accent); color: var(--bg); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 4px;
}

/* ---------- fixed layers ---------- */

.stage {
  position: fixed;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100vh;
  height: 100lvh;
  opacity: 0;
  transition: opacity 1.4s ease;
  pointer-events: none;
}

.gl .stage { opacity: 1; }

.grain {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: .07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .6 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

main, .foot { position: relative; z-index: 1; }

.skip {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 20;
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--fg);
  color: var(--bg);
  font: 500 12px/1 var(--mono);
  transform: translateY(-200%);
}

.skip:focus { transform: none; }

/* ---------- nav ---------- */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px var(--pad);
  pointer-events: none;
}

.nav > * { pointer-events: auto; }

.nav__mark {
  padding: 8px 14px;
  margin-left: -14px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-weight: 650;
  font-size: 1.05rem;
  line-height: 1.2;
  letter-spacing: -.02em;
  transition: background-color .5s ease, border-color .5s ease, box-shadow .5s ease;
}

.nav__mark span { color: var(--muted); }

.nav__links {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px;
  margin-right: -4px;
  border: 1px solid transparent;
  border-radius: 999px;
  transition: background-color .5s ease, border-color .5s ease, box-shadow .5s ease;
}

/* once content scrolls underneath, both ends of the nav sit on glass */
.is-scrolled .nav__mark,
.is-scrolled .nav__links {
  background-color: rgba(22, 23, 27, .5);
  border-color: rgba(255, 255, 255, .09);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 8px 30px rgba(0, 0, 0, .35);
  -webkit-backdrop-filter: blur(18px) saturate(1.6);
  backdrop-filter: blur(18px) saturate(1.6);
}

.nav__links a,
.nav__lang {
  padding: 9px 14px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--fg);
  font: 500 12px/1 var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color .3s ease, color .3s ease;
}

.nav__links a:hover,
.nav__lang:hover { background-color: rgba(255, 255, 255, .09); }

.nav__lang { color: var(--muted); }
.nav__lang:hover { color: var(--fg); }

/* ---------- hero ---------- */

.hero {
  display: grid;
  grid-template-rows: 1fr auto;
  min-height: 100vh;
  min-height: 100svh;
  padding: 96px var(--pad) calc(var(--pad) * .8);
}

/* The wordmark is drawn by the particle stage; this heading is what screen readers
   and browsers without WebGL get. */
.hero__title {
  align-self: center;
  justify-self: center;
  margin: 0;
  font-size: clamp(4rem, 19vw, 17rem);
  font-weight: 800;
  line-height: .8;
  letter-spacing: -.055em;
  user-select: none;
}

.hero__title span { color: var(--muted); font-weight: 300; }

.js .hero__title { opacity: 0; transition: opacity .8s ease; }
.js.no-gl .hero__title { opacity: 1; }

.hero__foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.hero__tag {
  margin: 0;
  font-size: clamp(1.1rem, 1.7vw, 1.5rem);
  line-height: 1.2;
  letter-spacing: -.015em;
}

.hero__tag span { display: block; }
.hero__tag span + span { color: var(--muted); }

.hero__meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 18px;
  font: 500 12px/1 var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}

.hero__status {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  white-space: nowrap;
}

.hero__scroll {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  color: var(--fg);
}

.hero__scroll-line {
  width: 1px;
  height: 46px;
  margin-top: -2px;
  background: linear-gradient(var(--fg), transparent);
  transform-origin: top;
  animation: drip 2.6s var(--ease) infinite;
}

@keyframes drip {
  0% { transform: scaleY(0); opacity: 1; }
  55% { transform: scaleY(1); opacity: 1; }
  100% { transform: scaleY(1) translateY(60%); opacity: 0; }
}

/* ---------- status dot ---------- */

.dot {
  position: relative;
  flex: none;
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted);
}

[data-state="up"] .dot { background: var(--ok); }
[data-state="down"] .dot { background: var(--accent); }

[data-state="up"] .dot::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid var(--ok);
  opacity: 0;
  animation: ping 3.2s ease-out infinite;
}

@keyframes ping {
  0% { transform: scale(.4); opacity: .7; }
  70%, 100% { transform: scale(1.5); opacity: 0; }
}

/* ---------- manifest ---------- */

.manifest { height: 210vh; }

.manifest__sticky {
  position: sticky;
  top: 0;
  display: grid;
  align-items: center;
  height: 100vh;
  height: 100svh;
  /* sits above centre: the lower part of the screen belongs to the ridgelines */
  padding: 0 var(--pad) 22vh;
}

.manifest__text {
  max-width: 21em;
  margin: 0;
  font-size: clamp(1.9rem, 4.7vw, 4.7rem);
  font-weight: 500;
  line-height: 1.06;
  letter-spacing: -.038em;
  text-wrap: balance;
}

.manifest__text span { transition: opacity .25s linear; }

/* ---------- shared section pieces ---------- */

.col { width: 100%; }

.head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: clamp(26px, 5vh, 52px);
  font: 500 12px/1 var(--mono);
  letter-spacing: .14em;
  text-transform: uppercase;
}

.head__idx { color: var(--accent); }
.head__title { margin: 0; font: inherit; }

.js .reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 1s var(--ease), transform 1.2s var(--ease);
  transition-delay: calc(var(--i, 0) * 70ms);
}

.js .reveal.in { opacity: 1; transform: none; }

.row:nth-child(2) { --i: 1; }
.row:nth-child(3) { --i: 2; }
.row:nth-child(4) { --i: 3; }
.row:nth-child(5) { --i: 4; }
.row:nth-child(6) { --i: 5; }
.row:nth-child(7) { --i: 6; }
.row:nth-child(8) { --i: 7; }

/* ---------- services ---------- */

.services {
  padding: 16vh var(--pad) 24vh;
  scroll-margin-top: -6vh;
}

.list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-bottom: 1px solid var(--line);
}

.row > a {
  position: relative;
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px 0;
  padding: clamp(16px, 2.3vh, 26px) 0 clamp(15px, 2.1vh, 24px);
  border-top: 1px solid var(--line);
}

.row > a::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  width: 100%;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .8s var(--ease);
}

.row__idx {
  align-self: start;
  padding-top: .9em;
  font: 500 12px/1 var(--mono);
  letter-spacing: .08em;
  color: var(--muted);
  transition: color .4s ease;
}

.row__name {
  font-size: clamp(2.2rem, 5.2vw, 4.5rem);
  font-weight: 600;
  line-height: .96;
  letter-spacing: -.04em;
  transition: transform .7s var(--ease), opacity .5s ease;
}

.row__arrow {
  width: clamp(22px, 2.6vw, 34px);
  height: clamp(22px, 2.6vw, 34px);
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.5;
  opacity: 0;
  transform: translate(-10px, 10px);
  transition: opacity .4s ease, transform .7s var(--ease);
}

.row__meta {
  grid-column: 2 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 20px;
  font: 400 12.5px/1.3 var(--mono);
  color: var(--muted);
  transition: transform .7s var(--ease);
}

.row__desc { color: var(--soft); }

.row__state {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.row[data-state="unknown"] .row__state,
.row:not([data-state]) .row__state { display: none; }

.row[data-state="down"] .row__state { color: var(--accent); }

.row.is-active > a::before { transform: scaleX(1); }
.row.is-active .row__idx { color: var(--accent); }
.row.is-active .row__name,
.row.is-active .row__meta { transform: translateX(.6rem); }
.row.is-active .row__arrow { opacity: 1; transform: none; }

.list.has-active .row:not(.is-active) .row__name { opacity: .5; }

/* ---------- contact ---------- */

/* With the stage running, the section is pinned for a stretch of scrolling while the
   particles go from "@" to the envelope to the Matrix logo. */
.gl .contact { height: 240vh; }

.contact__sticky {
  display: flex;
  align-items: center;
  min-height: 100vh;
  min-height: 100svh;
  padding: 16vh var(--pad);
}

.gl .contact__sticky {
  position: sticky;
  top: 0;
}

.contact__item {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 12px 24px;
  padding: clamp(20px, 3.2vh, 34px) 0;
  border-top: 1px solid var(--line);
}

.contact__item:last-child { border-bottom: 1px solid var(--line); }
.contact__item:nth-of-type(2) { --i: 1; }

.contact__item::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  width: 100%;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .8s var(--ease);
}

.contact__item.is-active::before { transform: scaleX(1); }

.contact__label {
  grid-column: 1 / -1;
  font: 500 12px/1 var(--mono);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color .4s ease;
}

.contact__item.is-active .contact__label { color: var(--accent); }

.contact__value {
  justify-self: start;
  padding-bottom: .12em;
  font-size: clamp(1.4rem, 3.3vw, 3rem);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -.035em;
  overflow-wrap: anywhere;
  background: linear-gradient(var(--accent), var(--accent)) 0 100% / 0 1px no-repeat;
  transition: background-size .8s var(--ease);
}

.contact__value:hover,
.contact__value:focus-visible { background-size: 100% 1px; }

.copy {
  padding: 10px 15px;
  border: 1px solid rgba(255, 255, 255, .13);
  border-radius: 999px;
  background-color: rgba(255, 255, 255, .04);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07);
  -webkit-backdrop-filter: blur(14px) saturate(1.5);
  backdrop-filter: blur(14px) saturate(1.5);
  color: var(--fg);
  font: 500 11.5px/1 var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color .3s ease, border-color .3s ease, color .3s ease;
}

.copy:hover { background-color: rgba(255, 255, 255, .1); }
.copy.is-done { border-color: var(--ok); color: var(--ok); }

/* ---------- footer ---------- */

.foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 32px;
  padding: 26px var(--pad) calc(26px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  font: 400 12px/1.4 var(--mono);
  color: var(--muted);
}

.foot a { color: var(--fg); }
.foot a:hover { color: var(--accent); }

/* ---------- wide screens: text left, particle stage right ---------- */

@media (min-width: 900px) {
  .col { width: min(52vw, 760px); }

  /* nothing is drawn on the right without the stage, so the text may use the room */
  .no-gl .col,
  html:not(.js) .col { width: min(100%, 1100px); }
}

@media (max-width: 899px) {
  /* the "@" is drawn in the lower part of the screen, so the lines move up */
  .contact__sticky { align-items: flex-start; padding-top: 14vh; }
  .contact__item { grid-template-columns: minmax(0, 1fr); }
  .copy { justify-self: start; }
}

@media (max-width: 520px) {
  .nav__mark { padding: 8px 12px; margin-left: -10px; }
  .nav__links a,
  .nav__lang { padding: 9px 10px; font-size: 11px; letter-spacing: .05em; }

  .hero__foot { flex-direction: column; align-items: stretch; }
  .hero__meta { flex-direction: row; align-items: center; justify-content: space-between; }
  .hero__scroll { align-items: center; }
  .hero__scroll-line { height: 26px; margin-top: 0; }

  .row > a { grid-template-columns: 2.4rem minmax(0, 1fr) auto; }
  .row__desc { flex-basis: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .hero__scroll-line,
  [data-state="up"] .dot::after { animation: none; }
  .stage { transition: none; }
}
