/* ============================================================
   Quiet Pages Publishing — style.css
   Aesthetic: warm parchment · editorial serif · muted depth
   Fonts: Playfair Display (headings) + DM Sans (body/nav)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,500;0,700;1,400;1,500&family=DM+Sans:ital,wght@0,300;0,400;0,500;1,300&display=swap');

/* ── Reset ────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }

/* ── Design Tokens ────────────────────────────────────────── */
:root {
  --parchment:      #f5f1e8;   /* warm off-white ground */
  --parchment-2:    #ece7db;   /* panels, nav bg */
  --parchment-3:    #d6cfc4;   /* borders / dividers */
  --slate:          #2d2c2a;   /* primary text */
  --slate-mid:      #514e49;   /* secondary text */
  --slate-light:    #8a8680;   /* labels, captions */
  --sage:           #6b7d6a;   /* accent */
  --sage-dark:      #4e5c4d;   /* accent hover */

  --font-serif:  'Playfair Display', Georgia, serif;
  --font-sans:   'DM Sans', 'Helvetica Neue', sans-serif;

  --max-w: 1020px;
  --pad:   clamp(1.25rem, 4vw, 2.5rem);
}

body {
  background-color: var(--parchment);
  color: var(--slate);
  font-family: var(--font-sans);
  font-weight: 300;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

/* Subtle paper grain overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.028;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
}

img   { display: block; max-width: 100%; height: auto; }
a     { color: inherit; text-decoration: none; }
strong { font-weight: 500; }

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

/* ── Typography helpers ───────────────────────────────────── */
.overline {
  font-family: var(--font-sans);
  font-size: 0.67rem;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--slate-light);
}

.section-rule {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 3.5rem 0 2.5rem;
  color: var(--slate-light);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
}

.section-rule::before,
.section-rule::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--parchment-3);
}

hr.rule {
  border: none;
  border-top: 1px solid var(--parchment-3);
  margin: 2.5rem 0;
}

/* ============================================================
   NAVIGATION
   ============================================================ */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--parchment-2);
  border-bottom: 1px solid var(--parchment-3);
}

.site-nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

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

/* Emblem in nav — subtle publisher mark */
.nav-brand .nav-emblem {
  width: 44px;
  height: auto;
  object-fit: contain;
  opacity: 0.72;
  flex-shrink: 0;
}

.nav-brand-text {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 400;
  color: var(--slate);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2.75rem;
  list-style: none;
}

.nav-links a {
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--slate-mid);
  transition: color 0.2s;
  position: relative;
  padding-bottom: 2px;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0;
  width: 0; height: 1px;
  background: var(--sage);
  transition: width 0.25s ease;
}

.nav-links a:hover,
.nav-links a.active            { color: var(--slate); }
.nav-links a:hover::after,
.nav-links a.active::after     { width: 100%; }

/* Hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.nav-toggle span { display: block; width: 22px; height: 1px; background: var(--slate); }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--sage-dark);
  border: 1px solid var(--sage);
  padding: 0.75rem 1.7rem;
  transition: background 0.2s, color 0.2s;
}
.btn:hover { background: var(--sage); color: var(--parchment); }

.btn-solid {
  background: var(--slate);
  color: var(--parchment);
  border-color: var(--slate);
}
.btn-solid:hover { background: var(--slate-mid); border-color: var(--slate-mid); color: var(--parchment); }

/* ============================================================
   PAGE HEAD (shared inner-page header)
   ============================================================ */
.page-head {
  padding: 5rem var(--pad) 4rem;
  border-bottom: 1px solid var(--parchment-3);
}

.page-head .overline { display: block; margin-bottom: 0.75rem; }

.page-head h1 {
  font-family: var(--font-serif);
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  font-weight: 400;
  color: var(--slate);
  letter-spacing: -0.01em;
  line-height: 1.1;
}

.page-head .head-sub {
  margin-top: 1rem;
  font-size: 0.96rem;
  color: var(--slate-mid);
  max-width: 560px;
  line-height: 1.82;
}

/* ============================================================
   HOME — HERO
   ============================================================ */
.hero {
  padding: 5.5rem var(--pad) 6.5rem;
  border-bottom: 1px solid var(--parchment-3);
  position: relative;
  overflow: hidden;
}

.hero-numeral {
  position: absolute;
  right: -0.02em;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-serif);
  font-size: clamp(18rem, 28vw, 34rem);
  font-weight: 700;
  font-style: italic;
  color: var(--parchment-2);
  line-height: 1;
  pointer-events: none;
  user-select: none;
}

.hero .container { position: relative; z-index: 1; max-width: 560px; }

/* Hero emblem — subtle imprint mark */
.hero .hero-emblem {
  width: 34px;
  height: auto;
  object-fit: contain;
  margin-bottom: 2.4rem;
  opacity: 0.8;
}

.hero-label { margin-bottom: 1rem; }

