/* CleftLabs Workstation Stylesheet for Technical Reports (TR-01 .. TR-08) */
*, *::before, *::after { box-sizing: border-box; }

:root {
  --desk: #233c44;
  --plat: #dad7ce;
  --plat-hi: #f4f2ec;
  --plat-lo: #8d8a80;
  --ink: #111316;
  --ink-soft: #26292e;
  --muted: #50535a;
  --blue: #1b4d7e;
  --amber: #e09124;
  --rust: #a33a20;
  --green: #166534;
  --rule: #c4c0b6;
  --paper: #eae7de;
  --sheet: #f4f2ec;
  --sticky: #fbf1c7;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

html {
  background-color: var(--desk);
  background-image:
    radial-gradient(rgba(255,255,255,0.08) 1px, transparent 1px),
    radial-gradient(rgba(0,0,0,0.18) 1px, transparent 1px);
  background-size: 8px 8px;
  background-position: 0 0, 4px 4px;
}

body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  color: var(--ink);
}

/* Top Workstation Menu Bar (matches index.html) */
.menubar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--plat);
  border-bottom: 2px solid var(--ink);
  box-shadow: inset 0 1px 0 var(--plat-hi), 0 2px 8px rgba(0,0,0,0.22);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
}
.menubar-in {
  max-width: 1080px;
  margin: 0 auto;
  padding: 9px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.mb-l { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.mb-logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0.06em;
  color: var(--ink);
  text-decoration: none;
  font-weight: 800;
}
.mb-l a:not(.mb-logo) { color: var(--ink); text-decoration: none; font-weight: 600; }
.mb-l a:hover { color: var(--blue); }
.mb-r { font-size: 11px; color: #3d3e42; display: flex; gap: 14px; white-space: nowrap; }

/* Workspace Container */
.paper-wrap {
  max-width: 980px;
  width: 100%;
  margin: 0 auto;
  padding: 20px 20px 32px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
}

/* SGI Window Chrome */
.win {
  background: var(--plat);
  border: 2px solid var(--ink);
  box-shadow: 5px 5px 0 rgba(0,0,0,0.42), inset 1px 1px 0 var(--plat-hi);
}
.w-bar {
  background: var(--blue);
  color: #fff;
  padding: 7px 11px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  border-bottom: 1.5px solid var(--ink);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
}
.w-bar.dark { background: #1c2026; }
.w-dots { display: inline-flex; gap: 5px; flex-shrink: 0; }
.w-box { width: 10px; height: 10px; background: var(--plat); border: 1px solid var(--ink); display: inline-block; }
.w-body { padding: 12px; }

/* Report Switcher Bar (TR-01 .. TR-08) */
.rep-nav {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 5px;
}
.rep-btn {
  display: block;
  text-align: center;
  background: var(--plat);
  color: var(--ink);
  text-decoration: none;
  border: 1.5px solid var(--ink);
  box-shadow: inset 1px 1px 0 var(--plat-hi), inset -1px -1px 0 var(--plat-lo);
  padding: 6px 4px;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 800;
}
.rep-btn:hover { background: #e6e3db; }
.rep-btn.active {
  background: var(--ink);
  color: #fff;
  box-shadow: none;
}
.rep-btn.fix:not(.active) { color: var(--rust); }

/* Document Interior Sheet */
.paper-sheet {
  background: var(--sheet);
  border: 1.5px inset #9a978e;
  padding: 34px 42px 38px;
}
.kicker {
  font-family: var(--mono);
  font-size: 10.8px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--blue);
  margin: 0 0 10px;
}
.paper-meta {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink-soft);
  background: var(--paper);
  border: 1.5px solid var(--ink);
  padding: 12px 15px;
  margin-bottom: 22px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}
.paper-meta strong { color: var(--ink); }
.paper-sheet h1 {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: clamp(1.48rem, 2.7vw, 2.05rem);
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: -0.02em;
  margin: 0 0 16px;
  color: var(--ink);
}
.paper-sheet h2 {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 30px 0 11px;
  padding-top: 14px;
  border-top: 1.5px solid var(--rule);
  color: var(--ink);
}
.paper-sheet h3 {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 800;
  color: var(--blue);
  margin: 20px 0 8px;
}
.paper-sheet p,
.paper-sheet li {
  font-size: 14.5px;
  color: var(--ink-soft);
  line-height: 1.68;
  overflow-wrap: anywhere;
}
.paper-sheet ul,
.paper-sheet ol {
  padding-left: 22px;
  margin: 10px 0 16px;
}
.paper-sheet li { margin-bottom: 6px; }
.paper-sheet a {
  color: var(--blue);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.paper-sheet a:hover { color: var(--rust); }
.paper-sheet code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: var(--paper);
  border: 1px solid var(--rule);
  padding: 1px 5px;
  color: var(--ink);
}
.paper-sheet pre {
  background: #0c1210;
  color: #6df2a4;
  border: 2px inset #5e5c55;
  padding: 12px 14px;
  font-family: var(--mono);
  font-size: 11.8px;
  line-height: 1.55;
  overflow-x: auto;
  margin: 16px 0;
}
.paper-sheet pre code {
  background: none;
  border: none;
  padding: 0;
  color: inherit;
}

/* Abstract & Errata Callout Boxes */
.abstract-box {
  background: #ffffff;
  border: 1.5px solid var(--ink);
  border-left: 5px solid var(--blue);
  padding: 15px 18px;
  margin: 18px 0 22px;
}
.abstract-box[style*="amber"] {
  background: var(--sticky);
  border-left-width: 5px;
}
.abstract-box p {
  margin: 0;
  font-size: 13.8px;
  line-height: 1.62;
  color: var(--ink);
}
.abstract-box p + p { margin-top: 10px; }

/* Equation Blocks */
.eq {
  background: var(--paper);
  border: 1.5px inset #9a978e;
  border-left: 4px solid var(--blue);
  padding: 12px 16px;
  font-family: var(--mono);
  font-size: 12.2px;
  line-height: 1.68;
  color: var(--ink);
  margin: 16px 0;
  overflow-x: auto;
}

/* Ledger Tables (.ptable & .data-table) */
.ptable-wrap,
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 18px 0 22px;
  border: 1.5px solid var(--ink);
  background: #ffffff;
}
table.ptable,
table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
table.ptable th,
table.ptable td,
table.data-table th,
table.data-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--rule);
  text-align: left;
  vertical-align: top;
}
table.ptable th,
table.data-table th {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #f4f2ec;
  background: #1c2026;
  border-bottom: 1.5px solid var(--ink);
}
table.ptable tbody tr:nth-child(even),
table.data-table tbody tr:nth-child(even) {
  background: #f7f5ef;
}
table.ptable tbody tr:hover,
table.data-table tbody tr:hover {
  background: #fff9de;
}
table.ptable td.num,
table.ptable th.num,
table.data-table td.num,
table.data-table th.num {
  text-align: right;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}
