:root {
  --bg: #cdd2c4;
  --surface: #f6f1e8;
  --ink: #2f2c27;

  --radius: 14px;
  --container: 1080px;

  --font-display: Georgia, "Times New Roman", serif;
  --font-body: system-ui, sans-serif;
}

/* =========================
   TYPOGRAPHY SYSTEM
========================= */

/* base body text */
body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink);
}

/* headings */
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 0.02em;
  margin: 0 0 16px;
}

/* scale */
h1 {
  font-size: 48px;
  line-height: 1.15;
}

h2 {
  font-size: 30px;
}

h3 {
  font-size: 18px;
}

/* paragraph rhythm */
p {
  margin: 0 0 16px;
  max-width: 60ch; /* KEY: readable line length */
}

/* small label text (tags, kicker, etc) */
.tag,
.kicker {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.6;
}

/* GLOBAL */
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.6;
}

/* subtle paper texture */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.06;
  background-image: url("https://www.transparenttextures.com/patterns/paper-fibers.png");
}

/* CONTAINER */
.container {
  width: min(var(--container), 90%);
  margin: 0 auto;
}

/* SECTIONS */
.section {
  padding: 90px 0;
}

.section.alt {
  background: rgba(246, 241, 232, 0.6);
  border-top: 1px solid rgba(47, 44, 39, 0.08);
  border-bottom: 1px solid rgba(47, 44, 39, 0.08);
  overflow: visible;
}

/* TYPOGRAPHY */
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 400;
  margin: 0 0 16px;
  letter-spacing: 0.02em;
}

h1 {
  font-size: 54px;
  line-height: 1.1;
}

h2 {
  font-size: 32px;
}

p {
  margin: 0;
  font-size: 16px;
}

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

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

/* ABOUT HERO LAYOUT */
.about-hero {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 60px;
  align-items: center;
}

@media (max-width: 900px) {
  .about-hero {
    grid-template-columns: 1fr;
    gap: 32px;
  }
}

.about-hero .card {
  box-shadow: 0 20px 40px rgba(0,0,0,0.08);
  transition: transform 0.3s ease;
}

.about-hero .card:hover {
  transform: translateY(-6px);
}

/* NAV */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(205, 207, 192, 0.8);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(0,0,0,0.06);
}

.nav-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 0;
}

.logo {
  font-size: 13px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

/* LINKS */
.nav-links {
  display: flex;
  gap: 24px;
}

.nav-links a {
  font-size: 13px;
  letter-spacing: 0.1em;
  text-decoration: none;
  color: var(--ink);
  opacity: 0.75;
}

.nav-links a:hover {
  opacity: 1;
}

/* HERO */
.hero {
  padding: 110px 0 80px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 60px;
  align-items: center;
}

.kicker {
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: 0.6;
  margin-bottom: 12px;
}

/* CARDS */
.card {
  background: rgba(255, 250, 245, 0.8);
  border: 1px solid rgba(60, 60, 60, 0.08);
  border-radius: var(--radius);
  padding: 24px;
}

/*CARD LINKS RESET (CLEAN + COMPLETE)*/

a.card,
a.card:link,
a.card:visited,
a.card:hover,
a.card:active {
  text-decoration: none;
  color: var(--ink);
}

/* ensure card behaves like a block */
a.card {
  display: block;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* optional: subtle interaction */
a.card:hover {
  color: var(--ink);
  transform: translateY(-4px);
}

/* TAG */
.tag {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.6;
  margin-bottom: 8px;
}

/* INDEX */
.index-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 20px;
}

.index-block {
  border-top: 1px solid rgba(47, 44, 39, 0.2);
  padding-top: 16px;
}

.index-block h3 {
  margin-bottom: 6px;
  font-size: 16px;
}

.index-block p {
  opacity: 0.7;
  font-size: 14px;
}

/* BUTTON */
.button {
  display: inline-block;
  margin-top: 16px;
  padding: 10px 16px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  font-family: var(--font-display);
  letter-spacing: 0.1em;
  text-decoration: none;
  color: inherit;
}
/* =========================
   BOOK SHELF (REAL SPINES)
========================= */

.book-full {
  box-shadow: 0 16px 40px rgba(0,0,0,0.3);
}

#books-grid {
  display: flex;
  align-items: flex-end;
  gap: 6px;

  overflow-x: auto;
  padding: 30px 0 20px;

  position: relative;
}

