/* tokens and themes */

:root {
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-head: Georgia, "Iowan Old Style", "Palatino Linotype", "Times New Roman", serif;
  --font-mono: ui-monospace, SFMono-Regular, "Cascadia Mono", Consolas, "Liberation Mono", monospace;

  --measure: 68ch;
  --wrap: 1100px;
  --gutter: 1.5rem;
  --radius: 10px;
  --radius-sm: 6px;

  --step-0: clamp(1rem, 0.96rem + 0.2vw, 1.075rem);
  --step-1: clamp(1.2rem, 1.1rem + 0.5vw, 1.45rem);
  --step-2: clamp(1.5rem, 1.32rem + 0.9vw, 2.05rem);
  --step-3: clamp(2rem, 1.6rem + 2vw, 3.1rem);

  --speed: 180ms;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* all three themes are teal: surfaces at hue 184-187, accents at 174.
   dark and light designed for readability, not accessibility.
   contrast theme designed for high contrast and accessibility. */

/* default to dark theme simply cause I prefer dark */
:root,
[data-theme="dark"] {
  color-scheme: dark;
  --surface:      #082a2e;
  --surface-2:    #0c363b;
  --surface-3:    #12444a;
  --ink:          #cfdedb;   /* 10.95 on surface */
  --ink-soft:     #9ab6b3;   /*  7.04 */
  --border:       #22585e;
  --border-strong:#44959e;
  --accent:       #58d3c6;   /*  8.36, eased down so links do not flare */
  --accent-ink:   #04211f;
  --accent-hover: #7ce4d8;
  --hero-bg:      #04191c;
  --hero-ink:     #cfdedb;
  --hero-ink-soft:#96b0ad;
  --hero-line:    #296d75;
  --mark:         rgba(88, 211, 198, 0.05);
  --shadow:       0 1px 2px rgba(0, 0, 0, 0.4), 0 6px 18px rgba(0, 0, 0, 0.35);
  --shadow-lift:  0 2px 4px rgba(0, 0, 0, 0.45), 0 14px 34px rgba(0, 0, 0, 0.5);
  --hero-wash:    rgba(255, 255, 255, 0.07);
  --focus:        #ffc24d;   /* amber, so focus never reads as an accent */
}

[data-theme="light"] {
  color-scheme: light;
  --surface:      #b5dbde;   /* 38% saturation, was 34% at much higher lightness */
  --surface-2:    #d4e9eb;
  --surface-3:    #97cace;
  --ink:          #0f3133;   /* 9.39 on surface */
  --ink-soft:     #325355;   /* 5.65 */
  --border:       #88b9bc;
  --border-strong:#4e7b7e;
  --accent:       #094e53;   /* 6.36 */
  --accent-ink:   #ebf6f7;
  --accent-hover: #053235;
  --hero-bg:      #7dbbbf;
  --hero-ink:     #0c282a;   /* 7.20, dark ink now that the hero is light */
  --hero-ink-soft:#27494c;   /* 4.54 */
  --hero-line:    #346265;
  --mark:         rgba(9, 78, 83, 0.07);
  --shadow:       0 1px 2px rgba(8, 40, 42, 0.08), 0 6px 18px rgba(8, 40, 42, 0.10);
  --shadow-lift:  0 2px 4px rgba(8, 40, 42, 0.11), 0 14px 34px rgba(8, 40, 42, 0.17);
  --hero-wash:    rgba(0, 0, 0, 0.07);
  --focus:        #8f3604;
}

[data-theme="contrast"] {
  color-scheme: dark;
  --surface:      #000a0c;
  --surface-2:    #000a0c;
  --surface-3:    #001417;
  --ink:          #ffffff;
  --ink-soft:     #ffffff;
  --border:       #ffffff;
  --border-strong:#ffffff;
  --accent:       #7ffff2;   /* 16.68 on surface */
  --accent-ink:   #000000;
  --accent-hover: #ffffff;
  --hero-bg:      #000000;
  --hero-ink:     #ffffff;
  --hero-ink-soft:#ffffff;
  --hero-line:    #7ffff2;
  --mark:         rgba(127, 255, 242, 0.12);
  --shadow:       none;
  --shadow-lift:  none;
  --hero-wash:    rgba(255, 255, 255, 0.2);
  --focus:        #ffffff;
}

/* structure over shading: every boundary a line, every link underlined */
[data-theme="contrast"] .card,
[data-theme="contrast"] .chip,
[data-theme="contrast"] .btn,
[data-theme="contrast"] .stat-strip,
[data-theme="contrast"] .skill-group,
[data-theme="contrast"] .facts,
[data-theme="contrast"] .contact-card,
[data-theme="contrast"] .theme-switch,
[data-theme="contrast"] .skill-search input,
[data-theme="contrast"] .nav-toggle {
  border-width: 2px;
}

[data-theme="contrast"] .featured { border-width: 3px; border-left-width: 6px; }
[data-theme="contrast"] .callout  { border-left-width: 6px; }
[data-theme="contrast"] .section  { border-top-width: 2px; }
[data-theme="contrast"] .site-header { border-bottom-width: 2px; }
[data-theme="contrast"] .site-footer { border-top-width: 2px; }

[data-theme="contrast"] .prose a,
[data-theme="contrast"] .featured p a,
[data-theme="contrast"] .work-entry a,
[data-theme="contrast"] .contact-card a {
  text-decoration: underline;
  text-decoration-thickness: 2px;
}

[data-theme="contrast"] .nav a[aria-current],
[data-theme="contrast"] .theme-switch button[aria-pressed="true"] {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

[data-theme="contrast"] :focus-visible { outline-width: 4px; }

/* no translucency: it softens the boundary this theme needs */
[data-theme="contrast"] .site-header {
  background: var(--surface);
  backdrop-filter: none;
}

/* base */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5.5rem;
}

body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font: var(--step-0)/1.65 var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: 600;
  line-height: 1.18;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}

