@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("./fonts/ibm-plex-sans-latin.woff2") format("woff2");
}

:root {
  color-scheme: dark;
  --background: #050505;
  --surface: #111;
  --surface-raised: #191919;
  --foreground: #fff;
  --muted: #aaa;
  --accent: #aa0000;
  --accent-bright: #df1010;
  --border: #3d1717;
  --gradient-radial: radial-gradient(circle, #160606, #050505 72%);
  --gradient-linear: linear-gradient(180deg, #a90000, #100606);
  font-family: "IBM Plex Sans", sans-serif;
  color: var(--foreground);
  background: var(--background);
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }
body { margin: 0; background: var(--background); color: var(--foreground); }
button, input { font: inherit; }
button, a, summary { -webkit-tap-highlight-color: transparent; }

.app-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--gradient-radial);
}

.card {
  position: relative;
  width: min(100%, 470px);
  padding: 32px;
  overflow: hidden;
  background: linear-gradient(145deg, rgb(90 0 0 / 25%), #101010 42%);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 20px 70px rgb(0 0 0 / 65%), 0 0 42px rgb(150 0 0 / 9%);
}

h1, h2, h3, h4 { margin: 0; }
h1 { margin-bottom: 8px; font-size: 1.55rem; font-weight: 600; letter-spacing: -.025em; }
.card h1 {
  background: linear-gradient(180deg, #fff 10%, #e6b8b8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.muted { margin: 0 0 24px; color: var(--muted); }
label { display: block; margin: 16px 0 6px; color: #e2dede; font-size: .92rem; }

input {
  width: 100%;
  padding: 11px 12px;
  color: var(--foreground);
  background: #090909;
  border: 1px solid #493030;
  border-radius: 7px;
  font: inherit;
}
input::placeholder { color: #777; }
input:focus-visible {
  outline: 2px solid var(--accent-bright);
  outline-offset: 2px;
  border-color: var(--accent-bright);
}

button, .home-link {
  min-height: 42px;
  border: 1px solid #4a2222;
  border-radius: 7px;
  padding: 9px 16px;
  color: var(--foreground);
  background: #181414;
  font: inherit;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, transform .15s ease;
}
button:hover, .home-link:hover { border-color: var(--accent-bright); background: #2b1010; }
button:active, .home-link:active { transform: translateY(1px); }
button:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent-bright);
  outline-offset: 3px;
}
.primary {
  color: #fff;
  background: linear-gradient(180deg, #c20c0c, #7e0000);
  border-color: #d12424;
  font-weight: 600;
}
.primary:hover { background: linear-gradient(180deg, #e21a1a, #980000); }
.card form:not(.address-form) .primary { width: 100%; margin-top: 22px; }
.address-form { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 24px; }
.address-form input { min-width: 0; }
.address-form > input { flex: 1; }
.blank-toggle {
  display: flex;
  flex-basis: 100%;
  align-items: center;
  gap: 8px;
  margin: 7px 0 0;
  color: #d6cdcd;
  cursor: pointer;
}
.blank-toggle input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent-bright); }
.blank-note { flex-basis: 100%; margin: 0; color: var(--muted); font-size: .85rem; }
.blank-note + .alert { flex-basis: 100%; margin: 4px 0 0; }
.logout-form { margin-top: 18px; text-align: right; }
.quiet { color: #c9bdbd; background: transparent; border-color: transparent; }
.quiet:hover { color: #fff; background: #231010; border-color: #4a2222; }
.alert {
  margin: 18px 0;
  padding: 12px;
  color: #ffdede;
  background: #280d0d;
  border: 1px solid #762424;
  border-radius: 7px;
}
.home-link {
  display: inline-flex;
  align-items: center;
  margin-top: 8px;
  color: #fff;
  text-decoration: none;
}
.home-link.primary {
  background: linear-gradient(180deg, #c20c0c, #7e0000);
  border-color: #d12424;
}
.home-link.primary:hover { background: linear-gradient(180deg, #e21a1a, #980000); }
.secondary-link { color: #f1caca; text-decoration: none; }
.secondary-link:hover { color: #fff; text-decoration: underline; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.proxy-mode { margin-top: 22px; color: #d6cdcd; }
.proxy-mode summary { cursor: pointer; font-size: .9rem; }
.proxy-mode summary:hover { color: #fff; }

.remote-browser-page { min-height: 100vh; background: #080808; }
.remote-toolbar {
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: #111;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 4px 18px rgb(0 0 0 / 35%);
}
.remote-toolbar button { min-height: 36px; padding: 6px 10px; }
.remote-toolbar .primary { background: linear-gradient(180deg, #c20c0c, #7e0000); border: 0; }
.remote-home { color: #f1caca; font-weight: 600; text-decoration: none; white-space: nowrap; }
.remote-toolbar > form:not(#remote-address-form) { margin: 0; }
#remote-address-form { display: flex; flex: 1; gap: 6px; margin: 0; }
#remote-address { min-width: 100px; flex: 1; padding: 7px 10px; }
.remote-status { margin: 0; padding: 5px 12px; color: #c2baba; font-size: .82rem; }
.remote-viewport {
  height: calc(100vh - 88px);
  display: grid;
  place-items: start center;
  overflow: auto;
  padding: 0 8px 8px;
}
#remote-screen {
  display: block;
  width: min(100%, 1280px);
  height: auto;
  max-height: 100%;
  object-fit: contain;
  background: #fff;
  outline: none;
  cursor: default;
}
.remote-error {
  position: fixed;
  right: 16px;
  bottom: 16px;
  max-width: min(90vw, 520px);
  margin: 0;
  padding: 10px 14px;
  color: #ffdede;
  background: #280d0d;
  border: 1px solid #762424;
  border-radius: 7px;
}

.scramjet-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: #080808;
}
.scramjet-toolbar {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px;
  background: linear-gradient(180deg, #171010, #0a0a0a);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 4px 20px rgb(0 0 0 / 35%);
}
.scramjet-toolbar .address-form { flex: 1; margin: 0; }
.scramjet-toolbar .address-form > input { flex: 1; }
.scramjet-toolbar .address-form > button { flex: 0 0 auto; }
.scramjet-actions { display: flex; gap: 4px; }
.scramjet-actions button { min-width: 42px; }
.scramjet-frame { flex: 1; min-height: 0; width: 100%; border: 0; background: #fff; }
.scramjet-status {
  margin: 0;
  padding: 6px 12px;
  color: #c2baba;
  font-size: .85rem;
  background: #111;
  border-top: 1px solid var(--border);
}
.scramjet-status[hidden] { display: none; }
.scramjet-toolbar .logout-form { margin: 0; }

@media (max-width: 640px) {
  .card { padding: 25px 21px; }
  .remote-toolbar { flex-wrap: wrap; }
  .remote-home { flex-basis: 100%; }
  #remote-address-form { flex-basis: 100%; }
  .remote-viewport { height: calc(100vh - 132px); }
  .scramjet-toolbar { flex-wrap: wrap; }
  .scramjet-actions { order: 1; }
  .scramjet-toolbar .address-form { order: 2; flex-basis: 100%; }
  .scramjet-toolbar .logout-form { margin-left: auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}