.hero h1 {
  font-family: var(--font-serif);
  font-size: clamp(2.6rem, 6vw, 4.4rem);
  font-weight: 400;
  line-height: 1.05;
  color: var(--slate);
  margin-bottom: 1.5rem;
  letter-spacing: -0.02em;
}

.hero h1 em { font-style: italic; color: var(--slate-mid); }

.hero-body {
  font-size: 1.03rem;
  color: var(--slate-mid);
  max-width: 440px;
  line-height: 1.82;
  margin-bottom: 2.8rem;
}

/* Section divider — thin ruled line between hero and content */
.section-divider {
  width: 60px;
  height: 1px;
  background: var(--parchment-3);
  border: none;
  display: block;
  margin: 4rem auto;
  opacity: 0.6;
}

/* ============================================================
   HOME — ABOUT STRIP
   ============================================================ */
.about-strip {
  padding: 6rem 0;
  border-bottom: 1px solid var(--parchment-3);
}

.about-strip .container {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 4rem;
  align-items: start;
}

.strip-label .overline { display: block; margin-bottom: 0.9rem; }

.strip-label h2 {
  font-family: var(--font-serif);
  font-size: clamp(1.55rem, 2.8vw, 2.1rem);
  font-weight: 400;
  line-height: 1.2;
  color: var(--slate);
}
.strip-label h2 em { font-style: italic; color: var(--slate-mid); }

.strip-body p {
  font-size: 0.97rem;
  color: var(--slate-mid);
  line-height: 1.85;
  max-width: 560px;
}
.strip-body p + p { margin-top: 1.1rem; }

/* ============================================================
   HOME — SERIES PANEL
   ============================================================ */
.series-panel {
  background: var(--parchment-2);
  border-top: 1px solid var(--parchment-3);
  border-bottom: 1px solid var(--parchment-3);
  padding: 6rem 0;
}

.series-panel .container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5rem;
  align-items: center;
}

.panel-text .overline { display: block; margin-bottom: 1rem; }

.panel-text h2 {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 400;
  line-height: 1.1;
  color: var(--slate);
  margin-bottom: 1.3rem;
  letter-spacing: -0.01em;
}
.panel-text h2 em { font-style: italic; }

.panel-desc {
  font-size: 0.95rem;
  color: var(--slate-mid);
  line-height: 1.85;
  margin-bottom: 2.2rem;
}

.edition-list { list-style: none; border-top: 1px solid var(--parchment-3); }
.edition-list li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--parchment-3);
}
.ed-name { font-family: var(--font-serif); font-size: 1rem; font-weight: 400; color: var(--slate); }
.ed-clue { font-size: 0.66rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--slate-light); }

/* Decorative sudoku motif */
.panel-motif { display: flex; align-items: center; justify-content: center; }

.sudoku-motif {
  width: min(260px, 90%);
  aspect-ratio: 1;
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  grid-template-rows: repeat(9, 1fr);
  border: 2px solid var(--parchment-3);
  opacity: 0.45;
}

.sudoku-motif .cell {
  border-right: 1px solid var(--parchment-3);
  border-bottom: 1px solid var(--parchment-3);
  font-family: var(--font-serif);
  font-size: clamp(0.42rem, 1.1vw, 0.65rem);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--slate-mid);
}
.sudoku-motif .cell:nth-child(3n)                    { border-right-width: 2px; }
.sudoku-motif .cell:nth-child(n+19):nth-child(-n+27) { border-bottom-width: 2px; }
.sudoku-motif .cell:nth-child(n+46):nth-child(-n+54) { border-bottom-width: 2px; }

/* ============================================================
   BOOKS PAGE
   ============================================================ */
.books-section { padding: 3.5rem 0 6rem; }

/* Section heading with flanking rules */
.edition-heading {
  font-family: var(--font-serif);
  font-size: clamp(1.2rem, 2.5vw, 1.55rem);
  font-weight: 400;
  color: var(--slate);
  letter-spacing: 0.01em;
}

/* Book grid — 3 col desktop, 2 tablet, 1 mobile */
.books-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.5rem 2rem;
  margin-bottom: 1rem;
}

/* Book card */
.book-card {
  display: flex;
  flex-direction: column;
}

.book-cover {
  aspect-ratio: 8 / 10;
  background: var(--parchment-2);
  border: 1px solid var(--parchment-3);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.4rem 1rem;
  text-align: center;
  position: relative;
  overflow: hidden;
  margin-bottom: 1.2rem;
  transition: border-color 0.25s;
}

.book-cover::before {
  content: '';
  position: absolute;
  inset: 12%;
  border: 1px solid var(--parchment-3);
  pointer-events: none;
  transition: border-color 0.25s;
}

.book-card:hover .book-cover { border-color: var(--sage); }
.book-card:hover .book-cover::before { border-color: var(--sage); opacity: 0.5; }

.cover-inner { position: relative; z-index: 1; }

.cover-series {
  font-family: var(--font-sans);
  font-size: 0.54rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--slate-light);
  display: block;
  margin-bottom: 0.4rem;
}

