:root {
  color-scheme: dark;
  --bg: #05080d;
  --surface: rgba(7, 13, 22, 0.92);
  --surface-strong: #08111d;
  --line: rgba(118, 167, 205, 0.28);
  --line-bright: rgba(31, 202, 255, 0.56);
  --text: #f3f7fb;
  --muted: #8091a4;
  --cyan: #20c8ff;
  --green: #31df82;
  --violet: #9258ff;
  --radius: 8px;
  --mono: "Cascadia Code", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  background: var(--bg);
  font-family: var(--sans);
  letter-spacing: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

.scene,
.scene picture,
.scene-image {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.scene {
  z-index: 0;
  overflow: hidden;
}

.scene-image {
  object-fit: cover;
  object-position: center bottom;
  opacity: 0.58;
  filter: saturate(0.9) contrast(1.05);
}

.scene::before {
  position: absolute;
  z-index: 1;
  inset: 0;
  content: "";
  background:
    linear-gradient(90deg, rgba(2, 5, 10, 0.82) 0%, rgba(2, 5, 10, 0.32) 30%, rgba(2, 5, 10, 0.22) 70%, rgba(2, 5, 10, 0.78) 100%),
    linear-gradient(180deg, rgba(2, 5, 10, 0.5) 0%, rgba(2, 5, 10, 0.05) 52%, rgba(2, 5, 10, 0.88) 100%);
}

.scene::after {
  position: absolute;
  z-index: 2;
  inset: 0;
  content: "";
  background-image:
    linear-gradient(rgba(32, 200, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(32, 200, 255, 0.025) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(to bottom, black, transparent 78%);
}

.agent-console,
.signal-panel {
  position: absolute;
  z-index: 3;
  top: 30px;
  width: 330px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(4, 10, 18, 0.82);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.32);
  font-family: var(--mono);
  backdrop-filter: blur(10px);
}

.agent-console {
  left: 24px;
}

.signal-panel {
  right: 24px;
  width: 288px;
}

.console-head,
.signal-head {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  border-bottom: 1px solid rgba(118, 167, 205, 0.18);
  gap: 9px;
  color: var(--muted);
  font-size: 11px;
}

.console-head strong,
.signal-head strong {
  color: var(--cyan);
  font-size: 12px;
}

.status-light,
.signal-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 16px rgba(49, 223, 130, 0.7);
}

.codex-mark {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 1px solid rgba(32, 200, 255, 0.44);
  border-radius: 6px;
  color: var(--cyan);
  font-weight: 700;
}

.console-thread {
  display: grid;
  min-height: 112px;
  padding: 16px;
  gap: 12px;
}

.message {
  width: max-content;
  max-width: 78%;
  padding: 10px 12px;
  border: 1px solid rgba(118, 167, 205, 0.2);
  border-radius: 7px;
  color: #c8d4df;
  background: rgba(9, 16, 27, 0.76);
  font-size: 12px;
}

.message-user {
  justify-self: end;
  border-color: rgba(32, 200, 255, 0.42);
}

.message-agent {
  color: var(--muted);
}

.console-input {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
  margin: 0 16px 16px;
  padding: 0 12px;
  border: 1px solid rgba(32, 200, 255, 0.4);
  border-radius: 7px;
  color: #dce7f0;
  font-size: 12px;
}

.console-input i {
  width: 9px;
  height: 9px;
  border-top: 1px solid var(--cyan);
  border-right: 1px solid var(--cyan);
  transform: rotate(45deg);
}

.signal-head em {
  margin-left: auto;
  color: var(--green);
  font-style: normal;
}

.signal-stage {
  position: relative;
  height: 124px;
  margin: 12px;
  overflow: hidden;
  border: 1px solid rgba(118, 167, 205, 0.14);
  border-radius: 6px;
  background:
    linear-gradient(rgba(3, 8, 14, 0.3), rgba(3, 8, 14, 0.72)),
    url("assets/bg-ae-codex-v2.webp") 76% 18% / 620px auto;
}

.signal-core {
  display: none;
}

.signal-stage::before,
.signal-stage::after {
  display: none;
}

.signal-node {
  display: none;
}

.node-one { top: 28px; left: 57px; }
.node-two { right: 42px; bottom: 28px; color: var(--violet); background: currentColor; }
.node-three { top: 54px; right: 55px; color: var(--green); background: currentColor; }

.signal-bars {
  display: grid;
  padding: 0 12px;
  gap: 6px;
}

.signal-bars span {
  height: 5px;
  border-radius: 2px;
  background: rgba(118, 167, 205, 0.12);
}

.signal-bars span::before {
  display: block;
  width: var(--value);
  height: 100%;
  content: "";
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cyan), var(--violet));
}

