
/* ============================================================
   MAHROZ'S SECRET LIBRARY
   CINEMATIC EDITION — COMPLETE RESPONSIVE CSS

   Original design preserved:
   - Burgundy and gold colours
   - Cinematic hero
   - Three decorative book covers
   - Personal letter
   - Scroll reveal animations
   - Closing section

   Responsive layouts:
   - Small mobile: 320px+
   - Mobile: 375px / 390px / 414px / 440px
   - Tablet: 681px–1024px
   - Laptop: 1025px+
   - Wide desktop: 1600px+
   ============================================================ */


/* ============================================================
   01 — DESIGN TOKENS
   ============================================================ */

:root {
  --night: #171116;
  --plum: #241b22;
  --burgundy: #632c40;
  --burgundy-light: #88435c;
  --gold: #c9a574;
  --gold-light: #e4c99e;
  --ivory: #f4e9d8;
  --paper: #f7eedf;
  --muted: #c0aeb4;
  --line: rgba(201, 165, 116, 0.25);

  --font-heading: "Playfair Display", Georgia, serif;
  --font-display: "Cormorant Garamond", Georgia, serif;
  --font-body: "DM Sans", Arial, sans-serif;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  --container-width: 1260px;
  --page-gutter: clamp(18px, 4vw, 72px);
}


/* ============================================================
   02 — GLOBAL RESET & VIEWPORT SAFETY
   ============================================================ */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  margin: 0;
  background: var(--night);
  color: var(--ivory);
  font-family: var(--font-body);
  line-height: 1.7;
  overflow-x: hidden;
}

@supports (overflow: clip) {
  html,
  body {
    overflow-x: clip;
  }
}

body,
button,
a {
  -webkit-tap-highlight-color: transparent;
}

button,
a {
  touch-action: manipulation;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
}

button,
a {
  outline-offset: 5px;
}

img,
video,
svg,
canvas {
  max-width: 100%;
}

img,
video {
  height: auto;
}

::selection {
  background: var(--gold);
  color: var(--night);
}

#mainContent {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

#mainContent > section {
  min-width: 0;
  max-width: 100%;
}

:where(
  .hero-inner,
  .collection-container,
  .section-heading,
  .book-grid,
  .book-card,
  .book-information,
  .note-paper
) {
  min-width: 0;
}

:where(
  .library-title,
  .hero-pretitle,
  .hero-description,
  .hero-dedication,
  .section-heading h2,
  .book-information h3,
  .book-description,
  .note-copy p,
  .library-closing h2
) {
  overflow-wrap: break-word;
}


/* ============================================================
   03 — AMBIENT BACKGROUND
   ============================================================ */

.library-ambient {
  position: fixed;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;

  background:
    radial-gradient(
      ellipse at 50% 0%,
      rgba(99, 44, 64, 0.27),
      transparent 55%
    ),
    var(--night);
}

.ambient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(85px);
  opacity: 0.3;

  animation:
    orbFloat 18s ease-in-out infinite alternate;
}

.orb-one {
  width: min(420px, 85vw);
  height: min(420px, 85vw);
  top: 8%;
  left: -180px;
  background: var(--burgundy);
}

.orb-two {
  width: min(380px, 85vw);
  height: min(380px, 85vw);
  right: -180px;
  bottom: 8%;
  background: #6b4b37;
  animation-delay: -9s;
}

.ambient-grain {
  position: absolute;
  inset: 0;
  opacity: 0.025;

  background-image:
    repeating-linear-gradient(
      0deg,
      transparent 0,
      transparent 3px,
      #fff 4px
    );
}

@keyframes orbFloat {
  from {
    transform: translate3d(0, 0, 0);
  }

  to {
    transform: translate3d(50px, -55px, 0);
  }
}


/* ============================================================
   04 — HEADER & NAVIGATION
   ============================================================ */

.library-header {
  position: relative;
  z-index: 20;

  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;

  width: 100%;
  min-width: 0;
  min-height: 88px;

  padding:
    18px
    clamp(22px, 5vw, 85px);

  border-bottom: 1px solid var(--line);
  background: rgba(23, 17, 22, 0.82);
}

.library-brand {
  display: inline-flex;
  align-items: center;
  gap: 13px;

  min-width: 0;
  max-width: 100%;

  color: var(--gold-light);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.21em;
  line-height: 1.5;

  transition: color 0.3s ease;
}

.library-brand span:last-child {
  min-width: 0;
  overflow-wrap: break-word;
}

.library-brand:hover {
  color: #fff;
}

.brand-symbol {
  flex-shrink: 0;
  font-size: 23px;
  color: var(--gold);
}

.library-nav {
  display: flex;
  align-items: center;
  gap: 28px;
  min-width: 0;
  flex-shrink: 0;
}

.nav-edition {
  font-size: 9px;
  color: var(--muted);
  letter-spacing: 0.2em;
}

