/* ==========================================================================
   piratecatadventures.com — Sam Field
   ========================================================================== */

:root {
  --bg:        #fbf9f5;
  --bg-sunk:   #f4f0e8;
  --surface:   #ffffff;
  --ink:       #1d1a16;
  --ink-soft:  #433e37;
  --muted:     #6f685d;
  --rule:      #e4ded2;
  --rule-soft: #efeae0;
  --accent:    #196b66;
  --accent-ink:#0f4b47;
  --brass:     #a5702a;
  --shadow:    0 1px 2px rgba(29, 26, 22, .05), 0 12px 28px -18px rgba(29, 26, 22, .30);

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Times New Roman", serif;
  --sans:  ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono:  ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --measure: 34rem;
  --wrap: 60rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:        #121619;
    --bg-sunk:   #0e1215;
    --surface:   #181d21;
    --ink:       #e9e4da;
    --ink-soft:  #cfc9be;
    --muted:     #98a0a5;
    --rule:      #2a3238;
    --rule-soft: #212930;
    --accent:    #63bdb4;
    --accent-ink:#8ad4cb;
    --brass:     #d3a15e;
    --shadow:    0 1px 2px rgba(0, 0, 0, .40), 0 14px 30px -18px rgba(0, 0, 0, .75);
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.7;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main { flex: 1 0 auto; }

a { color: var(--accent-ink); text-underline-offset: 2px; text-decoration-thickness: 1px; }
a:hover { color: var(--accent); }

img { max-width: 100%; height: auto; }

::selection { background: color-mix(in srgb, var(--accent) 24%, transparent); }

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

.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: 1rem; top: 1rem;
  z-index: 20;
  background: var(--surface);
  padding: .6rem 1rem;
  border-radius: .5rem;
  box-shadow: var(--shadow);
}

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

/* --------------------------------------------------------------- masthead */

.masthead {
  border-bottom: 1px solid var(--rule);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(140%) blur(8px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.masthead-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding-block: .85rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  text-decoration: none;
  color: var(--ink);
}

.logo { color: var(--brass); flex: none; display: block; }
.brand:hover .logo { color: var(--accent); }

.brand-text { display: flex; flex-direction: column; line-height: 1.2; }

.brand-name {
  font-family: var(--serif);
  font-size: 1.12rem;
  font-weight: 600;
  letter-spacing: .005em;
}

.brand-domain {
  font-family: var(--sans);
  font-size: .68rem;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--muted);
}

.nav {
  display: flex;
  gap: .35rem;
  font-family: var(--sans);
  font-size: .86rem;
}

.nav a {
  color: var(--muted);
  text-decoration: none;
  padding: .35rem .7rem;
  border-radius: 999px;
}
.nav a:hover { color: var(--ink); background: var(--rule-soft); }
.nav a.is-active { color: var(--accent-ink); background: color-mix(in srgb, var(--accent) 12%, transparent); }

/* Narrow phones: the domain line and the roomy nav padding are the first
   things to go, so the three nav items always fit on one row. */
@media (max-width: 30rem) {
  .wrap { padding-inline: 1.15rem; }

  .masthead-inner { gap: .5rem; padding-block: .7rem; }
  .brand { gap: .55rem; }
  .brand-domain { display: none; }
  .brand-name { font-size: 1rem; }
  .logo { width: 28px; height: 28px; }

  .nav { font-size: .8rem; gap: 0; }
  .nav a { padding: .3rem .5rem; }

  .cv-contact { flex-direction: column; gap: .25rem; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}

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

.hero {
  padding-block: clamp(3rem, 8vw, 5.5rem) clamp(2rem, 5vw, 3.25rem);
  border-bottom: 1px solid var(--rule-soft);
}

.eyebrow {
  font-family: var(--sans);
  font-size: .72rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--brass);
  margin: 0 0 .9rem;
}

.hero-title {
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  line-height: 1.08;
  letter-spacing: -.02em;
  font-weight: 600;
  margin: 0 0 1.25rem;
}

.hero-lede {
  max-width: var(--measure);
  font-size: 1.14rem;
  color: var(--ink-soft);
  margin: 0 0 1rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin-top: 2rem;
}

.button {
  display: inline-block;
  font-family: var(--sans);
  font-size: .88rem;
  font-weight: 500;
  letter-spacing: .01em;
  text-decoration: none;
  padding: .62rem 1.15rem;
  border-radius: 999px;
  border: 1px solid transparent;
  background: var(--accent);
  color: var(--bg);
  cursor: pointer;
  transition: transform .12s ease, background .12s ease, border-color .12s ease;
}
.button:hover { transform: translateY(-1px); background: var(--accent-ink); color: var(--bg); }

.button-quiet {
  background: transparent;
  color: var(--ink);
  border-color: var(--rule);
}
.button-quiet:hover { background: var(--rule-soft); color: var(--ink); border-color: var(--muted); }

/* -------------------------------------------------------------- page head */

.page-head {
  padding-block: clamp(2.5rem, 7vw, 4rem) 1.5rem;
}

