/* ============================================================
   Godil & Co. — Legal Pages Premium Styles v1.0
   3D Effects · Reading Progress · TOC · Tilt Cards
   ============================================================ */

/* ── READING PROGRESS BAR ─────────────────────────────────── */
.reading-progress {
  position: fixed;
  top: 72px;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--gold-light), var(--gold));
  background-size: 200% 100%;
  animation: shimmerProgress 2s linear infinite;
  z-index: 101;
  transition: width 0.15s linear;
  box-shadow: 0 0 10px rgba(201,168,76,0.6);
}
@keyframes shimmerProgress {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── LEGAL HERO ───────────────────────────────────────────── */
.legal-hero {
  position: relative;
  min-height: 65vh;
  display: flex;
  align-items: center;
  background: linear-gradient(140deg, #050E1C 0%, var(--navy) 40%, #0F2D52 70%, var(--blue) 100%);
  overflow: hidden;
  padding-top: 72px;
}

/* Grid pattern */
.legal-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(201,168,76,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(201,168,76,0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
}

/* Radial glow */
.legal-hero::after {
  content: '';
  position: absolute;
  top: -30%;
  left: -10%;
  width: 80%;
  height: 130%;
  background: radial-gradient(ellipse, rgba(201,168,76,0.07) 0%, transparent 60%);
  pointer-events: none;
}

.legal-hero .container {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 3rem;
  padding-bottom: 2rem;
  width: 100%;
}

.legal-hero-text { flex: 1; max-width: 680px; }

.legal-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(201,168,76,0.1);
  border: 1px solid rgba(201,168,76,0.25);
  color: var(--gold-light);
  font-family: var(--font-heading);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 6px 16px;
  border-radius: var(--radius-full);
  margin-bottom: 1.5rem;
}
.legal-hero-badge i { font-size: 0.7rem; }

.legal-hero h1 {
  color: var(--white);
  font-size: clamp(2.4rem, 5vw, 4.5rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.04em;
  margin-bottom: 1.25rem;
  text-shadow:
    0 2px 4px rgba(0,0,0,0.3),
    0 8px 20px rgba(0,0,0,0.2),
    0 20px 40px rgba(0,0,0,0.1);
}
.legal-hero h1 .gold { color: var(--gold); }

.legal-hero-desc {
  font-size: 1.05rem;
  color: rgba(255,255,255,0.7);
  line-height: 1.75;
  max-width: 560px;
  margin-bottom: 2rem;
}

.legal-meta {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.legal-meta-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  color: rgba(255,255,255,0.45);
  font-family: var(--font-heading);
}
.legal-meta-item i { color: var(--gold); font-size: 0.7rem; }
.legal-meta-sep { width: 4px; height: 4px; background: rgba(255,255,255,0.2); border-radius: 50%; }

/* ── 3D WIREFRAME CUBE ────────────────────────────────────── */
.cube-scene {
  flex-shrink: 0;
  position: relative;
  width: 240px;
  height: 240px;
  perspective: 600px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cube {
  width: 140px;
  height: 140px;
  position: absolute;
  top: 50%;
  left: 50%;
  margin: -70px 0 0 -70px;
  transform-style: preserve-3d;
  animation: rotateCube1 20s linear infinite;
}
.cube .face {
  position: absolute;
  width: 140px;
  height: 140px;
  border: 1.5px solid rgba(201,168,76,0.45);
  background: rgba(201,168,76,0.03);
}
.cube .front  { transform: rotateY(  0deg) translateZ(70px); }
.cube .right  { transform: rotateY( 90deg) translateZ(70px); }
.cube .back   { transform: rotateY(180deg) translateZ(70px); }
.cube .left   { transform: rotateY(-90deg) translateZ(70px); }
.cube .top    { transform: rotateX( 90deg) translateZ(70px); }
.cube .bottom { transform: rotateX(-90deg) translateZ(70px); }

@keyframes rotateCube1 {
  from { transform: rotateX(18deg) rotateY(0deg); }
  to   { transform: rotateX(18deg) rotateY(360deg); }
}

/* Inner smaller cube */
.cube-inner {
  width: 70px;
  height: 70px;
  position: absolute;
  top: 50%;
  left: 50%;
  margin: -35px 0 0 -35px;
  transform-style: preserve-3d;
  animation: rotateCube1 12s linear infinite reverse;
}
.cube-inner .face {
  position: absolute;
  width: 70px;
  height: 70px;
  border: 1px solid rgba(201,168,76,0.6);
  background: rgba(201,168,76,0.06);
}
.cube-inner .front  { transform: rotateY(  0deg) translateZ(35px); }
.cube-inner .right  { transform: rotateY( 90deg) translateZ(35px); }
.cube-inner .back   { transform: rotateY(180deg) translateZ(35px); }
.cube-inner .left   { transform: rotateY(-90deg) translateZ(35px); }
.cube-inner .top    { transform: rotateX( 90deg) translateZ(35px); }
.cube-inner .bottom { transform: rotateX(-90deg) translateZ(35px); }

/* Orbiting ring */
.orbit-ring {
  width: 200px;
  height: 200px;
  position: absolute;
  top: 50%;
  left: 50%;
  margin: -100px 0 0 -100px;
  border-radius: 50%;
  border: 1px dashed rgba(201,168,76,0.25);
  transform-style: preserve-3d;
  animation: orbitSpin 15s linear infinite;
}
.orbit-ring::before {
  content: '';
  position: absolute;
  width: 10px;
  height: 10px;
  background: var(--gold);
  border-radius: 50%;
  top: -5px;
  left: 50%;
  margin-left: -5px;
  box-shadow: 0 0 12px rgba(201,168,76,0.8);
}
@keyframes orbitSpin {
  from { transform: rotateX(70deg) rotateZ(0deg); }
  to   { transform: rotateX(70deg) rotateZ(360deg); }
}

/* Glowing orbs */
.hero-orb {
  position: absolute;
  border-radius: 50%;
  opacity: 0.4;
  animation: orbFloat 5s ease-in-out infinite;
  pointer-events: none;
}
.hero-orb-1 {
  width: 8px; height: 8px;
  background: var(--gold);
  box-shadow: 0 0 15px var(--gold);
  top: 30%; right: 20%;
  animation-delay: 0s;
}
.hero-orb-2 {
  width: 5px; height: 5px;
  background: var(--gold-light);
  box-shadow: 0 0 10px var(--gold-light);
  bottom: 25%; left: 15%;
  animation-delay: 1.5s;
}
.hero-orb-3 {
  width: 6px; height: 6px;
  background: var(--white);
  box-shadow: 0 0 10px rgba(255,255,255,0.5);
  top: 60%; right: 35%;
  animation-delay: 3s;
}
@keyframes orbFloat {
  0%, 100% { transform: translateY(0) scale(1); opacity: 0.4; }
  50%       { transform: translateY(-15px) scale(1.3); opacity: 0.8; }
}

/* ── INFO CARDS (top 3 highlights) ───────────────────────── */
.legal-info-strip {
  background: var(--white);
  padding: 2rem 0;
  border-bottom: 1px solid var(--grey-200);
  box-shadow: 0 4px 20px rgba(11,31,58,0.05);
}
.legal-info-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}
.info-card-3d {
  background: var(--white);
  border: 1px solid var(--grey-200);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: all 0.3s var(--ease-out);
  cursor: default;
  position: relative;
  overflow: hidden;
  transform-style: preserve-3d;
}
.info-card-3d::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, rgba(201,168,76,0), transparent);
  transition: background 0.2s;
  pointer-events: none;
}
.info-card-icon-3d {
  width: 44px; height: 44px;
  background: linear-gradient(135deg, var(--navy), var(--blue));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-size: 1rem;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(11,31,58,0.2);
}
.info-card-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-family: var(--font-heading);
  display: block;
  margin-bottom: 0.2rem;
}
.info-card-value {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--navy);
  font-family: var(--font-heading);
}

