:root {
  --bg: #07100e;
  --panel: rgba(13, 29, 25, 0.76);
  --panel-solid: #0d1d19;
  --line: rgba(190, 234, 218, 0.13);
  --line-strong: rgba(190, 234, 218, 0.25);
  --text: #edf7f2;
  --muted: #8da69c;
  --green: #61e6a6;
  --green-soft: rgba(97, 230, 166, 0.13);
  --amber: #f5c76d;
  --red: #ff7d78;
  --shadow: 0 26px 80px rgba(0, 0, 0, 0.3);
  --radius: 22px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

html { min-height: 100%; background: var(--bg); }

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 50% -20%, rgba(45, 124, 91, 0.2), transparent 42%),
    linear-gradient(180deg, #08130f 0%, var(--bg) 48%, #050b09 100%);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.18;
  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='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.12'/%3E%3C/svg%3E");
}

.ambient {
  position: fixed;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  filter: blur(110px);
  opacity: 0.08;
  pointer-events: none;
}
.ambient-one { background: var(--green); top: 20%; left: -260px; }
.ambient-two { background: #46b4cb; bottom: -280px; right: -180px; }

.site-header,
main,
footer {
  position: relative;
  width: min(1120px, calc(100% - 40px));
  margin-inline: auto;
}

.site-header {
  height: 86px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.brand {
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-size: 18px;
  font-weight: 720;
  letter-spacing: -0.03em;
}
.brand-accent { color: var(--green); }
.brand-mark { width: 27px; height: 22px; position: relative; display: inline-block; }
.brand-mark span {
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 18px rgba(97, 230, 166, 0.5);
}
.brand-mark span:nth-child(1) { left: 0; top: 8px; }
.brand-mark span:nth-child(2) { left: 10px; top: 0; }
.brand-mark span:nth-child(3) { right: 0; bottom: 0; }
.brand-mark::before,
.brand-mark::after {
  content: "";
  position: absolute;
  width: 13px;
  height: 1px;
  background: var(--green);
  transform-origin: left;
  opacity: 0.8;
}
.brand-mark::before { left: 5px; top: 10px; transform: rotate(-38deg); }
.brand-mark::after { left: 14px; top: 6px; transform: rotate(49deg); }

.signal-status {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 34px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(5, 13, 10, 0.55);
  font-size: 12px;
}
.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 0 4px rgba(245, 199, 109, 0.09);
}
.signal-status.is-online .status-dot { background: var(--green); box-shadow: 0 0 0 4px var(--green-soft), 0 0 12px rgba(97, 230, 166, 0.6); }
.signal-status.is-error .status-dot { background: var(--red); box-shadow: 0 0 0 4px rgba(255, 125, 120, 0.1); }

main { padding: 92px 0 48px; }
.hero { max-width: 810px; }
.eyebrow,
.section-kicker {
  color: var(--green);
  font-size: 11px;
  letter-spacing: 0.19em;
  font-weight: 700;
}
.eyebrow { display: flex; align-items: center; gap: 10px; margin: 0 0 23px; }
.eyebrow span { width: 30px; height: 1px; background: var(--green); }
.hero h1 {
  margin: 0;
  max-width: 790px;
  font-size: clamp(48px, 8vw, 88px);
  line-height: 0.98;
  letter-spacing: -0.065em;
  font-weight: 620;
}
.hero h1 em { color: var(--green); font-style: normal; }
.hero-copy {
  max-width: 650px;
  margin: 31px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.8;
}

.route {
  width: min(620px, 100%);
  margin-top: 38px;
  display: grid;
  grid-template-columns: auto minmax(35px, 1fr) auto minmax(35px, 1fr) auto;
  align-items: center;
  gap: 12px;
  color: #aac0b7;
  font-size: 11px;
}
.route-line { height: 1px; background: var(--line-strong); position: relative; overflow: visible; }
.route-line i {
  width: 5px;
  height: 5px;
  position: absolute;
  top: -2px;
  left: 0;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px var(--green);
  animation: travel 2.4s ease-in-out infinite;
}
.route-line:nth-of-type(4) i { animation-delay: 1.2s; }
@keyframes travel { 0%, 12% { left: 0; opacity: 0; } 25% { opacity: 1; } 80% { opacity: 1; } 100% { left: calc(100% - 5px); opacity: 0; } }

.devices-section { margin-top: 100px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; margin-bottom: 22px; }
.section-kicker { margin: 0 0 7px; }
.section-heading h2 { margin: 0; font-size: 28px; letter-spacing: -0.04em; }
.icon-button {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--muted);
  background: rgba(13, 29, 25, 0.6);
  cursor: pointer;
  transition: 160ms ease;
}
.icon-button:hover { border-color: var(--line-strong); color: var(--text); transform: translateY(-1px); }
.icon-button svg,
.note-icon svg,
.lock-mark svg,
.bar-icon svg { width: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.device-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.device-card {
  min-height: 228px;
  padding: 26px;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(15, 34, 29, 0.86), rgba(8, 20, 16, 0.72));
  box-shadow: var(--shadow);
  transition: 180ms ease;
}
.device-card.is-online:hover { border-color: rgba(97, 230, 166, 0.33); transform: translateY(-2px); }
.device-card::after {
  content: "";
  width: 150px;
  height: 150px;
  position: absolute;
  right: -75px;
  top: -75px;
  border-radius: 50%;
  background: var(--green);
  filter: blur(70px);
  opacity: 0;
  transition: 180ms ease;
}
.device-card.is-online::after { opacity: 0.08; }
.device-top { display: flex; justify-content: space-between; align-items: start; }
.device-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 15px;
  color: var(--muted);
  background: rgba(2, 10, 7, 0.32);
}
.device-icon svg { width: 25px; fill: none; stroke: currentColor; stroke-width: 1.45; stroke-linecap: round; stroke-linejoin: round; }
.is-online .device-icon { color: var(--green); border-color: rgba(97, 230, 166, 0.2); background: var(--green-soft); }
.device-badge {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  color: var(--muted);
  font-size: 11px;
}
.device-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #53665e; }
.is-online .device-badge { color: var(--green); }
.is-online .device-badge::before { background: var(--green); box-shadow: 0 0 9px rgba(97, 230, 166, 0.7); }
.is-unhealthy .device-badge { color: var(--amber); }
.is-unhealthy .device-badge::before { background: var(--amber); }
.device-card h3 { margin: 23px 0 8px; font-size: 20px; letter-spacing: -0.025em; }
.device-description { min-height: 42px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.device-action-row { margin-top: 21px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.device-detail { max-width: 55%; color: #71887e; font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.connect-button {
  min-width: 116px;
  height: 40px;
  border: 1px solid rgba(97, 230, 166, 0.38);
  border-radius: 12px;
  color: #06130e;
  background: var(--green);
  font-weight: 720;
  cursor: pointer;
  transition: 160ms ease;
}
.connect-button:hover { background: #7af0b9; transform: translateY(-1px); box-shadow: 0 8px 24px rgba(97, 230, 166, 0.15); }
.connect-button:disabled { color: #6c7f77; background: rgba(140, 166, 155, 0.08); border-color: var(--line); cursor: not-allowed; box-shadow: none; transform: none; }

.empty-card { grid-column: 1 / -1; min-height: 180px; display: grid; place-items: center; text-align: center; color: var(--muted); }
.skeleton { border-radius: 10px; background: linear-gradient(90deg, rgba(255,255,255,.03), rgba(255,255,255,.075), rgba(255,255,255,.03)); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
.skeleton-icon { width: 48px; height: 48px; }
.skeleton-title { width: 42%; height: 20px; margin-top: 28px; }
.skeleton-line { width: 72%; height: 12px; margin-top: 14px; }
@keyframes shimmer { to { background-position: -200% 0; } }

.privacy-note {
  margin-top: 32px;
  display: flex;
  gap: 16px;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: rgba(6, 16, 12, 0.42);
}
.note-icon { flex: 0 0 auto; width: 34px; height: 34px; display: grid; place-items: center; color: var(--green); }
.privacy-note h2 { margin: 1px 0 5px; font-size: 13px; }
.privacy-note p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.65; }

.viewer {
  margin-top: 46px;
  border: 1px solid var(--line-strong);
  border-radius: 24px;
  overflow: hidden;
  background: #091510;
  box-shadow: var(--shadow);
}
.viewer-header { min-height: 72px; padding: 12px 18px 12px 22px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.viewer-title-group { display: flex; align-items: center; gap: 13px; }
.viewer-title-group p { margin: 0 0 3px; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .1em; }
.viewer-title-group h2 { margin: 0; font-size: 16px; }
.viewer-state-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 5px rgba(245, 199, 109, .09); }
.viewer.is-direct .viewer-state-dot { background: var(--green); box-shadow: 0 0 0 5px var(--green-soft), 0 0 14px rgba(97, 230, 166, .5); }
.viewer.is-error .viewer-state-dot { background: var(--red); box-shadow: 0 0 0 5px rgba(255, 125, 120, .09); }
.browser-bar { min-height: 56px; display: flex; align-items: center; gap: 9px; padding: 9px 14px; border-bottom: 1px solid var(--line); background: rgba(3, 10, 7, .5); }
.lock-mark { color: var(--green); display: grid; place-items: center; padding: 0 4px; }
.lock-mark svg { width: 16px; }
.browser-bar input { flex: 1; min-width: 0; height: 36px; padding: 0 13px; border: 1px solid var(--line); border-radius: 10px; outline: none; color: #cfe0d9; background: rgba(255,255,255,.025); font: 12px ui-monospace, SFMono-Regular, Menlo, monospace; }
.browser-bar input:focus { border-color: rgba(97, 230, 166, .4); box-shadow: 0 0 0 3px rgba(97, 230, 166, .06); }
.browser-bar button { height: 36px; padding: 0 15px; border: 1px solid var(--line); border-radius: 10px; color: var(--text); background: rgba(255,255,255,.05); cursor: pointer; }
.browser-bar .bar-icon { width: 36px; padding: 0; display: grid; place-items: center; color: var(--muted); }
.bar-icon svg { width: 17px; }
.connection-progress { height: 520px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--muted); }
.connection-progress p { margin: 20px 0 7px; color: var(--text); font-size: 15px; }
.connection-progress span { font-size: 12px; }
.progress-spinner { width: 34px; height: 34px; border: 2px solid var(--line-strong); border-top-color: var(--green); border-radius: 50%; animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
#remote-frame { width: 100%; height: min(72vh, 820px); min-height: 520px; border: 0; background: #fff; }

footer { min-height: 100px; display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); color: #5f746b; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.toast-region { position: fixed; z-index: 50; right: 20px; bottom: 20px; display: grid; gap: 10px; }
.toast { max-width: min(390px, calc(100vw - 40px)); padding: 13px 16px; border: 1px solid var(--line-strong); border-radius: 12px; color: var(--text); background: #13241e; box-shadow: var(--shadow); font-size: 12px; animation: toast-in 180ms ease; }
.toast.error { border-color: rgba(255, 125, 120, .3); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }

@media (max-width: 760px) {
  .site-header, main, footer { width: min(100% - 28px, 1120px); }
  main { padding-top: 66px; }
  .hero h1 { font-size: clamp(45px, 15vw, 70px); }
  .route { grid-template-columns: auto 1fr auto 1fr auto; gap: 7px; font-size: 9px; }
  .devices-section { margin-top: 76px; }
  .device-grid { grid-template-columns: 1fr; }
  .viewer { margin-inline: -7px; border-radius: 18px; }
  .browser-bar button[type="submit"] { display: none; }
  #remote-frame, .connection-progress { min-height: 560px; height: 72vh; }
  footer { gap: 12px; flex-wrap: wrap; padding: 24px 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}
