/* design system */
:root {
  --leather-dark: #a47449;
  --gold-primary: #966f33;
  --gold-glow: #c68e17;
  --parchment-bg: #e6d5b8;
  --parchment-border: #b59052;
  --ink-primary: #2c1d11;
  --ink-secondary: #5a4332;

  --font-heading: serif;
  --font-body: serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: transparent;
  font-family: var(--font-body);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  overflow-x: hidden;
  position: relative;
  padding: 2rem 0;
}

a {
  text-decoration: none;
  color: inherit;
}

/* BACKGROUND VIDEO & OVERLAY */

.video-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -2;
  overflow: hidden;
}

/* Force the video tag itself to fill the fixed container completely */
.video-background video {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  min-width: 100%;
  min-height: 100%;
  width: auto;
  height: auto;
  object-fit: cover;
}

.video-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(18, 10, 6, 0.78);
  box-shadow: inset 0 0 100px rgba(0, 0, 0, 0.9);
  z-index: -1;
  pointer-events: none;
}

/* NAVIGATION */

.ribbon-nav {
  position: relative;
  display: flex;
  gap: 2rem;
  background: rgba(18, 10, 6, 0.9);
  padding: 2rem;
  border: 3px solid var(--gold-primary);
  border-radius: 10px;
  box-shadow: 0 0 15px rgba(150, 111, 51, 0.25);
  margin-bottom: 1.5rem;
}

