:root {
  font-family:
    Inter,
    system-ui,
    -apple-system,
    "Segoe UI",
    sans-serif;
  color-scheme: dark;
  --bg: #202329;
  --surface: #272b32;
  --text: #dee2e8;
  --muted: #a0a8b5;
  --subtle: #7f8999;
  --line: #3f4652;
  --accent: #89a9d2;
  --button: #688ab7;
  --button-hover: #799ac5;
  --button-text: #131c29;
  --focus: #a6c4ec;
  --error: #e5a8a8;
  --warn: #d1b683;
  --debug: #939daa;
  --glow-logs: rgba(91, 126, 170, 0.19);
  --glow-form: rgba(91, 126, 170, 0.055);
  --log-text: #bac6d6;
  --log-time: #9baabf;
  --log-debug: #a9b7c9;
  --log-line: 48px;
  --log-cycle: 480px;
  --scene-scrim: 8, 18, 29;
  background: var(--bg);
  color: var(--text);
  font-synthesis: none;
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f0f1f3;
  --surface: #e7e9ed;
  --text: #29323e;
  --muted: #596575;
  --subtle: #657181;
  --line: #bcc3ce;
  --accent: #466b99;
  --button: #496d9b;
  --button-hover: #3c5f8c;
  --button-text: #f1f3f7;
  --focus: #3c669c;
  --error: #974646;
  --warn: #82612c;
  --debug: #637080;
  --glow-logs: rgba(109, 141, 180, 0.16);
  --glow-form: rgba(109, 141, 180, 0.045);
  --log-text: #42536b;
  --log-time: #5a6d85;
  --log-debug: #566a83;
  --scene-scrim: 232, 237, 240;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-width: 320px;
}
button,
input {
  font: inherit;
}
button,
a,
input {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: wait;
  opacity: 0.65;
}
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 5px;
}
.app-shell {
  position: relative;
  isolation: isolate;
  overflow: clip;
  background: var(--bg);
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  padding: 36px clamp(24px, 5vw, 88px) 24px;
}
.atmosphere {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  user-select: none;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
header,
.story,
.auth-area {
  position: relative;
  isolation: isolate;
}
header::before,
.story::before,
.auth-area::before {
  content: "";
  position: absolute;
  z-index: -1;
  pointer-events: none;
  inset: -36px;
  background: radial-gradient(
    ellipse at center,
    rgba(var(--scene-scrim), 0.94) 35%,
    rgba(var(--scene-scrim), 0.78) 65%,
    rgba(var(--scene-scrim), 0) 100%
  );
  filter: blur(24px);
}
header::before {
  inset: -20px -24px;
  background: linear-gradient(
    90deg,
    rgba(var(--scene-scrim), 0.8),
    rgba(var(--scene-scrim), 0) 30%,
    rgba(var(--scene-scrim), 0) 70%,
    rgba(var(--scene-scrim), 0.8)
  );
  filter: blur(14px);
}
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
  font-size: 23px;
  font-weight: 600;
  letter-spacing: -0.8px;
}
.brand svg {
  width: 31px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.controls {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 13px;
}
.controls button {
  border: 0;
  background: none;
  color: var(--muted);
  padding: 8px;
}
.segmented {
  display: flex;
  gap: 4px;
}
.segmented button[aria-pressed="true"] {
  color: var(--text);
  background: var(--surface);
  border-radius: 5px;
}
.control-divider {
  height: 18px;
  border-left: 1px solid var(--line);
}
.theme-control {
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: 85px;
}
.theme-control span {
  font-size: 20px;
  line-height: 1;
}
main {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 400px;
  align-items: center;
  gap: clamp(48px, 8vw, 160px);
  width: 100%;
  max-width: 1440px;
  margin: 65px auto;
}
.story {
  min-width: 0;
  padding: 18px 0;
}
.eyebrow {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 2.4px;
  color: var(--subtle);
  margin: 0 0 22px;
}
h2 {
  font-size: clamp(36px, 3.4vw, 54px);
  font-weight: 500;
  line-height: 1.17;
  letter-spacing: -2px;
  margin: 0 0 34px;
}
h2 > span {
  color: var(--accent);
}
.demo {
  width: 100%;
  max-width: 750px;
}
.log-window {
  height: calc(var(--log-line) * 6);
  overflow: hidden;
  mask-image: linear-gradient(transparent, black 8%, black 90%, transparent);
}
.log-track {
  animation: log-flow 50s linear infinite;
}
.log-line {
  height: var(--log-line);
  display: grid;
  grid-template-columns: 215px 50px minmax(0, 1fr);
  min-width: 0;
  gap: 12px;
  align-items: center;
  white-space: nowrap;
  font-family: "JetBrains Mono", "Cascadia Mono", Consolas, monospace;
  font-size: 13px;
  line-height: 1.6;
}
.timestamp {
  color: var(--log-time);
}
.level {
  font-size: 12px;
  text-align: right;
}
.info {
  color: var(--accent);
}
.debug {
  color: var(--log-debug);
}
.warn {
  color: var(--warn);
}
.error {
  color: var(--error);
}
.log-message {
  min-width: 0;
  color: var(--log-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.log-dash {
  color: var(--subtle);
}
@keyframes log-flow {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(calc(-1 * var(--log-cycle)));
  }
}
.static .log-track {
  animation: none;
}
.static .log-cycle + .log-cycle {
  display: none;
}
.auth-area {
  width: 100%;
  padding: 16px 0;
}
.login-content {
  width: 100%;
}
.login-content .eyebrow {
  margin-bottom: 18px;
}
h1 {
  font-size: 29px;
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.9px;
  margin: 0 0 12px;
}
.subtitle {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
  margin: 0 0 34px;
}
.field {
  margin-bottom: 23px;
}
label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 10px;
}
input {
  display: block;
  width: 100%;
  height: 50px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  padding: 0 14px;
  font-size: 14px;
  transition: border-color 0.15s;
}
input::placeholder {
  color: var(--subtle);
  opacity: 1;
}
input:focus {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-color: var(--focus);
}
.password-field {
  position: relative;
}
.password-field input {
  padding-right: 50px;
}
.eye {
  position: absolute;
  right: 4px;
  top: 4px;
  width: 42px;
  height: 42px;
  border: none;
  background: none;
  color: var(--muted);
  display: grid;
  place-items: center;
  border-radius: 4px;
}
.eye svg {
  width: 20px;
  height: 20px;
}
.primary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 50px;
  padding: 12px 17px;
  border: 0;
  border-radius: 6px;
  color: var(--button-text);
  background: var(--button);
  font-size: 14px;
  font-weight: 600;
  margin-top: 30px;
}
.primary:hover:enabled {
  background: var(--button-hover);
}
.primary span {
  font-size: 21px;
  font-weight: 400;
}
.text-action {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 13px;
  text-align: left;
  padding: 0;
  margin-top: 18px;
  line-height: 1.6;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.layout-action {
  margin-top: 12px;
  font-size: 12px;
}
.layout-choice .hint {
  margin: 12px 0 0;
}
.layout-choice [role="group"] {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}
.layout-choice .text-action {
  margin-top: 8px;
}
.auth-area .error,
.notice,
.hint {
  font-size: 13px;
  line-height: 1.65;
  margin: 16px 0;
}
.hint,
.notice {
  color: var(--muted);
}
@media (max-width: 1199px) {
  .log-line {
    grid-template-columns: 105px 44px minmax(0, 1fr);
    gap: 8px;
  }
  .timestamp-date {
    display: none;
  }
}
@media (max-width: 1000px) {
  .atmosphere {
    background-position: 45% center;
  }
  main {
    gap: 32px;
    grid-template-columns: minmax(0, 1fr) 380px;
  }
  h2 {
    font-size: 36px;
  }
}
@media (max-width: 767px) {
  .atmosphere {
    background-position: right center;
  }
  .app-shell {
    padding: 24px;
  }
  main {
    display: block;
    max-width: 420px;
    margin: 60px auto;
  }
  .story {
    display: none;
  }
  .auth-area {
    padding: 0;
  }
  .controls {
    gap: 10px;
  }
}
@media (max-width: 420px) {
  .app-shell {
    padding: 24px 20px;
  }
  .brand {
    font-size: 21px;
    gap: 8px;
  }
  .brand svg {
    width: 26px;
  }
  .controls {
    gap: 4px;
  }
  .control-divider {
    display: none;
  }
  .theme-control {
    min-width: auto;
    font-size: 12px;
  }
  .theme-control span {
    display: none;
  }
  h1 {
    font-size: 26px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

.cursor-control {
  display: none;
}
@media (hover: hover) and (pointer: fine) {
  :root[data-cursor="pulselog"] {
    cursor:
      url("/cursor.png?v=pl014-b") 12 11,
      auto;
  }
  a,
  button,
  [role="button"],
  select,
  summary {
    cursor: pointer;
  }
  input,
  textarea,
  [contenteditable]:not([contenteditable="false"]),
  .log-line {
    cursor: text;
  }
  button:disabled {
    cursor: wait;
  }
  input:disabled,
  textarea:disabled,
  select:disabled,
  [aria-disabled="true"] {
    cursor: not-allowed;
  }
  .controls .cursor-control {
    display: block;
    position: fixed;
    right: clamp(20px, 5vw, 88px);
    bottom: 16px;
    padding: 8px;
    border-radius: 5px;
    background: var(--bg);
    color: var(--subtle);
    font-size: 11px;
  }
}
@media (forced-colors: active) {
  :root[data-cursor="pulselog"] {
    cursor: auto;
  }
}

/* Authenticated shell: scrolling stays in the page, never the modal's ancestor. */
.app-shell[data-context="workspace"] {
  padding: 0;
  height: 100dvh;
  min-height: 0;
}
.workspace-shell {
  display: flex;
  height: 100%;
  min-width: 0;
}
.workspace-page {
  flex: 1;
  min-width: 0;
  overflow: auto;
  scrollbar-gutter: stable;
}
.workspace-header {
  position: sticky;
  top: 0;
  z-index: 1;
  height: 64px;
  justify-content: flex-start;
  gap: 16px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(var(--scene-scrim), 0.85);
  font-size: 14px;
}
.workspace-header::before {
  content: none;
}
.menu-toggle {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  flex-shrink: 0;
}
.menu-toggle:hover {
  background: var(--surface);
}
.workspace-icon {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.workspace-content {
  display: block;
  width: auto;
  max-width: none;
  margin: 0;
  padding: clamp(32px, 5vw, 72px);
}
.home-content {
  padding-top: clamp(48px, 8vh, 88px);
}
.workspace-copy {
  position: relative;
  isolation: isolate;
  max-width: 650px;
}
.workspace-copy::before {
  content: "";
  position: absolute;
  inset: -28px -30px;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(
    ellipse,
    rgba(var(--scene-scrim), 0.93) 30%,
    rgba(var(--scene-scrim), 0.76) 60%,
    transparent 100%
  );
  filter: blur(24px);
}
.home-content h1 {
  font-size: clamp(36px, 4vw, 56px);
  letter-spacing: -2px;
  margin: 0 0 12px;
}
.home-welcome {
  color: var(--muted);
  font-size: 18px;
  margin: 0;
  line-height: 1.6;
}
.home-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin-top: 28px;
}
.home-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  width: auto;
  margin: 0;
  padding: 12px 20px;
  min-height: 46px;
  border-radius: 6px;
  font-size: 14px;
  text-decoration: none;
}
.home-secondary {
  color: var(--text);
  border: 1px solid var(--line);
  background: rgba(var(--scene-scrim), 0.5);
}
.home-secondary:hover {
  background: var(--surface);
}
.page-description {
  color: var(--muted);
  line-height: 1.8;
  font-size: 15px;
  max-width: 560px;
}
.about-version {
  color: var(--subtle);
  font-size: 12px;
  margin: 20px 0;
}
.about-slogan {
  font-size: 20px;
  line-height: 1.5;
}
.workspace-error {
  font-size: 14px;
  line-height: 1.7;
}
.sidebar {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  width: 260px;
  height: 100%;
  padding: 32px 16px 20px;
  overflow-y: auto;
  overscroll-behavior: contain;
  border-right: 1px solid var(--line);
  background: rgba(var(--scene-scrim), 0.95);
}
.sidebar-brand {
  padding: 0 12px;
  margin-bottom: 36px;
}
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 10px 12px;
  border-left: 3px solid transparent;
  border-radius: 5px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  text-decoration: none;
}
.sidebar-nav a:hover {
  background: var(--surface);
  color: var(--text);
}
.sidebar-nav a[aria-current="page"] {
  border-left-color: var(--accent);
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
}
.sidebar-profile {
  margin-top: auto;
  padding-top: 24px;
}
.profile-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  text-align: left;
  font-size: 14px;
}
.profile-toggle span:first-of-type {
  flex: 1;
  overflow-wrap: anywhere;
  min-width: 0;
}
.profile-settings {
  padding: 16px 12px 0;
}
.profile-settings fieldset {
  border: 0;
  padding: 0;
  margin: 0 0 16px;
  min-width: 0;
}
.profile-settings legend {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 8px;
  padding: 0;
}
.preference-options {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.preference-options button {
  min-height: 36px;
  padding: 6px 10px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
}
.preference-options button[aria-pressed="true"] {
  border-color: var(--line);
  background: var(--surface);
  color: var(--text);
}
.profile-logout {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  min-height: 44px;
  border: 0;
  border-top: 1px solid var(--line);
  padding: 10px 0;
  background: transparent;
  color: var(--text);
  font-size: 13px;
}
.sidebar-overlay {
  position: fixed;
  inset: 0;
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100dvh;
  max-width: none;
  max-height: none;
  border: 0;
  background: transparent;
  color: var(--text);
  overflow: hidden;
}
.sidebar-overlay::backdrop {
  background: rgba(var(--scene-scrim), 0.22);
}
.overlay-panel {
  width: min(280px, calc(100% - 40px));
  padding-top: 76px;
}
.overlay-panel .sidebar-brand {
  margin-bottom: 24px;
}
.overlay-toggle {
  position: absolute;
  left: 20px;
  top: 10px;
}
.sidebar-overlay[open] .overlay-panel {
  animation: sidebar-enter 160ms ease-out;
}
@keyframes sidebar-enter {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(0);
  }
}
@media (max-width: 767px) {
  .workspace-content {
    padding: 32px 24px;
  }
  .home-content {
    padding-top: 44px;
  }
  .home-welcome {
    font-size: 16px;
  }
  .home-actions {
    align-items: stretch;
    gap: 12px;
  }
  .home-actions a {
    justify-content: space-between;
  }
  .workspace-copy::before {
    inset: -20px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .sidebar-overlay[open] .overlay-panel {
    animation: none;
  }
}
