/* ============================================
   עקבות | Akvot — Paper Collage Design
   Dominant torn paper scraps as background
   ============================================ */

:root {
  --bg: #e8efe6;
  --bg-card: #f7f5f0;
  --text: #2c3330;
  --text-light: #556b5e;
  --teal: #1f8a72;
  --teal-light: #5dbfa8;
  --teal-deep: #1a6b5a;
  --plum: #7e4e78;
  --plum-light: #a87aa2;
  --plum-deep: #633057;
  --gold: #c9a033;
  --gold-light: #e0c862;
  --coral: #c76a5a;
  --divider: #b8c9b5;
  --divider-light: #d0dece;

  --font-display: 'Secular One', 'Rubik', sans-serif;
  --font-body: 'Rubik', 'Heebo', sans-serif;
  --font-reading: 'David Libre', 'Frank Ruhl Libre', serif;

  --transition-slow: 0.8s;
  --transition-gentle: 0.25s;
  --reading-width: 620px;
  --page-padding: 5vw;
}

/* ── Reset & Base ────────────────────────────── */

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

html {
  scroll-behavior: smooth;
  background: var(--bg);
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  direction: rtl;
  text-align: right;
  line-height: 1.8;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

::selection {
  background: var(--plum-light);
  color: white;
}

a {
  color: var(--text);
  text-decoration: none;
  transition: color var(--transition-gentle) ease;
}

a:hover { color: var(--teal); }

/* ══════════════════════════════════════════════════
   PAPER SCRAPS — Dominant decorative background
   10 large torn paper fragments, fixed position
   ══════════════════════════════════════════════════ */

.scraps {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.s {
  position: absolute;
  pointer-events: none;
  overflow: hidden;
}

/* ── Scrap 1: Large cream LINED notebook paper (top-right) ── */
.s1 {
  top: 3%;
  right: 2%;
  width: 320px;
  height: 240px;
  transform: rotate(-7deg);
  opacity: 0.6;
  background: #f5eed8;
  box-shadow:
    4px 6px 20px rgba(0,0,0,0.22),
    2px 3px 6px rgba(0,0,0,0.15),
    inset 0 0 30px rgba(0,0,0,0.03);
  border-radius: 2px;
  /* Red margin line + blue horizontal rules */
  background-image:
    linear-gradient(to bottom, #d08080 0px, #d08080 2px, transparent 2px),
    linear-gradient(90deg, transparent 85%, #d08080 85%, #d08080 86.5%, transparent 86.5%),
    repeating-linear-gradient(0deg, transparent, transparent 27px, #9ab8cc 27px, #9ab8cc 28px);
  background-position: 0 36px, 0 0, 0 0;
  background-size: 100% 100%, 100% 100%, 100% 28px;
  background-color: #f5eed8;
}
.s1::after {
  content: '';
  position: absolute;
  inset: 0;
  background: url('IMG_1.jpeg') center/cover no-repeat;
  opacity: 0.15;
  mix-blend-mode: multiply;
  mix-blend-mode: multiply;
}

.s2::after {
  content: '';
  position: absolute;
  inset: 0;
  background: url('IMG_2.jpeg') center/cover no-repeat;
  opacity: 0.15;
  mix-blend-mode: multiply;
  mix-blend-mode: multiply;
}

/* ── Scrap 2: Large YELLOW sticky note (bottom-left) — CRUMPLED ── */
.s2 {
  bottom: 8%;
  left: 3%;
  width: 220px;
  height: 220px;
  transform: rotate(5deg);
  opacity: 0.65;
  background: #f7e88a;
  box-shadow:
    5px 8px 25px rgba(0,0,0,0.25),
    2px 3px 8px rgba(0,0,0,0.18),
    inset 0 -6px 15px rgba(0,0,0,0.07),
    inset 4px 0 10px rgba(0,0,0,0.05),
    inset -3px 4px 12px rgba(0,0,0,0.06),
    inset 2px -4px 8px rgba(255,255,255,0.45);
  border-radius: 2px 2px 20px 3px;
  background-image:
    linear-gradient(148deg, rgba(255,255,255,0.5) 0%, rgba(255,255,255,0) 32%),
    linear-gradient(222deg, rgba(0,0,0,0.1) 5%, rgba(0,0,0,0) 38%),
    linear-gradient(38deg, rgba(0,0,0,0.07) 18%, rgba(0,0,0,0) 50%),
    linear-gradient(315deg, rgba(255,255,255,0.35) 8%, rgba(255,255,255,0) 44%),
    linear-gradient(190deg, rgba(0,0,0,0.05) 28%, rgba(0,0,0,0) 62%);
  background-color: #f7e88a;
}

.s3::after {
  content: '';
  position: absolute;
  inset: 0;
  background: url('IMG_3.jpeg') center/cover no-repeat;
  opacity: 0.15;
  mix-blend-mode: multiply;
  mix-blend-mode: multiply;
}

/* ── Scrap 3: Big BLUE graph paper (left-center) ── */
.s3 {
  top: 30%;
  left: 1%;
  width: 260px;
  height: 330px;
  transform: rotate(-4deg);
  opacity: 0.5;
  background: #d4e4f0;
  box-shadow:
    5px 7px 22px rgba(0,0,0,0.22),
    2px 3px 6px rgba(0,0,0,0.15);
  border-radius: 2px;
  /* 5mm graph paper grid */
  background-image:
    repeating-linear-gradient(0deg, transparent, transparent 19px, rgba(70,130,180,0.25) 19px, rgba(70,130,180,0.25) 20px),
    repeating-linear-gradient(90deg, transparent, transparent 19px, rgba(70,130,180,0.25) 19px, rgba(70,130,180,0.25) 20px);
  background-color: #d4e4f0;
}

.s4::after {
  content: '';
  position: absolute;
  inset: 0;
  background: url('IMG_4.jpeg') center/cover no-repeat;
  opacity: 0.15;
  mix-blend-mode: multiply;
  mix-blend-mode: multiply;
}

/* ── Scrap 4: PINK smooth torn paper (right-center) ── */
.s4 {
  top: 40%;
  right: 1%;
  width: 240px;
  height: 300px;
  transform: rotate(6deg);
  opacity: 0.5;
  background: #f0d0d8;
  box-shadow:
    5px 8px 24px rgba(0,0,0,0.2),
    2px 3px 6px rgba(0,0,0,0.14);
  border-radius: 2px;
}

.s5::after {
  content: '';
  position: absolute;
  inset: 0;
  background: url('IMG_5.jpeg') center/cover no-repeat;
  opacity: 0.15;
  mix-blend-mode: multiply;
  mix-blend-mode: multiply;
}

/* ── Scrap 5: KRAFT cardboard (top-left) ── */
.s5 {
  top: 5%;
  left: 4%;
  width: 280px;
  height: 180px;
  transform: rotate(9deg);
  opacity: 0.55;
  background: #d4c4a0;
  box-shadow:
    5px 7px 20px rgba(0,0,0,0.25),
    2px 3px 8px rgba(0,0,0,0.18);
  border-radius: 2px;
  /* Cardboard fiber texture */
  background-image:
    repeating-linear-gradient(88deg, transparent, transparent 2px, rgba(140,110,60,0.12) 2px, rgba(140,110,60,0.12) 3px),
    repeating-linear-gradient(2deg, transparent, transparent 5px, rgba(140,110,60,0.06) 5px, rgba(140,110,60,0.06) 6px);
  background-color: #d4c4a0;
}

.s6::after {
  content: '';
  position: absolute;
  inset: 0;
  background: url('IMG_6.jpeg') center/cover no-repeat;
  opacity: 0.15;
  mix-blend-mode: multiply;
  mix-blend-mode: multiply;
}

/* ── Scrap 6: GREEN lined paper (bottom-right) ── */
.s6 {
  bottom: 5%;
  right: 3%;
  width: 230px;
  height: 300px;
  transform: rotate(-8deg);
  opacity: 0.5;
  background: #d0e8c8;
  box-shadow:
    4px 7px 22px rgba(0,0,0,0.22),
    2px 3px 6px rgba(0,0,0,0.15);
  border-radius: 2px;
  /* Narrow college-ruled lines */
  background-image:
    repeating-linear-gradient(0deg, transparent, transparent 13px, rgba(60,110,70,0.22) 13px, rgba(60,110,70,0.22) 14px);
  background-color: #d0e8c8;
}

.s7::after {
  content: '';
  position: absolute;
  inset: 0;
  background: url('IMG_7.jpeg') center/cover no-repeat;
  opacity: 0.15;
  mix-blend-mode: multiply;
  mix-blend-mode: multiply;
}

/* ── Scrap 7: Wide WHITE torn strip (top-center) ── */
.s7 {
  top: 0%;
  left: 25%;
  width: 420px;
  height: 140px;
  transform: rotate(2deg);
  opacity: 0.55;
  background: #f8f6f0;
  box-shadow:
    3px 6px 18px rgba(0,0,0,0.2),
    1px 2px 5px rgba(0,0,0,0.12);
  border-radius: 2px;
  /* Faint canvas weave */
  background-image:
    repeating-linear-gradient(0deg, transparent, transparent 3px, rgba(0,0,0,0.015) 3px, rgba(0,0,0,0.015) 4px),
    repeating-linear-gradient(90deg, transparent, transparent 3px, rgba(0,0,0,0.01) 3px, rgba(0,0,0,0.01) 4px);
  background-color: #f8f6f0;
}

.s8::after {
  content: '';
  position: absolute;
  inset: 0;
  background: url('IMG_8.jpeg') center/cover no-repeat;
  opacity: 0.15;
  mix-blend-mode: multiply;
  mix-blend-mode: multiply;
}

/* ── Scrap 8: Small ORANGE/coral sticky (mid-right) — CRUMPLED ── */
.s8 {
  top: 18%;
  right: 12%;
  width: 150px;
  height: 150px;
  transform: rotate(-12deg);
  opacity: 0.55;
  background: #f0c4a0;
  box-shadow:
    4px 6px 18px rgba(0,0,0,0.24),
    1px 2px 5px rgba(0,0,0,0.16),
    inset 0 -5px 12px rgba(0,0,0,0.07),
    inset 3px 0 9px rgba(0,0,0,0.05),
    inset -2px 3px 8px rgba(0,0,0,0.06),
    inset 2px -3px 7px rgba(255,255,255,0.4);
  border-radius: 2px 2px 2px 18px;
  background-image:
    linear-gradient(112deg, rgba(255,255,255,0.45) 0%, rgba(255,255,255,0) 35%),
    linear-gradient(245deg, rgba(0,0,0,0.09) 0%, rgba(0,0,0,0) 38%),
    linear-gradient(67deg, rgba(0,0,0,0.06) 22%, rgba(0,0,0,0) 55%),
    linear-gradient(338deg, rgba(255,255,255,0.3) 14%, rgba(255,255,255,0) 48%);
  background-color: #f0c4a0;
}

.s9::after {
  content: '';
  position: absolute;
  inset: 0;
  background: url('IMG_9.jpeg') center/cover no-repeat;
  opacity: 0.15;
  mix-blend-mode: multiply;
  mix-blend-mode: multiply;
}

/* ── Scrap 9: PURPLE/mauve paper (bottom-center) ── */
.s9 {
  bottom: 2%;
  left: 30%;
  width: 300px;
  height: 160px;
  transform: rotate(3deg);
  opacity: 0.45;
  background: #dcc8e0;
  box-shadow:
    4px 7px 20px rgba(0,0,0,0.2),
    2px 3px 6px rgba(0,0,0,0.14);
  border-radius: 2px;
  /* Wide-ruled lines + crumple creases */
  background-image:
    linear-gradient(125deg, rgba(255,255,255,0.4) 0%, rgba(255,255,255,0) 35%),
    linear-gradient(235deg, rgba(0,0,0,0.08) 0%, rgba(0,0,0,0) 40%),
    linear-gradient(350deg, rgba(255,255,255,0.3) 8%, rgba(255,255,255,0) 45%),
    linear-gradient(62deg, rgba(0,0,0,0.05) 22%, rgba(0,0,0,0) 55%),
    repeating-linear-gradient(0deg, transparent, transparent 21px, rgba(100,60,110,0.15) 21px, rgba(100,60,110,0.15) 22px);
  background-color: #dcc8e0;
  box-shadow:
    4px 7px 20px rgba(0,0,0,0.2),
    2px 3px 6px rgba(0,0,0,0.14),
    inset 3px 0 10px rgba(0,0,0,0.04),
    inset -2px 4px 9px rgba(0,0,0,0.05),
    inset 1px -3px 7px rgba(255,255,255,0.35);
}

.s10::after {
  content: '';
  position: absolute;
  inset: 0;
  background: url('IMG_10.jpeg') center/cover no-repeat;
  opacity: 0.15;
  mix-blend-mode: multiply;
  mix-blend-mode: multiply;
}

/* ── Scrap 10: Small YELLOW-GREEN graph paper (left edge) ── */
.s10 {
  top: 65%;
  left: 0%;
  width: 180px;
  height: 240px;
  transform: rotate(-10deg);
  opacity: 0.5;
  background: #e4ecc8;
  box-shadow:
    4px 6px 18px rgba(0,0,0,0.22),
    2px 3px 6px rgba(0,0,0,0.15);
  border-radius: 2px;
  /* Small grid */
  background-image:
    repeating-linear-gradient(0deg, transparent, transparent 9px, rgba(80,100,50,0.18) 9px, rgba(80,100,50,0.18) 10px),
    repeating-linear-gradient(90deg, transparent, transparent 9px, rgba(80,100,50,0.18) 9px, rgba(80,100,50,0.18) 10px);
  background-color: #e4ecc8;
}

/* ── Torn scraps (one per page type, one ragged edge) ──────── */

/* Base — hidden by default */
.torn { display: none; }

/* Home: wide cream strip, torn along bottom edge, bottom-center */
.page-home .torn {
  display: block;
  bottom: 12%;
  left: 18%;
  width: 380px;
  height: 110px;
  transform: rotate(-2deg);
  opacity: 0.55;
  background-color: #f2e8d0;
  background-image:
    repeating-linear-gradient(0deg, transparent, transparent 23px, rgba(180,140,100,0.12) 23px, rgba(180,140,100,0.12) 24px);
  box-shadow: 3px 5px 16px rgba(0,0,0,0.18), 1px 2px 5px rgba(0,0,0,0.1);
  clip-path: polygon(
    0% 0%, 100% 0%,
    100% 65%,
    82% 68%,
    74% 90%,
    68% 100%,
    60% 72%,
    42% 70%,
    33% 94%,
    26% 100%,
    18% 74%,
    6% 71%,
    0% 68%
  );
}
.page-home .torn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: url('IMG_11.jpeg') center/cover no-repeat;
  opacity: 0.09;
  filter: grayscale(100%);
}

/* Stories list: tall blue strip, torn along right edge, right side */
.page-stories-list .torn {
  display: block;
  top: 20%;
  right: 0%;
  width: 100px;
  height: 340px;
  transform: rotate(1deg);
  opacity: 0.5;
  background-color: #c8d8e8;
  background-image:
    repeating-linear-gradient(90deg, transparent, transparent 17px, rgba(70,110,160,0.15) 17px, rgba(70,110,160,0.15) 18px);
  box-shadow: -3px 4px 14px rgba(0,0,0,0.16), -1px 2px 5px rgba(0,0,0,0.1);
  clip-path: polygon(
    0% 0%,
    62% 0%,
    65% 8%,
    88% 18%,
    100% 25%,
    68% 36%,
    65% 52%,
    94% 62%,
    100% 70%,
    70% 80%,
    64% 91%,
    80% 97%,
    62% 100%,
    0% 100%
  );
}
.page-stories-list .torn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: url('IMG_12.jpeg') center/cover no-repeat;
  opacity: 0.09;
  filter: grayscale(100%);
}

/* Poems list: warm kraft strip, torn along left edge, left side */
.page-poems-list .torn {
  display: block;
  top: 30%;
  left: 0%;
  width: 95px;
  height: 280px;
  transform: rotate(1.5deg);
  opacity: 0.5;
  background-color: #d4c8a8;
  background-image:
    repeating-linear-gradient(90deg, transparent, transparent 19px, rgba(120,90,50,0.13) 19px, rgba(120,90,50,0.13) 20px);
  box-shadow: 3px 4px 14px rgba(0,0,0,0.16), 1px 2px 5px rgba(0,0,0,0.1);
  clip-path: polygon(
    100% 0%,
    38% 0%,
    34% 10%,
    10% 21%,
    0% 28%,
    30% 37%,
    35% 53%,
    4% 64%,
    0% 71%,
    32% 79%,
    36% 91%,
    16% 97%,
    36% 100%,
    100% 100%
  );
}
.page-poems-list .torn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: url('IMG_11.jpeg') center/cover no-repeat;
  opacity: 0.09;
  filter: grayscale(100%);
}

/* Poem pages: tall warm strip, torn along left edge, left side */
.page-poem .torn {
  display: block;
  top: 25%;
  left: 0%;
  width: 90px;
  height: 300px;
  transform: rotate(-1.5deg);
  opacity: 0.5;
  background-color: #e8d8c0;
  box-shadow: 3px 4px 14px rgba(0,0,0,0.16), 1px 2px 5px rgba(0,0,0,0.1);
  clip-path: polygon(
    100% 0%,
    38% 0%,
    34% 10%,
    10% 21%,
    0% 28%,
    30% 37%,
    35% 53%,
    4% 64%,
    0% 71%,
    32% 79%,
    36% 91%,
    16% 97%,
    36% 100%,
    100% 100%
  );
}
.page-poem .torn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: url('IMG_13.jpeg') center/cover no-repeat;
  opacity: 0.09;
  filter: grayscale(100%);
}

/* Story pages: wide green strip, torn along top edge, top area */
.page-story .torn {
  display: block;
  top: 0%;
  right: 8%;
  width: 300px;
  height: 120px;
  transform: rotate(3deg);
  opacity: 0.5;
  background-color: #c8e0c8;
  background-image:
    repeating-linear-gradient(0deg, transparent, transparent 17px, rgba(60,100,60,0.14) 17px, rgba(60,100,60,0.14) 18px);
  box-shadow: 2px 5px 14px rgba(0,0,0,0.16), 1px 2px 5px rgba(0,0,0,0.1);
  clip-path: polygon(
    0% 100%, 100% 100%,
    100% 32%,
    76% 30%,
    66% 8%,
    60% 0%,
    52% 28%,
    36% 32%,
    26% 5%,
    20% 0%,
    12% 30%,
    0% 32%
  );
}
.page-story .torn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: url('IMG_14.jpeg') center/cover no-repeat;
  opacity: 0.09;
  filter: grayscale(100%);
}

