:root {
  --ink: #182432;
  --muted: #667383;
  --line: #d9dee4;
  --ivory: #f7f4ed;
  --paper: #ffffff;
  --blue: #314e68;
  --blue-dark: #20384e;
  --gold: #a58a52;
  --soft-blue: #edf2f6;
  --shadow: 0 18px 50px rgba(24, 36, 50, 0.07);

  --page-bg: var(--ivory);
  --card-bg: var(--paper);
  --header-bg: rgba(247, 244, 237, 0.94);
  --input-bg: #ffffff;
}


html[data-theme="night"] {
  --ink: #edf1f4;
  --muted: #aeb9c3;
  --line: #394754;
  --ivory: #111920;
  --paper: #18232d;
  --blue: #9db3c5;
  --blue-dark: #d6e0e7;
  --gold: #c0a56e;
  --soft-blue: #202d38;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.22);

  --page-bg: #111920;
  --card-bg: #18232d;
  --header-bg: rgba(17, 25, 32, 0.94);
  --input-bg: #14202a;
}


* {
  box-sizing: border-box;
}


html {
  scroll-behavior: smooth;
}


body {
  margin: 0;
  background: var(--page-bg);
  color: var(--ink);
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}


button,
select {
  font: inherit;
}


a {
  color: inherit;
}


.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: var(--header-bg);
  backdrop-filter: blur(14px);
}


.site-header-inner {
  width: min(1180px, calc(100% - 40px));
  min-height: 78px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}


.brand {
  display: flex;
  flex-direction: column;
  gap: 3px;
  text-decoration: none;
}


.brand-eyebrow,
.eyebrow,
.section-kicker,
.artifact-engine {
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}


.brand-name {
  font-family:
    Georgia,
    "Times New Roman",
    serif;
  font-size: 1.22rem;
  font-weight: 700;
}


.site-nav {
  display: flex;
  align-items: center;
  gap: 20px;
}


.site-nav a {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
}


.site-nav a:hover {
  color: var(--ink);
}


.theme-toggle {
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card-bg);
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}


.publication-shell {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 58px 0 38px;
}


.workspace-intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 40px;
  margin-bottom: 32px;
}


.workspace-intro h1,
.figure8-copy h2,
.workspace-toolbar h2,
.publication-principle h2 {
  margin: 0;
  font-family:
    Georgia,
    "Times New Roman",
    serif;
  color: var(--ink);
}


.workspace-intro h1 {
  margin-top: 8px;
  font-size: clamp(2.4rem, 5vw, 4.8rem);
  line-height: 0.98;
  letter-spacing: -0.035em;
}


.intro-copy {
  max-width: 680px;
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.75;
}


.workspace-seal {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.09em;
}


.seal-mark {
  width: 56px;
  height: 56px;
  border: 1px solid var(--gold);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--blue-dark);
  font-family:
    Georgia,
    "Times New Roman",
    serif;
  font-size: 1rem;
  font-weight: 700;
}


.figure8-panel {
  margin: 30px 0;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card-bg);
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 36px;
  align-items: center;
}


.figure8-copy h2 {
  margin-top: 7px;
  font-size: 1.65rem;
}


.figure8-copy p:last-child {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.65;
}


.figure8-flow {
  padding: 20px;
  border-radius: 14px;
  background: var(--soft-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--blue-dark);
  font-size: 0.84rem;
  font-weight: 800;
}


.flow-arrow {
  color: var(--gold);
}


.status-banner {
  margin: 24px 0;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--soft-blue);
  color: var(--blue-dark);
}


.status-banner[data-state="error"] {
  border-color: #a86b6b;
}


.workspace-toolbar {
  margin-top: 42px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 28px;
}


.workspace-toolbar h2 {
  margin-top: 6px;
  font-size: 2rem;
}


.toolbar-controls {
  display: flex;
  gap: 12px;
}


.filter-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}


.filter-field select {
  min-width: 160px;
  height: 42px;
  padding: 0 34px 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--input-bg);
  color: var(--ink);
}


.publication-summary {
  margin: 22px 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: var(--card-bg);
}


