@import url("https://fonts.googleapis.com/css2?family=Roboto+Serif:opsz,wght@8..144,500&display=swap");

:root {
  --ink: #172132;
  --navy: #14243a;
  --blue: #315b7c;
  --cream: #f3efe5;
  --paper: #fffefb;
  --gold: #bd8a42;
  --muted: #697180;
  --line: rgba(23, 33, 50, 0.14);
  font-family: "Roboto Serif", Georgia, serif;
  font-weight: 500;
  color: var(--ink);
  background: var(--cream);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; }
a { color: inherit; }
button, input { font: inherit; }

.site-header {
  height: 76px;
  padding: 0 clamp(22px, 5vw, 76px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: rgba(243, 239, 229, 0.92);
}

/* Shared navigation from erginbayrak.com */
.main-site-header {
  height: 56px;
  padding: 0 27px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  color: white;
  background: #a40000;
  box-shadow: 0 2px 5px rgba(0,0,0,.22);
  position: relative;
  z-index: 20;
  font-family: "Roboto Serif", Georgia, serif;
}

.site-owner {
  flex: 0 0 auto;
  color: white;
  text-decoration: none;
  font-size: 19px;
  font-weight: 400;
}

.main-site-nav {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(18px, 1.65vw, 31px);
  white-space: nowrap;
}

.main-site-nav a {
  color: white;
  text-decoration: none;
  font-size: 15px;
  line-height: 56px;
}

.main-site-nav a:hover,
.main-site-nav a:focus-visible { text-decoration: underline; text-underline-offset: 4px; }
.main-site-nav .is-current { font-weight: 700; }
.main-site-nav .site-search { font-size: 25px; line-height: 1; transform: rotate(-20deg); }

@media (max-width: 1180px) and (min-width: 851px) {
  .main-site-header { padding-inline: 18px; gap: 16px; }
  .main-site-nav { gap: 13px; }
  .main-site-nav a { font-size: 13px; }
  .site-owner { font-size: 17px; }
}

.brand, .reader-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; font-weight: 650; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; background: var(--navy); color: white; font-family: "Roboto Serif", Georgia, serif; font-size: 13px; letter-spacing: .08em; }
.header-link, .text-link { color: var(--blue); font-size: 14px; font-weight: 700; text-underline-offset: 5px; }

.hero {
  min-height: 570px;
  padding: 96px clamp(24px, 9vw, 150px) 110px;
  background:
    linear-gradient(rgba(10,15,22,.57), rgba(10,15,22,.57)),
    url("/images/ITTB.jpg") center center / cover no-repeat;
  border-bottom: 1px solid var(--line);
  color: white;
}

