/* Drawing sheet — shared styles for salihaltak.com */

@font-face {
  font-family: "Osi";
  src: url("../fonts/osifont.ttf") format("truetype");
  font-display: swap;
}
@font-face {
  font-family: "Archivo";
  src: url("../fonts/archivo.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Archivo";
  src: url("../fonts/archivo-italic.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: italic;
  font-display: swap;
}

:root {
  --desk: #e3e4de;
  --sheet: #f4f5f1;
  --ink: #14161a;
  --ink-2: #474b52;
  --rule: rgba(20, 22, 26, 0.16);
  --hatch: rgba(20, 22, 26, 0.06);
  --dim: #1f4fd1;
  --red: #c4311d;
  --lamp: #c4311d;

  --letter: "Osi", "Archivo", system-ui, sans-serif;
  --text: "Archivo", system-ui, sans-serif;

  --gutter: clamp(16px, 3vw, 40px);
  --frame: clamp(10px, 1.6vw, 22px);
  --w-heavy: 2px;
  --w-light: 1px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);

  color-scheme: light;
}

/* Blueprint (diazo) print: only when chosen; vellum is the default */
:root[data-print="blueprint"] {
  --desk: #0a1f47;
  --sheet: #10336e;
  --ink: #eef3ff;
  --ink-2: #bccbeb;
  --rule: rgba(238, 243, 255, 0.2);
  --hatch: rgba(238, 243, 255, 0.07);
  --dim: #9fd3ff;
  --red: #ff9a84;
  --lamp: #ff9a84;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 64px; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--desk);
  color: var(--ink);
  font-family: var(--text);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-stretch: 100%;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.5s var(--ease), color 0.5s var(--ease);
}

::selection { background: var(--dim); color: var(--sheet); }
html { scrollbar-color: var(--ink-2) var(--desk); }
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: var(--desk); }
::-webkit-scrollbar-thumb { background: var(--ink-2); border: 3px solid var(--desk); }

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.22em; }
a:hover { color: var(--dim); }
:focus-visible { outline: 2px dashed var(--dim); outline-offset: 3px; }

img, video, iframe, svg, canvas { display: block; max-width: 100%; }
[hidden] { display: none !important; }

.letter {
  font-family: var(--letter);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 50;
  background: var(--ink); color: var(--sheet); padding: 8px 12px;
  font-family: var(--letter); text-decoration: none;
}
.skip:focus { top: 12px; }
.skip:hover { color: var(--sheet); }

/* ---------- Drawing index bar ---------- */
.index {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 24px;
  padding: 0 var(--gutter);
  height: 52px;
  background: var(--desk);
  border-bottom: var(--w-light) solid var(--rule);
  font-family: var(--letter);
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: background-color 0.5s var(--ease);
}
.index__id { white-space: nowrap; text-decoration: none; }
.index__id b { font-weight: inherit; color: var(--red); }
.index__sheets { display: flex; gap: 4px; margin: 0; list-style: none; padding: 0; }
.index > nav { margin-right: auto; }
.index__sheets a {
  display: block; padding: 6px 10px; text-decoration: none; position: relative;
  color: var(--ink-2);
}
.index__sheets a:hover { color: var(--ink); }
.index__sheets a[aria-current="true"] { color: var(--ink); }
.index__sheets a[aria-current="true"]::after {
  content: ""; position: absolute; left: 10px; right: 10px; bottom: 1px;
  border-bottom: 2px solid var(--red);
}
.index__sheets span { color: var(--ink-2); margin-right: 6px; }
.index__tools { display: flex; align-items: center; gap: 18px; white-space: nowrap; }

.print {
  display: inline-flex; border: var(--w-light) solid var(--ink); font: inherit;
  letter-spacing: inherit; text-transform: inherit;
}
.print button {
  font: inherit; letter-spacing: inherit; text-transform: inherit;
  background: none; color: var(--ink-2); border: 0; padding: 3px 8px; cursor: pointer;
}
.print button[aria-pressed="true"] { background: var(--ink); color: var(--sheet); }
.print button:hover:not([aria-pressed="true"]) { color: var(--ink); }

/* ---------- Sheet frame ---------- */
.sheet {
  position: relative;
  margin: var(--gutter);
  background: var(--sheet);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 18px 40px -24px rgba(0, 0, 0, 0.35);
  padding: calc(var(--frame) + 18px);
  transition: background-color 0.5s var(--ease);
}
.sheet + .sheet { margin-top: calc(var(--gutter) * 1.5); }
.sheet::before {
  /* outer trim line + inner drawing border */
  content: ""; position: absolute; inset: var(--frame);
  border: var(--w-heavy) solid var(--ink); pointer-events: none;
}
.zones { position: absolute; inset: 0; pointer-events: none; font-family: var(--letter); font-size: 0.72rem; color: var(--ink-2); }
.zones__row, .zones__col { position: absolute; display: flex; justify-content: space-around; align-items: center; }
.zones__row { left: var(--frame); right: var(--frame); height: var(--frame); }
.zones__row--top { top: 0; }
.zones__row--bot { bottom: 0; }
.zones__col { flex-direction: column; top: var(--frame); bottom: var(--frame); width: var(--frame); }
.zones__col--l { left: 0; }
.zones__col--r { right: 0; }
.zones span { flex: 1; text-align: center; position: relative; }
.zones__row span + span::before { content: ""; position: absolute; left: 0; top: 30%; height: 70%; border-left: 1px solid var(--ink); }
.zones__row--bot span + span::before { top: 0; }
.zones__col span { display: flex; align-items: center; justify-content: center; }
.zones__col span + span::before { content: ""; position: absolute; top: 0; left: 30%; width: 70%; border-top: 1px solid var(--ink); }
.zones__col--r span + span::before { left: 0; }

