
/* ============================================================
   MEDATLAS COMMAND CENTER
   INSTITUTIONAL WORKSPACE DESIGN
   Day mode default | Night mode optional
   ============================================================ */

:root {
  color-scheme: light;
  --navy: #14213d;
  --deep-navy: #0d1830;
  --soft-navy: #263654;
  --gold: #ad7a20;
  --deep-gold: #8d6118;
  --soft-gold: #d7b56f;
  --ivory: #faf7ef;
  --paper: #fffdf8;
  --text: #1d2a42;
  --muted: #6b7688;
  --border: #e6dfd1;
  --surface: #ffffff;
  --surface-alt: #f1eadc;
  --page: #faf7ef;
  --shadow: 0 14px 45px rgba(20,33,61,.065);
  --shadow-lg: 0 24px 65px rgba(20,33,61,.11);
  --hero-bg: #14213d;
  --hero-text: #faf7ef;
  --hero-muted: #c9d2e1;
  --code-bg: #f3f0e9;
  --success: #247454;
  --danger: #a34343;
  --heading-font: Georgia, "Times New Roman", serif;
  --body-font: Inter, "Segoe UI", Arial, sans-serif;
}

body[data-theme="night"] {
  color-scheme: dark;
  --text: #f2efe8;
  --muted: #aab5c9;
  --border: #35445e;
  --surface: #18263e;
  --surface-alt: #23334f;
  --page: #0d1830;
  --shadow: 0 16px 50px rgba(0,0,0,.19);
  --shadow-lg: 0 26px 70px rgba(0,0,0,.26);
  --hero-bg: #101c35;
  --hero-text: #faf7ef;
  --hero-muted: #bac6da;
  --code-bg: #101c31;
  --success: #73cda7;
  --danger: #f0a3a3;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font-family: var(--body-font);
  line-height: 1.55;
  transition: background .25s ease, color .25s ease;
}

