:root {
  --bg: #08070d;
  --panel: rgba(12, 12, 20, 0.86);
  --panel-hover: rgba(21, 18, 32, 0.95);
  --border: #3e3853;
  --border-soft: rgba(164, 140, 255, 0.25);
  --violet: #a48cff;
  --violet-bright: #d2c7ff;
  --violet-dim: #7460ca;
  --text: #e9e6f3;
  --text-soft: #b9b4c9;
  --muted: #7f7a90;
  --danger: #ff7a9c;
  --gap: 14px;
  --radius: 9px;
  --bar-height: 38px;
  --status-height: 32px;
  color-scheme: dark;
  font-family: "Cascadia Code", "Fira Code", "IBM Plex Mono", "Liberation Mono", Consolas, monospace;
}

* {
  box-sizing: border-box;
}

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

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background: radial-gradient(circle at 15% 12%,rgba(115,103,255,.13),transparent 34rem), radial-gradient(circle at 82% 65%,rgba(164,140,255,.10),transparent 30rem), linear-gradient(rgba(255,255,255,.015) 1px,transparent 1px), linear-gradient(90deg,rgba(255,255,255,.015) 1px,transparent 1px),var(--bg);
  background-size: auto,auto,28px 28px,28px 28px,auto;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -3;
  pointer-events: none;
  opacity: .22;
  background: linear-gradient(120deg,transparent 0 38%,rgba(164,140,255,.06) 38% 39%,transparent 39% 100%), repeating-linear-gradient(165deg,transparent 0 42px,rgba(255,255,255,.018) 42px 43px);
}

a {
  color: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button,
input,
textarea {
  font: inherit;
}

button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--violet-bright);
  outline-offset: 3px;
}

code,
kbd {
  font-family: inherit;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 1000;
  padding: 8px 10px;
  color: #08070d;
  background: var(--violet-bright);
  transform: translateY(-140%);
}

.skip-link:focus {
  transform: translateY(0);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.ambient {
  position: fixed;
  z-index: -2;
  width: 34rem;
  height: 34rem;
  border-radius: 999px;
  filter: blur(110px);
  opacity: .12;
  pointer-events: none;
}

.ambient-one {
  top: 4rem;
  left: -12rem;
  background: #7367ff;
}

.ambient-two {
  right: -12rem;
  bottom: 2rem;
  background: var(--violet);
}

.waybar {
  position: sticky;
  top: 0;
  z-index: 100;
  min-height: var(--bar-height);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 5px 10px;
  color: var(--text-soft);
  background: rgba(8,7,13,.92);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 8px 30px rgba(0,0,0,.28);
  backdrop-filter: blur(18px);
}

.workspaces {
  display: flex;
  align-items: center;
  gap: 5px;
}

.workspace-button {
  min-width: 30px;
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 4px 8px;
  color: var(--text-soft);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 7px;
  cursor: pointer;
  transition: .13s ease;
}

.workspace-button:hover {
  color: var(--violet-bright);
  background: rgba(164,140,255,.08);
}

.workspace-button.is-active {
  color: #0b0911;
  background: var(--violet);
  border-color: var(--violet-bright);
  box-shadow: 0 0 18px rgba(164,140,255,.24);
}

.workspace-button span {
  font-weight: 800;
}

.workspace-button small {
  font-size: .78rem;
}

.workspace-button:active {
  transform: translateY(1px);
}

.waybar-center,
.waybar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .82rem;
}

.waybar-center {
  justify-content: center;
  color: var(--text);
}

.waybar-right {
  justify-content: flex-end;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--muted);
  box-shadow: 0 0 10px currentColor;
}

.status-dot.is-live {
  color: var(--danger);
  background: var(--danger);
}

.desktop {
  width: min(1480px,100%);
  min-height: calc(100vh - var(--bar-height) - var(--status-height));
  margin: 0 auto;
  padding: var(--gap);
}

.workspace[hidden] {
  display: none !important;
}

.workspace.is-active {
  animation: workspace-enter .18s ease-out;
}