table.ptable td code,
table.data-table td code {
  white-space: nowrap;
  font-size: 11px;
}

/* Paper Bottom Prev/Next Bar */
.paper-pager {
  margin-top: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.pager-btn {
  display: inline-block;
  background: var(--plat);
  color: var(--ink);
  text-decoration: none;
  border: 1.5px solid var(--ink);
  box-shadow: inset 1px 1px 0 var(--plat-hi), inset -1px -1px 0 var(--plat-lo);
  padding: 6px 11px;
  font-family: var(--mono);
  font-size: 10.8px;
  font-weight: 800;
}
.pager-btn:hover { background: #e6e3db; }
.pager-btn.primary { background: var(--amber); box-shadow: inset 1px 1px 0 #ffd180; }

a:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 1px;
}

/* Sticky Bottom Footer Dock (matches index.html) */
.dock {
  position: sticky;
  bottom: 0;
  z-index: 20;
  margin-top: auto;
  background: var(--plat);
  border-top: 2px solid var(--ink);
  box-shadow: inset 0 1px 0 var(--plat-hi), 0 -2px 8px rgba(0,0,0,0.22);
  font-family: var(--mono);
  font-size: 11px;
}
.dock-in {
  max-width: 1080px;
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.dock a { color: var(--blue); text-decoration: none; font-weight: 700; }
.dock a:hover { text-decoration: underline; }
.dock-links { display: inline-flex; gap: 14px; flex-wrap: wrap; }

@media (max-width: 820px) {
  .mb-r { display: none; }
  .rep-nav { grid-template-columns: repeat(4, 1fr); }
  .paper-sheet { padding: 24px 20px 28px; }
}
@media (max-width: 560px) {
  .menubar-in, .dock-in { padding: 8px 12px; }
  .paper-wrap { padding: 12px 12px 24px; }
  .w-body { padding: 8px; }
  .paper-sheet { padding: 18px 14px 22px; }
  .paper-sheet h1 { font-size: 1.38rem; }
  .paper-sheet p, .paper-sheet li { font-size: 13.8px; }
  .abstract-box { padding: 12px 14px; }
  .eq { padding: 10px 12px; font-size: 11px; }
  table.ptable, table.data-table { font-size: 11.5px; }
  table.ptable th, table.ptable td,
  table.data-table th, table.data-table td { padding: 6px 8px; white-space: nowrap; }
}
