/* ============================================================
   eScientia — Ebook Publishing House
   Display: Cormorant Garamond · UI: Inter
   ============================================================ */
:root {
  --cream:       #f7f4ef;
  --cream-2:     #efe9e0;
  --ink:         #1c1916;
  --ink-soft:    #5c554c;
  --ink-faint:   #8a8278;
  --navy:        #1a2c42;
  --navy-deep:   #0f1c2c;
  --gold:        #b8955a;
  --gold-light:  #d4b88a;
  --white:       #ffffff;
  --line:        #e0d9cf;
  --danger:      #b3382e;
  --success:     #2a7a52;
  --radius:      12px;
  --radius-lg:   20px;
  --shadow:      0 12px 40px rgba(15, 28, 44, .08);
  --shadow-lg:   0 28px 64px rgba(15, 28, 44, .14);
  --font-ui:     'Inter', system-ui, sans-serif;
  --font-display:'Cormorant Garamond', Georgia, serif;
  --ease:        cubic-bezier(.22, 1, .36, 1);
  --ease-spring: cubic-bezier(.34, 1.3, .64, 1);
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-ui);
  background: var(--cream);
  color: var(--ink);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--navy); text-decoration: none; transition: color .2s; }
a:hover { color: var(--gold); }
h1, h2, h3, .logo-word { font-family: var(--font-display); font-weight: 600; letter-spacing: -.01em; }


.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--navy); color: #fff; padding: .6rem 1rem; z-index: 300;
}
.skip-link:focus { left: 0; }
.muted { color: var(--ink-soft); font-size: .9rem; }
.center { text-align: center; }
.eyebrow {
  font-size: .72rem; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: var(--gold); margin-bottom: .5rem;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  border: 0; cursor: pointer;
  font: 600 .9rem var(--font-ui);
  padding: .85rem 1.75rem;
  border-radius: 999px;
  transition: transform .3s var(--ease), box-shadow .3s, background .25s, color .25s, border-color .25s;
  position: relative; overflow: hidden;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn-primary {
  background: var(--navy);
  color: #fff;
  box-shadow: 0 8px 24px rgba(26, 44, 66, .25);
}
.btn-primary:hover { background: var(--navy-deep); color: #fff; box-shadow: 0 12px 32px rgba(26, 44, 66, .35); }
.btn-primary::after {
  content: ''; position: absolute; top: 0; left: -90%; width: 45%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.2), transparent);
  transform: skewX(-18deg); transition: left .5s ease;
}
.btn-primary:hover::after { left: 130%; }
.btn-ghost {
  background: transparent; color: var(--navy);
  border: 1.5px solid rgba(26, 44, 66, .35);
}
.btn-ghost:hover { background: var(--navy); color: #fff; border-color: var(--navy); }
.btn-small {
  padding: .45rem .95rem; font-size: .8rem;
  background: var(--ink); color: #fff; border-radius: 999px;
}
.btn-small:hover { background: var(--navy); transform: translateY(-2px); }
.btn-block { width: 100%; margin-top: 1rem; }
.btn-icon { background: none; border: 0; font-size: 1.1rem; cursor: pointer; color: var(--ink-soft); padding: .4rem; transition: color .2s, transform .2s; }
.btn-icon:hover { color: var(--danger); transform: scale(1.1); }
.link-arrow {
  font-weight: 600; font-size: .9rem; color: var(--navy);
  display: inline-flex; align-items: center; gap: .3rem;
  transition: gap .25s, color .2s;
}
.link-arrow:hover { gap: .55rem; color: var(--gold); text-decoration: none; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(247, 244, 239, .88);
  backdrop-filter: blur(18px) saturate(1.3);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
  border-bottom: 1px solid transparent;
  transition: border-color .3s, box-shadow .3s, background .3s;
}
.site-header.scrolled {
  border-bottom-color: var(--line);
  box-shadow: 0 6px 28px rgba(15, 28, 44, .06);
  background: rgba(247, 244, 239, .95);
}
.header-inner {
  display: flex; align-items: center; gap: 1.5rem;
  max-width: 1280px; margin: 0 auto;
  padding: .9rem clamp(1.2rem, 4vw, 2.5rem);
}
.logo { display: flex; align-items: center; flex-shrink: 0; }
.logo:hover { text-decoration: none; }
.logo-img { height: 44px; width: auto; transition: transform .4s var(--ease-spring); }
.logo:hover .logo-img { transform: scale(1.05); }
.logo-word { font-size: 1.45rem; font-weight: 700; color: var(--ink); }
.logo-word em { font-style: italic; color: var(--gold); font-weight: 600; }

.main-nav {
  display: flex; align-items: center; gap: .15rem;
  margin-left: 1rem; flex: 1;
}
.main-nav > a,
.nav-drop-btn {
  font-size: .88rem; font-weight: 500; color: var(--ink-soft);
  padding: .45rem .9rem; border-radius: 999px;
  background: none; border: 0; cursor: pointer;
  font-family: var(--font-ui);
  transition: color .2s, background .2s;
}
.main-nav > a:hover,
.nav-drop-btn:hover { color: var(--ink); background: var(--cream-2); text-decoration: none; }
.main-nav > a.active { color: var(--navy); font-weight: 600; background: var(--cream-2); }

.nav-dropdown { position: relative; }
.nav-drop-menu {
  position: absolute; top: calc(100% + 8px); left: 0; min-width: 200px;
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  padding: .5rem; display: none; z-index: 60;
  animation: dropIn .25s var(--ease);
}
.nav-dropdown:hover .nav-drop-menu,
.nav-dropdown.open .nav-drop-menu { display: block; }
.nav-drop-menu a {
  display: block; padding: .55rem .9rem; border-radius: 8px;
  font-size: .88rem; color: var(--ink-soft);
}
.nav-drop-menu a:hover { background: var(--cream); color: var(--navy); text-decoration: none; }
@keyframes dropIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: none; }
}

.header-actions { display: flex; align-items: center; gap: .35rem; margin-left: auto; }
.icon-btn {
  position: relative;
  display: grid; place-items: center;
  width: 42px; height: 42px; border-radius: 50%;
  background: none; border: 0; cursor: pointer;
  color: var(--ink); transition: background .2s, color .2s, transform .25s var(--ease);
}
.icon-btn:hover { background: var(--cream-2); color: var(--navy); transform: translateY(-1px); text-decoration: none; }
.cart-badge {
  position: absolute; top: 2px; right: 2px;
  background: var(--gold); color: var(--navy-deep);
  font-size: .65rem; font-weight: 700;
  min-width: 17px; height: 17px; border-radius: 999px;
  display: grid; place-items: center; padding: 0 3px;
}