/* ── Navigation ──────────────────────────────── */

.main-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem var(--page-padding);
  background: rgba(232, 239, 230, 0.9);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 2px solid var(--divider-light);
}

.nav-logo {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 400;
  color: var(--teal-deep);
}

.nav-logo:hover { color: var(--plum); }

.nav-links {
  display: flex;
  gap: 2rem;
}

.nav-links a {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-light);
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  transition: all var(--transition-gentle) ease;
}

.nav-links a:hover {
  background: rgba(93, 191, 168, 0.12);
  color: var(--teal-deep);
}

.nav-links a.active {
  background: var(--teal);
  color: white;
}

/* ── Opening (Home) ──────────────────────────── */

.page-home { background: var(--bg); }

.opening {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 82vh;
  text-align: center;
  position: relative;
  z-index: 1;
}

.opening-content {
  position: relative;
  z-index: 1;
}

.opening-line {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity var(--transition-slow) ease, transform var(--transition-slow) ease;
}

.opening-line.visible {
  opacity: 1;
  transform: translateY(0);
}

.opening-title {
  font-family: var(--font-display);
  font-size: clamp(3.5rem, 9vw, 6rem);
  font-weight: 400;
  color: var(--teal-deep);
  text-shadow: 2px 3px 0px rgba(30, 107, 90, 0.08);
}

