/* Craig Hamilton — personal site
   Palette: claret and sky blue (Birmingham/Villa nod), cool paper, deep ink. */
:root {
  --ink: #1c1d2b;
  --ink-soft: #4a4c5e;
  --paper: #f4f5f8;
  --white: #ffffff;
  --claret: #6b1435;
  --claret-soft: #a3476b;
  --sky: #8fbde3;
  --sky-pale: #dcebf7;
  --rule: #d4d7e0;
  --display: "Bricolage Grotesque", system-ui, sans-serif;
  --body: "Public Sans", system-ui, sans-serif;
  --measure: 68ch;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 1.0625rem/1.65 var(--body);
}
a { color: var(--claret); text-underline-offset: 3px; }
a:hover { color: var(--claret-soft); }
:focus-visible { outline: 3px solid var(--sky); outline-offset: 3px; border-radius: 2px; }
img { max-width: 100%; }

.wrap { width: min(1120px, 100% - 2.5rem); margin-inline: auto; }

/* Header */
.site-head { border-bottom: 1px solid var(--rule); background: var(--paper); }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block: 1rem; flex-wrap: wrap; }
.brand { font: 700 1.2rem/1 var(--display); color: var(--ink); text-decoration: none; letter-spacing: -0.01em; }
.brand span { color: var(--claret); }
.nav { display: flex; gap: .3rem 1.3rem; flex-wrap: wrap; }
.nav a { color: var(--ink-soft); text-decoration: none; font-weight: 500; padding-block: .25rem; border-bottom: 2px solid transparent; }
.nav a:hover { color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--claret); }

/* Type */
h1, h2, h3 { font-family: var(--display); line-height: 1.1; letter-spacing: -0.02em; margin: 0 0 .6em; }
h1 { font-size: clamp(2.4rem, 5.5vw, 4.2rem); font-weight: 700; }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 650; }
h3 { font-size: 1.25rem; font-weight: 650; letter-spacing: -0.01em; }
p, li { max-width: var(--measure); }
.lede { font-size: 1.25rem; color: var(--ink-soft); line-height: 1.55; }

/* Hero with skills matrix */
.hero { padding-block: clamp(3rem, 8vw, 6rem) 3rem; display: grid; grid-template-columns: 1.15fr .85fr; gap: 3rem; align-items: center; }
.hero .actions { display: flex; gap: .8rem; flex-wrap: wrap; margin-top: 1.6rem; }
.btn { display: inline-block; padding: .75rem 1.2rem; border-radius: 6px; font-weight: 600; text-decoration: none; border: 2px solid var(--claret); }
.btn.primary { background: var(--claret); color: var(--white); }
.btn.primary:hover { background: #561029; color: var(--white); }
.btn.ghost { color: var(--claret); background: transparent; }

.matrix { background: var(--white); border: 1px solid var(--rule); border-radius: 10px; padding: 1.25rem; }
.matrix caption { text-align: left; font: 600 .95rem/1.3 var(--display); padding-bottom: .8rem; color: var(--ink); }
.matrix table { border-collapse: separate; border-spacing: 4px; width: 100%; }
.matrix th { font: 500 .78rem/1.2 var(--body); color: var(--ink-soft); text-align: left; padding-right: .4rem; }
.matrix thead th { text-align: center; font-size: .72rem; padding: 0 0 .3rem; }
.matrix td { height: 26px; border-radius: 4px; background: var(--paper); }
.matrix td[data-l="1"] { background: var(--sky-pale); }
.matrix td[data-l="2"] { background: var(--sky); }
.matrix td[data-l="3"] { background: var(--claret-soft); }
.matrix td[data-l="4"] { background: var(--claret); }
.matrix .key { display: flex; gap: .9rem; flex-wrap: wrap; margin-top: .8rem; font-size: .75rem; color: var(--ink-soft); }
.matrix .key i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: .3rem; vertical-align: -1px; }
@media (prefers-reduced-motion: no-preference) {
  .matrix td { animation: fill .5s ease-out both; }
  .matrix tr:nth-child(2) td { animation-delay: .08s; } .matrix tr:nth-child(3) td { animation-delay: .16s; }
  .matrix tr:nth-child(4) td { animation-delay: .24s; } .matrix tr:nth-child(5) td { animation-delay: .32s; }
  .matrix tr:nth-child(6) td { animation-delay: .40s; }
  @keyframes fill { from { background: var(--paper); } }
}

/* Sections */
.band { padding-block: 3.5rem; border-top: 1px solid var(--rule); }
.band.alt { background: var(--white); }
.split { display: grid; grid-template-columns: 1fr 2fr; gap: 2.5rem; }
.strands { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; }
.strand { border-top: 4px solid var(--claret); padding-top: 1rem; }
.strand:nth-child(2) { border-top-color: var(--sky); }
.strand:nth-child(3) { border-top-color: var(--ink); }
.strand p { color: var(--ink-soft); }
.figures { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; margin: 0; padding: 0; list-style: none; }
.figures li strong { display: block; font: 700 2.2rem/1 var(--display); color: var(--claret); margin-bottom: .35rem; }
.figures li { color: var(--ink-soft); font-size: .95rem; }

.case { padding-block: 2rem; border-bottom: 1px solid var(--rule); display: grid; grid-template-columns: 220px 1fr; gap: 2rem; }
.case:last-child { border-bottom: 0; }
.case .meta { color: var(--ink-soft); font-size: .95rem; }
.case .meta strong { display: block; color: var(--ink); font-family: var(--display); font-size: 1.05rem; }
.case ul { padding-left: 1.1rem; }
.case li { margin-bottom: .35rem; }

