/* docs/style.css - Minimalist Palette #10 & Page-by-Page Tabbed Architecture */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&family=Newsreader:ital,opsz,wght@0,6..72,400;0,6..72,600;1,6..72,400&display=swap');

:root {
  /* Minimalist Color Palette #10 */
  --c-light: #EBEAEC;        /* 1: #EBEAEC - Text primary, highlights */
  --c-muted: #9D9BA2;        /* 2: #9D9BA2 - Text secondary, subtle borders */
  --c-slate: #55535B;        /* 3: #55535B - Borders, cards hover, active pills */
  --c-aubergine: #3C313D;    /* 4: #3C313D - Surface cards, headers, nav */
  --c-dark: #18141D;         /* 5: #18141D - Main dark background */

  /* Functional mappings */
  --bg-main: var(--c-dark);
  --bg-surface: var(--c-aubergine);
  --bg-card: rgba(60, 49, 61, 0.65);
  --bg-card-hover: rgba(85, 83, 91, 0.5);
  --border-color: rgba(157, 155, 162, 0.25);
  --border-active: var(--c-muted);
  --text-main: var(--c-light);
  --text-muted: var(--c-muted);
  --accent-glow: rgba(157, 155, 162, 0.15);

  /* Typography */
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-serif: 'Newsreader', Georgia, serif;
  --font-mono: 'JetBrains Mono', monospace;

  --header-height: 72px;
  --footer-height: 54px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  width: 100%;
  overflow: hidden; /* No global page scrolling */
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: var(--font-sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Background Atmosphere */
body::before {
  content: '';
  position: fixed;
  top: -20%;
  left: -10%;
  width: 140%;
  height: 140%;
  background: 
    radial-gradient(circle at 20% 15%, rgba(60, 49, 61, 0.45) 0%, transparent 50%),
    radial-gradient(circle at 80% 85%, rgba(85, 83, 91, 0.2) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* App Shell Layout */
.app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
  position: relative;
  z-index: 1;
}

/* Top App Header & Breadcrumbs Bar */
.top-navbar {
  height: var(--header-height);
  background: rgba(24, 20, 29, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  flex-shrink: 0;
  z-index: 100;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand-badge {
  background: var(--c-aubergine);
  color: var(--c-light);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  letter-spacing: 0.5px;
}

.brand-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--c-light);
  letter-spacing: -0.02em;
}

/* Breadcrumb Navigation Tabs */
.breadcrumbs-nav {
  display: flex;
  align-items: center;
  background: rgba(60, 49, 61, 0.5);
  padding: 0.3rem 0.4rem;
  border-radius: 9999px;
  border: 1px solid var(--border-color);
  gap: 0.25rem;
  overflow-x: auto;
  scrollbar-width: none;
}
.breadcrumbs-nav::-webkit-scrollbar {
  display: none;
}

.crumb-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 1rem;
  border-radius: 9999px;
  border: none;
  background: transparent;
  color: var(--c-muted);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  text-decoration: none;
}

.crumb-btn .crumb-num {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  opacity: 0.7;
}

.crumb-btn:hover {
  color: var(--c-light);
  background: rgba(85, 83, 91, 0.3);
}

.crumb-btn.active {
  background: var(--c-light);
  color: var(--c-dark);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}
.crumb-btn.active .crumb-num {
  color: var(--c-dark);
  font-weight: 700;
  opacity: 1;
}

/* Quick Deliverable Links */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.action-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.85rem;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
  border: 1px solid var(--border-color);
  color: var(--c-light);
  background: rgba(60, 49, 61, 0.5);
}

.action-pill:hover {
  background: var(--c-slate);
  border-color: var(--c-muted);
  transform: translateY(-1px);
}

.action-pill.primary {
  background: var(--c-light);
  color: var(--c-dark);
  border-color: var(--c-light);
}
.action-pill.primary:hover {
  background: #ffffff;
}

/* Main Viewport Container (Page-by-Page) */
.page-viewport {
  flex: 1;
  position: relative;
  overflow: hidden;
  display: flex;
}

/* Each Slide as an Isolated Single Page */
.page-view {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  padding: 1.5rem 3.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  transform: scale(0.98) translateY(12px);
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--c-slate) transparent;
}