.opening-author {
  font-family: var(--font-reading);
  font-size: clamp(1rem, 1.8vw, 1.2rem);
  font-weight: 300;
  color: var(--text-light);
  letter-spacing: 0.12em;
  margin-top: 0.4em;
}

.opening-tagline {
  font-family: var(--font-reading);
  font-size: clamp(0.95rem, 1.6vw, 1.15rem);
  font-weight: 400;
  color: var(--text-light);
  line-height: 2;
}

.opening-enter {
  position: absolute;
  bottom: 5vh;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
  transition: opacity 1.5s ease;
}

.opening-enter.visible { opacity: 1; }

.enter-line {
  width: 2px;
  height: 35px;
  background: linear-gradient(to bottom, var(--teal-light), transparent);
  margin: 0 auto;
  border-radius: 1px;
  animation: pulse-line 2.5s ease-in-out infinite;
}

@keyframes pulse-line {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.9; }
}

/* ── Home Nav Cards ──────────────────────────── */

.home-nav-section {
  padding: 0 var(--page-padding) 10vh;
  display: flex;
  justify-content: center;
  position: relative;
  z-index: 1;
}

.home-nav {
  display: flex;
  gap: 2rem;
  justify-content: center;
}

.home-nav-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 230px;
  padding: 1.4rem 1.8rem;
  border: 2.5px solid var(--divider);
  border-radius: 12px;
  background: rgba(247, 245, 240, 0.92);
  backdrop-filter: blur(6px);
  transition: all var(--transition-gentle) ease;
  position: relative;
  overflow: hidden;
}

