/* Pudding Styles — Interactive Scrollytelling for Cephas
 * Inspired by pudding.cool
 * Applies to: letters, articles, innovations, general pages
 * Does NOT apply to: academic papers (they keep clean prose)
 */

/* ============================================================================
   HEOHO HERO BANNER — Homepage
   ============================================================================ */

.heoho-hero {
  background-color: #1A1F36;
  padding: 80px 24px;
  text-align: center;
  width: 100%;
}

.heoho-hero__content {
  max-width: 720px;
  margin: 0 auto;
}

.heoho-hero__title {
  color: #D4A843;
  font-size: 3rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 16px;
  line-height: 1.2;
}

.heoho-hero__tagline {
  color: #FFFFFF;
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 32px;
}

.heoho-hero__body {
  color: #E2E8F0;
  font-size: 1.1rem;
  line-height: 1.8;
  margin-bottom: 32px;
}

.heoho-hero__emphasis {
  font-weight: 600;
  margin-top: 16px;
}

.heoho-hero__scripture {
  color: rgba(212, 168, 67, 0.6);
  font-size: 0.9rem;
  font-style: italic;
  margin-bottom: 24px;
}

.heoho-hero__amplifier {
  color: #F59E0B;
  font-size: 1rem;
  font-weight: 600;
}

@media (max-width: 768px) {
  .heoho-hero {
    padding: 48px 16px;
  }
  .heoho-hero__title {
    font-size: 1.8rem;
    letter-spacing: 0.1em;
  }
  .heoho-hero__tagline {
    font-size: 1.1rem;
  }
  .heoho-hero__body {
    font-size: 0.95rem;
  }
}

/* ============================================================================
   BASE: Scroll-triggered reveal
   ============================================================================ */

.pudding-reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.pudding-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Slide-in variants */
.pudding-reveal--left {
  transform: translateX(-40px);
}
.pudding-reveal--left.is-visible {
  transform: translateX(0);
}

.pudding-reveal--right {
  transform: translateX(40px);
}
.pudding-reveal--right.is-visible {
  transform: translateX(0);
}

/* Scale variant */
.pudding-reveal--scale {
  transform: scale(0.9);
}
.pudding-reveal--scale.is-visible {
  transform: scale(1);
}

/* ============================================================================
   STICKY SECTIONS
   ============================================================================ */

.pudding-section {
  position: relative;
  min-height: 80vh;
  padding: 2rem 0;
}

.pudding-sticky {
  position: sticky;
  top: 20vh;
  z-index: 10;
  padding: 1.5rem 2rem;
  background: rgba(15, 23, 42, 0.95);
  border-left: 4px solid #f59e0b;
  border-radius: 0 8px 8px 0;
  backdrop-filter: blur(8px);
  margin-bottom: 2rem;
}

.pudding-sticky h2,
.pudding-sticky h3 {
  margin: 0;
  color: #f8fafc;
  font-size: 1.5rem;
}

.pudding-content {
  position: relative;
  z-index: 5;
}

/* ============================================================================
   STAT CALLOUTS
   ============================================================================ */

.pudding-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 2rem;
  margin: 2rem auto;
  max-width: 400px;
  text-align: center;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.8), rgba(30, 41, 59, 0.8));
  border: 1px solid rgba(245, 158, 11, 0.3);
}

/* ============================================================================
   K346 Cross-Link Blocks (Pudding + Papers)
   ============================================================================ */

.pudding-crosslinks {
  margin: 2rem 0;
  padding: 1rem 1.25rem;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.45);
}

.pudding-crosslinks h3 {
  margin: 0 0 0.75rem 0;
  font-size: 1rem;
  color: #f8fafc;
}

.pudding-crosslinks ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.pudding-crosslinks li {
  margin: 0;
}

.pudding-crosslinks a {
  display: inline-block;
  font-size: 0.85rem;
  line-height: 1.2;
  text-decoration: none;
  color: #e2e8f0;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 999px;
  padding: 0.35rem 0.6rem;
  background: rgba(15, 23, 42, 0.35);
}

