/* ===========================================================
   bartech-books.com — design tokens
   Paper-warm, hand-drawn, coloring-book sourced palette.
   =========================================================== */

@font-face {
  font-family: 'Caveat';
  src: url('../fonts/Caveat-Bold.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: 'Nunito';
  src: url('../fonts/Nunito-Variable.woff2') format('woff2-variations');
  font-weight: 300 900;
  font-display: swap;
}

:root {
  /* Color */
  --paper:        #FFFBF2;
  --paper-dim:    #EAF0F5;
  --ink:          #4A4038;
  --ink-soft:     #8A8275;
  --accent-blue:   #4F84B0;
  --sage:         #3A7D6B;
  --mustard:      #F2C14E;
  --line:         #6B5D4F;
  --line-soft:    #C9C2B4;

  /* Type */
  --font-display: 'Caveat', cursive;
  --font-body:    'Nunito', system-ui, -apple-system, sans-serif;

  /* Layout */
  --max-width: 1120px;
  --gutter: clamp(20px, 5vw, 56px);
  --radius: 16px;
  --stroke: 1.5px;

  --shadow-pop: 0 10px 28px rgba(74, 64, 56, 0.13), 0 2px 6px rgba(74, 64, 56, 0.08);
  --shadow-card: 0 4px 16px rgba(74, 64, 56, 0.08), 0 1px 3px rgba(74, 64, 56, 0.06);
  --shadow-soft: 0 8px 24px rgba(74, 64, 56, 0.08);
}

@media (prefers-color-scheme: dark) {
  /* Intentionally not implementing a dark theme: this brand lives on warm paper. */
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

@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;
  }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 500;
  line-height: 1.55;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
}

body::before {
  /* subtle paper grain so flat color doesn't feel like a UI default */
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(74,64,56,0.025) 0, transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(74,64,56,0.02) 0, transparent 45%);
}

a {
  color: var(--accent-blue);
  text-decoration: none;
}
a:hover { text-decoration: underline; }

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

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.05;
  margin: 0;
  color: var(--ink);
}

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--gutter);
  position: relative;
  z-index: 1;
}

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

/* ---------------- Header ---------------- */

.site-header {
  padding: 22px 0 16px;
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.main-nav a {
  font-weight: 800;
  font-size: 15px;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}

.main-nav a:hover {
  color: var(--accent-blue);
  text-decoration: none;
}

.main-nav a.active {
  color: var(--accent-blue);
  text-decoration: underline;
  text-decoration-color: var(--mustard);
  text-decoration-thickness: 3px;
  text-underline-offset: 6px;
}

.main-nav a.nav-cta {
  background: var(--accent-blue);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 9px 18px;
  box-shadow: var(--shadow-card);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.main-nav a.nav-cta:hover {
  color: #fff;
  background: #3F6F94;
  transform: translateY(-2px);
  box-shadow: var(--shadow-pop);
}

.nav-toggle {
  display: none;
}

@media (max-width: 720px) {
  .main-nav {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    padding-top: 16px;
    border-top: 1px solid var(--line-soft);
    margin-top: 14px;
  }
  .main-nav.is-open { display: flex; }
  .nav-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: 1.5px solid var(--ink);
    border-radius: 8px;
    padding: 8px 12px;
    font-weight: 800;
    font-size: 14px;
    font-family: var(--font-body);
    color: var(--ink);
    cursor: pointer;
  }
  .header-row { position: relative; }
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-family: var(--font-display);
  font-size: 38px;
  font-weight: 700;
  color: var(--ink);
}

.brand-mark {
  height: 80px;
  width: auto;
  flex-shrink: 0;
}

.brand-sub {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* ---------------- Hero ---------------- */

.hero {
  padding: 28px 0 56px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: var(--gutter);
  align-items: center;
}

@media (max-width: 880px) {
  .hero-grid { grid-template-columns: 1fr; }
}

.hero-eyebrow {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sage);
  margin-bottom: 14px;
}

.hero h1 {
  font-size: clamp(40px, 6vw, 64px);
  letter-spacing: 0.01em;
}

.hero h1 .accent {
  color: var(--accent-blue);
  position: relative;
  white-space: nowrap;
}

.hero p.lede {
  font-size: 19px;
  color: var(--ink-soft);
  max-width: 46ch;
  margin-top: 18px;
}

/* The signature element: a hand-drawn coloring-book page frame,
   reused for the hero illustration and every download button. */
.sketch-frame {
  position: relative;
  border: var(--stroke) solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-pop);
  overflow: hidden;
}