.eyebrow { margin: 0 0 18px; color: var(--gold); font-size: 12px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; }
.hero h1 { max-width: 940px; margin: 0; color: white; font: 500 clamp(48px, 7vw, 92px)/1.05 "Roboto Serif", Georgia, serif; letter-spacing: 0; text-shadow: 0 2px 12px rgba(0,0,0,.7); }
.hero h1 em { color: #f2d494; font-weight: 500; }
.hero-copy { max-width: 650px; margin: 34px 0; color: rgba(255,255,255,.92); font: 500 19px/1.65 "Roboto Serif", Georgia, serif; text-shadow: 0 1px 5px rgba(0,0,0,.8); }
.primary-button { display: inline-flex; gap: 25px; padding: 15px 20px; background: #a40000; color: white; text-decoration: none; font-size: 14px; font-weight: 750; box-shadow: 0 2px 8px rgba(0,0,0,.3); }

.catalog { padding: 100px clamp(24px, 7vw, 110px) 120px; background: #faf9f5; }
.section-heading { margin-bottom: 48px; }
.section-heading h2 { margin: 0; font: 500 clamp(35px, 4vw, 53px)/1.1 "Roboto Serif", Georgia, serif; }
.book-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(25px, 3vw, 48px); }
.book-card { min-width: 0; }
.cover-link, .placeholder-cover { display: block; position: relative; aspect-ratio: 8.5 / 11; box-shadow: 0 15px 35px rgba(20,36,58,.14); overflow: hidden; }
.cover-link img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s ease, filter .4s ease; }
.cover-link:hover img { transform: scale(1.015); filter: brightness(.72); }
.open-label { position: absolute; inset: auto 22px 22px; padding: 12px 16px; text-align: center; background: white; color: var(--navy); font-size: 13px; font-weight: 800; opacity: 0; transform: translateY(8px); transition: .3s ease; }
.cover-link:hover .open-label, .cover-link:focus-visible .open-label { opacity: 1; transform: none; }
.placeholder-cover { padding: 42px 35px; display: flex; flex-direction: column; justify-content: space-between; color: var(--navy); background: #e7e0cf; border-left: 8px solid #d0c5ae; }
.placeholder-cover--dark { color: white; background: var(--navy); border-left-color: #0b1727; }
.placeholder-series { font: 500 16px/1.35 "Roboto Serif", Georgia, serif; }
.placeholder-cover strong { font: 500 clamp(27px, 3vw, 43px)/1.05 "Roboto Serif", Georgia, serif; }
.roman { align-self: flex-end; font: 500 70px/1 "Roboto Serif", Georgia, serif; opacity: .18; }
.book-details { padding: 25px 3px 0; }
.volume-number { margin: 0 0 9px !important; color: var(--gold) !important; font-size: 11px !important; font-weight: 850; letter-spacing: .15em; text-transform: uppercase; }
.book-details h3 { margin: 0 0 12px; font: 500 26px/1.15 "Roboto Serif", Georgia, serif; }
.book-details p { min-height: 66px; margin: 0 0 17px; color: var(--muted); font-size: 14px; line-height: 1.55; }
.status-label { color: #8a8f97; font-size: 13px; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; }
footer { display: flex; justify-content: space-between; padding: 28px clamp(24px, 7vw, 110px); background: var(--navy); color: rgba(255,255,255,.68); font-size: 12px; }

.micro-hero h1 { font-size: clamp(42px, 6vw, 78px); }
.micro-catalog { min-height: 560px; }
.single-book-grid { grid-template-columns: minmax(0, 300px); justify-content: center; }
.single-book-grid .book-details { text-align: center; }
.single-book-grid .book-details p { min-height: 0; }
.micro-cover-link { aspect-ratio: 1448 / 2048; background: #315b7c; }
.micro-cover-link img { object-fit: contain; }

/* Compact desktop landing page: keep the introduction and volumes visible
   together on an ordinary laptop display. */
@media (min-width: 851px) {
  .site-header {
    height: 58px;
    padding-inline: clamp(22px, 4vw, 64px);
  }

  .brand-mark { width: 32px; height: 32px; font-size: 11px; }

  .hero {
    min-height: 285px;
    padding: 34px clamp(30px, 7vw, 115px) 38px;
    background-size: cover;
    background-position: center center;
    position: relative;
    display: block;
    text-align: center;
  }

  .hero h1 {
    position: absolute;
    top: 50%;
    left: 50%;
    width: min(92%, 1400px);
    max-width: none;
    transform: translate(-50%, -50%);
    font-size: 48px;
  }

  .hero-copy {
    position: absolute;
    top: calc(50% + 48px);
    left: 50%;
    width: min(88%, 760px);
    max-width: none;
    margin: 0;
    transform: translateX(-50%);
    color: #f2d494;
    font-size: 16px;
    line-height: 1.4;
  }

  .catalog { padding: 30px clamp(30px, 6vw, 96px) 36px; }
  .section-heading { max-width: 850px; margin: 0 auto 20px; }
  .section-heading .eyebrow { margin-bottom: 8px; }
  .section-heading h2 { font-size: 34px; }

  .book-grid {
    max-width: 850px;
    margin-inline: auto;
    gap: 30px;
  }

  .cover-link, .placeholder-cover { max-height: 330px; }
  .placeholder-cover { padding: 24px 22px; border-left-width: 6px; }
  .placeholder-series { font-size: 12px; }
  .placeholder-cover strong { font-size: 25px; }
  .roman { font-size: 48px; }

  .book-details { padding-top: 14px; }
  .volume-number { margin-bottom: 5px !important; }
  .book-details h3 { margin-bottom: 7px; font-size: 20px; }
  .book-details p { min-height: 44px; margin-bottom: 9px; font-size: 12px; line-height: 1.4; }

  footer { padding: 17px clamp(30px, 6vw, 96px); }
}

/* Reader */
.reader-page { height: 100vh; overflow: hidden; background: #d8d3c7; }
.reader-header { height: 64px; padding: 0 clamp(14px, 2.5vw, 36px); display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; background: var(--navy); color: white; box-shadow: 0 2px 14px rgba(0,0,0,.2); position: relative; z-index: 10; }
.reader-brand { justify-self: start; font-size: 13px; color: rgba(255,255,255,.8); }
.reader-brand-short { display: none; }
.reader-title { text-align: center; }
.reader-title span { display: block; color: #d8b271; font-size: 9px; font-weight: 800; letter-spacing: .17em; text-transform: uppercase; }
.reader-title strong { font: 500 17px "Roboto Serif", Georgia, serif; }
.reader-actions { justify-self: end; display: flex; gap: 5px; }
.icon-button { width: 38px; height: 38px; display: grid; place-items: center; border: 0; border-radius: 3px; background: transparent; color: white; text-decoration: none; cursor: pointer; font-size: 20px; }
.icon-button:hover, .icon-button:focus-visible { background: rgba(255,255,255,.12); }
.reader-main { height: calc(100vh - 108px); display: grid; place-items: center; padding: clamp(12px, 2vw, 28px) clamp(46px, 6vw, 90px); }
.loading-panel, .error-panel { text-align: center; }
.loading-mark { margin: 0 auto 18px; width: 56px; height: 56px; display: grid; place-items: center; background: var(--navy); color: white; font: 500 15px "Roboto Serif", Georgia, serif; animation: pulse 1.4s ease-in-out infinite; }
.loading-panel p { color: #5b5c59; }
@keyframes pulse { 50% { transform: scale(.94); opacity: .72; } }
.book-stage { width: min(100%, 1240px); height: 100%; position: relative; display: grid; place-items: center; }
.book { height: 100%; max-width: 100%; aspect-ratio: 17 / 11; display: grid; grid-template-columns: 1fr 1fr; position: relative; perspective: 2200px; filter: drop-shadow(0 22px 22px rgba(31,33,36,.22)); }
.book.cover-mode { aspect-ratio: 8.5 / 11; grid-template-columns: 1fr; }
.micro-reader-page .book { aspect-ratio: 1.414 / 1; }
.micro-reader-page .book.cover-mode { aspect-ratio: .707 / 1; }
.book.cover-mode .page--left, .book.cover-mode .book-gutter { display: none; }
.page { position: relative; min-width: 0; min-height: 0; background: var(--paper); overflow: hidden; backface-visibility: hidden; transform-style: preserve-3d; }
.page--left { transform-origin: right center; border-radius: 3px 0 0 3px; }
.page--right { transform-origin: left center; border-radius: 0 3px 3px 0; }
.page canvas { display: block; width: 100%; height: 100%; object-fit: contain; background: white; }
.page.is-empty { background: transparent; box-shadow: none; }
.page.is-empty canvas { display: none; }
.book-gutter { position: absolute; z-index: 3; left: 50%; top: 0; bottom: 0; width: 20px; transform: translateX(-50%); pointer-events: none; background: linear-gradient(90deg, rgba(0,0,0,.12), transparent 42%, rgba(0,0,0,.1)); opacity: .5; }
.page-label { position: absolute; bottom: 7px; color: rgba(20,36,58,.42); font-size: 10px; }
.page--left .page-label { left: 12px; }
.page--right .page-label { right: 12px; }
.book.turn-next .page--right { animation: turnNext .42s ease-in-out; z-index: 4; }
.book.turn-previous .page--left { animation: turnPrevious .42s ease-in-out; z-index: 4; }
@keyframes turnNext { 0% { transform: rotateY(0); } 50% { transform: rotateY(-82deg); filter: brightness(.72); } 51% { transform: rotateY(82deg); } 100% { transform: rotateY(0); } }
@keyframes turnPrevious { 0% { transform: rotateY(0); } 50% { transform: rotateY(82deg); filter: brightness(.72); } 51% { transform: rotateY(-82deg); } 100% { transform: rotateY(0); } }
.edge-control { position: absolute; z-index: 5; top: 50%; width: 44px; height: 76px; transform: translateY(-50%); border: 0; border-radius: 4px; background: rgba(20,36,58,.82); color: white; cursor: pointer; }
.edge-control span { font: 500 38px/1 "Roboto Serif", Georgia, serif; }
.edge-control--previous { right: calc(100% + 15px); }
.edge-control--next { left: calc(100% + 15px); }
.edge-control:disabled { opacity: .22; cursor: default; }
.reader-toolbar { height: 52px; display: flex; align-items: center; justify-content: center; gap: 17px; background: rgba(247,245,239,.97); border-top: 1px solid rgba(0,0,0,.12); }
.reader-toolbar button { border: 0; background: transparent; color: var(--navy); cursor: pointer; font-size: 19px; }
.reader-toolbar button:disabled { opacity: .25; cursor: default; }
.reader-toolbar .toolbar-divider { width: 1px; height: 22px; background: rgba(20,36,58,.2); }
.reader-toolbar .toolbar-action { color: var(--navy); text-decoration: none; font-size: 19px; line-height: 1; }
.reader-toolbar form { display: flex; align-items: center; gap: 7px; color: #64676b; font-size: 12px; }
.reader-toolbar input { width: 50px; padding: 5px 4px; border: 1px solid #c8c6be; border-radius: 3px; text-align: center; background: white; color: var(--ink); }
.error-panel { max-width: 480px; padding: 40px; background: white; }
.error-panel h1 { font: 500 28px "Roboto Serif", Georgia, serif; }

@media (max-width: 850px) {
  .main-site-header { padding-inline: 18px; gap: 22px; }
  .main-site-nav { overflow-x: auto; justify-content: flex-start; gap: 20px; scrollbar-width: none; }
  .main-site-nav::-webkit-scrollbar { display: none; }
  .main-site-nav a { font-size: 14px; }
  .book-grid { grid-template-columns: 1fr; gap: 60px; }
  .book-card { display: grid; grid-template-columns: minmax(190px, 42%) 1fr; gap: 28px; }
  .book-details p { min-height: 0; }
  .reader-main { padding-inline: 51px; }
  .book, .book.cover-mode { aspect-ratio: 8.5 / 11; grid-template-columns: 1fr; }
  .book .page--left, .book .book-gutter { display: none; }
  .edge-control--previous { right: calc(100% + 7px); }
  .edge-control--next { left: calc(100% + 7px); }
}

@media (max-width: 600px) {
  .main-site-header { height: 54px; padding-inline: 15px; }
  .site-owner { font-size: 16px; }
  .main-site-nav { gap: 16px; }
  .main-site-nav a { line-height: 54px; }
  .site-header { height: 64px; }
  .brand span:last-child { display: none; }
  .hero { min-height: 360px; padding: 48px 26px; background-position: 55% center; background-size: cover; display: flex; flex-direction: column; align-items: center; justify-content: center; }
  .hero h1 { font-size: clamp(43px, 13vw, 66px); }
  .hero-copy { margin: 20px 0 0; color: #f2d494; }
  .hero-copy { font-size: 17px; }
  .micro-hero h1 { font-size: clamp(38px, 11vw, 58px); }
  .catalog { padding-top: 72px; }
  .book-card { display: block; max-width: 390px; margin-inline: auto; }
  .book-details { padding-top: 20px; }
  footer { display: block; text-align: center; }
  .reader-header { grid-template-columns: auto 1fr auto; }
  .reader-brand-long { display: none; }
  .reader-brand-short { display: inline; }
  .reader-title strong { font-size: 14px; }
  .reader-title span { display: none; }
  .download-link { display: none; }
  .reader-main { height: calc(100vh - 106px); padding: 10px 40px; }
  .edge-control { width: 34px; height: 60px; background: rgba(20,36,58,.72); }
  .edge-control--previous { right: calc(100% + 3px); }
  .edge-control--next { left: calc(100% + 3px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