.home-nav-card::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.06;
  background-image:
    repeating-linear-gradient(0deg, transparent, transparent 19px, #7a9a88 19px, #7a9a88 20px),
    repeating-linear-gradient(90deg, transparent, transparent 19px, #7a9a88 19px, #7a9a88 20px);
  pointer-events: none;
}

.home-nav-card:nth-child(1) { border-color: var(--teal-light); }
.home-nav-card:nth-child(2) { border-color: var(--plum-light); }

.home-nav-card:nth-child(1):hover {
  background: rgba(218, 240, 234, 0.95);
  border-color: var(--teal);
  transform: translateY(-4px) rotate(-0.5deg);
  box-shadow: 0 8px 28px rgba(31, 138, 114, 0.18);
}

.home-nav-card:nth-child(2):hover {
  background: rgba(238, 224, 235, 0.95);
  border-color: var(--plum);
  transform: translateY(-4px) rotate(0.5deg);
  box-shadow: 0 8px 28px rgba(126, 78, 120, 0.18);
}

.card-label {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 400;
}

.home-nav-card:nth-child(1) .card-label { color: var(--teal); }
.home-nav-card:nth-child(2) .card-label { color: var(--plum); }

.card-arrow {
  font-size: 1.2rem;
  color: var(--divider);
  transition: all var(--transition-gentle) ease;
}

.home-nav-card:hover .card-arrow { transform: translateX(-5px); }
.home-nav-card:nth-child(1):hover .card-arrow { color: var(--teal); }
.home-nav-card:nth-child(2):hover .card-arrow { color: var(--plum); }

/* ── List Pages ──────────────────────────────── */

.list-page {
  max-width: 650px;
  margin: 0 auto;
  padding: 5rem var(--page-padding) 6rem;
  position: relative;
  z-index: 1;
}

.list-heading {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.5vw, 3rem);
  font-weight: 400;
  color: var(--teal-deep);
  margin-bottom: 0.5rem;
}