/* shelf line */
#books-grid::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 6px;

  height: 6px;
  background: rgba(47, 44, 39, 0.25);
  border-radius: 3px;
}

/* each book */
.card-link {
  flex: 0 0 auto;
  width: 34px;
  text-decoration: none;

  position: relative;
  display: flex;
  align-items: flex-end; /* ensures consistent baseline */

  overflow: visible;
}

/* spine container */
.book-card {
  height: 220px;
  border-radius: 3px;
  overflow: visible;

  position: static; /* KEY FIX */
}

/* height variation */
.card-link:nth-child(3n) .book-card { height: 260px; }
.card-link:nth-child(5n) .book-card { height: 200px; }
.card-link:nth-child(7n) .book-card { height: 240px; }

/* spine image */
.book-spine {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 2px;

  box-shadow: 
    inset -2px 0 3px rgba(0,0,0,0.25),
    inset 2px 0 2px rgba(255,255,255,0.15);

  transition: transform 0.25s ease;
}

/* =========================
   FIXED HOVER PREVIEW
========================= */

.book-preview {
  position: absolute;

  bottom: calc(100% + 18px); /* slightly higher = clears shelf */
  left: 50%;

  transform: translateX(-50%) translateY(6px) scale(0.98);
  opacity: 0;

  pointer-events: none;
  z-index: 20;

  width: 140px;
}

/* actual cover image */
.book-full {
  width: 140px;
  height: auto;
  aspect-ratio: 2 / 3;
  object-fit: cover;

  display: block;
  border-radius: 6px;

  background: #fff;

  box-shadow: 0 12px 30px rgba(0,0,0,0.25);
}

/* title */
.book-preview {
  position: absolute;
  bottom: calc(100% + 18px);

  left: 0;
  transform: translateY(10px) scale(0.98);

  opacity: 0;
  pointer-events: none;
  z-index: 999;

  width: 140px;
}

/* hover trigger */
.card-link:hover .book-preview {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.book-preview {
  background: none !important;
  padding: 0 !important;
}

#books-grid,
.section,
.section.alt,
.container {
  overflow: visible !important;
}

/* =========================
   WRITING PAGE LAYOUT
========================= */

.reading-container {
  max-width: 680px;
  margin: 0 auto;
}

.reading-container h1 {
  margin-bottom: 24px;
}

.reading-container p {
  font-size: 17px;
  line-height: 1.8;
}
/* =========================
   ART GRID (NO OVERFLOW FIX)
========================= */

.art-grid {
  display: grid;

  /* force safe responsive columns */
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));

  gap: 20px;
  margin-top: 24px;

  width: 100%;
}

/* VERY IMPORTANT: allow shrinking */
.art-grid > * {
  min-width: 0;
}

/* remove card styling */
.art-grid .card {
  padding: 0;
  background: transparent;
  border: none;

  display: block;
}

/* image */
.art-image {
  width: 100%;
  height: 300px;
  object-fit: cover;

  border-radius: 10px;
  display: block;
}

/* prevent any internal overflow */
.art-grid img {
  max-width: 100%;
}

/* =========================
   FILTER BUTTONS
========================= */

.filters {
  display: flex;
  gap: 12px;
  margin: 20px 0 30px;
}

.filters button {
  background: none;
  border: 1px solid rgba(47,44,39,0.2);
  padding: 6px 12px;
  border-radius: 999px;

  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;

  cursor: pointer;
}

.filters button.active {
  background: var(--ink);
  color: var(--surface);
}

/*ART PAGE FULL IMAGES*/
.art-full {
  width: 100%;
  height: auto;

  display: block;
  border-radius: 12px;

  max-height: 80vh;   /* prevents giant images */
  object-fit: contain;
}

.art-container {
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
}