:root {
  color-scheme: dark;
  --bklt-black: #000000;
  --bklt-ink: #f3f3ef;
  --bklt-paper: #d7d7cf;
  --bklt-muted: #85857e;
  --bklt-dim: #5b5b56;
  --bklt-panel: #090909;
  --bklt-panel-2: #111111;
  --bklt-line: #262626;
  --bklt-line-strong: #41413c;
  --bklt-acid: #dcff3f;
  --bklt-danger: #ff6b5f;
  --bklt-sans: "Geist", Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --bklt-mono: "Geist Mono", "SFMono-Regular", Consolas, monospace;
}

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

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--bklt-black);
}

body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 88% 4%, rgba(220, 255, 63, 0.08), transparent 24rem),
    var(--bklt-black);
  color: var(--bklt-ink);
  font-family: var(--bklt-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

body::before {
  position: fixed;
  z-index: -1;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px);
  background-size: 64px 64px;
  content: "";
  mask-image: linear-gradient(to bottom, black, transparent 78%);
  pointer-events: none;
}

button,
input {
  font: inherit;
}

a {
  color: inherit;
}

:where(a, button, input):focus-visible {
  outline: 2px solid var(--bklt-acid);
  outline-offset: 4px;
}

.portal-shell {
  min-height: 100vh;
}

.portal-header {
  display: flex;
  min-height: 78px;
  align-items: stretch;
  justify-content: space-between;
  border-bottom: 1px solid var(--bklt-line);
}

.portal-brand,
.portal-header__actions {
  display: flex;
  align-items: center;
}

.portal-brand {
  min-width: 236px;
  gap: 16px;
  padding: 0 28px;
  text-decoration: none;
}

.portal-brand__mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--bklt-ink);
  color: var(--bklt-ink);
  font-family: var(--bklt-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: -0.05em;
}

.portal-brand__name {
  color: var(--bklt-ink);
  font-size: 13px;
  font-weight: 720;
  letter-spacing: 0.18em;
}

