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

:root {
  --bg:     #08090B;
  --text:   #EEEEEE;
  --accent: #D3D8E0;
  --muted:  #858B96;
  --sub:    #626C7C;
  --fs:     clamp(2.5rem, 4vw, 5rem);
  --rail-w: clamp(280px, 30vw, 560px);
}

html, body {
  background: var(--bg);
  color: var(--text);
}

html:has(body.home),
body.home { height: 100%; overflow: hidden; }

body.menu-open { overflow: hidden; }

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

.header,
.mob-overlay,
.rail { font-family: 'Bebas Neue', Impact, 'Arial Narrow', sans-serif; }

.nav-item,
.mob-item {
  color: inherit;
  text-decoration: none;
  outline-offset: 4px;
}

.nav-list,
.mob-nav { list-style: none; }

.header {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  position: fixed;
  inset: 0 0 auto 0;
  padding: 1.25rem;
  z-index: 100;
  background: transparent;
  transition: transform 0.3s ease;
}

.header--hidden { transform: translateY(-110%); }

.header-version {
  font-size: 0.6rem;
  color: var(--muted);
  letter-spacing: 0.12em;
  font-family: 'Bebas Neue', sans-serif;
  line-height: 1;
}

.header-right {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.3rem;
  justify-self: end;
}

.header-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.3rem;
  text-decoration: none;
}

.header-name {
  display: block;
  font-size: clamp(1.6rem, 7vw, 2.4rem);
  color: var(--text);
  letter-spacing: 0.02em;
  line-height: 1;
  font-family: 'Bebas Neue', sans-serif;
}

.header .lang-switch {
  margin-top: 0;
  margin-bottom: 0;
  justify-content: flex-end;
}

.hamburger {
  grid-column: 1;
  grid-row: 1;
  align-self: stretch;
  background: none;
  border: 1px dashed rgba(211,216,224,0.4);
  cursor: pointer;
  aspect-ratio: 1;
  min-height: 44px;
  height: auto;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-shrink: 0;
}

.hamburger span {
  display: block;
  width: 22px;
  height: 1px;
  background: var(--accent);
}

.mob-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8,9,11,0.95);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 110;
  display: flex;
  flex-direction: column;
  padding: 1.25rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0s linear 0.3s;
}

.mob-overlay.open {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.3s ease;
}

.mob-top {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  margin-bottom: auto;
  gap: 1rem;
}

.mob-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.3rem;
  line-height: 1.2;
}

.mob-version {
  font-size: 0.6rem;
  color: var(--muted);
  letter-spacing: 0.12em;
}

.mob-brand .lang-switch { margin-top: 0; }

.mob-name {
  font-size: clamp(1.6rem, 7vw, 2.4rem);
  color: var(--text);
  letter-spacing: 0.02em;
  line-height: 1;
  margin-top: 0.4rem;
}

.mob-close {
  background: none;
  border: 1px dashed rgba(211,216,224,0.4);
  color: var(--accent);
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.3rem;
  aspect-ratio: 1;
  min-height: 44px;
  height: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  letter-spacing: 0;
  flex-shrink: 0;
}

.mob-nav {
  position: absolute;
  top: 50%;
  left: 1.25rem;
  transform: translateY(-50%);
  padding-left: 0;
  text-align: left;
}

.mob-item {
  font-size: clamp(calc(2.4rem - 2px), calc(9vw - 2px), calc(4rem - 2px));
  line-height: 1.1;
  padding: 0.05em 0;
  cursor: pointer;
  color: rgba(239, 239, 239, 0.4);
  transition: color 0.25s;
  display: flex;
  align-items: baseline;
  justify-content: flex-start;
  user-select: none;
  text-decoration: none;
}

.mob-hash {
  color: var(--accent);
  max-width: 0;
  overflow: hidden;
  opacity: 0;
  white-space: nowrap;
  transition: max-width 0.25s ease, opacity 0.2s, margin-right 0.25s ease;
  margin-right: 0;
  pointer-events: none;
}

.mob-item:hover,
.mob-item:focus-visible,
.mob-item[aria-current="page"] { color: var(--text); }

.mob-item:hover .mob-hash,
.mob-item:focus-visible .mob-hash,
.mob-item[aria-current="page"] .mob-hash {
  max-width: 1em;
  opacity: 1;
  margin-right: 0.15em;
}

