/* ==========================================================================
   PUBLICBYTES — ENGINEERING DRAWING DESIGN SYSTEM
   STYLE: APPLE INTERNAL CAD BLUEPRINT / PLOTTER SHEET
   INK: #000 ON #FFF ONLY. ONE WEIGHT (400). HAIRLINE 1PX RULES.
   SHEET 1 OF 1 — SCALE 1:1 — DO NOT SCALE DRAWING
   ========================================================================== */

/* --------------------------------------------------------------------------
   0. FONTS
   -------------------------------------------------------------------------- */
@import url('https://fonts.googleapis.com/css2?family=Share+Tech+Mono&display=swap');

@font-face {
  font-family: 'osifont';
  src: url('osifont.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #000;
  --ink-red: #C8102E;
  --paper: #fff;
  --hairline: 1px solid var(--ink);
  --frame: 2px solid var(--ink);
  --sheet-inset: 20px;   /* outer 2px frame inset from viewport edge */
  --frame-gap: 6px;      /* gap between outer frame and inner 1px rule */
  --section-gap: 140px;  /* air between top-level drawing zones */
  --markup-action-ink: var(--ink-red); /* for SVG board hover/redline markup only */
  --font-stack: 'osifont', 'Share Tech Mono', monospace;
}

/* --------------------------------------------------------------------------
   13. BASE TYPOGRAPHY / RESET
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  border-radius: 0;
  font-weight: 400;
}

html {
  background: var(--paper);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-stack);
  font-size: 14px;
  line-height: 1.6;
  text-transform: uppercase;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--ink);
  color: var(--paper);
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 400;
  margin: 0 0 0.75em 0;
  line-height: 1.2;
}
h1 { font-size: 32px; letter-spacing: 0.18em; }
h2 { font-size: 24px; letter-spacing: 0.14em; }
h3 { font-size: 18px; letter-spacing: 0.10em; }
h4 { font-size: 14px; letter-spacing: 0.08em; }

.display {
  font-size: clamp(40px, 8vw, 96px);
  letter-spacing: 0.25em;
  line-height: 1.05;
}

p { margin: 0 0 1em 0; }

a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--ink);
}

img, svg { display: block; }

hr {
  border: 0;
  border-top: var(--hairline);
  margin: 24px 0;
}

code, pre, kbd, samp { font-family: var(--font-stack); }

/* --------------------------------------------------------------------------
   1. .sheet — PAGE FRAME (DOUBLE DRAWING FRAME)
   Outer 2px border inset from viewport edge; inner 1px rule 6px inside it.
   Body has no margin; .sheet is the page wrapper.
   -------------------------------------------------------------------------- */
.sheet {
  position: relative;
  min-height: calc(100vh - 2 * var(--sheet-inset));
  margin: var(--sheet-inset);
  border: var(--frame);
  background: var(--paper);
}

/* inner 1px rule of the double frame */
.sheet::before {
  content: '';
  position: absolute;
  inset: var(--frame-gap);
  border: var(--hairline);
  pointer-events: none;
}

/* content well sits inside the inner rule */
.sheet-body {
  position: relative;
  padding: calc(var(--frame-gap) + 36px) calc(var(--frame-gap) + 24px) calc(var(--frame-gap) + 24px);
  z-index: 1;
}

.sheet-body > section {
  padding-top: 32px;
}

.sheet-body > section:first-child {
  padding-top: 0;
}

.sheet-body > section + section {
  margin-top: var(--section-gap);
}

/* --------------------------------------------------------------------------
   2. .zone-ticks — ZONE REFERENCE MARKS
   Letters (A,B,C,D...) down left/right edges; numbers (1-6) across
   top/bottom. Sit in the 6px band OUTSIDE the inner rule (on the frame gap).
   MARKUP:
     <div class="zone-ticks" aria-hidden="true">
       <span class="zt zt-top"    style="--i:1">1</span>  ... (1-6)
       <span class="zt zt-bottom" style="--i:1">1</span>
       <span class="zt zt-left"   style="--i:1">A</span>  ... (A-D)
       <span class="zt zt-right"  style="--i:1">A</span>
     </div>
   Place .zone-ticks as a direct child of .sheet.
   -------------------------------------------------------------------------- */
.zone-ticks {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  font-size: 9px;
  letter-spacing: 0;
  line-height: 1;
}

.zt {
  position: absolute;
  width: 10px;
  height: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--paper);
}