.pudding-crosslinks a:hover {
  border-color: rgba(245, 158, 11, 0.5);
  color: #fbbf24;
}

.pudding-stat__number {
  font-size: 4rem;
  font-weight: 900;
  line-height: 1;
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.pudding-stat__label {
  font-size: 1rem;
  color: #94a3b8;
  margin-top: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.pudding-stat__sublabel {
  font-size: 0.875rem;
  color: #64748b;
  margin-top: 0.25rem;
}

/* Color variants */
.pudding-stat--green .pudding-stat__number {
  background: linear-gradient(135deg, #22c55e, #10b981);
  -webkit-background-clip: text;
  background-clip: text;
}

.pudding-stat--blue .pudding-stat__number {
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  -webkit-background-clip: text;
  background-clip: text;
}

/* ============================================================================
   COMPARISON BOXES
   ============================================================================ */

.pudding-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin: 2rem 0;
}

.pudding-compare__box {
  padding: 1.5rem;
  border-radius: 12px;
  border: 1px solid rgba(100, 116, 139, 0.3);
  background: rgba(15, 23, 42, 0.6);
}

.pudding-compare__box--before {
  border-color: rgba(239, 68, 68, 0.3);
  background: rgba(127, 29, 29, 0.15);
}

.pudding-compare__box--after {
  border-color: rgba(34, 197, 94, 0.3);
  background: rgba(20, 83, 45, 0.15);
}

.pudding-compare__title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #94a3b8;
  margin-bottom: 0.75rem;
}

.pudding-compare__box--before .pudding-compare__title { color: #f87171; }
.pudding-compare__box--after .pudding-compare__title { color: #4ade80; }

.pudding-compare__value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #f8fafc;
}

/* ============================================================================
   STICKY QUOTES
   ============================================================================ */

.pudding-quote {
  position: sticky;
  top: 30vh;
  margin: 3rem 0;
  padding: 2rem 2.5rem;
  background: rgba(15, 23, 42, 0.95);
  border-left: 4px solid #6366f1;
  border-radius: 0 12px 12px 0;
  backdrop-filter: blur(8px);
  font-size: 1.25rem;
  font-style: italic;
  color: #e2e8f0;
  line-height: 1.6;
  z-index: 10;
}

.pudding-quote__attribution {
  display: block;
  margin-top: 1rem;
  font-size: 0.875rem;
  font-style: normal;
  color: #94a3b8;
}

/* ============================================================================
   CALLOUT BOXES
   ============================================================================ */

.pudding-callout {
  margin: 2rem 0;
  padding: 1.5rem 2rem;
  border-radius: 12px;
  border-left: 4px solid;
}

.pudding-callout__title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.75rem;
}

.pudding-callout__body {
  font-size: 1rem;
  line-height: 1.7;
  color: #e2e8f0;
}

.pudding-callout__body p:last-child {
  margin-bottom: 0;
}

/* Insight — amber */
.pudding-callout--insight {
  background: rgba(245, 158, 11, 0.08);
  border-color: #f59e0b;
}
.pudding-callout--insight .pudding-callout__title {
  color: #fbbf24;
}

/* Warning — red */
.pudding-callout--warning {
  background: rgba(239, 68, 68, 0.08);
  border-color: #ef4444;
}
.pudding-callout--warning .pudding-callout__title {
  color: #f87171;
}

/* Tip — green */
.pudding-callout--tip {
  background: rgba(34, 197, 94, 0.08);
  border-color: #22c55e;
}
.pudding-callout--tip .pudding-callout__title {
  color: #4ade80;
}

/* Note — blue */
.pudding-callout--note {
  background: rgba(59, 130, 246, 0.08);
  border-color: #3b82f6;
}
.pudding-callout--note .pudding-callout__title {
  color: #60a5fa;
}

/* SEC — purple (for disclaimers) */
.pudding-callout--sec {
  background: rgba(139, 92, 246, 0.08);
  border-color: #8b5cf6;
}
.pudding-callout--sec .pudding-callout__title {
  color: #a78bfa;
}

/* ============================================================================
   FLOW DIAGRAMS
   ============================================================================ */

.pudding-flow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin: 2rem 0;
  padding: 2rem;
  background: rgba(15, 23, 42, 0.6);
  border-radius: 16px;
  border: 1px solid rgba(100, 116, 139, 0.2);
}

