/* ===== GOOGLE FONTS ===== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600&family=Playfair+Display:wght@700;800;900&display=swap');

/* ===== CSS VARIABLES ===== */
:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #111118;
  --bg-card: rgba(20, 20, 35, 0.7);
  --bg-glass: rgba(255, 255, 255, 0.03);
  --border-glass: rgba(255, 255, 255, 0.08);
  --text-primary: #f0f0f5;
  --text-secondary: #a0a0b8;
  --text-muted: #6a6a80;
  --accent-1: #6c5ce7;
  --accent-2: #a29bfe;
  --accent-3: #fd79a8;
  --accent-4: #00cec9;
  --accent-5: #ffeaa7;
  --accent-6: #55efc4;
  --gradient-1: linear-gradient(135deg, #6c5ce7, #a29bfe);
  --gradient-2: linear-gradient(135deg, #fd79a8, #fab1d0);
  --gradient-3: linear-gradient(135deg, #00cec9, #81ecec);
  --gradient-4: linear-gradient(135deg, #ffeaa7, #fdcb6e);
  --gradient-5: linear-gradient(135deg, #55efc4, #00b894);
  --gradient-6: linear-gradient(135deg, #e17055, #d63031);
  --shadow-lg: 0 25px 60px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 40px rgba(108, 92, 231, 0.15);
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ===== RESET & BASE ===== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  overflow-x: hidden;
  min-height: 100vh;
}

/* ===== AMBIENT BACKGROUND ===== */
.ambient-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.ambient-bg .orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.12;
  animation: orbFloat 20s ease-in-out infinite;
}

.ambient-bg .orb:nth-child(1) {
  width: 600px;
  height: 600px;
  background: var(--accent-1);
  top: -200px;
  left: -100px;
  animation-delay: 0s;
}

.ambient-bg .orb:nth-child(2) {
  width: 500px;
  height: 500px;
  background: var(--accent-3);
  top: 50%;
  right: -150px;
  animation-delay: -7s;
}

.ambient-bg .orb:nth-child(3) {
  width: 400px;
  height: 400px;
  background: var(--accent-4);
  bottom: -100px;
  left: 30%;
  animation-delay: -14s;
}

@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(50px, -30px) scale(1.1); }
  50% { transform: translate(-30px, 50px) scale(0.95); }
  75% { transform: translate(40px, 20px) scale(1.05); }
}

/* ===== NAVIGATION ===== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 1rem 2rem;
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-glass);
  transition: var(--transition);
}

.navbar .nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.navbar .logo {
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem;
  font-weight: 800;
  background: var(--gradient-1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  cursor: pointer;
  letter-spacing: -0.5px;
}

.navbar .logo span {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  font-weight: 500;
  display: block;
  background: none;
  -webkit-text-fill-color: var(--text-muted);
  letter-spacing: 2px;
  text-transform: uppercase;
}

.nav-back {
  display: none;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition);
}

.nav-back:hover {
  background: rgba(108, 92, 231, 0.15);
  color: var(--accent-2);
  border-color: rgba(108, 92, 231, 0.3);
}

.nav-back svg {
  width: 16px;
  height: 16px;
}

body.report-view .nav-back {
  display: flex;
}

/* ===== MAIN CONTENT ===== */
.main-content {
  position: relative;
  z-index: 1;
  padding-top: 80px;
}

/* ===== HERO SECTION ===== */
.hero {
  text-align: center;
  padding: 6rem 2rem 4rem;
  max-width: 900px;
  margin: 0 auto;
}

.hero .badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1.2rem;
  background: rgba(108, 92, 231, 0.1);
  border: 1px solid rgba(108, 92, 231, 0.25);
  border-radius: 50px;
  color: var(--accent-2);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 2rem;
  animation: fadeInDown 0.8s ease-out;
}

.hero .badge .dot {
  width: 6px;
  height: 6px;
  background: var(--accent-6);
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.5); }
}

.hero h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2.5rem, 6vw, 4.2rem);
  font-weight: 900;
  line-height: 1.15;
  margin-bottom: 1.5rem;
  animation: fadeInUp 0.8s ease-out 0.2s both;
}

