/* Cal Kennedy — static author site (luminon-inspired dark palette) */

:root {
  --siz-min: 0.875rem;
  --siz-0: 0.9375rem;
  --siz-1: 1rem;
  --siz-2: 1.125rem;
  --siz-3: 1.25rem;
  --siz-4: 1.75rem;
  --siz-5: 2.25rem;
  --siz-6: 3rem;
  --siz-7: 3.5rem;

  --rad-2: 6px;
  --rad-3: 8px;

  --nav-hgt: calc(48px + 2rem);
  --max-wid: 1024px;
  --about-wid: 800px;

  --wht-1: hsl(230, 25%, 95%);
  --wht-2: hsl(230, 25%, 80%);
  --wht-3: hsl(230, 25%, 65%);
  --blk-1: hsl(230, 15%, 30%);
  --blk-2: hsl(230, 15%, 20%);
  --blk-3: hsl(230, 15%, 15%);
  --red-1: hsl(358, 79%, 57%);
  --red-2: hsl(358, 79%, 47%);
  --blu-1: hsl(222, 75%, 60%);
  --blu-2: hsl(222, 75%, 55%);
  --ylw-1: hsl(37, 100%, 78%);

  --fnt-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  --trn: all 0.125s ease-in-out;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--fnt-sans);
  font-size: var(--siz-2);
  line-height: 1.55;
  color: var(--wht-2);
  background: var(--blk-3);
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  color: var(--wht-1);
}

h1, h2, h3 {
  font-family: var(--fnt-sans);
  font-weight: 600;
  color: var(--wht-1);
  line-height: 1.2;
  margin: 0;
}

p {
  margin: 0;
}

em {
  font-style: italic;
  color: var(--wht-1);
}

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  width: 100%;
  height: var(--nav-hgt);
  border-bottom: 1px solid var(--blk-1);
  background: var(--blk-2);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--max-wid);
  height: 100%;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.brand {
  font-family: var(--fnt-sans);
  font-size: var(--siz-3);
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--wht-1);
}

.menu-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 1px solid var(--blk-1);
  border-radius: var(--rad-2);
  background: transparent;
  color: var(--wht-1);
  cursor: pointer;
}

.menu-toggle__icon {
  display: block;
  width: 1.25rem;
  height: 2px;
  background: var(--wht-1);
  box-shadow: 0 -6px 0 var(--wht-1), 0 6px 0 var(--wht-1);
}

.site-nav {
  display: none;
}

.site-nav a {
  font-weight: 600;
  color: var(--wht-1);
  padding: 0.75rem 1rem;
  border-radius: var(--rad-2);
}

.site-nav a:hover {
  background: var(--blk-1);
}

.site-nav.is-open {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: fixed;
  inset: 0;
  z-index: 9;
  padding: 6rem 2.5rem 2rem;
  background: var(--blk-3);
}

@media (min-width: 800px) {
  .menu-toggle {
    display: none;
  }

  .site-nav {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.25rem;
  }

  .site-nav.is-open {
    position: static;
    inset: auto;
    padding: 0;
    background: transparent;
  }
}

/* Sections */

.section {
  width: 100%;
  padding: 4rem 0;
}

.section--alt {
  background: var(--blk-2);
  border-top: 1px solid var(--blk-1);
}

.section--border {
  border-top: 1px solid var(--blk-1);
}