.list-divider {
  width: 50px;
  height: 3.5px;
  background: linear-gradient(to left, var(--teal-light), var(--plum-light));
  border-radius: 2px;
  margin-bottom: 2.5rem;
}

.content-list { list-style: none; }

.content-list li {
  border-bottom: 1px solid var(--divider-light);
}

.content-list li:first-child {
  border-top: 1px solid var(--divider-light);
}

.list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0.8rem;
  border-radius: 8px;
  transition: all var(--transition-gentle) ease;
}

.list-item:hover {
  background: rgba(93, 191, 168, 0.08);
  padding-right: 1.2rem;
}

.item-title {
  font-family: var(--font-body);
  font-size: 1.1rem;
  font-weight: 400;
}

.item-arrow {
  font-size: 1rem;
  color: var(--divider);
  transition: all var(--transition-gentle) ease;
}

.list-item:hover .item-arrow {
  color: var(--teal);
  transform: translateX(-5px);
}

/* ── Content Page ────────────────────────────── */

.content-page {
  max-width: var(--reading-width);
  margin: 0 auto;
  padding: 4rem var(--page-padding) 5rem;
  position: relative;
  z-index: 1;
}

.piece {
  position: relative;
  background: rgba(247, 245, 240, 0.94);
  backdrop-filter: blur(4px);
  border: 1.5px solid var(--divider);
  border-radius: 6px;
  padding: 3rem 2.5rem 2.5rem;
  box-shadow:
    0 4px 20px rgba(0, 0, 0, 0.06),
    0 1px 4px rgba(0, 0, 0, 0.04);
}

