/* ============================================================
   IBMNumbersDontLie.com — Stylesheet
   Aesthetic: Law library / literary authority / serious nonfiction
   Palette: Oxblood, cool cream, steel accent, near-black
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400;1,500&family=Libre+Baskerville:ital,wght@0,400;0,700;1,400&family=Lato:wght@300;400;700&display=swap');

/* --- Variables --- */
:root {
  --oxblood: #6B1D2A;
  --oxblood-deep: #4A1019;
  --oxblood-light: #8B2D3A;
  --cream: #F2F0ED;
  --cream-warm: #EAE8E3;
  --gold: #8A9BB5;
  --gold-muted: #7A8DA8;
  --gold-light: #A0B0C8;
  --near-black: #2C1810;
  --text-body: #3D2B20;
  --text-muted: #6B5B4F;
  --white: #FFFFFF;
  --rule-color: #D4C5B0;

  --font-display: 'Cormorant Garamond', 'Georgia', serif;
  --font-body: 'Libre Baskerville', 'Georgia', serif;
  --font-ui: 'Lato', 'Helvetica Neue', sans-serif;

  --content-width: 780px;
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 17px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  color: var(--near-black);
  background-color: var(--cream);
  line-height: 1.75;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: var(--oxblood); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--gold-muted); }

/* --- Utility --- */
.container { width: 100%; max-width: 100%; margin: 0 auto; padding: 0 60px; }
.narrow { max-width: var(--content-width); margin: 0 auto; }

/* --- Animations --- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes slideRule {
  from { width: 0; }
  to   { width: 80px; }
}

.animate-in {
  animation: fadeUp 0.8s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.delay-1 { animation-delay: 0.15s; }
.delay-2 { animation-delay: 0.3s; }
.delay-3 { animation-delay: 0.45s; }
.delay-4 { animation-delay: 0.6s; }
.delay-5 { animation-delay: 0.75s; }
.delay-6 { animation-delay: 0.9s; }

/* --- Header / Nav --- */
.site-header {
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--rule-color);
  background: var(--cream);
  position: sticky;
  top: 0;
  z-index: 100;
}
.site-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.site-logo {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--oxblood);
  letter-spacing: 0.02em;
}
.site-logo span {
  color: var(--gold-muted);
  font-weight: 400;
}

.site-nav { display: flex; gap: 2rem; align-items: center; }
.site-nav a {
  font-family: var(--font-ui);
  font-size: 0.9rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  transition: color 0.2s;
  position: relative;
}
.site-nav a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--gold);
  transition: width 0.3s ease;
}
.site-nav a:hover { color: var(--oxblood); }
.site-nav a:hover::after { width: 100%; }
.site-nav a.active { color: var(--oxblood); font-weight: 700; }
.site-nav a.active::after { width: 100%; }

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--oxblood);
  margin: 5px 0;
  transition: 0.3s;
}

/* --- Section Nav (page jump menu) --- */
.section-nav {
  background: var(--white);
  border-bottom: 1px solid var(--rule-color);
  padding: 1rem 0;
  position: sticky;
  top: var(--header-height, 0px);
  z-index: 99;
}
.section-nav .container {
  display: flex;
  justify-content: center;
  gap: 2.5rem;
}
.section-nav a {
  font-family: var(--font-ui);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: color 0.2s;
  white-space: nowrap;
}
.section-nav a:hover {
  color: var(--oxblood);
}

/* Scroll offset for sticky header + section nav */
[id] {
  scroll-margin-top: var(--scroll-offset, 120px);
}

/* --- Hero (Home) --- */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  text-align: center;
  padding: 2.5rem 2rem 5rem;
  position: relative;
  overflow: hidden;
}
.hero .container {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 40%, rgba(107,29,42,0.04) 0%, transparent 70%),
    radial-gradient(ellipse 60% 40% at 20% 80%, rgba(138,155,181,0.06) 0%, transparent 60%);
  pointer-events: none;
}

.hero-rule-vertical {
  width: 1px;
  height: 60px;
  background: linear-gradient(to bottom, transparent, var(--gold), transparent);
  margin: 0 auto 1.6rem;
  animation: fadeDown 1s ease 0.2s both;
}