h1 { font-size: var(--step-3); }
h2 { font-size: var(--step-2); }
h3 { font-size: var(--step-1); }

p { margin: 0 0 1.1em; max-width: var(--measure); }

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

img, svg { max-width: 100%; }

ul { padding-left: 1.2em; }

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

.skip-link {
  position: absolute;
  left: 0.75rem;
  top: -4rem;
  z-index: 100;
  padding: 0.6rem 1rem;
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: var(--radius-sm);
  font-weight: 600;
  text-decoration: none;
  transition: top var(--speed) var(--ease);
}
.skip-link:focus { top: 0.75rem; }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

/* layout */

.wrap {
  width: min(100% - (var(--gutter) * 2), var(--wrap));
  margin-inline: auto;
}

.section {
  position: relative;
  padding: clamp(3.5rem, 8vw, 6rem) 0;
  border-top: 1px solid var(--border);
}

.section--tint { background: var(--surface-2); }

.section__label {
  display: block;
  font: 600 0.78rem/1 var(--font-mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 0.9rem;
}

.section__intro {
  color: var(--ink-soft);
  font-size: var(--step-1);
  max-width: 54ch;
  margin-bottom: 2.5rem;
}

/* masked rather than an <img> so it picks up the theme color */
.section--marked::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-color: var(--accent);
  opacity: 0.06;
  -webkit-mask: url("../images/d20.svg") no-repeat right -80px center / 380px 380px;
  mask: url("../images/d20.svg") no-repeat right -80px center / 380px 380px;
}

[data-theme="contrast"] .section--marked::before { display: none; }

/* header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--surface);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

@supports not (backdrop-filter: blur(4px)) {
  .site-header { background: var(--surface); }
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-head);
  font-size: 1.06rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: 0.01em;
  margin-right: auto;
}
.wordmark:hover { color: var(--accent); }
.wordmark .d20 { width: 24px; height: 24px; color: var(--accent); flex: none; }

.nav { display: flex; align-items: center; gap: 0.35rem; }

.nav a {
  padding: 0.45rem 0.7rem;
  border-radius: var(--radius-sm);
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.94rem;
  font-weight: 500;
}
.nav a:hover { color: var(--ink); background: var(--surface-3); }
.nav a[aria-current] { color: var(--accent); }

.nav-toggle {
  display: none;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.7rem;
  font: 500 0.94rem var(--font-body);
  color: var(--ink);
  background: none;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

/* hero */

.hero {
  position: relative;
  background: var(--hero-bg);
  color: var(--hero-ink);
  padding: clamp(3.5rem, 9vw, 7rem) 0 clamp(3rem, 7vw, 5rem);
  overflow: hidden;
}

/* fades into the page below */
.hero::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: clamp(60px, 12vw, 130px);
  background: linear-gradient(to bottom, transparent, var(--surface));
  pointer-events: none;
}