.mob-footer {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.4rem 0;
  margin-top: auto;
  padding-top: 2rem;
}

.mob-footer a {
  font-size: var(--ui-fs);
  color: rgba(239, 239, 239, 0.4);
  text-decoration: none;
  letter-spacing: 0.06em;
  transition: color 0.25s;
}

.mob-footer a:hover,
.mob-footer a:focus-visible { color: var(--accent); }


.rail {
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: 10;
}

.page-body .rail {
  right: auto;
  width: var(--rail-w);
  z-index: 50;
}

.nav-list {
  position: absolute;
  top: 0;
  left: 10px;
  will-change: transform;
}

.nav-item {
  display: flex;
  width: fit-content;
  align-items: baseline;
  padding: 0.04em 0;
  line-height: 0.95;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}

.nav-hash {
  font-size: var(--fs);
  color: var(--accent);
  max-width: 0;
  overflow: hidden;
  opacity: 0;
  white-space: nowrap;
  -webkit-text-stroke: 1px var(--accent);
  transition: max-width 0.25s ease, opacity 0.2s, margin-right 0.25s ease;
  margin-right: 0;
  pointer-events: none;
}

.nav-text {
  font-size: var(--fs);
  color: var(--text);
  letter-spacing: 0.01em;
  -webkit-text-stroke: 1px var(--text);
}

.nav-item:hover .nav-hash,
.nav-item:focus-visible .nav-hash,
.nav-item.active .nav-hash,
.nav-item[aria-current="page"] .nav-hash {
  max-width: 1.2em;
  opacity: 1;
  margin-right: 0.06em;
}

.nav-item .nav-text b {
  color: var(--accent);
  font-style: normal;
  -webkit-text-stroke: 1px var(--accent);
}

:root {
  --side-w: clamp(200px, 17vw, 280px);
  --ui-fs: 1.25rem;
}

.side {
  position: fixed;
  inset: 0 0 0 auto;
  width: var(--side-w);
  align-items: flex-end;
  text-align: right;
  z-index: 50;
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1.25rem;
  font-family: 'Bebas Neue', Impact, 'Arial Narrow', sans-serif;
  letter-spacing: 0.06em;
}

.side-brand { display: flex; flex-direction: column; line-height: 1.2; text-decoration: none; gap: 0.3rem; }
.side-version { font-size: calc(0.6rem + 4px); color: var(--accent); letter-spacing: 0.1em; }
.side-name { font-size: var(--ui-fs); color: var(--text); }

/* blur during scramble animation */
.scrambling { filter: blur(1px); transition: filter 0.15s; }

.side .lang-switch { margin-top: 0.3rem; }
.side nav { margin-top: auto; }
.side-nav { list-style: none; }

.side-item {
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  padding: 0.1rem 0;
  font-size: var(--ui-fs);
  line-height: 1.25;
  color: rgba(239, 239, 239, 0.4);
  text-decoration: none;
  transition: color 0.25s;
}

.side-hash {
  color: var(--accent);
  max-width: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-width 0.25s ease, opacity 0.2s, margin-left 0.25s ease;
}

.side-item:hover,
.side-item:focus-visible,
.side-item[aria-current="page"] { color: var(--text); }

.side-item:hover .side-hash,
.side-item:focus-visible .side-hash,
.side-item[aria-current="page"] .side-hash { max-width: 1em; opacity: 1; margin-left: 0.15em; }

.side .side-text b,
.side .side-name b,
.rail-clients .nav-item .nav-text b {
  font-weight: 400;
  color: rgba(255, 255, 255, 0.85);
  -webkit-text-stroke: 0;
  text-shadow: 0 0 2px rgba(255, 255, 255, 0.5);
}

.side-social {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.2rem 1.5rem;
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
}

.side-social a {
  font-size: var(--ui-fs);
  color: rgba(239, 239, 239, 0.4);
  text-decoration: none;
  transition: color 0.25s;
}
.side-social a:hover,
.side-social a:focus-visible { color: var(--accent); }

.lang-switch {
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 0.25em;
  margin-top: 0.5rem;
}

.lang-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-family: 'Bebas Neue', Impact, 'Arial Narrow', sans-serif;
  font-size: calc(var(--ui-fs) * 0.72);
  letter-spacing: 0.1em;
  color: rgba(239, 239, 239, 0.35);
  padding: 0;
  transition: color 0.25s;
  line-height: 1;
}