.back-birthday {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 9px;

  flex-shrink: 0;
  padding: 10px 15px;

  border: 1px solid var(--line);
  border-radius: 50px;

  color: var(--gold-light);
  font-size: 11px;
  line-height: 1.4;

  transition:
    background 0.3s ease,
    border-color 0.3s ease,
    transform 0.3s ease;
}

.back-birthday:hover {
  background: rgba(201, 165, 116, 0.1);
  border-color: var(--gold);
  transform: translateY(-2px);
}


/* ============================================================
   05 — CINEMATIC HERO
   ============================================================ */

.library-hero {
  position: relative;

  display: flex;
  justify-content: center;
  align-items: center;

  width: 100%;
  min-width: 0;
  min-height: min(900px, 100svh);
  height: auto;

  padding:
    clamp(85px, 9vw, 120px)
    var(--page-gutter)
    clamp(95px, 10vw, 135px);

  text-align: center;
  overflow: hidden;
  isolation: isolate;
}

.library-hero::before {
  content: "";
  position: absolute;
  inset: 28px;

  border: 1px solid rgba(201, 165, 116, 0.12);
  pointer-events: none;
}

.library-hero::after {
  content: "";
  position: absolute;

  width: min(850px, 90vw);
  aspect-ratio: 1;
  height: auto;

  border: 1px solid rgba(201, 165, 116, 0.055);
  border-radius: 50%;
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 2;

  /* Critical fix:
     A flex item must be allowed to shrink. */
  display: block;
  flex: 0 1 800px;

  width: 100%;
  min-width: 0;
  max-width: 800px;

  margin-inline: auto;

  animation: heroAppear 1.3s var(--ease) both;
}

