@import url("https://fonts.googleapis.com/css2?family=Archivo:wdth,wght@112.5,600;112.5,800&family=IBM+Plex+Sans:wght@400;500&family=IBM+Plex+Mono:wght@500&display=swap");

:root {
  --steel: #e6ebf0;
  --plate: #f7f9fb;
  --ink: #16213a;
  --ink-2: #4a5670;
  --line: #c8d1dc;
  --brass: #c4a260;
  --brass-soft: #f1e6cc;
  --lamp: #2f9e6e;
  --danger: #b6403a;
  --display: "Archivo", system-ui, sans-serif;
  --body: "IBM Plex Sans", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--body);
  color: var(--ink);
  background: var(--steel);
  background-image: radial-gradient(circle at 1px 1px, rgba(22, 33, 58, 0.09) 1px, transparent 0);
  background-size: 22px 22px;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
:focus-visible { outline: 3px solid var(--brass); outline-offset: 3px; }

/* ---------- top bar ---------- */
.bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 28px; border-bottom: 1px solid var(--line);
  background: var(--plate);
}
.brand {
  font-family: var(--display); font-weight: 800; font-size: 18px;
  letter-spacing: 0.02em; text-transform: uppercase;
  display: flex; align-items: center; gap: 12px;
}
.brand .lamp { width: 10px; height: 10px; border-radius: 50%; background: var(--lamp); box-shadow: 0 0 0 4px rgba(47, 158, 110, 0.18); }
.who { font-size: 14px; color: var(--ink-2); display: flex; gap: 16px; align-items: center; }
.btn-quiet {
  font: 500 13px var(--body); color: var(--ink); background: transparent;
  border: 1px solid var(--line); border-radius: 6px; padding: 7px 12px; cursor: pointer;
}
.btn-quiet:hover { border-color: var(--ink); }

/* ---------- hub grid ---------- */
.wrap { max-width: 1180px; margin: 0 auto; padding: 44px 28px 80px; }
.head { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; margin-bottom: 26px; flex-wrap: wrap; }
h1 {
  font-family: var(--display); font-weight: 800; font-size: clamp(28px, 4vw, 44px);
  margin: 0; letter-spacing: -0.01em; line-height: 1;
}
.hint { font: 500 12px var(--mono); color: var(--ink-2); letter-spacing: 0.04em; text-transform: uppercase; }
.hint kbd {
  display: inline-block; min-width: 20px; padding: 1px 5px; text-align: center;
  border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; background: var(--plate);
  font: inherit;
}
.search {
  width: 100%; max-width: 360px; padding: 10px 12px; margin: 0 0 22px;
  font: 400 15px var(--body); color: var(--ink);
  border: 1px solid var(--line); border-radius: 6px; background: var(--plate);
}
.grid {
  display: grid; gap: 20px;
  grid-template-columns: repeat(auto-fill, minmax(min(400px, 100%), 1fr));
}

/* tile = a switch plate: logo, name, key, lamp */
.tile {
  position: relative; display: flex; flex-direction: column; gap: 20px;
  padding: 28px 28px 22px; min-height: 280px;
  background: var(--plate); border: 1px solid var(--line); border-radius: 10px;
  text-decoration: none; color: var(--ink);
  box-shadow: inset 0 1px 0 #fff, 0 1px 2px rgba(22, 33, 58, 0.06);
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}
.tile::after {
  content: ""; position: absolute; left: 20px; right: 20px; bottom: 0; height: 3px;
  background: var(--tile-color, var(--brass)); border-radius: 3px 3px 0 0;
  transform: scaleX(0.28); transform-origin: left; transition: transform 200ms ease;
}
.tile:hover, .tile:focus-visible { transform: translateY(-2px); border-color: var(--ink-2); box-shadow: 0 8px 20px rgba(22, 33, 58, 0.12); }
.tile:hover::after, .tile:focus-visible::after { transform: scaleX(1); }
.tile.hidden { display: none; }

.logo-box {
  height: 130px; padding: 10px 14px; display: flex; align-items: center; justify-content: center;
  background: var(--logo-bg, transparent); border-radius: 10px;
}
.logo-box img { max-height: 112px; max-width: 300px; object-fit: contain; }
.monogram {
  width: 56px; height: 56px; border-radius: 8px; display: grid; place-items: center;
  background: var(--tile-color, var(--ink)); color: #fff;
  font: 800 20px var(--display); letter-spacing: 0.02em;
}
.tile-name { font-family: var(--display); font-weight: 700; font-size: 24px; line-height: 1.2; }
.tile-sub { font-size: 14px; color: var(--ink-2); margin-top: 4px; }
.tile-foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; }
.key {
  font: 500 12px var(--mono); color: var(--ink-2);
  border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px;
  min-width: 22px; text-align: center; padding: 1px 6px;
}
.open { font: 500 12px var(--mono); color: var(--ink-2); text-transform: uppercase; letter-spacing: 0.06em; }
.tile:hover .open { color: var(--ink); }
.tile-foot .ghl {
  font: 600 11px var(--mono); color: var(--ink-2); text-decoration: none;
  border: 1px solid var(--line); border-radius: 5px; padding: 2px 7px; margin-left: auto; margin-right: 8px;
}
.tile-foot .ghl:hover { border-color: var(--tile-color, var(--brass)); color: var(--ink); }

.empty {
  padding: 40px; text-align: center; color: var(--ink-2);
  border: 1px dashed var(--line); border-radius: 10px; background: var(--plate);
}

/* ---------- login ---------- */
.login-wrap { min-height: 100%; display: grid; place-items: center; padding: 24px; }
.card {
  width: 100%; max-width: 400px; background: var(--plate);
  border: 1px solid var(--line); border-radius: 12px; padding: 32px 30px 28px;
  box-shadow: 0 12px 34px rgba(22, 33, 58, 0.12);
}
.card h1 { font-size: 26px; margin-bottom: 6px; }
.card p { margin: 0 0 22px; color: var(--ink-2); font-size: 14px; }
label { display: block; font: 500 12px var(--mono); text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-2); margin: 14px 0 6px; }
input[type="text"], input[type="password"] {
  width: 100%; padding: 11px 12px; font: 400 15px var(--body); color: var(--ink);
  border: 1px solid var(--line); border-radius: 6px; background: #fff;
}
.btn {
  width: 100%; margin-top: 22px; padding: 12px; cursor: pointer;
  font: 700 15px var(--display); letter-spacing: 0.02em; color: #fff;
  background: var(--ink); border: 0; border-radius: 6px;
}
.btn:hover { background: #0e1730; }
.btn[disabled] { opacity: 0.6; cursor: wait; }
.error { margin-top: 14px; color: var(--danger); font-size: 14px; min-height: 18px; }

@media (max-width: 560px) {
  .bar { padding: 14px 18px; }
  .wrap { padding: 28px 18px 60px; }
  .hint { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .tile, .tile::after { transition: none; }
}
