/* coreys.cloud: the homepage and the one sign-in. One dark theme, phone first. */

@font-face { font-family: 'IBM Plex Mono'; font-weight: 400; font-display: swap; src: url(fonts/plex-mono-400.woff2) format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-weight: 600; font-display: swap; src: url(fonts/plex-mono-600.woff2) format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 100 700; font-display: swap; src: url(fonts/plex-sans.woff2) format('woff2'); }

:root {
  color-scheme: dark;
  --bg: #101318;
  --panel: #181c23;
  --line: #2a313b;
  --line-2: #3a4450;
  --text: #e9edf1;
  --muted: #9aa5b1;
  --accent: #5b9dff;
  --danger: #ff7a6b;
  --ink: #101318;
  --mono: 'IBM Plex Mono', ui-monospace, Menlo, monospace;
  --sans: 'IBM Plex Sans', system-ui, -apple-system, sans-serif;
  --radius: 10px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 16px/1.5 var(--sans); min-height: 100dvh; }
h1, h2, h3, p { margin: 0; }
button, input { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.eyebrow { font: 500 11px/1.3 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }

.wrap {
  max-width: 640px; margin: 0 auto; display: flex; flex-direction: column; gap: 28px;
  padding: calc(28px + env(safe-area-inset-top)) 16px calc(48px + env(safe-area-inset-bottom));
}
.notice { color: #f5a524; font: 500 13px/1.4 var(--mono); }
.head { display: flex; align-items: center; gap: 14px; }
.head-mark { border-radius: 10px; flex: none; }
.head h1 { font-size: 26px; font-weight: 600; line-height: 1.15; }

.tiles { list-style: none; margin: 12px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 12px; }
.tile {
  display: grid; grid-template-columns: 52px minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 14px; row-gap: 10px;
  padding: 16px; min-height: 44px; border-radius: var(--radius);
  background: var(--panel); border: 1px solid var(--line); color: var(--text); text-decoration: none;
  transition: border-color .15s, transform .15s;
}
.tile:hover { border-color: var(--line-2); }
.tile:active { transform: translateY(1px); }
.tile:focus-visible, .btn:focus-visible, .input:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.tile img { border-radius: 12px; }
.tile-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tile-name { font-size: 18px; font-weight: 600; }
.tile-about { font-size: 14px; color: var(--muted); }
.tile-host { grid-column: 1 / -1; font: 400 12px/1.3 var(--mono); color: var(--muted); border-top: 1px solid var(--line); padding-top: 10px; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 16px; display: flex; flex-direction: column; gap: 14px; }
.panel h2 { font-size: 18px; font-weight: 600; }
.panel h3 { font-size: 15px; font-weight: 600; margin-top: 4px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn {
  min-height: 44px; padding: 10px 16px; border-radius: 8px; border: 1px solid var(--line-2);
  background: transparent; color: var(--text); font-size: 15px; font-weight: 500; cursor: pointer;
}
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--ink); font-weight: 600; width: 100%; min-height: 50px; }
.btn.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 50%, var(--line)); }
.btn.armed { background: var(--danger); color: var(--ink); border-color: var(--danger); }
.btn:disabled { opacity: .55; cursor: default; }
.input { width: 100%; min-height: 44px; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--bg); color: var(--text); font-size: 16px; }
.passkey { display: flex; flex-direction: column; gap: 6px; padding-top: 12px; border-top: 1px solid var(--line); }
.passkey-row { display: flex; gap: 8px; }
.passkey small { color: var(--muted); font-size: 12px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); text-align: left; }

.toasts { position: fixed; left: 0; right: 0; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 40; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 0 12px; pointer-events: none; }
.toast { max-width: 560px; width: 100%; padding: 12px 14px; border-radius: 8px; border: 1px solid var(--line-2); background: #20262f; font-size: 14px; box-shadow: 0 8px 24px rgba(0, 0, 0, .45); }
.toast.error { border-color: var(--danger); }

.login-body { display: grid; place-items: center; padding: 24px 16px; }
.login-card { width: min(420px, 100%); display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; padding: 28px 20px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; }
.login-card h1 { font-size: 24px; font-weight: 600; }
.login-mark { border-radius: 16px; }
.login-card form { width: 100%; display: flex; flex-direction: column; gap: 12px; margin-top: 4px; }
.error { color: var(--danger); font-size: 14px; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