.nav-toggle {
  display: none; background: none; border: 0; cursor: pointer;
  flex-direction: column; gap: 5px; padding: .4rem;
}
.nav-toggle span {
  width: 22px; height: 2px; background: var(--ink); border-radius: 2px;
  transition: .3s var(--ease);
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Search overlay */
.search-overlay {
  position: absolute; inset: 0; z-index: 110;
  background: rgba(247, 244, 239, .98);
  backdrop-filter: blur(12px);
  display: flex; align-items: center; justify-content: center;
  padding: 0 clamp(1rem, 4vw, 3rem);
  animation: fadeIn .25s var(--ease);
}
.search-overlay[hidden] { display: none; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.search-overlay-form {
  position: relative; width: 100%; max-width: 640px;
  display: flex; align-items: center; gap: .5rem;
}
.search-overlay-form input {
  flex: 1; border: 0; border-bottom: 2px solid var(--navy);
  background: transparent; padding: .9rem 0;
  font: 400 1.25rem var(--font-display); outline: none; color: var(--ink);
}
.search-overlay-form input::placeholder { color: var(--ink-faint); }
.search-overlay-form button[type="submit"] {
  background: none; border: 0; cursor: pointer; color: var(--navy); padding: .5rem;
}
.search-close {
  background: none; border: 0; cursor: pointer;
  font-size: 1.2rem; color: var(--ink-soft); padding: .5rem;
}
.search-suggest {
  position: absolute; top: calc(100% + 12px); left: 0; right: 0;
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  overflow: hidden; z-index: 50;
}
.search-suggest a {
  display: flex; justify-content: space-between; gap: 1rem;
  padding: .75rem 1.15rem; color: var(--ink); font-size: .95rem;
}
.search-suggest a:hover { background: var(--cream); text-decoration: none; }
.search-suggest .sug-author { color: var(--ink-soft); font-size: .8rem; }

/* ---------- Hero (centered, theme-aware) ---------- */
.hero {
  position: relative; z-index: 5;           /* lets the search dropdown overlap the next section */
  /* sticky header (~4.5rem) is subtracted so the block is centred in the visible viewport */
  min-height: calc(100vh - 4.5rem); min-height: calc(100svh - 4.5rem);
  display: flex; align-items: center; justify-content: center;
  padding: 2.5rem clamp(1.2rem, 5vw, 4rem);
  color: var(--ink);
  text-align: center;
}
/* Hero always uses the dark palette (even in light theme); header and the rest of the page follow the theme */
.hero {
  --cream:       #12161c;
  --cream-2:     #1a2029;
  --ink:         #e8e4dc;
  --ink-soft:    #a39e94;
  --ink-faint:   #6e6a62;
  --navy:        #c9a86c;
  --navy-deep:   #0a0e14;
  --gold:        #d4b88a;
  --gold-light:  #e8d4b0;
  --white:       #1a2029;
  --line:        #2a3140;
  --shadow:      0 12px 40px rgba(0, 0, 0, .35);
  --shadow-lg:   0 28px 64px rgba(0, 0, 0, .45);
  color-scheme: dark;
}
.hero .btn-primary { background: var(--gold); color: #12161c; box-shadow: 0 8px 24px rgba(201, 168, 108, .25); }
.hero .btn-primary:hover { background: var(--gold-light); color: #12161c; }
.hero .btn-ghost { color: var(--gold); border-color: rgba(201, 168, 108, .4); }
.hero .btn-ghost:hover { background: var(--gold); color: #12161c; border-color: var(--gold); }
.hero a { color: inherit; }
.hero .hero-result, .hero .hero-result:hover { color: var(--ink); }
.hero-slides, .hero-slide, .hero-scrim { position: absolute; inset: 0; }
.hero-slides { overflow: hidden; }
.hero-slide {
  background-size: cover; background-position: center;
  opacity: 0; transition: opacity 1.6s ease-in-out;
  will-change: transform, opacity;
}
.hero-slide.active { opacity: 1; animation: kenburns 8.5s ease-out forwards; }
@keyframes kenburns { from { transform: scale(1.03); } to { transform: scale(1.14); } }
.hero-scrim {
  background:
    radial-gradient(ellipse 80% 70% at 50% 50%, rgba(10, 14, 20, .9) 0%, rgba(10, 14, 20, .78) 55%, rgba(10, 14, 20, .55) 100%);
}
.hero-inner {
  position: relative; z-index: 2;
  width: 100%; max-width: 760px; margin: 0 auto;
  display: flex; flex-direction: column; align-items: center;
}
.hero-logo {
  width: clamp(150px, 24vw, 240px); height: auto;
  margin-bottom: 1.6rem;
  filter: drop-shadow(0 14px 34px rgba(0, 0, 0, .55));
}
.hero h1 {
  font-size: clamp(2.3rem, 5.6vw, 4rem);
  line-height: 1.08; font-weight: 600;
  color: var(--ink);
  text-wrap: balance;
}
.hero-sub {
  max-width: 54ch; margin: 1.1rem auto 2rem;
  color: var(--ink-soft); font-size: 1.08rem; line-height: 1.7;
  text-wrap: balance;
}

/* search */
.hero-search { position: relative; z-index: 20; width: 100%; max-width: 720px; }
.hero-cta, .hero-stats { position: relative; z-index: 1; }
.hero-search-form {
  display: flex; align-items: center; gap: .6rem;
  background: var(--white); border: 1px solid rgba(212, 184, 138, .55);
  border-radius: 999px; padding: .42rem 1.4rem .42rem 1.3rem;
  box-shadow: var(--shadow);
  transition: border-color .2s, box-shadow .25s;
}
.hero-search-form:focus-within {
  border-color: var(--gold-light);
  box-shadow: var(--shadow-lg), 0 0 0 4px color-mix(in srgb, var(--gold-light) 22%, transparent);
}
.hero-search-icon { flex: none; color: var(--ink-faint); }
.hero-search-form input {
  flex: 1; min-width: 0; border: 0; outline: 0; background: transparent;
  font: 400 1.05rem var(--font-ui); color: var(--ink);
  padding: .8rem .2rem;
}
.hero-search-form input::placeholder { color: var(--ink-faint); }
.hero-search-form input::-webkit-search-cancel-button { display: none; }

.hero-results {
  position: absolute; top: calc(100% + 10px); left: 0; right: 0; z-index: 30;
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  overflow: hidden; text-align: left;
  max-height: 340px; overflow-y: auto;
}
.hero-results[hidden] { display: none; }
.hero-result {
  display: flex; align-items: center; gap: .85rem;
  padding: .5rem .9rem; color: var(--ink);
  border-bottom: 1px solid var(--line);
  transition: background .15s;
}
.hero-result:last-child { border-bottom: 0; }
.hero-result:hover, .hero-result:focus-visible { background: var(--cream); color: var(--ink); outline: none; }
.hero-result img {
  flex: none; width: 38px; height: 54px; object-fit: cover;
  border-radius: 3px; background: var(--cream-2);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .18);
}
.hero-result-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.hero-result-text strong {
  font: 600 1.02rem var(--font-display); color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.hero-result-author { font-size: .78rem; color: var(--gold); font-weight: 600; }
.hero-result-desc {
  font-size: .78rem; color: var(--ink-soft); margin-top: .1rem;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.hero-results-empty { padding: 1.1rem 1.3rem; color: var(--ink-soft); font-size: .95rem; }

/* buttons */
.hero-cta { display: flex; justify-content: center; gap: 1rem; flex-wrap: wrap; margin-top: 2rem; }

/* statistics */
.hero-stats {
  display: flex; justify-content: center; gap: clamp(1.5rem, 5vw, 3.5rem);
  list-style: none; margin-top: 3rem; flex-wrap: wrap;
}
.hero-stats li { text-align: center; }
.hero-stats strong {
  display: block; font-family: var(--font-display);
  font-size: 1.9rem; color: var(--ink); font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.hero-stats span { font-size: .78rem; color: var(--ink-soft); letter-spacing: .04em; text-transform: uppercase; }

.anim-up {
  opacity: 0; transform: translateY(36px);
  animation: rise 1s var(--ease) forwards;
}
.d1 { animation-delay: .1s; }
.d2 { animation-delay: .25s; }
.d3 { animation-delay: .4s; }
.d4 { animation-delay: .55s; }
.d5 { animation-delay: .72s; }
.d6 { animation-delay: .9s; }
@keyframes rise { to { opacity: 1; transform: none; } }

.scroll-hint {
  position: absolute; bottom: 28px; left: 50%; transform: translateX(-50%);
  width: 26px; height: 42px; border: 1.5px solid rgba(255,255,255,.35);
  border-radius: 999px; z-index: 2;
}
.scroll-hint span {
  position: absolute; top: 8px; left: 50%; margin-left: -2px;
  width: 4px; height: 8px; border-radius: 2px; background: #fff;
  animation: wheel 1.9s ease-in-out infinite;
}
@keyframes wheel {
  0%   { opacity: 1; transform: translateY(0); }
  70%  { opacity: 0; transform: translateY(14px); }
  100% { opacity: 0; }
}

/* ---------- Manifesto ---------- */
.manifesto {
  background: var(--navy-deep);
  color: #d4cbb8;
  padding: clamp(2.5rem, 5vw, 3.5rem) clamp(1.2rem, 4vw, 3rem);
  text-align: center;
}
.manifesto blockquote {
  max-width: 720px; margin: 0 auto;
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2.8vw, 1.85rem);
  font-style: italic; font-weight: 500;
  line-height: 1.45; color: #f0ebe3;
}

/* ---------- Sections ---------- */
.section {
  padding: clamp(3rem, 6vw, 5rem) clamp(1.2rem, 4vw, 2.5rem);
  max-width: 1200px; margin: 0 auto;
}
.section-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 1rem; margin-bottom: 2.2rem; flex-wrap: wrap;
}
.section-head h2 {
  font-size: clamp(1.8rem, 3.5vw, 2.5rem);
  font-weight: 600; line-height: 1.15;
}
.section-note { color: var(--ink-soft); font-size: .9rem; }
.count-pill {
  display: inline-block; font-family: var(--font-ui);
  font-size: .75rem; font-weight: 700;
  background: var(--cream-2); color: var(--navy);
  border-radius: 999px; padding: .15rem .7rem; vertical-align: middle;
  margin-left: .4rem;
}
.breadcrumb {
  max-width: 1200px; margin: 1.4rem auto 0;
  padding: 0 clamp(1.2rem, 4vw, 2.5rem);
  font-size: .85rem; color: var(--ink-faint);
  display: flex; gap: .45rem; flex-wrap: wrap; align-items: center;
}
.breadcrumb a { color: var(--ink-soft); }
.breadcrumb a:hover { color: var(--gold); }
.empty {
  text-align: center; padding: 3.5rem 1.5rem; color: var(--ink-soft);
  background: var(--white); border: 1.5px dashed var(--line);
  border-radius: var(--radius-lg);
}

/* ---------- Reveal ---------- */
.reveal {
  opacity: 0; transform: translateY(36px);
  transition: opacity .9s var(--ease), transform .9s var(--ease);
}
.reveal.in { opacity: 1; transform: none; }
.reveal .stagger > * {
  opacity: 0; transform: translateY(24px);
  transition: opacity .65s var(--ease), transform .65s var(--ease);
}
.reveal.in .stagger > * { opacity: 1; transform: none; }
.reveal.in .stagger > *:nth-child(1) { transition-delay: .05s; }
.reveal.in .stagger > *:nth-child(2) { transition-delay: .12s; }
.reveal.in .stagger > *:nth-child(3) { transition-delay: .19s; }
.reveal.in .stagger > *:nth-child(4) { transition-delay: .26s; }
.reveal.in .stagger > *:nth-child(5) { transition-delay: .33s; }
.reveal.in .stagger > *:nth-child(6) { transition-delay: .4s; }
.reveal.in .stagger > *:nth-child(7) { transition-delay: .47s; }
.reveal.in .stagger > *:nth-child(8) { transition-delay: .54s; }

@media (prefers-reduced-motion: reduce) {
  .anim-up, .hero-slide.active, .btn-primary::after { animation: none !important; }
  .anim-up, .reveal, .reveal .stagger > * {
    opacity: 1 !important; transform: none !important; transition: none !important;
  }
}

/* ---------- Featured grid ---------- */
.featured-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.4rem;
}
.featured-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform .35s var(--ease), box-shadow .35s;
  height: 100%;
}
.featured-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}
.featured-cover {
  display: block; overflow: hidden;
  aspect-ratio: 2/3; background: var(--cream-2);
  flex-shrink: 0;
}
.featured-cover img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .7s var(--ease);
}
.featured-card:hover .featured-cover img { transform: scale(1.06); }
.featured-body {
  padding: 1.1rem 1.2rem 1.3rem;
  display: flex; flex-direction: column; gap: .35rem; flex: 1;
  min-height: 0;
}
.featured-body .book-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.5em;
}
.featured-body .book-author {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.featured-excerpt {
  font-size: .88rem;
  color: var(--ink-soft);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
  margin: .15rem 0 .1rem;
  min-height: 4.5em; /* 3 lines — keeps cards equal when no description */
}
.featured-body .book-foot {
  margin-top: auto;
  padding-top: .7rem;
}

/* ---------- Domain grid ---------- */
.domain-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}
.domain-card {
  position: relative;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem 1.4rem 1.3rem;
  display: flex; flex-direction: column; gap: .25rem;
  transition: transform .3s var(--ease), box-shadow .3s, border-color .25s;
  overflow: hidden;
}
.domain-card::after {
  content: '';
  position: absolute; left: 0; bottom: 0; height: 2.5px; width: 0;
  background: var(--gold);
  transition: width .4s var(--ease);
}
.domain-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow);
  border-color: rgba(184, 149, 90, .4);
  text-decoration: none;
}
.domain-card:hover::after { width: 100%; }
.domain-count {
  font-size: .7rem; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--gold);
}
.domain-card h3 {
  font-size: 1.35rem; color: var(--ink); font-weight: 600;
  transition: color .2s;
}
.domain-card:hover h3 { color: var(--navy); }
.domain-en {
  font-size: .8rem; color: var(--ink-faint); font-style: italic;
  font-family: var(--font-display);
}
.domain-arrow {
  position: absolute; right: 1.2rem; bottom: 1.2rem;
  font-size: 1.1rem; color: var(--gold);
  opacity: 0; transform: translateX(-6px);
  transition: opacity .3s, transform .3s var(--ease);
}
.domain-card:hover .domain-arrow { opacity: 1; transform: none; }