@keyframes workspace-enter {
  from {
    opacity: 0;
    transform: translateY(4px) scale(.998);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.tile-grid {
  display: grid;
  gap: var(--gap);
  align-items: stretch;
}

.home-grid {
  grid-template-columns: minmax(0,1.15fr) minmax(340px,.85fr);
  grid-template-areas: "profile terminal" "stream media";
}

.profile-window {
  grid-area: profile;
}

.terminal-window {
  grid-area: terminal;
}

.stream-monitor {
  grid-area: stream;
}

.now-playing {
  grid-area: media;
}

.stream-grid {
  grid-template-columns: 1.25fr .75fr;
}

.hero-window {
  grid-row: span 2;
}

.project-grid {
  grid-template-columns: repeat(2,minmax(0,1fr));
}

.links-grid {
  grid-template-columns: minmax(0,1.3fr) minmax(300px,.7fr);
}

.links-window {
  grid-row: span 2;
}

.window {
  position: relative;
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 18px 45px rgba(0,0,0,.26),inset 0 1px rgba(255,255,255,.025);
  backdrop-filter: blur(15px);
  transition: .14s ease;
}

.window::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  border-radius: inherit;
  background: linear-gradient(120deg,rgba(255,255,255,.022),transparent 28% 72%,rgba(164,140,255,.025));
}

.window:hover {
  background: var(--panel-hover);
  border-color: rgba(164,140,255,.25);
  box-shadow: 0 20px 55px rgba(0,0,0,.31),0 0 0 1px rgba(164,140,255,.08);
}

.focus-window {
  border-color: var(--violet-dim);
  box-shadow: 0 20px 58px rgba(0,0,0,.34),0 0 0 1px rgba(164,140,255,.12),0 0 32px rgba(115,103,255,.08);
}

.window-titlebar {
  position: relative;
  z-index: 6;
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 9px;
  color: var(--text-soft);
  background: linear-gradient(90deg,rgba(164,140,255,.07),transparent 40%),rgba(7,7,12,.72);
  border-bottom: 1px solid var(--border);
  font-size: .78rem;
}

.focus-window .window-titlebar {
  color: var(--violet-bright);
  border-bottom-color: var(--violet-dim);
}

.window-titlebar span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.window-titlebar span:last-child {
  flex: 0 0 auto;
  color: var(--muted);
  letter-spacing: .22em;
}

.window-content {
  position: relative;
  z-index: 5;
  padding: clamp(16px,2vw,26px);
}

.profile-content {
  min-height: 300px;
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: clamp(18px,3vw,34px);
  align-items: center;
}

.avatar {
  width: min(100%,170px);
  aspect-ratio: 1;
  object-fit: cover;
  background: #090810;
  border: 1px solid var(--violet-dim);
  border-radius: 12px;
  box-shadow: 0 0 0 5px rgba(164,140,255,.06),0 18px 38px rgba(0,0,0,.32);
}

.identity h2,
.hero-panel h2,
.media-card h2,
.project-card h2 {
  margin: 0;
  color: var(--violet-bright);
  line-height: 1.05;
}

.identity h2 {
  margin-top: 5px;
  font-size: clamp(2rem,5vw,4.25rem);
  letter-spacing: -.055em;
}

.eyebrow,
.label {
  margin: 0;
  color: var(--violet);
  font-size: .73rem;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.handle {
  margin: 7px 0 15px;
  color: var(--text-soft);
}

.lead {
  max-width: 62ch;
  margin: 0;
  color: var(--text);
  font-size: clamp(1rem,1.5vw,1.16rem);
  line-height: 1.65;
}

.quick-actions,
.platform-row {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 22px;
}

.button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  color: var(--violet-bright);
  background: rgba(164,140,255,.055);
  border: 1px solid rgba(164,140,255,.25);
  border-radius: 7px;
  text-decoration: none;
  transition: .13s ease;
}

.button:hover {
  color: #fff;
  background: rgba(164,140,255,.12);
  border-color: var(--violet);
}

.button:active {
  transform: translateY(1px);
}

.button.primary {
  color: #0a0810;
  background: var(--violet);
  border-color: var(--violet-bright);
  font-weight: 800;
}

.button.primary:hover {
  background: var(--violet-bright);
}

.full-width {
  width: 100%;
}

.text-link {
  color: var(--violet);
  text-decoration: none;
}

.text-link:hover {
  color: var(--violet-bright);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.terminal {
  min-height: 300px;
  color: var(--text-soft);
  background: repeating-linear-gradient(to bottom,transparent 0 3px,rgba(255,255,255,.014) 3px 4px),rgba(3,3,6,.52);
  font-size: .88rem;
  line-height: 1.55;
}

.terminal p {
  margin: 0 0 12px;
}

.terminal b {
  color: var(--violet-bright);
}

.terminal i {
  color: #7367ff;
  font-style: normal;
}

.terminal-output {
  margin: -5px 0 17px 16px;
  color: var(--text);
}

.terminal-status {
  display: grid;
  grid-template-columns: 86px 1fr;
  gap: 5px 12px;
  margin: -5px 0 17px 16px;
}

.terminal-status dt {
  color: var(--violet);
  font-weight: 800;
}

.terminal-status dd {
  margin: 0;
  color: var(--text);
}

.cursor {
  color: var(--violet-bright);
  animation: blink 1s steps(1) infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

.stream-state {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}

.large-status-dot {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--muted);
  box-shadow: 0 0 22px rgba(127,122,144,.34);
}

.large-status-dot.is-live {
  background: var(--danger);
  box-shadow: 0 0 28px rgba(255,122,156,.48);
}

.stream-state-text {
  margin: 3px 0 0;
  color: var(--text);
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: .03em;
}

.stat-list {
  margin: 0 0 20px;
}

.stat-list>div {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 12px;
  padding: 8px 0;
  border-top: 1px solid rgba(255,255,255,.05);
}

.stat-list dt {
  color: var(--muted);
}

.stat-list dd {
  margin: 0;
  color: var(--text);
}

.media-card {
  min-height: 190px;
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 18px;
  align-items: center;
}

.media-thumbnail {
  aspect-ratio: 16/10;
  display: grid;
  place-items: center;
  color: var(--violet-bright);
  background: radial-gradient(circle at 68% 28%,rgba(164,140,255,.28),transparent 28%),linear-gradient(135deg,#171426,#09080f);
  border: 1px solid rgba(164,140,255,.25);
  border-radius: 9px;
  font-size: 2rem;
}

.media-card h2 {
  margin-top: 5px;
  font-size: 1.25rem;
}

.media-card p:not(.label) {
  color: var(--text-soft);
  line-height: 1.5;
}

.hero-panel {
  min-height: 380px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero-panel h2 {
  max-width: 18ch;
  margin-top: 8px;
  font-size: clamp(2rem,5vw,4.4rem);
  letter-spacing: -.055em;
}

.hero-panel>p:not(.eyebrow) {
  max-width: 65ch;
  color: var(--text-soft);
  line-height: 1.7;
}

.schedule-list {
  display: grid;
  gap: 9px;
}

.schedule-item {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 12px;
  padding: 11px;
  background: rgba(164,140,255,.035);
  border: 1px solid rgba(164,140,255,.12);
  border-radius: 8px;
}

.schedule-item time {
  color: var(--violet);
  font-weight: 900;
}

.schedule-item strong,
.schedule-item span {
  display: block;
}

.schedule-item span {
  margin-top: 3px;
  color: var(--muted);
  font-size: .82rem;
}

.rule-list {
  display: grid;
  gap: 9px;
  margin: 0;
  padding-left: 18px;
  color: var(--text-soft);
  line-height: 1.5;
}

.rule-list li::marker {
  color: var(--violet);
}

.signal-chain {
  min-height: 150px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.signal-chain span {
  padding: 8px 10px;
  color: var(--violet-bright);
  background: rgba(164,140,255,.055);
  border: 1px solid rgba(164,140,255,.25);
  border-radius: 7px;
  font-weight: 800;
}

.signal-chain i {
  color: var(--muted);
  font-style: normal;
}

.project-card {
  min-height: 270px;
}

.project-card .window-content {
  display: flex;
  min-height: 230px;
  flex-direction: column;
}

.project-card h2 {
  margin-top: 8px;
  font-size: 1.5rem;
}

.project-card p {
  color: var(--text-soft);
  line-height: 1.6;
}

.project-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0 20px;
}

.tag {
  padding: 4px 7px;
  color: var(--violet-bright);
  background: rgba(164,140,255,.055);
  border: 1px solid rgba(164,140,255,.14);
  border-radius: 999px;
  font-size: .73rem;
}

.project-card .button {
  margin-top: auto;
  align-self: flex-start;
}

.link-grid {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 10px;
}

.link-card {
  min-height: 110px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  padding: 14px;
  color: var(--text);
  background: rgba(164,140,255,.035);
  border: 1px solid rgba(164,140,255,.13);
  border-radius: 8px;
  text-decoration: none;
  transition: .14s ease;
}

.link-card:hover {
  transform: translateY(-2px);
  background: rgba(164,140,255,.075);
  border-color: var(--violet);
}

.link-card strong {
  color: var(--violet-bright);
  font-size: 1.05rem;
}

.link-card span {
  color: var(--muted);
  font-size: .8rem;
  overflow-wrap: anywhere;
}

.contact-panel {
  line-height: 1.65;
}

.contact-panel p {
  margin-top: 0;
  color: var(--text-soft);
}

.contact-panel code {
  color: var(--violet-bright);
}

.motd {
  min-height: 150px;
  display: grid;
  place-items: center;
  margin: 0;
  color: var(--violet-bright);
  font-size: clamp(1.2rem,2.5vw,2rem);
  line-height: 1.4;
  text-align: center;
}

.statusbar {
  min-height: var(--status-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 5px 12px;
  color: var(--muted);
  background: rgba(8,7,13,.94);
  border-top: 1px solid var(--border);
  font-size: .75rem;
  backdrop-filter: blur(18px);
}

.statusbar>div {
  display: flex;
  align-items: center;
  gap: 9px;
}

.status-chip {
  padding: 3px 6px;
  color: #08070d;
  background: var(--violet);
  border-radius: 5px;
  font-weight: 900;
}

kbd {
  min-width: 20px;
  display: inline-grid;
  place-items: center;
  padding: 2px 5px;
  color: var(--text-soft);
  background: #11101a;
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 4px;
}

@media (max-width:980px) {
  .home-grid,
  .stream-grid,
  .links-grid {
    grid-template-columns: 1fr;
  }

  .home-grid {
    grid-template-areas: "profile" "terminal" "stream" "media";
  }

  .hero-window,
  .links-window {
    grid-row: auto;
  }

  .project-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width:680px) {
  :root {
    --gap: 9px;
    --radius: 7px;
  }

  .waybar {
    grid-template-columns: 1fr auto;
  }

  .waybar-center {
    display: none;
  }

  .workspace-button small,
  #local-date,
  .keyboard-hint {
    display: none;
  }

  .desktop {
    padding: 9px;
  }

  .profile-content {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .avatar {
    width: 138px;
    margin-inline: auto;
  }

  .quick-actions,
  .platform-row {
    justify-content: center;
  }

  .media-card {
    grid-template-columns: 1fr;
  }

  .media-thumbnail {
    max-width: 220px;
  }

  .terminal-status,
  .stat-list>div {
    grid-template-columns: 1fr;
  }

  .link-grid {
    grid-template-columns: 1fr;
  }

  .window-titlebar {
    font-size: .7rem;
  }

  .window-content {
    padding: 15px;
  }
}

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

/* Main-page links occupy the old latest-video position */
.home-links {
  grid-area: media;
}

/* Dedicated old-web workspace */
.web-grid {
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
}

.web-grid .button-panel {
  grid-column: 1;
}

.button-wall-heading {
  margin-bottom: 14px;
  text-align: center;
}

.button-wall {
  display: grid;
  grid-template-columns: repeat(4, 88px);
  gap: 6px;
  justify-content: center;
  align-items: center;
}

.button-wall a {
  display: block;
  width: 88px;
  height: 31px;
  line-height: 0;
}

.button-wall img {
  display: block;
  width: 88px;
  height: 31px;
  object-fit: contain;
}

@media (max-width: 520px) {
  .button-wall {
    grid-template-columns: repeat(2, 88px);
  }
}

/* Scroll target should not hide beneath the top bar */
#quick-links {
  scroll-margin-top: 54px;
}

@media (max-width: 980px) {
  .web-grid {
    grid-template-columns: 1fr;
  }

  .web-grid .button-panel {
    grid-column: auto;
  }
}

/* Handle and oshi mark */
.identity-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 7px 0 15px;
}

.identity-meta .handle {
  margin: 0;
}

.oshi-mark {
  margin: 0;
  padding: 4px 8px;
  color: var(--violet-bright);
  background: rgba(164, 140, 255, 0.055);
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  font-family: "Noto Color Emoji", "Segoe UI Emoji", "Apple Color Emoji", sans-serif;
  font-size: 1.15rem;
  line-height: 1;
  letter-spacing: 0.08em;
  box-shadow: 0 0 12px rgba(164, 140, 255, 0.08);
}

@media (max-width: 680px) {
  .identity-meta {
    justify-content: center;
  }
}