/* src/styles.css */
:root {
  color-scheme: dark;
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  --bg: #0d1017;
  --panel: rgba(16, 20, 30, 0.78);
  --panel-strong: rgba(12, 15, 22, 0.95);
  --text: #eef2ff;
  --muted: #98a2b3;
  --accent: #7dd3fc;
  --accent-2: #f59e0b;
  --shadow: 0 26px 80px rgba(0, 0, 0, 0.35);
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(
      circle at top left,
      rgba(125, 211, 252, 0.15),
      transparent 28%),
    radial-gradient(
      circle at bottom right,
      rgba(245, 158, 11, 0.14),
      transparent 24%),
    linear-gradient(
      160deg,
      #0b1020 0%,
      #101726 45%,
      #0a0d14 100%);
  color: var(--text);
}
body {
  min-height: 100vh;
}
button,
input,
select {
  font: inherit;
}
#app {
  min-height: 100vh;
  min-height: 100dvh;
}
.shell {
  width: min(1480px, calc(100vw - 24px));
  margin: 0 auto;
  padding: 16px 0 20px;
}
.viewer-shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
}
.viewer-top,
.viewer-frame {
  backdrop-filter: blur(16px);
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow);
}
.viewer-top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 18px 20px;
  border-radius: 22px;
}
.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.72rem;
}
h1,
h2 {
  margin: 0;
  line-height: 1.1;
}
.arrow-btn {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(10, 14, 24, 0.55);
  color: var(--text);
}
.arrow-btn:hover {
  border-color: rgba(125, 211, 252, 0.55);
  transform: translateY(-50%) scale(1.02);
}
.viewer-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
}
.viewer-frame {
  border-radius: 26px;
  padding: 20px;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.stage {
  margin-top: 16px;
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
}
.arrow-btn,
.page-badge {
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}
.arrow-btn {
  position: absolute;
  top: 50%;
  z-index: 4;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
}
.arrow-left {
  left: -6px;
}
.arrow-right {
  right: -6px;
}
.arrow-btn:disabled {
  opacity: 0.35;
  cursor: default;
}
.viewer-stage {
  display: grid;
  place-items: center;
  flex: 1;
  min-height: 0;
  width: 100%;
  perspective: 1800px;
  overflow: hidden;
}
.page-surface {
  position: relative;
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  transform-style: preserve-3d;
}
.page-layer {
  position: absolute;
  inset: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transform-style: preserve-3d;
  will-change: transform, opacity;
}
.page-layer.one-page {
  width: 100%;
}
.page-layer.two-page {
  width: 100%;
  gap: 0;
}
.page-slot {
  position: relative;
  display: grid;
  place-items: center;
  width: fit-content;
  min-width: 0;
  min-height: 0;
  transform-style: preserve-3d;
}
.page-slot.blank {
  background:
    linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.04),
      rgba(255, 255, 255, 0.02)),
    rgba(255, 255, 255, 0.02);
  border-radius: 12px;
  border: 1px dashed rgba(255, 255, 255, 0.08);
}
.page-slot canvas {
  display: block;
  max-width: 100%;
  max-height: 100%;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  background: #fff;
  backface-visibility: hidden;
}
.page-slot.turning {
  z-index: 5;
  will-change: transform, opacity;
  box-shadow: 0 14px 46px rgba(0, 0, 0, 0.28);
}
.page-turn-overlay {
  position: absolute;
  pointer-events: none;
  transform-style: preserve-3d;
  will-change: transform, opacity;
}
.page-turn-face {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  backface-visibility: hidden;
  transform-style: preserve-3d;
}
.page-turn-face.back {
  transform: rotateY(180deg);
}
.page-turn-overlay .turning-canvas {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 12px;
  box-shadow: 0 26px 60px rgba(0, 0, 0, 0.42);
  backface-visibility: hidden;
}
.page-turn-shadow {
  position: absolute;
  inset: 0;
  border-radius: 12px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 180ms ease;
  background:
    linear-gradient(
      to var(--turn-shadow-side, right),
      rgba(0, 0, 0, 0.34),
      rgba(0, 0, 0, 0.12) 22%,
      rgba(255, 255, 255, 0.06) 50%,
      rgba(0, 0, 0, 0.22));
  mix-blend-mode: multiply;
}
.page-turn-shadow[data-direction=next] {
  --turn-shadow-side: right;
}
.page-turn-shadow[data-direction=prev] {
  --turn-shadow-side: left;
}
.page-turn-shadow.active {
  opacity: 1;
}
.page-layer.current {
  z-index: 2;
}
.loading {
  color: var(--muted);
  font-size: 1rem;
  padding: 24px;
}
.page-badge {
  position: absolute;
  top: 8px;
  left: 10px;
  z-index: 2;
  font-size: 0.75rem;
  color: var(--text);
  background: rgba(0, 0, 0, 0.55);
  padding: 3px 8px;
  border-radius: 999px;
}
@media (max-width: 900px) {
  .shell {
    width: calc(100vw - 12px);
    padding: 10px 0 14px;
  }
  .viewer-top {
    flex-direction: column;
    align-items: flex-start;
    padding: 14px 16px;
  }
  .viewer-frame {
    padding: 10px;
    border-radius: 18px;
  }
  .arrow-btn {
    width: 44px;
    height: 44px;
    font-size: 1.5rem;
    background: rgba(10, 14, 24, 0.7);
  }
  .arrow-left {
    left: 2px;
  }
  .arrow-right {
    right: 2px;
  }
}
@media (max-height: 520px) {
  .shell {
    padding: 6px 0 8px;
  }
  .viewer-top {
    padding: 8px 14px;
    border-radius: 16px;
  }
  .viewer-top h1 {
    font-size: 1.1rem;
  }
  .eyebrow {
    margin-bottom: 2px;
  }
  .stage {
    margin-top: 8px;
  }
  .viewer-frame {
    padding: 8px;
  }
}