/* ---------- Book grid ---------- */
.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 1.5rem 1.3rem;
}
.book-card {
  display: flex; flex-direction: column;
  transition: transform .3s var(--ease);
}
.book-card:hover { transform: translateY(-4px); }
.book-cover {
  border-radius: 10px; overflow: hidden;
  aspect-ratio: 2/3; background: var(--cream-2);
  box-shadow: 0 8px 24px rgba(15, 28, 44, .1);
  transition: transform .4s var(--ease), box-shadow .4s;
  display: block; position: relative;
}
.book-card:hover .book-cover {
  transform: translateY(-6px);
  box-shadow: 0 18px 44px rgba(15, 28, 44, .16);
}
.book-cover img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .6s var(--ease);
}
.book-card:hover .book-cover img { transform: scale(1.07); }
.book-info {
  padding: .85rem .1rem 0;
  display: flex; flex-direction: column; gap: .22rem; flex: 1;
}
.book-author {
  font-size: .72rem; color: var(--ink-faint);
  font-weight: 600; text-transform: uppercase; letter-spacing: .05em;
}
.book-title {
  font-family: var(--font-display);
  font-size: 1.15rem; font-weight: 600; line-height: 1.25;
}
.book-title a { color: var(--ink); }
.book-title a:hover { color: var(--gold); text-decoration: none; }
.book-foot {
  margin-top: auto; padding-top: .65rem;
  display: flex; align-items: center; justify-content: space-between; gap: .5rem;
}
.price { font-weight: 700; color: var(--navy); font-size: .95rem; }
.price-big { font-size: 1.5rem; font-family: var(--font-display); font-weight: 600; }

