/* ==========================================================================
   DocKoontz.com memorial site
   Static, single page. No JavaScript, no external fonts, no tracking.

   Palette designed in OKLCH, shipped as hex for older-browser compatibility.
   All text/background pairs verified against WCAG 2.1:
     ink on white          15.55 : 1
     muted on white         8.11 : 1
     bronze on white        7.67 : 1
     ivory on ink-deep     17.28 : 1
     honey on ink-deep     11.00 : 1
     kicker on ink-deep     7.38 : 1
     white on bronze        7.67 : 1
   ========================================================================== */

:root {
  /* color */
  --bg: #ffffff;          /* oklch(1 0 0) */
  --ink-deep: #0d131d;    /* oklch(0.185 0.022 262)  hero + footer band */
  --ink: #1f242e;         /* oklch(0.26  0.02  262)  body text */
  --muted: #4b5059;       /* oklch(0.43  0.016 262)  secondary text */
  --surface: #f4f6f8;     /* oklch(0.972 0.004 255)  tinted sections, panels */
  --line: #d6d9de;        /* oklch(0.885 0.008 255)  hairlines */
  --bronze: #7a4710;      /* oklch(0.45  0.095 62)   links, accents */
  --bronze-deep: #653907; /* oklch(0.39  0.085 62)   hover, small accent text */
  --hero-ivory: #f9f6f2;  /* oklch(0.975 0.006 85)   light text on dark band */
  --hero-muted: #d5c5ab;  /* oklch(0.83  0.04  80)   secondary text on dark band */
  --kicker: #c99b5a;      /* oklch(0.72  0.10  75)   honey accents on dark band */

  /* type */
  --font-serif: 'Palatino Linotype', Palatino, 'Book Antiqua', 'URW Palladio L', Georgia, 'Times New Roman', serif;
  --font-sans: 'Segoe UI', system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif;
}

/* ---- base ---------------------------------------------------------------- */

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

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

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: clamp(1.0625rem, 1.02rem + 0.25vw, 1.125rem);
  line-height: 1.68;
}

img { max-width: 100%; }

h1, h2, h3 { text-wrap: balance; }

section[id] { scroll-margin-top: 1.25rem; }

::selection { background: var(--kicker); color: var(--ink-deep); }

a {
  color: var(--bronze);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 0.15s ease-out;
}

a:hover {
  color: var(--bronze-deep);
  text-decoration-thickness: 2px;
}

a:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--bronze);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  z-index: 10;
  background: var(--bg);
  color: var(--bronze-deep);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  padding: 0.7rem 1.1rem;
  border: 1px solid var(--bronze);
  border-radius: 0 0 5px 0;
}

.skip-link:focus { left: 0; }

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

.hero {
  background: var(--ink-deep);
  color: var(--hero-ivory);
  border-bottom: 4px solid var(--bronze);
  padding: clamp(3.25rem, 9vw, 5.5rem) 1.5rem clamp(3.5rem, 9vw, 5.75rem);
}

.hero-inner {
  max-width: 56rem;
  margin-inline: auto;
  display: grid;
  gap: 2.5rem;
  justify-items: center;
  text-align: center;
}

.portrait {
  margin: 0;
  width: min(58vw, 230px);
}

.portrait img {
  display: block;
  width: 100%;
  height: auto;
  border: 5px solid var(--hero-ivory);
  border-radius: 2px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.4);
}

.hero-kicker {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--kicker);
}

.hero h1 {
  margin: 0.9rem 0 0.4rem;
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(2.25rem, 1.3rem + 4.2vw, 3.5rem);
  line-height: 1.1;
  letter-spacing: 0.01em;
  color: var(--hero-ivory);
}

.hero-aka {
  margin: 0 0 1.5rem;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(1.2rem, 1rem + 1vw, 1.5rem);
  color: var(--hero-muted);
}

.hero-roles {
  margin: 0 0 0.45rem;
  font-family: var(--font-sans);
  font-size: 0.98rem;
  letter-spacing: 0.03em;
  color: var(--hero-muted);
}

.hero-dates {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  color: var(--kicker);
}

