/* ==========================================================================
   Chad Tamplin — portfolio
   Hand-written CSS. No framework, no build step, no external requests.

   Direction: "the architect's plate". Cool paper, ink, and a single brass
   accent. A serif carries display type, a sans carries prose and UI, and
   monospace is reserved strictly for data — dates, technology names, and
   drawing labels — so it reads as machine fact rather than decoration.
   ========================================================================== */

:root {
    /* surfaces */
    --paper: #f6f7f8;
    --paper-2: #ffffff;
    --paper-3: #eef0f3;
    /* ink */
    --ink: #12161c;
    --ink-2: #414b57;
    --ink-3: #626c79;
    /* rules */
    --rule: #dde1e6;
    --rule-2: #c7cdd4;
    /* accent — instrument brass */
    --brass: #8a6520;
    --brass-lift: #a67c2c;
    --brass-wash: rgba(138, 101, 32, .08);
    /* inverted band */
    --band: #141a22;
    --band-2: #1e2731;
    --band-rule: #2c3743;
    --band-text: #c3cbd4;
    --brass-2: #c9a24a;
    /* type stacks — system faces only, no web fonts */
    --serif: "Charter", "Bitstream Charter", "Iowan Old Style", Cambria, "Palatino Linotype", Palatino, Georgia, serif;
    --sans: "Segoe UI Variable Text", "Segoe UI", -apple-system, BlinkMacSystemFont, system-ui, Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, "Cascadia Mono", "SF Mono", Consolas, "Liberation Mono", Menlo, monospace;
    /* metrics */
    --wrap: 1180px;
    --gut: clamp(1.25rem, 4vw, 3rem);
    --nav-h: 66px;
    --rail: 152px;
}

/* --------------------------------------------------------------- reset -- */

*, *::before, *::after { box-sizing: border-box; }

html {
  color-scheme: light;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 32px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink-2);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3 { color: var(--ink); margin: 0; line-height: 1.2; }
p { margin: 0 0 1.05em; }
p:last-child { margin-bottom: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: inherit; }
strong { color: var(--ink); font-weight: 600; }
svg { display: block; }

::selection { background: rgba(138, 101, 32, .18); color: var(--ink); }

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--ink); color: var(--paper);
  padding: .65rem 1rem; border-radius: 4px;
  font: 500 14px/1 var(--sans);
}
.skip:focus { left: 10px; top: 10px; }

:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ------------------------------------------------------------- layout -- */

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding-inline: var(--gut);
}

/* The page spine: a fixed label rail on the left, content on the right.
   The same two-column rhythm repeats inside Ventures and Timeline, where
   the rail carries dates instead of a label. */
.sec {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.5rem;
}
@media (min-width: 940px) {
  .sec {
    grid-template-columns: var(--rail) minmax(0, 1fr);
    gap: clamp(2rem, 4vw, 3.75rem);
  }
  .sec-rail { position: sticky; top: calc(var(--nav-h) + 2.4rem); align-self: start; }
}

.sec-label {
  font: 600 11px/1 var(--sans);
  letter-spacing: .17em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding-top: 1rem;
  border-top: 2px solid var(--brass);
  display: inline-block;
}

/* ---------------------------------------------------------------- nav -- */

.nav {
  position: sticky; top: 0; z-index: 50;
  height: var(--nav-h);
  background: rgba(246, 247, 248, .82);
  backdrop-filter: blur(12px) saturate(160%);
  -webkit-backdrop-filter: blur(12px) saturate(160%);
  border-bottom: 1px solid transparent;
  transition: border-color .25s ease, background .25s ease;
}
.nav.is-stuck { border-bottom-color: var(--rule); background: rgba(246, 247, 248, .94); }

.nav-inner { height: 100%; display: flex; align-items: center; gap: 1.75rem; }

.mark {
  flex: none;
  font: 400 19px/1 var(--serif);
  letter-spacing: -.01em;
  color: var(--ink);
  text-decoration: none;
}

.nav-links { display: flex; gap: 1.6rem; margin-left: auto; }
.nav-links a {
  position: relative;
  text-decoration: none;
  font: 400 15px/1 var(--sans);
  color: var(--ink-3);
  padding: .5rem 0;
  transition: color .18s ease;
  white-space: nowrap;
}
.nav-links a::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 1.5px; background: var(--brass);
  transform: scaleX(0); transform-origin: left;
  transition: transform .22s ease;
}
.nav-links a:hover { color: var(--ink); }
.nav-links a.is-active { color: var(--ink); }
.nav-links a.is-active::after { transform: scaleX(1); }

