:root {
  --page-bg: #050505;
  --panel-bg: #11110f;
  --panel-raised: #171611;
  --field-bg: #090909;
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(255, 255, 255, 0.2);
  --text: #f7f7f4;
  --muted: #a3a3a3;
  --subtle: #6f6f6f;
  --gold: #f3c43d;
  --gold-deep: #e0a52a;
  --gold-ink: #211906;
  --danger: #ff8e8e;
  --success: #b9e7a7;
  --sidebar-width: 286px;
}

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

html {
  color-scheme: dark;
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  color: var(--text);
  background: var(--page-bg);
  font-family: "Fira Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 200;
  padding: 10px 14px;
  border-radius: 8px;
  color: var(--gold-ink);
  background: var(--gold);
  font-weight: 700;
  transform: translateY(-150%);
  transition: transform 0.2s ease;
}

.skip-link:focus {
  transform: translateY(0);
}

/* Email access */
.access-page {
  display: grid;
  place-items: center;
  overflow-x: hidden;
}

.access-page::before,
.access-page::after {
  content: "";
  position: fixed;
  z-index: -2;
  pointer-events: none;
  border-radius: 999px;
  filter: blur(10px);
}

.access-page::before {
  top: -28vh;
  left: 50%;
  width: min(920px, 110vw);
  height: 620px;
  background: radial-gradient(circle, rgba(224, 165, 42, 0.2), rgba(224, 165, 42, 0) 70%);
  transform: translateX(-50%);
}

.access-page::after {
  right: -260px;
  bottom: -340px;
  width: 700px;
  height: 700px;
  background: radial-gradient(circle, rgba(118, 86, 18, 0.12), rgba(118, 86, 18, 0) 70%);
}

.access-shell {
  display: flex;
  width: 100%;
  min-height: 100vh;
  padding: 48px 24px 32px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.access-card {
  position: relative;
  width: min(100%, 560px);
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  padding: 54px 54px 46px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background:
    radial-gradient(110% 80% at 50% 0%, rgba(243, 196, 61, 0.08), transparent 52%),
    linear-gradient(180deg, rgba(20, 20, 18, 0.98), rgba(13, 13, 13, 0.98));
  box-shadow: 0 32px 100px rgba(0, 0, 0, 0.56);
}

.access-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.04);
}

.access-brand {
  display: flex;
  justify-content: center;
  margin-bottom: 48px;
}

.access-brand img {
  display: block;
  width: 122px;
  height: auto;
}

.access-copy {
  text-align: center;
}

