/* ============================================
   NOTATIONS — leather journal
   /ourotheia/notations.css
   ============================================ */

/* ----------------------------------------
   BASE
   ---------------------------------------- */
.o-notations {
  background: #0a0908;
  color: #d4d0c8;
  font-family: var(--o-font-body);
  min-height: 100vh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

/* Kill cursor trail */
.o-notations .cursor-trail,
.o-notations #cursorCanvas,
body:has(.o-notations) > canvas {
  display: none !important;
}

.o-notations .o-vignette {
  z-index: 100;
}

.o-notations > * {
  position: relative;
  z-index: 1;
}


/* ----------------------------------------
   JOURNAL — outer leather cover
   ---------------------------------------- */
.journal {
  width: 600px;
  height: 80vh;
  max-height: 760px;
  min-height: 480px;
  position: relative;
  z-index: 2;
}

.journal-cover {
  width: 100%;
  height: 100%;
  position: relative;
  /* Leather cover feel */
  background: #1a1614;
  border-radius: 2px 12px 12px 2px;
  box-shadow:
    /* Outer shadow — book sitting on surface */
    0 8px 40px rgba(0,0,0,0.7),
    0 2px 10px rgba(0,0,0,0.5),
    /* Subtle warm edge highlight on leather */
    inset 0 1px 0 rgba(180,160,130,0.06),
    inset 0 -1px 0 rgba(0,0,0,0.3),
    /* Right edge — page thickness */
    3px 0 0 #0e0c0a,
    4px 1px 0 #0a0908,
    5px 2px 8px rgba(0,0,0,0.4);
  display: flex;
}


/* ----------------------------------------
   SPINE — spiral binding
   ---------------------------------------- */
.journal-spine {
  width: 32px;
  flex-shrink: 0;
  position: relative;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0;
  /* Dark strip behind spirals */
  background: linear-gradient(
    90deg,
    #0a0908 0%,
    #141210 40%,
    #0e0c0a 100%
  );
  border-radius: 4px 0 0 4px;
}

/* Individual spiral rings */
.spiral-ring {
  width: 22px;
  height: 10px;
  border: 2px solid #3a3530;
  border-radius: 50%;
  position: relative;
  flex-shrink: 0;
  background: linear-gradient(
    180deg,
    #4a4540 0%,
    #2a2520 50%,
    #1a1510 100%
  );
  box-shadow:
    0 1px 2px rgba(0,0,0,0.6),
    inset 0 1px 1px rgba(180,160,130,0.08);
}

/* Wire highlight on top of each ring */
.spiral-ring::after {
  content: '';
  position: absolute;
  top: 1px;
  left: 3px;
  right: 3px;
  height: 2px;
  background: rgba(180,160,130,0.12);
  border-radius: 1px;
}

/* Ribbon — now hangs from top of spine area */
.journal-ribbon {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 14px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 20;
}

.ribbon-tail {
  display: block;
  width: 14px;
  height: 55px;
  background: linear-gradient(
    180deg,
    #8b1a1a 0%,
    #a02020 40%,
    #6b1212 100%
  );
  clip-path: polygon(0 0, 100% 0, 100% 85%, 50% 100%, 0 85%);
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
  transition: height 300ms ease, filter 200ms ease;
}

.journal-ribbon:hover .ribbon-tail {
  height: 63px;
  filter: brightness(1.2);
}

/* ----------------------------------------
   PAGE AREA
   ---------------------------------------- */
.journal-page-area {
  flex: 1;
  position: relative;
  overflow: hidden;
  border-radius: 0 10px 10px 0;
  /* Dark parchment base */
  background-color: #12100e;
  background-image: url('/assets/images/backgrounds/blackroughtexture.png');
  background-repeat: repeat;
  background-size: auto;
  /* Texture at partial opacity — blend with base */
}

/* Texture opacity layer */
.journal-page-area::before {
  content: '';
  position: absolute;
  inset: 0;
  background-color: #12100e;
  opacity: 0.4;
  z-index: 0;
  pointer-events: none;
}

/* Inner page shadow (worn edges, light falloff) */
.journal-page-area::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  box-shadow:
    inset 3px 0 12px rgba(0,0,0,0.5),
    inset -2px 0 8px rgba(0,0,0,0.3),
    inset 0 3px 10px rgba(0,0,0,0.4),
    inset 0 -3px 10px rgba(0,0,0,0.4);
  border-radius: 0 10px 10px 0;
}


/* ----------------------------------------
   PAGE FLIPPER — 3D transforms
   ---------------------------------------- */
.journal-flipper {
  width: 100%;
  height: 100%;
  position: relative;
  perspective: 1800px;
}

.journal-page {
  position: absolute;
  inset: 0;
  padding: 0;
  opacity: 0;
  pointer-events: none;
  z-index: 1;
  /* 3D flip setup */
  backface-visibility: hidden;
  transform-origin: left center;
  transition: transform 600ms ease, opacity 300ms ease;
}

.journal-page.active {
  opacity: 1;
  pointer-events: auto;
  z-index: 2;
  transform: rotateY(0deg);
}

