/* williampark.org — shared chrome for the Chip Floorplan world.
   Tokens, type, header/nav, footer, and browser surfaces used by every page.
   Page-specific layout lives in home.css (homepage) and project.css (write-ups).
   ONE type size everywhere: hierarchy is weight, tracking, ink, and spacing. */

:root {
  --paper: #edefe8;
  --paper-deep: #e3e6dd;
  --ink: #22262a;
  --ink-2: #555c64;
  --rule: #b9beb2;
  --rule-strong: #22262a;
  --bin-green: #2f9e44;
  --bin-blue: #1971c2;
  --bin-yellow: #f5c518;
  --bin-red: #e03131;
  --fs: 0.875rem;          /* the one size */
  --lh: 1.7;
  --track: 0.08em;
  --pad: clamp(18px, 4vw, 40px);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: "Martian Mono", "Courier New", monospace;
  font-size: var(--fs);
  line-height: var(--lh);
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}

/* Browser surfaces carry the design too. */
::selection { background: var(--ink); color: var(--paper); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
* { scrollbar-color: var(--rule) var(--paper); scrollbar-width: thin; }
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-thumb { background: var(--rule); border: 2px solid var(--paper); }
::-webkit-scrollbar-track { background: var(--paper); }

.sheet {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 var(--pad) var(--pad);
}

a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--rule); text-underline-offset: 4px; }
@media (hover: hover) {
  a:hover { text-decoration-color: var(--ink); }
}

strong { font-weight: 700; }

/* --- ruled header bar --- */
.head-bar {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px 24px;
  border-top: 2px solid var(--rule-strong);
  border-bottom: 1px solid var(--rule-strong);
  padding-top: 10px;
  padding-bottom: 10px;
  margin-top: 14px;
}
.brand { font-size: var(--fs); font-weight: 800; letter-spacing: 0.22em; text-transform: uppercase; }
.brand a { text-decoration: none; }
.head-nav { display: flex; gap: 22px; flex-wrap: wrap; }
.head-nav a {
  text-decoration: none;
  letter-spacing: var(--track);
  text-transform: uppercase;
  color: var(--ink-2);
  border-bottom: 1px solid transparent;
}
@media (hover: hover) {
  .head-nav a:hover { color: var(--ink); border-bottom-color: var(--ink); }
}

/* --- sections --- */
.section { margin-top: clamp(32px, 5vw, 48px); }
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  border-bottom: 2px solid var(--rule-strong);
  padding-bottom: 8px;
  margin-bottom: 20px;
}
.section-head h2 {
  font-size: var(--fs);
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.section-note { color: var(--ink-2); letter-spacing: 0.03em; }

/* --- footer --- */
footer {
  margin-top: clamp(48px, 8vw, 80px);
  border-top: 2px solid var(--rule-strong);
  padding: 16px 0 8px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px 24px;
}
.foot-mark { letter-spacing: 0.03em; color: var(--ink-2); }
.foot-links { display: flex; gap: 20px; flex-wrap: wrap; }
.foot-links a { text-decoration: none; letter-spacing: var(--track); text-transform: uppercase; border-bottom: 1px solid var(--rule); }
@media (hover: hover) {
  .foot-links a:hover { border-bottom-color: var(--ink); }
}

@media (max-width: 640px) {
  .head-bar { border-bottom: none; padding-bottom: 0; }
  .head-nav {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 0 26px;
    border-top: 1px solid var(--rule);
    border-bottom: 1px solid var(--rule-strong);
    margin-top: 6px;
  }
  .head-nav a { padding: 9px 0; }
  .section-head { flex-direction: column; align-items: flex-start; gap: 6px; }
}
