/* chrishamilton.uk — stylesheet v2
   Warm reading site. The tie does the shouting. The yellow is the wink. */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600;9..144,700&display=swap');

:root {
  /* Warm palette — pulled from the photo, on a clean white canvas */
  --paper: #ffffff;          /* plain white page background */
  --paper-soft: #f7f0e3;     /* warm cream for asides / cards if needed */
  --ink: #2a2620;            /* warm near-black for body text */
  --ink-soft: #5a4f44;       /* warm soft grey */
  --ink-muted: #8a7a6c;      /* warm muted */
  --rule: #e8dccb;           /* warm rule line */
  --link: #b14c1a;           /* deep warm rust — confident, present, warm */
  --link-hover: #2a2620;     /* darken on hover */
  --accent: #d4a017;         /* the yellow sock — mustard, used sparingly */

  /* Type */
  --display: "Fraunces", "Iowan Old Style", "Georgia", serif;
  --serif: "Iowan Old Style", "Charter", "Georgia", "Cambria", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;

  /* Layout */
  --measure: 42rem;          /* ~720px reading column */
  --measure-wide: 56rem;     /* for home page composition */
}

* { box-sizing: border-box; }

html {
  font-size: 18px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.wrap {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 2.5rem 1.5rem 5rem;
}

.wrap.wide { max-width: var(--measure-wide); }

/* ─── Header ─── */
header {
  margin-bottom: 3rem;
  padding-bottom: 1.5rem;
  position: relative;
}

/* The mustard rule — the yellow sock running through every page */
header::after {
  content: "";
  display: block;
  width: 3rem;
  height: 3px;
  background: var(--accent);
  margin-top: 1.5rem;
}

header .site-name {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.375rem;
  letter-spacing: -0.01em;
  text-decoration: none;
  color: var(--ink);
  display: inline-block;
  margin-bottom: 0.875rem;
}

header nav {
  font-family: var(--sans);
  font-size: 0.9375rem;
  letter-spacing: 0.01em;
}

header nav a {
  color: var(--ink-soft);
  text-decoration: none;
  margin-right: 1.75rem;
  position: relative;
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s, color 0.15s;
}

header nav a:hover {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

header nav a:last-child { margin-right: 0; }

/* ─── Display headings ─── */
h1 {
  font-family: var(--display);
  font-size: 2.5rem;
  line-height: 1.15;
  font-weight: 600;
  margin: 0 0 0.5rem;
  letter-spacing: -0.015em;
  color: var(--ink);
}

h2 {
  font-family: var(--display);
  font-size: 1.5rem;
  line-height: 1.3;
  font-weight: 600;
  margin: 3rem 0 1rem;
  letter-spacing: -0.01em;
  color: var(--ink);
}

h3 {
  font-family: var(--display);
  font-size: 1.1875rem;
  line-height: 1.35;
  font-weight: 600;
  margin: 2rem 0 0.5rem;
  color: var(--ink);
}

h4 {
  font-size: 0.9375rem;
  font-weight: 600;
  margin: 1.5rem 0 0.5rem;
  font-family: var(--sans);
  color: var(--ink-soft);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.subtitle {
  font-family: var(--display);
  font-style: italic;
  font-weight: 400;
  color: var(--ink-soft);
  font-size: 1.1875rem;
  line-height: 1.4;
  margin: 0.75rem 0 2rem;
}

.byline {
  font-family: var(--sans);
  font-size: 0.875rem;
  color: var(--ink-muted);
  margin-bottom: 2.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--rule);
  letter-spacing: 0.02em;
}

/* ─── Body text ─── */
p { margin: 0 0 1.25rem; }

a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: rgba(177, 76, 26, 0.4);
  transition: text-decoration-color 0.15s, color 0.15s;
}

a:hover {
  color: var(--link-hover);
  text-decoration-color: var(--accent);
}

strong { font-weight: 600; color: var(--ink); }
em { font-style: italic; }

/* ─── Lists ─── */
ul, ol {
  margin: 0 0 1.25rem;
  padding-left: 1.5rem;
}

li {
  margin-bottom: 0.5rem;
  padding-left: 0.25rem;
}

ul li::marker { color: var(--ink-muted); }

/* ─── Blockquote ─── */
blockquote {
  margin: 2rem 0;
  padding: 0 0 0 1.5rem;
  border-left: 3px solid var(--accent);
  color: var(--ink-soft);
  font-family: var(--display);
  font-style: italic;
  font-size: 1.1875rem;
  line-height: 1.5;
}

blockquote p { margin-bottom: 0.5rem; }
blockquote p:last-child { margin-bottom: 0; }

/* ─── Horizontal rule ─── */
hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 3rem 0;
}

