:root {
  --paper: #FCFCF9;
  --ink: #1E2430;
  --graphite: #5A6372;
  --crayon-blue: #2C55D4;
  --crayon-red: #E4572E;
  --crayon-yellow: #F5B31E;
  --wash: #F1F4FE;
  --display: "Bricolage Grotesque", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --hand: "Shantell Sans", cursive;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --col: 46rem;
  --pad: clamp(1.25rem, 5vw, 2rem);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

::selection { background: var(--crayon-blue); color: #fff; }

a { color: inherit; }

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

.skip {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--crayon-blue);
  color: #fff;
  padding: .5rem 1rem;
  z-index: 100;
}
.skip:focus { left: 0; }

.wrap {
  max-width: var(--col);
  margin-inline: auto;
  padding-inline: var(--pad);
}

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

.hero { padding-block: clamp(4.5rem, 14vh, 8.5rem) clamp(2.5rem, 6vh, 4rem); }

.eyebrow {
  font-family: var(--mono);
  font-size: .75rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--graphite);
  margin: 0 0 1.5rem;
}

h1 {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(2.9rem, 10vw, 6.25rem);
  line-height: .97;
  letter-spacing: -0.02em;
  margin: 0 0 1.4rem;
}

.hello {
  display: block;
  font-weight: 500;
  font-size: clamp(1.1rem, 3vw, 1.5rem);
  letter-spacing: 0;
  color: var(--graphite);
  margin-bottom: .5rem;
}

.name {
  position: relative;
  display: inline-block;
}

.underline {
  position: absolute;
  left: -1%;
  bottom: -0.28em;
  width: 102%;
  height: .32em;
  pointer-events: none;
}

.roles {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(1.15rem, 3.4vw, 1.5rem);
  color: var(--ink);
  margin: 0;
  max-width: 42ch;
}

.vibe { position: relative; white-space: nowrap; }

.note {
  position: absolute;
  left: 50%;
  top: 100%;
  transform: rotate(-4deg) translate(-30%, .35rem);
  font-family: var(--hand);
  font-size: .95rem;
  color: var(--crayon-blue);
  white-space: nowrap;
}

/* Narrow phones: tuck the note under the line instead of off the edge. */
@media (max-width: 24rem) {
  .roles { position: relative; }
  .vibe { position: static; }
  .note { left: 0; transform: rotate(-4deg) translate(0, .35rem); }
}

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

.section { padding-block: clamp(2.25rem, 6vh, 3.5rem); }

.label {
  font-family: var(--mono);
  font-weight: 500;
  font-size: .75rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--graphite);
  margin: 0 0 1.25rem;
}

.label::before {
  content: "";
  display: inline-block;
  width: 1.1rem;
  height: .28rem;
  margin-right: .6rem;
  vertical-align: .12em;
  background: var(--crayon-blue);
  border-radius: 999px;
  transform: rotate(-2deg);
}

.section p { margin: 0 0 1.1rem; max-width: 60ch; }
.section p:last-child { margin-bottom: 0; }

/* ---------- elsewhere list ---------- */

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

.place a {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .35rem 1rem;
  padding: .9rem .75rem;
  margin-inline: -.75rem;
  border-radius: .5rem;
  text-decoration: none;
  transition: background .15s ease;
}

.place a:hover { background: var(--wash); }

.place-name {
  font-family: var(--mono);
  font-weight: 500;
  font-size: .95rem;
  color: var(--ink);
  border-bottom: 3px solid transparent;
}

.place a:hover .place-name { border-bottom-color: var(--crayon-blue); }

.place-desc { color: var(--graphite); font-size: .95rem; }

.place-arrow { margin-left: auto; color: var(--crayon-blue); font-family: var(--mono); }

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

footer {
  padding-block: clamp(2.5rem, 7vh, 4rem);
  color: var(--graphite);
  font-size: .9rem;
}

footer p { margin: 0 0 .5rem; max-width: 60ch; }

footer a { color: var(--ink); text-decoration-color: var(--crayon-blue); text-decoration-thickness: 2px; }
.section p a { text-decoration-color: var(--crayon-blue); text-decoration-thickness: 2px; text-underline-offset: 2px; }

/* ---------- crayon mode ---------- */

#crayonToggle {
  position: fixed;
  right: clamp(.9rem, 3vw, 1.5rem);
  bottom: clamp(.9rem, 3vw, 1.5rem);
  z-index: 70;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-family: var(--mono);
  font-size: .85rem;
  padding: .6rem .95rem;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  box-shadow: 0 2px 0 var(--ink);
}

#crayonToggle:hover { background: var(--wash); }

#crayonToggle[aria-pressed="true"] {
  background: var(--crayon-blue);
  border-color: var(--crayon-blue);
  color: #fff;
  box-shadow: 0 2px 0 var(--ink);
}