@keyframes heroAppear {
  from {
    opacity: 0;
    transform: translateY(35px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-decor {
  position: absolute;
  z-index: 1;
  color: rgba(201, 165, 116, 0.25);
  font-size: 85px;
  pointer-events: none;
}

.hero-decor-left {
  left: 9%;
  top: 35%;
}

.hero-decor-right {
  right: 9%;
  bottom: 27%;
}

.hero-eyebrow,
.section-kicker,
.closing-kicker {
  color: var(--gold);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  line-height: 1.8;
}

.hero-eyebrow {
  max-width: 100%;
  margin-inline: auto;
  overflow-wrap: anywhere;
}


/* ============================================================
   06 — HERO EMBLEM
   ============================================================ */

.library-emblem {
  display: flex;
  justify-content: center;
  margin: 35px auto 30px;
}

.emblem-ring {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;

  width: 122px;
  height: 122px;
  flex-shrink: 0;

  border: 1px solid var(--gold);
  border-radius: 50%;

  box-shadow:
    0 0 0 9px rgba(201, 165, 116, 0.045),
    0 0 60px rgba(201, 165, 116, 0.07);

  animation: emblemGlow 5s ease-in-out infinite;
}

@keyframes emblemGlow {
  0%,
  100% {
    box-shadow:
      0 0 0 9px rgba(201, 165, 116, 0.045),
      0 0 45px rgba(201, 165, 116, 0.05);
  }

  50% {
    box-shadow:
      0 0 0 12px rgba(201, 165, 116, 0.075),
      0 0 75px rgba(201, 165, 116, 0.13);
  }
}

.emblem-crown,
.emblem-leaf {
  color: var(--gold);
  font-size: 17px;
  line-height: 1;
}

.emblem-letter {
  margin: 2px 0;
  color: var(--gold-light);
  font-family: var(--font-display);
  font-size: 53px;
  line-height: 1;
}


/* ============================================================
   07 — HERO TYPOGRAPHY
   ============================================================ */

.hero-pretitle {
  max-width: 100%;
  margin: 0 0 12px;

  color: var(--muted);
  font-family: var(--font-display);
  font-size: clamp(20px, 3vw, 29px);
  font-style: italic;
  line-height: 1.4;
}

.library-title {
  display: block;

  width: 100%;
  max-width: 100%;
  min-width: 0;

  margin: 0;

  font-family: var(--font-heading);
  font-size: clamp(45px, 7.3vw, 95px);
  font-weight: 400;
  line-height: 1.17;
  letter-spacing: -0.045em;

  white-space: normal;
  text-align: center;
}

.library-title em {
  display: block;

  width: 100%;
  max-width: 100%;

  color: var(--gold-light);
  font-family: var(--font-display);
  font-size: 1.13em;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.025em;

  white-space: normal;
}

.ornamental-divider {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 17px;

  max-width: 100%;
  margin: 32px auto;

  color: var(--gold);
}

.ornamental-divider span {
  width: 72px;
  max-width: 22vw;
  height: 1px;

  background:
    linear-gradient(
      90deg,
      transparent,
      var(--gold)
    );
}

.ornamental-divider span:last-child {
  transform: rotate(180deg);
}

.ornamental-divider i {
  font-size: 22px;
  font-style: normal;
}

.hero-description {
  width: 100%;
  max-width: 600px;
  margin: 0 auto 17px;

  color: var(--ivory);
  font-family: var(--font-display);
  font-size: clamp(23px, 3vw, 31px);
  line-height: 1.4;
}

.hero-dedication {
  max-width: 100%;
  margin-inline: auto;

  color: var(--muted);
  font-size: 13px;
  line-height: 2;
}


/* ============================================================
   08 — PRIMARY BUTTONS
   ============================================================ */

.explore-button,
.return-button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 20px;

  max-width: 100%;
  margin-top: 32px;
  padding: 17px 27px;

  border: 1px solid var(--gold);
  background: var(--gold);

  color: var(--night);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.17em;
  line-height: 1.5;
  text-align: center;

  transition:
    background 0.3s ease,
    color 0.3s ease,
    transform 0.3s ease,
    box-shadow 0.3s ease;
}

.explore-button:hover,
.return-button:hover {
  background: transparent;
  color: var(--gold-light);
  transform: translateY(-3px);

  box-shadow:
    0 12px 35px rgba(0, 0, 0, 0.2);
}

.hero-signature {
  max-width: 100%;
  margin-top: 32px;

  color: var(--gold-light);
  font-family: var(--font-display);
  font-size: 20px;
  font-style: italic;
  line-height: 1.5;
}


/* ============================================================
   09 — BOOK COLLECTION SECTION
   ============================================================ */

.collection-section {
  position: relative;

  width: 100%;
  min-width: 0;

  padding:
    115px
    var(--page-gutter)
    135px;

  background:
    linear-gradient(
      180deg,
      rgba(36, 27, 34, 0.65),
      rgba(23, 17, 22, 0.5)
    );

  border-top: 1px solid var(--line);
}

.collection-container {
  width: 100%;
  max-width: var(--container-width);
  min-width: 0;
  margin-inline: auto;
}

.section-heading {
  width: 100%;
  max-width: 740px;
  margin: 0 auto 75px;
  text-align: center;
}

.section-ornament {
  display: block;
  margin: 15px 0 20px;

  color: var(--gold);
  font-size: 22px;
  letter-spacing: 0.4em;
}

.section-heading h2 {
  max-width: 100%;
  margin: 0 0 19px;

  font-family: var(--font-heading);
  font-size: clamp(37px, 5vw, 62px);
  font-weight: 400;
  line-height: 1.3;
}

.section-heading h2 em {
  display: block;

  color: var(--gold-light);
  font-family: var(--font-display);
  font-size: 1.16em;
  font-weight: 400;
}

.section-heading > p:last-child {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.8;
}


/* ============================================================
   10 — RESPONSIVE BOOK GRID
   ============================================================ */

.book-grid {
  display: grid;
  grid-template-columns:
    repeat(3, minmax(0, 1fr));

  align-items: stretch;
  gap: clamp(18px, 2.4vw, 30px);

  width: 100%;
  min-width: 0;
}

.book-card {
  display: flex;
  flex-direction: column;

  width: 100%;
  min-width: 0;

  border: 1px solid var(--line);
  background: rgba(36, 27, 34, 0.68);

  transition:
    border-color 0.4s ease,
    transform 0.4s var(--ease),
    box-shadow 0.4s ease;
}

.book-card:hover {
  border-color: rgba(201, 165, 116, 0.65);
  transform: translateY(-9px);

  box-shadow:
    0 25px 65px rgba(0, 0, 0, 0.27);
}

.book-cover-wrap {
  display: flex;
  justify-content: center;
  align-items: center;

  width: 100%;
  min-width: 0;
  min-height: 415px;

  padding: 38px 25px;

  background:
    radial-gradient(
      ellipse at 50% 50%,
      rgba(201, 165, 116, 0.08),
      transparent 75%
    );

  perspective: 1100px;
}


/* ============================================================
   11 — DECORATIVE BOOK COVERS
   ============================================================ */

.book-cover {
  position: relative;

  width: min(100%, 250px);
  max-width: 100%;
  aspect-ratio: 0.7;

  border-radius: 3px 9px 9px 3px;

  box-shadow:
    -9px 8px 0 rgba(0, 0, 0, 0.2),
    13px 18px 35px rgba(0, 0, 0, 0.45),
    inset 7px 0 12px rgba(0, 0, 0, 0.3);

  transform: rotateY(-9deg);
  transform-origin: left center;

  transition:
    transform 0.65s var(--ease),
    box-shadow 0.65s ease;
}

.book-card:hover .book-cover {
  transform: rotateY(0deg) translateY(-6px);

  box-shadow:
    -9px 8px 0 rgba(0, 0, 0, 0.15),
    17px 25px 45px rgba(0, 0, 0, 0.45);
}

.book-cover::before {
  content: "";
  position: absolute;
  z-index: 2;

  top: 0;
  bottom: 0;
  left: 11px;

  width: 2px;
  background: rgba(255, 255, 255, 0.13);
}

.book-cover::after {
  content: "";
  position: absolute;
  inset: 0;

  border-radius: inherit;
  pointer-events: none;

  background:
    linear-gradient(
      110deg,
      rgba(255, 255, 255, 0.09),
      transparent 35%,
      rgba(0, 0, 0, 0.18)
    );
}

.garden-cover {
  background:
    radial-gradient(
      circle at 50% 35%,
      rgba(179, 188, 118, 0.16),
      transparent 60%
    ),
    linear-gradient(
      145deg,
      #284d3c,
      #122a24
    );
}

.anne-cover {
  background:
    radial-gradient(
      circle at 60% 30%,
      rgba(235, 187, 118, 0.14),
      transparent 60%
    ),
    linear-gradient(
      145deg,
      #7c3c2e,
      #3d1c22
    );
}

.dosti-cover {
  background:
    radial-gradient(
      circle at 45% 40%,
      rgba(201, 165, 116, 0.17),
      transparent 65%
    ),
    linear-gradient(
      145deg,
      #50344c,
      #231928
    );
}


/* ============================================================
   12 — BOOK COVER TYPOGRAPHY
   ============================================================ */

.cover-border {
  position: absolute;
  inset: 15px;

  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;

  min-width: 0;
  padding: 16px 10px;

  border: 1px solid rgba(228, 201, 158, 0.68);

  color: var(--gold-light);
  text-align: center;
}

.cover-border::before,
.cover-border::after {
  content: "✦";
  position: absolute;

  color: var(--gold-light);
  font-size: 13px;
}

.cover-border::before {
  top: -11px;
  padding: 0 7px;
  background: #284234;
}

.anne-cover .cover-border::before {
  background: #66352e;
}

.dosti-cover .cover-border::before {
  background: #443047;
}

.cover-border::after {
  bottom: 9px;
}

.cover-edition,
.cover-bottom {
  max-width: 100%;
  font-size: 7px;
  letter-spacing: 0.18em;
  line-height: 1.6;
  overflow-wrap: break-word;
}

.cover-edition {
  position: absolute;
  top: 25px;
}

.cover-bottom {
  position: absolute;
  bottom: 32px;
}

.cover-ornament {
  margin-bottom: 17px;
  font-size: 34px;
}

.cover-border h3 {
  max-width: 100%;
  margin: 0;

  color: #f6e5c7;
  font-family: var(--font-display);
  font-size: clamp(29px, 3vw, 40px);
  font-weight: 500;
  line-height: 1.1;

  overflow-wrap: break-word;
}

.cover-border .urdu-cover-title {
  font-family:
    "Noto Nastaliq Urdu",
    "Noto Naskh Arabic",
    serif;

  font-size: 29px;
  line-height: 2.1;
  overflow-wrap: anywhere;
}

.cover-divider {
  width: 55px;
  height: 1px;
  margin: 17px 0 11px;
  background: var(--gold);
}

.cover-border p {
  max-width: 100%;
  margin: 0;

  font-family: var(--font-display);
  font-size: 15px;
  line-height: 1.4;
}


/* ============================================================
   13 — BOOK INFORMATION
   ============================================================ */

.book-information {
  display: flex;
  flex-direction: column;
  flex: 1;

  width: 100%;
  min-width: 0;

  padding: 29px 27px 32px;
  border-top: 1px solid var(--line);
}

.book-category {
  margin: 0 0 11px;

  color: var(--gold);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.17em;
  line-height: 1.7;
}

.book-information h3 {
  max-width: 100%;
  margin: 0 0 5px;

  font-family: var(--font-heading);
  font-size: clamp(23px, 2.5vw, 29px);
  font-weight: 400;
  line-height: 1.3;
}

.book-author {
  margin: 0 0 18px;

  color: var(--gold-light);
  font-family: var(--font-display);
  font-size: 18px;
  font-style: italic;
  line-height: 1.6;
}

.book-description {
  max-width: 100%;
  margin: 0 0 23px;

  color: var(--muted);
  font-size: 13px;
  line-height: 1.85;
}

.book-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;

  margin-top: auto;
  margin-bottom: 25px;
}

.book-tags span {
  padding: 5px 10px;

  border: 1px solid rgba(201, 165, 116, 0.2);
  border-radius: 30px;

  color: var(--gold-light);
  font-size: 10px;
  line-height: 1.5;
}

.read-button {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;

  width: 100%;
  min-width: 0;

  padding: 15px 17px;

  border: 1px solid var(--gold);
  background: rgba(201, 165, 116, 0.08);

  color: var(--gold-light);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.13em;
  line-height: 1.5;

  transition:
    background 0.3s ease,
    color 0.3s ease;
}

.read-button span:first-child {
  min-width: 0;
  overflow-wrap: anywhere;
}

.read-button:hover {
  background: var(--gold);
  color: var(--night);
}

.read-button span:last-child {
  flex-shrink: 0;
  font-size: 19px;
  line-height: 1;
}


/* ============================================================
   14 — PERSONAL NOTE SECTION
   ============================================================ */

.library-note-section {
  width: 100%;

  padding:
    125px
    var(--page-gutter);

  border-top: 1px solid var(--line);

  background:
    radial-gradient(
      ellipse at 50% 50%,
      rgba(99, 44, 64, 0.16),
      transparent 70%
    );
}

.note-paper {
  position: relative;

  width: 100%;
  max-width: 750px;

  margin-inline: auto;
  padding: clamp(35px, 6vw, 80px);

  background: var(--paper);
  color: #34272d;

  box-shadow:
    0 25px 80px rgba(0, 0, 0, 0.25);
}

.note-paper::before {
  content: "";
  position: absolute;
  inset: 15px;

  border: 1px solid rgba(99, 44, 64, 0.18);
  pointer-events: none;
}

.note-kicker {
  max-width: 100%;
  margin: 0;

  color: var(--burgundy);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2em;
  line-height: 1.8;
  text-align: center;
}

.note-symbol {
  margin: 22px 0 10px;

  color: var(--burgundy);
  font-size: 33px;
  text-align: center;
}

.note-paper h2 {
  max-width: 100%;
  margin: 0 0 28px;

  font-family: var(--font-heading);
  font-size: clamp(33px, 5vw, 51px);
  font-weight: 400;
  line-height: 1.35;
  text-align: center;
}

.note-paper h2 em {
  color: var(--burgundy);
  font-family: var(--font-display);
  font-size: 1.2em;
}

.note-copy {
  max-width: 100%;
}

.note-copy p {
  max-width: 100%;
  margin: 0 0 19px;

  font-family: var(--font-display);
  font-size: clamp(20px, 2.4vw, 25px);
  line-height: 1.55;
}

.note-signature {
  max-width: 100%;
  margin: 32px 0 0;

  color: var(--burgundy);
  font-family: var(--font-display);
  font-size: 25px;
  font-style: italic;
  line-height: 1.4;
  text-align: right;
}

.note-signature strong {
  display: block;
  font-size: 32px;
  font-weight: 600;
}


/* ============================================================
   15 — CLOSING SECTION
   ============================================================ */

.library-closing {
  width: 100%;
  padding:
    130px
    var(--page-gutter)
    145px;

  text-align: center;
}

.closing-ornament {
  display: block;
  margin-bottom: 20px;

  color: var(--gold);
  font-size: 35px;
}

.library-closing h2 {
  width: 100%;
  max-width: 750px;
  margin: 0 auto 25px;

  font-family: var(--font-heading);
  font-size: clamp(35px, 5vw, 65px);
  font-weight: 400;
  line-height: 1.25;
}

.library-closing h2 em {
  display: block;

  color: var(--gold-light);
  font-family: var(--font-display);
  font-size: 1.1em;
  font-weight: 400;
}

.library-closing > p {
  max-width: 100%;
  margin-inline: auto;

  color: var(--muted);
  font-family: var(--font-display);
  font-size: 23px;
  line-height: 1.5;
}

.return-button {
  margin-top: 28px;
}


/* ============================================================
   16 — FOOTER
   ============================================================ */

.library-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 18px;

  width: 100%;
  min-width: 0;

  padding:
    32px
    clamp(22px, 5vw, 85px);

  border-top: 1px solid var(--line);

  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.14em;
  line-height: 1.7;
}