/* ---------- Book detail ---------- */
.book-detail {
  max-width: 1100px; margin: 0 auto;
  padding: 2.5rem clamp(1.2rem, 4vw, 2.5rem) 4rem;
  display: grid; grid-template-columns: 280px 1fr;
  gap: clamp(2rem, 5vw, 3.5rem);
}
.detail-cover img {
  border-radius: 12px; box-shadow: var(--shadow-lg);
  aspect-ratio: 2/3; object-fit: cover; width: 100%;
}
.detail-author {
  color: var(--gold); font-weight: 600; letter-spacing: .04em;
  font-size: .9rem; margin-bottom: .4rem; text-transform: uppercase;
}
.detail-info h1 {
  font-size: clamp(2rem, 4vw, 3rem); line-height: 1.1; margin-bottom: .7rem;
}
.detail-meta {
  font-size: .9rem; color: var(--ink-soft); margin-bottom: 1.2rem;
}
.detail-desc {
  color: var(--ink-soft); line-height: 1.75; font-size: 1.02rem;
  margin-bottom: 1.8rem;
}
.detail-buy {
  display: flex; flex-wrap: wrap; gap: 1rem; align-items: center;
  margin-bottom: 1.5rem;
}
.detail-perks {
  list-style: none; display: flex; flex-direction: column; gap: .45rem;
  font-size: .9rem; color: var(--ink-soft);
}
.detail-perks li { padding-left: .2rem; }

/* ---------- About band ---------- */
.about-band {
  background: var(--cream-2);
  padding: clamp(3.5rem, 7vw, 5.5rem) clamp(1.2rem, 4vw, 2.5rem);
}
.about-band-inner {
  max-width: 1100px; margin: 0 auto;
  display: grid; grid-template-columns: 1.2fr .85fr;
  gap: clamp(2rem, 5vw, 4rem); align-items: center;
}
.about-copy h2 {
  font-size: clamp(1.9rem, 3.5vw, 2.6rem);
  margin-bottom: 1rem; line-height: 1.15;
}
.about-copy > p {
  color: var(--ink-soft); font-size: 1.05rem; margin-bottom: 1.5rem;
  max-width: 48ch;
}
.check-list {
  list-style: none; display: flex; flex-direction: column; gap: .7rem;
}
.check-list li {
  position: relative; padding-left: 1.9rem; font-weight: 500; font-size: .95rem;
}
.check-list li::before {
  content: '';
  position: absolute; left: 0; top: .3rem;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--navy);
}
.check-list li::after {
  content: '';
  position: absolute; left: 5px; top: .5rem;
  width: 5px; height: 9px;
  border: solid #fff; border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.about-cta-card {
  background: var(--navy-deep);
  color: #e8e0d4;
  border-radius: var(--radius-lg);
  padding: 2.4rem 2rem;
  box-shadow: var(--shadow-lg);
  text-align: center;
  position: relative;
}
.about-mark {
  width: 48px; height: 48px; margin: 0 auto 1.2rem;
  opacity: .9;
}
.about-cta-card h3 {
  font-size: 1.55rem; color: #fff; margin-bottom: .6rem;
}
.about-cta-card p {
  color: #a89f90; margin-bottom: 1.5rem; font-size: .95rem;
}
.about-cta-card .btn-primary {
  background: var(--gold); color: var(--navy-deep);
}
.about-cta-card .btn-primary:hover {
  background: var(--gold-light);
}