#scribble {
  position: fixed;
  inset: 0;
  z-index: 60;
  touch-action: none;
  cursor: crosshair;
}

#scribble[hidden] { display: none; }

#crayonKit {
  position: fixed;
  left: 50%;
  bottom: clamp(.9rem, 3vw, 1.5rem);
  transform: translateX(-50%);
  z-index: 70;
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .5rem .65rem;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 999px;
  box-shadow: 0 2px 0 var(--ink);
}

#crayonKit[hidden] { display: none; }

.swatch {
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
}

.swatch[aria-pressed="true"] { border-color: var(--ink); }

.swatch-blue { background: var(--crayon-blue); }
.swatch-red { background: var(--crayon-red); }
.swatch-yellow { background: var(--crayon-yellow); }

.kit-btn {
  font-family: var(--mono);
  font-size: .8rem;
  background: none;
  border: none;
  color: var(--ink);
  cursor: pointer;
  padding: .35rem .5rem;
  border-radius: .4rem;
}

.kit-btn:hover { background: var(--wash); }

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

/* ---------- tabs ---------- */

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem;
  padding-top: clamp(1.25rem, 4vh, 2rem);
  font-family: var(--mono);
  font-size: .85rem;
}

.tabs a {
  padding: .4rem .7rem;
  margin-left: -.7rem;
  margin-right: .7rem;
  border-radius: .4rem;
  text-decoration: none;
  color: var(--graphite);
  border-bottom: 3px solid transparent;
}

.tabs a:hover { background: var(--wash); color: var(--ink); }

.tabs a[aria-current="page"] {
  color: var(--ink);
  border-bottom-color: var(--crayon-blue);
}

.hero.compact { padding-block: clamp(2.5rem, 8vh, 4.5rem) clamp(1.5rem, 4vh, 2.5rem); }

.hero.compact h1 { font-size: clamp(2.4rem, 8vw, 4.5rem); }

.soon {
  display: inline-block;
  font-family: var(--hand);
  color: var(--crayon-blue);
  transform: rotate(-3deg);
}

/* ---------- books: home shelf ---------- */

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

.shelf a {
  display: flex;
  flex-direction: column;
  gap: .6rem;
  width: clamp(5.25rem, 21vw, 6.75rem);
  text-decoration: none;
}

.shelf img,
.book-cover img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: .25rem;
  box-shadow: 0 1px 2px rgba(30, 36, 48, .12), 0 8px 24px rgba(30, 36, 48, .12);
  transition: transform .2s ease;
}

.shelf a:hover img { transform: translateY(-3px) rotate(-.6deg); }

.shelf-title {
  font-family: var(--display);
  font-weight: 800;
  font-size: .9rem;
  line-height: 1.2;
}

.shelf a:hover .shelf-title {
  text-decoration: underline;
  text-decoration-color: var(--crayon-blue);
  text-decoration-thickness: 3px;
}

/* ---------- books: books tab ---------- */

.book-detail {
  display: grid;
  grid-template-columns: clamp(6.5rem, 16vw, 8.5rem) 1fr;
  gap: 1.75rem;
  align-items: start;
  padding-block: 1.5rem 2.5rem;
  scroll-margin-top: 1.5rem;
}

.book-detail + .book-detail { border-top: 1px solid #E3E6EC; padding-top: 2.5rem; }

.book-series {
  font-family: var(--mono);
  font-size: .75rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--graphite);
  margin: 0 0 .4rem;
}

.book-name {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(1.6rem, 5vw, 2.2rem);
  line-height: 1.1;
  margin: 0 0 1rem;
}

.section .book-desc p { margin: 0 0 .9rem; }

.book-questions { font-style: italic; color: var(--graphite); }