.library-footer > * {
  min-width: 0;
  max-width: 100%;
}

.library-footer p {
  margin: 0;

  color: var(--gold-light);
  font-family: var(--font-display);
  font-size: 17px;
  font-style: italic;
  letter-spacing: 0;
}


/* ============================================================
   17 — SCROLL REVEAL ANIMATIONS
   ============================================================ */

.reveal {
  opacity: 1;
  transform: none;
}

.js-ready .reveal {
  opacity: 0;
  transform: translateY(30px);

  transition:
    opacity 0.85s var(--ease),
    transform 0.85s var(--ease);
}

.js-ready .reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.book-card:nth-child(2) {
  transition-delay: 0.1s;
}

.book-card:nth-child(3) {
  transition-delay: 0.2s;
}


/* ============================================================
   18 — LARGE DESKTOP
   1600px and above
   ============================================================ */

@media (min-width: 1600px) {

  .library-hero {
    min-height: 850px;
  }

  .hero-inner {
    max-width: 850px;
    flex-basis: 850px;
  }

  .library-title {
    font-size: 95px;
  }

  .collection-container {
    max-width: 1320px;
  }

  .book-grid {
    gap: 34px;
  }
}


/* ============================================================
   19 — LAPTOP AND SMALL DESKTOP
   1025px to 1399px
   ============================================================ */