/* ---------- Auth / forms ---------- */
.auth-card, .form-box {
  max-width: 420px; margin: 2.5rem auto;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 2.4rem 2rem;
  box-shadow: var(--shadow);
}
.auth-card h2, .form-box h1 {
  font-size: 1.9rem; text-align: center; margin-bottom: .35rem;
}
.auth-card .muted, .form-box .muted { text-align: center; margin-bottom: 1.6rem; }
.auth-card label, .form-group label {
  display: block; font-size: .82rem; font-weight: 600;
  margin-bottom: .3rem; color: var(--ink-soft);
}
.auth-card input, .form-group input,
.form-group select, .form-group textarea {
  width: 100%; border: 1.5px solid var(--line);
  border-radius: 10px; padding: .75rem 1rem;
  font: 400 .95rem var(--font-ui); background: var(--white);
  outline: none; margin-bottom: 1rem;
  transition: border-color .2s, box-shadow .2s;
}
.auth-card input:focus, .form-group input:focus,
.form-group select:focus, .form-group textarea:focus {
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(26, 44, 66, .1);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.alert, .form-error, .form-success {
  padding: .75rem 1rem; border-radius: 10px;
  margin-bottom: 1.2rem; font-size: .9rem;
}
.alert-error, .form-error {
  background: #fdf2f1; color: var(--danger); border: 1px solid #f0c8c4;
}
.form-success {
  background: #f0f7f3; color: var(--success); border: 1px solid #b8ddc8;
}

/* ---------- Cart ---------- */
.cart-list { display: flex; flex-direction: column; gap: 1rem; }
.cart-row {
  display: grid;
  grid-template-columns: 64px 1fr auto auto auto;
  gap: 1rem; align-items: center;
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1rem 1.15rem;
  transition: box-shadow .25s;
}
.cart-row:hover { box-shadow: var(--shadow); }
.cart-row img {
  width: 64px; height: 96px; object-fit: cover;
  border-radius: 6px;
}
.cart-row h3 { font-size: 1.05rem; font-family: var(--font-display); }
.cart-row input[type="number"] {
  width: 56px; padding: .4rem; border: 1px solid var(--line);
  border-radius: 6px; text-align: center;
}
.cart-summary {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.5rem;
  margin-top: 1.5rem; margin-left: auto; max-width: 340px;
  box-shadow: var(--shadow);
}
.cart-summary > div {
  display: flex; justify-content: space-between;
  margin-bottom: .5rem; font-size: .95rem;
}
.cart-summary .total {
  font-size: 1.35rem; font-weight: 700;
  font-family: var(--font-display);
  margin: .8rem 0 1.2rem; padding-top: .8rem;
  border-top: 1px solid var(--line);
}
.cart-summary .free { color: var(--success); }

/* ---------- Account tabs ---------- */
.tabs {
  display: flex; gap: .3rem; margin-bottom: 1.8rem;
  border-bottom: 2px solid var(--line); flex-wrap: wrap;
}
.tab {
  background: none; border: 0; cursor: pointer;
  padding: .7rem 1.15rem; font: 600 .9rem var(--font-ui);
  color: var(--ink-soft); border-bottom: 2.5px solid transparent;
  margin-bottom: -2px; transition: color .2s, border-color .2s;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--navy); border-bottom-color: var(--navy); }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--navy-deep);
  color: #9a9080;
  padding: 3.5rem clamp(1.2rem, 4vw, 2.5rem) 1.5rem;
  margin-top: 0;
}
.footer-top {
  max-width: 1200px; margin: 0 auto 2.5rem;
  display: grid; grid-template-columns: 1.3fr 2fr;
  gap: 3rem;
}
.footer-logo {
  display: inline-flex; align-items: center; gap: .55rem;
  margin-bottom: .9rem;
}
.footer-logo:hover { text-decoration: none; }
.footer-logo img { width: auto; height: 36px; }
.footer-logo .logo-word { color: #f0ebe3; font-size: 1.35rem; }
.footer-logo .logo-word em { color: var(--gold-light); }
.footer-brand p {
  font-size: .9rem; line-height: 1.65; max-width: 32ch; color: #7a7268;
}
.footer-cols {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem;
}
.site-footer h4 {
  color: #e8e0d4; font-size: .8rem; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
  margin-bottom: 1rem; font-family: var(--font-ui);
}
.site-footer ul { list-style: none; }
.site-footer li { margin-bottom: .4rem; }
.site-footer a {
  color: #8a8278; font-size: .9rem;
  transition: color .2s, padding-left .2s;
}
.site-footer a:hover { color: var(--gold-light); text-decoration: none; padding-left: 3px; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.06);
  padding-top: 1.3rem; text-align: center;
  font-size: .8rem; color: #6a635a;
  max-width: 1200px; margin: 0 auto;
}

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 28px; left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--navy-deep); color: #f0ebe3;
  padding: .85rem 1.5rem; border-radius: 999px;
  font-size: .9rem; font-weight: 600;
  box-shadow: 0 12px 40px rgba(0,0,0,.3);
  z-index: 300; opacity: 0; pointer-events: none;
  transition: transform .4s var(--ease-spring), opacity .35s;
}
.toast.show {
  opacity: 1; transform: translateX(-50%) translateY(0);
}