/* horizontal ticks: 6 columns, --i is 1-based index */
.zt-top,
.zt-bottom {
  left: calc((var(--i) - 0.5) * (100% / 6) - 5px);
}
.zt-top    { top: -2px; }
.zt-bottom { bottom: -2px; }

/* vertical ticks: 4 rows, --i is 1-based index */
.zt-left,
.zt-right {
  top: calc((var(--i) - 0.5) * (100% / 4) - 5px);
}
.zt-left  { left: -2px; }
.zt-right { right: -2px; }

/* --------------------------------------------------------------------------
   3. .fiducial — CROSSHAIR-IN-CIRCLE REGISTRATION MARK
   Inline SVG. Copy this snippet:
     <span class="fiducial" aria-hidden="true">
       <svg viewBox="0 0 24 24">
         <circle cx="12" cy="12" r="8" fill="none" stroke="#000" stroke-width="1"/>
         <line x1="12" y1="0"  x2="12" y2="24" stroke="#000" stroke-width="1"/>
         <line x1="0"  y1="12" x2="24" y2="12" stroke="#000" stroke-width="1"/>
       </svg>
     </span>
   -------------------------------------------------------------------------- */
.fiducial {
  display: inline-block;
  width: 24px;
  height: 24px;
  vertical-align: middle;
}
.fiducial svg { width: 100%; height: 100%; }

/* convenience corner placement inside .sheet */
.fiducial-corner    { position: absolute; z-index: 2; }
.fiducial-corner.tl { top: 16px;    left: 16px;  }
.fiducial-corner.tr { top: 16px;    right: 16px; }
.fiducial-corner.bl { bottom: 16px; left: 16px;  }
.fiducial-corner.br { bottom: 16px; right: 16px; }

/* --------------------------------------------------------------------------
   4. .titleblock — DRAWING TITLE BLOCK (PER REF SHEET)
   Grid table. Left group: wordmark row, property line, then
   ORIG DIV / DESIGNER / DATE / SCALE. Right column: TITLE / DRAWING NO.
   MARKUP:
     <section class="titleblock">
       <div class="tb-wordmark">PUBLICBYTES</div>
       <div class="tb-property">THIS IS THE PROPERTY OF ...</div>
       <div class="tb-cell"><span class="cell-label">ORIG DIV</span><span class="tb-value">...</span></div>
       <div class="tb-cell"><span class="cell-label">DESIGNER</span><span class="tb-value">...</span></div>
       <div class="tb-cell"><span class="cell-label">DATE</span><span class="tb-value">...</span></div>
       <div class="tb-cell"><span class="cell-label">SCALE</span><span class="tb-value">...</span></div>
       <div class="tb-cell tb-title"><span class="cell-label">TITLE</span><span class="tb-value">...</span></div>
       <div class="tb-cell tb-dwgno"><span class="cell-label">DRAWING NO.</span><span class="tb-value">...</span></div>
     </section>
   -------------------------------------------------------------------------- */
.titleblock {
  display: grid;
  grid-template-columns: repeat(4, 1fr) minmax(180px, 1.1fr);
  grid-template-rows: auto auto auto;
  border: var(--hairline);
  background: var(--paper);
}

/* hairlines between cells: draw top+left on every cell, suppress on edges */
.titleblock > * {
  border-left: var(--hairline);
  border-top: var(--hairline);
  padding: 8px 10px;
  min-width: 0;
}

.tb-brandrow {
  grid-column: 1 / 5;
  grid-row: 1;
  border-left: 0;
  border-top: 0;
  display: grid;
  grid-template-columns: 150px 1fr;
  padding: 0;
  min-width: 0;
}

