:root {
  color-scheme: dark;
  --bg: #0a0c0f;
  --panel: rgba(18, 21, 25, 0.92);
  --panel-soft: rgba(24, 28, 32, 0.76);
  --border: rgba(225, 235, 242, 0.11);
  --accent: #34b5cf;
  --accent-soft: #1d6777;
  --text: #eef2f6;
  --muted: #97a0aa;
  --success: #4abe7b;
  font-family: "Trebuchet MS", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

* { box-sizing: border-box; }

html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; }

body {
  position: relative;
  min-width: 320px;
  background:
    radial-gradient(circle at 74% 38%, rgba(52, 181, 207, 0.075), transparent 25%),
    radial-gradient(circle at 17% 76%, rgba(52, 181, 207, 0.035), transparent 28%),
    #0a0c0f;
}

body::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(0,0,0,.36), transparent 42%, rgba(0,0,0,.1));
  pointer-events: none;
}

.noise {
  position: absolute;
  inset: 0;
  opacity: .18;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.16'/%3E%3C/svg%3E");
}

.grid {
  position: absolute;
  inset: 0;
  opacity: .22;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: linear-gradient(to bottom, transparent, #000 20%, #000 76%, transparent);
}

.topbar {
  position: absolute;
  z-index: 3;
  top: 0;
  left: 0;
  right: 0;
  height: 86px;
  padding: 0 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  background: rgba(10, 12, 15, .68);
}

.brand { display: flex; align-items: center; gap: 14px; font-size: 16px; font-weight: 800; letter-spacing: .14em; }
.brand b { color: var(--accent); }
.brand-mark { width: 28px; height: 28px; position: relative; display: inline-block; transform: rotate(45deg); border: 2px solid var(--accent); }
.brand-mark i { position: absolute; display: block; background: var(--bg); }
.brand-mark i:first-child { width: 15px; height: 7px; top: -3px; left: 4px; }
.brand-mark i:last-child { width: 7px; height: 15px; right: -3px; bottom: 4px; }

.connection-state { color: var(--muted); display: flex; align-items: center; gap: 10px; font-size: 12px; font-weight: 700; letter-spacing: .15em; }
.pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 rgba(52,181,207,.5); animation: pulse 1.9s infinite; }

.scene { position: absolute; z-index: 2; inset: 86px 0 0; }

.hero { position: absolute; left: 8.4%; top: 18%; max-width: 660px; }
.eyebrow { color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .18em; margin-bottom: 30px; }
.eyebrow span { display: inline-block; color: var(--bg); background: var(--accent); padding: 5px 8px; margin-right: 10px; letter-spacing: .08em; }
.hero h1 { margin: 0; font-size: 64px; line-height: .98; letter-spacing: -.045em; text-transform: uppercase; }
.hero h1 em { color: var(--accent); font-style: normal; }
.hero p { margin: 27px 0 0; color: var(--muted); font-size: 16px; line-height: 1.65; }

.session-card {
  position: absolute;
  right: 8.4%;
  top: 15%;
  width: 350px;
  padding: 23px;
  background: var(--panel-soft);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 24px 70px rgba(0,0,0,.3);
  backdrop-filter: blur(12px);
}
.session-card::before { content: ""; position: absolute; width: 44px; height: 2px; top: -1px; left: 23px; background: var(--accent); }
.card-index { color: var(--accent); font-size: 11px; font-weight: 700; letter-spacing: .18em; margin-bottom: 22px; }
.session-card dl { margin: 0; }
.session-card dl div { display: flex; justify-content: space-between; gap: 20px; padding: 13px 0; border-top: 1px solid rgba(255,255,255,.055); }
.session-card dt { color: var(--muted); font-size: 13px; }
.session-card dd { margin: 0; max-width: 205px; color: var(--text); font-size: 14px; font-weight: 700; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-foot { display: flex; justify-content: space-between; align-items: flex-end; margin-top: 20px; color: var(--muted); font-size: 10px; letter-spacing: .12em; }
.signal { display: flex; align-items: flex-end; gap: 3px; height: 14px; }
.signal i { display: block; width: 3px; background: var(--accent); }
.signal i:nth-child(1) { height: 4px; }.signal i:nth-child(2) { height: 7px; }.signal i:nth-child(3) { height: 10px; }.signal i:nth-child(4) { height: 14px; }

.loader {
  position: absolute;
  z-index: 4;
  right: 48px;
  bottom: 69px;
  width: 580px;
  padding: 23px 26px 22px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: 0 20px 70px rgba(0,0,0,.42);
}
.loader::after { content: ""; position: absolute; right: -1px; bottom: 26px; height: 48px; width: 2px; background: var(--accent); }
.loader-heading { display: flex; justify-content: space-between; gap: 20px; align-items: flex-end; }
.step-code { display: block; margin-bottom: 5px; color: var(--accent); font-size: 11px; font-weight: 800; letter-spacing: .16em; }
.loader h2 { margin: 0; font-size: 20px; line-height: 1.25; }
.loader-heading strong { color: var(--text); font-size: 34px; line-height: 1; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.status-row { height: 34px; padding-top: 11px; display: flex; justify-content: space-between; gap: 18px; color: var(--muted); font-size: 12px; }
#statusText { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
#fileCounter { flex: 0 0 auto; color: var(--accent); font-variant-numeric: tabular-nums; }
.progress-track { position: relative; overflow: visible; height: 4px; margin-top: 9px; background: rgba(255,255,255,.08); }
.progress-fill { width: 8%; height: 100%; background: var(--accent); transition: width .45s cubic-bezier(.2,.8,.2,1); }
.progress-glow { position: absolute; top: -3px; left: 8%; width: 10px; height: 10px; border-radius: 50%; background: var(--text); box-shadow: 0 0 18px 5px rgba(52,181,207,.55); transform: translateX(-50%); transition: left .45s cubic-bezier(.2,.8,.2,1); }
.stages { list-style: none; margin: 18px 0 0; padding: 0; display: flex; justify-content: space-between; }
.stages li { display: flex; align-items: center; gap: 6px; color: #606a73; font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; transition: color .3s; }
.stages li span { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.stages li.done { color: var(--success); }
.stages li.active { color: var(--accent); }

.footer { position: absolute; z-index: 3; left: 48px; right: 48px; bottom: 0; height: 45px; display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--border); color: #626c75; font-size: 10px; font-weight: 700; letter-spacing: .12em; }

@keyframes pulse { 70% { box-shadow: 0 0 0 9px rgba(52,181,207,0); } 100% { box-shadow: 0 0 0 0 rgba(52,181,207,0); } }

@media (max-width: 980px), (max-height: 680px) {
  .topbar { height: 68px; padding: 0 26px; }
  .scene { inset: 68px 0 0; }
  .hero { left: 6%; top: 12%; }
  .hero h1 { font-size: 46px; }
  .session-card { right: 26px; top: 10%; width: 310px; }
  .loader { right: 26px; bottom: 56px; width: 520px; }
  .footer { left: 26px; right: 26px; }
}

@media (max-width: 760px) {
  .connection-state { display: none; }
  .hero { left: 24px; right: 24px; top: 8%; }
  .hero h1 { font-size: 36px; }
  .hero p { font-size: 14px; }
  .session-card { display: none; }
  .loader { left: 18px; right: 18px; width: auto; bottom: 58px; padding: 19px; }
  .loader-heading strong { font-size: 28px; }
  .stages li { font-size: 0; }
  .stages li span { width: 7px; height: 7px; }
  .footer { left: 18px; right: 18px; }
  .footer span:last-child { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
