:root {
  color-scheme: dark;
  --bg: #101215;
  --panel: #191d22;
  --panel-strong: #20252c;
  --ink: #f4f2ec;
  --muted: #a7abb2;
  --faint: #747b85;
  --line: #30363f;
  --line-strong: #4b535f;
  --gold: #d6ad4d;
  --gold-bright: #e4c269;
  --blue: #91afd5;
  --success: #8fc5a3;
  --danger: #e09a8f;
  --header-height: 66px;
  --content-width: 1240px;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
}

body {
  height: 100dvh;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family:
    "PingFang SC", "Noto Sans CJK SC", "Microsoft YaHei", system-ui,
    -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
  letter-spacing: 0;
}

button {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}

img {
  display: block;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 20;
  padding: 9px 13px;
  border-radius: 6px;
  background: var(--gold);
  color: #13100a;
  font-weight: 700;
  transform: translateY(-160%);
  transition: transform 180ms ease;
}

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

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.site-header {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  padding: 0 max(24px, calc((100% - var(--content-width)) / 2));
  border-bottom: 1px solid rgba(75, 83, 95, 0.65);
  background: rgba(16, 18, 21, 0.96);
}

.brand,
.header-auth-button,
.account-identity,
.screen-caption {
  display: flex;
  align-items: center;
}

.brand {
  gap: 11px;
  text-decoration: none;
}

.brand-mark,
.account-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--panel);
  color: var(--gold);
  font-weight: 800;
}

.brand-mark {
  width: 36px;
  height: 36px;
  font-size: 17px;
}

.brand strong {
  font-size: 15px;
  line-height: 1;
}

.header-auth-button,
.auth-submit,
.account-action {
  min-height: 40px;
  border: 1px solid var(--gold);
  border-radius: 7px;
  background: var(--gold);
  color: #14110a;
  font-weight: 760;
  transition:
    transform 180ms ease,
    background 180ms ease,
    border-color 180ms ease;
}

.header-auth-button {
  gap: 8px;
  padding: 0 15px;
}

.header-auth-button:hover,
.auth-submit:hover,
.account-action:hover {
  border-color: var(--gold-bright);
  background: var(--gold-bright);
  transform: translateY(-1px);
}

.header-auth-button:active,
.auth-submit:active,
.account-action:active {
  transform: translateY(1px);
}

.header-auth-button svg {
  width: 16px;
  height: 16px;
  stroke-width: 2;
}

.single-screen {
  position: relative;
  height: calc(100dvh - var(--header-height));
  min-height: 590px;
  overflow: hidden;
  isolation: isolate;
}

.screen-media,
.screen-scrim {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.screen-media {
  z-index: -4;
  object-fit: cover;
  object-position: center;
  filter: saturate(0.78) contrast(1.04) brightness(0.68);
  transform: scale(1.012);
}

.screen-scrim {
  z-index: -3;
  background:
    linear-gradient(90deg, rgba(11, 13, 16, 0.98) 0%, rgba(11, 13, 16, 0.79) 39%, rgba(11, 13, 16, 0.24) 68%, rgba(11, 13, 16, 0.7) 100%),
    linear-gradient(0deg, rgba(11, 13, 16, 0.78) 0%, transparent 38%, rgba(11, 13, 16, 0.22) 100%);
}

.screen-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 360px);
  align-items: center;
  gap: 78px;
  width: min(var(--content-width), calc(100% - 48px));
  height: 100%;
  margin: 0 auto;
  padding: 36px 0 54px;
}

.screen-content,
.auth-panel,
.auth-view,
.auth-form,
.invite-form,
.field-label,
.field-input {
  min-width: 0;
}

.hero-copy {
  max-width: 660px;
}

.eyebrow,
.auth-kicker {
  margin: 0 0 14px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 760;
}

.hero-copy h1 {
  margin: 0;
  font-size: 56px;
  font-weight: 760;
  line-height: 1.2;
  text-wrap: balance;
}

.hero-lead {
  max-width: 520px;
  margin: 22px 0 0;
  color: #d9dadd;
  font-size: 18px;
  line-height: 1.7;
  text-wrap: pretty;
}