.tb-logo-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  border-right: var(--hairline);
  min-width: 0;
}

.tb-wordmark {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  text-align: center;
  font-size: clamp(40px, 8vw, 96px);
  letter-spacing: 0.25em;
  text-indent: 0;
  line-height: 1.1;
  padding: 12px 8px 8px;
  min-width: 0;
}

.tb-wordmark-logo {
  flex: 0 0 auto;
  width: auto;
  height: 84px;
}

.tb-wordmark-text {
  letter-spacing: inherit;
  text-indent: 0.25em; /* optically recenters tracked-out caps */
}

.tb-property {
  grid-column: 1 / 5;
  grid-row: 2;
  border-left: 0;
  text-align: center;
  font-size: 12px;
  letter-spacing: 0.08em;
  padding: 3px 8px;
  line-height: 1.5;
}

.tb-title {
  grid-column: 5;
  grid-row: 1 / 3;
  border-top: 0;
}
.tb-dwgno {
  grid-column: 5;
  grid-row: 3;
}

.tb-cell {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.tb-cell:nth-child(3) { border-left: 0; } /* ORIG DIV: leftmost in its row */

.tb-value {
  font-size: 18px;
  letter-spacing: 0.06em;
  align-self: center;
  margin-top: auto;
  padding-bottom: 4px;
}

/* --------------------------------------------------------------------------
   TINY CELL LABEL (SHARED)
   -------------------------------------------------------------------------- */
.cell-label {
  display: block;
  font-size: 9px;
  letter-spacing: 0.12em;
  line-height: 1;
  align-self: flex-start;
}

/* --------------------------------------------------------------------------
   5. .dwg-header — STICKY TOP NAV STRIP
   MARKUP:
     <header class="dwg-header">
       <nav class="dwg-nav"><a href="#">INDEX</a> ...</nav>
       <div class="dwg-fields">
         <span class="dwg-field"><span class="cell-label">DWG NO.</span>PB-001</span>
         ...
       </div>
     </header>
   -------------------------------------------------------------------------- */
.dwg-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 16px;
  background: var(--paper);
  border-bottom: var(--hairline);
  padding: 0 12px;
  min-height: 40px;
}

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

.dwg-nav a,
.dwg-header a {
  font-size: 11px;
  letter-spacing: 0.12em;
  border-bottom: 0;
  padding: 4px 2px;
}
.dwg-nav a:hover { background: var(--ink-red); color: var(--paper); }

/* current-sheet marker */
.dwg-nav a[aria-current="page"] {
  background: var(--ink-red);
  color: var(--paper);
}

.dwg-fields {
  display: flex;
  align-items: stretch;
}

.dwg-field {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  font-size: 11px;
  letter-spacing: 0.12em;
  padding: 4px 14px;
  border-left: var(--hairline);
}

/* --------------------------------------------------------------------------
   6. .spec-table / .ruled — RULED DATA TABLE
   -------------------------------------------------------------------------- */
.table-scroll { max-width: 100%; overflow-x: auto; }

.spec-table,
.ruled {
  border-collapse: collapse;
  width: 100%;
  font-size: 12px;
  letter-spacing: 0.05em;
}

.spec-table th,
.spec-table td,
.ruled th,
.ruled td {
  border: var(--hairline);
  padding: 10px 14px;
  text-align: left;
  vertical-align: top;
}

.spec-table th,
.ruled th {
  font-size: 13px;
  letter-spacing: 0.1em;
}

.spec-table .cell-label,
.ruled .cell-label {
  margin-bottom: 4px;
}

/* --------------------------------------------------------------------------
   7. .section-head — SECTION HEADER TABLE STRIP
   MARKUP:
     <div class="section-head">
       <span class="sh-zone">B</span>
       <span class="sh-name">DETAIL — TYPOGRAPHY</span>
       <span class="sh-ref">SHEET 2 REF</span>
     </div>
   -------------------------------------------------------------------------- */