@media (min-width: 1025px) and (max-width: 1399px) {

  .library-hero {
    min-height: 740px;
  }

  .hero-inner {
    max-width: 760px;
  }

  .library-title {
    font-size: clamp(64px, 6.5vw, 90px);
  }

  .collection-section {
    padding-top: 100px;
    padding-bottom: 115px;
  }

  .book-grid {
    gap: 22px;
  }

  .book-cover-wrap {
    min-height: 380px;
    padding: 30px 18px;
  }

  .book-cover {
    width: min(100%, 235px);
  }

  .book-information {
    padding: 25px 22px 29px;
  }
}


/* ============================================================
   20 — TABLET
   681px to 1024px
   ============================================================ */

@media (min-width: 681px) and (max-width: 1024px) {

  .library-header {
    min-height: 78px;
    padding: 16px 28px;
  }

  .nav-edition {
    display: none;
  }

  .library-hero {
    min-height: 0;
    padding: 105px 35px 115px;
  }

  .hero-inner {
    flex: 0 1 720px;
    width: 100%;
    max-width: 720px;
  }

  .library-title {
    font-size: clamp(55px, 7.5vw, 78px);
  }

  .library-title em {
    font-size: 1.04em;
  }

  .hero-description {
    max-width: 560px;
    font-size: clamp(24px, 3.4vw, 29px);
  }

  .hero-decor-left {
    left: 4%;
  }

  .hero-decor-right {
    right: 4%;
  }

  .collection-section {
    padding: 95px 30px 110px;
  }

  .book-grid {
    grid-template-columns:
      repeat(2, minmax(0, 1fr));

    max-width: 850px;
    margin-inline: auto;
    gap: 24px;
  }

  .book-card:last-child {
    grid-column: 1 / -1;
    width: min(100%, 410px);
    justify-self: center;
  }

  .book-cover-wrap {
    min-height: 380px;
  }

  .library-note-section {
    padding: 100px 30px;
  }

  .library-closing {
    padding: 105px 30px 120px;
  }

  .library-footer {
    justify-content: center;
    text-align: center;
  }
}


