html {
  scroll-behavior: smooth;
}

body {
  background: #fbfaf7;
  overflow-x: hidden;
}

.skip-link {
  position: fixed;
  z-index: 2000;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.65rem 0.9rem;
  border-radius: 8px;
  background: #191714;
  color: #fff;
  text-decoration: none;
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.landing-hero {
  position: relative;
  isolation: isolate;
  min-height: 610px;
  overflow: hidden;
  padding: 0;
  background: #f8f4ed;
  text-align: left;
}

.landing-hero::before {
  content: '';
  position: absolute;
  z-index: -1;
  inset: 0;
  background:
    linear-gradient(90deg, #fbf8f2 0%, #fbf8f2 48%, rgba(251,248,242,0.96) 54%, rgba(251,248,242,0.62) 65%, rgba(251,248,242,0.08) 79%),
    linear-gradient(180deg, rgba(255,255,255,0.12), rgba(246,239,228,0.08));
  pointer-events: none;
}

.landing-hero::after {
  content: '';
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(154,101,37,0.28), transparent);
}

.hero-art {
  position: absolute;
  z-index: -2;
  inset: 0;
}

.hero-art img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
}

.landing-nav {
  position: relative;
  z-index: 20;
  width: min(1400px, calc(100% - 4rem));
  min-height: 82px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto minmax(260px, 1fr);
  align-items: center;
  gap: 2rem;
}

.brand {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: #181511;
  text-decoration: none;
}

.brand-mark {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  color: #bd7f1d;
}

.brand-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-family: var(--serif);
  font-size: 1.55rem;
  font-weight: 400;
  line-height: 1;
}

.brand-tagline {
  overflow: hidden;
  margin-top: 0.25rem;
  color: #4f4a44;
  font-size: 0.63rem;
  font-weight: 400;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.desktop-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
}

.desktop-nav a {
  position: relative;
  padding: 1.8rem 0 1.45rem;
  color: #25211d;
  font-size: 0.78rem;
  font-weight: 500;
  text-decoration: none;
}

.desktop-nav a::after {
  content: '';
  position: absolute;
  right: 0;
  bottom: 1.1rem;
  left: 0;
  height: 2px;
  background: #b87718;
  transform: scaleX(0);
  transition: transform 0.18s ease;
}

.desktop-nav a:hover::after,
.desktop-nav a.active::after {
  transform: scaleX(1);
}

.nav-actions {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.65rem;
}