button, textarea, input { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
[hidden] { display: none !important; }

button:focus-visible,
a:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

body.cc-pending .workspace-shell { display: none; }
body:not(.cc-pending) .auth-checking { display: none; }

.auth-checking {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
  text-align: center;
}

.auth-checking-inner {
  max-width: 440px;
}

.auth-symbol {
  width: 68px;
  height: 68px;
  display: grid;
  place-items: center;
  margin: 0 auto 20px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  color: var(--gold);
  font: bold 36px var(--heading-font);
}

.auth-checking h1 {
  font: normal 29px var(--heading-font);
}

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

.eyebrow {
  display: block;
  color: var(--gold);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .17em;
  text-transform: uppercase;
}

.gold-text { color: var(--soft-gold); }

/* HEADER */

.masthead {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.masthead-inner {
  max-width: 1440px;
  min-height: 90px;
  padding: 18px 34px;
  margin: auto;
  display: flex;
  align-items: center;
  gap: 32px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  text-decoration: none;
  flex-shrink: 0;
}

.brand-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 2px solid var(--gold);
  border-radius: 50%;
  background: var(--navy);
  color: var(--soft-gold);
  font: bold 25px var(--heading-font);
}

.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-name {
  font: bold 24px var(--heading-font);
  letter-spacing: -.025em;
}

.brand-sub {
  color: var(--gold);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .18em;
}

.masthead-title {
  padding-left: 28px;
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.masthead-title strong {
  font: normal 19px var(--heading-font);
}

.header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  flex-wrap: wrap;
}

.header-actions a,
.header-actions button {
  padding: 9px 13px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  font-size: 12px;
  font-weight: 650;
  text-decoration: none;
}

.header-actions a:hover,
.header-actions button:hover {
  background: var(--surface-alt);
}

.header-actions .theme-toggle {
  border-color: var(--border);
}

.header-actions .logout-button {
  background: var(--navy);
  color: #ffffff;
}

.header-actions .logout-button:hover {
  background: var(--soft-navy);
}

/* PAGE */

.workspace {
  max-width: 1440px;
  margin: auto;
  padding: 30px 34px 90px;
}

/* HERO */

.hero {
  position: relative;
  min-height: 350px;
  padding: 54px 55px;
  overflow: hidden;
  border-radius: 15px;
  background:
    radial-gradient(circle at 80% 50%,
      rgba(173,122,32,.18), transparent 45%),
    linear-gradient(115deg,
      var(--hero-bg), #263654);
  color: var(--hero-text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
}

.hero-content {
  max-width: 680px;
  position: relative;
  z-index: 2;
}

.hero h1 {
  margin: 17px 0;
  font: normal clamp(42px,5vw,66px)/1.05
    var(--heading-font);
  letter-spacing: -.045em;
}

.hero h1 em {
  color: var(--soft-gold);
  font-style: normal;
}

.hero-description {
  max-width: 560px;
  color: var(--hero-muted);
  font-size: 15px;
  line-height: 1.8;
}

.hero-indicators {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 30px;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 5px;
  background: rgba(255,255,255,.06);
  font-size: 11px;
}

.chip-label {
  color: #b7c3d5;
  font-size: 9px;
  letter-spacing: .08em;
}

.status-dot,
.output-indicator {
  width: 7px;
  height: 7px;
  flex-shrink: 0;
  border-radius: 50%;
  background: #83cda7;
}

.hero-art {
  position: relative;
  width: 360px;
  min-width: 290px;
  height: 240px;
  display: grid;
  place-items: center;
  color: var(--soft-gold);
  opacity: .9;
}

.art-orbit {
  position: absolute;
  border: 1px solid rgba(215,181,111,.17);
  border-radius: 50%;
}

.art-orbit-one { width: 270px; height: 270px; }
.art-orbit-two { width: 210px; height: 210px; }

.art-core {
  position: relative;
  width: 100%;
  filter: drop-shadow(0 0 12px rgba(215,181,111,.18));
}

.art-core svg { width: 100%; }

.art-caption {
  position: absolute;
  bottom: -5px;
  white-space: nowrap;
  font-size: 8px;
  letter-spacing: .15em;
  color: #c6b38b;
}

/* OVERVIEW */

.overview-strip {
  display: grid;
  grid-template-columns: repeat(4,minmax(0,1fr));
  margin: 20px 0 56px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.overview-item {
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 24px 27px;
  gap: 5px;
}

.overview-item + .overview-item {
  border-left: 1px solid var(--border);
}

.overview-label {
  color: var(--gold);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .12em;
}

.overview-item strong {
  font: normal 27px var(--heading-font);
}

.overview-detail {
  color: var(--muted);
  font-size: 11px;
}

/* SECTIONS */

.section-block { margin-top: 60px; }

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.section-heading h2 {
  margin: 7px 0;
  font: normal 35px var(--heading-font);
  letter-spacing: -.03em;
}

.section-heading p {
  margin: 0;
  max-width: 670px;
  color: var(--muted);
  font-size: 13px;
}

.section-tag {
  flex-shrink: 0;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--gold);
  background: var(--surface);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .1em;
}

/* FEATURE CARDS */

.featured-grid {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 18px;
}

.feature-card {
  width: 100%;
  min-height: 268px;
  display: flex;
  flex-direction: column;
  text-align: left;
  padding: 27px;
  border: 1px solid var(--border);
  border-top: 3px solid var(--gold);
  border-radius: 11px;
  background: var(--surface);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: var(--text);
  transition: transform .18s, box-shadow .18s;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.feature-top,
.feature-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.feature-symbol {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-alt);
  color: var(--gold);
  font: normal 27px var(--heading-font);
}

.feature-tag {
  color: var(--gold);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .1em;
}

.feature-card h3 {
  margin: 22px 0 8px;
  font: normal 26px var(--heading-font);
}

.feature-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.feature-bottom {
  margin-top: auto;
  padding-top: 22px;
  color: var(--gold);
  font-size: 11px;
  font-weight: 700;
}

.feature-arrow { font-size: 23px; }

/* PRIME */

.prime-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.prime-input-panel,
.prime-output-panel {
  min-width: 0;
  padding: 25px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.field-label {
  display: block;
  margin-bottom: 10px;
  font-size: 12px;
  font-weight: 800;
}

#apMsg {
  width: 100%;
  min-height: 160px;
  padding: 15px;
  resize: vertical;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--page);
  color: var(--text);
  font-size: 13px;
}

.prime-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 15px;
}

.prime-controls button,
.text-button {
  padding: 10px 13px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--text);
  font-size: 12px;
  font-weight: 750;
}

.prime-controls .action-button {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}

.prime-controls .danger-button {
  color: var(--danger);
}

.prime-controls button:disabled {
  opacity: .45;
  cursor: wait;
}

.pulse-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
  font-size: 11px;
}

.pulse-meta span { color: var(--muted); }
.pulse-meta strong {
  font-family: Consolas, monospace;
  overflow-wrap: anywhere;
}

.output-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.output-status {
  color: var(--muted);
  font-size: 12px;
}

#apOut {
  min-height: 220px;
  max-height: 480px;
  overflow: auto;
  padding: 17px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--code-bg);
  color: var(--text);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: 12px/1.65 Consolas, monospace;
}

/* ENGINE DIRECTORY */

.engine-grid {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 16px;
}

.engine-card {
  min-height: 185px;
  display: flex;
  flex-direction: column;
  position: relative;
  padding: 23px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow);
  color: var(--text);
  text-decoration: none;
  transition: transform .18s, box-shadow .18s;
}

.engine-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.engine-card h3 {
  margin: 13px 0 7px;
  font: normal 22px var(--heading-font);
}

.engine-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.engine-card .engine-meta {
  margin-top: auto;
  padding-top: 18px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--gold);
  font-size: 10px;
  font-weight: 750;
}

.engine-index {
  color: var(--gold);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .12em;
}

.tile-tools {
  position: absolute;
  top: 16px;
  right: 16px;
  display: flex;
  gap: 5px;
}