/* ============================================================
   21 — MOBILE
   All screens up to 680px
   ============================================================ */

@media (max-width: 680px) {

  :root {
    --page-gutter: 20px;
  }

  html {
    scroll-padding-top: 65px;
  }

  body {
    min-width: 0;
  }

  /* Header */

  .library-header {
    min-height: 70px;
    padding: 13px 16px;
    gap: 10px;
  }

  .library-brand {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
    max-width: none;

    gap: 7px;
    font-size: 8px;
    letter-spacing: 0.08em;
  }

  .library-brand span:last-child {
    overflow-wrap: anywhere;
  }

  .brand-symbol {
    font-size: 18px;
  }

  .library-nav {
    flex: 0 0 auto;
    gap: 0;
  }

  .nav-edition {
    display: none;
  }

  .back-birthday {
    gap: 6px;
    padding: 9px 11px;
    font-size: 10px;
    white-space: nowrap;
  }

  /* Hero */

  .library-hero {
    display: flex;
    justify-content: center;
    align-items: center;

    width: 100%;
    min-width: 0;

    min-height: 0;
    height: auto;

    padding:
      80px
      var(--page-gutter)
      90px;

    overflow: hidden;
  }

  .library-hero::before {
    inset: 11px;
  }

  .library-hero::after {
    width: 110vw;
    max-width: none;
    aspect-ratio: 1;
  }

  .hero-inner {
    display: block;

    flex: 0 1 auto;
    width: 100%;
    min-width: 0;
    max-width: 100%;

    margin-inline: auto;
    padding: 0;

    text-align: center;
  }

  .hero-decor {
    font-size: 38px;
  }

  .hero-decor-left {
    top: 21%;
    left: 6%;
  }

  .hero-decor-right {
    right: 6%;
    bottom: 17%;
  }

  .hero-eyebrow {
    width: 100%;
    max-width: 100%;

    margin: 0 auto;

    font-size: 8px;
    letter-spacing: 0.12em;
    line-height: 1.9;
    overflow-wrap: anywhere;
  }

  /* Emblem */

  .library-emblem {
    margin: 28px auto 25px;
  }

  .emblem-ring {
    width: 98px;
    height: 98px;
  }

  .emblem-letter {
    font-size: 43px;
  }

  /* Title */

  .hero-pretitle {
    width: 100%;
    max-width: 100%;

    margin: 0 auto 13px;

    font-size: clamp(17px, 4.8vw, 23px);
    line-height: 1.45;
  }

  .library-title {
    display: block;

    width: 100%;
    min-width: 0;
    max-width: 100%;

    margin: 0 auto;

    font-size: clamp(34px, 8.8vw, 56px);
    line-height: 1.18;
    letter-spacing: -0.055em;

    white-space: normal;
    text-align: center;
  }

  .library-title em {
    display: block;

    width: 100%;
    max-width: 100%;

    margin-top: 5px;

    font-size: 0.98em;
    line-height: 1.23;
    letter-spacing: -0.045em;

    white-space: normal;
  }

  .ornamental-divider {
    gap: 13px;
    margin: 25px auto;
  }

  .ornamental-divider span {
    width: clamp(30px, 12vw, 60px);
  }

  /* Description */

  .hero-description {
    width: 100%;
    max-width: 100%;

    margin: 0 auto 20px;

    font-size: clamp(20px, 5.4vw, 26px);
    line-height: 1.42;
  }

  .hero-dedication {
    width: 100%;
    max-width: 100%;

    margin-inline: auto;

    font-size: 12px;
    line-height: 1.8;
  }

  .explore-button {
    width: min(100%, 310px);
    max-width: 100%;

    margin-top: 27px;
    padding: 15px 12px;
    gap: 12px;

    font-size: 9px;
    letter-spacing: 0.1em;
  }

  .hero-signature {
    max-width: 100%;
    margin-top: 27px;

    font-size: 18px;
    line-height: 1.5;
  }

  /* Collection */

  .collection-section {
    padding: 82px 18px 95px;
  }

  .collection-container {
    width: 100%;
    max-width: 100%;
  }

  .section-heading {
    width: 100%;
    max-width: 100%;
    margin-bottom: 45px;
  }

  .section-kicker {
    font-size: 9px;
    letter-spacing: 0.15em;
  }

  .section-ornament {
    margin: 13px 0 18px;
    font-size: 19px;
  }

  .section-heading h2 {
    font-size: clamp(31px, 8vw, 45px);
    line-height: 1.25;
  }

  .section-heading h2 em {
    font-size: 1.05em;
  }

  .section-heading > p:last-child {
    font-size: 13px;
    line-height: 1.8;
  }

  /* Single-column book cards */

  .book-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);

    width: 100%;
    max-width: 410px;

    margin-inline: auto;
    gap: 28px;
  }

  .book-card,
  .book-card:last-child {
    grid-column: auto;

    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .book-cover-wrap {
    width: 100%;
    min-height: 0;
    padding: 32px 20px;
  }

  .book-cover {
    width: min(100%, 230px);
  }

  .cover-border h3 {
    font-size: 35px;
  }

  .book-information {
    padding: 25px 22px 28px;
  }

  .book-information h3 {
    font-size: clamp(23px, 6vw, 29px);
  }

  .book-description {
    font-size: 13px;
    line-height: 1.85;
  }

  .read-button {
    padding: 14px 15px;
    font-size: 10px;
  }

  /* Personal note */

  .library-note-section {
    padding: 78px 16px;
  }

  .note-paper {
    width: 100%;
    max-width: 100%;
    padding: 45px 29px;
  }

  .note-paper::before {
    inset: 10px;
  }

  .note-kicker {
    font-size: 9px;
    letter-spacing: 0.12em;
  }

  .note-paper h2 {
    font-size: clamp(31px, 8vw, 45px);
  }

  .note-copy p {
    font-size: clamp(19px, 5.2vw, 23px);
    line-height: 1.55;
  }

  .note-signature {
    font-size: 22px;
  }

  .note-signature strong {
    font-size: 28px;
  }

  /* Closing */

  .library-closing {
    padding: 95px 20px 105px;
  }

  .library-closing h2 {
    font-size: clamp(31px, 8vw, 47px);
  }

  .library-closing > p {
    font-size: 20px;
  }

  .return-button {
    width: auto;
    max-width: 100%;

    padding: 15px 17px;
    gap: 10px;

    font-size: 9px;
    letter-spacing: 0.09em;
    line-height: 1.6;
  }

  /* Footer */

  .library-footer {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 13px;

    padding: 29px 18px;
    text-align: center;
  }

  .library-footer p {
    font-size: 17px;
  }

  /* Remove unnecessary card delays on mobile */

  .book-card:nth-child(2),
  .book-card:nth-child(3) {
    transition-delay: 0s;
  }
}