.pudding-flow__step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 1.25rem;
  background: rgba(30, 41, 59, 0.8);
  border-radius: 12px;
  border: 1px solid rgba(245, 158, 11, 0.2);
  min-width: 120px;
  text-align: center;
}

.pudding-flow__number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: #0f172a;
  font-weight: 900;
  font-size: 0.8rem;
}

.pudding-flow__label {
  font-size: 0.85rem;
  color: #e2e8f0;
  font-weight: 500;
}

.pudding-flow__arrow {
  font-size: 1.5rem;
  color: #f59e0b;
  font-weight: 700;
}

.pudding-flow__arrow--loop {
  font-size: 2rem;
  color: #22c55e;
  margin-left: 0.5rem;
}

/* ============================================================================
   FLIPBLOCK — Skipping Stones Collapsible Sections
   Used by academic papers for At a Glance / More Details / In Depth
   Clean, minimal design — NOT pudding-animated
   ============================================================================ */

.flipblock {
  margin: 1.5rem 0;
  border: 1px solid rgba(100, 116, 139, 0.25);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.4);
}

.flipblock__header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  cursor: pointer;
  list-style: none;
  user-select: none;
  background: rgba(30, 41, 59, 0.6);
  border-bottom: 1px solid transparent;
  transition: background 0.2s ease;
}

.flipblock__header:hover {
  background: rgba(30, 41, 59, 0.8);
}

.flipblock__header::-webkit-details-marker {
  display: none;
}

.flipblock__title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #f8fafc;
  flex-shrink: 0;
}

.flipblock__preview {
  font-size: 0.85rem;
  color: #94a3b8;
  font-style: italic;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.flipblock__chevron {
  font-size: 0.7rem;
  color: #64748b;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.flipblock[open] .flipblock__chevron {
  transform: rotate(90deg);
}

.flipblock[open] .flipblock__header {
  border-bottom-color: rgba(100, 116, 139, 0.25);
}

.flipblock__body {
  padding: 1.5rem;
  line-height: 1.7;
  color: #e2e8f0;
}

.flipblock__body h3 {
  color: #f8fafc;
  margin-top: 1.5rem;
}

.flipblock__body h3:first-child {
  margin-top: 0;
}

.flipblock__body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}

.flipblock__body th,
.flipblock__body td {
  padding: 0.5rem 0.75rem;
  border: 1px solid rgba(100, 116, 139, 0.2);
  font-size: 0.9rem;
}

.flipblock__body th {
  background: rgba(30, 41, 59, 0.6);
  font-weight: 600;
  color: #f8fafc;
  text-align: left;
}

.flipblock__body code {
  background: rgba(30, 41, 59, 0.8);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.85em;
}

.flipblock__body pre {
  background: rgba(15, 23, 42, 0.8);
  padding: 1rem;
  border-radius: 8px;
  overflow-x: auto;
  margin: 1rem 0;
}

/* ============================================================================
   PROGRESS INDICATOR
   ============================================================================ */

.pudding-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: rgba(30, 41, 59, 0.5);
  z-index: 1000;
}

.pudding-progress__bar {
  height: 100%;
  background: linear-gradient(90deg, #f59e0b, #ef4444);
  width: 0%;
  transition: width 0.1s linear;
}

/* Chapter markers */
.pudding-chapters {
  position: fixed;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  z-index: 100;
}

.pudding-chapter-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #475569;
  border: 2px solid #64748b;
  cursor: pointer;
  transition: all 0.3s ease;
}

.pudding-chapter-dot.is-active {
  background: #f59e0b;
  border-color: #f59e0b;
  transform: scale(1.3);
}

