/* LCZ gateway */

:root {
  --ink: #050506;
  --bone: #ece8dd;
  --warm: #ffb874;
  --warm-hi: #fff1dc;
  --sys: #7fe0a4;
  --sys-hi: #f0fff5;
  --pad: clamp(18px, 2.4vw, 40px);
  --serif: "Bodoni Moda", "Didot", "Bodoni MT", "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "Martian Mono", ui-monospace, "SFMono-Regular", "Cascadia Mono", Consolas, monospace;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --ui: clamp(10px, .68vw, 13px);
  --px: 0;
  --py: 0;
  --logo-w: min(42vw, 72vh);
  --logo-h: calc(var(--logo-w) / 2.87);
}

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

html, body {
  height: 100%;
  margin: 0;
  background: var(--ink);
  color: var(--bone);
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  position: fixed;
  inset: 0;
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  -webkit-text-size-adjust: 100%;
  background:
    radial-gradient(60vmax 40vmax at 50% 50%, rgba(236, 232, 221, .06), transparent 70%),
    var(--ink);
}

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

#field {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  display: block;
  opacity: 0;
}
.gl #field { opacity: 1; }

.stage {
  position: fixed; inset: 0;
  transition: opacity .5s ease;
}

/* ------------------------------------------------------------------- HUD */

.hud {
  position: absolute;
  left: max(var(--pad), env(safe-area-inset-left));
  right: max(var(--pad), env(safe-area-inset-right));
  display: grid;
  align-items: center;
  gap: 1.5em;
  font-size: var(--ui);
  font-variation-settings: "wdth" 100, "wght" 400;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: rgba(236, 232, 221, .56);
  white-space: nowrap;
  pointer-events: none;
}
.hud--top { top: max(var(--pad), env(safe-area-inset-top)); grid-template-columns: 1fr auto; }
.hud--bottom { bottom: max(var(--pad), env(safe-area-inset-bottom)); grid-template-columns: 1fr; }
.hud__end { justify-self: end; }
.hud__legal { display: flex; align-items: baseline; gap: 1em; }
.hud__sep { opacity: .5; }
.hud__mark {
  color: var(--bone);
  font-variation-settings: "wdth" 112.5, "wght" 700;
  letter-spacing: .3em;
}

/* ----------------------------------------------------------------- gates */

.gate {
  position: absolute;
  display: flex;
  flex-direction: column;
  color: var(--bone);
  text-decoration: none;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  transition: opacity .7s var(--ease), filter .7s var(--ease);
  will-change: opacity;
}

.gate__word {
  display: block;
  white-space: nowrap;
  transition:
    color .7s var(--ease), text-shadow .7s var(--ease), letter-spacing .9s var(--ease),
    font-variation-settings .9s var(--ease);
}

.gate__body { display: flex; flex-direction: column; gap: 1.1em; }
.gate__line { display: block; }
.gate__meta {
  display: block;
  max-width: 44ch;
  text-wrap: balance;
  font-size: var(--ui);
  line-height: 1.7;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(236, 232, 221, .58);
}

.gate__meta > span { display: block; white-space: nowrap; }

.gate__go {
  display: inline-flex;
  align-items: center;
  gap: .9em;
  align-self: flex-start;
  padding: 1.05em 1.35em 1em;
  border: 1px solid rgba(236, 232, 221, .34);
  border-radius: 999px;
  font-size: calc(var(--ui) * 1.1);
  letter-spacing: .12em;
  text-transform: uppercase;
  transition: background-color .45s var(--ease), color .45s var(--ease), border-color .45s var(--ease);
}
.gate__go i { font-style: normal; display: inline-block; transition: transform .45s var(--ease); }
.gate:hover .gate__go i, .gate:focus-visible .gate__go i { transform: translate(3px, -3px); }
.gate:focus-visible .gate__go { outline: 2px solid currentColor; outline-offset: 5px; }