.signal-tags {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 12px;
  gap: 6px;
}

.signal-tags span {
  padding: 7px 3px;
  border: 1px solid rgba(118, 167, 205, 0.15);
  border-radius: 5px;
  color: var(--muted);
  text-align: center;
  font-size: 8px;
}

.page-shell {
  position: relative;
  z-index: 5;
  display: grid;
  min-height: 100vh;
  place-items: start center;
  padding: 34px 24px 28px;
}

.profile {
  width: min(100%, 620px);
  text-align: center;
}

.avatar-wrap {
  position: relative;
  width: 174px;
  height: 174px;
  margin: 0 auto 18px;
  padding: 9px;
  border: 1px solid rgba(32, 200, 255, 0.48);
  border-radius: 50%;
  box-shadow: 0 0 0 12px rgba(32, 200, 255, 0.035), 0 18px 60px rgba(0, 0, 0, 0.42);
}

.avatar-wrap::after {
  position: absolute;
  inset: 4px;
  content: "";
  border: 2px solid var(--cyan);
  border-radius: 50%;
  pointer-events: none;
}

.avatar {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.corner {
  position: absolute;
  z-index: 2;
  width: 20px;
  height: 20px;
  border-color: #d9f5ff;
  pointer-events: none;
}

.corner-one {
  top: 27px;
  left: -23px;
  border-top: 1px solid;
  border-left: 1px solid;
}

.corner-two {
  right: -23px;
  bottom: 27px;
  border-right: 1px solid;
  border-bottom: 1px solid;
}

.identity {
  margin-bottom: 18px;
}

.site-label {
  margin: 0 0 5px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  color: #f7fbff;
  font-size: 58px;
  font-weight: 800;
  line-height: 1;
}

.handle {
  margin: 10px 0 0;
  color: var(--cyan);
  font-family: var(--mono);
  font-size: 21px;
  font-weight: 700;
}

.bio {
  margin: 14px 0 0;
  color: #e9eef3;
  font-size: 18px;
  font-weight: 650;
}

.links {
  display: grid;
  gap: 9px;
}

.link-card {
  position: relative;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 28px;
  align-items: center;
  min-height: 62px;
  padding: 8px 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(7, 13, 22, 0.9);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.16);
  text-align: left;
  transition: border-color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

.link-card::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 2px;
  content: "";
  background: var(--cyan);
  opacity: 0;
  transition: opacity 160ms ease;
}

.link-card:hover,
.link-card:focus-visible {
  border-color: var(--line-bright);
  background: rgba(8, 17, 29, 0.98);
  transform: translateY(-1px);
}

.link-card:hover::before,
.link-card:focus-visible::before {
  opacity: 1;
}

.link-card:focus-visible,
.footer a:focus-visible,
.privacy-actions button:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

.icon {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
}

.icon svg,
.arrow svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.icon svg {
  fill: currentColor;
  stroke: none;
}

.icon .cutout {
  fill: var(--surface-strong);
}

