/* raduscurtu.com/table-of-contents/: loaded after css/discount.css, adds the contents explorer and its transitions */

.progress { position: fixed; top: 0; left: 0; right: 0; height: 4px; z-index: 60; background: linear-gradient(90deg, var(--gold), var(--amber-2)); transform: scaleX(0); transform-origin: left; }

/* scroll reveal */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s ease, transform .7s cubic-bezier(.2, .7, .2, 1); }
.reveal.in { opacity: 1; transform: none; }
.chapters .reveal:nth-child(3n+2) { transition-delay: .06s; }
.chapters .reveal:nth-child(3n+3) { transition-delay: .12s; }

/* hero */
.toc-hero { padding: 64px 0 72px; }
.toc-hero-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: 56px; align-items: center; }
.toc-hero h1 { font-size: clamp(36px, 4.8vw, 62px); }
.toc-hero h1 em { color: var(--gold-2); }
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 6px 0 26px; max-width: 560px; }
.stats-row div { background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .14); border-radius: 14px; padding: 14px 10px; text-align: center; }
.stats-row b { display: block; font-family: var(--display); font-size: 36px; line-height: 1; color: var(--gold-2); }
.stats-row span { font-size: 12.5px; color: rgba(255, 255, 255, .72); }
.hero-ctas { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; }
.btn-ghost { color: #fff; font-weight: 700; text-decoration: none; padding: 15px 22px; border: 1.5px solid rgba(255, 255, 255, .4); border-radius: 10px; transition: background .2s, border-color .2s; }
.btn-ghost:hover { background: rgba(255, 255, 255, .1); border-color: #fff; }

/* 3D book */
.book3d { position: relative; perspective: 1400px; display: flex; justify-content: center; }
.book3d-in { position: relative; width: min(300px, 80%); transform: rotateY(-24deg) rotateX(4deg); transform-style: preserve-3d; transition: transform .9s cubic-bezier(.2, .7, .2, 1); animation: float 6s ease-in-out infinite; }
.book3d:hover .book3d-in { transform: rotateY(-6deg) rotateX(0); }
.book3d-in img { border-radius: 2px 6px 6px 2px; box-shadow: 30px 40px 60px -20px rgba(0, 0, 0, .8); }
.spine { position: absolute; top: 0; bottom: 0; left: 0; width: 26px; transform: rotateY(90deg) translateZ(13px) translateX(-13px); transform-origin: left; background: linear-gradient(90deg, #4A0B0F, #7E161B); }
.pages-badge { position: absolute; right: 0; bottom: -6px; background: var(--paper); color: var(--ink); border-radius: 12px; padding: 10px 14px; font-size: 12.5px; line-height: 1.3; border-left: 4px solid var(--gold); box-shadow: 0 16px 30px -16px rgba(0, 0, 0, .7); }
.pages-badge b { display: block; font-family: var(--display); font-size: 18px; color: var(--wine); }
@keyframes float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -10px; } }

/* sticky toolbar */
.toolbar { position: sticky; top: 0; z-index: 30; background: rgba(251, 246, 238, .94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); padding: 14px 0 10px; scroll-margin-top: 0; }
.search { position: relative; max-width: 720px; margin: 0 auto 10px; }
.search svg { position: absolute; left: 16px; top: 50%; width: 20px; height: 20px; transform: translateY(-50%); color: var(--muted); }
.search input { width: 100%; font: inherit; font-size: 17px; padding: 14px 18px 14px 46px; border: 2px solid var(--line); border-radius: 99px; background: #fff; color: var(--ink); outline: none; transition: border-color .2s, box-shadow .2s; }
.search input:focus { border-color: var(--gold); box-shadow: 0 0 0 5px rgba(201, 154, 62, .18); }
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-bottom: 8px; }
.chip { font: inherit; font-size: 13.5px; font-weight: 600; padding: 6px 13px; border-radius: 99px; border: 1px solid var(--line); background: #fff; color: var(--ink-2); cursor: pointer; transition: background .2s, color .2s, border-color .2s, transform .2s; }
.chip:hover { border-color: var(--gold); transform: translateY(-1px); }
.chip.on { background: var(--wine); border-color: var(--wine); color: #fff; }
.tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 14px; font-size: 13.5px; }
.tools p { margin: 0; color: var(--red); font-weight: 600; min-height: 1px; }
.tools button { font: inherit; font-size: 13px; font-weight: 600; background: none; border: 0; color: var(--muted); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.part-nav { display: flex; gap: 4px; background: #fff; border: 1px solid var(--line); border-radius: 99px; padding: 3px; }
.part-nav a { font-weight: 700; font-size: 13px; color: var(--ink-2); text-decoration: none; padding: 5px 12px; border-radius: 99px; transition: background .25s, color .25s; }
.part-nav a.on { background: var(--wine); color: #fff; }

/* contents */
.toc { background: var(--cream); padding-top: 50px; }
.toc-wrap { max-width: 980px; }
.part { text-align: center; margin: 30px 0 26px; scroll-margin-top: 190px; }
.part-label { display: inline-block; font-size: 12px; font-weight: 800; letter-spacing: .2em; text-transform: uppercase; color: #fff; background: var(--red); padding: 5px 14px; border-radius: 99px; margin-bottom: 12px; }
.part h2 { color: var(--wine); }
.part h2 em { color: var(--red); }
.part p { font-family: var(--serif); font-size: 18px; color: var(--ink-2); max-width: 36em; margin: 0 auto; }
.chapters { display: grid; gap: 12px; }
.ch { background: var(--paper); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; scroll-margin-top: 200px; transition: box-shadow .3s, border-color .3s, opacity .7s ease, transform .7s cubic-bezier(.2, .7, .2, 1); }
.ch:hover { border-color: #DCC7A3; box-shadow: 0 18px 40px -30px rgba(74, 11, 15, .6); }
.ch.open { border-color: var(--gold); box-shadow: 0 24px 50px -34px rgba(74, 11, 15, .7); }
.ch.hide { display: none; }
.ch-head { width: 100%; display: grid; grid-template-columns: 64px 1fr auto 30px; gap: 16px; align-items: center; text-align: left; font: inherit; color: inherit; background: none; border: 0; padding: 18px 20px; cursor: pointer; }
.ch-num { font-family: var(--display); font-size: 34px; font-weight: 700; color: var(--gold); line-height: 1; transition: color .3s, transform .3s; }
.ch.open .ch-num, .ch-head:hover .ch-num { color: var(--red); transform: scale(1.06); }
.ch-title b { display: block; font-family: var(--display); font-size: 20px; color: var(--wine); line-height: 1.25; }
.ch-title small { display: block; font-family: var(--serif); font-size: 15.5px; color: var(--ink-2); margin-top: 3px; }
.ch-meta { text-align: right; white-space: nowrap; }
.ch-page { display: block; font-weight: 700; font-size: 14px; color: var(--ink); }
.ch-count { font-size: 12.5px; color: var(--muted); }
.ch-plus { position: relative; width: 30px; height: 30px; border-radius: 50%; background: var(--cream); transition: background .3s, transform .4s; }
.ch-plus::before, .ch-plus::after { content: ""; position: absolute; left: 50%; top: 50%; width: 12px; height: 2px; background: var(--wine); transform: translate(-50%, -50%); transition: transform .4s; }
.ch-plus::after { transform: translate(-50%, -50%) rotate(90deg); }
.ch.open .ch-plus { background: var(--wine); transform: rotate(180deg); }
.ch.open .ch-plus::before, .ch.open .ch-plus::after { background: #fff; }
.ch.open .ch-plus::after { transform: translate(-50%, -50%) rotate(0); }
.ch-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .45s cubic-bezier(.2, .7, .2, 1); }
.ch.open .ch-body { grid-template-rows: 1fr; }
.ch-inner { overflow: hidden; }
.subs { list-style: none; margin: 0; padding: 4px 24px 20px 100px; columns: 2; column-gap: 34px; }
.subs li { display: flex; align-items: baseline; gap: 6px; break-inside: avoid; padding: 6px 0; font-size: 15px; opacity: 0; transform: translateX(-8px); transition: opacity .35s, transform .35s; }
.ch.open .subs li { opacity: 1; transform: none; }
.ch.open .subs li:nth-child(n+4) { transition-delay: .05s; }
.ch.open .subs li:nth-child(n+8) { transition-delay: .1s; }
.ch.open .subs li:nth-child(n+14) { transition-delay: .15s; }
.subs .t { color: var(--ink); }
.subs .dots { flex: 1; border-bottom: 1px dotted #CDBB9C; transform: translateY(-4px); min-width: 12px; }
.subs .p { font-weight: 700; font-size: 13.5px; color: var(--wine); }
.subs li.dim { opacity: .35 !important; }
.subs mark, .ch-title mark { background: rgba(242, 174, 54, .45); color: inherit; border-radius: 3px; padding: 0 2px; }
.no-subs { margin: 0; padding: 0 24px 20px 100px; font-family: var(--serif); font-style: italic; color: var(--muted); }
.note { display: flex; gap: 18px; align-items: center; max-width: 760px; margin: 46px auto 10px; background: var(--paper); border-left: 4px solid var(--gold); border-radius: 0 16px 16px 0; padding: 20px 24px; }
.note img { width: 72px; height: 72px; flex: none; border-radius: 50%; object-fit: cover; object-position: top; }
.note p { margin: 0; font-family: var(--display); font-style: italic; font-size: 19px; line-height: 1.5; color: var(--wine); }
.note .hand { display: block; font-family: var(--hand); font-style: normal; font-size: 32px; margin-top: 4px; }
.mid-buy { display: grid; grid-template-columns: 120px 1fr; gap: 26px; align-items: center; margin: 46px auto 0; max-width: 760px; background: radial-gradient(120% 140% at 0% 0%, #8C1A20 0%, var(--wine) 45%, var(--wine-2) 100%); color: #fff; border-radius: 18px; padding: 24px 28px; }
.mid-buy img { transform: rotate(-5deg); border-radius: 2px; box-shadow: 0 20px 34px -14px rgba(0, 0, 0, .8); }
.mid-buy h3 { font-size: 24px; margin-bottom: 6px; }
.mid-buy p { color: rgba(255, 255, 255, .85); font-size: 16px; }
.mid-buy s { opacity: .6; }
.mid-buy b { color: var(--gold-2); font-size: 22px; }

/* real pages */
.real-pages { background: var(--paper); }
.real-pages h2, .faq h2, .final h2, .bundles h2, .bonuses h2, .reviews h2 { color: var(--wine); }
.shots { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
.shot { margin: 0; transition: opacity .7s ease, transform .5s cubic-bezier(.2, .7, .2, 1); }
.shot:nth-child(2) { transition-delay: .08s; } .shot:nth-child(3) { transition-delay: .16s; } .shot:nth-child(4) { transition-delay: .24s; } .shot:nth-child(5) { transition-delay: .32s; }
.shot img { border-radius: 8px; border: 1px solid var(--line); box-shadow: 0 20px 40px -28px rgba(0, 0, 0, .6); transition: transform .35s, box-shadow .35s; }
.shot:hover img { transform: translateY(-8px) rotate(-1.5deg); box-shadow: 0 30px 50px -26px rgba(74, 11, 15, .7); }
.shot figcaption { text-align: center; font-size: 13.5px; color: var(--muted); margin-top: 10px; }

@media (prefers-reduced-motion: reduce) {
  .reveal, .ch, .subs li, .ch-body, .book3d-in { transition: none !important; animation: none !important; opacity: 1; transform: none; }
}
@media (max-width: 1000px) {
  .shots { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 860px) {
  .toc-hero-grid { grid-template-columns: minmax(0, 1fr); gap: 36px; }
  .book3d { order: -1; }
  .book3d-in { width: 200px; }
  .pages-badge { right: 8%; }
  .subs { columns: 1; padding-left: 24px; }
  .no-subs { padding-left: 24px; }
}
@media (max-width: 600px) {
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .toolbar { padding: 10px 0 8px; }
  .chips { flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; padding-bottom: 4px; scrollbar-width: none; }
  .chip { flex: none; }
  .search input { font-size: 16px; padding: 12px 14px 12px 42px; }
  .tools button { display: none; }
  .ch-head { grid-template-columns: 42px 1fr 26px; gap: 12px; padding: 16px 14px; }
  .ch-meta { display: none; }
  .ch-num { font-size: 26px; }
  .ch-title b { font-size: 17.5px; }
  .ch-title small { font-size: 14.5px; }
  .ch-plus { width: 26px; height: 26px; }
  .subs { padding: 2px 16px 16px; }
  .no-subs { padding: 0 16px 16px; }
  .shots { grid-template-columns: repeat(2, 1fr); }
  .shots .shot:last-child { grid-column: 1 / -1; max-width: 50%; justify-self: center; }
  .note { flex-direction: column; text-align: center; border-left: 0; border-top: 4px solid var(--gold); border-radius: 0 0 16px 16px; }
  .mid-buy { grid-template-columns: minmax(0, 1fr); text-align: center; }
  .mid-buy img { width: 110px; margin: 0 auto; }
}