.publication-summary article {
  min-height: 98px;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
}


.publication-summary article + article {
  border-left: 1px solid var(--line);
}


.summary-label {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}


.publication-summary strong {
  font-family:
    Georgia,
    "Times New Roman",
    serif;
  font-size: 1.75rem;
}


.artifact-section {
  min-height: 260px;
}


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


.artifact-card {
  position: relative;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card-bg);
  box-shadow: var(--shadow);
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    border-color 160ms ease;
}


.artifact-card:hover {
  transform: translateY(-2px);
  border-color: rgba(165, 138, 82, 0.55);
  box-shadow: 0 22px 60px rgba(24, 36, 50, 0.11);
}


.artifact-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}


.artifact-mark {
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--soft-blue);
  display: grid;
  place-items: center;
  color: var(--blue-dark);
  font-family:
    Georgia,
    "Times New Roman",
    serif;
  font-weight: 700;
}


.artifact-status {
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}


.artifact-status[data-status="published"] {
  border-color: rgba(165, 138, 82, 0.55);
  color: var(--gold);
}


.artifact-heading {
  margin-top: 22px;
}


.artifact-heading h3 {
  margin: 6px 0 0;
  font-family:
    Georgia,
    "Times New Roman",
    serif;
  font-size: 1.45rem;
  line-height: 1.2;
}


.artifact-engine {
  margin: 0;
}


.artifact-description {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.6;
}


.artifact-tags {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}


.artifact-tags span {
  padding: 6px 9px;
  border-radius: 999px;
  background: var(--soft-blue);
  color: var(--blue-dark);
  font-size: 0.75rem;
  font-weight: 700;
}


.artifact-details {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}


.artifact-details div {
  min-width: 0;
}


.artifact-details span {
  display: block;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}


.artifact-details strong {
  display: block;
  margin-top: 5px;
  font-size: 0.88rem;
  overflow-wrap: anywhere;
}


.artifact-actions {
  margin-top: 22px;
  display: flex;
  justify-content: flex-end;
  gap: 9px;
}


.button {
  min-height: 40px;
  padding: 0 15px;
  border-radius: 10px;
  font-weight: 800;
}


.button-secondary {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
}


.button-publish {
  border: 1px solid var(--gold);
  background: var(--gold);
  color: #ffffff;
}


.button:disabled {
  cursor: default;
  opacity: 0.58;
}


.empty-state {
  padding: 70px 24px;
  border: 1px dashed var(--line);
  border-radius: 18px;
  background: var(--card-bg);
  text-align: center;
}


.empty-mark {
  width: 58px;
  height: 58px;
  margin: 0 auto;
  border: 1px solid var(--gold);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--gold);
  font-family:
    Georgia,
    "Times New Roman",
    serif;
  font-weight: 700;
}


.empty-state h3 {
  margin: 18px 0 7px;
  font-family:
    Georgia,
    "Times New Roman",
    serif;
  font-size: 1.4rem;
}


.empty-state p {
  max-width: 520px;
  margin: 0 auto;
  color: var(--muted);
  line-height: 1.65;
}


.publication-principle {
  margin-top: 42px;
  padding: 30px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 40px;
  align-items: center;
}


.publication-principle h2 {
  margin-top: 7px;
  font-size: 1.7rem;
}


.publication-principle > p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}


.publication-footer {
  margin-top: 48px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 20px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.07em;
}


@media (max-width: 820px) {

  .site-header-inner,
  .workspace-intro,
  .workspace-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .site-header-inner {
    padding: 16px 0;
  }

  .site-nav {
    flex-wrap: wrap;
  }

  .workspace-seal {
    align-self: flex-start;
  }

  .figure8-panel,
  .publication-principle {
    grid-template-columns: 1fr;
  }

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

  .toolbar-controls {
    width: 100%;
    flex-direction: column;
  }

  .filter-field select {
    width: 100%;
  }
}