.section-head {
  display: flex;
  align-items: stretch;
  border: var(--hairline);
  margin: 32px 0 16px;
}

.sh-zone {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  border-right: var(--hairline);
  font-size: 16px;
  letter-spacing: 0;
  padding: 6px 8px;
}

.sh-name {
  flex: 1;
  display: flex;
  align-items: center;
  font-size: 13px;
  letter-spacing: 0.15em;
  padding: 6px 12px;
}

.sh-ref {
  display: flex;
  align-items: center;
  border-left: var(--hairline);
  font-size: 9px;
  letter-spacing: 0.12em;
  padding: 6px 10px;
}

/* --------------------------------------------------------------------------
   8. MARKUP / CONTROLS
   -------------------------------------------------------------------------- */
.stamp {
  display: inline-block;
  position: relative;
  border: 2px solid var(--ink-red);
  color: var(--ink-red);
  background: transparent;
  font-size: 13px;
  line-height: 1;
  letter-spacing: 0.15em;
  padding: 10px 18px;
  transform: rotate(-3deg);
  opacity: 0.85;
}

.stamp::after {
  content: '';
  position: absolute;
  inset: 3px;
  border: 1px solid var(--ink-red);
  pointer-events: none;
}

.stamp + .stamp {
  margin-left: 28px;
}

.stamp--lg { font-size: 18px; }

/* --------------------------------------------------------------------------
   8A. .btn-draft — RECTANGULAR LINK BUTTON
   -------------------------------------------------------------------------- */
.btn-draft {
  display: inline-block;
  border: var(--hairline);
  border-bottom: var(--hairline); /* override base link underline */
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-stack);
  font-size: 12px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 10px 22px;
  cursor: pointer;
  transition: background-color 120ms linear, color 120ms linear;
}

.btn-draft:hover {
  background: var(--ink-red);
  color: var(--paper);
}

.btn-draft:focus-visible,
a:focus-visible,
button:focus-visible {
  outline: 1px dashed var(--ink);
  outline-offset: 3px;
}

/* --------------------------------------------------------------------------
   9. .invert-hover — GENERIC HOVER INVERSION
   Apply to <tr>, cells, list items, or any clickable element.
   -------------------------------------------------------------------------- */
.invert-hover {
  transition: background-color 120ms linear, color 120ms linear;
  cursor: pointer;
}

.invert-hover:hover,
.invert-hover:hover a,
.invert-hover:hover td,
.invert-hover:hover th,
.invert-hover:hover .cell-label,
.invert-hover:hover .excerpt,
tr:has(a):hover,
tr:has(a):hover a,
tr:has(a):hover td,
tr:has(a):hover th,
tr:has(a):hover .excerpt,
.filter-cell:hover,
.filter-cell:hover a {
  background: var(--ink-red);
  color: var(--paper);
}

/* --------------------------------------------------------------------------
   10. .notes-block — NOTES TEXT
   MARKUP:
     <div class="notes-block">
       <span class="cell-label">NOTES:</span>
       <ol><li>...</li></ol>
     </div>
   -------------------------------------------------------------------------- */
.notes-block {
  font-size: 12px;
  letter-spacing: 0.05em;
  line-height: 1.8;
  max-width: 60ch;
  padding: 8px 0;
}