.tile-tools button {
  width: 27px;
  height: 27px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface-alt);
  color: var(--text);
}

.directory-status,
.directory-hint,
.debug-line {
  margin-top: 17px;
  color: var(--muted);
  font-size: 12px;
}

.debug-line {
  font-family: Consolas, monospace;
  overflow-wrap: anywhere;
}

/* UTILITIES */

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

.utility-card {
  min-height: 165px;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 23px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
}

.utility-card:hover {
  border-color: var(--gold);
}

.utility-icon {
  color: var(--gold);
  font-size: 26px;
}

.utility-card strong {
  margin-top: 7px;
  font: normal 19px var(--heading-font);
}

.utility-card > span:nth-last-child(2) {
  color: var(--muted);
  font-size: 11px;
}

.utility-arrow {
  position: absolute;
  right: 19px;
  top: 19px;
  color: var(--gold);
  font-size: 20px;
}

/* FOOTER */

.workspace-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.footer-inner {
  max-width: 1440px;
  margin: auto;
  padding: 25px 34px;
  display: flex;
  justify-content: space-between;
  gap: 15px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 11px;
}

.footer-inner a {
  color: var(--gold);
  text-decoration: none;
}

/* RESPONSIVE */

@media (max-width: 1120px) {
  .masthead-inner { flex-wrap: wrap; }
  .header-actions { width: 100%; justify-content: flex-start; }
  .hero-art { width: 280px; min-width: 240px; }
  .engine-grid { grid-template-columns: repeat(2,1fr); }
  .utility-grid { grid-template-columns: repeat(2,1fr); }
}

@media (max-width: 760px) {
  .masthead-inner { padding: 17px; gap: 18px; }
  .masthead-title { padding-left: 15px; }
  .workspace { padding: 18px 16px 60px; }
  .hero { padding: 36px 27px; min-height: auto; }
  .hero-art { display: none; }
  .overview-strip { grid-template-columns: repeat(2,1fr); }
  .overview-item:nth-child(3) { border-left: none; }
  .overview-item:nth-child(n+3) {
    border-top: 1px solid var(--border);
  }
  .featured-grid,
  .prime-layout,
  .engine-grid { grid-template-columns: 1fr; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .section-heading h2 { font-size: 29px; }
  .footer-inner { padding: 22px 16px; }
}

@media (max-width: 440px) {
  .masthead-title { display: none; }
  .header-actions { gap: 5px; }
  .header-actions a,
  .header-actions button { padding: 8px; }
  .overview-strip { grid-template-columns: 1fr; }
  .overview-item + .overview-item {
    border-left: none;
    border-top: 1px solid var(--border);
  }
  .utility-grid { grid-template-columns: 1fr; }
}

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


/* ============================================================
   MEDATLAS COMMAND CENTER
   ARCHITECT DIVISIONS — INSTITUTIONAL DESIGN
   ============================================================ */

.architect-divisions {
  margin-top: 54px;
}

.divisions-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.division-card {
  position: relative;
  min-height: 270px;

  display: flex;
  flex-direction: column;

  padding: 27px;

  border: 1px solid var(--border);
  border-radius: 11px;

  background: var(--surface);
  color: var(--text);

  box-shadow: var(--shadow);

  text-decoration: none;

  transition:
    transform .2s ease,
    box-shadow .2s ease,
    border-color .2s ease;

  overflow: hidden;
}

.division-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--gold);
  opacity: .75;
}

.division-card:hover {
  transform: translateY(-4px);
  border-color: var(--gold);
  box-shadow: var(--shadow-lg);
}

.division-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.division-icon {
  width: 48px;
  height: 48px;

  display: grid;
  place-items: center;

  border: 1px solid var(--border);
  border-radius: 50%;

  background: var(--surface-alt);
  color: var(--gold);

  font: normal 28px var(--heading-font);
}

.division-number {
  color: var(--gold);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .13em;
}

.division-card h3 {
  margin: 23px 0 9px;

  font: normal 27px var(--heading-font);
  letter-spacing: -.025em;
}

.division-card p {
  margin: 0;

  color: var(--muted);

  font-size: 13px;
  line-height: 1.7;
}

.division-bottom {
  margin-top: auto;
  padding-top: 24px;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;

  color: var(--gold);

  font-size: 10px;
  font-weight: 800;
  letter-spacing: .09em;
}

.division-arrow {
  font-size: 23px;
  font-weight: 400;
  line-height: 1;
}

/* NIGHT MODE */

body[data-theme="night"] .division-card {
  background: var(--surface);
  border-color: var(--border);
}

body[data-theme="night"] .division-card:hover {
  border-color: var(--soft-gold);
}

body[data-theme="night"] .division-icon {
  color: var(--soft-gold);
}

body[data-theme="night"] .division-bottom {
  color: var(--soft-gold);
}

/* RESPONSIVE */

@media (max-width: 1100px) {
  .divisions-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

  .division-card {
    min-height: 245px;
  }
}