.hero-art {
  aspect-ratio: 8.5 / 11;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  max-width: 360px;
  margin: 0 auto;
}

.hero-art svg { width: 100%; height: 100%; padding: 24px; }

/* ---------------- Book grid ---------------- */

.section-label {
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 8px;
}

.section-title {
  font-size: clamp(28px, 4vw, 38px);
  margin-bottom: 36px;
}

.book-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  margin-bottom: 64px;
}

@media (max-width: 880px) {
  .book-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .book-grid { grid-template-columns: 1fr; }
}

.book-card {
  display: flex;
  flex-direction: column;
  border: var(--stroke) solid var(--line-soft);
  border-radius: var(--radius);
  background: #fff;
  overflow: hidden;
  text-decoration: none;
  color: var(--ink);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  box-shadow: var(--shadow-card);
}

.book-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-pop);
  text-decoration: none;
}

.book-card-art {
  aspect-ratio: 8.5 / 11;
  background: linear-gradient(135deg, var(--paper-dim), #DCE8F0);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-bottom: 1px solid var(--line-soft);
  overflow: hidden;
}

.book-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.book-cover-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.book-cover-fallback svg { width: 100%; height: 100%; }

.book-card-body {
  padding: 18px 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-grow: 1;
}

.book-card-title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
}

.book-card-meta {
  font-size: 14px;
  color: var(--ink-soft);
  font-weight: 700;
}

.book-card-cta {
  margin-top: auto;
  padding-top: 10px;
  font-weight: 800;
  font-size: 14px;
  color: var(--accent-blue);
}

/* ---------------- Download button (signature) ---------------- */

.btn-download {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 17px;
  color: var(--ink);
  background: var(--mustard);
  border: none;
  border-radius: 12px;
  padding: 16px 26px;
  box-shadow: var(--shadow-pop);
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-download:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 32px rgba(74, 64, 56, 0.18), 0 4px 10px rgba(74, 64, 56, 0.1);
  text-decoration: none;
}

.btn-download:active {
  transform: translateY(-1px);
  box-shadow: var(--shadow-card);
}

.btn-download svg { width: 22px; height: 22px; flex-shrink: 0; }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 15px;
  color: var(--ink);
  border: 1.5px solid var(--ink);
  border-radius: 10px;
  padding: 10px 18px;
  background: transparent;
  text-decoration: none;
}
.btn-secondary:hover { background: var(--paper-dim); text-decoration: none; }

/* ---------------- Book detail page ---------------- */

.book-detail {
  padding: 36px 0 64px;
}

.breadcrumb {
  font-size: 14px;
  color: var(--ink-soft);
  margin-bottom: 28px;
  font-weight: 700;
}

.detail-grid {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 48px;
  align-items: start;
}

@media (max-width: 880px) {
  .detail-grid { grid-template-columns: 1fr; }
}

.detail-art {
  aspect-ratio: 8.5 / 11;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.detail-art svg { width: 100%; height: 100%; padding: 28px; }

.detail-kicker {
  color: var(--sage);
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.detail-title {
  font-size: clamp(36px, 5vw, 52px);
  margin-bottom: 18px;
}

.detail-desc {
  font-size: 18px;
  color: var(--ink-soft);
  max-width: 52ch;
  margin-bottom: 28px;
}

.detail-meta-row {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 28px;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-soft);
}

.detail-meta-row span strong {
  color: var(--ink);
  display: block;
  font-size: 16px;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  margin-bottom: 36px;
}

.review-nudge {
  font-size: 14px;
  color: var(--ink-soft);
  border-top: 1px dashed var(--line-soft);
  padding-top: 20px;
}

/* ---------------- Newsletter ---------------- */

.newsletter {
  background: var(--ink);
  color: var(--paper);
  border-radius: 20px;
  padding: 44px var(--gutter);
  margin: 24px 0 64px;
}

.newsletter-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 36px;
  align-items: center;
}

@media (max-width: 880px) {
  .newsletter-grid { grid-template-columns: 1fr; }
}

.newsletter h2 {
  color: var(--paper);
  font-size: clamp(26px, 4vw, 36px);
  margin-bottom: 12px;
}

.newsletter p {
  color: #D8D4C8;
  font-size: 16px;
  max-width: 44ch;
}