/* sheet label strip (bottom right corner of every sheet) */
.strip {
  display: grid; grid-template-columns: auto auto auto; justify-content: end;
  margin-top: 48px; margin-right: calc(-18px + 0px); margin-bottom: -18px;
  font-family: var(--letter); text-transform: uppercase; letter-spacing: 0.05em; font-size: 0.85rem;
}
.strip > div { border-top: var(--w-heavy) solid var(--ink); border-left: var(--w-light) solid var(--ink); padding: 6px 14px; }
.strip small { display: block; font-size: 0.68rem; color: var(--ink-2); }

.view-label {
  font-family: var(--letter); text-transform: uppercase; letter-spacing: 0.06em;
  font-size: 0.85rem; color: var(--ink-2); margin-top: 10px;
}
.view-label b { font-weight: inherit; color: var(--ink); border-bottom: 1px solid var(--ink); }

h1, h2, h3 { text-wrap: balance; margin: 0; }
/* display lettering: drawing hand (ISO 3098), thickened to hold at size */
.lettered {
  font-family: var(--letter); font-weight: normal; text-transform: uppercase;
  letter-spacing: 0.04em; -webkit-text-stroke: 0.028em currentColor; paint-order: stroke fill;
}
h2.sheet-title {
  font-size: clamp(2rem, 4.2vw, 3.4rem); line-height: 1;
  margin-bottom: clamp(28px, 4vw, 56px);
}

/* ---------- Revision symbol (triangle with letter) ---------- */
.revtri {
  --s: 2.4em;
  display: inline-grid; place-items: center; width: var(--s); height: var(--s);
  font-family: var(--letter); line-height: 1; padding-top: 0.5em; position: relative;
}
.revtri svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.revtri polygon { fill: none; stroke: currentColor; stroke-width: 1.5; vector-effect: non-scaling-stroke; }

/* ---------- Buttons/links in lettering ---------- */
.cmd {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--letter); text-transform: uppercase; letter-spacing: 0.06em;
  text-decoration: none; padding: 9px 14px;
  border: var(--w-light) solid var(--ink); color: var(--ink); background: none;
  transition: background-color 0.2s, color 0.2s;
}
.cmd:hover { background: var(--ink); color: var(--sheet); }
.cmd svg { width: 14px; height: 14px; flex: none; }
.cmd--primary { background: var(--ink); color: var(--sheet); }
.cmd--primary:hover { background: var(--dim); border-color: var(--dim); color: var(--sheet); }

/* draw-on line reveal for revision clouds and leaders */
.draw path, .draw polyline, .draw line { stroke-dasharray: var(--len, 2000); stroke-dashoffset: 0; }
.js .draw:not(.is-drawn) path, .js .draw:not(.is-drawn) polyline { stroke-dashoffset: var(--len, 2000); }
.draw path, .draw polyline { transition: stroke-dashoffset 1.6s var(--ease); }
@media (prefers-reduced-motion: reduce) {
  .js .draw:not(.is-drawn) path, .js .draw:not(.is-drawn) polyline { stroke-dashoffset: 0; }
}

/* system schematics (parts list + detail sheets) */
.sc-box rect { fill: var(--sheet); stroke: var(--ink); stroke-width: 1.5; }
.sc-t text { font-family: var(--letter); fill: var(--ink); font-size: 14px; text-anchor: middle; text-transform: uppercase; letter-spacing: 0.03em; }
.sc-t .sc-s { fill: var(--ink-2); font-size: 11.5px; }
.sc-l path { fill: none; stroke: var(--dim); stroke-width: 1.25; }
.sc-a path { fill: none; stroke: var(--dim); stroke-width: 1.25; }
.sc-n { font-family: var(--letter); fill: var(--ink-2); font-size: 12px; letter-spacing: 0.03em; text-transform: uppercase; }

/* ---------- Footer ---------- */
.foot {
  display: flex; flex-wrap: wrap; gap: 12px 28px; justify-content: space-between;
  padding: 8px var(--gutter) 28px; font-family: var(--letter); font-size: 0.85rem;
  text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-2);
}
.foot a { color: var(--ink-2); }
@media (pointer: coarse) { #zone { display: none; } }

@media (max-width: 760px) {
  .index { gap: 12px; height: 48px; font-size: 0.85rem; }
  .index__sheets { display: none; }
  .index__tools { margin-left: auto; }
  .sheet { margin: 12px; padding: calc(var(--frame) + 14px); }
  .sheet + .sheet { margin-top: 20px; }
  .strip { grid-template-columns: 1fr auto; margin-right: -14px; margin-bottom: -14px; }
  .strip > div:first-child { grid-column: 1 / -1; }
  body { font-size: 1rem; }
}