.hero__d20 {
  position: absolute;
  top: 50%;
  right: -6%;
  width: min(46vw, 420px);
  height: auto;
  transform: translateY(-50%);
  color: var(--hero-line);
  opacity: 0.5;
  pointer-events: none;
}

.hero__inner { position: relative; z-index: 1; max-width: 40rem; }

.hero__eyebrow {
  font: 600 0.8rem/1 var(--font-mono);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--hero-ink-soft);
  margin: 0 0 1.1rem;
}

.hero h1 { margin-bottom: 0.35em; }

.hero__roles {
  font-size: var(--step-1);
  color: var(--hero-ink);
  margin-bottom: 1rem;
}
.hero__roles span { white-space: nowrap; }
.hero__roles .sep { color: var(--hero-ink-soft); padding: 0 0.45rem; }

.hero__pitch { color: var(--hero-ink-soft); max-width: 46ch; }

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.9rem;
}

/* sections */

.about__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}

.facts {
  margin: 0;
  padding: 1.4rem 1.5rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.facts dt {
  font: 600 0.74rem/1 var(--font-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 0.3rem;
}
.facts dd { margin: 0 0 1.15rem; }
.facts dd:last-child { margin-bottom: 0; }

.skill-groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.skill-group {
  padding: 1.35rem 1.4rem 1.5rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.skill-group h3 {
  font-family: var(--font-body);
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 0.9rem;
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.chip {
  display: inline-block;
  padding: 0.28rem 0.65rem;
  font-size: 0.87rem;
  line-height: 1.45;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
}

.chip--learning {
  border-style: dashed;
  border-color: var(--border-strong);
  color: var(--ink-soft);
}

/* revealed by js; without scripting the filter would do nothing */
.skill-search[hidden] { display: none; }

.skill-search {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}
.skill-search label {
  font: 600 0.78rem/1 var(--font-mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.skill-search input {
  flex: 1 1 16rem;
  max-width: 22rem;
  padding: 0.55rem 0.8rem;
  font: inherit;
  font-size: 0.95rem;
  color: var(--ink);
  background: var(--surface-2);
  /* border-strong, not border: a control needs 3:1 */
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
}
.skill-search input::placeholder { color: var(--ink-soft); opacity: 0.75; }

.chip[hidden], .skill-group[hidden] { display: none; }

.skill-empty {
  color: var(--ink-soft);
  font-style: italic;
}

/* separates the featured project from the grid */
.grid-label {
  display: block;
  font: 600 0.74rem/1 var(--font-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 2.5rem 0 1.1rem;
}

/* one only; the treatment stops meaning anything at two */

.featured {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: clamp(1.75rem, 4vw, 3.25rem);
  align-items: start;
  padding: clamp(1.75rem, 4vw, 2.5rem);
  margin-bottom: 2rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.featured__kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font: 600 0.74rem/1 var(--font-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.9rem;
}
.featured__kicker svg { width: 14px; height: 14px; }

.featured h3 {
  font-size: var(--step-2);
  margin-bottom: 0.6rem;
}
.featured h3 a { color: inherit; text-decoration: none; }
.featured h3 a:hover { color: var(--accent); text-decoration: underline; }

.featured p { color: var(--ink-soft); }
.featured p:last-of-type { margin-bottom: 0; }

.featured__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1.6rem;
}

.stat-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: 1.1rem 1rem;
  margin: 1.75rem 0 0;
  padding: 1.25rem 1.35rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.stat-strip div { min-width: 0; }
.stat-strip dt {
  font: 600 0.7rem/1.4 var(--font-mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 0.15rem;
}
.stat-strip dd {
  margin: 0;
  font-family: var(--font-head);
  font-size: 1.65rem;
  line-height: 1.1;
  font-weight: 600;
  color: var(--ink);
}
.stat-strip dd small {
  display: block;
  font: 400 0.82rem/1.4 var(--font-body);
  color: var(--ink-soft);
  margin-top: 0.2rem;
}

.featured__note {
  grid-column: 1 / -1;
  margin: 0;
  padding-top: 1.4rem;
  border-top: 1px solid var(--border);
  font-size: 0.92rem;
  color: var(--ink-soft);
}

[data-theme="contrast"] .featured { border-width: 2px; border-left-width: 4px; }

@media (max-width: 820px) {
  .featured { grid-template-columns: 1fr; }
  .featured__actions .btn { flex: 1 1 auto; justify-content: center; }
}

/* projects */

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform var(--speed) var(--ease), box-shadow var(--speed) var(--ease),
              border-color var(--speed) var(--ease);
}
.card:hover,
.card:focus-within {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lift);
  border-color: var(--border-strong);
}

.card__kicker {
  font: 600 0.74rem/1 var(--font-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 0.7rem;
}

.card h3 { margin-bottom: 0.45rem; }

.card h3 a {
  color: inherit;
  text-decoration: none;
}
.card h3 a:hover { color: var(--accent); text-decoration: underline; }

/* whole card clickable without nesting interactive elements */
.card h3 a::after {
  content: "";
  position: absolute;
  inset: 0;
}

.card p { color: var(--ink-soft); font-size: 0.96rem; margin-bottom: 1.1rem; }

.card__stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  list-style: none;
  margin: auto 0 0;
  padding: 0;
}
.card__stack li {
  font: 0.78rem/1.5 var(--font-mono);
  padding: 0.2rem 0.5rem;
  color: var(--ink-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.card--placeholder {
  border-style: dashed;
  box-shadow: none;
  background: none;
}
.card--placeholder:hover { transform: none; box-shadow: none; }

/* project detail pages */

.page-head {
  padding: clamp(2.5rem, 6vw, 4rem) 0 clamp(2rem, 4vw, 3rem);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}

.breadcrumb {
  font-size: 0.9rem;
  color: var(--ink-soft);
  margin-bottom: 1.1rem;
}
.breadcrumb a { text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb span { padding: 0 0.4rem; }

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1.75rem;
  margin-top: 1.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}
.meta-row div { min-width: 8rem; }
.meta-row dt {
  font: 600 0.72rem/1 var(--font-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 0.35rem;
}
.meta-row dd { margin: 0; font-weight: 500; }

.prose h2 { margin-top: 2.5rem; }
.prose h3 { margin-top: 1.75rem; }
.prose > *:first-child { margin-top: 0; }
.prose ul { max-width: var(--measure); }
.prose li { margin-bottom: 0.4em; }

.prose table {
  width: 100%;
  margin: 1.75rem 0;
  border-collapse: collapse;
  font-size: 0.95rem;
}
.prose th,
.prose td {
  padding: 0.7rem 0.9rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
}
.prose th {
  font: 600 0.74rem/1.5 var(--font-mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  white-space: nowrap;
}
.prose tbody tr:last-child td { border-bottom: none; }
.prose td:first-child { font-weight: 600; white-space: nowrap; }

.table-scroll { overflow-x: auto; }

.status-flag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.75rem;
  margin-bottom: 1.25rem;
  font: 600 0.74rem/1.5 var(--font-mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--surface-3);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
}
.status-flag::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

.callout {
  padding: 1.1rem 1.3rem;
  margin: 2rem 0;
  background: var(--surface-2);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.callout p:last-child { margin-bottom: 0; }

.figure {
  margin: 2rem 0;
}
.figure img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.figure figcaption {
  margin-top: 0.65rem;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

/* work that exists but cannot be linked */

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

.work-entry {
  display: grid;
  grid-template-columns: minmax(0, 15rem) minmax(0, 1fr);
  gap: 0.5rem clamp(1.5rem, 4vw, 3rem);
  padding: 1.6rem 0 0;
  border-top: 1px solid var(--border);
}
.work-entry:first-child { border-top: none; padding-top: 0; }

.work-entry__role {
  font: 600 0.76rem/1.5 var(--font-mono);
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.work-entry h3 { margin-bottom: 0.5rem; }
.work-entry p:last-of-type { margin-bottom: 0; }

.work-entry__note {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 1rem;
  padding: 0.5rem 0.8rem;
  font-size: 0.88rem;
  color: var(--ink-soft);
  background: var(--surface-3);
  border-radius: var(--radius-sm);
}
.work-entry__note svg { width: 1em; height: 1em; flex: none; }

/* present, not promoted */

.section-aside {
  margin-top: clamp(2.5rem, 5vw, 3.5rem);
  padding-top: 1.75rem;
  border-top: 1px solid var(--border);
  max-width: 62ch;
  font-size: 0.94rem;
  color: var(--ink-soft);
}
.section-aside h3 {
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 0.7rem;
}
.section-aside p:last-child { margin-bottom: 0; }

/* the book */

.book {
  display: grid;
  grid-template-columns: minmax(0, 15rem) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 3.5rem);
  align-items: start;
}

.book__cover {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lift);
}

.book__title {
  font-style: italic;
  margin-bottom: 0.35rem;
}

.book__byline {
  font: 600 0.76rem/1.5 var(--font-mono);
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 1.25rem;
}

.book__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.75rem;
}

/* contact */

.contact__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-top: 2rem;
}

.contact-card {
  padding: 1.35rem 1.4rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.contact-card h3 {
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 0.5rem;
}
.contact-card p { margin: 0; font-size: 1.02rem; }
.contact-card a { font-weight: 500; }

/* components */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.25rem;
  font: 600 0.96rem/1.2 var(--font-body);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-decoration: none;
  transition: background-color var(--speed) var(--ease), color var(--speed) var(--ease),
              border-color var(--speed) var(--ease);
}

.btn--primary {
  background: var(--accent);
  color: var(--accent-ink);
}
.btn--primary:hover { background: var(--accent-hover); color: var(--accent-ink); }

.btn--ghost {
  background: transparent;
  color: var(--hero-ink);
  border-color: var(--hero-line);
}
.btn--ghost:hover { background: var(--hero-wash); color: var(--hero-ink); }

.btn--quiet {
  background: var(--surface-2);
  color: var(--ink);
  border-color: var(--border-strong);
}
.btn--quiet:hover { background: var(--surface-3); color: var(--ink); }

.btn svg { width: 1.05em; height: 1.05em; flex: none; }

/* theme control */

.theme-switch {
  display: flex;
  gap: 2px;
  padding: 3px;
  background: var(--surface-3);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
}

.theme-switch button {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  color: var(--ink-soft);
  background: none;
  border: none;
  border-radius: 999px;
  cursor: pointer;
}
.theme-switch button:hover { color: var(--ink); }
.theme-switch button[aria-pressed="true"] {
  background: var(--surface);
  color: var(--accent);
  box-shadow: var(--shadow);
}
.theme-switch svg { width: 17px; height: 17px; }

/* footer */

.site-footer {
  padding: 2.5rem 0 3rem;
  background: var(--surface-2);
  border-top: 1px solid var(--border);
  color: var(--ink-soft);
  font-size: 0.92rem;
}
.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
}
.site-footer p { margin: 0; }
.site-footer nav { margin-left: auto; display: flex; gap: 1.25rem; }

/* responsive */

@media (max-width: 860px) {
  .about__grid { grid-template-columns: 1fr; }
  .work-entry { grid-template-columns: 1fr; }
  .section--marked::before { display: none; }
}

@media (max-width: 620px) {
  .book { grid-template-columns: 1fr; }
  .book__cover { max-width: 13rem; }
}

@media (max-width: 680px) {
  .nav-toggle { display: inline-flex; }

  .nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.5rem var(--gutter) 1rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
  }
  .nav[hidden] { display: none; }
  .nav a { padding: 0.7rem 0.5rem; font-size: 1rem; }

  .hero__d20 { opacity: 0.28; right: -22%; }
  .hero__actions .btn { flex: 1 1 100%; justify-content: center; }
  .site-footer nav { margin-left: 0; width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .card:hover { transform: none; }
}

@media print {
  body { background: #fff; color: #000; }
  .hero { background: #fff; color: #000; padding: 0 0 1rem; }
  .card, .skill-group, .facts { break-inside: avoid; box-shadow: none; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 0.85em; }
}

/* nav, footer links, detail pages */

.page-head__lede {
  font-size: var(--step-1);
  color: var(--ink-soft);
  max-width: 56ch;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 3rem;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 4.25rem;
}

.nav-links { display: flex; align-items: center; gap: 0.35rem; margin-left: auto; }

.nav-links a {
  padding: 0.45rem 0.7rem;
  border-radius: var(--radius-sm);
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.94rem;
  font-weight: 500;
}
.nav-links a:hover { color: var(--ink); background: var(--surface-3); }
.nav-links a[aria-current] { color: var(--accent); }

.footer-links { display: flex; gap: 1.25rem; margin-left: auto; }

@media (max-width: 680px) {
  .site-nav { flex-wrap: wrap; }
  .nav-links { margin-left: 0; width: 100%; }
  .footer-links { margin-left: 0; }
}
