/* jamiestanton.ai — shared stylesheet
   Palette "Mist" and the Franklin/Spectral pairing are unchanged from the
   original single-page version. See SITE-NOTES.md before altering either. */

/* Fonts are self-hosted (latin subsets, woff2) so first paint does not wait on Google. */
@font-face { font-family: "Libre Franklin"; font-style: normal; font-weight: 400 800; font-display: swap; src: url("/assets/fonts/LibreFranklin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Spectral"; font-style: italic; font-weight: 400; font-display: swap; src: url("/assets/fonts/Spectral-400-italic.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Spectral"; font-style: normal; font-weight: 400; font-display: swap; src: url("/assets/fonts/Spectral-400.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Spectral"; font-style: normal; font-weight: 600; font-display: swap; src: url("/assets/fonts/Spectral-600.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --paper:  #EBEFF4;
  --ink:    #0E1620;
  --muted:  #545C69;
  --rule:   #D2D8E0;
  --accent: #1A47C9;
  --sans: "Libre Franklin", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --serif: "Spectral", Georgia, "Times New Roman", serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0F141A; --ink: #E9ECEF; --muted: #98A1AE; --rule: #232B34; --accent: #8AA9FF;
  }
}
:root[data-theme="dark"] {
  --paper: #0F141A; --ink: #E9ECEF; --muted: #98A1AE; --rule: #232B34; --accent: #8AA9FF;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

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

.page {
  max-width: 44rem;
  margin: 0 auto;
  padding: clamp(1.75rem, 5vw, 2.75rem) clamp(1.5rem, 6vw, 3rem) 4rem;
}

a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 38%, transparent);
  padding-bottom: 1px;
}
a:hover { border-bottom-color: var(--accent); }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

/* ---------- Masthead ---------- */

.masthead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem 2rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--rule);
  margin-bottom: clamp(2.5rem, 7vw, 4rem);
}
.masthead--home { justify-content: flex-start; }

.wordmark {
  font-weight: 800;
  font-size: 1.02rem;
  letter-spacing: -0.03em;
  color: var(--ink);
  border-bottom: 0;
  padding-bottom: 0;
}
.wordmark:hover { border-bottom: 0; color: var(--accent); }

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 1.4rem;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.97rem;
  font-weight: 600;
  letter-spacing: -0.008em;
}
.nav a { color: var(--muted); border-bottom: 1px solid transparent; }
.nav a:hover { color: var(--ink); border-bottom-color: var(--accent); }
.nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ink); }

/* ---------- Hero ---------- */

.name {
  margin: 0;
  font-weight: 800;
  font-size: clamp(3rem, 13vw, 6.2rem);
  line-height: 0.92;
  letter-spacing: -0.035em;
}

.name-rule { height: 2px; background: var(--ink); margin: clamp(1rem, 3vw, 1.5rem) 0 1.1rem; }

