/* Causewaybay Books — a Prague antikvariát on the web.
   Palette: walnut night, aged paper, brass foil, leather bindings. */

:root {
  --night: #120c08;
  --wood: #241610;
  --wood-frame: #1a0f09;
  --plank: #3b2515;
  --plank-lit: #5a3820;
  --paper: #efdfbd;
  --paper-shadow: #d8c49c;
  --ink: #2a1e14;
  --faint: #8a7358;
  --brass: #c9a961;
  --brass-bright: #e8ce93;
  --display: "IM Fell English", "Iowan Old Style", Georgia, serif;
  --body: "Spectral", Georgia, "Times New Roman", serif;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--night);
  color: var(--paper);
  font-family: var(--body);
  font-weight: 300;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: clip;
}

::selection { background: var(--brass); color: var(--night); }

a:focus-visible {
  outline: 2px dashed var(--brass);
  outline-offset: 4px;
}

/* ---------- Hero: the shop window ---------- */

.hero {
  position: relative;
  min-height: clamp(540px, 74vh, 900px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background:
    url("assets/hero.jpg") center 38% / cover no-repeat,
    radial-gradient(ellipse at 50% 30%, #3a2412 0%, var(--night) 75%);
  isolation: isolate;
}

.lang-nav {
  position: absolute;
  top: 18px;
  right: 22px;
  z-index: 2;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 2px 8px;
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.06em;
}

.lang-nav a {
  color: var(--paper-shadow);
  text-decoration: none;
  padding: 3px 2px;
  border-bottom: 1px solid transparent;
  transition: color 0.25s, border-color 0.25s;
}

.lang-nav a:hover { color: var(--brass-bright); }

.lang-now {
  color: var(--brass-bright);
  padding: 3px 2px;
  border-bottom: 1px solid var(--brass);
}

.lang-dot { color: var(--faint); }

.hero-scrim {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(to bottom, rgba(18, 12, 8, 0.35) 0%, rgba(18, 12, 8, 0.05) 35%, rgba(18, 12, 8, 0.55) 72%, var(--night) 100%),
    radial-gradient(ellipse at center, transparent 40%, rgba(10, 6, 3, 0.5) 100%);
}

.hero-inner {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 0 24px 9vh;
  max-width: 60rem;
}

.eyebrow {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--brass);
  text-indent: 0.42em; /* balance the trailing letter-space */
  animation: settle 0.9s ease-out both;
}

.shop-name {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(3rem, 8.5vw, 6rem);
  line-height: 1.02;
  margin-top: 0.35em;
  color: var(--paper);
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.65);
  animation: settle 0.9s 0.12s ease-out both;
}

.hero-sub {
  margin-top: 0.9em;
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--paper-shadow);
  animation: settle 0.9s 0.24s ease-out both;
}

.hero-sub em { font-family: var(--display); color: var(--brass-bright); }

.hero-rule {
  margin-top: 1.6em;
  color: var(--brass);
  font-size: 1.1rem;
  animation: settle 0.9s 0.36s ease-out both;
}

.hero-rule::before,
.hero-rule::after {
  content: "";
  display: inline-block;
  vertical-align: middle;
  width: clamp(48px, 10vw, 120px);
  height: 1px;
  background: linear-gradient(to right, transparent, var(--brass));
  margin: 0 14px;
}
.hero-rule::after { background: linear-gradient(to left, transparent, var(--brass)); }