.hero-eyebrow {
  font-family: var(--font-body);
  font-size: 0.9rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold-muted);
  margin-bottom: 1.8rem;
}

.book-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2rem, 5vw, 4.5rem);
  line-height: 0.95;
  letter-spacing: -0.02em;
  color: var(--oxblood);
  margin-bottom: 0.2em;
}
.book-title .of {
  font-weight: 400;
  font-style: italic;
  color: var(--gold-muted);
  font-size: 0.85em;
}

.book-subtitle {
  font-family: var(--font-display);
  font-weight: 300;
  font-style: italic;
  font-size: clamp(1.1rem, 2.2vw, 1.6rem);
  color: var(--text-muted);
  letter-spacing: 0.01em;
  margin-bottom: 0.6em;
}

/* Ornament divider */
.ornament {
  display: flex;
  align-items: center;
  gap: 1rem;
  justify-content: center;
  margin: 0.4rem auto 1rem;
}
.ornament-line {
  width: 60px;
  height: 1px;
  background: var(--gold-light);
}
.ornament-diamond {
  width: 6px;
  height: 6px;
  background: var(--gold);
  transform: rotate(45deg);
}

.hero-author {
  font-family: var(--font-body);
  font-size: 1.05rem;
  letter-spacing: 0.06em;
  color: var(--text-body);
  margin-bottom: 2rem;
}
.hero-author strong {
  font-weight: 700;
  color: var(--near-black);
}

.hero-status {
  display: inline-block;
  margin-bottom: 2rem;
  padding: 0.8rem 2.2rem;
  font-family: var(--font-body);
  font-size: 0.9rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--oxblood);
  border: 1.5px solid var(--oxblood);
  text-decoration: none;
  transition: all 0.25s ease;
}
.hero-status:hover {
  background: var(--oxblood);
  color: var(--cream);
}

.hero-support {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
}
.hero-support-label {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-style: italic;
  color: var(--text-muted);
}
.hero-support a {
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--oxblood);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(107,29,42,0.3);
  transition: text-decoration-color 0.2s;
}
.hero-support a:hover {
  text-decoration-color: var(--oxblood);
}

/* Scroll indicator */
.scroll-hint {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}
.scroll-hint span {
  font-family: var(--font-ui);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.scroll-bar {
  width: 1px;
  height: 40px;
  background: var(--gold-light);
  animation: pulse 2s ease infinite;
}

@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes pulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

/* --- Section shared --- */
section {
  padding: 5rem 0;
}
section + section {
  border-top: 1px solid var(--rule-color);
}

.section-eyebrow {
  font-family: var(--font-ui);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold-muted);
  margin-bottom: 0.75rem;
}

.section-title {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 500;
  color: var(--oxblood);
  line-height: 1.25;
  margin-bottom: 1rem;
}

.section-lead {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 620px;
  margin-bottom: 3rem;
}

/* --- Table of Contents Cards (Home) --- */
.toc-section {
  background: var(--white);
}

.toc-cards {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.toc-act-header {
  background: var(--oxblood);
  color: var(--cream);
  padding: 1.5rem 2rem;
  margin-top: 1.5rem;
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.toc-act-header:first-child {
  margin-top: 0;
}
.toc-act-header .act-label {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-light);
  display: block;
  margin-bottom: 0.3rem;
}

.toc-chapter {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 1rem;
  align-items: baseline;
  padding: 1rem 2rem;
  border-bottom: 1px solid var(--rule-color);
  transition: background-color 0.15s ease;
}
.toc-chapter:hover {
  background-color: var(--cream);
}
.toc-chapter:nth-child(even) {
  background-color: var(--cream);
}
.toc-chapter:nth-child(even):hover {
  background-color: var(--cream-warm);
}

.toc-chapter-num {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--gold-muted);
  text-align: right;
  padding-right: 0.5rem;
}

.toc-chapter-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--near-black);
  line-height: 1.4;
}

