:root {
  --paper: #fffdf7;
  --paper-2: #fffaf0;
  --yellow: #f5d33b;
  --yellow-deep: #ecbd11;
  --ink: #141414;
  --ink-soft: rgba(20, 20, 20, 0.68);
  --line: rgba(20, 20, 20, 0.1);
  --line-strong: rgba(20, 20, 20, 0.16);
  --shadow: 0 28px 80px rgba(20, 20, 20, 0.13);
  --shadow-strong: 0 42px 120px rgba(20, 20, 20, 0.2);
  --positive: #1f9d55;
  --negative: #cf3c2f;
  --neutral: #7c6d36;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: 'Manrope', 'Segoe UI', sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top, rgba(245, 211, 59, 0.26), transparent 34%),
    linear-gradient(180deg, #ffffff 0%, #fffdf7 52%, #fff9ec 100%);
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.62)),
    repeating-linear-gradient(
      180deg,
      transparent 0 34px,
      rgba(20, 20, 20, 0.02) 34px 35px
    );
  opacity: 0.75;
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

code {
  font-family:
    'SFMono-Regular',
    Consolas,
    'Liberation Mono',
    Menlo,
    monospace;
}

.site-shell,
.shell {
  position: relative;
  z-index: 1;
  width: min(1220px, calc(100vw - 40px));
  margin: 0 auto;
  padding: 28px 0 72px;
}

.masthead,
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.wordmark-symbol {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 10px 30px rgba(20, 20, 20, 0.06);
  font-size: 0.96rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.wordmark-copy,
.eyebrow,
.chapter-label,
.page-chip,
.metric-label,
.thesis-index,
.quote-mark,
.status-label,
.section-title {
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

.wordmark-copy,
.eyebrow,
.chapter-label,
.status-label {
  color: var(--ink-soft);
  font-size: 0.75rem;
  font-weight: 800;
}

.masthead-links,
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
  text-decoration: none;
  font-weight: 800;
  cursor: pointer;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease,
    background-color 160ms ease;
}

.button:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
  box-shadow: 0 18px 28px rgba(20, 20, 20, 0.08);
}

.button.ghost {
  background: rgba(255, 255, 255, 0.7);
}

.hero-copy {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 14px;
  padding: 42px 0 18px;
}

.hero-title,
.page-title,
.topbar-title {
  margin: 0;
  font-family: 'Fraunces', Georgia, serif;
  line-height: 0.94;
}

.hero-title {
  display: grid;
  gap: 10px;
  font-size: clamp(3rem, 8vw, 6.6rem);
}

.hero-title span {
  font-size: clamp(1.4rem, 3.6vw, 2.7rem);
  color: rgba(20, 20, 20, 0.78);
}

.hero-lede,
.page-body,
.hero-note,
.admin-copy,
.quote-copy,
.form-feedback {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.6;
}

.hero-lede {
  max-width: 760px;
  font-size: 1.02rem;
}

.hero-actions {
  display: grid;
  gap: 12px;
  justify-items: center;
}