.portal-brand__section {
  color: var(--bklt-muted);
  font-family: var(--bklt-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.portal-header__actions {
  gap: 8px;
  padding: 0 20px;
  border-left: 1px solid var(--bklt-line);
}

.portal-user {
  max-width: 220px;
  overflow: hidden;
  margin-right: 8px;
  color: var(--bklt-muted);
  font-family: var(--bklt-mono);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portal-button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid var(--bklt-line-strong);
  border-radius: 2px;
  background: transparent;
  padding: 0 15px;
  color: var(--bklt-paper);
  cursor: pointer;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-decoration: none;
  text-transform: uppercase;
  transition: border-color 140ms ease, color 140ms ease, background 140ms ease;
}

.portal-button:hover {
  border-color: var(--bklt-paper);
  color: #ffffff;
}

.portal-button--primary {
  border-color: var(--bklt-acid);
  background: var(--bklt-acid);
  color: #050505;
}

.portal-button--primary:hover {
  border-color: #ecff91;
  background: #ecff91;
  color: #050505;
}

.portal-button--icon {
  width: 40px;
  padding: 0;
}

.portal-kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--bklt-acid);
  font-family: var(--bklt-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.portal-kicker::before {
  width: 28px;
  height: 1px;
  background: currentColor;
  content: "";
}

.portal-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--bklt-paper);
  font-family: var(--bklt-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.portal-status::before {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--bklt-acid);
  box-shadow: 0 0 14px rgba(220, 255, 63, 0.8);
  content: "";
}

.portal-footer {
  display: flex;
  min-height: 62px;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--bklt-line);
  padding: 0 28px;
  color: var(--bklt-dim);
  font-family: var(--bklt-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.portal-footer__rule {
  width: 46px;
  height: 1px;
  background: var(--bklt-line-strong);
}

/* Home */

.home-main {
  display: grid;
  min-height: calc(100vh - 141px);
  grid-template-columns: minmax(0, 1.55fr) minmax(340px, 0.75fr);
}

.home-primary {
  display: flex;
  min-height: 680px;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(42px, 7vw, 96px);
}

.home-primary__copy {
  max-width: 900px;
}

.home-primary h1 {
  max-width: 920px;
  margin-top: 42px;
  font-size: clamp(58px, 8.5vw, 136px);
  font-weight: 580;
  letter-spacing: -0.075em;
  line-height: 0.82;
}

.home-primary h1 span {
  display: block;
  color: var(--bklt-muted);
  font-weight: 260;
}

.home-primary__bottom {
  display: grid;
  max-width: 860px;
  grid-template-columns: minmax(200px, 1fr) minmax(260px, 1.3fr);
  gap: 42px;
  align-items: end;
}

.home-primary__statement {
  color: var(--bklt-muted);
  font-size: 15px;
  line-height: 1.65;
}

.home-primary__statement strong {
  color: var(--bklt-paper);
  font-weight: 520;
}

.home-launch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid var(--bklt-line-strong);
  border-bottom: 1px solid var(--bklt-line-strong);
  padding: 22px 0;
  text-decoration: none;
  transition: border-color 140ms ease;
}

.home-launch:hover {
  border-color: var(--bklt-acid);
}

.home-launch__label {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.home-launch__label strong {
  font-size: 16px;
  font-weight: 600;
}

.home-launch__label span {
  color: var(--bklt-muted);
  font-family: var(--bklt-mono);
  font-size: 9px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.home-launch__arrow {
  color: var(--bklt-acid);
  font-size: 24px;
  transition: transform 140ms ease;
}

.home-launch:hover .home-launch__arrow {
  transform: translateX(5px);
}

.home-launch[aria-disabled="true"] {
  opacity: 0.42;
  pointer-events: none;
}

.home-side {
  display: grid;
  grid-template-rows: 1fr auto;
  border-left: 1px solid var(--bklt-line);
}

.home-instrument {
  position: relative;
  display: flex;
  min-height: 520px;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  padding: 40px;
}

.home-instrument::before,
.home-instrument::after {
  position: absolute;
  width: min(33vw, 420px);
  height: min(33vw, 420px);
  border: 1px solid var(--bklt-line);
  border-radius: 50%;
  content: "";
  pointer-events: none;
}

.home-instrument::before {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.home-instrument::after {
  top: 50%;
  left: 50%;
  width: min(20vw, 260px);
  height: min(20vw, 260px);
  border-color: var(--bklt-line-strong);
  transform: translate(-50%, -50%);
}

.home-instrument__crosshair {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 1;
  width: 74px;
  height: 74px;
  transform: translate(-50%, -50%);
}

.home-instrument__crosshair::before,
.home-instrument__crosshair::after {
  position: absolute;
  top: 50%;
  left: 50%;
  background: var(--bklt-acid);
  content: "";
  transform: translate(-50%, -50%);
}

.home-instrument__crosshair::before {
  width: 74px;
  height: 1px;
}

.home-instrument__crosshair::after {
  width: 1px;
  height: 74px;
}

.home-instrument__meta {
  z-index: 2;
  display: flex;
  justify-content: space-between;
  color: var(--bklt-muted);
  font-family: var(--bklt-mono);
  font-size: 9px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.home-archive {
  display: grid;
  min-height: 190px;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 24px;
  border-top: 1px solid var(--bklt-line);
  background: var(--bklt-panel);
  padding: 34px 40px;
  text-decoration: none;
  transition: background 140ms ease;
}

.home-archive:hover {
  background: var(--bklt-panel-2);
}

.home-archive__index {
  display: block;
  margin-bottom: 14px;
  color: var(--bklt-acid);
  font-family: var(--bklt-mono);
  font-size: 10px;
}

.home-archive strong {
  display: block;
  font-size: 28px;
  font-weight: 520;
  letter-spacing: -0.03em;
}

.home-archive p {
  max-width: 260px;
  margin-top: 8px;
  color: var(--bklt-muted);
  font-size: 12px;
  line-height: 1.5;
}

.home-archive svg {
  color: var(--bklt-paper);
}

/* Archive */

.archive-main {
  min-height: calc(100vh - 141px);
  padding: clamp(42px, 6vw, 88px) clamp(22px, 5vw, 72px) 88px;
}

.archive-intro {
  display: grid;
  max-width: 1320px;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.5fr);
  gap: 44px;
  align-items: end;
  margin: 0 auto 70px;
}

.archive-intro h1 {
  max-width: 880px;
  margin-top: 24px;
  font-size: clamp(54px, 7vw, 112px);
  font-weight: 520;
  letter-spacing: -0.075em;
  line-height: 0.9;
}

.archive-intro__aside {
  border-left: 1px solid var(--bklt-line-strong);
  padding-left: 24px;
  color: var(--bklt-muted);
  font-size: 13px;
  line-height: 1.65;
}

.archive-toolbar {
  display: grid;
  max-width: 1320px;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 18px;
  margin: 0 auto;
  border-top: 1px solid var(--bklt-line);
  border-bottom: 1px solid var(--bklt-line);
  padding: 14px 0;
}

.archive-search {
  width: 100%;
  min-height: 44px;
  border: 0;
  background: transparent;
  color: var(--bklt-ink);
  font-size: 15px;
  outline: 0;
}

.archive-search::placeholder {
  color: var(--bklt-dim);
}

.archive-count {
  color: var(--bklt-muted);
  font-family: var(--bklt-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.archive-grid {
  display: grid;
  max-width: 1320px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0 auto;
  border-left: 1px solid var(--bklt-line);
}

.archive-card {
  position: relative;
  display: none;
  min-height: 230px;
  flex-direction: column;
  justify-content: space-between;
  border-right: 1px solid var(--bklt-line);
  border-bottom: 1px solid var(--bklt-line);
  padding: 26px;
  text-decoration: none;
  transition: background 140ms ease;
}

.archive-card[data-authorized="true"]:not([hidden]) {
  display: flex;
}

.archive-card:hover {
  background: var(--bklt-panel-2);
}

.archive-card__top,
.archive-card__bottom {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.archive-card__index,
.archive-card__group {
  color: var(--bklt-muted);
  font-family: var(--bklt-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.archive-card__group {
  color: var(--bklt-dim);
}

.archive-card h2 {
  margin: 34px 0 8px;
  font-size: 24px;
  font-weight: 520;
  letter-spacing: -0.035em;
}

.archive-card p {
  max-width: 320px;
  color: var(--bklt-muted);
  font-size: 12px;
  line-height: 1.55;
}

.archive-card__arrow {
  color: var(--bklt-dim);
  font-size: 20px;
  transition: color 140ms ease, transform 140ms ease;
}

.archive-card:hover .archive-card__arrow {
  color: var(--bklt-acid);
  transform: translateX(4px);
}

.archive-empty {
  max-width: 1320px;
  margin: 40px auto 0;
  border: 1px solid var(--bklt-line);
  padding: 32px;
  color: var(--bklt-muted);
  font-size: 13px;
}

[hidden] {
  display: none !important;
}

/* Login */

.login-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(0, 1.25fr) minmax(420px, 0.75fr);
}

.login-story {
  position: relative;
  display: flex;
  min-height: 760px;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  padding: clamp(34px, 5vw, 72px);
}

.login-story::before {
  position: absolute;
  right: -12vw;
  bottom: -22vw;
  width: min(74vw, 980px);
  height: min(74vw, 980px);
  border: 1px solid var(--bklt-line);
  border-radius: 50%;
  content: "";
}

.login-story__brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.login-story__brand strong {
  font-size: 13px;
  letter-spacing: 0.18em;
}

.login-story__copy {
  z-index: 1;
  max-width: 760px;
}

.login-story h1 {
  margin-top: 32px;
  font-size: clamp(58px, 8vw, 124px);
  font-weight: 520;
  letter-spacing: -0.078em;
  line-height: 0.82;
}

.login-story h1 span {
  display: block;
  color: var(--bklt-muted);
  font-weight: 240;
}

.login-story__footer {
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--bklt-dim);
  font-family: var(--bklt-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.login-panel {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-left: 1px solid var(--bklt-line);
  background: rgba(7, 7, 7, 0.9);
  padding: clamp(30px, 4.5vw, 68px);
}

.login-panel__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--bklt-muted);
  font-family: var(--bklt-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.login-card {
  width: 100%;
  max-width: 470px;
  margin: 76px auto;
}

.login-card h2 {
  font-size: clamp(38px, 4vw, 56px);
  font-weight: 520;
  letter-spacing: -0.055em;
}

.login-card__subtitle {
  margin: 12px 0 42px;
  color: var(--bklt-muted);
  font-size: 14px;
  line-height: 1.55;
}

.form-group {
  margin-bottom: 24px;
}

.form-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 9px;
  color: var(--bklt-paper);
  font-family: var(--bklt-mono);
  font-size: 9px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.form-label span {
  color: var(--bklt-dim);
}

.form-input {
  width: 100%;
  min-height: 56px;
  border: 1px solid var(--bklt-line-strong);
  border-radius: 2px;
  background: var(--bklt-black);
  padding: 0 16px;
  color: var(--bklt-ink);
  font-size: 16px;
  outline: 0;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.form-input:focus {
  border-color: var(--bklt-acid);
  box-shadow: 0 0 0 1px var(--bklt-acid);
}

.form-input.error {
  border-color: var(--bklt-danger);
}

.form-input::placeholder {
  color: var(--bklt-dim);
}

.login-submit {
  position: relative;
  width: 100%;
  min-height: 56px;
  border: 1px solid var(--bklt-acid);
  border-radius: 2px;
  background: var(--bklt-acid);
  color: #050505;
  cursor: pointer;
  font-size: 11px;
  font-weight: 720;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.login-submit:hover {
  border-color: #ecff91;
  background: #ecff91;
}

.login-submit:disabled {
  cursor: wait;
  opacity: 0.58;
}

.login-submit--loading {
  color: transparent;
}

.login-submit--loading::after {
  position: absolute;
  inset: 0;
  width: 18px;
  height: 18px;
  margin: auto;
  border: 2px solid #050505;
  border-top-color: transparent;
  border-radius: 50%;
  animation: portal-spin 600ms linear infinite;
  content: "";
}

@keyframes portal-spin {
  to { transform: rotate(360deg); }
}

.login-message {
  display: none;
  margin-bottom: 22px;
  border-left: 2px solid currentColor;
  background: var(--bklt-panel-2);
  padding: 12px 14px;
  color: var(--bklt-danger);
  font-size: 12px;
  line-height: 1.5;
}

.login-message.visible {
  display: block;
}

.login-message--success {
  color: var(--bklt-acid);
}

.login-session {
  display: none;
}

.login-session.active {
  display: block;
}

.login-session__name {
  margin-bottom: 12px;
  font-size: 28px;
  font-weight: 520;
}

.login-session__links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 24px 0;
}

.login-panel__footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  color: var(--bklt-dim);
  font-family: var(--bklt-mono);
  font-size: 9px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.login-panel__footer a {
  color: var(--bklt-muted);
  text-decoration: none;
}

.login-panel__footer a:hover {
  color: var(--bklt-ink);
}

@media (max-width: 1040px) {
  .home-main {
    grid-template-columns: 1fr;
  }

  .home-side {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: none;
    border-top: 1px solid var(--bklt-line);
    border-left: 0;
  }

  .home-instrument {
    min-height: 360px;
  }

  .home-archive {
    min-height: 360px;
    border-top: 0;
    border-left: 1px solid var(--bklt-line);
  }

  .archive-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .login-shell {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 760px) {
  .portal-header {
    min-height: 66px;
  }

  .portal-brand {
    min-width: 0;
    padding: 0 16px;
  }

  .portal-brand__section,
  .portal-user {
    display: none;
  }

  .portal-header__actions {
    padding: 0 12px;
  }

  .portal-button--home span,
  .portal-button--logout span {
    display: none;
  }

  .portal-button--home,
  .portal-button--logout {
    width: 40px;
    padding: 0;
  }

  .home-primary {
    min-height: 620px;
    padding: 42px 22px;
  }

  .home-primary h1 {
    margin-top: 34px;
    font-size: clamp(54px, 18vw, 88px);
  }

  .home-primary__bottom {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .home-side {
    grid-template-columns: 1fr;
  }

  .home-instrument {
    min-height: 310px;
    padding: 28px 22px;
  }

  .home-instrument::before {
    width: 280px;
    height: 280px;
  }

  .home-instrument::after {
    width: 170px;
    height: 170px;
  }

  .home-archive {
    min-height: 230px;
    border-top: 1px solid var(--bklt-line);
    border-left: 0;
    padding: 30px 22px;
  }

  .archive-main {
    padding: 42px 16px 70px;
  }

  .archive-intro {
    grid-template-columns: 1fr;
    gap: 30px;
    margin-bottom: 46px;
  }

  .archive-intro h1 {
    font-size: clamp(52px, 17vw, 82px);
  }

  .archive-intro__aside {
    padding-left: 16px;
  }

  .archive-grid {
    grid-template-columns: 1fr;
  }

  .archive-card {
    min-height: 205px;
    padding: 22px;
  }

  .portal-footer {
    padding: 0 16px;
  }

  .login-shell {
    grid-template-columns: 1fr;
  }

  .login-story {
    min-height: 360px;
    padding: 30px 22px 40px;
  }

  .login-story h1 {
    font-size: clamp(52px, 17vw, 84px);
  }

  .login-story__footer {
    display: none;
  }

  .login-panel {
    min-height: 620px;
    border-top: 1px solid var(--bklt-line);
    border-left: 0;
    padding: 30px 22px;
  }

  .login-card {
    margin: 54px auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