.book-amazon {
  display: inline-block;
  margin-top: .5rem;
  font-family: var(--mono);
  font-size: .9rem;
  color: var(--crayon-blue);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.book-detail:target .book-name {
  text-decoration: underline;
  text-decoration-color: var(--crayon-yellow);
  text-decoration-thickness: 5px;
}

@media (max-width: 34rem) {
  /* Phone: small cover beside the title, description full width below. */
  .book-detail { grid-template-columns: 5.5rem 1fr; gap: .9rem 1.1rem; }
  .book-body { display: contents; }
  .book-cover { grid-column: 1; grid-row: 1 / span 2; }
  .book-series { grid-column: 2; grid-row: 1; align-self: end; }
  .book-name { grid-column: 2; grid-row: 2; align-self: start; margin: 0; }
  .book-desc, .book-amazon { grid-column: 1 / -1; }
  .book-amazon { justify-self: start; margin-top: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .shelf a:hover img { transform: none; }
}

/* ---------- contact ---------- */

.contact-email {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(1.35rem, 5vw, 1.9rem);
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.section .contact-email a {
  text-decoration-color: var(--crayon-blue);
  text-decoration-thickness: 4px;
  text-underline-offset: 5px;
}

.contact-form {
  display: grid;
  gap: 1rem;
  max-width: 34rem;
  margin-top: 1.5rem;
}

.contact-form .row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 1rem;
}

.contact-form label {
  display: grid;
  gap: .35rem;
  font-family: var(--mono);
  font-size: .8rem;
  letter-spacing: .06em;
  color: var(--graphite);
}

.contact-form input,
.contact-form textarea {
  font: inherit;
  font-family: var(--body);
  font-size: 1rem;
  letter-spacing: 0;
  color: var(--ink);
  background: #fff;
  border: 2px solid #D5DAE3;
  border-radius: .5rem;
  padding: .65rem .8rem;
  width: 100%;
}

.contact-form textarea { min-height: 8rem; resize: vertical; }

.contact-form input:focus,
.contact-form textarea:focus { outline: none; border-color: var(--crayon-blue); }

.contact-form .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.contact-form button {
  justify-self: start;
  font-family: var(--mono);
  font-size: .9rem;
  padding: .7rem 1.2rem;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--crayon-blue);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 2px 0 var(--ink);
}

.contact-form button:hover { filter: brightness(1.08); }

.contact-form button[disabled] { opacity: .6; cursor: progress; }

.section .form-status { margin: 0; min-height: 1.65em; color: var(--graphite); }

/* ---------- elsewhere groups ---------- */

.group-label {
  font-family: var(--mono);
  font-weight: 500;
  font-size: .75rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--graphite);
  margin: 1.75rem 0 .25rem;
}

.group-label:first-of-type { margin-top: 0; }

/* ---------- single book page ---------- */

.crumbs a { color: inherit; text-decoration: none; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }

.book-hero { padding-block: clamp(2.5rem, 7vh, 4rem) clamp(1rem, 3vh, 2rem); }

.book-hero-grid {
  display: grid;
  grid-template-columns: clamp(7rem, 24vw, 12rem) 1fr;
  gap: clamp(1.1rem, 4vw, 2.25rem);
  align-items: center;
}

.book-hero-cover {
  display: block;
  width: 100%;
  height: auto;
  border-radius: .3rem;
  box-shadow: 0 1px 2px rgba(30, 36, 48, .12), 0 12px 32px rgba(30, 36, 48, .16);
}

.book-h1 {
  font-size: clamp(2rem, 7vw, 3.75rem);
  line-height: 1.02;
  margin: 0 0 .6rem;
}

.book-byline {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(1rem, 3vw, 1.25rem);
  color: var(--graphite);
  margin: 0 0 1.1rem;
}

.book-byline a { color: var(--ink); text-decoration-color: var(--crayon-blue); text-decoration-thickness: 2px; }

.book-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin: 0; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-family: var(--mono);
  font-size: .85rem;
  padding: .6rem 1rem;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--crayon-blue);
  color: #fff;
  text-decoration: none;
  box-shadow: 0 2px 0 var(--ink);
}

.btn:hover { filter: brightness(1.08); }

.btn-quiet { background: var(--paper); color: var(--ink); }
.btn-quiet:hover { background: var(--wash); filter: none; }

.book-name a { text-decoration: none; }
.book-name a:hover { text-decoration: underline; text-decoration-color: var(--crayon-blue); text-decoration-thickness: 3px; }

.book-links { display: flex; flex-wrap: wrap; gap: .4rem 1.25rem; margin: .5rem 0 0; }
.book-links .book-amazon { margin-top: 0; }

.shelf-meta { font-family: var(--mono); font-size: .75rem; color: var(--graphite); }

.shelf a[aria-current="page"] img { outline: 3px solid var(--crayon-blue); outline-offset: 3px; }

@media (max-width: 34rem) {
  .book-links { grid-column: 1 / -1; }
}

/* ---------- footer social icons ---------- */

.social { list-style: none; display: flex; flex-wrap: wrap; gap: .35rem; margin: 0 0 1.25rem -.75rem; padding: 0; }
.social a {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 999px;
  color: var(--graphite);
}
.social a:hover, .social a:focus-visible { color: var(--crayon-blue); background: var(--wash); }
.social svg { fill: currentColor; }

/* ---------- research ---------- */

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

.pubs li { padding: .9rem 0; border-bottom: 1px solid #E3E6EC; max-width: 60ch; }
.pubs li:last-child { border-bottom: 0; }

.pub-title {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.1rem;
  line-height: 1.25;
  text-decoration-color: var(--crayon-blue);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.pub-meta { display: block; margin-top: .3rem; font-size: .92rem; color: var(--graphite); }

.giving {
  border-left: 4px solid var(--crayon-red);
  padding-left: clamp(1rem, 4vw, 1.5rem);
}