/* ── LEGAL CONTENT LAYOUT ─────────────────────────────────── */
.legal-content-wrap {
  padding: 5rem 0;
  background: var(--grey-50);
}
.legal-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 3.5rem;
  align-items: start;
}

/* ── TOC SIDEBAR ──────────────────────────────────────────── */
.toc-sidebar {
  position: sticky;
  top: 90px;
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--grey-200);
  padding: 1.5rem;
  max-height: calc(100vh - 110px);
  overflow-y: auto;
  box-shadow: var(--shadow-sm);
}
.toc-sidebar::-webkit-scrollbar { width: 4px; }
.toc-sidebar::-webkit-scrollbar-thumb { background: var(--grey-200); border-radius: 2px; }

.toc-title {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.toc-list { display: flex; flex-direction: column; gap: 0.15rem; }
.toc-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  transition: all 0.25s;
  border-left: 2px solid transparent;
  line-height: 1.4;
  font-family: var(--font-heading);
  font-weight: 500;
  text-decoration: none;
}
.toc-link::before {
  content: '';
  width: 5px; height: 5px;
  background: var(--grey-300);
  border-radius: 50%;
  flex-shrink: 0;
  transition: background 0.25s, transform 0.25s;
}
.toc-link:hover {
  color: var(--navy);
  background: var(--grey-50);
  border-left-color: var(--grey-200);
}
.toc-link.active {
  color: var(--navy);
  background: var(--gold-pale);
  border-left-color: var(--gold);
  font-weight: 600;
}
.toc-link.active::before {
  background: var(--gold);
  transform: scale(1.4);
}