.cover-title {
  font-family: var(--font-serif);
  font-size: 0.88rem;
  font-weight: 400;
  color: var(--slate-mid);
  line-height: 1.4;
  display: block;
}

.book-card h3 {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 400;
  color: var(--slate);
  margin-bottom: 0.4rem;
  line-height: 1.3;
}

.book-vol {
  font-size: 0.72rem;
  color: var(--slate-light);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 1rem;
  display: block;
}

.book-card .btn { font-size: 0.66rem; padding: 0.65rem 1.4rem; align-self: flex-start; }

/* ============================================================
   ABOUT PAGE
   ============================================================ */
.about-content { padding: 5rem 0 7rem; }
.about-content .container { max-width: 660px; }

.about-content h2 {
  font-family: var(--font-serif);
  font-size: clamp(1.4rem, 2.8vw, 1.85rem);
  font-weight: 400;
  color: var(--slate);
  margin-top: 3.5rem;
  margin-bottom: 1rem;
  letter-spacing: -0.01em;
}
.about-content h2:first-of-type { margin-top: 0; }

.about-content p {
  font-size: 0.97rem;
  color: var(--slate-mid);
  line-height: 1.88;
  margin-bottom: 1.1rem;
}

.pullquote {
  font-family: var(--font-serif);
  font-size: clamp(1.15rem, 2.5vw, 1.5rem);
  font-style: italic;
  font-weight: 400;
  color: var(--slate);
  line-height: 1.55;
  padding: 2.2rem 0 2.2rem 2rem;
  border-left: 2px solid var(--parchment-3);
  margin: 3rem 0;
}

/* ============================================================
   CONTACT PAGE
   ============================================================ */
.contact-content { padding: 5rem 0 7rem; }
.contact-content .container { max-width: 560px; }

.contact-content p {
  font-size: 0.97rem;
  color: var(--slate-mid);
  line-height: 1.88;
  margin-bottom: 1.2rem;
}

.contact-block {
  margin-bottom: 1.5rem;
  padding: 1.6rem 2rem 1.6rem 2.2rem;
  background: var(--parchment-2);
  border: 1px solid var(--parchment-3);
  border-left: 2px solid var(--sage);
}

.contact-block .contact-type {
  font-size: 0.65rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--slate-light);
  display: block;
  margin-bottom: 0.45rem;
}

.contact-block a {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 400;
  color: var(--slate);
  transition: color 0.2s;
}
.contact-block a:hover { color: var(--sage-dark); }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: var(--slate);
  padding: 3.5rem var(--pad);
}

.site-footer .container {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 2rem;
}

.footer-left { display: flex; align-items: center; gap: 1.1rem; }

.footer-left .footer-emblem {
  width: 40px;
  height: 40px;
  object-fit: contain;
  opacity: 0.5;
  filter: invert(1);
  flex-shrink: 0;
}

.footer-brand-name {
  font-family: var(--font-serif);
  font-size: 0.98rem;
  font-weight: 400;
  color: var(--parchment);
  opacity: 0.8;
}

.footer-tagline {
  font-size: 0.7rem;
  color: var(--parchment);
  opacity: 0.38;
  margin-top: 0.15rem;
  letter-spacing: 0.04em;
}

.footer-right { text-align: right; }

.footer-nav {
  list-style: none;
  display: flex;
  gap: 2rem;
  margin-bottom: 0.9rem;
  justify-content: flex-end;
}
.footer-nav a {
  font-size: 0.66rem;
  font-weight: 400;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--parchment);
  opacity: 0.44;
  transition: opacity 0.2s;
}
.footer-nav a:hover { opacity: 0.88; }

.footer-copy {
  font-size: 0.7rem;
  color: var(--parchment);
  opacity: 0.28;
  letter-spacing: 0.03em;
  line-height: 1.6;
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-up  { animation: fadeUp 0.75s cubic-bezier(0.22, 1, 0.36, 1) both; }
.delay-1  { animation-delay: 0.1s; }
.delay-2  { animation-delay: 0.22s; }
.delay-3  { animation-delay: 0.36s; }
.delay-4  { animation-delay: 0.52s; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 860px) {
  .books-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
  :root { --pad: 1.25rem; }

  .nav-toggle { display: flex; }
  .nav-links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: var(--parchment-2);
    border-bottom: 1px solid var(--parchment-3);
    padding: 0.5rem 0 1rem;
    gap: 0;
  }
  .nav-links.open { display: flex; }
  .nav-links li a { display: block; padding: 0.75rem var(--pad); }
  .site-nav .container { position: relative; }

  .hero-numeral                    { display: none; }
  .about-strip .container          { grid-template-columns: 1fr; gap: 2rem; }
  .series-panel .container         { grid-template-columns: 1fr; }
  .panel-motif                     { display: none; }
  .site-footer .container          { grid-template-columns: 1fr; }
  .footer-right                    { text-align: left; }
  .footer-nav                      { justify-content: flex-start; flex-wrap: wrap; gap: 1.2rem; }
}

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