.zone-quiet {
  padding: 80px 0;
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.excerpt {
  font-size: 10px;
  line-height: 1.5;
  letter-spacing: 0.02em;
  color: var(--ink);
  opacity: 0.62;
}

.row-overflow { display: none; }
.rows-expanded .row-overflow { display: table-row; }

.row-expander {
  text-align: center;
  cursor: pointer;
  letter-spacing: 0.15em;
  transition: background-color 120ms linear, color 120ms linear;
}

.row-expander:hover {
  background: var(--ink-red);
  color: var(--paper);
}

.row-expander::before { content: '+ ' attr(data-count) ' MORE — EXPAND'; }
.rows-expanded .row-expander::before { content: '— COLLAPSE'; }

.notes-block .cell-label { margin-bottom: 4px; }

.notes-block ol {
  margin: 0;
  padding-left: 2.5em;
  list-style: decimal;
}

.notes-block ol li::marker {
  content: counter(list-item) '.  ';
}

.notes-block p { margin: 0; }

/* --------------------------------------------------------------------------
   11. .redacted — REDACTION BAR (MARKER SWIPE)
   The ONLY curved element in the system, per the ref's blacked-out
   designer name. Text inside remains for a11y but is inked over.
   -------------------------------------------------------------------------- */
.redacted {
  display: inline-block;
  background: var(--ink);
  color: var(--ink);
  border-radius: 999px; /* sanctioned exception: marker-swipe ends */
  padding: 0.05em 0.6em;
  line-height: 1.2;
  user-select: none;
}
.redacted::selection { background: var(--ink); color: var(--ink); }

/* --------------------------------------------------------------------------
   12. .dim — DIMENSION-LINE LABEL
   -------------------------------------------------------------------------- */
.dim {
  font-size: 10px;
  letter-spacing: 0.08em;
  line-height: 1;
}

/* dimension line with arrows + centered label:
   <div class="dim-line"><span class="dim">375 PX</span></div> */
.dim-line {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 12px;
}
.dim-line::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  border-top: var(--hairline);
}
.dim-line::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  border-left: var(--hairline);
  border-right: var(--hairline);
}
.dim-line .dim {
  position: relative;
  background: var(--paper);
  padding: 0 8px;
}

/* --------------------------------------------------------------------------
   UTILITIES
   -------------------------------------------------------------------------- */
.tracked      { letter-spacing: 0.12em; }
.tracked-wide { letter-spacing: 0.25em; }
.tiny         { font-size: 9px; }
.rule-top     { border-top: var(--hairline); }
.rule-bottom  { border-bottom: var(--hairline); }

/* --------------------------------------------------------------------------
   14. RESPONSIVE
   -------------------------------------------------------------------------- */
@media (max-width: 720px) {
  :root {
    --sheet-inset: 8px;
    --section-gap: 72px;
  }

  .sheet { min-height: calc(100vh - 2 * var(--sheet-inset)); }
  .sheet-body { padding: calc(var(--frame-gap) + 24px) calc(var(--frame-gap) + 12px) calc(var(--frame-gap) + 12px); }
  .zone-quiet { padding: 56px 0; }
  .stamp + .stamp { margin-left: 0; margin-top: 18px; }

  /* titleblock stacks to 2 columns */
  .titleblock { grid-template-columns: 1fr 1fr; grid-template-rows: none; }
  .tb-brandrow {
    grid-column: 1 / -1;
    grid-row: auto;
    grid-template-columns: 1fr;
  }
  .tb-logo-cell { display: none; }
  .tb-wordmark {
    font-size: clamp(22px, 7.5vw, 40px);
    letter-spacing: 0.12em;
    text-indent: 0;
  }
  .tb-wordmark-text { text-indent: 0.12em; }
  .tb-property { grid-column: 1 / -1; grid-row: auto; }
  .tb-title,
  .tb-dwgno    { grid-column: auto; grid-row: auto; border-top: var(--hairline); }
  .tb-cell:nth-child(3) { border-left: 0; }
  .tb-cell:nth-child(5) { border-left: 0; }
  .tb-title    { border-left: 0; }

  .dwg-header { flex-wrap: wrap; padding: 0 8px; }
  .dwg-nav { gap: 12px; }
  .dwg-field { padding: 4px 8px; }
}

@media (max-width: 420px) {
  /* titleblock stacks to a single column */
  .titleblock { grid-template-columns: 1fr; }
  .titleblock > * { border-left: 0; }
  .tb-dwgno { border-left: 0; }
}

/* --------------------------------------------------------------------------
   15. PRINT
   -------------------------------------------------------------------------- */
@media print {
  .dwg-header { position: static; }
  .sheet { min-height: auto; }
  a { border-bottom: 0; }
}