.toc-cta {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--grey-100);
}
.toc-cta a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  font-weight: 600;
  font-family: var(--font-heading);
  background: var(--navy);
  color: var(--white);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  transition: background 0.25s, transform 0.25s;
  text-decoration: none;
}
.toc-cta a:hover { background: var(--blue); transform: translateY(-1px); }

/* ── LEGAL SECTIONS ───────────────────────────────────────── */
.legal-article { display: flex; flex-direction: column; gap: 1.5rem; }

.legal-section {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--grey-200);
  padding: 2.25rem 2.5rem;
  position: relative;
  overflow: hidden;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.legal-section::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(to bottom, var(--navy), var(--blue));
  border-radius: 4px 0 0 4px;
  opacity: 0;
  transition: opacity 0.35s;
}
.legal-section:hover { border-color: var(--grey-300); box-shadow: var(--shadow-md); }
.legal-section:hover::before { opacity: 1; }

/* 3D tilt glow overlay */
.tilt-glow {
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
  background: radial-gradient(circle at 50% 50%, rgba(201,168,76,0.06), transparent 60%);
}
.legal-section:hover .tilt-glow { opacity: 1; }

.section-head {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.sec-num {
  font-family: var(--font-heading);
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  background: var(--gold-pale);
  border: 1px solid rgba(201,168,76,0.25);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 3px;
}
.legal-section h2 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: -0.02em;
  margin: 0;
}
.legal-section h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 0.5rem;
}
.legal-section p {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 0.75rem;
}
.legal-section p:last-child { margin-bottom: 0; }
.legal-section ul {
  list-style: none;
  margin: 0.75rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.legal-section ul li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.7;
}
.legal-section ul li::before {
  content: '';
  width: 6px; height: 6px;
  background: var(--gold);
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 8px;
}

/* Highlight box inside section */
.legal-highlight {
  background: linear-gradient(135deg, var(--gold-pale), rgba(201,168,76,0.08));
  border: 1px solid rgba(201,168,76,0.22);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  margin: 1rem 0;
}
.legal-highlight p {
  font-size: 0.875rem;
  color: var(--navy);
  font-weight: 500;
  margin: 0;
}
.legal-highlight i { color: var(--gold); margin-right: 0.4rem; }

/* ── INTRO SECTION (special) ──────────────────────────────── */
.legal-intro {
  background: linear-gradient(135deg, var(--navy) 0%, var(--blue) 100%);
  border: none;
  color: var(--white);
}
.legal-intro::before { opacity: 0 !important; }
.legal-intro h2 { color: var(--white); font-size: 1.5rem; }
.legal-intro p { color: rgba(255,255,255,0.78); font-size: 1rem; }

/* ── PRINT ────────────────────────────────────────────────── */
.print-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  font-weight: 600;
  font-family: var(--font-heading);
  color: var(--text-muted);
  border: 1px solid var(--grey-200);
  padding: 8px 16px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.25s;
  background: var(--white);
  margin-bottom: 1.5rem;
}
.print-btn:hover {
  color: var(--navy);
  border-color: var(--navy);
  background: var(--grey-50);
}

/* ── RESPONSIVE ───────────────────────────────────────────── */
@media (max-width: 1024px) {
  .legal-layout { grid-template-columns: 220px 1fr; gap: 2.5rem; }
  .cube-scene { width: 180px; height: 180px; }
}
@media (max-width: 768px) {
  .legal-hero { min-height: auto; padding: 7rem 0 4rem; }
  .legal-hero .container { flex-direction: column; }
  .cube-scene { display: none; }
  .legal-layout { grid-template-columns: 1fr; }
  .toc-sidebar { position: static; max-height: none; }
  .legal-info-cards { grid-template-columns: 1fr; }
  .legal-section { padding: 1.5rem; }
}

@media print {
  header, footer, .toc-sidebar, .reading-progress, .print-btn { display: none !important; }
  .legal-layout { grid-template-columns: 1fr; }
  .legal-section { break-inside: avoid; border: 1px solid #ddd; }
}