@media (max-width: 560px) {

  .publication-shell,
  .site-header-inner {
    width: min(
      100% - 28px,
      1180px
    );
  }

  .publication-summary {
    grid-template-columns: 1fr;
  }

  .publication-summary article + article {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .artifact-details {
    grid-template-columns: 1fr;
  }

  .artifact-actions {
    flex-direction: column;
  }

  .button {
    width: 100%;
  }

  .publication-footer {
    flex-direction: column;
  }
}

/* ============================================================
   PUBLICATION WORKSPACE
   ARTIFACT PREVIEW + PUBLICATION CONTROL
   ============================================================ */


.button-danger {
  border: 1px solid rgba(166, 77, 77, 0.42);
  background: transparent;
  color: #a64d4d;
}


.button-danger:hover {
  background: rgba(166, 77, 77, 0.07);
}


.button-quiet {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
}


.button-quiet:hover {
  color: var(--ink);
  border-color: var(--gold);
}


.button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}


.artifact-card[data-queued="false"] {
  opacity: 0.78;
}


.artifact-card[data-queued="false"]::after {
  content: "Removed from publication queue";
  position: absolute;
  top: 22px;
  right: 72px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card-bg);
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}


/* ============================================================
   DIALOG
   ============================================================ */


.artifact-dialog {
  width: min(760px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--card-bg);
  color: var(--ink);
  box-shadow:
    0 28px 90px rgba(20, 33, 61, 0.22);
}


.artifact-dialog::backdrop {
  background: rgba(13, 24, 48, 0.58);
  backdrop-filter: blur(3px);
}


.dialog-shell {
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
}


.dialog-header {
  padding: 24px 26px 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}


.dialog-header h2 {
  margin: 5px 0 0;
  font-family:
    Georgia,
    "Times New Roman",
    serif;
  font-size: clamp(1.55rem, 3vw, 2.15rem);
  font-weight: 500;
  line-height: 1.15;
}


.dialog-eyebrow {
  margin: 0;
  color: var(--gold);
  font-family:
    Georgia,
    "Times New Roman",
    serif;
  font-size: 0.82rem;
  font-style: italic;
}


.dialog-close {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  font-size: 1.45rem;
  line-height: 1;
  cursor: pointer;
}


.dialog-body {
  padding: 24px 26px;
  overflow-y: auto;
}


.preview-description {
  margin: 0 0 22px;
  color: var(--muted);
  line-height: 1.7;
}


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


.preview-field {
  padding: 14px 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--soft-blue);
}


.preview-field span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}


.preview-field strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 0.9rem;
}


.preview-tags {
  margin-top: 22px;
}


.preview-tags-label {
  margin: 0 0 9px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}


.preview-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}


.preview-tag-list span {
  padding: 6px 9px;
  border-radius: 999px;
  background: var(--soft-blue);
  color: var(--blue-dark);
  font-size: 0.75rem;
  font-weight: 700;
}


/* ============================================================
   PUBLICATION AGREEMENT
   ============================================================ */


.publication-agreement {
  margin: 0 26px 24px;
  padding: 20px;
  border: 1px solid rgba(165, 138, 82, 0.42);
  border-radius: 14px;
  background: rgba(165, 138, 82, 0.06);
}


.agreement-heading h3 {
  margin: 5px 0 0;
  font-family:
    Georgia,
    "Times New Roman",
    serif;
  font-size: 1.25rem;
}


.agreement-copy {
  margin-top: 15px;
  color: var(--muted);
  line-height: 1.6;
}


.agreement-copy p {
  margin: 10px 0 0;
}


.agreement-check {
  margin-top: 18px;
  display: flex;
  align-items: flex-start;
  gap: 11px;
  cursor: pointer;
  line-height: 1.5;
}


.agreement-check input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--gold);
}


.dialog-actions {
  padding: 18px 26px 24px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}


@media (max-width: 680px) {

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

  .artifact-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .artifact-actions .button {
    width: 100%;
  }

  .artifact-card[data-queued="false"]::after {
    position: static;
    display: inline-block;
    margin-top: 14px;
  }

  .dialog-header,
  .dialog-body,
  .dialog-actions {
    padding-left: 18px;
    padding-right: 18px;
  }

  .publication-agreement {
    margin-left: 18px;
    margin-right: 18px;
  }

}