.hero h1 .highlight {
  background: var(--gradient-1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero .subtitle {
  font-size: 1.15rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 2rem;
  animation: fadeInUp 0.8s ease-out 0.4s both;
}

.hero .meta-info {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
  animation: fadeInUp 0.8s ease-out 0.6s both;
}

.hero .meta-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.hero .meta-item svg {
  width: 16px;
  height: 16px;
  color: var(--accent-2);
}

/* ===== APPLICATION CARDS GRID ===== */
.apps-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 2rem 6rem;
}

.section-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 2.5rem;
}

.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-glass);
}

.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 1.5rem;
}

/* ===== APPLICATION CARD ===== */
.app-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 2rem;
  cursor: pointer;
  transition: var(--transition);
  overflow: hidden;
  animation: fadeInUp 0.6s ease-out both;
}

.app-card:nth-child(1) { animation-delay: 0.1s; }
.app-card:nth-child(2) { animation-delay: 0.2s; }
.app-card:nth-child(3) { animation-delay: 0.3s; }
.app-card:nth-child(4) { animation-delay: 0.4s; }
.app-card:nth-child(5) { animation-delay: 0.5s; }
.app-card:nth-child(6) { animation-delay: 0.6s; }

.app-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  opacity: 0;
  transition: var(--transition);
}

.app-card:nth-child(1)::before { background: var(--gradient-1); }
.app-card:nth-child(2)::before { background: var(--gradient-2); }
.app-card:nth-child(3)::before { background: var(--gradient-3); }
.app-card:nth-child(4)::before { background: var(--gradient-4); }
.app-card:nth-child(5)::before { background: var(--gradient-5); }
.app-card:nth-child(6)::before { background: var(--gradient-6); }

.app-card:hover {
  transform: translateY(-6px);
  border-color: rgba(108, 92, 231, 0.2);
  box-shadow: var(--shadow-glow);
}

.app-card:hover::before {
  opacity: 1;
}

.card-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.2rem;
}

.card-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.app-card:nth-child(1) .card-icon { background: rgba(108, 92, 231, 0.15); }
.app-card:nth-child(2) .card-icon { background: rgba(253, 121, 168, 0.15); }
.app-card:nth-child(3) .card-icon { background: rgba(0, 206, 201, 0.15); }
.app-card:nth-child(4) .card-icon { background: rgba(255, 234, 167, 0.15); }
.app-card:nth-child(5) .card-icon { background: rgba(85, 239, 196, 0.15); }
.app-card:nth-child(6) .card-icon { background: rgba(225, 112, 85, 0.15); }

.card-header .card-title-group {
  flex: 1;
}

.card-number {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 0.3rem;
}

.card-title {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.3;
}

.card-domain {
  display: inline-block;
  margin-top: 0.75rem;
  padding: 0.25rem 0.75rem;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: 50px;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.card-desc {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: 1rem;
  line-height: 1.65;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1.5rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--border-glass);
}

.card-read-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent-2);
  transition: var(--transition);
}

.app-card:hover .card-read-btn {
  gap: 0.7rem;
}

.card-read-btn svg {
  width: 16px;
  height: 16px;
  transition: var(--transition);
}

.card-time {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ===== REPORT VIEW ===== */
.report-container {
  display: none;
  max-width: 860px;
  margin: 0 auto;
  padding: 3rem 2rem 6rem;
  animation: fadeInUp 0.6s ease-out;
}

body.report-view .home-view {
  display: none;
}

body.report-view .report-container {
  display: block;
}

/* Report Header */
.report-header {
  margin-bottom: 3rem;
}

.report-header .report-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1rem;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}

.report-header h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 900;
  line-height: 1.2;
  margin-bottom: 1rem;
}

.report-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-top: 1.5rem;
  padding: 1.2rem;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
}

.report-meta-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.report-meta-item strong {
  color: var(--text-secondary);
  font-weight: 600;
}

/* Report Sections */
.report-section {
  margin-bottom: 3rem;
  padding: 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  transition: var(--transition);
}

.report-section:hover {
  border-color: rgba(108, 92, 231, 0.15);
}

.report-section .section-number {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--accent-2);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.report-section h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 1.2rem;
  line-height: 1.3;
}