/* ============================================================
   22 — SMALL MOBILE
   Up to 390px
   ============================================================ */

@media (max-width: 390px) {

  :root {
    --page-gutter: 19px;
  }

  .library-header {
    padding-inline: 12px;
  }

  .library-brand {
    gap: 6px;
    font-size: 7px;
    letter-spacing: 0.06em;
  }

  .back-birthday {
    padding: 8px 9px;
    font-size: 9px;
  }

  .library-hero {
    padding:
      70px
      var(--page-gutter)
      82px;
  }

  .hero-eyebrow {
    font-size: 7px;
    letter-spacing: 0.1em;
  }

  .hero-pretitle {
    font-size: 17px;
  }

  .library-title {
    font-size: clamp(32px, 8.8vw, 38px);
  }

  .library-title em {
    font-size: 0.98em;
  }

  .hero-description {
    font-size: 20px;
  }

  .hero-dedication {
    font-size: 11px;
  }

  .collection-section {
    padding-inline: 15px;
  }

  .book-cover {
    width: min(100%, 215px);
  }

  .book-cover-wrap {
    padding: 29px 17px;
  }

  .book-information {
    padding: 23px 19px 26px;
  }

  .note-paper {
    padding: 42px 24px;
  }
}


/* ============================================================
   23 — VERY SMALL MOBILE
   Up to 340px
   ============================================================ */