.section__intro,
.section__body,
.luminon-teaser,
.contact-block {
  width: min(100%, var(--about-wid));
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section__intro {
  width: min(100%, 900px);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.eyebrow {
  font-size: var(--siz-1);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--wht-3);
}

.hero-title {
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 650;
}

.lede {
  font-size: clamp(1.125rem, 2.5vw, 1.25rem);
  color: var(--wht-2);
}

.section-title {
  font-size: clamp(1.75rem, 4vw, 3rem);
  margin-bottom: 1.5rem;
}

/* Books */

.books-grid {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 2rem;
  width: min(100%, 1000px);
  margin: 0 auto;
  padding: 0 1.5rem;
}

@media (min-width: 900px) {
  .books-grid {
    flex-direction: row;
    align-items: stretch;
    gap: 2.5rem;
  }
}

.book-card {
  flex: 1 1 280px;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  padding: 1.5rem;
  border-radius: var(--rad-3);
  background: var(--blk-2);
  border: 1px solid var(--blk-1);
  /* Never clip book blurbs on mobile */
  overflow: visible;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.book-card:hover {
  transform: translateY(-2px);
}

.book-card--patient {
  border-color: hsla(222, 75%, 60%, 0.35);
  background-image: linear-gradient(165deg, hsla(222, 40%, 22%, 0.55), transparent 55%);
}

.book-card--patient:hover {
  border-color: var(--blu-1);
}

.book-card--compelled {
  border-color: hsla(358, 79%, 57%, 0.4);
  background-image: linear-gradient(165deg, hsla(358, 50%, 18%, 0.65), transparent 55%);
}

.book-card--compelled:hover {
  border-color: var(--red-1);
}

.book-cover {
  width: 100%;
  height: auto;
  max-height: 420px;
  object-fit: contain;
  object-position: center top;
  border-radius: var(--rad-2);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
}

.book-card__body {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  /* Ensure full text visibility */
  overflow: visible;
  min-height: 0;
}

.book-card__title {
  font-size: var(--siz-4);
  font-weight: 600;
  letter-spacing: 0.01em;
}

.book-card--patient .book-card__title {
  color: var(--blu-1);
}

.book-card--compelled .book-card__title {
  color: var(--red-1);
}

.book-card__subtitle {
  font-size: var(--siz-min);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--wht-3);
}

.book-card__blurb {
  font-size: var(--siz-2);
  color: var(--wht-2);
  overflow: visible;
  white-space: normal;
  text-overflow: unset;
}

.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
  margin-top: 0.35rem;
  padding: 0 1.5rem 2px;
  min-height: 3.25rem;
  border: none;
  border-radius: calc(3.25rem / 2);
  font-family: var(--fnt-sans);
  font-size: var(--siz-2);
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #fff;
  cursor: pointer;
  transition: var(--trn);
  -webkit-tap-highlight-color: transparent;
}

.btn--patient {
  background: var(--blu-2);
}

.btn--patient:hover {
  background: var(--blu-1);
  color: #fff;
  outline: 1px solid var(--wht-1);
}

.btn--compelled {
  background: var(--red-1);
}

.btn--compelled:hover {
  background: var(--red-2);
  color: #fff;
  outline: 1px solid var(--wht-1);
}

/* Luminon teaser */

.luminon-teaser {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.25rem;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

.luminon-teaser__logo {
  width: min(220px, 70%);
  height: auto;
}

.luminon-teaser__text {
  font-size: var(--siz-2);
  color: var(--wht-2);
  max-width: 40rem;
}

.luminon-teaser__link {
  color: var(--blu-1);
  font-weight: 600;
}

.luminon-teaser__link:hover {
  color: var(--wht-1);
  text-decoration: underline;
}

/* About */

.prose {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.prose p {
  font-size: clamp(1.125rem, 2vw, 1.25rem);
  color: var(--wht-2);
}

.quote {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 0.5rem 0 0;
  padding: 1.5rem;
  border-radius: var(--rad-3);
  background: var(--blk-3);
  border: none;
}

.quote p {
  font-size: clamp(1.25rem, 2.5vw, 1.75rem);
  color: var(--ylw-1);
}

.quote cite {
  font-size: var(--siz-1);
  font-style: normal;
  color: var(--wht-3);
}

/* Contact */

.contact-block {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

.contact-block .section-title {
  margin-bottom: 0;
}

.contact-email {
  font-size: var(--siz-2);
  color: var(--blu-1);
  font-weight: 600;
}

.contact-email:hover {
  color: var(--wht-1);
}

/* Footer */

.site-footer {
  border-top: 1px solid var(--blk-1);
  background: var(--blk-2);
  padding: 3rem 1.5rem;
  text-align: center;
}

.site-footer__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  max-width: var(--about-wid);
  margin: 0 auto;
}

.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
}

.site-footer a {
  color: var(--wht-2);
}

.site-footer a:hover {
  color: var(--wht-1);
}

.site-footer__copy {
  color: var(--wht-2);
}

.site-footer__tag {
  font-size: var(--siz-min);
  color: var(--wht-3);
}

/* Legal pages */

.legal {
  width: min(100%, 1000px);
  margin: 0 auto;
  padding: 4rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  color: var(--wht-1);
}

.legal h1 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
}

.legal h2 {
  font-size: var(--siz-3);
  margin-top: 0.5rem;
}

.legal p,
.legal li {
  color: var(--wht-2);
  font-size: var(--siz-2);
}

.legal ul {
  margin: 0;
  padding-left: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.legal hr {
  border: none;
  height: 1px;
  width: 100%;
  background: var(--blk-1);
  margin: 0.5rem 0;
}

.legal a {
  color: var(--wht-1);
  font-weight: 600;
}

/* Fade-in */

.fade-in {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.fade-in.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .fade-in {
    opacity: 1;
    transform: none;
    transition: none;
  }

  html {
    scroll-behavior: auto;
  }
}