.page-view.active {
  opacity: 1;
  visibility: visible;
  transform: scale(1) translateY(0);
  z-index: 10;
}

.page-content-wrapper {
  max-width: 1280px;
  width: 100%;
  margin: auto 0;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

/* Page Headers */
.view-header {
  margin-bottom: 0.3rem;
}

.view-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--c-muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 0.2rem;
}

.view-title {
  font-size: 2.1rem;
  font-weight: 700;
  color: var(--c-light);
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.view-desc {
  font-size: 1rem;
  color: var(--c-muted);
  max-width: 800px;
  margin-top: 0.3rem;
}

/* Grid Layouts */
.grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  align-items: stretch;
}

.grid-3col {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.2rem;
}

/* Minimalist Cards with Palette #10 */
.m-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1.4rem;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  transition: border-color 0.2s, background 0.2s;
}

.m-card:hover {
  border-color: var(--c-slate);
  background: var(--bg-card-hover);
}

.card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--c-light);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.card-text {
  font-size: 0.92rem;
  color: var(--c-muted);
  line-height: 1.6;
}

/* Image Frames */
.plot-card {
  background: rgba(24, 20, 29, 0.6);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 0.4rem;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  transition: transform 0.2s, border-color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.plot-card:hover {
  transform: translateY(-2px);
  border-color: var(--c-muted);
}

.plot-card img {
  width: 100%;
  height: auto;
  max-height: 340px;
  object-fit: contain;
  border-radius: 8px;
  display: block;
}

.plot-zoom-hint {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(24, 20, 29, 0.85);
  color: var(--c-light);
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  pointer-events: none;
  font-family: var(--font-mono);
}

/* Equations Box */
.formula-box {
  background: rgba(24, 20, 29, 0.85);
  border: 1px solid var(--c-slate);
  border-radius: 12px;
  padding: 1rem;
  text-align: center;
  color: var(--c-light);
  font-size: 1.05rem;
}

/* Hero Section Specifics */
.hero-wrapper {
  text-align: center;
  max-width: 880px;
  margin: 0 auto;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(60, 49, 61, 0.8);
  border: 1px solid var(--c-slate);
  color: var(--c-light);
  padding: 0.35rem 0.9rem;
  border-radius: 9999px;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 1.2rem;
}

.hero-title {
  font-size: 3.4rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.1;
  color: var(--c-light);
  margin-bottom: 1rem;
}

.hero-subtitle {
  font-size: 1.2rem;
  color: var(--c-muted);
  font-weight: 400;
  line-height: 1.6;
  margin-bottom: 2rem;
}

.hero-cta-grid {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 2.2rem;
}

.hero-meta-row {
  display: flex;
  justify-content: center;
  gap: 3rem;
  padding-top: 1.8rem;
  border-top: 1px solid var(--border-color);
}

.hero-meta-item {
  text-align: left;
}

.hero-meta-label {
  font-size: 0.72rem;
  color: var(--c-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-family: var(--font-mono);
}

.hero-meta-val {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--c-light);
}

/* Interactive Playground Layout */
.playground-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 1.5rem;
  align-items: stretch;
}

.control-item {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.control-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--c-light);
}

.val-pill {
  font-family: var(--font-mono);
  background: var(--c-dark);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.78rem;
  color: var(--c-light);
  border: 1px solid var(--border-color);
}

input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  background: var(--c-slate);
  border-radius: 3px;
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  background: var(--c-light);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 8px rgba(0,0,0,0.5);
}

.r0-card {
  background: var(--c-dark);
  border: 1px solid var(--c-slate);
  border-radius: 12px;
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.8rem;
}