.report-section h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-top: 1.5rem;
  margin-bottom: 0.8rem;
  color: var(--text-primary);
}

.report-section p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.8;
  margin-bottom: 1rem;
}

.report-section ul, .report-section ol {
  color: var(--text-secondary);
  font-size: 0.95rem;
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

.report-section li {
  margin-bottom: 0.5rem;
  line-height: 1.7;
}

.report-section li::marker {
  color: var(--accent-2);
}

/* Math blocks */
.math-block {
  background: rgba(108, 92, 231, 0.06);
  border: 1px solid rgba(108, 92, 231, 0.15);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin: 1.2rem 0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9rem;
  color: var(--accent-2);
  overflow-x: auto;
  text-align: center;
  line-height: 2;
}

/* Key point callouts */
.callout {
  padding: 1.2rem 1.5rem;
  border-radius: var(--radius-md);
  margin: 1.2rem 0;
  font-size: 0.9rem;
  line-height: 1.7;
}

.callout.info {
  background: rgba(108, 92, 231, 0.08);
  border-left: 3px solid var(--accent-1);
  color: var(--accent-2);
}

.callout.tip {
  background: rgba(0, 206, 201, 0.08);
  border-left: 3px solid var(--accent-4);
  color: var(--accent-4);
}

.callout.example {
  background: rgba(253, 121, 168, 0.08);
  border-left: 3px solid var(--accent-3);
  color: var(--accent-3);
}

.callout strong {
  display: block;
  margin-bottom: 0.4rem;
  font-weight: 700;
}

/* Steps */
.step-list {
  list-style: none;
  padding: 0;
  counter-reset: step;
}

.step-list li {
  counter-increment: step;
  padding: 1rem 1rem 1rem 3.5rem;
  position: relative;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  margin-bottom: 0.75rem;
}

.step-list li::before {
  content: counter(step);
  position: absolute;
  left: 1rem;
  top: 1rem;
  width: 28px;
  height: 28px;
  background: var(--gradient-1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  font-weight: 700;
  color: white;
}

/* Table of contents */
.toc {
  padding: 1.5rem;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  margin-bottom: 2rem;
}

.toc h3 {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 1rem;
  margin-top: 0;
}

.toc ol {
  list-style: none;
  padding: 0;
  counter-reset: toc;
}

.toc li {
  counter-increment: toc;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-glass);
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.toc li:last-child {
  border-bottom: none;
}

.toc li::before {
  content: "0" counter(toc) ".";
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  color: var(--accent-2);
  margin-right: 0.75rem;
  font-size: 0.8rem;
}

/* Navigation between reports */
.report-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-glass);
}

.report-nav-btn {
  flex: 1;
  padding: 1.2rem 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-primary);
  text-align: left;
}

.report-nav-btn:last-child {
  text-align: right;
}

.report-nav-btn:hover {
  border-color: rgba(108, 92, 231, 0.3);
  background: rgba(108, 92, 231, 0.05);
}

.report-nav-btn .nav-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 0.3rem;
}

.report-nav-btn .nav-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--accent-2);
}

/* ===== FOOTER ===== */
.footer {
  text-align: center;
  padding: 3rem 2rem;
  border-top: 1px solid var(--border-glass);
  color: var(--text-muted);
  font-size: 0.8rem;
}

.footer .footer-name {
  font-weight: 600;
  color: var(--text-secondary);
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== SCROLL REVEAL ===== */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .apps-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    padding: 4rem 1.5rem 2rem;
  }

  .hero .meta-info {
    gap: 1rem;
  }

  .report-container {
    padding: 2rem 1rem 4rem;
  }

  .report-section {
    padding: 1.5rem;
  }

  .report-nav {
    flex-direction: column;
  }

  .report-nav-btn:last-child {
    text-align: left;
  }

  .navbar {
    padding: 0.8rem 1rem;
  }
}

@media (max-width: 480px) {
  .hero h1 {
    font-size: 2rem;
  }

  .card-header {
    flex-direction: column;
  }

  .report-meta {
    flex-direction: column;
    gap: 0.75rem;
  }
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: rgba(108, 92, 231, 0.3);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(108, 92, 231, 0.5);
}