/* Flip OUT — page turns forward (current page flips left like turning a page) */
.journal-page.flip-out-forward {
  opacity: 1;
  z-index: 3;
  transform: rotateY(-110deg);
  transition: transform 600ms ease;
  pointer-events: none;
}

/* Flip IN — page arrives from right (was "behind", flips into view) */
.journal-page.flip-in-forward {
  opacity: 1;
  z-index: 2;
  transform: rotateY(0deg);
  pointer-events: none;
}

/* Flip OUT backward — page un-turns (flips right, away) */
.journal-page.flip-out-backward {
  opacity: 1;
  z-index: 3;
  transform: rotateY(40deg);
  transition: transform 600ms ease;
  pointer-events: none;
}

/* Flip IN backward — previous page settles back */
.journal-page.flip-in-backward {
  opacity: 1;
  z-index: 2;
  transform: rotateY(0deg);
  pointer-events: none;
}


/* ----------------------------------------
   PAGE CONTENT (scrollable inner)
   ---------------------------------------- */
.page-content {
  position: absolute;
  inset: 0;
  padding: 2.5rem 2.8rem 3.5rem 2.2rem;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 1;
  /* Uneven margins — handmade feel */
  scrollbar-width: thin;
  scrollbar-color: rgba(180,160,130,0.15) transparent;
}

.page-content::-webkit-scrollbar {
  width: 4px;
}
.page-content::-webkit-scrollbar-track {
  background: transparent;
}
.page-content::-webkit-scrollbar-thumb {
  background: rgba(180,160,130,0.15);
  border-radius: 2px;
}
.page-content::-webkit-scrollbar-thumb:hover {
  background: rgba(180,160,130,0.3);
}


/* ----------------------------------------
   TABLE OF CONTENTS
   ---------------------------------------- */
.journal-title {
  font-family: "Euphorigenic", var(--o-font-display);
  font-size: 2.2rem;
  color: #d4b878;
  text-align: center;
  margin-bottom: 0.1em;
  letter-spacing: 0.08em;
  text-shadow:
    0 0 10px rgba(212,184,120,0.15),
    0 1px 3px rgba(0,0,0,0.8);
}

.journal-subtitle {
  text-align: center;
  font-style: italic;
  font-size: 0.82rem;
  color: #7a756b;
  margin-bottom: 1.5rem;
  letter-spacing: 0.04em;
}

.toc-divider {
  width: 60%;
  height: 1px;
  margin: 1.2rem auto;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(180,160,130,0.2) 30%,
    rgba(180,160,130,0.25) 50%,
    rgba(180,160,130,0.2) 70%,
    transparent 100%
  );
}

.toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.toc-entry {
  display: flex;
  align-items: baseline;
  gap: 0.6em;
  padding: 0.45em 0;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: var(--o-font-body);
  transition: color 200ms ease;
}

.toc-entry:hover {
  color: #d4b878;
}

.toc-entry-title {
  font-size: 0.88rem;
  color: #d4d0c8;
  flex-shrink: 0;
  transition: color 200ms ease;
}

.toc-entry:hover .toc-entry-title {
  color: #d4b878;
}

.toc-entry-dots {
  flex: 1;
  border-bottom: 1px dotted rgba(180,160,130,0.15);
  min-width: 20px;
  margin-bottom: 0.2em;
}

.toc-entry-date {
  font-size: 0.72rem;
  color: #5a554d;
  flex-shrink: 0;
  font-family: var(--o-font-mono, monospace);
}

/* TOC tag filters */
.toc-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3em;
  justify-content: center;
  margin-top: 0.5rem;
}

.toc-tag-filter {
  background: none;
  border: 1px solid rgba(180,160,130,0.1);
  font-family: var(--o-font-mono, monospace);
  font-size: 0.65rem;
  color: #6a655d;
  padding: 0.1em 0.5em;
  cursor: pointer;
  transition: color 200ms ease, border-color 200ms ease;
  border-radius: 1px;
}

.toc-tag-filter:hover,
.toc-tag-filter.active {
  color: #d4b878;
  border-color: rgba(212,184,120,0.3);
}

.toc-tag-filter.active {
  background: rgba(212,184,120,0.06);
}


/* ----------------------------------------
   ENTRY STYLES
   ---------------------------------------- */
.entry-header {
  margin-bottom: 1.5rem;
}

.entry-date {
  display: block;
  font-family: var(--o-font-mono, monospace);
  font-size: 0.7rem;
  color: #5a554d;
  letter-spacing: 0.1em;
  margin-bottom: 0.4em;
}

.entry-title {
  font-family: "Euphorigenic", var(--o-font-display);
  font-size: 1.5rem;
  color: #d4d0c8;
  letter-spacing: 0.04em;
  text-shadow: 0 1px 4px rgba(0,0,0,0.6);
}

.entry-body {
  font-size: 0.88rem;
  line-height: 1.8;
  color: #c8c4bc;
  /* Slight ink bleed */
  text-shadow: 0 0 1px rgba(212,208,200,0.08);
}