.r0-val-display {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--c-light);
}

.canvas-card {
  background: rgba(24, 20, 29, 0.8);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  position: relative;
}

.canvas-card canvas {
  width: 100% !important;
  height: 100% !important;
  max-height: 380px;
}

/* Bottom Pagination & Navigation Controls */
.bottom-footer {
  height: var(--footer-height);
  background: rgba(24, 20, 29, 0.9);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  flex-shrink: 0;
  z-index: 100;
}

.footer-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--c-aubergine);
  color: var(--c-light);
  border: 1px solid var(--border-color);
  padding: 0.35rem 0.9rem;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.footer-btn:hover:not(:disabled) {
  background: var(--c-slate);
  border-color: var(--c-muted);
}

.footer-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.footer-dots {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--c-slate);
  cursor: pointer;
  transition: all 0.2s;
}

.dot.active {
  width: 24px;
  border-radius: 4px;
  background: var(--c-light);
}

/* Modal for Zoomed Plots */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(24, 20, 29, 0.92);
  backdrop-filter: blur(16px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  padding: 2rem;
}

.modal.visible {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  max-width: 90vw;
  max-height: 90vh;
  position: relative;
  background: var(--c-aubergine);
  padding: 1rem;
  border-radius: 16px;
  border: 1px solid var(--c-slate);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
}

.modal-img {
  max-width: 100%;
  max-height: 82vh;
  object-fit: contain;
  border-radius: 8px;
  display: block;
}

.modal-close {
  position: absolute;
  top: -16px;
  right: -16px;
  background: var(--c-light);
  color: var(--c-dark);
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 1.4rem;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

/* Documentation Pages Layout (relazione.html, dispense.html, guida_orale.html) */
.docs-body {
  overflow-y: auto !important;
  background-color: var(--c-dark);
  color: var(--c-light);
}

.docs-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(16px);
  background: rgba(24, 20, 29, 0.92) !important;
  border-bottom: 1px solid var(--border-color);
}

.docs-container {
  display: flex;
  max-width: 1500px;
  margin: 0 auto;
  padding: 2rem;
  gap: 3rem;
}

.docs-sidebar {
  width: 280px;
  flex-shrink: 0;
  position: sticky;
  top: 90px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  background: rgba(60, 49, 61, 0.4);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1.5rem;
}

.docs-sidebar h3 {
  font-size: 0.85rem;
  color: var(--c-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 1rem;
  font-family: var(--font-mono);
}

.docs-sidebar ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.docs-sidebar a {
  color: var(--c-muted);
  text-decoration: none;
  font-size: 0.92rem;
  padding: 0.35rem 0.6rem;
  border-radius: 6px;
  display: block;
  transition: all 0.15s;
}

.docs-sidebar a:hover {
  color: var(--c-light);
  background: rgba(85, 83, 91, 0.4);
}

.docs-content {
  flex: 1;
  min-width: 0;
  max-width: 900px;
}

.chapter-title {
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--c-light);
  margin-bottom: 1rem;
  letter-spacing: -0.03em;
}

.section-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--c-light);
  margin: 2.5rem 0 1rem 0;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color);
}

.info-box {
  background: var(--bg-card);
  border-left: 4px solid var(--c-muted);
  border-radius: 8px;
  padding: 1.2rem 1.4rem;
  margin: 1.5rem 0;
}
.info-box.hint {
  border-left-color: var(--c-light);
  background: rgba(85, 83, 91, 0.25);
}
.info-box h4 {
  color: var(--c-light);
  margin-bottom: 0.5rem;
}

/* Responsive */
@media (max-width: 1024px) {
  .grid-2col, .grid-3col, .playground-grid {
    grid-template-columns: 1fr;
  }
  .page-view {
    padding: 1.5rem;
  }
  .hero-title {
    font-size: 2.4rem;
  }
  .breadcrumbs-nav {
    display: none;
  }
  .plot-card img {
    max-height: 240px;
  }
}