/* Canvas grain on content card */
.piece::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 6px;
  opacity: 0.05;
  background-image:
    url("data:image/svg+xml,%3Csvg width='300' height='300' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='0.75' numOctaves='5' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  pointer-events: none;
}

/* Torn edge top */
.piece::after {
  content: '';
  position: absolute;
  top: -8px;
  left: 5%;
  right: 5%;
  height: 9px;
  background: var(--bg-card);
  clip-path: polygon(
    0% 100%, 1% 20%, 3% 70%, 5% 10%, 7% 50%, 9% 0%, 11% 65%, 13% 15%,
    15% 75%, 17% 5%, 19% 55%, 21% 25%, 23% 80%, 25% 10%, 27% 60%,
    29% 0%, 31% 50%, 33% 20%, 35% 70%, 37% 5%, 39% 55%, 41% 30%,
    43% 75%, 45% 10%, 47% 60%, 49% 0%, 51% 45%, 53% 15%, 55% 70%,
    57% 5%, 59% 55%, 61% 25%, 63% 80%, 65% 10%, 67% 55%, 69% 0%,
    71% 50%, 73% 20%, 75% 75%, 77% 5%, 79% 60%, 81% 30%, 83% 70%,
    85% 0%, 87% 50%, 89% 15%, 91% 65%, 93% 5%, 95% 55%, 97% 20%,
    99% 70%, 100% 100%
  );
  filter: drop-shadow(0 -1px 1px rgba(0,0,0,0.06));
}

.piece-title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 400;
  color: var(--accent-teal);
  text-align: center;
  margin-bottom: 2rem;
  padding-bottom: 1.2rem;
  border-bottom: 1.5px solid var(--divider);
  letter-spacing: 0.01em;
}

.piece-text {
  font-family: var(--font-reading);
  font-size: clamp(1.05rem, 2vw, 1.2rem);
  line-height: 2;
  color: var(--text);
}

.piece-text p { margin-bottom: 1.2em; }
.piece-text p:last-child { margin-bottom: 0; }

.story-image {
  margin: 2rem auto;
  text-align: center;
}
.story-image img {
  max-width: 460px;
  width: 100%;
  height: auto;
  border: 1px solid var(--divider);
  border-radius: 4px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
  filter: none;
}

/* ── Piece Navigation ────────────────────────── */

.piece-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 3rem;
  padding-top: 1.5rem;
}

.piece-nav a {
  font-family: var(--font-body);
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  color: var(--text-light);
  padding: 0.5rem 1rem;
  border-radius: 6px;
  transition: all var(--transition-gentle) ease;
}

