:root {
  color-scheme: dark;
  font-family: Geist, Inter, ui-sans-serif, system-ui, -apple-system,
    BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #111827;
  color: #f3f4f6;
  --gray-900: #111827;
  --gray-800: #1f2937;
  --gray-700: #374151;
  --gray-600: #4b5563;
  --gray-500: #6b7280;
  --gray-400: #9ca3af;
  --gray-300: #d1d5db;
  --gray-100: #f3f4f6;
  --blue-700: #1d4ed8;
  --blue-600: #2563eb;
  --blue-400: #60a5fa;
  --green-400: #4ade80;
  --yellow-400: #facc15;
  --red-400: #f87171;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--gray-900);
  color: var(--gray-100);
  -webkit-font-smoothing: antialiased;
}

button, a { font: inherit; }
button:not(:disabled), a { cursor: pointer; }

.shell { min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
  min-height: 64px;
  padding: 0 max(24px, calc((100vw - 1024px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--gray-700);
  background: var(--gray-900);
}

.brand, .header-actions { display: flex; align-items: center; gap: 12px; }
.brand > div:last-child { display: flex; flex-direction: column; }
.brand strong { font-size: 16px; font-weight: 700; }
.brand span {
  margin-top: 1px;
  color: var(--gray-400);
  font-size: 11px;
}

.mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: var(--blue-600);
  color: white;
  font-weight: 700;
}

main {
  width: min(1024px, calc(100% - 48px));
  margin: 0 auto;
  flex: 1;
  padding: 32px 0 56px;
}

h1, h2, h3, p { margin-top: 0; }
h1 { font-size: 24px; line-height: 1.3; margin-bottom: 24px; }
h2 { font-size: 18px; line-height: 1.4; }
h3 { font-size: 15px; line-height: 1.4; }

.login-card {
  width: min(640px, 100%);
  margin: 10vh auto 0;
  padding: 32px;
  border: 1px solid var(--gray-700);
  border-radius: 8px;
  background: var(--gray-800);
}

.login-card h1 { margin-bottom: 12px; }
.login-card > p:not(.eyebrow):not(.error),
.hero p {
  color: var(--gray-400);
  font-size: 14px;
  line-height: 1.6;
}

.eyebrow {
  color: var(--gray-400);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.button {
  border: 0;
  border-radius: 4px;
  padding: 9px 16px;
  color: white;
  font-weight: 500;
  transition: background-color .15s ease;
}
.button.primary { margin-top: 12px; background: var(--blue-600); }
.button.primary:hover { background: var(--blue-700); }
.button.subtle { background: var(--gray-700); color: var(--gray-300); }
.button.subtle:hover { background: var(--gray-600); }
.identity { color: var(--gray-400); font-size: 13px; }

.hero {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 24px;
  margin-bottom: 24px;
}
.hero h1 { margin-bottom: 6px; }
.hero p { margin-bottom: 0; }
.legend { display: flex; gap: 16px; color: var(--gray-400); font-size: 12px; padding-bottom: 4px; }
.legend span { display: flex; align-items: center; gap: 7px; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot.staging { background: var(--yellow-400); }
.dot.production { background: var(--green-400); }

.environment-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.environment {
  padding: 24px;
  border: 1px solid var(--gray-700);
  border-radius: 8px;
  background: var(--gray-800);
}
.environment-heading { display: flex; justify-content: space-between; align-items: start; gap: 16px; }
.environment-heading h2, .section-heading h2 { margin-bottom: 0; }
.environment.staging .eyebrow { color: var(--yellow-400); }
.environment.production .eyebrow { color: var(--green-400); }
.environment-badge {
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: 4px;
  background: var(--gray-700);
  color: var(--gray-300);
  font-size: 11px;
}
.environment-description { color: var(--gray-400); font-size: 13px; line-height: 1.55; margin: 10px 0 20px; }

.link-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.link-card {
  min-height: 158px;
  padding: 16px;
  border: 1px solid var(--gray-600);
  border-radius: 8px;
  background: var(--gray-700);
  transition: background-color .15s ease, border-color .15s ease;
}
.link-card:hover { background: var(--gray-600); border-color: var(--blue-400); }
.card-top { display: flex; justify-content: space-between; gap: 10px; }
.category { color: var(--gray-400); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; }
.card-action { color: var(--blue-400); background: none; border: 0; padding: 0; text-decoration: none; font-size: 12px; }
.card-action:hover { text-decoration: underline; }
.link-card h3 { margin: 18px 0 7px; color: var(--gray-100); }
.link-card p { color: var(--gray-400); font-size: 12px; line-height: 1.5; margin-bottom: 12px; }
.hostname, code { color: var(--gray-400); font-size: 10px; overflow-wrap: anywhere; }

.shared-section { margin-top: 40px; }
.section-heading { margin-bottom: 16px; }
.shared-section .link-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }

footer {
  padding: 20px 24px;
  text-align: center;
  color: var(--gray-500);
  border-top: 1px solid var(--gray-700);
  font-size: 11px;
}
.error { color: var(--red-400); margin: 16px 0 0; font-size: 13px; }
.hidden { display: none !important; }

@media (max-width: 1100px) {
  .environment-grid { grid-template-columns: 1fr; }
  .shared-section .link-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  main { width: min(100% - 24px, 1024px); padding-top: 24px; }
  .topbar { padding: 12px; }
  .identity { display: none; }
  .hero { align-items: start; flex-direction: column; }
  .link-grid, .shared-section .link-grid { grid-template-columns: 1fr; }
  .environment, .login-card { padding: 20px; }
}