.pudding-chapter-dot:hover {
  background: #94a3b8;
  border-color: #94a3b8;
}

/* ============================================================================
   RESPONSIVE
   ============================================================================ */

@media (max-width: 768px) {
  .pudding-stat__number {
    font-size: 3rem;
  }

  .pudding-compare {
    grid-template-columns: 1fr;
  }

  .pudding-sticky {
    top: 10vh;
    padding: 1rem 1.5rem;
  }

  .pudding-sticky h2,
  .pudding-sticky h3 {
    font-size: 1.2rem;
  }

  .pudding-quote {
    top: 15vh;
    padding: 1.5rem;
    font-size: 1.1rem;
  }

  .pudding-chapters {
    display: none;
  }

  .pudding-flow {
    flex-direction: column;
    padding: 1.5rem;
  }

  .pudding-flow__arrow {
    transform: rotate(90deg);
  }

  .pudding-flow__arrow--loop {
    transform: none;
  }

  .pudding-callout {
    padding: 1rem 1.25rem;
  }

  .flipblock__preview {
    display: none;
  }

  .flipblock__body {
    padding: 1rem;
  }
}

/* ============================================================================
   PRINT FALLBACK — No animations in print
   ============================================================================ */

@media print {
  .pudding-reveal {
    opacity: 1 !important;
    transform: none !important;
  }

  .pudding-sticky {
    position: static !important;
  }

  .pudding-quote {
    position: static !important;
  }

  .pudding-progress,
  .pudding-chapters {
    display: none !important;
  }

  .pudding-callout {
    border-left-width: 2px;
    background: #f8fafc !important;
  }

  .pudding-callout__body,
  .pudding-callout__title {
    color: #1e293b !important;
  }

  .flipblock {
    border: 1px solid #cbd5e1;
  }

  .flipblock[open] .flipblock__body,
  .flipblock .flipblock__body {
    display: block !important;
  }

  .flipblock__header {
    background: #f1f5f9 !important;
  }

  .flipblock__title,
  .flipblock__body {
    color: #1e293b !important;
  }
}

/* ============================================================================
   OPS DOCUMENT TABLES — XLSX export views
   ============================================================================ */

.ops-table-wrap {
  width: 100%;
  overflow-x: auto;
  margin: 1.5rem 0 2rem;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.35);
}

.ops-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  font-size: 0.95rem;
  line-height: 1.45;
}

.ops-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #1e293b;
  color: #f8fafc;
  text-align: left;
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.45);
  font-weight: 600;
  white-space: nowrap;
}

.ops-table tbody td {
  padding: 0.58rem 0.75rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  vertical-align: top;
}

.ops-table tbody tr:nth-child(odd) {
  background: rgba(30, 41, 59, 0.45);
}

.ops-table tbody tr:nth-child(even) {
  background: rgba(15, 23, 42, 0.2);
}

.ops-table tbody tr:hover {
  background: rgba(59, 130, 246, 0.15);
}

@media (max-width: 900px) {
  .ops-table-wrap {
    margin-left: -0.2rem;
    margin-right: -0.2rem;
  }

  .ops-table {
    min-width: 620px;
    font-size: 0.9rem;
  }

  .ops-table thead th,
  .ops-table tbody td {
    padding: 0.5rem 0.6rem;
  }
}

@media print {
  .ops-table-wrap {
    overflow: visible !important;
    border: 1px solid #cbd5e1;
    background: #ffffff !important;
  }

  .ops-table {
    min-width: 0;
    width: 100%;
    color: #111827 !important;
    font-size: 9pt;
  }

  .ops-table thead th {
    position: static;
    color: #111827 !important;
    background: #e2e8f0 !important;
    border-bottom: 1px solid #94a3b8;
  }

  .ops-table tbody td {
    border-bottom: 1px solid #e2e8f0;
    color: #111827 !important;
    background: #ffffff !important;
  }

  .ops-table tbody tr:nth-child(odd),
  .ops-table tbody tr:nth-child(even),
  .ops-table tbody tr:hover {
    background: #ffffff !important;
  }
}