/* --------------------------------------------------------------- btns -- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .72rem 1.25rem;
  border: 1px solid var(--rule-2);
  border-radius: 4px;
  background: var(--paper-2);
  color: var(--ink);
  font: 500 15px/1 var(--sans);
  text-decoration: none;
  white-space: nowrap;
  transition: border-color .18s ease, background .18s ease, color .18s ease;
}
.btn:hover { border-color: var(--ink-3); background: var(--paper-3); }

.btn-primary { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.btn-primary:hover { background: #262f3a; border-color: #262f3a; color: #fff; }

/* No border box to align to, so drop the side padding — otherwise it hangs
   indented from the margin whenever it wraps onto its own line. */
.btn-quiet {
  border-color: transparent; background: transparent; color: var(--ink-2);
  padding-inline: 0; margin-inline: .5rem;
}
.btn-quiet:hover { background: transparent; border-color: transparent; color: var(--brass); }

.btn-sm { padding: .5rem .9rem; font-size: 14px; flex: none; }
.btn-block { width: 100%; }

/* --------------------------------------------------------------- hero -- */

.hero {
  padding-top: clamp(3.25rem, 8vw, 6rem);
  padding-bottom: clamp(3rem, 7vw, 5rem);
}

.masthead {
  display: flex; flex-wrap: wrap; gap: .5rem 2rem;
  align-items: baseline; justify-content: space-between;
  padding-bottom: 1.1rem;
  margin-bottom: clamp(2rem, 4vw, 3rem);
  border-bottom: 1px solid var(--rule-2);
}
.masthead-name {
  font: 400 clamp(1.55rem, 3vw, 2rem)/1.1 var(--serif);
  letter-spacing: -.015em;
  margin-bottom: .35rem;
}
.masthead-role {
  font: 500 12px/1.4 var(--sans);
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0;
}
.masthead-loc {
  font: 400 13px/1.4 var(--mono);
  color: var(--ink-3);
  margin: 0;
}

.thesis {
  /* em, not ch — the measure should scale with the display size itself */
  max-width: 15em;
  font: 400 clamp(2.1rem, 5.4vw, 3.6rem)/1.14 var(--serif);
  letter-spacing: -.022em;
  color: var(--ink);
  text-wrap: balance;
  margin-bottom: 1.6rem;
}

.hero-lede {
  max-width: 56ch;
  font-size: 1.06rem;
  line-height: 1.72;
  margin-bottom: 2.1rem;
}

.hero-actions {
  display: flex; flex-wrap: wrap; gap: .65rem;
  margin-bottom: clamp(2.75rem, 6vw, 4.5rem);
}

/* ------------------------------------------------------------- ledger -- */

/* Explicit column counts rather than auto-fit: with exactly four figures,
   auto-fit lands on three columns at tablet widths and orphans the fourth. */
.ledger {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
  border-top: 1px solid var(--rule-2);
  border-bottom: 1px solid var(--rule-2);
}
.ledger-item {
  padding: 1.15rem 1.4rem 1.2rem;
  border-left: 1px solid var(--rule);
}
.ledger-item:first-child { border-left: 0; padding-left: 0; }

