@import url("https://fonts.googleapis.com/css2?family=Azeret+Mono:wght@400;500;700&family=Newsreader:opsz,wght@6..72,500;6..72,700&display=swap");

:root {
  --ink: #101414;
  --ink-soft: #27302f;
  --field: #e8dfcd;
  --paper: #fbf5e9;
  --paper-deep: #d8cfbd;
  --copper: #b86b38;
  --signal: #1f8d66;
  --signal-soft: #b8dbc2;
  --danger: #b24533;
  --night: #18211f;
  --line: rgba(16, 20, 20, 0.16);
  --shadow: 0 28px 80px rgba(11, 16, 15, 0.25);
  --serif: "Newsreader", Georgia, serif;
  --mono: "Azeret Mono", "Courier New", monospace;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 18% 10%, rgba(184, 107, 56, 0.22), transparent 28rem),
    radial-gradient(circle at 92% 6%, rgba(31, 141, 102, 0.22), transparent 25rem),
    linear-gradient(135deg, #ece0ca 0%, #f8f0df 48%, #cfbea4 100%);
  font-family: var(--mono);
  overflow-x: hidden;
}

button {
  font: inherit;
}

.ambient {
  position: fixed;
  inset: auto;
  border-radius: 999px;
  filter: blur(16px);
  pointer-events: none;
  opacity: 0.65;
  z-index: 0;
}

.ambient-one {
  width: 34rem;
  height: 34rem;
  left: -13rem;
  top: 18rem;
  background: rgba(184, 107, 56, 0.18);
}

.ambient-two {
  width: 28rem;
  height: 28rem;
  right: -8rem;
  bottom: 2rem;
  background: rgba(31, 141, 102, 0.18);
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.25;
  background-image:
    linear-gradient(rgba(16, 20, 20, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16, 20, 20, 0.035) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0.25));
}

.app-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 19rem minmax(0, 1fr);
  gap: 1.2rem;
  width: min(1480px, calc(100vw - 2rem));
  margin: 1rem auto;
}