/* --- Epigraph / Pull Quote --- */
.epigraph-section {
  background: var(--oxblood);
  color: var(--cream);
  text-align: center;
  padding: 4.5rem 2rem;
  position: relative;
}
.epigraph-section::before {
  content: '\201C';
  font-family: var(--font-display);
  font-size: 8rem;
  color: rgba(138,155,181,0.15);
  position: absolute;
  top: 0.5rem;
  left: 50%;
  transform: translateX(-50%);
  line-height: 1;
}

.epigraph-text {
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 400;
  font-style: italic;
  line-height: 1.5;
  max-width: 100%;
  margin: 0 auto 1rem;
  position: relative;
  z-index: 1;
}

.epigraph-source {
  font-family: var(--font-ui);
  font-size: 0.9rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold-light);
  position: relative;
  z-index: 1;
}

/* --- CTA Banner (For Publishers) --- */
.cta-banner {
  text-align: center;
  padding: 4rem 2rem;
  background: var(--cream-warm);
}

.cta-banner h2 {
  font-family: var(--font-display);
  font-size: 1.85rem;
  font-weight: 500;
  color: var(--oxblood);
  margin-bottom: 1rem;
}

.cta-banner p {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}

.btn {
  display: inline-block;
  padding: 0.85rem 2.2rem;
  font-family: var(--font-ui);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-radius: 2px;
  transition: all 0.25s ease;
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: var(--oxblood);
  color: var(--cream);
}
.btn-primary:hover {
  background: var(--oxblood-deep);
  color: var(--cream);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(107,29,42,0.25);
}

.btn-outline {
  background: transparent;
  color: var(--oxblood);
  border: 1px solid var(--oxblood);
}
.btn-outline:hover {
  background: var(--oxblood);
  color: var(--cream);
}

/* --- About Page Hero --- */
.page-hero {
  padding: 4.5rem 0 3.5rem;
  text-align: center;
  border-bottom: 1px solid var(--rule-color);
}

.page-hero h1 {
  font-family: var(--font-display);
  font-size: 2.8rem;
  font-weight: 500;
  color: var(--oxblood);
  margin-bottom: 0.75rem;
}

.page-hero .lead {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-style: italic;
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto;
}

/* --- Author Bio Section --- */
.author-section {
  padding: 4rem 0;
}

.author-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 3.5rem;
  align-items: start;
}

.author-photo-frame {
  aspect-ratio: 3/4;
  background: var(--cream-warm);
  border: 1px solid var(--rule-color);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.author-photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.author-photo-placeholder {
  font-family: var(--font-ui);
  font-size: 0.9rem;
  color: var(--text-muted);
  text-align: center;
  letter-spacing: 0.05em;
}

.author-bio h2 {
  font-family: var(--font-display);
  font-size: 1.85rem;
  font-weight: 600;
  color: var(--near-black);
  margin-bottom: 0.5rem;
}

.author-bio .author-role {
  font-family: var(--font-ui);
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold-muted);
  margin-bottom: 1.5rem;
}

.author-bio p {
  font-size: 1rem;
  color: var(--text-body);
  margin-bottom: 1rem;
  line-height: 1.8;
}

.author-bio p:last-of-type { margin-bottom: 0; }

/* --- Credentials List --- */
.credentials {
  padding: 3rem 0;
  border-top: 1px solid var(--rule-color);
}

.credentials h3 {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 500;
  color: var(--oxblood);
  margin-bottom: 2rem;
}

.credential-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem 2.5rem;
}

.credential {
  display: flex;
  gap: 0.75rem;
  align-items: baseline;
}

.credential-year {
  font-family: var(--font-ui);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--gold-muted);
  letter-spacing: 0.04em;
  min-width: 48px;
  flex-shrink: 0;
}

.credential-text {
  font-size: 0.95rem;
  color: var(--text-body);
  line-height: 1.5;
}

/* --- Publishers Page --- */
.publisher-content {
  padding: 4rem 0;
}

.publisher-content h2 {
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 600;
  color: var(--near-black);
  margin-bottom: 1rem;
  margin-top: 2.5rem;
}
.publisher-content h2:first-of-type { margin-top: 0; }

