/* ===== Artbooks: covers, the book stage, plate grid, full-screen viewer ===== */
:root { --ground: var(--ink-2); --accent: var(--gold); }

/* Cover: a printed book — painting + real type + seal + spine light */
.cover { position: relative; aspect-ratio: 2 / 3; border-radius: 3px 6px 6px 3px; overflow: hidden; background: var(--ground); box-shadow: 0 18px 40px rgba(0,0,0,.55), 0 2px 6px rgba(0,0,0,.4); isolation: isolate; }
.cover img { width: 100%; height: 100%; object-fit: cover; }
.cover::before { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(to bottom, color-mix(in srgb, var(--ground) 82%, transparent) 0%, color-mix(in srgb, var(--ground) 30%, transparent) 26%, transparent 42%); }
.cover::after { content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none; background: linear-gradient(to right, rgba(255,255,255,.18) 0, rgba(255,255,255,0) 2.5%, rgba(0,0,0,.25) 3.2%, rgba(0,0,0,0) 6%), linear-gradient(140deg, rgba(255,255,255,.08), rgba(255,255,255,0) 40%); }
.cover-type { position: absolute; z-index: 3; inset: 7% 8% auto; display: grid; gap: 6px; text-align: center; justify-items: center; }
.cover-kala { font: 600 .56rem/1.2 var(--sans); letter-spacing: .22em; text-transform: uppercase; color: var(--accent); opacity: .95; }
.cover-title { font-family: var(--serif); font-weight: 600; font-size: clamp(1.15rem, 2.1vw, 1.6rem); line-height: 1.02; text-wrap: balance;
  background: linear-gradient(180deg, #fff3d6 0%, #e9c27a 42%, #b98a3c 58%, #f6dca2 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,.6)); }
.cover-seal { position: absolute; z-index: 3; bottom: 4.5%; left: 50%; transform: translateX(-50%); font: 600 .46rem var(--sans); letter-spacing: .2em; white-space: nowrap; text-transform: uppercase; color: var(--ink, #f3e6cf); opacity: .75; padding: 3px 8px; border: 1px solid color-mix(in srgb, var(--accent) 60%, transparent); border-radius: 2px; background: color-mix(in srgb, var(--ground) 45%, transparent); }
.cover.big .cover-kala { font-size: .72rem; }
.cover.big .cover-title { font-size: clamp(1.9rem, 3.6vw, 2.9rem); }
.cover.big .cover-seal { font-size: .62rem; }

.strip.books { grid-auto-columns: clamp(150px, 15vw, 210px); gap: 18px; }
.book-card { gap: 10px; transition: transform .35s ease; }
.book-card:hover { transform: translateY(-6px); }
.book-card .cover-title { font-size: clamp(1rem, 1.25vw, 1.2rem); }
.book-card .book-meta { margin: 0; font-size: .78rem; color: var(--ivory-faint); }

/* Stage: the book's own room */
.stage { position: relative; overflow: hidden; background: var(--ground); min-height: min(94vh, 900px); display: flex; align-items: center; }
.stage-bg { position: absolute; inset: -10%; width: 120%; height: 120%; max-width: none; object-fit: cover; filter: blur(42px) saturate(1.15); opacity: .42; }
.stage::after { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at 30% 40%, transparent 0%, color-mix(in srgb, var(--ground) 70%, transparent) 55%, var(--ground) 100%), linear-gradient(to top, var(--ink) 0%, transparent 18%); }
.stage-body { position: relative; z-index: 1; width: 100%; display: grid; grid-template-columns: minmax(0, min(380px, 36vw)) minmax(0, 1fr); gap: clamp(28px, 6vw, 88px); align-items: center; padding-block: calc(90px + env(safe-area-inset-top, 0px)) 60px; max-width: 1240px; margin: 0 auto; }
.stage-cover { perspective: 1400px; }
.stage-cover .cover { transform: rotateY(-11deg) rotateX(2deg); transition: transform .8s cubic-bezier(.2,.7,.2,1); box-shadow: 30px 30px 60px rgba(0,0,0,.6), 0 4px 10px rgba(0,0,0,.5); }
.stage-cover:hover .cover { transform: rotateY(0) rotateX(0); }
.stage-text { display: grid; gap: 14px; min-width: 0; }
.stage-text .chip, .stage-text .chip a { color: var(--accent); text-decoration: none; }
.stage-text h1 { font-size: clamp(2.6rem, 6vw, 5rem); color: var(--ivory); }
.stage-text .subtitle { margin: -6px 0 0; font-family: var(--serif); font-style: italic; font-size: 1.25rem; color: var(--ivory-dim); }
.stage-text .logline { margin: 0; font-size: clamp(1.02rem, 1.6vw, 1.2rem); color: var(--ivory-dim); max-width: 50ch; }
.stage-text .actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.stage .btn:not(.ghost) { background: var(--accent); color: #1a1208; }

/* Book page body */
.book-body { display: grid; gap: 48px; padding-block: 24px 64px; max-width: 1240px; margin: 0 auto; }
.book-body .essay { max-width: 64ch; }
.book-body .essay::first-letter { color: var(--accent); }
.inside h2 { font-family: var(--sans); font-size: 1.05rem; display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; margin-bottom: 14px; }
.inside h2 span { font-weight: 400; color: var(--ivory-faint); font-size: .85rem; }
.plate-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(46%, 150px), 1fr)); gap: 10px; }
.pg { position: relative; aspect-ratio: 2 / 3; border-radius: 4px; overflow: hidden; background: var(--ink-3); text-decoration: none; }
.pg img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.pg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.75), transparent 45%); }
.pg:hover img { transform: scale(1.06); }
.pg-n { position: absolute; z-index: 1; top: 8px; left: 10px; font: 600 .78rem var(--serif); color: var(--ivory); text-shadow: 0 1px 3px #000; }
.pg-e { position: absolute; z-index: 1; bottom: 9px; left: 10px; right: 10px; font: 600 .66rem var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.style-card { border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 12%, transparent), transparent 60%), var(--ink-2); border-radius: 10px; padding: clamp(18px, 3vw, 30px); display: grid; gap: 10px; max-width: 760px; }
.style-card h3 { font-size: 2rem; }
.style-card p { margin: 0; color: var(--ivory-dim); }
.style-card .btn { justify-self: start; background: var(--accent); color: #1a1208; }

/* Viewer: one plate, full screen */
body.viewing .top, body.viewing .foot { display: none; }
.viewer { position: fixed; inset: 0; z-index: 40; background: var(--ground); overflow: hidden; color: var(--ivory); }
.v-bg { position: absolute; inset: -10%; width: 120%; height: 120%; max-width: none; object-fit: cover; filter: blur(50px) saturate(1.2); opacity: .32; }
.viewer::after { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at center, transparent 0%, color-mix(in srgb, var(--ground) 80%, transparent) 75%); pointer-events: none; }
.v-progress { position: absolute; z-index: 5; top: env(safe-area-inset-top, 0px); left: 0; right: 0; height: 3px; background: rgba(255,255,255,.08); }
.v-progress span { display: block; height: 100%; background: var(--accent); transition: width .4s; }
.v-close { position: absolute; z-index: 6; top: calc(14px + env(safe-area-inset-top, 0px)); right: max(16px, env(safe-area-inset-right, 0px)); width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; background: rgba(0,0,0,.35); text-decoration: none; font-size: 1rem; }
.v-zone { position: absolute; z-index: 4; top: 0; bottom: 0; width: 9vw; }
.v-zone.prev { left: 0; cursor: w-resize; }
.v-zone.next { right: 0; cursor: e-resize; }
.v-stage { position: relative; z-index: 3; height: 100%; display: grid; grid-template-columns: auto minmax(0, 380px); gap: clamp(24px, 4vw, 64px); align-items: center; justify-content: center; padding: calc(36px + env(safe-area-inset-top, 0px)) 10vw calc(28px + env(safe-area-inset-bottom, 0px)); animation: vin .55s ease both; }
@keyframes vin { from { opacity: 0; transform: scale(.985); } to { opacity: 1; transform: none; } }
.v-plate { margin: 0; height: 100%; display: flex; align-items: center; justify-content: center; min-height: 0; }
.v-plate img { max-height: calc(100vh - 70px); max-width: 100%; width: auto; aspect-ratio: 2 / 3; object-fit: contain; border-radius: 3px; box-shadow: 0 30px 70px rgba(0,0,0,.6); cursor: zoom-out; }
.v-plate.is-cover .cover { height: calc(100vh - 90px); max-height: 820px; width: auto; }
.v-text { display: grid; gap: 12px; align-content: center; transition: opacity .4s; }
.v-emotion { font: 600 .74rem var(--sans); letter-spacing: .26em; text-transform: uppercase; color: var(--accent); }
.v-count { font-family: var(--serif); font-size: 2.6rem; line-height: 1; color: var(--ivory); }
.v-count i { font-style: normal; font-size: 1.1rem; color: var(--ivory-faint); }
.v-text h1 { font-size: clamp(1.9rem, 3vw, 2.6rem); }
.v-text p { margin: 0; font-family: var(--serif); font-size: clamp(1.15rem, 1.6vw, 1.32rem); line-height: 1.6; color: var(--ivory-dim); }
.v-nav { display: flex; gap: 10px; margin-top: 8px; }
.viewer .btn:not(.ghost) { background: var(--accent); color: #1a1208; }
.viewer.bare .v-text { opacity: 0; pointer-events: none; }
.v-stage.end { grid-template-columns: minmax(0, 720px); }
.v-end { display: grid; gap: 16px; justify-items: start; }
.v-end h1 { font-size: clamp(2.4rem, 5vw, 4rem); }
.v-end p { margin: 0; color: var(--ivory-dim); }
.v-end .actions { display: flex; gap: 10px; flex-wrap: wrap; }

@media (max-width: 860px) {
  .stage-body { grid-template-columns: minmax(0, 1fr); justify-items: center; text-align: center; padding-top: calc(80px + env(safe-area-inset-top, 0px)); }
  .stage-cover { width: min(64vw, 300px); }
  .stage-cover .cover { transform: none; }
  .stage-text { justify-items: center; }
  .stage-text .actions, .stage-text .meta { justify-content: center; }
  .v-stage { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; align-items: stretch; gap: 14px; padding: calc(28px + env(safe-area-inset-top, 0px)) 16px calc(16px + env(safe-area-inset-bottom, 0px)); overflow-y: auto; }
  .v-plate img { max-height: 64vh; }
  .v-plate.is-cover .cover { height: 58vh; }
  .v-text { gap: 8px; }
  .v-count { font-size: 1.8rem; }
  .v-zone { width: 18vw; bottom: 40%; }
  .v-stage.end { align-content: center; }
}

/* Created with KamZour */
.intro { display: grid; gap: 22px; }
.made-with { display: inline-flex; align-items: center; gap: 12px; justify-self: start; padding: 10px 18px 10px 10px; border-radius: 999px; text-decoration: none; border: 1px solid color-mix(in srgb, var(--accent) 50%, transparent); background: color-mix(in srgb, var(--accent) 10%, transparent); transition: background .3s, transform .3s; }
.made-with:hover { background: color-mix(in srgb, var(--accent) 22%, transparent); transform: translateY(-1px); }
.mw-mark { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #1a1208; font: 700 1rem var(--serif); }
.mw-text { display: grid; line-height: 1.25; }
.mw-text b { font: 600 .9rem var(--sans); color: var(--ivory); }
.mw-text i { font: italic 500 1rem var(--serif); color: var(--accent); }
.made-with.small { padding: 6px 14px 6px 6px; margin-top: 10px; background: transparent; }
.made-with.small .mw-mark { width: 26px; height: 26px; font-size: .8rem; }
.made-with.small .mw-text b { font-size: .76rem; }
.made-with.small .mw-text i { font-size: .88rem; }
