@font-face {
  font-family: "Cairo";
  src: url("/static/fonts/cairo-latin-ext.woff2") format("woff2");
  font-weight: 200 1000;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Cairo";
  src: url("/static/fonts/cairo-latin.woff2") format("woff2");
  font-weight: 200 1000;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --ink: #09101B;
  --ink-2: #131C2B;
  --ink-3: #1E2A3C;
  --green: #4FF7A8;
  --green-deep: #0E7A4C;
  --paper: #F4F6F5;
  --text: #E8ECF1;
  --muted: #9AA6B6;
  --warn: #F5B83D;
  --bad: #FF6B6B;
  --radius-bubble: 14px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font: 400 17px/1.55 "Cairo", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  min-height: 100vh;
}

.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: clamp(28px, 6vw, 72px) clamp(18px, 4vw, 40px);
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: clamp(32px, 6vw, 80px);
  align-items: start;
}

.logo { display: block; height: 22px; width: auto; margin-bottom: clamp(40px, 7vw, 72px); }

h1 {
  font-weight: 800;
  font-size: clamp(34px, 5.2vw, 56px);
  line-height: 1.04;
  letter-spacing: -0.02em;
  margin: 0 0 22px;
  max-width: 14ch;
}

.lede { font-size: 19px; color: var(--text); margin: 0 0 28px; max-width: 46ch; }

.facts { list-style: none; padding: 0; margin: 0 0 36px; max-width: 52ch; }
.facts li { padding: 14px 0 14px 22px; border-top: 1px solid var(--ink-3); color: var(--muted); position: relative; }
.facts li::before { content: ""; position: absolute; left: 0; top: 24px; width: 10px; height: 2px; background: var(--green); }
.facts strong { color: var(--text); font-weight: 700; }

.connect {
  display: inline-flex; align-items: center; gap: 12px;
  font: inherit; font-weight: 700; font-size: 18px;
  color: var(--ink); background: var(--green);
  border: 0; border-radius: 12px;
  padding: 16px 26px 16px 22px;
  cursor: pointer;
  transition: transform .12s ease, background-color .12s ease;
}
.connect:hover:not(:disabled) { background: #7DFAC0; }
.connect:active:not(:disabled) { transform: translateY(1px); }
.connect:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.connect:disabled { opacity: .55; cursor: progress; }

.fine { color: var(--muted); font-size: 15px; margin-top: 18px; }
.fine a { color: var(--text); }

/* The status panel reads like a WhatsApp chat: each backend step arrives as a message. */
.thread {
  background: var(--ink-2);
  border: 1px solid var(--ink-3);
  border-radius: 22px;
  overflow: hidden;
  position: sticky;
  top: 24px;
}
.thread-head { display: flex; align-items: center; gap: 14px; padding: 16px 20px; background: var(--ink-3); }
.avatar { width: 42px; height: 42px; border-radius: 50%; background: var(--ink); display: grid; place-items: center; overflow: hidden; }
.avatar img { width: 26px; height: auto; object-fit: cover; object-position: left; aspect-ratio: 1; }
.thread-head h2 { font-size: 17px; margin: 0; font-weight: 700; line-height: 1.2; }
.thread-head p { margin: 0; font-size: 14px; color: var(--muted); }

.log {
  list-style: none; margin: 0; padding: 22px 18px 26px;
  display: flex; flex-direction: column; gap: 10px;
  min-height: 380px; max-height: 70vh; overflow-y: auto;
  background-image: radial-gradient(rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 18px 18px;
}
.msg {
  max-width: 88%;
  padding: 10px 14px 12px;
  border-radius: var(--radius-bubble);
  font-size: 16px; line-height: 1.45;
  background: var(--ink-3);
  color: var(--text);
  border-top-left-radius: 4px;
  animation: arrive .22s ease-out;
}
.msg.out { align-self: flex-end; background: var(--green); color: var(--ink); border-top-left-radius: var(--radius-bubble); border-top-right-radius: 4px; }
.msg.warn { box-shadow: inset 3px 0 0 var(--warn); }
.msg.bad { box-shadow: inset 3px 0 0 var(--bad); }
.msg.done { box-shadow: inset 3px 0 0 var(--green); }
.msg small { display: block; color: var(--muted); font-size: 13px; margin-top: 6px; overflow-wrap: anywhere; }
.msg .bar { display: block; height: 4px; border-radius: 2px; background: var(--ink); margin-top: 10px; overflow: hidden; }
.msg .bar i { display: block; height: 100%; background: var(--green); width: 0; transition: width .4s ease; }
.typing { align-self: flex-start; display: inline-flex; gap: 4px; padding: 12px 14px; background: var(--ink-3); border-radius: var(--radius-bubble); border-top-left-radius: 4px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; }
.typing i:nth-child(3) { animation-delay: .4s; }

@keyframes arrive { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .msg, .typing i { animation: none; }
  .connect, .msg .bar i { transition: none; }
}

@media (max-width: 860px) {
  .wrap { grid-template-columns: 1fr; }
  .thread { position: static; }
  .log { min-height: 240px; }
  .logo { margin-bottom: 36px; }
}

.noscript { text-align: center; padding: 16px; background: var(--warn); color: var(--ink); margin: 0; }