.ca-button {
  gap: 12px;
  padding: 0 20px;
  background: linear-gradient(180deg, #fff7c7, #f8db4f);
  border-color: rgba(236, 189, 17, 0.45);
  box-shadow: 0 18px 40px rgba(236, 189, 17, 0.24);
}

.button-label {
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.ca-button code {
  max-width: min(56vw, 420px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hero-note {
  font-size: 0.94rem;
}

.book-stage {
  display: grid;
  gap: 16px;
  margin-top: -14px;
  padding-top: 0;
}

.section-heading {
  display: grid;
  justify-items: center;
  gap: 6px;
  text-align: center;
}

.section-title {
  margin: 0;
  font-family: 'Fraunces', Georgia, serif;
  font-size: clamp(1.2rem, 2.3vw, 1.7rem);
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--ink);
}

.section-title:empty {
  display: none;
}

.book-scene {
  --page-width: clamp(280px, 31vw, 360px);
  --page-height: clamp(430px, 47vw, 560px);
  --spread-width: calc(var(--page-width) * 2);
  position: relative;
  display: grid;
  place-items: center;
  min-height: calc(var(--page-height) + 72px);
  padding: 10px 0 34px;
}

.book-shadow {
  position: absolute;
  left: 50%;
  bottom: 10px;
  width: calc(var(--page-width) * 1.04);
  height: 54px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(20, 20, 20, 0.18), transparent 68%);
  filter: blur(18px);
  transition:
    width 320ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 320ms ease,
    opacity 360ms ease;
  transform: translateX(-50%);
}

.book-frame {
  position: relative;
  width: var(--page-width);
  height: var(--page-height);
  perspective: 2400px;
  transform: scale(1);
  transform-origin: center top;
  transition:
    transform 260ms ease,
    width 320ms cubic-bezier(0.22, 1, 0.36, 1),
    height 320ms cubic-bezier(0.22, 1, 0.36, 1);
}

.book-mask {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: 8px 24px 24px 8px;
  border: 1px solid rgba(20, 20, 20, 0.08);
  box-shadow: var(--shadow-strong);
  background: rgba(255, 255, 255, 0.96);
}

.book-spread {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--spread-width);
  height: 100%;
  display: grid;
  grid-template-columns: repeat(2, var(--page-width));
}

.book-spread::before {
  content: '';
  position: absolute;
  top: 18px;
  bottom: 18px;
  left: calc(var(--page-width) - 1px);
  width: 2px;
  background: linear-gradient(
    180deg,
    rgba(20, 20, 20, 0.03),
    rgba(20, 20, 20, 0.12) 22%,
    rgba(20, 20, 20, 0.12) 78%,
    rgba(20, 20, 20, 0.03)
  );
  z-index: 2;
}

.page {
  display: grid;
  align-content: start;
  gap: 18px;
  height: 100%;
  padding: clamp(20px, 2.6vw, 28px);
  font-family: 'Baloo 2', 'Manrope', sans-serif;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(255, 253, 247, 0.98)),
    repeating-linear-gradient(180deg, transparent 0 30px, rgba(20, 20, 20, 0.025) 30px 31px);
}

.page-left {
  background:
    linear-gradient(90deg, rgba(245, 211, 59, 0.12), transparent 22%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(255, 253, 247, 0.98));
}

.page-right {
  border-left: 1px solid rgba(20, 20, 20, 0.08);
  background:
    linear-gradient(270deg, rgba(245, 211, 59, 0.12), transparent 22%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(255, 253, 247, 0.98));
}

.page-topline {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.page-chip {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(245, 211, 59, 0.24);
  color: var(--ink);
  font-size: 0.72rem;
  font-weight: 800;
}

.page-chip.subtle {
  background: rgba(20, 20, 20, 0.05);
}

.page-copy {
  display: grid;
  gap: 10px;
}

.page-title {
  font-family: 'Bangers', 'Fraunces', serif;
  font-size: clamp(1.7rem, 3vw, 2.7rem);
  letter-spacing: 0.01em;
}

.page-left--cta {
  position: relative;
  align-content: center;
  gap: 22px;
  background:
    radial-gradient(circle at 18% 82%, rgba(50, 201, 108, 0.1), transparent 28%),
    radial-gradient(circle at 88% 88%, rgba(255, 107, 107, 0.1), transparent 26%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(255, 253, 247, 0.98));
}

.page-left--cta::before {
  content: '';
  position: absolute;
  inset: auto 18px 20px auto;
  width: 132px;
  height: 132px;
  border-radius: 999px;
  background:
    radial-gradient(circle, rgba(245, 211, 59, 0.22) 18%, transparent 20%) 0 0 / 18px 18px,
    transparent;
  opacity: 0.8;
  pointer-events: none;
}

.page-right--metrics {
  position: relative;
  gap: 16px;
  background:
    radial-gradient(circle at 100% 10%, rgba(245, 211, 59, 0.14), transparent 26%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 253, 247, 0.98));
}

.page-right--metrics::before {
  content: 'UP ONLY';
  position: absolute;
  top: 18px;
  right: 20px;
  padding: 6px 14px;
  border: 2px solid #141414;
  border-radius: 999px;
  background: #f5d33b;
  box-shadow: 4px 4px 0 #141414;
  font-family: 'Bangers', 'Fraunces', serif;
  font-size: 1rem;
  letter-spacing: 0.08em;
  transform: rotate(8deg);
}

.trade-panel {
  gap: 14px;
}

.trade-title {
  max-width: 7ch;
  font-family: 'Bangers', 'Fraunces', serif;
  font-size: clamp(2.45rem, 4.5vw, 3.85rem);
  line-height: 0.92;
  letter-spacing: 0.02em;
  text-shadow: 3px 3px 0 rgba(245, 211, 59, 0.5);
}