.page-title {
  font-size: clamp(2rem, 5vw, 2.9rem);
  line-height: 1.12;
  letter-spacing: -.02em;
  font-weight: 600;
  margin: 0 0 .85rem;
}

.page-lede {
  max-width: var(--measure);
  color: var(--ink-soft);
  font-size: 1.1rem;
  margin: 0;
}

.narrow { max-width: 40rem; }

/* ------------------------------------------------------------- post lists */

.section { padding-block: clamp(2rem, 5vw, 3rem) clamp(2.5rem, 6vw, 4rem); }

.section-title {
  font-family: var(--sans);
  font-size: .74rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  margin: 0 0 1.5rem;
  padding-bottom: .75rem;
  border-bottom: 1px solid var(--rule);
}

.post-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1rem;
}

.post-item-link {
  display: block;
  text-decoration: none;
  color: inherit;
  padding: 1.35rem 1.5rem;
  border: 1px solid var(--rule);
  border-radius: .9rem;
  background: var(--surface);
  transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease;
}
.post-item-link:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--rule));
}

.post-date {
  display: block;
  font-family: var(--sans);
  font-size: .72rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}

.post-item-title {
  font-size: 1.45rem;
  line-height: 1.22;
  letter-spacing: -.012em;
  font-weight: 600;
  margin: .45rem 0 .5rem;
}
.post-item-link:hover .post-item-title { color: var(--accent-ink); }

.post-item-summary {
  margin: 0;
  color: var(--ink-soft);
  max-width: var(--measure);
}

.post-more {
  display: inline-block;
  margin-top: .9rem;
  font-family: var(--sans);
  font-size: .82rem;
  color: var(--accent-ink);
}

.post-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .45rem;
  margin: .95rem 0 0;
}

.tag, .reading {
  font-family: var(--sans);
  font-size: .7rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: .2rem .6rem;
}
.reading { border-color: transparent; padding-inline: .2rem; }

.section-more {
  margin: 1.75rem 0 0;
  font-family: var(--sans);
  font-size: .88rem;
}

/* ------------------------------------------------------------ post detail */

.post { padding-block: clamp(2.5rem, 7vw, 4rem) 4rem; }

.post-head {
  max-width: var(--measure);
  padding-bottom: 1.75rem;
  margin-bottom: 2.25rem;
  border-bottom: 1px solid var(--rule);
}

.post-title {
  font-size: clamp(2rem, 5.2vw, 3rem);
  line-height: 1.1;
  letter-spacing: -.022em;
  font-weight: 600;
  margin: .5rem 0 .9rem;
}

.post-standfirst {
  font-size: 1.16rem;
  color: var(--muted);
  font-style: italic;
  margin: 0;
}

.player {
  max-width: var(--measure);
  margin: 0 0 2.5rem;
  border-radius: .9rem;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.player iframe { display: block; border: 0; }

/* ------------------------------------------------------------------ prose */

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

.prose p,
.prose ul,
.prose ol,
.prose pre,
.prose dl,
.prose table { margin: 0 0 1.35rem; }

.prose > *:last-child { margin-bottom: 0; }

.prose p { color: var(--ink-soft); }

.prose h2 {
  font-size: 1.6rem;
  line-height: 1.22;
  letter-spacing: -.015em;
  font-weight: 600;
  color: var(--ink);
  margin: 3rem 0 1rem;
  padding-top: .35rem;
}
.prose > h2:first-child { margin-top: 0; }
.prose h2::before {
  content: "";
  display: block;
  width: 2.2rem;
  height: 2px;
  background: var(--brass);
  margin-bottom: .9rem;
  border-radius: 2px;
}

.prose h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 2.25rem 0 .85rem;
  color: var(--ink);
}

.prose strong { color: var(--ink); font-weight: 600; }

.prose a { color: var(--accent-ink); }

.prose ul, .prose ol { padding-left: 1.3rem; color: var(--ink-soft); }
.prose li + li { margin-top: .6rem; }
.prose li::marker { color: var(--brass); }

.prose blockquote {
  margin: 2rem 0;
  padding: .25rem 0 .25rem 1.4rem;
  border-left: 3px solid var(--brass);
  color: var(--ink);
  font-style: italic;
  font-size: 1.12rem;
}
.prose blockquote p { color: inherit; }

.prose hr {
  border: 0;
  height: 1px;
  background: var(--rule);
  margin-block: 2.75rem;
}

.prose code {
  font-family: var(--mono);
  font-size: .88em;
  background: var(--bg-sunk);
  border: 1px solid var(--rule-soft);
  border-radius: .3rem;
  padding: .1em .35em;
}

.prose pre {
  background: var(--bg-sunk);
  border: 1px solid var(--rule);
  border-radius: .7rem;
  padding: 1rem 1.15rem;
  overflow-x: auto;
}
.prose pre code { background: none; border: 0; padding: 0; }

/* The playlist post leans on bold-led paragraphs as track headings. */
.prose p > strong:first-child { color: var(--ink); }

.post-foot {
  max-width: var(--measure);
  margin-top: 3.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  font-family: var(--sans);
  font-size: .88rem;
}