/* Services — light */
.gate--services {
  left: max(var(--pad), env(safe-area-inset-left));
  top: calc(max(var(--pad), env(safe-area-inset-top)) + clamp(26px, 5vh, 56px));
  align-items: flex-start;
  transform: translate3d(calc(var(--px) * -14px), calc(var(--py) * -10px), 0);
}
.gate--services .gate__word {
  /* Inter, the typeface lczservices.com itself is set in */
  font-family: var(--sans);
  font-optical-sizing: none;
  font-variation-settings: "opsz" 32, "wght" 470;
  font-size: min(12.6vw, 23vh);
  line-height: .92;
  letter-spacing: -.045em;
  margin: .02em 0 .24em -.035em;
  padding-right: .06em;
}
/* the motto stays in the italic serif */
.gate--services .gate__line {
  font-family: var(--serif);
  font-style: italic;
  font-optical-sizing: none;
  font-variation-settings: "opsz" 18, "wght" 520;
  font-size: clamp(19px, 1.85vw, 30px);
  line-height: 1.1;
}
.gate--services .gate__body { padding-left: .2em; }

[data-state="services"] .gate--services .gate__word {
  color: var(--warm-hi);
  font-variation-settings: "opsz" 32, "wght" 560;
  text-shadow: 0 0 .28em rgba(255, 150, 60, .5), 0 0 1.1em rgba(255, 120, 30, .28);
}
[data-state="services"] .gate--services .gate__go,
.gate--services:hover .gate__go,
.gate--services:focus-visible .gate__go {
  background: var(--warm-hi); color: #1a0d02; border-color: var(--warm-hi);
}
/* when the other side is live, this one falls out of focus */
[data-state="systems"] .gate--services { opacity: .34; filter: blur(2.5px); }

/* Systems — order */
.gate--systems {
  right: max(var(--pad), env(safe-area-inset-right));
  bottom: calc(max(var(--pad), env(safe-area-inset-bottom)) + clamp(30px, 5.5vh, 60px));
  flex-direction: column-reverse;
  align-items: flex-end;
  text-align: right;
  transform: translate3d(calc(var(--px) * 14px), calc(var(--py) * 10px), 0);
}
.gate--systems .gate__body { align-items: flex-end; flex-direction: column-reverse; }
.gate--systems .gate__go { align-self: flex-end; }
.gate--systems .gate__word {
  font-family: var(--mono);
  text-transform: uppercase;
  font-size: min(8.4vw, 15.5vh);
  line-height: .92;
  letter-spacing: -.055em;
  font-variation-settings: "wdth" 88, "wght" 300;
  margin: .2em -.02em 0 0;
}
.gate--systems .gate__line {
  font-size: clamp(12px, 1.02vw, 16px);
  font-variation-settings: "wdth" 100, "wght" 350;
  letter-spacing: -.01em;
}

[data-state="systems"] .gate--systems .gate__word {
  color: var(--sys-hi);
  font-variation-settings: "wdth" 108, "wght" 560;
  text-shadow: 0 0 .35em rgba(90, 220, 140, .45), 0 0 1.2em rgba(60, 190, 110, .3);
}
[data-state="systems"] .gate--systems .gate__go,
.gate--systems:hover .gate__go,
.gate--systems:focus-visible .gate__go {
  background: var(--sys-hi); color: #04170b; border-color: var(--sys-hi);
}
[data-state="services"] .gate--systems { opacity: .3; }
[data-state="services"] .gate--systems .gate__word { font-variation-settings: "wdth" 78, "wght" 140; }

/* ------------------------------------------------------------------ core */