.trade-copy {
  max-width: 24ch;
  padding: 14px 16px;
  border: 2px solid #141414;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 6px 6px 0 rgba(20, 20, 20, 0.1);
  font-size: 0.95rem;
  line-height: 1.35;
}

.trade-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.trade-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 68px;
  padding: 0 18px;
  border-radius: 20px;
  border: 2px solid #141414;
  text-decoration: none;
  font-family: 'Bangers', 'Fraunces', serif;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    border-color 160ms ease;
}

.trade-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 30px rgba(20, 20, 20, 0.12);
}

.trade-button--buy {
  background: linear-gradient(180deg, #39d977, #13934a);
  border-color: rgba(20, 147, 75, 0.45);
  color: #ffffff;
  box-shadow:
    0 16px 28px rgba(20, 147, 75, 0.24),
    5px 5px 0 #0d5f31;
  transform: rotate(-1.5deg);
}

.trade-button--sell {
  background: linear-gradient(180deg, #ff7474, #d53a3a);
  border-color: rgba(216, 60, 60, 0.45);
  color: #ffffff;
  box-shadow:
    0 16px 28px rgba(216, 60, 60, 0.2),
    5px 5px 0 #912121;
  transform: rotate(1.5deg);
}

.thesis-list {
  display: grid;
  gap: 10px;
}

.thesis-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: start;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(20, 20, 20, 0.08);
  background: rgba(255, 255, 255, 0.82);
}

.thesis-index {
  color: rgba(20, 20, 20, 0.48);
  font-size: 0.74rem;
  font-weight: 800;
}

.thesis-item p,
.scene-card figcaption {
  margin: 0;
  line-height: 1.55;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.metrics-grid--board {
  gap: 14px;
  margin-top: 4px;
}

.metrics-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 0.95fr);
  gap: 12px;
}

.metrics-hero-card {
  display: grid;
  gap: 12px;
  min-height: 126px;
  padding: 16px 18px;
  border-radius: 24px;
  border: 2px solid #141414;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 250, 234, 0.92));
  box-shadow:
    var(--shadow),
    6px 6px 0 rgba(20, 20, 20, 0.12);
  transform: rotate(-1deg);
}

.metrics-hero-card--change {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.92));
  transform: rotate(1deg);
}

.metric-card,
.scene-card,
.quote-card,
.admin-card {
  border-radius: 22px;
  border: 1px solid rgba(20, 20, 20, 0.08);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow);
}

.metric-card {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 2px solid #141414;
  box-shadow:
    var(--shadow),
    5px 5px 0 rgba(20, 20, 20, 0.1);
}

.metrics-grid--board .metric-card {
  min-height: 96px;
  padding: 14px;
}

.metrics-grid--board .metric-card:nth-child(odd) {
  transform: rotate(-1deg);
}

.metrics-grid--board .metric-card:nth-child(even) {
  transform: rotate(1deg);
}

.metric-label {
  font-family: 'Bangers', 'Fraunces', serif;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--ink-soft);
  letter-spacing: 0.12em;
}

.metric-value {
  font-family: 'Bangers', 'Fraunces', serif;
  font-size: clamp(1rem, 2vw, 1.35rem);
  line-height: 1.1;
}

.metrics-grid--board .metric-value {
  font-size: clamp(1.35rem, 2.6vw, 2rem);
}

.metric-value--hero {
  font-size: clamp(1.8rem, 3vw, 2.55rem);
  line-height: 0.95;
}

.metric-value--change {
  font-size: clamp(1.8rem, 3vw, 2.35rem);
  line-height: 0.95;
}

.metric-value.positive {
  color: var(--positive);
}

.metric-value.negative {
  color: var(--negative);
}

.metric-value.neutral {
  color: var(--neutral);
}

.scene-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.scene-card,
.quote-card {
  overflow: hidden;
}

.scene-card--wide,
.quote-card {
  grid-column: 1 / -1;
}

.scene-card img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.scene-card--wide img {
  aspect-ratio: 1.8 / 1;
}

.scene-card figcaption,
.quote-card {
  padding: 16px 18px 18px;
}

.quote-mark {
  margin: 0 0 10px;
  color: rgba(20, 20, 20, 0.48);
  font-size: 0.72rem;
  font-weight: 800;
}

.quote-copy {
  font-size: 1rem;
}