.sidebar,
.workspace,
.panel,
.hero-panel,
.brain-panel,
.system-card,
.operator-card {
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.sidebar {
  position: sticky;
  top: 1rem;
  height: calc(100vh - 2rem);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1rem;
  border-radius: 2rem;
  background: rgba(16, 20, 20, 0.9);
  color: var(--paper);
  overflow: hidden;
}

.sidebar::after {
  content: "";
  position: absolute;
  inset: auto -5rem -5rem auto;
  width: 12rem;
  height: 12rem;
  border: 1px solid rgba(251, 245, 233, 0.18);
  border-radius: 50%;
}

.brand-block {
  display: flex;
  gap: 0.85rem;
  align-items: center;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 3.8rem;
  height: 3.8rem;
  border: 1px solid rgba(251, 245, 233, 0.28);
  border-radius: 1.15rem;
  background:
    linear-gradient(135deg, rgba(184, 107, 56, 0.92), rgba(31, 141, 102, 0.7)),
    var(--night);
  color: var(--paper);
  font-weight: 700;
  letter-spacing: -0.08em;
}

.brand-block h1,
.topbar h2,
.hero-copy h3,
.panel h3,
.brain-panel h3 {
  margin: 0;
  font-family: var(--serif);
  letter-spacing: -0.045em;
}

.brand-block h1 {
  font-size: 1.5rem;
}

.eyebrow {
  margin: 0 0 0.35rem;
  color: var(--copper);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.sidebar .eyebrow {
  color: #d69b63;
}

.system-card,
.operator-card {
  position: relative;
  padding: 1rem;
  border-radius: 1.3rem;
  background: rgba(251, 245, 233, 0.08);
}

.system-card strong,
.operator-card strong {
  display: block;
  margin-bottom: 0.35rem;
  font-family: var(--serif);
  font-size: 1.35rem;
}

.system-card span,
.operator-card span {
  color: rgba(251, 245, 233, 0.72);
  font-size: 0.75rem;
  line-height: 1.45;
}

.nav-stack {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.2rem;
  overflow: auto;
  padding-right: 0.2rem;
}

.nav-item {
  width: 100%;
  padding: 0.78rem 0.85rem;
  border: 1px solid rgba(251, 245, 233, 0.1);
  border-radius: 0.95rem;
  color: rgba(251, 245, 233, 0.78);
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: transform 180ms ease, background 180ms ease, color 180ms ease;
}

.nav-item:hover,
.nav-item.active {
  color: var(--paper);
  background: rgba(251, 245, 233, 0.12);
  transform: translateX(0.25rem);
}

.nav-item.active {
  border-color: rgba(214, 155, 99, 0.55);
}

.operator-card {
  margin-top: auto;
}

.workspace {
  min-height: calc(100vh - 2rem);
  padding: 1.1rem;
  border-radius: 2.2rem;
  background: rgba(251, 245, 233, 0.64);
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1rem;
}

.topbar h2 {
  font-size: clamp(2rem, 5vw, 4.8rem);
  line-height: 0.86;
}

.health-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.health-pill,
.mode-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(251, 245, 233, 0.72);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.health-pill::before {
  content: "";
  width: 0.52rem;
  height: 0.52rem;
  border-radius: 50%;
  background: var(--signal);
  box-shadow: 0 0 0 0.3rem rgba(31, 141, 102, 0.13);
}

.health-pill.watch::before {
  background: var(--copper);
  box-shadow: 0 0 0 0.3rem rgba(184, 107, 56, 0.13);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(22rem, 0.8fr);
  gap: 1rem;
  margin-bottom: 1rem;
}

.hero-panel,
.brain-panel,
.panel {
  border-radius: 1.7rem;
  background: rgba(251, 245, 233, 0.82);
}

.hero-panel {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 15rem;
  gap: 1rem;
  min-height: 18rem;
  padding: 1.4rem;
  overflow: hidden;
}

.hero-panel::before {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 0.4rem;
  background: repeating-linear-gradient(90deg, var(--signal) 0 1rem, transparent 1rem 1.6rem, var(--copper) 1.6rem 2.05rem);
}

.hero-copy h3 {
  max-width: 52rem;
  font-size: clamp(2rem, 4.8vw, 5.7rem);
  line-height: 0.86;
}

.hero-copy p:last-child,
.brain-panel p {
  max-width: 42rem;
  color: var(--ink-soft);
  line-height: 1.7;
}

.signal-orbit {
  position: relative;
  align-self: center;
  justify-self: center;
  display: grid;
  place-items: center;
  width: 14rem;
  height: 14rem;
}

.signal-orbit span {
  position: absolute;
  inset: calc(var(--i, 0) * 1.1rem);
  border: 1px solid rgba(16, 20, 20, 0.18);
  border-radius: 50%;
  animation: breathe 3.4s ease-in-out infinite;
}

.signal-orbit span:nth-child(1) {
  --i: 0;
}

.signal-orbit span:nth-child(2) {
  --i: 2;
  animation-delay: 300ms;
}

.signal-orbit span:nth-child(3) {
  --i: 4;
  animation-delay: 600ms;
}

.signal-orbit b {
  display: grid;
  place-items: center;
  width: 5.2rem;
  height: 5.2rem;
  border-radius: 1.5rem;
  color: var(--paper);
  background: var(--night);
  font-family: var(--serif);
  font-size: 1.65rem;
}

.brain-panel {
  padding: 1.25rem;
}

.brain-route {
  display: grid;
  gap: 0.55rem;
  margin: 1.4rem 0;
}

.brain-route span {
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.33);
  font-weight: 700;
}

.brain-route i {
  width: 1px;
  height: 1rem;
  margin-left: 1.2rem;
  background: var(--copper);
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.metric-card {
  min-height: 9rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 1.35rem;
  background: rgba(251, 245, 233, 0.74);
  animation: rise 520ms ease both;
}

.metric-card strong {
  display: block;
  margin: 0.5rem 0 0.25rem;
  font-family: var(--serif);
  font-size: 2.5rem;
  line-height: 0.9;
}

.metric-card span {
  color: var(--ink-soft);
  font-size: 0.75rem;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(19rem, 0.65fr);
  gap: 1rem;
}

.panel {
  padding: 1.2rem;
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}

.panel-heading h3 {
  font-size: 2rem;
}

.panel-heading h3 span {
  color: var(--copper);
}

.table-shell {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 1.2rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 46rem;
}

th,
td {
  padding: 0.9rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  background: rgba(16, 20, 20, 0.06);
  color: var(--ink-soft);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

td {
  font-size: 0.82rem;
}

tr:last-child td {
  border-bottom: 0;
}

.status {
  display: inline-flex;
  padding: 0.35rem 0.5rem;
  border-radius: 999px;
  color: var(--paper);
  background: var(--signal);
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
}

.status.watch {
  background: var(--copper);
}

.status.danger {
  background: var(--danger);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.mini-card {
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 1.15rem;
  background: rgba(255, 255, 255, 0.28);
}

.mini-card strong {
  display: block;
  margin-bottom: 0.4rem;
  font-family: var(--serif);
  font-size: 1.35rem;
}

.mini-card p {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.55;
  font-size: 0.82rem;
}

.contract-list {
  display: grid;
  gap: 0.7rem;
}

.contract-item {
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.24);
}

.contract-item strong {
  display: block;
  margin-bottom: 0.3rem;
}

.contract-item span {
  color: var(--ink-soft);
  font-size: 0.74rem;
  line-height: 1.45;
}

.timeline {
  display: grid;
  gap: 0.8rem;
}

.timeline-item {
  display: grid;
  grid-template-columns: 8rem minmax(0, 1fr);
  gap: 0.8rem;
  padding: 0.9rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.22);
}

.timeline-item time {
  color: var(--copper);
  font-weight: 700;
  font-size: 0.72rem;
}

.timeline-item p {
  margin: 0;
  line-height: 1.55;
}

@keyframes breathe {
  0%,
  100% {
    transform: scale(0.95);
    opacity: 0.55;
  }
  50% {
    transform: scale(1.02);
    opacity: 1;
  }
}

@keyframes rise {
  from {
    transform: translateY(0.9rem);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@media (max-width: 1120px) {
  .app-shell,
  .hero-grid,
  .content-grid {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: relative;
    top: 0;
    height: auto;
  }

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

  .hero-panel {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .app-shell {
    width: min(100vw - 0.8rem, 100%);
    margin: 0.4rem auto;
  }

  .workspace,
  .sidebar {
    border-radius: 1.35rem;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .metrics-grid,
  .card-grid,
  .nav-stack {
    grid-template-columns: 1fr;
  }

  .hero-copy h3 {
    font-size: 2.6rem;
  }

  .signal-orbit {
    width: 10rem;
    height: 10rem;
  }

  .timeline-item {
    grid-template-columns: 1fr;
  }
}


.login-strip {
  display: grid;
  grid-template-columns: minmax(16rem, 1fr) repeat(5, minmax(7rem, auto));
  gap: 0.75rem;
  align-items: end;
  padding: 1rem;
  margin-bottom: 1rem;
  border: 1px solid var(--line);
  border-radius: 1.25rem;
  background: rgba(16, 20, 20, 0.06);
}
.login-strip h3,
.login-strip p { margin: 0; }
.login-strip label,
.contact-form input { display: grid; gap: 0.3rem; font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-soft); }
.login-strip input,
.contact-form input {
  width: 100%;
  padding: 0.78rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  background: rgba(251, 245, 233, 0.88);
  color: var(--ink);
  font: 700 0.85rem var(--mono);
}
.login-strip button,
.panel-heading button,
.detail-btn,
.contact-form button,
#back-dashboard {
  padding: 0.82rem 0.95rem;
  border: 1px solid rgba(16, 20, 20, 0.18);
  border-radius: 0.85rem;
  background: var(--night);
  color: var(--paper);
  cursor: pointer;
  font-weight: 700;
}
.split-lab { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(20rem, 0.8fr); gap: 1rem; margin-top: 1rem; }
.contact-form { display: grid; grid-template-columns: 1fr 1fr 0.7fr auto; gap: 0.55rem; margin: 0.75rem 0; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-top: 1rem; }
.detail-panel { padding: 1rem; border: 1px solid var(--line); border-radius: 1.2rem; background: rgba(251, 245, 233, 0.78); overflow: auto; max-height: 34rem; }
.quote-row { padding: 0.8rem 0; border-bottom: 1px solid var(--line); }
.quote-row p { margin: 0.35rem 0; font-family: var(--serif); font-size: 1.25rem; }
.quote-row span { display: block; color: var(--signal); }
.quote-row small,
.mini-card small { display: block; margin-top: 0.45rem; color: var(--ink-soft); }
pre { white-space: pre-wrap; overflow-wrap: anywhere; padding: 0.7rem; border-radius: 0.8rem; background: rgba(16, 20, 20, 0.08); font-size: 0.72rem; }
.mode-tag.danger { background: rgba(178, 69, 51, 0.16); color: var(--danger); }
.mode-tag.watch { background: rgba(184, 107, 56, 0.16); color: var(--copper); }
code { font-family: var(--mono); font-size: 0.72rem; }
@media (max-width: 980px) {
  .login-strip,
  .split-lab,
  .detail-grid,
  .contact-form { grid-template-columns: 1fr; }
}