.eyebrow {
  display: inline-flex;
  margin-bottom: 16px;
  padding: 6px 11px;
  border: 1px solid rgba(243, 196, 61, 0.22);
  border-radius: 999px;
  color: #e8cb79;
  background: rgba(243, 196, 61, 0.07);
  font-family: "Space Grotesk", sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.access-copy h1 {
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(30px, 5vw, 38px);
  line-height: 1.15;
  letter-spacing: -0.035em;
}

.access-copy p {
  max-width: 380px;
  margin: 13px auto 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.55;
}

.access-form {
  display: flex;
  margin-top: 38px;
  flex-direction: column;
  gap: 14px;
}

.field-label {
  color: #d8d8d5;
  font-size: 13px;
  font-weight: 600;
}

.input-wrap {
  position: relative;
}

.input-wrap svg {
  position: absolute;
  top: 50%;
  left: 17px;
  width: 19px;
  height: 19px;
  color: #777;
  pointer-events: none;
  transform: translateY(-50%);
}

.access-input {
  width: 100%;
  height: 58px;
  padding: 0 17px 0 50px;
  border: 1px solid var(--line);
  border-radius: 11px;
  outline: none;
  color: var(--text);
  background: var(--field-bg);
  font-size: 16px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.access-input::placeholder {
  color: #626262;
}

.access-input:hover {
  border-color: var(--line-strong);
}

.access-input:focus {
  border-color: var(--gold-deep);
  background: #0d0c09;
  box-shadow: 0 0 0 3px rgba(224, 165, 42, 0.12);
}

.access-submit {
  display: inline-flex;
  width: 100%;
  height: 56px;
  border: 0;
  border-radius: 11px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: var(--gold-ink);
  background: linear-gradient(135deg, #f7d25b, var(--gold-deep));
  box-shadow: 0 12px 34px rgba(224, 165, 42, 0.16);
  font-family: "Space Grotesk", sans-serif;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.18s ease, filter 0.18s ease, opacity 0.18s ease;
}

.access-submit svg {
  width: 17px;
  height: 17px;
}

.access-submit:hover:not(:disabled) {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.access-submit:active:not(:disabled) {
  transform: translateY(0);
}

.access-submit:disabled {
  cursor: wait;
  opacity: 0.72;
}

.form-status {
  min-height: 20px;
  color: var(--danger);
  font-size: 13px;
  line-height: 20px;
  text-align: left;
}

.form-status.success {
  color: var(--success);
}

.access-assurance {
  display: flex;
  margin-top: 21px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #777;
  font-size: 12px;
  line-height: 18px;
}

.access-assurance svg {
  width: 15px;
  height: 15px;
  flex: none;
}

.access-legal {
  width: min(100%, 540px);
  max-width: 540px;
  margin-top: 28px;
  color: #666;
  font-size: 12px;
  line-height: 19px;
  text-align: center;
}

.access-legal a {
  color: #929292;
  text-underline-offset: 3px;
}

.access-legal a:hover {
  color: var(--text);
}

/* Installation */
.install-page {
  background: #030303;
}

.install-page.access-pending .install-sidebar,
.install-page.access-pending .install-shell {
  visibility: hidden;
}

.install-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 50;
  display: flex;
  width: var(--sidebar-width);
  padding: 30px 22px 24px;
  border-right: 1px solid var(--line);
  flex-direction: column;
  background: #050505;
}

.sidebar-brand {
  display: inline-flex;
  width: fit-content;
  padding: 10px 12px;
  align-items: center;
}

.sidebar-brand img {
  display: block;
  width: 105px;
  height: auto;
}

.sidebar-label {
  margin: 50px 12px 14px;
  color: #5f5f5f;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sidebar-link {
  display: flex;
  min-height: 48px;
  padding: 0 14px;
  border-radius: 10px;
  align-items: center;
  gap: 12px;
  color: #999;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.18s ease, background 0.18s ease;
}

.sidebar-link svg {
  width: 18px;
  height: 18px;
  flex: none;
}

.sidebar-link:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.045);
}

.sidebar-link.active {
  color: #fff;
  background: #242424;
}

.sidebar-footer {
  display: flex;
  margin-top: auto;
  padding: 18px 12px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  flex-direction: column;
  gap: 8px;
}

.sidebar-footer a {
  width: fit-content;
  color: #737373;
  font-size: 12px;
  line-height: 20px;
  text-decoration: none;
}

.sidebar-footer a:hover {
  color: var(--text);
}

.install-shell {
  min-height: 100vh;
  margin-left: var(--sidebar-width);
}

.install-topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  height: 86px;
  padding: 0 42px;
  border-bottom: 1px solid var(--line);
  align-items: center;
  justify-content: flex-end;
  background: rgba(3, 3, 3, 0.88);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.mobile-menu {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 9px;
  align-items: center;
  justify-content: center;
  color: #ccc;
  background: #0b0b0b;
  cursor: pointer;
}

.mobile-menu svg {
  width: 20px;
  height: 20px;
}

.viewer-email {
  max-width: min(420px, 60vw);
  overflow: hidden;
  border: 0;
  color: #aaa;
  background: transparent;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.viewer-email:hover {
  color: #fff;
}

.install-main {
  width: min(100%, 980px);
  margin: 0 auto;
  padding: 94px 56px 80px;
}

.install-heading h1 {
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(34px, 5vw, 46px);
  line-height: 1.15;
  letter-spacing: -0.035em;
}

.install-heading p {
  margin-top: 13px;
  color: #777;
  font-size: 18px;
  line-height: 1.55;
}

.prerequisites {
  margin-top: 66px;
}

.section-kicker {
  color: #777;
  font-family: "Space Grotesk", sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.prerequisites ul {
  display: grid;
  margin-top: 23px;
  gap: 15px;
  color: #aaa;
  font-size: 16px;
  line-height: 1.55;
  list-style: none;
}

.prerequisites li {
  position: relative;
  padding-left: 26px;
}

.prerequisites li::before {
  content: "";
  position: absolute;
  top: 0.67em;
  left: 2px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold-deep);
  box-shadow: 0 0 10px rgba(224, 165, 42, 0.48);
}

.instruction-rule {
  height: 1px;
  margin: 58px 0 0;
  border: 0;
  background: var(--line);
}

.steps {
  display: flex;
  padding: 48px 0 0;
  flex-direction: column;
  gap: 42px;
  list-style: none;
  counter-reset: install-step;
}

.step {
  position: relative;
  padding-left: 50px;
  color: #c8c8c8;
  font-size: 16px;
  line-height: 1.65;
  counter-increment: install-step;
}

.step::before {
  content: counter(install-step) ".";
  position: absolute;
  top: 0;
  left: 0;
  width: 32px;
  color: #636363;
  font-family: "Fira Mono", monospace;
  font-size: 15px;
}

.step strong {
  color: #fff;
  font-weight: 600;
}

.git-url-box {
  display: flex;
  min-height: 70px;
  margin-top: 18px;
  padding: 10px 12px 10px 20px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  align-items: center;
  gap: 14px;
  background: #070707;
}

.git-url-box code {
  min-width: 0;
  overflow-x: auto;
  color: #e3e3df;
  font-family: "Fira Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 14px;
  line-height: 22px;
  white-space: nowrap;
  scrollbar-width: thin;
}

.copy-button {
  display: inline-flex;
  width: 42px;
  height: 42px;
  margin-left: auto;
  border: 0;
  border-radius: 8px;
  flex: none;
  align-items: center;
  justify-content: center;
  color: #8b8b8b;
  background: transparent;
  cursor: pointer;
  transition: color 0.18s ease, background 0.18s ease;
}

.copy-button:hover {
  color: var(--gold);
  background: rgba(255, 255, 255, 0.055);
}

.copy-button svg {
  width: 20px;
  height: 20px;
}

.copy-status {
  min-height: 20px;
  margin-top: 9px;
  color: var(--success);
  font-size: 12px;
}

.install-note {
  margin-top: 52px;
  padding: 20px 22px;
  border: 1px solid rgba(243, 196, 61, 0.16);
  border-radius: 12px;
  color: #aaa;
  background: rgba(243, 196, 61, 0.045);
  font-size: 14px;
  line-height: 1.65;
}

.install-note strong {
  color: #ead58d;
}

.install-note p + p {
  margin-top: 12px;
}

.install-complete {
  margin-top: 48px;
  color: #777;
  font-size: 15px;
  line-height: 1.6;
}

.install-complete a {
  color: #d9bd69;
  text-underline-offset: 3px;
}

.install-complete a:hover {
  color: var(--gold);
}

.sidebar-scrim {
  display: none;
}

@media (max-width: 820px) {
  .install-sidebar {
    width: min(286px, 84vw);
    box-shadow: 24px 0 70px rgba(0, 0, 0, 0.6);
    transform: translateX(-105%);
    transition: transform 0.24s ease;
  }

  .install-page.sidebar-open .install-sidebar {
    transform: translateX(0);
  }

  .sidebar-scrim {
    position: fixed;
    inset: 0;
    z-index: 45;
    display: block;
    border: 0;
    visibility: hidden;
    background: rgba(0, 0, 0, 0.68);
    opacity: 0;
    transition: opacity 0.24s ease, visibility 0.24s ease;
  }

  .install-page.sidebar-open .sidebar-scrim {
    visibility: visible;
    opacity: 1;
  }

  .install-shell {
    margin-left: 0;
  }

  .install-topbar {
    height: 72px;
    padding: 0 20px;
    justify-content: space-between;
  }

  .mobile-menu {
    display: inline-flex;
  }

  .install-main {
    padding: 68px 28px 64px;
  }
}

@media (max-width: 560px) {
  .access-shell {
    justify-content: flex-start;
    padding: 22px 14px 24px;
  }

  .access-card {
    width: calc(100vw - 28px);
    max-width: calc(100vw - 28px);
    margin: auto 0;
    padding: 38px 22px 32px;
    border-radius: 18px;
  }

  .access-brand {
    margin-bottom: 36px;
  }

  .access-brand img {
    width: 105px;
  }

  .access-form {
    margin-top: 30px;
  }

  .access-assurance {
    align-items: flex-start;
  }

  .access-assurance span {
    min-width: 0;
  }

  .access-legal {
    width: calc(100vw - 28px);
    max-width: calc(100vw - 28px);
  }

  .install-main {
    padding: 52px 20px 56px;
  }

  .install-heading p {
    font-size: 16px;
  }

  .prerequisites {
    margin-top: 48px;
  }

  .instruction-rule {
    margin-top: 44px;
  }

  .steps {
    padding-top: 40px;
    gap: 36px;
  }

  .step {
    padding-left: 38px;
    font-size: 15px;
  }

  .git-url-box {
    padding-left: 14px;
  }

  .git-url-box code {
    font-size: 12px;
  }
}

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