:root {
  color-scheme: dark;
  --bg: #080b12;
  --surface: #0d111a;
  --surface-strong: #111827;
  --surface-subtle: #151c29;
  --ink: #e6edf3;
  --muted: #9ba7b4;
  --muted-low: #647282;
  --line: #202938;
  --line-strong: #2a3547;
  --blue: #38bdf8;
  --green: #34d399;
  --red: #f87171;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.42);
  --focus: 0 0 0 1px rgba(56, 189, 248, 0.32), 0 0 0 6px rgba(56, 189, 248, 0.06);
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --sans: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 50% 0%, rgba(56, 189, 248, 0.08), transparent 34%),
    linear-gradient(135deg, rgba(8, 11, 18, 0.98), rgba(13, 17, 26, 0.96)),
    var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body.is-booting {
  overflow: hidden;
}

input {
  font: inherit;
}

.workspace {
  position: relative;
  min-height: 100vh;
  padding: clamp(16px, 3vw, 36px);
  display: grid;
  place-items: center;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
}

h1,
p {
  margin-top: 0;
}

.boot-screen {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  place-items: center;
  padding: clamp(18px, 4vw, 48px);
  background:
    radial-gradient(circle at 50% 18%, rgba(56, 189, 248, 0.08), transparent 32%),
    linear-gradient(135deg, rgba(8, 11, 18, 0.98), rgba(13, 17, 26, 0.96)),
    var(--bg);
  transition:
    opacity 420ms ease,
    transform 420ms ease,
    visibility 420ms ease;
}

.boot-screen.is-handoff {
  opacity: 0;
  transform: translateY(-10px);
  visibility: hidden;
}

.boot-panel {
  width: min(520px, 100%);
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(13, 17, 26, 0.92);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
  transform: translateZ(0);
}

.boot-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.boot-header h1 {
  margin: 0;
  font-family: var(--mono);
  font-size: 17px;
  font-weight: 600;
}

.boot-header span {
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-strong);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
}

.boot-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin: 18px 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
}

.boot-progress {
  height: 8px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #101722;
}

.boot-progress div {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #1d4f68, var(--blue));
  transition: width 520ms cubic-bezier(0.22, 1, 0.36, 1);
}

.boot-status {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 12px;
  margin: 12px 0 18px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
}

.boot-status span:first-child {
  color: var(--blue);
  font-weight: 600;
}

.boot-log {
  min-height: 150px;
  display: grid;
  align-content: start;
  gap: 8px;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-subtle);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.45;
  list-style: none;
}

.boot-log li {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 10px;
}

.boot-log span {
  color: var(--green);
  font-weight: 600;
}

.os-frame {
  width: min(1040px, 100%);
  min-height: min(720px, calc(100vh - 32px));
  overflow: hidden;
  border: 1px solid rgba(32, 41, 56, 0.96);
  border-radius: 18px;
  background: rgba(13, 17, 26, 0.9);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px);
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity 520ms ease,
    transform 520ms ease,
    box-shadow 180ms ease,
    border-color 180ms ease;
}

.os-frame:focus-within {
  border-color: rgba(56, 189, 248, 0.42);
  box-shadow: var(--shadow), var(--focus);
}

body.is-booting .os-frame {
  pointer-events: none;
  opacity: 0;
  transform: translateY(10px);
}

body.is-ready .os-frame {
  pointer-events: auto;
  opacity: 1;
  transform: translateY(0);
}

.topbar {
  height: 56px;
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr) 220px;
  align-items: center;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(8, 11, 18, 0.72);
}

.window-controls {
  display: flex;
  gap: 8px;
}

.window-controls span {
  width: 12px;
  height: 12px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
}

.window-controls span:nth-child(1) {
  background: #334155;
}

.window-controls span:nth-child(2) {
  background: #334155;
}

.window-controls span:nth-child(3) {
  background: #334155;
}

.command-center {
  justify-self: center;
  min-width: min(520px, 100%);
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  color: var(--muted);
  font-size: 13px;
}

.command-icon {
  color: var(--blue);
  font-weight: 700;
}

.status-strip {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 13px;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
}

.terminal-pane {
  min-height: calc(min(720px, calc(100vh - 32px)) - 56px);
  padding: clamp(20px, 4vw, 44px);
  display: grid;
  grid-template-rows: auto minmax(280px, 1fr) auto;
  background: var(--surface);
}