.icon-soundcloud svg path:last-child,
.icon-x svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.icon-tiktok { color: #1fe4e6; filter: drop-shadow(2px 1px 0 #ff2a68); }
.icon-youtube { color: #ff1744; }
.icon-twitch { color: #9147ff; }
.icon-soundcloud { color: #ff8700; }
.icon-x { color: #f6f8fa; }
.icon-telegram { color: #2aabee; }
.icon-patreon { color: #ff5c62; }

.link-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.link-copy strong {
  overflow: hidden;
  color: #f1f5f9;
  font-size: 17px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.link-copy small {
  overflow: hidden;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.arrow {
  display: grid;
  width: 23px;
  height: 23px;
  place-items: center;
  color: var(--cyan);
  transition: transform 160ms ease;
}

.arrow svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.link-card:hover .arrow,
.link-card:focus-visible .arrow {
  transform: translateX(2px);
}

.footer {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 18px;
  gap: 12px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
}

.footer a {
  color: #a9bac9;
  text-decoration: underline;
  text-decoration-color: rgba(32, 200, 255, 0.4);
  text-underline-offset: 3px;
}

.privacy-page {
  background:
    linear-gradient(rgba(4, 8, 13, 0.9), rgba(4, 8, 13, 0.98)),
    url("assets/bg-ae-codex-v2.webp") center / cover fixed;
}

.privacy-shell {
  width: min(100% - 32px, 760px);
  margin: 0 auto;
  padding: 64px 0 80px;
}

.privacy-shell > a {
  display: inline-block;
  margin-bottom: 28px;
  color: var(--cyan);
  font-family: var(--mono);
  font-size: 12px;
}

.privacy-shell h1 {
  margin-bottom: 14px;
  font-size: 46px;
}

.privacy-shell h2 {
  margin: 32px 0 10px;
  font-size: 19px;
}

.privacy-shell p,
.privacy-shell li {
  color: #b7c4d0;
  font-size: 15px;
  line-height: 1.7;
}

.privacy-shell ul {
  padding-left: 20px;
}

.privacy-control {
  margin: 28px 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.privacy-control p {
  margin: 0 0 14px;
}

.privacy-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.privacy-actions button {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line-bright);
  border-radius: 6px;
  color: var(--text);
  background: #0a1724;
  cursor: pointer;
}

.privacy-actions button.secondary {
  border-color: var(--line);
  color: #b7c4d0;
  background: transparent;
}

.privacy-status {
  margin-top: 12px !important;
  color: var(--green) !important;
  font-family: var(--mono);
  font-size: 12px !important;
}

@media (max-width: 1180px) {
  .agent-console { width: 280px; }
  .signal-panel { width: 250px; }
  .page-shell { padding-top: 30px; }
  .profile { width: min(100%, 570px); }
}

@media (max-width: 880px) {
  .agent-console,
  .signal-panel {
    display: none;
  }

  .scene-image {
    opacity: 0.38;
    object-position: center bottom;
  }

  .scene::before {
    background: rgba(2, 5, 10, 0.68);
  }

  .page-shell {
    padding: 26px 14px 22px;
  }

  .profile {
    width: min(100%, 560px);
  }

  .avatar-wrap {
    width: 150px;
    height: 150px;
  }

  h1 {
    font-size: 48px;
  }
}

@media (max-width: 520px) {
  .page-shell {
    padding-top: 24px;
  }

  .avatar-wrap {
    width: 138px;
    height: 138px;
    margin-bottom: 17px;
  }

  .corner-one { left: -16px; }
  .corner-two { right: -16px; }

  .site-label {
    font-size: 9px;
  }

  h1 {
    font-size: 39px;
  }

  .handle {
    margin-top: 8px;
    font-size: 16px;
  }

  .bio {
    margin-top: 13px;
    font-size: 16px;
  }

  .identity {
    margin-bottom: 16px;
  }

  .links {
    gap: 8px;
  }

  .link-card {
    grid-template-columns: 38px minmax(0, 1fr) 24px;
    min-height: 58px;
    padding: 7px 12px;
  }

  .icon {
    width: 27px;
    height: 27px;
  }

  .link-copy strong {
    font-size: 16px;
  }

  .link-copy small {
    display: none;
  }

  .footer {
    flex-wrap: wrap;
    margin-top: 16px;
  }

  .privacy-shell {
    padding-top: 36px;
  }

  .privacy-shell h1 {
    font-size: 36px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