/* ---------- Social ---------- */
.social-login { margin-top: 1.4rem; }
.social-buttons { display: grid; gap: .6rem; }
.divider {
  display: flex; align-items: center; gap: 1rem;
  color: var(--ink-faint); font-size: .82rem; margin: 0 0 1rem;
}
.divider::before, .divider::after {
  content: ''; flex: 1; height: 1px; background: var(--line);
}
.btn-social {
  display: flex; align-items: center; justify-content: center; gap: .6rem;
  padding: .75rem 1rem; border-radius: 999px;
  border: 1.5px solid var(--line); background: var(--white);
  color: var(--ink); font-weight: 600; font-size: .9rem;
  transition: border-color .2s, transform .25s var(--ease), box-shadow .25s;
}
.btn-social:hover {
  text-decoration: none; transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0,0,0,.06);
}
.btn-google:hover { border-color: #4285F4; }
.btn-facebook { background: #1877F2; border-color: #1877F2; color: #fff; }
.btn-facebook:hover { background: #1663cf; }
.btn-apple { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-apple:hover { background: #000; }

/* ---------- Admin ---------- */
.admin-table {
  width: 100%; border-collapse: collapse;
  background: var(--white); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow);
}
.admin-table th, .admin-table td {
  padding: .8rem 1.1rem; text-align: left;
  border-bottom: 1px solid var(--line); font-size: .9rem;
}
.admin-table th {
  background: var(--cream-2); font-weight: 700; font-size: .78rem;
  text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft);
}
.stat-cards {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem; margin-bottom: 2rem;
}
.stat-card {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.2rem;
}
.stat-card .num {
  font-family: var(--font-display); font-size: 1.8rem;
  font-weight: 600; color: var(--navy);
}
.stat-card .label { font-size: .8rem; color: var(--ink-soft); }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .featured-grid {
    grid-template-columns: 1fr 1fr;
  }
  .about-band-inner { grid-template-columns: 1fr; }
  .footer-top { grid-template-columns: 1fr; gap: 2rem; }
}
@media (max-width: 800px) {
  .nav-toggle { display: flex; order: -1; }
  .main-nav {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    background: rgba(247, 244, 239, .98);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line);
    flex-direction: column; align-items: stretch;
    padding: .8rem 1rem 1rem; gap: .15rem;
    box-shadow: var(--shadow-lg); margin-left: 0;
  }
  .main-nav.open { display: flex; }
  .main-nav > a, .nav-drop-btn { padding: .7rem 1rem; }
  .nav-dropdown { width: 100%; }
  .nav-drop-menu {
    position: static; box-shadow: none; border: 0;
    background: var(--cream-2); margin-top: .3rem;
    display: none;
  }
  .nav-dropdown.open .nav-drop-menu { display: block; }
  .book-detail { grid-template-columns: 200px 1fr; }
}
@media (max-width: 620px) {
  .featured-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .featured-grid { grid-template-columns: 1fr; }
  .book-detail { grid-template-columns: 1fr; }
  .detail-cover { max-width: 220px; margin: 0 auto; }
  /* footer stays on 3 columns on phones: catalog · account · publisher */
  .footer-cols { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .9rem; }
  .site-footer h4 { font-size: .68rem; letter-spacing: .05em; margin-bottom: .75rem; overflow-wrap: anywhere; }
  .site-footer li { margin-bottom: .55rem; line-height: 1.35; }
  .site-footer .footer-cols a { font-size: .8rem; overflow-wrap: anywhere; }
  .site-footer .footer-cols a:hover { padding-left: 0; }
  .form-row { grid-template-columns: 1fr; }
  .cart-row {
    grid-template-columns: 52px 1fr auto;
  }
  .cart-row .price { grid-column: 2; }
  .cart-summary { margin-left: 0; max-width: none; }
  .hero-stats { gap: 1.5rem; }
}

/* ============================================================
   Language switcher
   ============================================================ */
.lang-switch {
  display: flex; align-items: center; gap: 0;
  border: 1px solid var(--line);
  border-radius: 999px; overflow: hidden;
  margin-right: .25rem;
}
.lang-switch a {
  font-size: .72rem; font-weight: 700; letter-spacing: .04em;
  padding: .35rem .55rem; color: var(--ink-soft);
  transition: background .2s, color .2s;
}
.lang-switch a:hover { color: var(--ink); text-decoration: none; background: var(--cream-2); }
.lang-switch a.active {
  background: var(--navy); color: #fff;
}

/* Theme toggle icons */
#themeToggle .icon-moon { display: none; }
#themeToggle .icon-sun { display: block; }
[data-theme="dark"] #themeToggle .icon-moon { display: block; }
[data-theme="dark"] #themeToggle .icon-sun { display: none; }

/* ============================================================
   DARK THEME
   ============================================================ */
[data-theme="dark"] {
  --cream:       #12161c;
  --cream-2:     #1a2029;
  --ink:         #e8e4dc;
  --ink-soft:    #a39e94;
  --ink-faint:   #6e6a62;
  --navy:        #c9a86c;
  --navy-deep:   #0a0e14;
  --gold:        #d4b88a;
  --gold-light:  #e8d4b0;
  --white:       #1a2029;
  --line:        #2a3140;
  --danger:      #e07068;
  --success:     #5cba8a;
  --shadow:      0 12px 40px rgba(0, 0, 0, .35);
  --shadow-lg:   0 28px 64px rgba(0, 0, 0, .45);
}

[data-theme="dark"] body {
  background: var(--cream);
  color: var(--ink);
}

[data-theme="dark"] .site-header {
  background: rgba(18, 22, 28, .88);
}
[data-theme="dark"] .site-header.scrolled {
  background: rgba(18, 22, 28, .96);
  border-bottom-color: var(--line);
  box-shadow: 0 6px 28px rgba(0, 0, 0, .4);
}

[data-theme="dark"] .logo-img {
  filter: brightness(1.15);
}

[data-theme="dark"] .main-nav > a:hover,
[data-theme="dark"] .nav-drop-btn:hover {
  background: var(--cream-2);
}
[data-theme="dark"] .main-nav > a.active {
  background: var(--cream-2);
  color: var(--gold);
}

[data-theme="dark"] .nav-drop-menu {
  background: #1a2029;
  border-color: var(--line);
}
[data-theme="dark"] .nav-drop-menu a:hover {
  background: #232a36;
  color: var(--gold);
}

[data-theme="dark"] .icon-btn:hover {
  background: var(--cream-2);
  color: var(--gold);
}

[data-theme="dark"] .lang-switch {
  border-color: var(--line);
}
[data-theme="dark"] .lang-switch a.active {
  background: var(--gold);
  color: #12161c;
}
[data-theme="dark"] .lang-switch a:hover {
  background: var(--cream-2);
  color: var(--ink);
}

[data-theme="dark"] .search-overlay {
  background: rgba(18, 22, 28, .98);
}
[data-theme="dark"] .search-overlay-form input {
  border-bottom-color: var(--gold);
  color: var(--ink);
}
[data-theme="dark"] .search-suggest {
  background: #1a2029;
  border-color: var(--line);
}
[data-theme="dark"] .search-suggest a:hover {
  background: #232a36;
}

[data-theme="dark"] .manifesto {
  background: #0a0e14;
  color: #a39e94;
}
[data-theme="dark"] .manifesto blockquote p {
  color: #e8e4dc;
}

[data-theme="dark"] .featured-card,
[data-theme="dark"] .domain-card,
[data-theme="dark"] .auth-card,
[data-theme="dark"] .form-box,
[data-theme="dark"] .cart-row,
[data-theme="dark"] .cart-summary,
[data-theme="dark"] .stat-card,
[data-theme="dark"] .empty {
  background: #1a2029;
  border-color: var(--line);
}

[data-theme="dark"] .book-cover {
  background: #232a36;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .4);
}
[data-theme="dark"] .book-card:hover .book-cover {
  box-shadow: 0 18px 44px rgba(0, 0, 0, .5);
}

[data-theme="dark"] .book-title a { color: var(--ink); }
[data-theme="dark"] .book-title a:hover { color: var(--gold); }
[data-theme="dark"] .price { color: var(--gold); }

[data-theme="dark"] .btn-primary {
  background: var(--gold);
  color: #12161c;
  box-shadow: 0 8px 24px rgba(201, 168, 108, .25);
}
[data-theme="dark"] .btn-primary:hover {
  background: var(--gold-light);
  color: #12161c;
}
[data-theme="dark"] .btn-ghost {
  color: var(--gold);
  border-color: rgba(201, 168, 108, .4);
}
[data-theme="dark"] .btn-ghost:hover {
  background: var(--gold);
  color: #12161c;
  border-color: var(--gold);
}
[data-theme="dark"] .btn-small {
  background: #2a3140;
  color: var(--ink);
}
[data-theme="dark"] .btn-small:hover {
  background: var(--gold);
  color: #12161c;
}

[data-theme="dark"] .link-arrow { color: var(--gold); }
[data-theme="dark"] .link-arrow:hover { color: var(--gold-light); }

[data-theme="dark"] .about-band {
  background: #0e1218;
}
[data-theme="dark"] .about-cta-card {
  background: #1a2029;
  border: 1px solid var(--line);
}
[data-theme="dark"] .about-cta-card .btn-primary {
  background: var(--gold);
  color: #12161c;
}
[data-theme="dark"] .check-list li::before {
  background: var(--gold);
}

[data-theme="dark"] .site-footer {
  background: #0a0e14;
}
[data-theme="dark"] .site-footer a:hover {
  color: var(--gold);
}

[data-theme="dark"] .auth-card input,
[data-theme="dark"] .form-group input,
[data-theme="dark"] .form-group select,
[data-theme="dark"] .form-group textarea,
[data-theme="dark"] .cart-row input[type="number"] {
  background: #12161c;
  border-color: var(--line);
  color: var(--ink);
}
[data-theme="dark"] .auth-card input:focus,
[data-theme="dark"] .form-group input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201, 168, 108, .15);
}