@keyframes settle {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

/* ---------- The bookcase ---------- */

main { padding: 5rem 24px 3rem; }

.case {
  max-width: 1080px;
  margin: 0 auto;
  background:
    linear-gradient(to right, rgba(0, 0, 0, 0.28), transparent 12%, transparent 88%, rgba(0, 0, 0, 0.28)),
    linear-gradient(175deg, #2b1a10, var(--wood) 40%, #1f130c);
  border: 12px solid var(--wood-frame);
  border-radius: 4px;
  box-shadow:
    inset 0 0 60px rgba(0, 0, 0, 0.55),
    0 30px 80px rgba(0, 0, 0, 0.6);
  padding: clamp(20px, 4vw, 48px) clamp(16px, 4vw, 52px) clamp(28px, 4vw, 56px);
  animation: settle 1s 0.3s ease-out both;
}

.case-note {
  text-align: center;
  font-style: italic;
  color: var(--faint);
  font-size: 0.95rem;
  margin-bottom: 2.4rem;
}

/* ---------- One shelf ---------- */

.shelf {
  position: relative;
  margin-bottom: 5.6rem;
}

.shelf:last-of-type { margin-bottom: 1rem; }

.plaque {
  display: inline-block;
  font-family: var(--body);
  font-weight: 500;
  font-size: 0.7rem;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: #3a2a12;
  background: linear-gradient(170deg, var(--brass-bright), var(--brass) 55%, #a4823e);
  border: 1px solid #7c6230;
  border-radius: 2px;
  padding: 0.45em 1.1em 0.4em 1.3em;
  box-shadow:
    inset 0 1px 0 rgba(255, 248, 220, 0.6),
    0 2px 6px rgba(0, 0, 0, 0.5);
  text-shadow: 0 1px 0 rgba(255, 246, 214, 0.45);
  margin-bottom: 1.8rem;
}

.row {
  display: flex;
  align-items: flex-end;
  gap: 7px;
  padding: 0 clamp(8px, 3vw, 36px);
  min-height: 285px;
  perspective: 1600px;
  perspective-origin: 50% 30%;
}

.plank {
  height: 15px;
  border-radius: 2px;
  background: linear-gradient(to bottom, var(--plank-lit), var(--plank) 45%, #2a1809);
  box-shadow:
    0 1px 0 rgba(255, 220, 160, 0.12) inset,
    0 10px 22px rgba(0, 0, 0, 0.65);
}

/* Decorative pile of lying books at the shelf's far end */
.pile {
  margin-left: auto;
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: 1px;
  padding-bottom: 1px;
}

.pile i {
  display: block;
  width: var(--pw);
  height: 15px;
  border-radius: 2px 3px 3px 2px;
  background:
    linear-gradient(to bottom, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.02) 40%, rgba(0, 0, 0, 0.35)),
    var(--pl);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

.pile i:nth-child(2) { transform: translateX(-7px) rotate(-0.6deg); }
.pile i:nth-child(3) { transform: translateX(5px) rotate(0.5deg); }

/* ---------- One book ---------- */

.book {
  position: relative;
  display: block;
  width: var(--w);
  height: var(--h);
  text-decoration: none;
  flex: none;
  z-index: 1;
}

.book:hover, .book:focus-visible { z-index: 6; }

.volume {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transform: rotate(var(--lean));
  transition: transform 0.55s cubic-bezier(0.2, 0.9, 0.25, 1.1);
  will-change: transform;
}

.book:hover .volume,
.book:focus-visible .volume {
  transform: translateY(-20px) rotateY(-76deg);
}

/* ground shadow under each book */
.book::after {
  content: "";
  position: absolute;
  left: -12%;
  right: -12%;
  bottom: -4px;
  height: 10px;
  background: radial-gradient(ellipse, rgba(0, 0, 0, 0.55), transparent 70%);
  transition: opacity 0.5s, transform 0.5s;
}

.book:hover::after, .book:focus-visible::after {
  transform: scaleX(2.6);
  opacity: 0.8;
}

/* Spine — front face of the closed book */
.spine {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  background:
    linear-gradient(to right, rgba(0, 0, 0, 0.42), rgba(255, 255, 255, 0.1) 18%, rgba(255, 255, 255, 0.02) 45%, rgba(0, 0, 0, 0.34)),
    var(--leather);
  border-radius: 3px 3px 2px 2px;
  box-shadow: inset 0 -6px 12px rgba(0, 0, 0, 0.35);
  backface-visibility: hidden;
}

.band {
  width: 78%;
  border-top: 1px solid var(--foil);
  border-bottom: 1px solid var(--foil);
  height: 5px;
  opacity: 0.9;
}

.band-top { margin-top: 14px; }
.band-bottom { margin-top: auto; margin-bottom: 14px; }

.spine-title {
  writing-mode: vertical-rl;
  font-family: var(--display);
  font-size: 0.92rem;
  letter-spacing: 0.06em;
  color: var(--foil);
  max-height: calc(var(--h) - 110px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 16px;
  text-shadow: 0 0 6px rgba(0, 0, 0, 0.4);
}

.spine-orn {
  margin-top: auto;
  color: var(--foil);
  font-size: 0.7rem;
  opacity: 0.85;
  padding-top: 6px;
}

/* Cover — hinged on the spine's right edge, swings out on hover */
.cover {
  position: absolute;
  top: 0;
  left: 100%;
  width: 192px;
  height: 100%;
  transform-origin: left center;
  transform: rotateY(90deg);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 18px 16px;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(255, 255, 255, 0.09), transparent 60%),
    linear-gradient(to right, rgba(0, 0, 0, 0.3), transparent 12%),
    var(--leather);
  border-radius: 0 4px 4px 0;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.25);
}

/* gold double frame stamped into the cover */
.cover::before {
  content: "";
  position: absolute;
  inset: 9px;
  border: 1px solid var(--foil);
  outline: 1px solid var(--foil);
  outline-offset: 3px;
  opacity: 0.75;
  pointer-events: none;
  border-radius: 1px;
}

.cover-press {
  font-size: 0.52rem;
  font-weight: 500;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--foil);
  opacity: 0.85;
  margin-top: 8px;
}

.cover-title {
  font-family: var(--display);
  font-size: 1.18rem;
  line-height: 1.18;
  color: var(--foil);
  margin-top: auto;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

.cover-sub {
  font-style: italic;
  font-size: 0.68rem;
  color: var(--foil);
  opacity: 0.8;
  margin-top: 0.6em;
  line-height: 1.35;
}

.cover-orn { color: var(--foil); font-size: 0.85rem; margin-top: auto; opacity: 0.9; }

.cover-author {
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--foil);
  opacity: 0.75;
  margin-top: 0.9em;
  margin-bottom: 6px;
}

/* ---------- Paper tag that slides out below ---------- */

.tag {
  position: absolute;
  top: calc(100% + 30px);
  left: 50%;
  width: 240px;
  transform: translate(-50%, 10px) rotate(-1.4deg);
  background: linear-gradient(178deg, var(--paper), var(--paper-shadow));
  color: var(--ink);
  padding: 14px 16px 12px;
  border-radius: 2px;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.35s ease;
  z-index: 7;
}

/* punched hole + string suggestion */
.tag::before {
  content: "";
  position: absolute;
  top: 8px;
  left: 50%;
  width: 7px;
  height: 7px;
  margin-left: -4px;
  border-radius: 50%;
  background: var(--night);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.7);
}

.book:hover .tag, .book:focus-visible .tag {
  opacity: 1;
  transform: translate(-50%, 0) rotate(-1.4deg);
}

.tag-title {
  display: block;
  font-family: var(--display);
  font-size: 1rem;
  line-height: 1.2;
  margin-top: 6px;
}

.tag-blurb {
  display: block;
  font-size: 0.78rem;
  line-height: 1.45;
  margin-top: 0.45em;
  color: #4a3a28;
}

.tag-meta {
  display: block;
  margin-top: 0.7em;
  padding-top: 0.5em;
  border-top: 1px solid rgba(42, 30, 20, 0.25);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #6b5133;
}

/* ---------- Colophon ---------- */

.colophon {
  text-align: center;
  padding: 4rem 24px 3.5rem;
  color: var(--faint);
  font-size: 0.9rem;
}

.colophon-fine {
  margin-top: 0.5em;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
}

.colophon code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.9em;
  color: var(--brass);
}

/* ---------- Touch & small screens ---------- */

@media (hover: none) {
  .book:hover .volume { transform: rotate(var(--lean)); }
  .tag { display: none; }
}

@media (max-width: 760px) {
  .hero { min-height: clamp(420px, 58vh, 640px); }
  .eyebrow {
    font-size: 0.58rem;
    letter-spacing: 0.28em;
    text-indent: 0.28em;
  }
  .shop-name { font-size: clamp(2.3rem, 11vw, 3rem); }
  main { padding-top: 3rem; }
  .row {
    overflow-x: auto;
    overflow-y: hidden;
    min-height: 290px;
    -webkit-overflow-scrolling: touch;
  }
  .shelf { margin-bottom: 3rem; }
  .tag { display: none; }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .eyebrow, .shop-name, .hero-sub, .hero-rule, .case { animation: none; }
  .volume, .tag, .book::after { transition: none; }
  .book:hover .volume, .book:focus-visible .volume { transform: rotate(var(--lean)); }
}