.ribbon-btn {
  background: transparent;
  border: none;
  color: var(--gold-primary);
  padding: 0.5rem 1rem;
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.ribbon-btn:hover,
.ribbon-btn.active {
  color: #ffffff;
  background: rgba(150, 111, 51, 0.25);
}

/* BOOK CONTAINER */

.tome-container {
  position: relative;
  perspective: 2000px;
  width: 380px;
  height: 540px;
}

.tome {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
}

.page {
  position: absolute;
  inset: 0;
  transform-origin: left center;
  transform-style: preserve-3d;
  transition: transform 0.8s cubic-bezier(0.645, 0.045, 0.355, 1);
  border-radius: 4px 12px 12px 4px;
  cursor: pointer;
}

.page.flipped {
  transform: rotateY(-180deg);
}

.page-front,
.page-back {
  position: absolute;
  inset: 0;
  padding: 2rem;
  backface-visibility: hidden;
  background-color: var(--parchment-bg);
  border: 2px solid var(--parchment-border);
  box-shadow:
    inset 0 0 30px rgba(90, 67, 50, 0.3),
    0 10px 25px rgba(0, 0, 0, 0.8);
  border-radius: 4px 12px 12px 4px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.page-back {
  transform: rotateY(180deg);
  background-color: #dfcdb0;
}

.gold-border-inner {
  border: 1px solid var(--gold-primary);
  height: 100%;
  width: 100%;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.cover-page .page-front {
  background: linear-gradient(135deg, #5a4332, #120a06);
  border: 4px solid var(--gold-primary);
  box-shadow:
    inset 0 0 25px rgba(198, 142, 23, 0.35),
    0 0 20px rgba(150, 111, 51, 0.5),
    0 15px 35px rgba(0, 0, 0, 0.9);
}

.final-cover .gold-border-inner {
  border-color: var(--gold-primary);
  background: linear-gradient(135deg, #120a06, #2b1307);
}

.final-cover h2 {
  color: var(--gold-primary);
  border-bottom: none;
}

.final-cover .lore-text {
  color: #c8b28b;
}

/* TYPOGRAPHY & DECORATION */

.parchment-content {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  height: 100%;
}

.chapter-number {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  color: var(--leather-dark);
  letter-spacing: 2px;
  text-transform: uppercase;
}

h2 {
  font-family: var(--font-heading);
  color: var(--ink-primary);
  font-size: 1.5rem;
  border-bottom: 1px dashed var(--parchment-border);
  padding-bottom: 0.3rem;
}

.drop-cap-text {
  font-size: 0.95rem;
  line-height: 1.45;
}

.drop-cap {
  font-family: var(--font-heading);
  float: left;
  font-size: 2.8rem;
  line-height: 0.8;
  padding-right: 0.4rem;
  color: var(--leather-dark);
}

.lore-text {
  font-size: 0.9rem;
  color: var(--ink-secondary);
  line-height: 1.45;
}

.arcane-crest {
  font-size: 3rem;
  color: var(--gold-primary);
  margin-bottom: 0.5rem;
}

.tome-title {
  font-family: var(--font-heading);
  color: var(--gold-primary);
  font-size: 2rem;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.tome-subtitle {
  font-family: var(--font-body);
  color: #c8b28b;
  font-size: 1rem;
  font-style: italic;
  margin-bottom: 1rem;
}

/* INNER PAGE SECTIONS & COMPONENTS */

.about-header {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.profile-frame {
  width: 120px;
  height: 200px;
  min-width: 200px;
  border: 3px solid var(--gold-primary);
  box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.6);
  background-color: var(--leather-dark);
  overflow: hidden;
  border-radius: 8px;
}

.profile-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hobby-gallery {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.8rem;
  margin-top: 0.4rem;
  margin-bottom: 0.4rem;
  width: 100%;
}

.hobby-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.hobby-square-box {
  width: 125px;
  height: 125px;
  min-width: 125px;
  min-height: 125px;
  border: 3px solid var(--gold-primary);
  border-radius: 10px;
  overflow: hidden;
  background-color: var(--leather-dark);
  box-shadow:
    0 6px 15px rgba(0, 0, 0, 0.5),
    inset 0 0 10px rgba(0, 0, 0, 0.6);
  transition:
    transform 0.3s ease,
    border-color 0.3s ease,
    box-shadow 0.3s ease;
}

.hobby-square-box:hover {
  transform: translateY(-5px) scale(1.05);
  border-color: var(--gold-glow);
  box-shadow: 0 8px 20px rgba(198, 142, 23, 0.5);
}

.hobby-square-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.volleyball-desc {
  text-align: center;
  margin-top: 0.2rem;
  font-style: italic;
  font-size: 0.8rem;
  line-height: 1.3;
}

.relic-item {
  background: rgba(90, 67, 50, 0.08);
  border-left: 3px solid var(--leather-dark);
  padding: 0.7rem;
  margin-bottom: 0.4rem;
}

.relic-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.2rem;
}

.relic-header h3 {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  color: var(--ink-primary);
}

.social-sigils {
  display: flex;
  justify-content: space-around;
  align-items: center;
  gap: 0.5rem;
  margin: 0.1rem 0;
}

.social-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  text-decoration: none;
}

.social-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: var(--ink-primary);
  color: var(--gold-primary);
  border: 1px solid var(--gold-primary);
  border-radius: 50%;
  font-size: 0.85rem;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.4);
  transition: all 0.3s ease;
}

.social-handle {
  font-family: var(--font-heading);
  font-size: 0.7rem;
  color: #000000;
  letter-spacing: 0.5px;
  text-decoration: none;
  transition: color 0.3s ease;
}

.social-link:hover .social-icon {
  background: var(--leather-dark);
  color: #ffffff;
  border-color: var(--gold-glow);
  transform: translateY(-2px);
}

.social-link:hover .social-handle {
  color: var(--leather-dark);
}

.raven-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.raven-form input,
.raven-form textarea {
  width: 100%;
  background: rgba(255, 255, 255, 0.4);
  border: 1px solid var(--parchment-border);
  padding: 0.5rem;
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--ink-primary);
  outline: none;
}

.raven-btn {
  background: var(--ink-primary);
  color: var(--gold-primary);
  border: 1px solid var(--gold-primary);
  padding: 0.6rem;
  font-family: var(--font-heading);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.raven-btn:hover {
  background: var(--leather-dark);
  color: #ffffff;
}

/* CONTROLS & PAGINATION */

.tome-controls {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.rune-btn {
  background: rgba(18, 10, 6, 0.9);
  border: 1px solid var(--gold-primary);
  color: var(--gold-primary);
  padding: 0.6rem 1.2rem;
  font-family: var(--font-heading);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.rune-btn:hover:not(:disabled) {
  background: white;
  color: var(--leather-dark);
}

.pagination-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* STORYBOOK FOOTER */

.storybook-footer {
  margin-top: auto;
  padding-top: 0.8rem;
  border-top: 1px dashed var(--gold-primary);
  width: 100%;
  text-align: center;
}

.storybook-footer p {
  font-family: var(--font-body);
  font-size: 0.75rem;
  color: var(--parchment-bg);
  font-style: italic;
  opacity: 0.8;
}