.tags { display: flex; flex-wrap: wrap; gap: .45rem; list-style: none; padding: 0; }
.tags li { background: var(--sky-pale); color: var(--ink); border-radius: 999px; padding: .2rem .75rem; font-size: .88rem; }

.pubs li { margin-bottom: .7rem; }
.note { background: var(--sky-pale); border-left: 4px solid var(--sky); padding: 1rem 1.2rem; border-radius: 0 6px 6px 0; }

/* Footer */
.site-foot { background: var(--ink); color: #c9cbd8; padding-block: 2.5rem; margin-top: 0; }
.site-foot a { color: var(--white); }
.site-foot .wrap { display: flex; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; }
.site-foot h2 { color: var(--white); font-size: 1.4rem; }

@media (max-width: 860px) {
  .hero, .split { grid-template-columns: 1fr; }
  .strands { grid-template-columns: 1fr; }
  .figures { grid-template-columns: repeat(2, 1fr); }
  .case { grid-template-columns: 1fr; gap: .6rem; }
}

/* Blog */
.chips { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.4rem; }
.chip { font: 500 .9rem var(--body); border: 1px solid var(--rule); background: var(--white); color: var(--ink); border-radius: 999px; padding: .35rem .9rem; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--claret); border-color: var(--claret); color: var(--white); }
.post-list { padding-bottom: 3rem; }
.post-list .year { font-size: 1.1rem; color: var(--ink-soft); margin: 2rem 0 .6rem; padding-bottom: .4rem; border-bottom: 1px solid var(--rule); }
.post-card { display: grid; grid-template-columns: 160px 1fr; gap: 1.2rem; padding: 1rem 0; text-decoration: none; color: var(--ink); border-bottom: 1px solid var(--rule); }
.post-card[hidden] { display: none; }
.post-card img, .post-card .nothumb { width: 160px; height: 100px; object-fit: cover; border-radius: 6px; background: var(--sky-pale); display: block; }
.pc-title { display: block; font: 650 1.15rem/1.3 var(--display); }
.post-card:hover .pc-title { color: var(--claret); text-decoration: underline; text-underline-offset: 3px; }
.pc-meta { display: block; color: var(--ink-soft); font-size: .88rem; margin: .2rem 0 .35rem; }
.pc-sum { display: block; color: var(--ink-soft); font-size: .95rem; max-width: 70ch; }
.post { max-width: 760px; padding-block: 2.5rem 3rem; }
.post h1 { font-size: clamp(2rem, 4vw, 2.8rem); }
.post-meta { color: var(--ink-soft); margin: 0 0 .8rem; }
.post-back { font-size: .95rem; }
.post-feature { margin: 1.5rem 0; }
.post-feature img { width: 100%; border-radius: 8px; }
.post-body { font-size: 1.05rem; }
.post-body img { max-width: 100%; height: auto; border-radius: 4px; }
.post-body h2 { font-size: 1.5rem; margin-top: 2rem; }
.post-body h3 { margin-top: 1.6rem; }
.post-body blockquote { margin: 1.2rem 0; padding: .2rem 1.2rem; border-left: 4px solid var(--sky); color: var(--ink-soft); }
.post-body pre { background: #1e2030; color: #e6e8f0; padding: 1rem; border-radius: 6px; overflow-x: auto; font-size: .88rem; line-height: 1.5; }
.post-body code { font-size: .9em; }
.post-body :not(pre) > code { background: var(--sky-pale); padding: .1rem .3rem; border-radius: 3px; }
.post-body table { border-collapse: collapse; display: block; overflow-x: auto; font-size: .92rem; margin: 1rem 0; }
.post-body th, .post-body td { border-bottom: 1px solid var(--rule); padding: .4rem .6rem; text-align: left; }
.post-body iframe { max-width: 100%; border: 0; }
.post-body figure { margin: 1.5rem 0; }
.post-body figcaption, .post-body .caption { color: var(--ink-soft); font-size: .9rem; font-style: italic; }
.post-body .html-widget { max-width: 100%; }
@media (max-width: 640px) {
  .post-card { grid-template-columns: 96px 1fr; gap: .8rem; }
  .post-card img, .post-card .nothumb { width: 96px; height: 72px; }
  .pc-sum { display: none; }
}

/* Case study */
.cs { max-width: 820px; padding-block: 2.5rem 3rem; }
.cs h1 { font-size: clamp(2rem, 4.2vw, 3rem); }
.cs h2 { margin-top: 2.4rem; }
.cs-facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem 2rem; background: var(--white); border: 1px solid var(--rule); border-left: 5px solid var(--claret); border-radius: 8px; padding: 1.2rem 1.4rem; margin: 2rem 0; }
.cs-facts dt { font-weight: 600; font-size: .85rem; color: var(--ink-soft); }
.cs-facts dd { margin: .15rem 0 0; }
.cs-steps { padding-left: 1.3rem; }
.cs-steps li { margin-bottom: .8rem; padding-left: .3rem; }
.cs-figure { margin: 2rem 0; background: var(--white); border: 1px solid var(--rule); border-radius: 8px; padding: 1.2rem; }
.cs-fig { width: 100%; height: auto; font-family: var(--body); }
.cs-figure figcaption { color: var(--ink-soft); font-size: .92rem; margin-top: .8rem; }
.case-link { font-weight: 600; }
@media (max-width: 640px) { .cs-facts { grid-template-columns: 1fr; } }

.portrait { display: block; width: 120px; height: 120px; border-radius: 50%; object-fit: cover; margin-bottom: 1.4rem; border: 4px solid var(--white); box-shadow: 0 0 0 2px var(--sky); }