@media (max-width: 759px) {
  .ledger { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ledger-item { padding: 1rem 1.1rem; }
  .ledger-item:nth-child(odd) { border-left: 0; padding-left: 0; }
  .ledger-item:nth-child(n + 3) { border-top: 1px solid var(--rule); }
}

.ledger dt {
  font: 500 11px/1.4 var(--sans);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: .5rem;
}
.ledger dd {
  margin: 0;
  font: 400 2.35rem/1 var(--serif);
  letter-spacing: -.03em;
  color: var(--ink);
}
.ledger .unit {
  font-size: 1.45rem;
  color: var(--brass);
  margin-left: .04em;
}

/* ----------------------------------------------------------- sections -- */

.section {
  padding-block: clamp(3.25rem, 7vw, 5.75rem);
  border-top: 1px solid var(--rule);
}

.lead {
  max-width: 44ch;
  font: 400 clamp(1.24rem, 2.1vw, 1.5rem)/1.45 var(--serif);
  letter-spacing: -.012em;
  color: var(--ink);
  text-wrap: pretty;
  margin-bottom: 1.5rem;
}

.prose { max-width: 66ch; margin-bottom: clamp(2rem, 4vw, 3rem); }

/* --------------------------------------------------------- track cards -- */

.tracks {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
}
@media (min-width: 720px) {
  .tracks { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.card {
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: 5px;
  padding: 1.6rem 1.6rem 1.7rem;
}
.card h3 {
  font: 600 1.08rem/1.35 var(--sans);
  letter-spacing: -.01em;
  margin-bottom: .5rem;
}
.card-lede {
  color: var(--ink-3);
  font-size: .96rem;
  margin-bottom: 1.15rem;
  padding-bottom: 1.15rem;
  border-bottom: 1px solid var(--rule);
}

.ticks li {
  position: relative;
  padding-left: 1.15rem;
  font-size: .96rem;
  line-height: 1.55;
  margin-bottom: .6rem;
}
.ticks li:last-child { margin-bottom: 0; }
.ticks li::before {
  content: "";
  position: absolute; left: 0; top: .68em;
  /* 2px, not 1.5 — a half-pixel rule renders unevenly down a list */
  width: 7px; height: 2px;
  background: var(--brass);
}

/* ------------------------------------------------------------ records -- */

.records { margin-top: clamp(.5rem, 2vw, 1.5rem); }

.rec {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: .6rem;
  padding-block: clamp(1.9rem, 4vw, 2.6rem);
  border-top: 1px solid var(--rule);
}
@media (min-width: 720px) {
  .rec { grid-template-columns: 150px minmax(0, 1fr); gap: 2rem; }
}

.rec-when {
  font: 400 13px/1.5 var(--mono);
  color: var(--ink-3);
  letter-spacing: .01em;
  margin: 0;
}
.rec-flag {
  display: inline-block;
  margin: .8rem 0 0;
  padding: .3rem .5rem;
  font: 500 10.5px/1 var(--sans);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--brass);
  background: var(--brass-wash);
  border: 1px solid rgba(138, 101, 32, .3);
  border-radius: 3px;
}

.rec-body { max-width: 68ch; }
.rec-body h3 {
  font: 400 clamp(1.5rem, 2.6vw, 1.85rem)/1.2 var(--serif);
  letter-spacing: -.02em;
  margin-bottom: .3rem;
}
/* A job title, not a field label — caps would mangle it and cost legibility. */
.rec-role {
  font: 500 15px/1.5 var(--sans);
  color: var(--brass);
  margin-bottom: 1.15rem;
}
.rec-body p { font-size: 1.005rem; }

.chips {
  display: flex; flex-wrap: wrap; gap: .35rem;
  margin: 1.3rem 0 0;
}
.chips li {
  font: 400 12.5px/1 var(--mono);
  color: var(--ink-2);
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: .42rem .55rem;
}

.rec-links {
  display: flex; flex-wrap: wrap; gap: 1.5rem;
  margin-top: 1.3rem;
}
.rec-links a {
  font: 500 15px/1.4 var(--sans);
  color: var(--ink);
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 1px solid var(--rule-2);
  transition: color .18s ease, border-color .18s ease;
}
.rec-links a:hover { color: var(--brass); border-bottom-color: var(--brass); }

/* -------------------------------------------------------------- plate -- */
/* The signature: the reference architecture drawn as a plate, with a
   drafting title block beneath it. */

.plate {
  margin: 0 0 clamp(2.5rem, 5vw, 3.75rem);
  background: var(--paper-2);
  border: 1px solid var(--rule-2);
  border-radius: 4px;
}

.plate-sheet {
  padding: clamp(1.1rem, 2.5vw, 1.75rem);
  overflow-x: auto;
}
/* inner drawing frame, drafting-sheet style */
.plate-sheet > svg {
  width: 100%;
  min-width: 640px;
  height: auto;
  padding: clamp(1rem, 2vw, 1.5rem);
  border: 1px solid var(--rule);
}

.plate-block {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  border-top: 1px solid var(--rule-2);
}
.pb-cell {
  padding: .85rem 1.1rem .95rem;
  border-top: 1px solid var(--rule);
}
.pb-cell:first-child { border-top: 0; }

@media (min-width: 820px) {
  .plate-block { grid-template-columns: 2fr 1fr 1.3fr 1.5fr; }
  .pb-cell { border-top: 0; border-left: 1px solid var(--rule); }
  .pb-cell:first-child { border-left: 0; }
}

.pb-k {
  display: block;
  font: 500 10px/1 var(--sans);
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: .45rem;
}
.pb-v {
  display: block;
  font: 400 13px/1.4 var(--mono);
  color: var(--ink);
}

/* drawing */
.d-box    { fill: var(--paper-2); stroke: var(--rule-2); stroke-width: 1; }
.d-tenant { fill: none; stroke: var(--rule-2); stroke-width: 1; stroke-dasharray: 3 3; }
.d-rail   { fill: var(--brass-wash); stroke: var(--rule-2); stroke-width: 1; }
.d-accent { stroke: var(--brass); }
.d-hair   { stroke: var(--rule); stroke-width: 1; }
.d-arrow  { stroke: #9aa3ad; stroke-width: 1; fill: none; }

.d-cap { font: 500 10px var(--sans); fill: var(--ink-3); letter-spacing: .14em; }
.d-cap-accent { fill: var(--brass); }
.d-lbl { font: 400 11.5px var(--mono); fill: var(--ink-2); text-anchor: middle; }
.d-body { font: 400 12.5px var(--mono); fill: var(--ink); }
.d-dim { fill: var(--ink-3); font-size: 11.5px; }

/* --------------------------------------------------------------- spec -- */

.spec {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  border-top: 1px solid var(--rule);
  border-left: 1px solid var(--rule);
}
@media (min-width: 560px) { .spec { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 900px) { .spec { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.spec-col {
  padding: 1.35rem 1.4rem 1.5rem;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.spec-h {
  font: 500 11px/1 var(--sans);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--brass);
  margin-bottom: 1rem;
  padding-bottom: .8rem;
  border-bottom: 1px solid var(--rule);
}
.spec-list li {
  font: 400 13px/1.5 var(--mono);
  color: var(--ink-2);
  padding: .3rem 0;
}

/* -------------------------------------------------------------- index -- */

.idx { margin-bottom: clamp(2.5rem, 5vw, 3.5rem); }

.idx-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: .35rem;
  padding-block: 1.5rem;
  border-top: 1px solid var(--rule);
}
.idx-row:first-child { border-top: 0; padding-top: 0; }
@media (min-width: 720px) {
  .idx-row { grid-template-columns: 150px minmax(0, 1fr); gap: 2rem; }
}

.idx-when {
  font: 400 13px/1.5 var(--mono);
  color: var(--ink-3);
  margin: 0;
}
.idx-what h3 {
  font: 600 1.02rem/1.4 var(--sans);
  letter-spacing: -.005em;
  margin-bottom: .1rem;
}
.idx-where {
  font: 500 14px/1.5 var(--sans);
  color: var(--brass);
  margin-bottom: .5rem;
}
.idx-note {
  max-width: 68ch;
  font-size: .96rem;
  margin: 0;
}
.idx-flag { color: var(--ink); font-weight: 600; }

/* ----------------------------------------------------------------- edu -- */

.edu { border-top: 1px solid var(--rule-2); padding-top: 1.8rem; }
.edu-h {
  font: 500 11px/1 var(--sans);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 1.2rem;
}
.edu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.4rem;
}
.edu-school {
  font: 400 1.15rem/1.3 var(--serif);
  color: var(--ink);
  margin-bottom: .15rem;
}
.edu-detail {
  font: 400 13px/1.5 var(--mono);
  color: var(--ink-3);
  margin: 0;
}
.edu-note {
  max-width: 60ch;
  margin: 1.6rem 0 0;
  padding-left: 1rem;
  border-left: 2px solid var(--brass);
  font: 400 1.02rem/1.6 var(--serif);
  color: var(--ink-2);
}

/* ------------------------------------------------------- contact band -- */

.band {
  background: var(--band);
  border-top: 0;
  color: var(--band-text);
}
.band .sec-label { color: #8d99a6; border-top-color: var(--brass-2); }
.band .lead { color: #f0f3f6; }
.contact-copy { max-width: 52ch; }

.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(2rem, 4vw, 3.5rem);
  align-items: start;
}
@media (min-width: 900px) {
  .contact-grid { grid-template-columns: minmax(0, 1fr) minmax(320px, 400px); }
}

.contact-card {
  background: var(--band-2);
  border: 1px solid var(--band-rule);
  border-radius: 5px;
  overflow: hidden;
}

.contact-row {
  display: flex; align-items: baseline; gap: 1rem;
  padding: .95rem 1.3rem;
  border-bottom: 1px solid var(--band-rule);
  text-decoration: none;
  transition: background .18s ease;
}
.contact-row:hover { background: #26313d; }
.contact-row-static { cursor: default; }
.contact-row-static:hover { background: transparent; }

.contact-k {
  flex: none; width: 5.2rem;
  font: 500 10.5px/1.7 var(--sans);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #8d99a6;
}
.contact-v {
  font: 400 14.5px/1.5 var(--mono);
  color: #f0f3f6;
  word-break: break-word;
}
.contact-row:hover .contact-v { color: var(--brass-2); }

.contact-dl { display: grid; gap: .6rem; padding: 1.3rem; }

.band .btn {
  background: transparent;
  border-color: var(--band-rule);
  color: #f0f3f6;
}
.band .btn:hover { background: #26313d; border-color: #46545f; }
.band .btn-primary {
  background: var(--brass-2);
  border-color: var(--brass-2);
  color: var(--band);
  font-weight: 600;
}
.band .btn-primary:hover { background: #d9b45f; border-color: #d9b45f; color: var(--band); }

/* -------------------------------------------------------------- footer -- */

.footer {
  background: var(--band);
  border-top: 1px solid var(--band-rule);
  padding-block: 1.75rem;
}
.footer-inner {
  display: flex; flex-wrap: wrap; gap: .4rem 1.5rem;
  justify-content: space-between; align-items: center;
}
.footer p {
  margin: 0;
  font: 400 13px/1.6 var(--mono);
  color: #8d99a6;
}
.footer-meta { color: #7a8794; }

/* -------------------------------------------------------------- motion -- */

.reveal {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .6s cubic-bezier(.22, .61, .36, 1),
              transform .6s cubic-bezier(.22, .61, .36, 1);
}
.reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}

/* ---------------------------------------------------------- responsive -- */

@media (max-width: 939px) {
  /* Section labels sit inline above their content once the rail collapses. */
  .sec-label { padding-top: .8rem; }
}

@media (max-width: 860px) {
  /* The link rail scrolls horizontally rather than disappearing. */
  .nav-inner { gap: 1rem; }
  .nav-links {
    gap: 1.2rem;
    min-width: 0;          /* flex items default to min-width:auto and won't scroll */
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-inline: .1rem;
    mask-image: linear-gradient(to right, transparent 0, #000 8px, #000 calc(100% - 8px), transparent 100%);
    -webkit-mask-image: linear-gradient(to right, transparent 0, #000 8px, #000 calc(100% - 8px), transparent 100%);
  }
  .nav-links::-webkit-scrollbar { display: none; }
  .nav-links a { font-size: 14px; }
  .nav .btn-sm { display: none; }
}

@media (max-width: 620px) {
  body { font-size: 16px; }
  .masthead-loc { width: 100%; }
  .btn-quiet { margin-inline: 0; }
  .ledger dd { font-size: 1.95rem; }
  .rec-flag { margin-top: .5rem; }
  .contact-k { width: 4.4rem; }
}

/* ---------------------------------------------------------------- print -- */

@media print {
  .nav, .hero-actions, .contact-dl, .footer-meta, .skip { display: none !important; }
  body { background: #fff; color: #111; font-size: 11pt; }
  .band, .footer { background: #fff; color: #111; border-top: 1px solid #ccc; }
  .band .lead, .contact-v, .footer p { color: #111; }
  .contact-card { background: #fff; border-color: #ccc; }
  .contact-row { border-bottom-color: #ddd; }
  .contact-k, .sec-label, .band .sec-label { color: #555; }
  .card, .chips li, .plate { background: #fff; border-color: #ccc; }
  .sec-rail { position: static !important; }
  .reveal { opacity: 1 !important; transform: none !important; }
  .section { border-top-color: #ddd; page-break-inside: avoid; }
  .rec, .plate, .idx-row { page-break-inside: avoid; }
  a { text-decoration: underline; }
}