@media (min-width: 760px) {
  .hero-inner {
    grid-template-columns: 270px minmax(0, 1fr);
    align-items: center;
    justify-items: start;
    text-align: left;
    gap: clamp(2.5rem, 6vw, 4rem);
  }

  .portrait { width: 100%; }
}

/* ---- in-page navigation -------------------------------------------------- */

.page-nav {
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.page-nav ul {
  list-style: none;
  margin: 0 auto;
  padding: 0.85rem 1.25rem;
  max-width: 64rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 1.9rem;
  justify-content: center;
}

.page-nav a {
  font-family: var(--font-sans);
  font-size: 0.92rem;
  color: var(--muted);
  text-decoration: none;
  padding: 0.2rem 0;
  border-bottom: 2px solid transparent;
  transition: color 0.15s ease-out, border-color 0.15s ease-out;
}

.page-nav a:hover {
  color: var(--bronze-deep);
  border-bottom-color: var(--bronze);
}

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

.section { padding: clamp(3rem, 8vw, 4.75rem) 1.5rem; }

.section-tinted {
  background: var(--surface);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.section-inner {
  max-width: 47rem;
  margin-inline: auto;
}

#curriculum-vitae .section-inner { max-width: 50rem; }

h2 {
  margin: 0 0 1.6rem;
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(1.65rem, 1.3rem + 1.4vw, 2.15rem);
  line-height: 1.2;
  color: var(--ink);
}

h2::before {
  content: "";
  display: block;
  width: 3.25rem;
  height: 2px;
  background: var(--bronze);
  margin-bottom: 1.1rem;
}

h3 {
  margin: 2.4rem 0 0.9rem;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.25rem;
  line-height: 1.3;
  color: var(--ink);
}

.prose p {
  max-width: 65ch;
  margin: 0 0 1.15rem;
  text-wrap: pretty;
}

.lede { font-size: 1.13em; }

.obit-pointer { margin-top: 1.6rem; }

.archive-note {
  font-family: var(--font-sans);
  font-size: 0.875rem;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 0.85rem 1.1rem;
  margin: 0 0 1.7rem;
  max-width: 65ch;
}

/* ---- professional life --------------------------------------------------- */

.degree-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: 65ch;
}

.degree-list li { padding: 0.65rem 0; }

.degree-list li + li { border-top: 1px solid var(--line); }

.timeline {
  margin: 0;
  max-width: 65ch;
}

.timeline > div {
  display: grid;
  gap: 0.15rem 1.5rem;
  padding: 0.8rem 0;
}

.timeline > div + div { border-top: 1px solid var(--line); }

.timeline dt {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  color: var(--bronze-deep);
  padding-top: 0.2rem;
}

.timeline dd { margin: 0; }

@media (min-width: 640px) {
  .timeline > div { grid-template-columns: 10.5rem minmax(0, 1fr); }
}

.focus-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.45rem 2rem;
}

.focus-list li {
  position: relative;
  padding-left: 1.1rem;
}

.focus-list li::before {
  content: "\00B7";
  position: absolute;
  left: 0;
  color: var(--bronze);
  font-weight: 700;
}

@media (min-width: 560px) {
  .focus-list {
    grid-template-columns: 1fr 1fr;
    max-width: 40rem;
  }
}

/* ---- curriculum vitae accordion ------------------------------------------ */

.cv-intro {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  color: var(--muted);
  margin: 0 0 1.9rem;
  max-width: 65ch;
}

details {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  margin-top: 0.85rem;
  overflow: hidden;
}

summary {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: 1.05rem 1.3rem;
  cursor: pointer;
  list-style: none;
  transition: background-color 0.15s ease-out;
}

summary::-webkit-details-marker { display: none; }

summary:hover { background: var(--surface); }

summary:focus-visible { outline-offset: -2px; }

.acc-title {
  flex: 1 1 auto;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.08rem;
  color: var(--ink);
}

.acc-count {
  font-family: var(--font-sans);
  font-size: 0.82rem;
  color: var(--muted);
  white-space: nowrap;
}

summary::after {
  content: "+";
  font-family: var(--font-sans);
  font-size: 1.35rem;
  line-height: 1;
  color: var(--bronze);
}