.newsletter-embed-slot {
  background: rgba(255,255,255,0.06);
  border: 2px dashed rgba(255,255,255,0.25);
  border-radius: 12px;
  padding: 24px;
  font-size: 14px;
  color: #B9B5A8;
  text-align: center;
}

/* ---------------- Footer ---------------- */

.site-footer {
  padding: 32px 0 48px;
  font-size: 14px;
  color: var(--ink-soft);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.site-footer a { color: var(--ink-soft); font-weight: 700; }

/* ---------------- Homepage CTA row ---------------- */

.cta-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 64px;
}

@media (max-width: 880px) {
  .cta-row { grid-template-columns: 1fr; }
}

.cta-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  background: #fff;
  border: var(--stroke) solid var(--line-soft);
  border-radius: var(--radius);
  padding: 28px 24px;
  box-shadow: var(--shadow-card);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.cta-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-pop);
  text-decoration: none;
}

.cta-card-icon {
  width: 32px;
  height: 32px;
  color: var(--accent-blue);
  stroke-width: 1.8;
}

.cta-card-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
}

.cta-card-desc {
  font-size: 14px;
  color: var(--ink-soft);
  font-weight: 600;
}

/* ---------------- All books / category page ---------------- */

.category-block {
  margin-bottom: 56px;
}

.category-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.category-header h2 {
  font-size: clamp(26px, 4vw, 34px);
}

.category-header .category-note {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-soft);
}

.coming-soon-card {
  border: var(--stroke) dashed var(--ink);
  border-radius: var(--radius);
  background: var(--paper-dim);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 36px 20px;
  gap: 8px;
  color: var(--ink-soft);
  min-height: 100%;
}

.coming-soon-card .soon-badge {
  font-family: var(--font-display);
  font-size: 24px;
  color: var(--ink);
}

/* ---------------- Contact / pitch page ---------------- */

.contact-wrap {
  padding: 36px 0 64px;
  max-width: 640px;
}

.contact-intro {
  font-size: 18px;
  color: var(--ink-soft);
  margin-bottom: 32px;
  max-width: 56ch;
}

.form-field {
  margin-bottom: 20px;
}

.form-field label {
  display: block;
  font-weight: 800;
  font-size: 14px;
  margin-bottom: 6px;
  color: var(--ink);
}

.form-field input,
.form-field textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 16px;
  padding: 12px 14px;
  border: 1.5px solid var(--line-soft);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
}

.form-field input:focus,
.form-field textarea:focus {
  outline: 3px solid var(--sage);
  outline-offset: 1px;
}

.form-field textarea {
  resize: vertical;
  min-height: 140px;
}

.form-note {
  font-size: 13px;
  color: var(--ink-soft);
  margin-top: 24px;
}

.form-success {
  display: none;
  background: var(--sage);
  color: #fff;
  border-radius: 10px;
  padding: 16px 20px;
  font-weight: 700;
  margin-bottom: 24px;
}
.form-success.is-visible { display: block; }

/* ---------------- Passcode modal ---------------- */

.passcode-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(74, 64, 56, 0.45);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.passcode-modal.is-open { display: flex; }

.passcode-modal-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-pop);
  padding: 32px;
  max-width: 380px;
  width: 100%;
  position: relative;
}

.passcode-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: none;
  border: none;
  font-size: 22px;
  line-height: 1;
  color: var(--ink-soft);
  cursor: pointer;
  padding: 4px;
}
.passcode-modal-close:hover { color: var(--ink); }

.passcode-modal-title {
  font-family: var(--font-display);
  font-size: 26px;
  margin-bottom: 8px;
}

.passcode-modal-hint {
  font-size: 14px;
  color: var(--ink-soft);
  margin-bottom: 20px;
}

.passcode-modal-card input[type="text"] {
  width: 100%;
  font-family: var(--font-body);
  font-size: 16px;
  padding: 12px 14px;
  border: 1.5px solid var(--line-soft);
  border-radius: 10px;
  margin-bottom: 12px;
}
.passcode-modal-card input[type="text"]:focus {
  outline: 3px solid var(--accent-blue);
  outline-offset: 1px;
}

.passcode-error {
  display: none;
  font-size: 13px;
  color: #B33A3A;
  font-weight: 700;
  margin-bottom: 12px;
}
.passcode-error.is-visible { display: block; }

/* ---------------- 404 ---------------- */

.not-found {
  padding: 100px 0;
  text-align: center;
}

.not-found h1 {
  font-size: clamp(48px, 8vw, 96px);
  color: var(--accent-blue);
}