.notification-bell {
  position: relative;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  border: 1px solid rgba(70,58,46,0.14);
  border-radius: 50%;
  background: rgba(255,255,255,0.84);
  color: #2d2823;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(42,35,30,0.05);
  backdrop-filter: blur(12px);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.notification-bell:hover {
  transform: translateY(-1px);
  box-shadow: 0 7px 22px rgba(42,35,30,0.1);
}

.notification-bell:focus-visible {
  outline: 2px solid #a96743;
  outline-offset: 3px;
}

.notification-bell svg {
  width: 19px;
  height: 19px;
}

.notification-indicator {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 8px;
  height: 8px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #b97513;
  opacity: 0;
  transform: scale(0.5);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.notification-bell.active .notification-indicator {
  opacity: 1;
  transform: scale(1);
}

.subscription-dialog {
  width: min(440px, calc(100% - 2rem));
  max-width: none;
  padding: 0;
  border: none;
  border-radius: 22px;
  background: transparent;
  color: #1a1815;
  overflow: visible;
}

.subscription-dialog::backdrop {
  background: rgba(24,20,17,0.48);
  backdrop-filter: blur(4px);
}

.subscription-panel {
  position: relative;
  padding: 2.2rem;
  border: 1px solid rgba(94,72,50,0.12);
  border-radius: 22px;
  background:
    radial-gradient(circle at 90% 0, rgba(185,116,19,0.14), transparent 13rem),
    #fffdf9;
  box-shadow: 0 28px 90px rgba(33,27,22,0.24);
}

.subscription-close {
  position: absolute;
  top: 0.8rem;
  right: 0.8rem;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: #847a70;
  cursor: pointer;
  font-size: 1.35rem;
  line-height: 1;
}

.subscription-close:hover {
  background: #f1ebe3;
  color: #28231f;
}

.subscription-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  margin-bottom: 1.2rem;
  border-radius: 50%;
  background: #f2e6d4;
  color: #ad7118;
}

.subscription-icon.success {
  background: #e7efe4;
  color: #477341;
}

.subscription-icon svg {
  width: 24px;
  height: 24px;
}

.subscription-kicker {
  margin-bottom: 0.4rem;
  color: #a5650e;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.subscription-panel h2 {
  max-width: 330px;
  margin-bottom: 0.65rem;
  font-family: var(--serif);
  font-size: 2rem;
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 1;
}

.subscription-copy {
  margin-bottom: 1.35rem;
  color: #665f58;
  font-size: 0.86rem;
  line-height: 1.65;
}

.subscription-form label {
  display: block;
  margin-bottom: 0.4rem;
  color: #514a43;
  font-size: 0.72rem;
  font-weight: 600;
}

.subscription-form input[type='email'] {
  width: 100%;
  min-height: 46px;
  margin-bottom: 0.75rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid #ded6cb;
  border-radius: 10px;
  background: #fff;
  color: #1e1b18;
  font: 0.86rem var(--sans);
  outline: none;
}

.subscription-form input[type='email']:focus {
  border-color: #ac711b;
  box-shadow: 0 0 0 3px rgba(172,113,27,0.13);
}

.subscription-form input[type='email'][readonly] {
  background: #f4efe8;
  color: #625b54;
}

.subscription-form button,
.subscription-secondary {
  width: 100%;
  min-height: 44px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #c18a2d, #a96b0f);
  color: #fff;
  cursor: pointer;
  font: 600 0.82rem var(--sans);
}

.subscription-form button:disabled,
.subscription-remove:disabled {
  opacity: 0.55;
  cursor: wait;
}

.subscription-honeypot {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.subscription-fine-print {
  margin-top: 0.75rem;
  color: #8a827a;
  font-size: 0.66rem;
  line-height: 1.45;
}

.subscription-fine-print a {
  color: inherit;
}

.subscription-error {
  min-height: 1rem;
  margin-top: 0.55rem;
  color: #a23b32;
  font-size: 0.72rem;
}

.subscription-success {
  text-align: left;
}

.subscription-secondary {
  margin-top: 0.2rem;
}

.subscription-remove {
  width: 100%;
  margin-top: 0.65rem;
  padding: 0.55rem;
  border: none;
  background: transparent;
  color: #8a5047;
  cursor: pointer;
  font: 500 0.72rem var(--sans);
}

.mobile-nav {
  display: none;
  position: relative;
}

.mobile-nav summary {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(70,58,46,0.14);
  border-radius: 50%;
  background: rgba(255,255,255,0.84);
  cursor: pointer;
  list-style: none;
}

.mobile-nav summary::-webkit-details-marker {
  display: none;
}

.mobile-nav summary svg {
  width: 19px;
  height: 19px;
}

.mobile-nav-links {
  position: absolute;
  top: calc(100% + 0.6rem);
  right: 0;
  width: 190px;
  padding: 0.55rem;
  border: 1px solid rgba(70,58,46,0.12);
  border-radius: 12px;
  background: rgba(255,255,255,0.98);
  box-shadow: 0 16px 40px rgba(42,35,30,0.14);
}

.mobile-nav-links a {
  display: block;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  color: #332d28;
  font-size: 0.8rem;
  text-decoration: none;
}

.mobile-nav-links a:hover {
  background: #f4eee5;
}

.hero-inner {
  position: relative;
  z-index: 2;
  width: min(1400px, calc(100% - 4rem));
  margin: 0 auto;
  padding: 3.4rem 0 3.6rem;
}

.hero-copy {
  width: min(660px, 54%);
}

.landing-hero .eyebrow,
.section-kicker {
  margin-bottom: 0.75rem;
  color: #a6650f;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.landing-hero h1 {
  margin: 0 0 0.9rem;
  color: #151310;
  font-family: var(--serif);
  font-size: clamp(3.7rem, 5.3vw, 5.6rem);
  font-weight: 400;
  letter-spacing: -0.045em;
  line-height: 0.9;
}

.landing-hero h1 span {
  display: block;
}

.landing-hero .intro {
  max-width: 570px;
  margin: 0 0 1.3rem;
  color: #34302b;
  font-family: var(--serif);
  font-size: clamp(1.05rem, 1.5vw, 1.3rem);
  font-weight: 400;
  line-height: 1.35;
}

.hero-search {
  position: relative;
  width: min(650px, 100%);
  min-height: 52px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  padding: 0.25rem 0.28rem 0.25rem 0;
  border: 1px solid rgba(93,76,58,0.11);
  border-radius: 999px;
  background: rgba(255,255,255,0.94);
  box-shadow: 0 7px 24px rgba(60,45,30,0.08);
}

.hero-search .search-wrapper {
  flex: 1;
  min-width: 0;
}

.hero-search .search-wrapper svg {
  left: 1rem;
  width: 20px;
  height: 20px;
  color: #26221e;
}

.hero-search .search-input {
  width: 100%;
  min-width: 0;
  padding: 0.8rem 0.7rem 0.8rem 3rem;
  border: none;
  border-radius: 999px;
  background: transparent;
  box-shadow: none;
  font-size: 0.84rem;
}

.hero-search .search-input:focus {
  border: none;
  box-shadow: none;
}

.hero-search:focus-within {
  box-shadow: 0 0 0 3px rgba(184,119,24,0.18), 0 7px 24px rgba(60,45,30,0.08);
}

.hero-search-button {
  min-width: 116px;
  align-self: stretch;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, #c18a2d, #a96b0f);
  color: #fff;
  cursor: pointer;
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 600;
  transition: filter 0.15s ease, transform 0.15s ease;
}

.hero-search-button:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}

.hero-topics {
  width: min(760px, 100%);
}

.landing-hero .tag-filters {
  margin: 0;
}

.landing-hero .tag-btn,
.landing-hero .tag-toggle {
  flex-shrink: 0;
  padding: 0.38rem 0.78rem;
  border-color: rgba(119,94,65,0.15);
  background: rgba(255,255,255,0.7);
  color: #423b34;
  backdrop-filter: blur(8px);
  font-size: 0.71rem;
}

.landing-hero .tag-btn.active {
  border-color: #af741b;
  background: #af741b;
  color: #fff;
}

.landing-main {
  max-width: 1400px;
  padding: 2.9rem 2rem 5rem;
}

.collection-section {
  scroll-margin-top: 1rem;
}

.collection-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.6rem;
}