details[open] summary::after { content: "\2212"; }

details[open] summary { border-bottom: 1px solid var(--line); }

.cv-list {
  list-style: none;
  margin: 0;
  padding: 0.4rem 1.3rem 1.15rem;
}

.cv-list li { padding: 0.85rem 0; }

.cv-list li + li { border-top: 1px solid var(--line); }

.cv-name {
  display: block;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.02rem;
  color: var(--ink);
}

.cv-meta {
  display: block;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  letter-spacing: 0.03em;
  color: var(--bronze-deep);
  margin-top: 0.2rem;
}

.cv-org {
  display: block;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  color: var(--muted);
  margin-top: 0.2rem;
  max-width: 60ch;
}

/* ---- memorial links ------------------------------------------------------ */

.links-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.links-list li { padding: 0.35rem 0 1.2rem; }

.links-list a {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.15rem;
}

.link-note {
  display: block;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  color: var(--muted);
  margin-top: 0.35rem;
  max-width: 65ch;
}

.donation {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1.5rem 1.7rem 1.7rem;
  margin: 1.4rem 0 0;
}

.donation h3 { margin: 0 0 0.7rem; }

.donation p {
  margin: 0 0 1.1rem;
  max-width: 60ch;
}

.donation p:last-child { margin-bottom: 0; }

.donation-link {
  display: inline-block;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.95rem;
  background: var(--bronze);
  color: #ffffff;
  padding: 0.7rem 1.2rem;
  border-radius: 4px;
  text-decoration: none;
  transition: background-color 0.15s ease-out;
}

.donation-link:hover,
.donation-link:focus-visible {
  background: var(--bronze-deep);
  color: #ffffff;
}

.profiles {
  font-family: var(--font-sans);
  font-size: 0.93rem;
  color: var(--muted);
  margin: 1.9rem 0 0;
}

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

.site-foot {
  background: var(--ink-deep);
  border-top: 4px solid var(--bronze);
  color: var(--hero-muted);
  text-align: center;
  padding: 3rem 1.5rem 3.4rem;
}

.foot-name {
  margin: 0 0 0.35rem;
  font-family: var(--font-serif);
  font-size: 1.18rem;
  color: var(--hero-ivory);
}

.foot-years {
  margin: 0 0 1.1rem;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  letter-spacing: 0.12em;
  color: var(--kicker);
}

.foot-note {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 0.85rem;
}

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after { transition: none !important; }
}

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

@media print {
  .skip-link,
  .page-nav { display: none; }

  .hero,
  .site-foot {
    background: #ffffff;
    color: #000000;
    border-color: #000000;
  }

  .hero h1,
  .hero-kicker,
  .hero-aka,
  .hero-roles,
  .hero-dates,
  .foot-name,
  .foot-years,
  .foot-note { color: #000000; }

  .portrait img {
    box-shadow: none;
    border-color: #dddddd;
  }

  a {
    color: #000000;
    text-decoration: none;
  }

  .links-list a::after,
  .donation-link::after,
  .profiles a::after,
  .obit-pointer a::after {
    content: " (" attr(href) ")";
    font-size: 0.85em;
  }

  .donation-link {
    background: none;
    color: #000000;
    padding: 0;
  }

  details {
    border-color: #dddddd;
    break-inside: avoid-page;
  }
}

/* ---- back to top ----------------------------------------------------------- */

.back-to-top {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 1000;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.75rem 0.95rem;
  border-radius: 999px;
  background: #0d131d;
  color: #fff;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.24);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease, background-color 0.2s ease;
}

.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.back-to-top:hover,
.back-to-top:focus-visible {
  background: #1b2738;
  color: #fff;
  text-decoration: none;
}

.back-to-top:focus-visible {
  outline: 3px solid rgba(255, 255, 255, 0.8);
  outline-offset: 3px;
}

@media (max-width: 480px) {
  .back-to-top {
    right: 0.75rem;
    bottom: 0.75rem;
    padding: 0.7rem 0.8rem;
  }

  .back-to-top span:last-child {
    display: none;
  }
}