[data-theme="dark"] .tab.active {
  color: var(--gold);
  border-bottom-color: var(--gold);
}

[data-theme="dark"] .toast {
  background: #1a2029;
  color: var(--ink);
  border: 1px solid var(--line);
}

[data-theme="dark"] .count-pill {
  background: #232a36;
  color: var(--gold);
}

[data-theme="dark"] .detail-author { color: var(--gold); }
[data-theme="dark"] .admin-table {
  background: #1a2029;
}
[data-theme="dark"] .admin-table th {
  background: #232a36;
  color: var(--ink-soft);
}
[data-theme="dark"] .admin-table td {
  border-bottom-color: var(--line);
}

[data-theme="dark"] .btn-social {
  background: #1a2029;
  border-color: var(--line);
  color: var(--ink);
}
[data-theme="dark"] .btn-facebook { background: #1877F2; border-color: #1877F2; color: #fff; }
[data-theme="dark"] .btn-apple { background: #e8e4dc; border-color: #e8e4dc; color: #12161c; }

/* Smooth theme transition */
html { color-scheme: light; }
html[data-theme="dark"] { color-scheme: dark; }
body, .site-header, .featured-card, .domain-card, .book-cover,
.auth-card, .cart-row, .about-band, .site-footer {
  transition: background-color .35s ease, color .25s ease, border-color .35s ease, box-shadow .35s ease;
}

/* ============================================================
   Authors directory (index.php #autori) + author.php
   ============================================================ */
.az-nav {
  display: flex; flex-wrap: wrap; gap: .35rem;
  margin: -.6rem 0 2.2rem;
}
.az-nav a {
  min-width: 2.1rem; height: 2.1rem; padding: 0 .55rem;
  display: inline-flex; align-items: center; justify-content: center;
  font: 600 .85rem var(--font-ui);
  color: var(--navy); background: var(--white);
  border: 1px solid var(--line); border-radius: 999px;
  transition: background .25s, color .25s, border-color .25s, transform .3s var(--ease);
}
.az-nav a:hover {
  background: var(--navy); color: #fff; border-color: var(--navy);
  transform: translateY(-2px); text-decoration: none;
}

.author-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
  align-items: start;
}
.author-letter-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.4rem 1.4rem 1.3rem;
  scroll-margin-top: 90px;
  position: relative; overflow: hidden;
}
.author-letter-card::after {
  content: ''; position: absolute; left: 0; bottom: 0; height: 2.5px; width: 100%;
  background: var(--gold); opacity: .0; transition: opacity .3s;
}
.author-letter-card:hover::after { opacity: 1; }
.author-letter {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3.5vw, 2.5rem);
  font-weight: 600; line-height: .9;
  color: var(--gold);
  display: inline-block; position: relative;
  margin-bottom: 1.1rem;
}
.author-letter::after {
  content: ''; position: absolute; left: 0; right: -.4rem; bottom: -.45rem;
  height: 2.5px; background: var(--gold-light); opacity: .6; border-radius: 2px;
}
.author-list { list-style: none; display: flex; flex-direction: column; gap: .15rem; }
.author-list a {
  display: block; padding: .3rem 0;
  font-family: var(--font-display); font-size: 1.15rem; font-weight: 500;
  line-height: 1.3; color: var(--ink);
  transition: color .2s, transform .25s var(--ease);
}
.author-list a:hover { color: var(--gold); transform: translateX(4px); text-decoration: none; }
.author-sn { font-weight: 700; }

[data-theme="dark"] .az-nav a,
[data-theme="dark"] .author-letter-card {
  background: #1a2029; border-color: var(--line);
}
[data-theme="dark"] .az-nav a { color: var(--ink); }
[data-theme="dark"] .az-nav a:hover { background: var(--gold); color: #12161c; border-color: var(--gold); }

@media (max-width: 480px) {
  .author-cards { grid-template-columns: 1fr; }
}

/* ============================================================
   Static / legal pages (about.php, terms.php, privacy.php)
   Uses the site tokens, so light/dark follow [data-theme] automatically.
   ============================================================ */
.section-narrow { max-width: 900px; }

.static-page h1 {
  font-size: clamp(2.2rem, 5vw, 3.2rem);
  line-height: 1.1; margin: 0 0 .7rem;
}
.static-page .lead {
  font-size: 1.2rem; line-height: 1.55;
  color: var(--ink-soft); max-width: 60ch; margin: 0 0 2rem;
}
.static-page .meta {
  font-size: .9rem; color: var(--ink-faint); margin: 0 0 1.8rem;
}
.static-page h2 {
  font-size: clamp(1.45rem, 2.6vw, 1.8rem); line-height: 1.2;
  margin: 2.6rem 0 1rem; padding-bottom: .5rem;
  border-bottom: 1px solid var(--line);
  scroll-margin-top: 90px;
}
.static-page p { margin: 0 0 .9rem; }
.static-page ul { padding-left: 1.35rem; margin: .6rem 0 1rem; }
.static-page li { margin-bottom: .4rem; }
.static-page p a, .static-page li a {
  text-decoration: underline; text-underline-offset: 2px;
}

/* long legal text (terms article, privacy body) */
.legal-text h2 { font-size: 1.35rem; margin-top: 2.2rem; }

/* card grid (about) */
.info-grid {
  display: grid; gap: 1rem; margin-top: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.info-card {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.25rem 1.4rem;
  transition: transform .3s var(--ease), box-shadow .3s, border-color .25s;
}
.info-card:hover {
  transform: translateY(-3px); box-shadow: var(--shadow);
  border-color: rgba(184, 149, 90, .4);
}
.info-card h3 { font-size: 1.35rem; margin: 0 0 .3rem; color: var(--ink); }
.info-card p { margin: 0; color: var(--ink-soft); font-size: .95rem; }

/* table of contents (terms) */
.toc-box {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.1rem 1.5rem;
  margin-bottom: .5rem; font-size: .93rem; color: var(--ink);
}
.toc-box strong {
  display: block; margin-bottom: .4rem;
  font-family: var(--font-display); font-size: 1.25rem; font-weight: 600;
}
.toc-box ol { padding-left: 1.3rem; columns: 2 260px; column-gap: 2rem; }
.toc-box li { margin-bottom: .25rem; }
.toc-box a { text-decoration: none; }
.toc-box a:hover { text-decoration: underline; }

.static-actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 2.2rem; }

/* ============================================================
   Cookie banner + cookie policy page
   ============================================================ */
.cookie-banner {
  position: fixed; z-index: 250;
  left: 50%; bottom: max(1rem, env(safe-area-inset-bottom));
  width: min(780px, calc(100% - 2rem));
  display: flex; align-items: center; gap: 1.2rem 1.6rem;
  background: var(--white); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 1.1rem 1.4rem;
  opacity: 0; transform: translate(-50%, 24px);
  transition: opacity .4s var(--ease), transform .5s var(--ease);
}
.cookie-banner[hidden] { display: none; }
.cookie-banner.show { opacity: 1; transform: translate(-50%, 0); }
.cookie-banner::before {
  content: ''; position: absolute; left: 1.4rem; right: 1.4rem; top: -1px; height: 2.5px;
  background: var(--gold); border-radius: 0 0 3px 3px;
}
.cookie-banner-body { flex: 1; min-width: 0; }
.cookie-banner h2 { font-size: 1.3rem; line-height: 1.2; margin-bottom: .2rem; }
.cookie-banner p { font-size: .88rem; line-height: 1.5; color: var(--ink-soft); }
.cookie-banner p a { text-decoration: underline; text-underline-offset: 2px; white-space: nowrap; }
.cookie-banner-actions { display: flex; gap: .6rem; flex-shrink: 0; }
.cookie-banner .btn { padding: .65rem 1.2rem; font-size: .85rem; white-space: nowrap; }

@media (max-width: 620px) {
  .cookie-banner { flex-direction: column; align-items: stretch; padding: 1rem 1.1rem; }
  .cookie-banner-actions { flex-direction: column-reverse; }
  .cookie-banner .btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .cookie-banner { transition: opacity .01s; transform: translate(-50%, 0); }
}

/* footer "Cookie settings" button */
.link-btn {
  background: none; border: 0; padding: 0; cursor: pointer;
  font: inherit; color: inherit; text-decoration: underline; text-underline-offset: 2px;
  transition: color .2s;
}
.link-btn:hover { color: var(--gold-light); }

/* cookie policy: table + preferences */
.table-wrap {
  overflow-x: auto; margin: 1rem 0 1.4rem;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--white);
}
.cookie-table { width: 100%; border-collapse: collapse; font-size: .92rem; min-width: 560px; }
.cookie-table th, .cookie-table td {
  text-align: left; vertical-align: top; padding: .8rem 1rem;
  border-bottom: 1px solid var(--line);
}
.cookie-table th {
  font-size: .7rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--gold); background: var(--cream-2);
}
.cookie-table tr:last-child td { border-bottom: 0; }
.cookie-table td:first-child { white-space: nowrap; }
.legal-text code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .85em; background: var(--cream-2); color: var(--ink);
  padding: .1rem .4rem; border-radius: 6px;
}
.cookie-prefs {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.1rem 1.4rem; margin: 1rem 0 1.4rem;
}
.cookie-prefs p { margin: 0; }
.cookie-prefs .static-actions { margin-top: .9rem; }