.core {
  position: absolute;
  left: 50%; top: 50%;
  width: var(--logo-w);
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.core__fallback {
  display: block;
  width: 100%;
  height: auto;
  color: var(--bone);
  fill: currentColor;
}
.gl .core__fallback { visibility: hidden; }

/* ---------------------------------------------------------------- cursor */

.cursor { display: none; }
.has-cursor.has-pointer, .has-cursor.has-pointer * { cursor: none; }
.has-cursor.has-pointer .cursor {
  display: block;
  position: fixed; left: 0; top: 0;
  z-index: 5;
  pointer-events: none;
  mix-blend-mode: difference;
  will-change: transform;
}
.cursor i {
  position: absolute;
  left: -15px; top: -15px;
  width: 30px; height: 30px;
  border: 1px solid #fff;
  border-radius: 50%;
  transition: transform .5s var(--ease), background-color .4s ease;
}
.cursor i::after {
  content: "";
  position: absolute; left: 50%; top: 50%;
  width: 3px; height: 3px; margin: -1.5px;
  background: #fff; border-radius: 50%;
}
[data-state="services"] .cursor i { transform: scale(1.25); }
[data-state="systems"] .cursor i { transform: scale(.85); }
.on-gate .cursor i { transform: scale(2.3); background: rgba(255, 255, 255, .14); }

/* ------------------------------------------------------- arrival / leave */

@keyframes rise { from { opacity: 0; transform: translate3d(0, 16px, 0); } to { opacity: 1; transform: none; } }
@keyframes pull-focus { from { opacity: 0; filter: blur(18px); transform: translate3d(0, .06em, 0) scale(1.03); } to { opacity: 1; filter: blur(0); transform: none; } }
@keyframes lock-in { from { opacity: 0; letter-spacing: .12em; } to { opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.hud { animation: fade 1.2s ease .15s backwards; }
.gate--services .gate__word { animation: pull-focus 1.1s var(--ease) .12s backwards; }
.gate--systems .gate__word { animation: lock-in .9s var(--ease) .2s backwards; }
.gate__body > * { animation: rise .8s var(--ease) backwards; }
.gate__line { animation-delay: .28s !important; }
.gate__meta { animation-delay: .36s !important; }
.gate__go { animation-delay: .44s !important; }

.veil {
  position: fixed; inset: 0; z-index: 9;
  background: #000;
  opacity: 0;
  pointer-events: none;
  transition: opacity .32s ease .44s;
}
.is-leaving .veil { opacity: 1; }
.is-leaving .stage { opacity: 0; transition-duration: .4s; }
.is-leaving .cursor { opacity: 0; }

/* --------------------------------------------------------------- portrait */

@media (max-aspect-ratio: 4/5) {
  :root { --pad: clamp(16px, 5vw, 28px); --logo-w: min(74vw, 60vh); --ui: clamp(9px, 1.5vw, 13px); }

  .hud--bottom .hud__end { justify-self: center; }
  /* too long for one line on a phone: stack it */
  .hud__legal { flex-direction: column; align-items: center; gap: .45em; }
  .hud__sep { display: none; }

  .gate { left: max(var(--pad), env(safe-area-inset-left)); right: max(var(--pad), env(safe-area-inset-right)); }
  .gate--services { top: calc(max(var(--pad), env(safe-area-inset-top)) + clamp(26px, 4.5vh, 48px)); transform: none; }
  .gate--systems { bottom: calc(max(var(--pad), env(safe-area-inset-bottom)) + clamp(42px, 6vh, 60px)); transform: none; }

  .gate--services .gate__word { font-size: min(22vw, 13.5vh); }
  .gate--services .gate__line { font-size: clamp(18px, 5.4vw, 34px); }
  .gate--systems .gate__word { font-size: min(13.6vw, 8.6vh); }
  .gate--systems .gate__line { font-size: clamp(11px, 3.1vw, 18px); }

  .gate__body { gap: .95em; }
  .gate__meta { max-width: 34ch; letter-spacing: .12em; }
  .gate__go { padding: 1.15em 1.5em 1.1em; }
}

/* small portrait screens: drop the descriptor lines before anything collides */
@media (max-aspect-ratio: 4/5) and (max-height: 700px) {
  .gate__meta { display: none; }
}

/* short landscape (phones on their side, squat windows) */
@media (min-aspect-ratio: 4/5) and (max-height: 620px) {
  .gate__meta { display: none; }
  .gate--services .gate__word { font-size: min(11.8vw, 20vh); }
  .gate__body { gap: .8em; }
}
@media (min-aspect-ratio: 4/5) and (max-height: 430px) {
  .gate__line { display: none; }
  .gate__go { padding: .8em 1.1em .75em; }
}

/* --------------------------------------------------------- reduced motion */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-delay: 0s !important;
    transition-duration: .01ms !important;
    transition-delay: 0s !important;
  }
  .gate--services, .gate--systems { transform: none; }
  [data-state="systems"] .gate--services { filter: none; }
}

@media (forced-colors: active) {
  .gate__go { border: 1px solid ButtonText; }
}