.lang-btn:hover,
.lang-btn:focus-visible,
.lang-btn--active { color: var(--text); }

.lang-sep {
  font-family: 'Bebas Neue', Impact, 'Arial Narrow', sans-serif;
  font-size: calc(var(--ui-fs) * 0.72);
  color: rgba(239, 239, 239, 0.15);
  line-height: 1;
  pointer-events: none;
}

.lang-switch--mob {
  justify-content: flex-start;
  margin-top: 0.5rem;
  margin-bottom: 0;
}

span.nav-item { cursor: default; }

.nav-banner .nav-text {
  color: rgba(211, 216, 224, 0.55);
  -webkit-text-stroke-color: rgba(211, 216, 224, 0.55);
}
.nav-banner:hover .nav-text,
.nav-banner:focus-visible .nav-text { color: var(--text); }

.rail-clients .nav-text {
  color: rgba(239, 239, 239, 0.4);
  -webkit-text-stroke-color: transparent;
  transition: color 0.25s;
}

.rail-clients .nav-item:hover .nav-text,
.rail-clients .nav-item:focus-visible .nav-text,
.rail-clients .nav-item.active .nav-text { color: var(--text); }

.rail-clients .nav-item { position: relative; }


@media (min-width: 769px) {
  .header,
  .mob-overlay { display: none; }
}

@media (min-width: 769px) {
  .rail,
  .side    { display: flex; }
  .mob-home,
  .mob-tint { display: none; }
}

.desk-tint {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: var(--desk-color, transparent);
  opacity: 0.04;
  transition: background 0.7s ease;
}

@media (max-width: 768px) { .desk-tint { display: none; } }

@media (max-width: 768px) {
  .rail,
  .side { display: none; }

  body.home .header { background: transparent; }

  body.home .mob-home::before,
  body.home .mob-home::after {
    content: '';
    position: absolute;
    left: 0; right: 0;
    pointer-events: none;
    z-index: 0;
  }
  body.home .mob-home::before {
    top: 0;
    height: 38%;
    background: linear-gradient(to bottom, rgba(8,9,11,0.75) 0%, transparent 100%);
  }
  body.home .mob-home::after {
    bottom: 0;
    height: 42%;
    background: linear-gradient(to top, rgba(8,9,11,0.80) 0%, transparent 100%);
  }

  .mob-home-content,
  .mob-home-nav,
  .mob-home-bar { position: relative; z-index: 1; }

  .mob-tint {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: var(--desk-color, transparent);
    opacity: 0.04;
    transition: background 0.7s ease;
  }

  .mob-home {
    display: flex;
    position: fixed;
    inset: 0;
    flex-direction: column;
    background: transparent;
    z-index: 2;
    justify-content: flex-end;
  }

  .mob-home-content {
    padding: 0 1.5rem 1rem;
    font-family: 'Bebas Neue', sans-serif;
    transition: opacity 0.28s ease;
  }

  .mob-home-label { display: none; }

  .mob-home-title {
    line-height: 0.88;
    color: var(--text);
    font-weight: 400;
    margin-bottom: 0.75rem;
    display: block;
  }

  .mob-home-cta {
    display: block;
    text-align: center;
    border: 1px dashed rgba(211, 216, 224, 0.4);
    padding: 0.85rem 1rem;
    color: var(--text);
    text-decoration: none;
    font-size: 1rem;
    letter-spacing: 0.18em;
    transition: border-color 0.25s, color 0.25s;
  }
  .mob-home-cta:active { border-color: var(--accent); color: var(--accent); }

  .mob-home-nav {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 0.65rem 1.5rem 0.5rem;
  }

  .mob-dot {
    flex: 1;
    height: 2px;
    background: rgba(211, 216, 224, 0.22);
    border: none;
    cursor: pointer;
    padding: 0;
    transition: background 0.3s;
  }
  .mob-dot.active {
    background: var(--accent);
  }

  .mob-home-bar {
    height: 2px;
    background: var(--accent);
    opacity: 0.4;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}


.field {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.5s ease;
}
.field.is-on { opacity: 1; }



.content[data-field] { position: relative; z-index: 1; }