/* ─── Footer ─── */
footer {
  margin-top: 5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  font-family: var(--sans);
  font-size: 0.8125rem;
  color: var(--ink-muted);
  letter-spacing: 0.01em;
}

footer p { margin-bottom: 0.25rem; }
footer a { color: var(--ink-muted); text-decoration-color: rgba(138, 122, 108, 0.3); }
footer a:hover { color: var(--ink-soft); }

/* ─── Home page composition ─── */
.home-hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3.5rem;
  align-items: center;
  margin: 1rem 0 4rem;
}

.home-hero .photo {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(42, 38, 32, 0.06), 0 12px 32px rgba(42, 38, 32, 0.08);
}

.home-hero .greeting h1 {
  margin-bottom: 1.25rem;
  font-size: 2.75rem;
}

.home-hero .greeting .lead {
  font-size: 1.1875rem;
  color: var(--ink-soft);
  font-family: var(--display);
  font-style: italic;
  font-weight: 400;
  line-height: 1.45;
  margin-bottom: 0;
}

/* The "have a poke around" block */
.poke-around {
  margin-top: 2rem;
}

.poke-around p {
  font-size: 1.0625rem;
}

/* ─── About portrait ─── */
.portrait {
  width: 100%;
  max-width: 24rem;
  margin: 1.5rem auto 2.5rem;
  display: block;
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(42, 38, 32, 0.06), 0 8px 24px rgba(42, 38, 32, 0.06);
}

/* ─── Writing index ─── */
.post-list { list-style: none; padding: 0; margin: 2.5rem 0 0; }

.post-list li {
  margin-bottom: 2.5rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--rule);
  padding-left: 0;
}

.post-list li:last-child { border-bottom: 0; }

.post-list h3 {
  margin: 0.25rem 0 0.5rem;
  font-size: 1.5rem;
  line-height: 1.25;
}

.post-list h3 a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  padding-bottom: 1px;
  transition: border-color 0.15s;
}

.post-list h3 a:hover {
  border-bottom-color: var(--accent);
}

.post-list .meta {
  font-family: var(--sans);
  font-size: 0.8125rem;
  color: var(--ink-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 0;
}

.post-list .summary {
  color: var(--ink-soft);
  margin: 0;
  font-size: 1.0625rem;
  font-family: var(--display);
  font-style: italic;
  line-height: 1.5;
}

/* ─── Permalink (back to writing) ─── */
.permalink {
  display: inline-block;
  font-family: var(--sans);
  font-size: 0.8125rem;
  margin-bottom: 2.5rem;
  color: var(--ink-muted);
  text-decoration: none;
  letter-spacing: 0.02em;
  border-bottom: 1px solid transparent;
  padding-bottom: 1px;
}

.permalink:hover {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

/* ─── Sign-off and footnote ─── */
.signoff {
  font-family: var(--sans);
  font-size: 0.875rem;
  color: var(--ink-muted);
  font-style: italic;
}

.footnote {
  font-family: var(--sans);
  font-size: 0.8125rem;
  color: var(--ink-muted);
  letter-spacing: 0.01em;
}

.footnote a { color: var(--ink-muted); text-decoration-color: rgba(138, 122, 108, 0.3); }

/* ─── Mobile ─── */
@media (max-width: 720px) {
  html { font-size: 17px; }
  .wrap { padding: 2rem 1.25rem 3rem; }

  h1 { font-size: 2rem; }
  h2 { font-size: 1.375rem; margin-top: 2.5rem; }
  h3 { font-size: 1.0625rem; }

  header nav a { margin-right: 1.25rem; }

  .home-hero {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .home-hero .greeting h1 {
    font-size: 2.25rem;
  }

  .home-hero .photo {
    max-width: 22rem;
    margin: 0 auto;
  }

  .portrait {
    max-width: 20rem;
  }

  blockquote {
    font-size: 1.0625rem;
  }

  .subtitle {
    font-size: 1.0625rem;
  }
}