/* ============================================================
   Hero — compact on phones so the whole first screen fits the viewport
   ============================================================ */
@media (max-width: 600px) {
  .hero { padding: 1rem 1.1rem; min-height: calc(100vh - 4rem); min-height: calc(100svh - 4rem); }
  .hero-logo { width: auto; height: clamp(72px, 15svh, 110px); margin-bottom: .8rem; }
  .hero h1 { font-size: clamp(1.55rem, 7vw, 2rem); line-height: 1.1; }
  .hero-sub { font-size: .86rem; line-height: 1.5; margin: .6rem auto 1.1rem; }
  .hero-search-form { padding: .2rem 1rem .2rem 1rem; gap: .5rem; }
  .hero-search-form input { font-size: .95rem; padding: .6rem .1rem; }
  .hero-search-icon { width: 18px; height: 18px; }
  .hero-cta { gap: .6rem; margin-top: 1.1rem; flex-wrap: nowrap; width: 100%; }
  .hero-cta .btn { flex: 1 1 0; min-width: 0; padding: .65rem .6rem; font-size: .78rem; text-align: center; }
  .hero-stats { margin-top: 1.3rem; gap: .5rem 1.2rem; flex-wrap: nowrap; justify-content: space-between; width: 100%; }
  .hero-stats strong { font-size: 1.2rem; }
  .hero-stats span { font-size: .62rem; letter-spacing: .02em; display: block; line-height: 1.25; }
  .hero-result img { width: 32px; height: 46px; }
  .hero-result { padding: .45rem .75rem; gap: .7rem; }
  .hero-result-text strong { font-size: .95rem; }
}
/* very short phones (e.g. landscape / small SE): squeeze a little more */
@media (max-width: 600px) and (max-height: 640px) {
  .hero-logo { height: 64px; margin-bottom: .5rem; }
  .hero-sub { margin: .4rem auto .8rem; font-size: .8rem; }
  .hero-cta { margin-top: .8rem; }
  .hero-stats { margin-top: .9rem; }
}

/* ============================================================
   Mobile: keep the page inside the viewport width
   (header was ~416px wide: menu + logo + language + 4 icon buttons)
   ============================================================ */
html, body { max-width: 100%; overflow-x: clip; }
@media (max-width: 600px) {
  .header-inner { gap: .3rem; padding: .55rem .7rem; }
  .logo-img { height: 34px; }
  .nav-toggle { padding: .3rem; }
  .nav-toggle span { width: 20px; }
  .header-actions { gap: .05rem; min-width: 0; }
  .header-actions .icon-btn { width: 34px; height: 34px; }
  .header-actions .icon-btn svg { width: 18px; height: 18px; }
  .lang-switch { margin-right: .15rem; }
  .lang-switch a { font-size: .66rem; padding: .3rem .42rem; }
  .cart-badge { top: 0; right: 0; min-width: 15px; height: 15px; font-size: .58rem; }
}
@media (max-width: 360px) {
  .header-inner { gap: .15rem; padding: .5rem .45rem; }
  .logo-img { height: 30px; }
  .header-actions .icon-btn { width: 30px; height: 30px; }
  .header-actions .icon-btn svg { width: 16px; height: 16px; }
}

/* Mobile hero: more breathing room between rows, scaled to the screen height */
@media (max-width: 600px) {
  .hero-logo  { margin-bottom: clamp(.9rem, 3svh, 1.8rem); }
  .hero-sub   { margin: clamp(.8rem, 2.4svh, 1.4rem) auto clamp(1.4rem, 4svh, 2.4rem); }
  .hero-cta   { margin-top: clamp(1.2rem, 3.6svh, 2.2rem); }
  .hero-stats { margin-top: clamp(1.6rem, 5svh, 3.2rem); }
}
@media (max-width: 600px) and (max-height: 640px) {
  .hero-logo  { margin-bottom: .7rem; }
  .hero-sub   { margin: .6rem auto 1rem; }
  .hero-cta   { margin-top: 1rem; }
  .hero-stats { margin-top: 1.2rem; }
}