.publisher-content p {
  font-size: 1rem;
  color: var(--text-body);
  line-height: 1.8;
  margin-bottom: 1rem;
}

.manuscript-details {
  background: var(--white);
  border: 1px solid var(--rule-color);
  padding: 2rem 2.5rem;
  margin: 2.5rem 0;
}

.manuscript-details h3 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--oxblood);
  margin-bottom: 1rem;
}

.detail-row {
  display: flex;
  gap: 1rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--rule-color);
  font-size: 0.95rem;
}
.detail-row:last-child { border-bottom: none; }

.detail-label {
  font-family: var(--font-ui);
  font-weight: 700;
  color: var(--text-muted);
  min-width: 140px;
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.detail-value {
  color: var(--text-body);
}

/* --- Contact Info Block --- */
.contact-block {
  background: var(--oxblood);
  color: var(--cream);
  padding: 3rem 2.5rem;
  margin: 2.5rem 0;
  text-align: center;
}

.contact-block h3 {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.contact-block p {
  color: rgba(245,240,232,0.7);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

.contact-block .contact-email {
  font-family: var(--font-ui);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gold-light);
  display: block;
  margin-bottom: 0.5rem;
}
.contact-block .contact-email:hover { color: var(--gold); }

.contact-block .contact-phone {
  font-family: var(--font-ui);
  font-size: 1rem;
  color: var(--cream);
}

/* --- Contact Form --- */
.contact-form-section {
  background: var(--white);
  border: 1px solid var(--rule-color);
  padding: 2.5rem;
  margin: 2.5rem 0;
}

.contact-form-section h3 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--oxblood);
  margin-bottom: 1.5rem;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-group label {
  font-family: var(--font-ui);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.form-group input,
.form-group textarea {
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--near-black);
  background: var(--cream);
  border: 1px solid var(--rule-color);
  padding: 0.75rem 1rem;
  border-radius: 2px;
  transition: border-color 0.2s;
  line-height: 1.6;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--oxblood);
  box-shadow: 0 0 0 2px rgba(107,29,42,0.08);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-muted);
  opacity: 0.6;
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
}

.contact-form .btn-primary {
  align-self: flex-start;
  margin-top: 0.5rem;
}

/* --- Footer --- */
.site-footer {
  padding: 2.5rem 0;
  border-top: 1px solid var(--rule-color);
  background: var(--cream-warm);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-text {
  font-family: var(--font-ui);
  font-size: 0.9rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.footer-links {
  display: flex;
  gap: 1.5rem;
}
.footer-links a {
  font-family: var(--font-ui);
  font-size: 0.9rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}
.footer-links a:hover { color: var(--oxblood); }

/* --- Responsive --- */
@media (max-width: 900px) {
  .author-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .author-photo-frame {
    max-width: 240px;
    margin: 0 auto;
  }
  .credential-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 680px) {
  html { font-size: 16px; }

  .container { padding: 0 1.25rem; }

  .hero { padding: 3rem 1.5rem 4rem; min-height: 100vh; }
  .book-title { font-size: clamp(1.8rem, 8vw, 3rem); }

  .section-title { font-size: 1.7rem; }
  .epigraph-text { font-size: 1.25rem; }

  .site-nav { display: none; }
  .site-nav.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    background: var(--cream);
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--rule-color);
    gap: 1rem;
  }
  .nav-toggle { display: block; }

  .section-nav .container {
    gap: 1.5rem;
    flex-wrap: wrap;
  }

  .toc-chapter {
    grid-template-columns: 56px 1fr;
    gap: 0.75rem;
    padding: 0.85rem 1.25rem;
  }
  .toc-act-header {
    padding: 1.25rem 1.25rem;
    font-size: 1.2rem;
  }

  .page-hero h1 { font-size: 2rem; }
  .manuscript-details { padding: 1.5rem; }
  .contact-block { padding: 2rem 1.5rem; }
  .contact-form-section { padding: 1.5rem; }

  .credential-grid {
    grid-template-columns: 1fr;
  }

  .detail-row { flex-direction: column; gap: 0.25rem; }
  .detail-label { min-width: auto; }
}