.piece-nav a:hover {
  background: rgba(93, 191, 168, 0.1);
  color: var(--teal-deep);
}

/* ── Footer ──────────────────────────────────── */

.site-footer {
  text-align: center;
  padding: 3rem var(--page-padding) 2rem;
  position: relative;
  z-index: 1;
}

.footer-line {
  width: 40px;
  height: 2px;
  background: linear-gradient(to left, var(--teal-light), var(--plum-light));
  border-radius: 1px;
  margin: 0 auto 1rem;
}

.footer-text {
  font-family: var(--font-reading);
  font-size: clamp(1.1rem, 2vw, 1.4rem);
  color: var(--text-light);
  letter-spacing: 0.06em;
}

.footer-line {
  width: 50px;
  height: 2.5px;
  background: linear-gradient(to left, var(--teal-light), var(--plum-light));
  border-radius: 1px;
  margin: 0 auto 1.2rem;
}

/* Home page: even larger footer tagline */
.page-home .footer-text {
  font-size: clamp(1rem, 2vw, 1.3rem);
  letter-spacing: 0.08em;
}
.page-home .footer-author { display: none; }

.page-home .footer-line {
  width: 70px;
  height: 3px;
  margin-bottom: 1.8rem;
}

/* ── Scrap visibility per page type ─────────── */

/* Hide all scraps by default, show only selected ones per page */
.s1, .s2, .s3, .s4, .s5, .s6, .s7, .s8, .s9, .s10 { display: none; }

/* Home: s1 (cream lined, top-right), s5 (kraft, top-left), s7 (white strip, top-center) */
.page-home .s1, .page-home .s5, .page-home .s7 { display: block; }

/* Poems list: s3 (blue graph), s8 (orange sticky), s10 (yellow-green) */
.page-poems-list .s3, .page-poems-list .s8, .page-poems-list .s10 { display: block; }

/* Stories list: s2 (yellow sticky), s6 (green lined), s9 (purple) */
.page-stories-list .s2, .page-stories-list .s6, .page-stories-list .s9 { display: block; }

/* ── Per-poem scraps (3 unique scraps per poem, each with different image watermark) ── */
.item-poem_1  .s1, .item-poem_1  .s6, .item-poem_1  .s9  { display: block; }
.item-poem_2  .s2, .item-poem_2  .s4, .item-poem_2  .s10 { display: block; }
.item-poem_4  .s3, .item-poem_4  .s7, .item-poem_4  .s8  { display: block; }
.item-poem_5  .s4, .item-poem_5  .s6, .item-poem_5  .s1  { display: block; }
.item-poem_6  .s5, .item-poem_6  .s8, .item-poem_6  .s9  { display: block; }
.item-poem_7  .s1, .item-poem_7  .s3, .item-poem_7  .s10 { display: block; }
.item-poem_8  .s7, .item-poem_8  .s2, .item-poem_8  .s9  { display: block; }
.item-poem_9  .s8, .item-poem_9  .s4, .item-poem_9  .s3  { display: block; }
.item-poem_10 .s9, .item-poem_10 .s5, .item-poem_10 .s2  { display: block; }
.item-poem_12 .s10,.item-poem_12 .s7, .item-poem_12 .s1  { display: block; }
.item-poem_13 .s1, .item-poem_13 .s4, .item-poem_13 .s8  { display: block; }
.item-poem_14 .s2, .item-poem_14 .s5, .item-poem_14 .s9  { display: block; }
.item-poem_15 .s3, .item-poem_15 .s7, .item-poem_15 .s2  { display: block; }
.item-poem_16 .s4, .item-poem_16 .s1, .item-poem_16 .s9  { display: block; }

/* ── Per-story scraps ── */
.item-story_1  .s2, .item-story_1  .s6, .item-story_1  .s9  { display: block; }
.item-story_2  .s3, .item-story_2  .s4, .item-story_2  .s10 { display: block; }
.item-story_3  .s1, .item-story_3  .s7, .item-story_3  .s8  { display: block; }
.item-story_4  .s5, .item-story_4  .s2, .item-story_4  .s9  { display: block; }
.item-story_5  .s6, .item-story_5  .s1, .item-story_5  .s10 { display: block; }
.item-story_6  .s4, .item-story_6  .s8, .item-story_6  .s3  { display: block; }
.item-story_7  .s9, .item-story_7  .s5, .item-story_7  .s2  { display: block; }
.item-story_8  .s10,.item-story_8  .s7, .item-story_8  .s1  { display: block; }
.item-story_9  .s3, .item-story_9  .s6, .item-story_9  .s8  { display: block; }
.item-story_10 .s4, .item-story_10 .s1, .item-story_10 .s9  { display: block; }
.item-story_11 .s2, .item-story_11 .s5, .item-story_11 .s10 { display: block; }
.item-story_12 .s7, .item-story_12 .s3, .item-story_12 .s8  { display: block; }
.item-story_13 .s1, .item-story_13 .s6, .item-story_13 .s9  { display: block; }
.item-story_14 .s4, .item-story_14 .s2, .item-story_14 .s10 { display: block; }
.item-story_15 .s5, .item-story_15 .s8, .item-story_15 .s3  { display: block; }
.item-story_16 .s6, .item-story_16 .s1, .item-story_16 .s9  { display: block; }
.item-story_17 .s7, .item-story_17 .s4, .item-story_17 .s2  { display: block; }