.visual-flow {
  display: grid;
  grid-template-columns: auto 32px auto 32px auto;
  align-items: center;
  width: max-content;
  margin-top: 38px;
}

.flow-node {
  display: grid;
  justify-items: center;
  gap: 9px;
  min-width: 88px;
}

.flow-node > span {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 1px solid rgba(214, 173, 77, 0.66);
  border-radius: 8px;
  background: rgba(37, 33, 22, 0.84);
  color: var(--gold);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(10px);
}

.flow-node svg {
  width: 23px;
  height: 23px;
  stroke-width: 1.7;
}

.flow-node strong {
  color: #d6d7da;
  font-size: 12px;
  font-weight: 650;
}

.flow-arrow {
  justify-self: center;
  width: 15px;
  height: 15px;
  color: var(--faint);
  stroke-width: 1.6;
}

.auth-panel {
  align-self: center;
  padding: 24px;
  border: 1px solid rgba(89, 98, 111, 0.82);
  border-radius: 8px;
  background: rgba(24, 28, 33, 0.94);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 26px 68px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(22px);
}

.auth-heading h2 {
  margin: 0;
  font-size: 23px;
  line-height: 1.2;
}

.auth-heading p:last-child {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.auth-view {
  min-height: 125px;
  margin-top: 18px;
}

.apple-sign-in-button {
  width: 100%;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 16px;
  border: 1px solid #474b52;
  border-radius: 6px;
  background: #000;
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
}

.apple-sign-in-button:hover:not(:disabled) {
  background: #17191c;
}

.apple-sign-in-button:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.apple-sign-in-button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.apple-sign-in-mark {
  width: 16px;
  height: 16px;
  display: inline-grid;
  place-items: center;
  color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 19px;
  line-height: 1;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0;
  color: var(--faint);
  font-size: 10px;
}

.auth-divider::before,
.auth-divider::after {
  height: 1px;
  flex: 1;
  background: var(--line);
  content: "";
}

.auth-form,
.invite-form {
  display: grid;
  gap: 11px;
}

.field-label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.field-input {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  outline: none;
  background: #111419;
  color: var(--ink);
  font-size: 14px;
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.field-input::placeholder {
  color: #626975;
}

.field-input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(214, 173, 77, 0.12);
}

.field-input.code-input {
  font-variant-numeric: tabular-nums;
}

.auth-submit,
.account-action {
  width: 100%;
  padding: 0 15px;
}

.auth-submit:disabled,
.account-action:disabled {
  cursor: wait;
  opacity: 0.62;
  transform: none;
}

.auth-secondary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.text-action {
  flex: 0 0 auto;
  padding: 3px 0;
  border: 0;
  background: transparent;
  color: var(--blue);
  font-size: 11px;
}

.text-action:hover {
  color: #bdd0e7;
}

.auth-context {
  min-width: 0;
  overflow: hidden;
  color: var(--faint);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-data-note {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.auth-message {
  min-height: 18px;
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.auth-message[data-tone="error"] {
  color: var(--danger);
}

.auth-message[data-tone="success"] {
  color: var(--success);
}

.auth-skeleton {
  display: grid;
  gap: 10px;
  padding-top: 2px;
}

.auth-skeleton span {
  display: block;
  height: 13px;
  overflow: hidden;
  border-radius: 4px;
  background: var(--panel-strong);
}

.auth-skeleton span:nth-child(2) {
  height: 44px;
}

.auth-skeleton span:nth-child(3) {
  height: 40px;
}

.auth-skeleton span::after {
  display: block;
  width: 45%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
  content: "";
  animation: shimmer 1.3s infinite;
}

.account-summary {
  display: grid;
  gap: 13px;
}

.account-identity {
  gap: 11px;
}

.account-avatar {
  width: 40px;
  height: 40px;
  font-size: 16px;
}

.account-identity div {
  min-width: 0;
}

.account-identity strong,
.account-identity span {
  display: block;
}

.account-identity strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-identity span {
  margin-top: 3px;
  color: var(--success);
  font-size: 11px;
}

.account-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.account-metrics div {
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #15191e;
}

.account-metrics span,
.account-metrics strong {
  display: block;
}

.account-metrics span {
  color: var(--faint);
  font-size: 9px;
}

.account-metrics strong {
  margin-top: 2px;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.account-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.account-logout {
  min-height: 40px;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
}

.account-logout:hover {
  border-color: #626c79;
  color: var(--ink);
}

.screen-caption {
  position: absolute;
  right: max(24px, calc((100% - var(--content-width)) / 2));
  bottom: 20px;
  gap: 8px;
  color: rgba(198, 201, 206, 0.62);
  font-size: 10px;
}

.screen-caption svg {
  width: 14px;
  height: 14px;
  color: var(--gold);
  stroke-width: 1.7;
}

@keyframes shimmer {
  from {
    transform: translateX(-140%);
  }
  to {
    transform: translateX(260%);
  }
}

@media (max-width: 920px) {
  .site-header {
    padding-right: 20px;
    padding-left: 20px;
  }

  .screen-content {
    grid-template-columns: minmax(0, 1fr) 330px;
    gap: 36px;
    width: calc(100% - 40px);
  }

  .hero-copy h1 {
    font-size: 46px;
  }

  .hero-lead {
    font-size: 16px;
  }
}

@media (max-width: 700px) {
  :root {
    --header-height: 60px;
  }

  body {
    overflow-y: auto;
  }

  .site-header {
    padding-right: 14px;
    padding-left: 14px;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
  }

  .brand strong {
    font-size: 13px;
  }

  .header-auth-button {
    min-height: 36px;
    padding: 0 11px;
    font-size: 12px;
  }

  .header-auth-button svg {
    display: none;
  }

  .single-screen {
    height: calc(100dvh - var(--header-height));
    min-height: 700px;
  }

  .screen-media {
    object-position: 64% center;
    filter: saturate(0.78) contrast(1.03) brightness(0.62);
  }

  .screen-scrim {
    background:
      linear-gradient(0deg, rgba(11, 13, 16, 0.98) 0%, rgba(11, 13, 16, 0.85) 52%, rgba(11, 13, 16, 0.42) 100%),
      linear-gradient(90deg, rgba(11, 13, 16, 0.76), rgba(11, 13, 16, 0.3));
  }

  .screen-caption {
    display: none;
  }

  .screen-content {
    grid-template-columns: 1fr;
    align-content: center;
    gap: 28px;
    width: calc(100% - 28px);
    padding: 26px 0 30px;
  }

  .hero-copy {
    max-width: 500px;
  }

  .eyebrow {
    margin-bottom: 9px;
  }

  .hero-copy h1 {
    font-size: 38px;
    line-height: 1.22;
  }

  .hero-lead {
    margin-top: 13px;
    font-size: 14px;
    line-height: 1.6;
  }

  .visual-flow {
    grid-template-columns: auto 24px auto 24px auto;
    margin-top: 22px;
  }

  .flow-node {
    min-width: 70px;
    gap: 6px;
  }

  .flow-node > span {
    width: 42px;
    height: 42px;
  }

  .flow-node svg {
    width: 19px;
    height: 19px;
  }

  .flow-node strong {
    font-size: 10px;
  }

  .auth-panel {
    width: 100%;
    max-width: 100%;
    padding: 20px;
    background: rgba(24, 28, 33, 0.97);
  }

  .auth-heading h2 {
    font-size: 21px;
  }

  .auth-view {
    min-height: 118px;
    margin-top: 15px;
  }
}

@media (max-width: 380px) {
  .brand strong {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .hero-copy h1 {
    font-size: 34px;
  }

  .visual-flow {
    grid-template-columns: auto 18px auto 18px auto;
  }

  .flow-node {
    min-width: 64px;
  }

  .account-actions {
    grid-template-columns: 1fr;
  }
}

@media (max-height: 760px) and (min-width: 701px) {
  .screen-content {
    padding-top: 24px;
    padding-bottom: 32px;
  }

  .hero-copy h1 {
    font-size: 46px;
  }

  .hero-lead {
    margin-top: 15px;
    font-size: 16px;
  }

  .visual-flow {
    margin-top: 25px;
  }

  .auth-panel {
    padding: 20px;
  }
}

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