.lede {
  margin: 0;
  font-size: clamp(1.2rem, 3.8vw, 1.55rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.26;
  max-width: 30rem;
}

.credential {
  margin: 1.35rem 0 0;
  display: inline-block;
  border-left: 3px solid var(--accent);
  padding: 0.1rem 0 0.1rem 0.8rem;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.01em;
}
.credential span { display: block; font-weight: 400; color: var(--muted); font-size: 0.92rem; letter-spacing: 0; }

.standfirst {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.14rem;
  line-height: 1.68;
}

.intro {
  display: grid;
  grid-template-columns: 11rem 1fr;
  gap: 1.9rem;
  align-items: start;
  margin-top: 1.9rem;
  max-width: 40rem;
}
.intro img { display: block; width: 100%; height: auto; }
.intro .credential { margin-top: 0; margin-bottom: 1.15rem; }
@media (max-width: 33rem) {
  .intro { grid-template-columns: 1fr; gap: 1.5rem; }
  .intro .shot { max-width: 10.5rem; }
}

/* ---------- Subpage head ---------- */

.page-title {
  margin: 0;
  font-weight: 800;
  font-size: clamp(2.5rem, 9vw, 4.1rem);
  line-height: 0.96;
  letter-spacing: -0.035em;
  max-width: 18ch;
}

/* ---------- Sections ---------- */

section { margin-top: clamp(3.5rem, 9vw, 5.5rem); }

.kicker { margin: 0 0 0.9rem; font-size: 0.92rem; font-weight: 700; color: var(--muted); }

h2 {
  margin: 0 0 1.5rem;
  font-size: clamp(1.6rem, 5.2vw, 2.15rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.08;
  max-width: 24ch;
}

h3 {
  margin: 0 0 1.1rem;
  font-size: 1.16rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.prose { font-family: var(--serif); font-size: 1.11rem; line-height: 1.72; max-width: 33rem; }
.prose p { margin: 0 0 1.15em; }
.prose p:last-child { margin-bottom: 0; }
.prose em { font-style: italic; }

.pull {
  margin: 2rem 0;
  padding-left: 1.25rem;
  border-left: 3px solid var(--accent);
  font-family: var(--sans);
  font-weight: 700;
  font-size: 1.22rem;
  line-height: 1.36;
  letter-spacing: -0.02em;
  max-width: 28rem;
}

.more { margin: 1.6rem 0 0; font-weight: 600; font-size: 1rem; }

.rows { list-style: none; margin: 0; padding: 0; max-width: 34rem; border-top: 1px solid var(--rule); }
.rows li { padding: 1.05rem 0; border-bottom: 1px solid var(--rule); }
.rows strong { display: block; font-weight: 700; letter-spacing: -0.012em; margin-bottom: 0.25rem; }
.rows span { display: block; color: var(--muted); font-size: 0.98rem; line-height: 1.55; }

/* ---------- Figures ---------- */

.figures { list-style: none; margin: 0 0 2rem; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; max-width: 34rem; }
.figures li { border-top: 2px solid var(--ink); padding-top: 0.6rem; }
.figures b { display: block; font-size: clamp(1.5rem, 5vw, 2rem); font-weight: 800; letter-spacing: -0.035em; line-height: 1; }
.figures span { display: block; color: var(--muted); font-size: 0.88rem; margin-top: 0.35rem; line-height: 1.4; }
@media (max-width: 30rem) { .figures { grid-template-columns: 1fr 1fr; } }

figure { margin: 2.25rem 0 0; }
figure img { display: block; width: 100%; height: auto; }
figcaption { margin-top: 0.7rem; color: var(--muted); font-size: 0.88rem; line-height: 1.5; max-width: 32rem; }

/* ---------- Gallery ---------- */

.gallery { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 1rem; max-width: 34rem; }
.gallery li { break-inside: avoid; margin: 0 0 1rem; }
.gallery picture { display: block; }
.gallery img { display: block; width: 100%; height: auto; }
@media (max-width: 30rem) { .gallery { columns: 1; } }

/* ---------- Career ---------- */

.career { list-style: none; margin: 0; padding: 0; max-width: 34rem; }
.career li { display: grid; grid-template-columns: 8.5rem 1fr; gap: 0 1.25rem; padding: 0.95rem 0; border-bottom: 1px solid var(--rule); }
.career li:first-child { border-top: 1px solid var(--rule); }
.career .when { color: var(--muted); font-size: 0.93rem; font-variant-numeric: tabular-nums; padding-top: 0.12rem; }
.career .what strong { display: block; font-weight: 700; letter-spacing: -0.012em; }
.career .what span { display: block; color: var(--muted); font-size: 0.96rem; margin-top: 0.15rem; line-height: 1.5; }
@media (max-width: 34rem) {
  .career li { grid-template-columns: 1fr; gap: 0.3rem; }
  .career .when { order: 2; }
}

/* ---------- Talks ---------- */

.talks { list-style: none; margin: 0; padding: 0; max-width: 34rem; border-top: 1px solid var(--rule); }
.talks li { padding: 1.05rem 0; border-bottom: 1px solid var(--rule); }
.talks .title { font-weight: 700; letter-spacing: -0.012em; }
.talks .meta { display: block; color: var(--muted); font-size: 0.94rem; margin-top: 0.22rem; line-height: 1.5; }

/* ---------- Writing teasers ---------- */

.teasers { list-style: none; margin: 0; padding: 0; max-width: 34rem; border-top: 1px solid var(--rule); }
.teasers li { padding: 1.3rem 0; border-bottom: 1px solid var(--rule); }
.teasers .when { display: block; color: var(--muted); font-size: 0.86rem; font-variant-numeric: tabular-nums; margin-bottom: 0.35rem; }
.teasers .title { font-size: 1.16rem; font-weight: 800; letter-spacing: -0.022em; line-height: 1.24; }
.teasers .title a { color: var(--ink); border-bottom-color: color-mix(in srgb, var(--ink) 22%, transparent); }
.teasers .title a:hover { color: var(--accent); border-bottom-color: var(--accent); }
.teasers .summary { display: block; font-family: var(--serif); color: var(--muted); font-size: 1rem; line-height: 1.6; margin-top: 0.4rem; max-width: 30rem; }

/* ---------- Post ---------- */

.post-head { max-width: 33rem; }
.post-title {
  margin: 0;
  font-size: clamp(2.1rem, 7vw, 3.1rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.02;
}
.dateline { margin: 1rem 0 0; color: var(--muted); font-size: 0.92rem; }
.post-body { margin-top: 2.25rem; }

.backlink { margin-top: clamp(3rem, 8vw, 4rem); font-weight: 600; font-size: 1rem; }

/* ---------- Contact and footer ---------- */

.contact { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.7rem 2rem; font-size: 1.06rem; }

footer {
  margin-top: clamp(4rem, 10vw, 6rem);
  padding-top: 1.1rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.85rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.6rem 2rem;
}
footer ul { list-style: none; display: flex; flex-wrap: wrap; gap: 0.6rem 1.3rem; margin: 0; padding: 0; }
footer a { color: var(--muted); border-bottom-color: color-mix(in srgb, var(--muted) 32%, transparent); }
footer a:hover { color: var(--ink); border-bottom-color: var(--ink); }

/* ---------- Accessibility ---------- */

.skip {
  position: absolute; left: 1rem; top: -4rem;
  padding: 0.5rem 0.8rem;
  background: var(--ink); color: var(--paper);
  border: 0; font-weight: 700; z-index: 10;
}
.skip:focus { top: 1rem; outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Post closing ---------- */

.post-close { margin-top: clamp(3rem, 8vw, 4rem); padding-top: 1.5rem; border-top: 1px solid var(--rule); max-width: 33rem; }
.post-close .prose p, .post-close p.prose { margin: 0; }
.post-close-links { margin: 1.4rem 0 0; display: flex; flex-wrap: wrap; gap: 0.5rem 2rem; font-family: var(--sans); font-weight: 600; font-size: 1rem; }

/* ---------- 404 ---------- */

.notfound { max-width: 33rem; }
.notfound .code { margin: 0 0 0.6rem; font-size: 0.92rem; font-weight: 700; color: var(--muted); }
.notfound h1 { margin: 0 0 1.25rem; font-weight: 800; font-size: clamp(2.2rem, 8vw, 3.4rem); line-height: 1; letter-spacing: -0.035em; }
.notfound ul { list-style: none; margin: 1.5rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem 2rem; font-weight: 600; }

@media print {
  .masthead, .skip, footer, .post-close-links { display: none; }
  body { background: #fff; color: #000; font-size: 11pt; }
  a { color: #000; border-bottom: 0; }
}