/* --------------------------------------------------------------------- CV */

.cv-head { padding-bottom: .5rem; }

.cv-contact {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem 1.1rem;
  font-family: var(--sans);
  font-size: .88rem;
  color: var(--muted);
  margin: 0 0 1rem;
}

.cv-availability {
  max-width: var(--measure);
  color: var(--ink-soft);
  margin: 0;
  font-style: italic;
}

.cv-actions { margin-top: 1.5rem; }

.cv-grid {
  display: grid;
  gap: 2.5rem;
  padding-bottom: 4rem;
  grid-template-columns: 1fr;
}

@media (min-width: 62rem) {
  .cv-grid {
    grid-template-columns: minmax(0, 1.65fr) minmax(15rem, .85fr);
    gap: 3.5rem;
  }
}

.cv-block + .cv-block { margin-top: 2.75rem; }

.cv-h2 {
  font-family: var(--sans);
  font-size: .74rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  margin: 0 0 1.25rem;
  padding-bottom: .7rem;
  border-bottom: 1px solid var(--rule);
}

.cv-summary { margin: 0; color: var(--ink-soft); }

.job + .job {
  margin-top: 2.25rem;
  padding-top: 2.25rem;
  border-top: 1px solid var(--rule-soft);
}

.job-head { margin-bottom: .75rem; }

.job-role {
  font-size: 1.25rem;
  line-height: 1.25;
  font-weight: 600;
  margin: 0 0 .25rem;
}

.job-company {
  font-family: var(--sans);
  font-size: .9rem;
  margin: 0;
  color: var(--ink-soft);
}
.job-company-name { color: var(--accent-ink); font-weight: 500; }
.job-sep { color: var(--rule); margin-inline: .35rem; }
.job-location { color: var(--muted); }

.job-period {
  font-family: var(--sans);
  font-size: .74rem;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--muted);
  margin: .3rem 0 0;
}

.job-note {
  margin: .75rem 0 0;
  color: var(--muted);
  font-style: italic;
  font-size: .97rem;
}

.job-bullets {
  margin: .9rem 0 0;
  padding-left: 1.15rem;
  color: var(--ink-soft);
}
.job-bullets li + li { margin-top: .55rem; }
.job-bullets li::marker { color: var(--brass); }

.cv-defs { margin: 0; }
.cv-defs dt {
  font-family: var(--mono);
  font-size: .92rem;
  color: var(--accent-ink);
  margin-top: 1.25rem;
}
.cv-defs dt:first-child { margin-top: 0; }
.cv-defs dd { margin: .35rem 0 0; color: var(--ink-soft); }

.skill-group + .skill-group { margin-top: 1.5rem; }

.skill-title {
  font-family: var(--sans);
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--ink);
  margin: 0 0 .5rem;
}

.skill-list {
  list-style: none;
  margin: 0;
  padding: 0;
  font-family: var(--sans);
  font-size: .87rem;
  color: var(--ink-soft);
}
.skill-list li {
  padding-left: .95rem;
  position: relative;
  margin-top: .32rem;
  line-height: 1.55;
}
.skill-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .62em;
  width: .3rem;
  height: .3rem;
  border-radius: 50%;
  background: var(--brass);
}

.edu-credential { font-size: 1.05rem; font-weight: 600; margin: 0; }
.edu-institution { margin: .2rem 0 0; color: var(--accent-ink); font-family: var(--sans); font-size: .9rem; }

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

.footer {
  border-top: 1px solid var(--rule);
  background: var(--bg-sunk);
  margin-top: auto;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .75rem 1.5rem;
  padding-block: 1.75rem;
  font-family: var(--sans);
  font-size: .82rem;
  color: var(--muted);
}

.footer-note { margin: 0; }
.footer-links { margin: 0; display: flex; gap: 1.1rem; }
.footer-links a { color: var(--muted); text-decoration: none; }
.footer-links a:hover { color: var(--accent-ink); text-decoration: underline; }

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

@media print {
  :root {
    --bg: #fff; --bg-sunk: #fff; --surface: #fff;
    --ink: #000; --ink-soft: #1a1a1a; --muted: #555;
    --rule: #bbb; --rule-soft: #ddd;
    --accent: #000; --accent-ink: #000; --brass: #666;
  }
  body { font-size: 10.5pt; line-height: 1.45; }
  .masthead, .footer, .no-print { display: none !important; }
  .wrap { max-width: none; padding-inline: 0; }
  .page-head { padding-block: 0 .5rem; }
  .cv-grid {
    display: grid;
    grid-template-columns: 1.7fr 1fr;
    gap: 1.5rem;
    padding-bottom: 0;
  }
  .cv-block + .cv-block { margin-top: 1.25rem; }
  .cv-h2 { margin-bottom: .6rem; padding-bottom: .3rem; }
  .job + .job { margin-top: 1rem; padding-top: 1rem; }
  .job, .cv-block, .edu { break-inside: avoid; }
  a { text-decoration: none; color: #000; }
  @page { margin: 14mm; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  .button:hover, .post-item-link:hover { transform: none; }
}