.terminal-header {
  max-width: 760px;
  padding-bottom: clamp(18px, 4vh, 34px);
  border-bottom: 1px solid var(--line);
}

.terminal-header h1 {
  margin-bottom: 6px;
  font-size: clamp(20px, 3vw, 30px);
  line-height: 1.15;
}

.terminal-header p:last-child {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14px;
}

.terminal-output {
  min-height: 0;
  overflow-y: auto;
  display: grid;
  align-content: start;
  padding: clamp(22px, 5vh, 48px) 0;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.65;
  scroll-behavior: smooth;
  scrollbar-color: var(--line-strong) transparent;
  scrollbar-width: thin;
}

.terminal-output::-webkit-scrollbar {
  width: 8px;
}

.terminal-output::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: var(--line-strong);
}

.entry {
  max-width: 780px;
  opacity: 1;
  transform: translateY(0);
  will-change: opacity, transform;
  transition:
    opacity 150ms ease,
    transform 150ms ease;
}

.entry.is-exiting {
  opacity: 0;
  transform: translateY(6px);
}

.entry.is-entering {
  opacity: 0;
  transform: translateY(-6px);
}

.prompt-line {
  margin-bottom: 12px;
  color: var(--muted);
}

.prompt-line strong,
.terminal-input label {
  color: var(--blue);
  font-weight: 600;
}

.output-block {
  padding: 0;
  color: var(--ink);
}

.output-block.is-error {
  color: var(--red);
}

.output-block h2 {
  margin: 0 0 20px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0;
}

.output-body {
  max-width: 70ch;
  white-space: pre-wrap;
}