@media (max-width: 340px) {

  :root {
    --page-gutter: 15px;
  }

  .library-header {
    gap: 7px;
    padding-inline: 10px;
  }

  .library-brand {
    font-size: 6px;
    gap: 5px;
  }

  .back-birthday {
    gap: 4px;
    padding: 8px;
    font-size: 8px;
  }

  .library-hero {
    padding-top: 62px;
    padding-bottom: 75px;
  }

  .library-title {
    font-size: 29px;
  }

  .library-title em {
    font-size: 0.95em;
  }

  .hero-pretitle {
    font-size: 16px;
  }

  .hero-description {
    font-size: 18px;
  }

  .hero-eyebrow {
    font-size: 7px;
    letter-spacing: 0.05em;
  }

  .explore-button {
    gap: 8px;
    font-size: 8px;
  }

  .book-cover {
    width: min(100%, 200px);
  }

  .cover-border h3 {
    font-size: 30px;
  }

  .note-paper {
    padding: 39px 21px;
  }
}


/* ============================================================
   24 — LANDSCAPE PHONES
   Short-height screens
   ============================================================ */

@media (max-height: 500px) and (orientation: landscape) {

  .library-hero {
    min-height: 0;
    height: auto;
    padding-top: 65px;
    padding-bottom: 75px;
  }

  .hero-inner {
    max-width: 680px;
  }

  .library-emblem {
    margin: 16px auto;
  }

  .emblem-ring {
    width: 78px;
    height: 78px;
  }

  .emblem-letter {
    font-size: 33px;
  }

  .hero-pretitle {
    margin-top: 15px;
  }

  .ornamental-divider {
    margin-block: 18px;
  }
}


/* ============================================================
   25 — TOUCH DEVICE OPTIMISATION
   ============================================================ */

@media (hover: none) and (pointer: coarse) {

  .book-card:hover {
    transform: none;
    box-shadow: none;
  }

  .book-card:hover .book-cover {
    transform: rotateY(-9deg);
  }

  .back-birthday:hover,
  .explore-button:hover,
  .return-button:hover {
    transform: none;
  }

  .read-button,
  .back-birthday,
  .explore-button,
  .return-button {
    min-height: 44px;
  }
}


/* ============================================================
   26 — ACCESSIBILITY
   ============================================================ */

:focus-visible {
  outline: 2px solid var(--gold-light);
  outline-offset: 4px;
}

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }

  .js-ready .reveal {
    opacity: 1;
    transform: none;
  }

  .hero-inner,
  .emblem-ring,
  .ambient-orb {
    animation: none !important;
  }
}


/* ============================================================
   END — MAHROZ'S SECRET LIBRARY
   COMPLETE RESPONSIVE CINEMATIC CSS
   ============================================================ */


   
/* ============================================================
   MAHROZ SECRET LIBRARY
   PREMIUM DARK SEARCH & FILTER COLOURS
   COLOUR CHANGES ONLY — NO LAYOUT CHANGES
   ============================================================ */

/* Search, Language and Category fields */

.library-filter-group input,
.library-filter-group select {
  background: #38242f !important;
  color: #f8e9df !important;
  border-color: #8f6878 !important;
  color-scheme: dark;
}

/* Search placeholder */

.library-filter-group input::placeholder {
  color: #c9abb5 !important;
  opacity: 1;
}

/* Selected text and typed search text */

.library-filter-group input:focus,
.library-filter-group select:focus {
  background: #432b38 !important;
  color: #fff1e8 !important;
  border-color: #d6a5ae !important;
  box-shadow: 0 0 0 3px rgba(214, 165, 174, 0.15) !important;
}

/* Dropdown options */

.library-filter-group select option {
  background: #38242f;
  color: #f8e9df;
}

/* Selected dropdown option */

.library-filter-group select option:checked {
  background: #704b60;
  color: #ffffff;
}

/* Search text selection */

.library-filter-group input::selection {
  background: #a8768d;
  color: #ffffff;
}

/* Native search clear icon */

.library-filter-group input[type="search"] {
  color-scheme: dark;
}

/* ============================================================
   END — COLOUR OVERRIDES ONLY
   ============================================================ */