/* ── Story pages: wider reading area ─────────── */

.page-story .content-page {
  max-width: 820px;
}

.page-story .piece {
  padding: 3rem 3rem 2.5rem;
}

.page-poem .piece-text {
  line-height: 1.65;
}
.page-poem .piece-text p { margin-bottom: 2em; }

.page-story .piece-text {
  font-size: clamp(1.05rem, 1.8vw, 1.15rem);
  line-height: 2.1;
  text-align: justify;
}

/* ── Scroll Reveal ───────────────────────────── */

.reveal {
  opacity: 0;
  transform: translateY(15px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* ── Scrollbar ───────────────────────────────── */

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--divider); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--teal-light); }

/* ── Reduced Motion ──────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .opening-line, .reveal { opacity: 1; transform: none; }
}

/* ── Responsive ──────────────────────────────── */

@media (max-width: 768px) {
  :root {
    --page-padding: 5vw;
    --reading-width: 92vw;
  }

  .main-nav { padding: 0.8rem var(--page-padding); }
  .nav-links { gap: 0.8rem; }
  .nav-links a { font-size: 0.9rem; padding: 0.25rem 0.6rem; }

  .home-nav {
    flex-direction: column;
    gap: 1.2rem;
    align-items: center;
  }

  .home-nav-card { width: 80vw; max-width: 280px; }
  .list-page { padding-top: 3.5rem; }
  .piece { padding: 2rem 1.5rem 1.5rem; }
  .page-story .piece { padding: 2rem 1.5rem 1.5rem; }
  .page-story .content-page { max-width: 92vw; }

  .piece-nav {
    flex-direction: column;
    gap: 0.8rem;
    text-align: center;
  }

  /* Scale down scraps on tablets */
  .s1 { width: 200px; height: 150px; }
  .s2 { width: 140px; height: 140px; }
  .s3 { width: 160px; height: 210px; }
  .s4 { width: 150px; height: 190px; }
  .s5 { width: 170px; height: 110px; }
  .s6 { width: 140px; height: 190px; }
  .s7 { width: 260px; height: 90px; }
  .s8 { width: 95px; height: 95px; }
  .s9 { width: 190px; height: 100px; }
  .s10 { width: 110px; height: 150px; }
}

@media (max-width: 480px) {
  body { font-size: 16px; }
  .nav-logo { font-size: 1.2rem; }
  .piece { padding: 1.5rem 1.2rem 1.2rem; border-radius: 4px; }

  /* Smaller scraps on phones */
  .s1 { width: 140px; height: 100px; opacity: 0.4; }
  .s2 { width: 100px; height: 100px; opacity: 0.4; }
  .s3 { width: 110px; height: 140px; opacity: 0.35; }
  .s4 { width: 100px; height: 130px; opacity: 0.35; }
  .s5 { width: 120px; height: 80px; opacity: 0.35; }
  .s6 { width: 100px; height: 130px; opacity: 0.35; }
  .s7 { width: 180px; height: 60px; opacity: 0.35; }
  .s8 { width: 70px; height: 70px; opacity: 0.35; }
  .s9 { width: 130px; height: 70px; opacity: 0.3; }
  .s10 { width: 80px; height: 110px; opacity: 0.3; }
}

@media (min-width: 1400px) {
  :root { --reading-width: 660px; }
  .piece-text { font-size: 1.25rem; }

  /* Larger scraps on big screens */
  .s1 { width: 400px; height: 300px; }
  .s2 { width: 270px; height: 270px; }
  .s3 { width: 320px; height: 400px; }
  .s4 { width: 300px; height: 370px; }
  .s5 { width: 350px; height: 230px; }
  .s6 { width: 280px; height: 370px; }
  .s7 { width: 520px; height: 170px; }
  .s8 { width: 190px; height: 190px; }
  .s9 { width: 380px; height: 200px; }
  .s10 { width: 220px; height: 300px; }
}