.book-cover {
  position: absolute;
  top: 0;
  left: 0;
  width: var(--page-width);
  height: var(--page-height);
  border: 0;
  padding: 0;
  background: transparent;
  transform-style: preserve-3d;
  transform-origin: left center;
  transform: rotateY(0deg);
  transition:
    transform 340ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 160ms ease,
    filter 320ms ease;
  cursor: pointer;
  z-index: 3;
}

.book-cover:hover {
  filter: drop-shadow(0 20px 36px rgba(20, 20, 20, 0.18));
}

.cover-face {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 8px 24px 24px 8px;
  border: 1px solid rgba(20, 20, 20, 0.1);
  box-shadow: 0 28px 80px rgba(20, 20, 20, 0.22);
  backface-visibility: hidden;
}

.cover-front {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(245, 245, 245, 0.98));
}

.cover-front img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  transform: scale(1.01);
}

.cover-kicker,
.cover-back-copy {
  position: absolute;
  top: 18px;
  left: 18px;
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
}

.cover-back {
  background:
    radial-gradient(circle at top left, rgba(245, 211, 59, 0.3), transparent 36%),
    linear-gradient(180deg, #fffaf0, #fff6da);
  transform: rotateY(180deg);
}

.book-hint {
  margin: 0;
  text-align: center;
  color: var(--ink-soft);
}

.book-scene.is-opening .book-cover {
  transform: rotateY(-142deg);
  opacity: 0.38;
}

.book-scene.is-open .book-frame {
  width: var(--spread-width);
  transform: scale(1.08);
}

.book-scene.is-open .book-cover {
  transform: rotateY(-160deg);
  opacity: 0.02;
}

.book-scene.is-open .book-shadow {
  width: calc(var(--spread-width) * 0.82);
  transform: translateX(-50%) scaleX(1.04);
  opacity: 0.92;
}

.book-scene.is-opened .book-cover {
  opacity: 0;
  pointer-events: none;
}

.shell--admin {
  padding-top: 44px;
}

.topbar-title {
  font-size: clamp(2rem, 4vw, 3rem);
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-top: 26px;
}

.admin-card {
  display: grid;
  gap: 18px;
  padding: 24px;
}

.status-list,
.admin-form {
  display: grid;
  gap: 14px;
}

.status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.status-value {
  color: var(--ink);
}

.field {
  display: grid;
  gap: 8px;
}

.field span {
  color: var(--ink-soft);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.field input {
  min-height: 52px;
  padding: 0 16px;
  border-radius: 14px;
  border: 1px solid rgba(20, 20, 20, 0.12);
  background: rgba(255, 255, 255, 0.84);
  color: var(--ink);
}

.form-feedback.positive {
  color: var(--positive);
}

.form-feedback.negative {
  color: var(--negative);
}

@media (max-width: 980px) {
  .book-scene {
    --page-width: min(84vw, 440px);
    --page-height: 620px;
    --spread-width: var(--page-width);
    --open-height: 1180px;
    min-height: calc(var(--page-height) + 56px);
  }

  .book-frame {
    height: var(--page-height);
  }

  .book-mask {
    border-radius: 18px;
  }

  .book-spread {
    width: var(--page-width);
    height: var(--open-height);
    grid-template-columns: 1fr;
  }

  .book-spread::before {
    display: none;
  }

  .page {
    min-height: var(--page-height);
  }

  .trade-title {
    max-width: none;
  }

  .metrics-hero {
    grid-template-columns: 1fr;
  }

  .page-right {
    border-left: 0;
    border-top: 1px solid rgba(20, 20, 20, 0.08);
  }

  .book-cover {
    transform-origin: top center;
  }

  .cover-face {
    border-radius: 18px;
  }

  .book-scene.is-open .book-frame {
    width: var(--page-width);
    height: var(--open-height);
  }

  .book-scene.is-open .book-cover {
    transform: rotateX(-168deg);
  }

  .book-scene.is-open .book-shadow {
    width: calc(var(--page-width) * 1.18);
  }

  .admin-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .site-shell,
  .shell {
    width: min(100vw - 24px, 100%);
    padding-top: 18px;
  }

  .masthead,
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero-copy {
    padding-top: 26px;
  }

  .metrics-grid,
  .scene-grid {
    grid-template-columns: 1fr;
  }

  .trade-actions {
    grid-template-columns: 1fr;
  }

  .scene-card--wide,
  .quote-card {
    grid-column: auto;
  }

  .scene-card--wide img {
    aspect-ratio: 1 / 1;
  }

  .book-scene {
    --page-width: min(88vw, 380px);
    --page-height: 560px;
    --open-height: 1080px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