.collection-header .section-kicker {
  margin-bottom: 0.35rem;
}

.collection-header h2 {
  font-family: var(--serif);
  font-size: clamp(2rem, 3vw, 2.7rem);
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 1;
}

.collection-header .book-count {
  color: var(--text-tertiary);
  font-size: 0.78rem;
  white-space: nowrap;
}

.landing-main .book-grid,
.landing-main .online-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 2.1rem 1.55rem;
}

.landing-main .book-card {
  overflow: visible;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.landing-main .book-card:hover {
  box-shadow: none;
  transform: translateY(-4px);
}

.landing-main .book-cover-wrapper {
  min-height: 232px;
  overflow: visible;
  justify-content: flex-start;
  padding: 0.25rem;
  background: transparent;
}

.landing-main .book-cover-wrapper::before,
.landing-main .book-cover-wrapper::after {
  display: none;
}

.landing-main .book-cover-wrapper img {
  height: 218px;
  max-width: 150px;
  box-shadow: 0 8px 22px rgba(35,28,23,0.14), 0 2px 5px rgba(35,28,23,0.08);
}

.landing-main .book-info {
  padding: 0.7rem 0.15rem 0;
}

.landing-main .book-info h3 {
  margin-bottom: 0.2rem;
  font-size: 1.05rem;
  line-height: 1.12;
}

.landing-main .book-info .authors {
  margin-bottom: 0.35rem;
  font-size: 0.72rem;
}

.landing-main .book-info .subtitle {
  display: -webkit-box;
  overflow: hidden;
  margin-top: 0;
  color: #74706b;
  font-size: 0.73rem;
  line-height: 1.38;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.landing-main .category-badge {
  display: none;
}

.landing-main .book-card.online-result {
  padding: 0.8rem;
  border-radius: 14px;
  background: #f8f5fb;
  box-shadow: inset 0 0 0 1px rgba(124,100,180,0.15);
}

.recent-section {
  margin-bottom: 3.5rem;
  padding: 1.4rem 1.5rem;
  border-radius: 18px;
  background: linear-gradient(135deg, #efe6da, #f8f4ee);
}

.recent-header h2 {
  font-size: 1.65rem;
}

.recent-card {
  background: rgba(255,255,255,0.68);
}

.online-section {
  margin-top: 4rem;
}

.about-section {
  margin-top: 5.5rem;
  padding: 3.6rem;
  border-radius: 26px;
  background:
    radial-gradient(circle at 90% 15%, rgba(187,126,30,0.14), transparent 18rem),
    #eee6db;
}

.about-copy {
  max-width: 760px;
}

.about-copy h2 {
  max-width: 680px;
  margin-bottom: 1rem;
  font-family: var(--serif);
  font-size: clamp(2.4rem, 4vw, 3.7rem);
  font-weight: 400;
  letter-spacing: -0.035em;
  line-height: 0.98;
}

.about-copy > p:last-child {
  max-width: 650px;
  color: #5f5851;
  font-size: 0.92rem;
  line-height: 1.75;
}

.about-pillars {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 2.2rem;
}

.about-pillar {
  padding: 1.25rem;
  border-radius: 14px;
  background: rgba(255,255,255,0.56);
}

.about-pillar h3 {
  margin-bottom: 0.35rem;
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 400;
}

.about-pillar p {
  color: #6d665f;
  font-size: 0.75rem;
  line-height: 1.55;
}

@media (max-width: 1180px) {
  .landing-nav,
  .hero-inner {
    width: min(100% - 2.5rem, 1100px);
  }

  .landing-nav {
    grid-template-columns: minmax(220px, 1fr) auto minmax(180px, 1fr);
  }

  .brand-tagline {
    display: none;
  }

  .landing-main .book-grid,
  .landing-main .online-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .landing-nav {
    grid-template-columns: 1fr auto;
  }

  .desktop-nav {
    display: none;
  }

  .mobile-nav {
    display: block;
  }

  .hero-copy {
    width: min(680px, 68%);
  }

  .about-section {
    padding: 2.5rem;
  }
}

@media (max-width: 700px) {
  .landing-hero {
    min-height: 880px;
  }

  .landing-hero::before {
    background:
      linear-gradient(180deg, #fbf8f2 0%, #fbf8f2 49%, rgba(251,248,242,0.96) 57%, rgba(251,248,242,0.58) 68%, rgba(251,248,242,0.04) 80%);
  }

  .hero-art img {
    object-position: center;
  }

  .landing-nav,
  .hero-inner {
    width: calc(100% - 1.6rem);
  }

  .landing-nav {
    display: block;
    min-height: 70px;
    gap: 0.5rem;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
  }

  .brand-name {
    font-size: 1.2rem;
  }

  .nav-actions {
    position: absolute;
    top: 50%;
    right: 0;
    gap: 0.35rem;
    transform: translateY(-50%);
  }

  .notification-bell {
    width: 38px;
    height: 38px;
  }

  .landing-nav .auth-trigger {
    min-height: 36px;
    padding: 0.42rem 0.72rem;
  }

  .hero-inner {
    padding-top: 2.35rem;
  }

  .hero-copy {
    width: 100%;
  }

  .landing-hero h1 {
    max-width: 360px;
    font-size: clamp(2.65rem, 13vw, 3.65rem);
    line-height: 0.92;
  }

  .landing-hero .intro {
    max-width: 430px;
    font-size: 1.05rem;
  }

  .hero-search {
    min-height: 50px;
    padding-right: 0.2rem;
  }

  .hero-search-button {
    position: absolute;
    top: 0.22rem;
    right: 0.22rem;
    bottom: 0.22rem;
    width: 88px;
    min-width: 0;
  }

  .hero-search .search-input {
    padding-right: 96px;
  }

  .landing-hero .tag-filters {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 0.15rem 0 0.5rem;
    scrollbar-width: none;
  }

  .landing-hero .tag-filters::-webkit-scrollbar {
    display: none;
  }

  .landing-hero .tag-btn.overflow {
    display: inline-flex !important;
  }

  .landing-hero .tag-toggle {
    display: none !important;
  }

  .landing-main {
    padding: 2.4rem 1rem 4rem;
  }

  .collection-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .landing-main .book-grid,
  .landing-main .online-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.8rem 1rem;
  }

  .landing-main .book-card {
    flex-direction: column;
  }

  .landing-main .book-cover-wrapper {
    min-height: 200px;
    padding: 0;
  }

  .landing-main .book-cover-wrapper img {
    height: 190px;
    max-width: 128px;
  }

  .landing-main .book-info {
    padding: 0.65rem 0 0;
  }

  .landing-main .book-info h3 {
    font-size: 1rem;
  }

  .landing-main .book-info .subtitle {
    -webkit-line-clamp: 2;
  }

  .recent-grid {
    grid-template-columns: 1fr 1fr;
  }

  .about-section {
    margin-top: 4rem;
    padding: 2rem 1.25rem;
    border-radius: 20px;
  }

  .about-pillars {
    grid-template-columns: 1fr;
  }

  .subscription-dialog {
    width: 100%;
    max-width: none;
    margin: auto 0 0;
    border-radius: 22px 22px 0 0;
  }

  .subscription-panel {
    padding: 2rem 1.25rem calc(1.5rem + env(safe-area-inset-bottom));
    border-radius: 22px 22px 0 0;
  }
}

@media (max-width: 430px) {
  .brand-copy {
    max-width: 142px;
  }

  @media (max-width: 360px) {
    .landing-nav .brand-copy {
      display: none;
    }
  }

  .brand-name {
    font-size: 1.08rem;
  }

  .brand-mark {
    width: 33px;
    height: 33px;
  }

  .landing-nav {
    width: calc(100% - 1rem);
  }

  .hero-search {
    padding-right: 0;
  }

  .hero-search-button {
    width: 76px;
    font-size: 0.74rem;
  }

  .hero-search .search-input {
    padding-right: 84px;
  }

  .recent-grid {
    grid-template-columns: 1fr;
  }

  .landing-main .book-cover-wrapper {
    min-height: 180px;
  }

  .landing-main .book-cover-wrapper img {
    height: 172px;
    max-width: 115px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .desktop-nav a::after,
  .hero-search-button,
  .recent-card {
    transition: none;
  }
}