.entry-body p {
  margin: 0 0 1em;
  /* Uneven left margins for handwritten feel */
}

.entry-body p:nth-child(odd) {
  padding-left: 0.15em;
}

.entry-body p:nth-child(3n) {
  padding-left: 0.4em;
}

/* Color ink lines */
.entry-body .ink-color {
  color: var(--ink, #d4d0c8);
  -webkit-text-fill-color: var(--ink, #d4d0c8);
  text-shadow: 0 0 3px var(--ink, transparent);
}

/* Inline links */
.entry-body a {
  color: var(--o-seaglass-light, #6ac4b0);
  text-decoration: none;
  transition: color 200ms ease, text-shadow 400ms ease;
}

.entry-body a:hover {
  color: var(--o-seaglass-pale, #a0ddd0);
  text-shadow: 0 0 6px rgba(106,196,176,0.3);
}

/* Entry tags */
.entry-tags {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(180,160,130,0.08);
  display: flex;
  flex-wrap: wrap;
  gap: 0.3em;
}

.etag {
  font-family: var(--o-font-mono, monospace);
  font-size: 0.65rem;
  color: #5a554d;
  padding: 0.1em 0.4em;
  border: 1px solid rgba(180,160,130,0.08);
  border-radius: 1px;
  transition: color 200ms ease;
}


/* ----------------------------------------
   PAGE TURN CORNERS — dog-ear curl
   ---------------------------------------- */
.page-corner {
  position: absolute;
  bottom: 0;
  width: 48px;
  height: 48px;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 10;
  padding: 0;
  opacity: 0;
  transition: opacity 300ms ease;
  overflow: hidden;
}

.journal-page-area:hover .page-corner:not(.disabled) {
  opacity: 1;
}

.page-corner.disabled {
  opacity: 0 !important;
  pointer-events: none;
}

.page-corner--prev {
  left: 0;
}

.page-corner--next {
  right: 0;
}

/* Hide the SVG — we're replacing with CSS dog-ears */
.page-corner .corner-fold {
  display: none;
}

/* Dog-ear effect via pseudo-elements */
.page-corner::before {
  content: '';
  position: absolute;
  bottom: 0;
  width: 40px;
  height: 40px;
  transition: width 200ms ease, height 200ms ease, box-shadow 200ms ease;
}

/* Next: bottom-right curl */
.page-corner--next::before {
  right: 0;
  background: linear-gradient(
    315deg,
    #2a2520 0%,
    #1e1a16 40%,
    #151210 100%
  );
  border-top-left-radius: 8px;
  box-shadow:
    -2px -2px 6px rgba(0,0,0,0.5),
    inset 1px 1px 2px rgba(180,160,130,0.06);
  clip-path: polygon(100% 0%, 100% 100%, 0% 100%);
}

.page-corner--next:hover::before {
  width: 52px;
  height: 52px;
  box-shadow:
    -3px -3px 10px rgba(0,0,0,0.6),
    inset 1px 1px 3px rgba(180,160,130,0.1);
}

/* Prev: bottom-left curl */
.page-corner--prev::before {
  left: 0;
  background: linear-gradient(
    45deg,
    #2a2520 0%,
    #1e1a16 40%,
    #151210 100%
  );
  border-top-right-radius: 8px;
  box-shadow:
    2px -2px 6px rgba(0,0,0,0.5),
    inset -1px 1px 2px rgba(180,160,130,0.06);
  clip-path: polygon(0% 0%, 100% 100%, 0% 100%);
}

.page-corner--prev:hover::before {
  width: 52px;
  height: 52px;
  box-shadow:
    3px -3px 10px rgba(0,0,0,0.6),
    inset -1px 1px 3px rgba(180,160,130,0.1);
}


/* ----------------------------------------
   PAGE NUMBER
   ---------------------------------------- */
.page-number {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--o-font-mono, monospace);
  font-size: 0.6rem;
  color: #3a3630;
  letter-spacing: 0.15em;
  z-index: 5;
  pointer-events: none;
}


/* ----------------------------------------
   BACK LINK
   ---------------------------------------- */
.notations-back {
  position: fixed;
  bottom: 1.2rem;
  left: 1.5rem;
  font-family: var(--o-font-mono, monospace);
  font-size: 0.72rem;
  color: var(--o-text-faint, #4a4540);
  text-decoration: none;
  z-index: 10;
  transition: color 200ms ease;
}

.notations-back:hover {
  color: var(--o-mauve, #b09ac0);
}


/* ----------------------------------------
   RESPONSIVE
   ---------------------------------------- */
@media (max-width: 680px) {
  .journal {
    width: 95vw;
    height: 85vh;
  }

  .journal-spine {
    width: 20px;
  }

  .page-content {
    padding: 2rem 1.8rem 3rem 1.5rem;
  }

  .journal-title {
    font-size: 1.7rem;
  }

  .entry-title {
    font-size: 1.25rem;
  }
}

@media (max-width: 420px) {
  .page-content {
    padding: 1.5rem 1.2rem 2.5rem 1rem;
  }
}