.output-section + .output-section {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.profile-section {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  align-items: start;
  gap: 24px;
}

.profile-photo {
  position: relative;
  width: 118px;
  aspect-ratio: 1;
  overflow: hidden;
  display: grid;
  place-items: center;
  border: 1px solid rgba(56, 189, 248, 0.42);
  border-radius: 12px;
  background: var(--surface-strong);
  color: var(--blue);
  font-family: var(--mono);
  font-size: 20px;
  font-weight: 600;
}

.profile-photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-copy {
  min-width: 0;
}

.profile-copy strong,
.profile-copy span {
  display: block;
}

.profile-copy strong {
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
}

.profile-copy span {
  margin-top: 3px;
  color: var(--muted);
}

.profile-copy p {
  margin: 14px 0 0;
  max-width: 68ch;
  color: var(--ink);
  white-space: normal;
}

.member-section {
  display: grid;
  grid-template-columns: 152px minmax(0, 1fr);
  align-items: start;
  gap: 24px;
}

.member-media {
  width: 152px;
  aspect-ratio: 1;
  overflow: hidden;
  display: grid;
  place-items: center;
  border: 1px solid rgba(56, 189, 248, 0.36);
  border-radius: 50%;
  background: var(--surface-strong);
  color: var(--blue);
}

.member-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.member-document,
.member-initials {
  min-height: 152px;
  padding: 14px;
  justify-items: start;
  align-content: end;
}

.member-document span,
.member-document strong,
.member-document a {
  display: block;
}

.member-document span {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.member-document strong {
  margin-top: 8px;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.member-document a {
  margin-top: 12px;
  color: var(--blue);
  text-decoration: none;
}

.member-document a:focus-visible,
.member-document a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.member-initials span {
  color: var(--blue);
  font-size: 24px;
  font-weight: 600;
}

.member-copy {
  min-width: 0;
}

.member-copy > strong,
.member-copy > span {
  display: block;
}

.member-copy > strong {
  color: var(--ink);
  font-size: 16px;
  font-weight: 600;
}

.member-copy > span {
  margin-top: 4px;
  color: var(--muted);
}

.member-copy > p {
  margin: 16px 0 0;
  max-width: 76ch;
  color: var(--ink);
}

.member-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 18px;
}

.member-facts div {
  min-height: 62px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.34);
}

.member-facts span,
.team-card strong,
.team-card span,
.team-card p {
  display: block;
}

.member-facts span {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.member-facts strong {
  color: var(--ink);
  font-size: 12px;
  font-weight: 500;
}

.member-subsection {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.member-subsection p {
  margin: 8px 0 0;
  max-width: 76ch;
  color: var(--ink);
}

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

.team-card {
  min-height: 86px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.32);
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.team-card img,
.team-avatar-fallback {
  width: 46px;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid rgba(56, 189, 248, 0.36);
  background: var(--surface-strong);
}

.team-card img {
  display: block;
  object-fit: cover;
}

.team-avatar-fallback {
  display: grid;
  place-items: center;
  color: var(--blue);
  font-weight: 600;
}

.team-card strong {
  color: var(--blue);
  font-weight: 600;
}

.team-card span {
  margin-top: 8px;
  color: var(--ink);
  font-weight: 600;
}

.team-card p {
  margin: 5px 0 0;
  color: var(--muted);
}

.section-label {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0;
  text-transform: uppercase;
}

.section-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 18px;
  max-width: 76ch;
}

.section-list li::marker {
  color: var(--blue);
}

.section-note {
  max-width: 72ch;
  padding-left: 12px;
  border-left: 2px solid var(--line-strong);
  color: var(--muted);
  white-space: pre-wrap;
}

.footer-section {
  color: var(--muted);
  white-space: pre-wrap;
}

.footer-section div {
  max-width: 46ch;
  color: var(--muted);
}

.footer-section div::first-line {
  color: var(--ink);
}

.timeline-list {
  display: grid;
  gap: 16px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 98px minmax(0, 1fr);
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.timeline-item:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.timeline-period {
  color: var(--blue);
  font-weight: 600;
}

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

.timeline-item strong {
  color: var(--ink);
  font-weight: 600;
}

.timeline-item span {
  margin-top: 2px;
  color: var(--muted);
}

.timeline-item p {
  margin: 8px 0 0;
  max-width: 68ch;
  color: var(--ink);
}

.section-table {
  display: grid;
  gap: 8px;
}

.section-table div {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 14px;
}

.section-table strong {
  color: var(--blue);
  font-weight: 600;
}

.section-table span {
  color: var(--ink);
}

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

.output-chip {
  min-height: 66px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.output-chip span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.output-chip strong {
  color: var(--ink);
  font-size: 12px;
}

.terminal-input {
  height: 48px;
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 0;
  border-top: 1px solid var(--line);
  background: transparent;
  font-family: var(--mono);
  transition: border-color 160ms ease;
}

.terminal-input:focus-within {
  border-color: rgba(56, 189, 248, 0.58);
}

.terminal-input > span {
  color: var(--muted);
}

.command-field {
  min-width: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
}

.terminal-input input {
  width: 1ch;
  min-width: 1ch;
  max-width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  caret-color: transparent;
  font-family: var(--mono);
}

.terminal-input input::placeholder {
  color: var(--muted-low);
}

.cursor {
  width: 7px;
  height: 18px;
  margin-left: 2px;
  border-radius: 1px;
  background: var(--blue);
  opacity: 1;
  transform: translateZ(0);
  animation: cursorBlink 1.08s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

body.shell-busy .cursor,
body.is-booting .cursor {
  animation: none;
  opacity: 0.25;
}

@keyframes cursorBlink {
  0% {
    opacity: 1;
  }

  45% {
    opacity: 1;
  }

  55% {
    opacity: 0.18;
  }

  100% {
    opacity: 0.18;
  }
}

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

@media (max-width: 820px) {
  .workspace {
    padding: 0;
  }

  .os-frame {
    min-height: 100vh;
    border: 0;
    border-radius: 0;
  }

  .topbar {
    grid-template-columns: 80px minmax(0, 1fr);
  }

  .status-strip {
    display: none;
  }

  .command-center {
    min-width: 0;
  }

  .terminal-pane {
    min-height: calc(100vh - 56px);
    padding: 18px;
    grid-template-rows: auto minmax(220px, 1fr) auto;
  }

  .profile-section {
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 18px;
  }

  .profile-photo {
    width: 96px;
  }

  .member-section {
    grid-template-columns: 128px minmax(0, 1fr);
    gap: 18px;
  }

  .member-media {
    width: 128px;
  }

  .member-facts {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 520px) {
  .topbar {
    padding: 0 12px;
  }

  .window-controls {
    gap: 6px;
  }

  .command-center {
    justify-content: flex-start;
    padding: 0 10px;
  }

  .boot-panel {
    padding: 18px;
  }

  .boot-status {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .terminal-header h1 {
    font-size: 22px;
  }

  .terminal-output {
    font-size: 12px;
    line-height: 1.6;
  }

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

  .profile-section,
  .member-section,
  .timeline-item {
    grid-template-columns: 1fr;
  }

  .profile-section {
    gap: 16px;
  }

  .profile-photo {
    width: 88px;
  }

  .member-media {
    width: 112px;
  }

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

  .section-table div {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}
