:root {
  --navy: #0a1628;
  --navy-light: #132038;
  --navy-mid: #1a2d4a;
  --gold: #c9a227;
  --gold-light: #e8c547;
  --gold-dim: rgba(201, 162, 39, 0.15);
  --white: #f8f9fc;
  --gray: #94a3b8;
  --gray-light: #cbd5e1;
  --green: #22c55e;
  --yellow: #eab308;
  --red: #ef4444;
  --slide-padding: clamp(1.5rem, 4vw, 3.5rem);
  --nav-height: 3.75rem;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
  --font-sans: 'Inter', system-ui, sans-serif;
  --font-display: 'Playfair Display', Georgia, serif;
}

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

html, body {
  height: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  font-family: var(--font-sans);
  background: var(--navy);
  color: var(--white);
  color-scheme: dark;
}

#app button {
  font-family: inherit;
  color: inherit;
}

#app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  max-height: 100vh;
  max-height: 100dvh;
  overflow: hidden;
}

/* Top bar */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
  padding-top: calc(0.75rem + var(--safe-top));
  background: rgba(10, 22, 40, 0.95);
  border-bottom: 1px solid rgba(201, 162, 39, 0.2);
  z-index: 100;
  flex-shrink: 0;
}

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

.brand-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  color: var(--navy);
  font-weight: 800;
  font-size: 0.75rem;
  border-radius: 8px;
}

.brand-text {
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
}

.top-controls {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.lang-switch {
  display: flex;
  background: var(--navy-mid);
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(201, 162, 39, 0.3);
}

.lang-btn {
  padding: 0.4rem 0.9rem;
  border: none;
  background: transparent;
  color: var(--gray);
  font-weight: 600;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
}

.lang-btn.active {
  background: var(--gold);
  color: var(--navy);
}

.lang-btn:hover:not(.active) {
  color: var(--white);
}

.slide-counter {
  font-size: 0.85rem;
  color: var(--gray);
  font-variant-numeric: tabular-nums;
}

/* Presentation area */
.presentation {
  flex: 1;
  overflow: hidden;
  position: relative;
  min-height: 0;
}

.slides-container {
  height: 100%;
  position: relative;
}

.slide {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: var(--slide-padding);
  opacity: 0;
  visibility: hidden;
  transform: translateX(40px);
  transition: opacity 0.45s ease, transform 0.45s ease, visibility 0.45s;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--gold) var(--navy-mid);
}

.slide.active {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
}

.slide.prev {
  transform: translateX(-40px);
}

/* Slide layouts */
.slide-inner {
  flex: 1;
  display: flex;
  flex-direction: column;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.slide-hero {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.slide-hero .hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: brightness(0.35);
}

.slide-hero .hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(10,22,40,0.85) 0%, rgba(10,22,40,0.5) 100%);
}

.slide-hero .hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 2rem;
}

.slide-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 5vw, 3.2rem);
  font-weight: 700;
  margin-bottom: 0.5rem;
  line-height: 1.2;
}

.slide-hero h2 {
  font-size: clamp(1.2rem, 3vw, 2rem);
  color: var(--gold-light);
  font-weight: 600;
  margin-bottom: 1.5rem;
}

.slide-hero .subtitle {
  font-size: clamp(0.95rem, 2vw, 1.25rem);
  color: var(--gray-light);
  max-width: 700px;
  margin: 0 auto 2rem;
  line-height: 1.6;
}

.slide-hero .meta-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem 2.5rem;
  margin-top: 2rem;
}

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

.slide-hero .meta-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gold);
  margin-bottom: 0.25rem;
}

.slide-hero .meta-value {
  font-size: 0.95rem;
  color: var(--white);
}

/* Content slides */
.slide-header {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--gold-dim);
}

.slide-header h1 {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 3.5vw, 2.2rem);
  color: var(--gold-light);
  line-height: 1.3;
}

.slide-header h2 {
  font-size: clamp(1.1rem, 2.5vw, 1.6rem);
  color: var(--white);
  margin-top: 0.25rem;
}

.slide-body {
  flex: 1;
  font-size: clamp(0.85rem, 1.6vw, 1rem);
  line-height: 1.65;
  color: var(--gray-light);
}

.slide-body p {
  margin-bottom: 1rem;
}

.slide-body strong {
  color: var(--white);
  font-weight: 600;
}

.slide-body h3 {
  color: var(--gold);
  font-size: 1.05em;
  margin: 1.25rem 0 0.75rem;
  font-weight: 600;
}

.slide-body ul {
  list-style: none;
  margin: 0.5rem 0 1rem;
}

.slide-body ul li {
  position: relative;
  padding-left: 1.25rem;
  margin-bottom: 0.35rem;
}

.slide-body ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 6px;
  height: 6px;
  background: var(--gold);
  border-radius: 50%;
}

.slide-body ol {
  margin: 0.5rem 0 1rem 1.25rem;
}

.slide-body ol li {
  margin-bottom: 0.35rem;
}

.slide-body blockquote {
  border-left: 3px solid var(--gold);
  padding: 0.75rem 1.25rem;
  margin: 1rem 0;
  background: var(--gold-dim);
  border-radius: 0 8px 8px 0;
  color: var(--white);
  font-style: italic;
}

.module-intro {
  background: rgba(201, 162, 39, 0.08);
  border-left: 3px solid var(--gold);
  padding: 0.85rem 1.1rem;
  margin-bottom: 1.1rem;
  border-radius: 0 8px 8px 0;
  color: var(--white);
  line-height: 1.6;
}

.module-note {
  font-size: 0.92em;
  color: var(--gray-light);
  margin: 0.75rem 0 1rem;
  font-style: italic;
}

.slide-body hr {
  border: none;
  border-top: 1px solid rgba(201, 162, 39, 0.2);
  margin: 1.5rem 0;
}

/* Two column layout */
.slide-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
}

.slide-columns .slide-image {
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

.slide-columns .slide-image img {
  width: 100%;
  height: auto;
  display: block;
}

/* Architecture flow */
.arch-flow {
  background: var(--navy-light);
  border-radius: 12px;
  padding: 1.5rem;
  margin: 1rem 0;
  border: 1px solid rgba(201, 162, 39, 0.15);
  font-family: monospace;
  font-size: 0.9em;
  line-height: 1.8;
  white-space: pre-line;
  color: var(--white);
}

.arch-flow .flow-title {
  color: var(--gold-light);
  font-weight: 700;
  text-align: center;
}

.arch-flow .flow-arrow {
  color: var(--gold);
  text-align: center;
  display: block;
}

.arch-flow .flow-section {
  color: var(--gray-light);
  padding-left: 1rem;
}

/* Budget badge */
.budget-badge {
  display: inline-block;
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  color: var(--navy);
  font-weight: 800;
  font-size: 1.4rem;
  padding: 0.5rem 1.5rem;
  border-radius: 8px;
  margin-top: 1rem;
}

.budget-badge.large {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  padding: 0.75rem 2rem;
}

/* Tables */
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.9em;
}

.data-table th,
.data-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid rgba(201, 162, 39, 0.15);
}

.data-table th {
  color: var(--gold);
  font-weight: 600;
  background: var(--navy-light);
}

.data-table td {
  color: var(--gray-light);
}

.data-table td:last-child {
  text-align: right;
  font-weight: 600;
  color: var(--gold-light);
}

.data-table tr.total td {
  font-weight: 800;
  font-size: 1.05em;
  color: var(--gold-light);
  border-top: 2px solid var(--gold);
}

/* Phase cards */
.phase-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}

.phase-card {
  background: var(--navy-light);
  border: 1px solid rgba(201, 162, 39, 0.2);
  border-radius: 12px;
  padding: 1.25rem;
}

.phase-card h4 {
  color: var(--gold-light);
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}

.phase-card .phase-budget {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--gold);
  margin: 0.5rem 0;
}

.phase-card p {
  color: var(--gray-light);
  font-size: 0.88rem;
  line-height: 1.5;
}

.phase-card .phase-duration {
  font-size: 0.85rem;
  color: var(--gray);
}

/* Status indicators */
.status-row {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin: 1rem 0;
}

.status-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
}

.status-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
}

.status-dot.green { background: var(--green); }
.status-dot.yellow { background: var(--yellow); }
.status-dot.red { background: var(--red); }

/* Steps flow */
.steps-flow {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin: 1rem 0;
}

.step-item {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.step-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.step-arrow {
  text-align: center;
  color: var(--gold);
  padding-left: 10px;
  font-size: 1.2rem;
}

/* Tech stack */
.tech-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}

.tech-card {
  background: var(--navy-light);
  border-radius: 12px;
  padding: 1.25rem;
  border: 1px solid rgba(201, 162, 39, 0.15);
}

.tech-card ul {
  list-style: none;
  margin: 0;
}

.tech-card ul li {
  position: relative;
  padding-left: 1rem;
  margin-bottom: 0.35rem;
  color: var(--gray-light);
  font-size: 0.88rem;
  line-height: 1.5;
}

.tech-card ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 5px;
  height: 5px;
  background: var(--gold);
  border-radius: 50%;
}

.tech-card h4 {
  color: var(--gold);
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Navigation */
.nav-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1.5rem;
  padding-bottom: calc(0.75rem + var(--safe-bottom));
  padding-left: calc(1.5rem + env(safe-area-inset-left, 0px));
  padding-right: calc(1.5rem + env(safe-area-inset-right, 0px));
  background: rgba(10, 22, 40, 0.95);
  border-top: 1px solid rgba(201, 162, 39, 0.2);
  flex-shrink: 0;
  z-index: 110;
}

.nav-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(201, 162, 39, 0.4);
  background: var(--navy-mid);
  color: var(--gold-light);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.nav-btn:hover {
  background: var(--gold);
  color: var(--navy);
  border-color: var(--gold);
}

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

.progress-bar {
  flex: 1;
  height: 4px;
  background: var(--navy-mid);
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
  border-radius: 2px;
  transition: width 0.4s ease;
  width: 0%;
}

/* Overview panel */
.overview-toggle {
  position: fixed;
  bottom: calc(var(--nav-height) + var(--safe-bottom) + 0.5rem);
  right: calc(1.5rem + env(safe-area-inset-right, 0px));
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(201, 162, 39, 0.4);
  background: var(--navy-mid);
  color: var(--gold-light);
  cursor: pointer;
  font-size: 1.1rem;
  z-index: 105;
  transition: all 0.2s;
}

.overview-toggle:hover {
  background: var(--gold);
  color: var(--navy);
}

.slide-overview {
  position: fixed;
  inset: 0;
  background: rgba(10, 22, 40, 0.97);
  z-index: 200;
  overflow-y: auto;
  padding: 2rem;
  color: var(--white);
}

.slide-overview.hidden {
  display: none;
}

.overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  max-width: 1400px;
  margin: 0 auto;
}

.slide-overview .overview-item {
  background: var(--navy-light);
  border: 1px solid rgba(201, 162, 39, 0.2);
  border-radius: 8px;
  padding: 1rem;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.8rem;
  color: var(--gray-light);
  text-align: left;
  appearance: none;
  -webkit-appearance: none;
}

.slide-overview .overview-item .ov-title {
  color: var(--gray-light);
  line-height: 1.4;
}

.slide-overview .overview-item:hover,
.slide-overview .overview-item.active-overview {
  border-color: var(--gold);
  background: var(--navy-mid);
  color: var(--white);
}

.slide-overview .overview-item:hover .ov-title,
.slide-overview .overview-item.active-overview .ov-title {
  color: var(--white);
}

.slide-overview .overview-item .ov-num {
  color: var(--gold);
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.slide-overview .overview-item:hover .ov-num,
.slide-overview .overview-item.active-overview .ov-num {
  color: var(--gold-light);
}

.slide-overview .overview-close {
  position: fixed;
  top: 1rem;
  right: 1.5rem;
  background: var(--gold);
  color: var(--navy);
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  z-index: 201;
}

/* Conclusion slide special */
.conclusion-slide .slide-body {
  text-align: center;
}

.conclusion-tagline {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 3vw, 1.8rem);
  color: var(--gold-light);
  margin: 2rem 0 1rem;
  line-height: 1.4;
}

.conclusion-footer {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--gold-dim);
}

.conclusion-footer h3 {
  color: var(--gold-light);
  font-size: 1.3rem;
}

.conclusion-footer p {
  color: var(--gray);
  font-size: 0.95rem;
  margin-top: 0.5rem;
}

/* Responsive */
@media (max-width: 768px) {
  :root {
    --nav-height: 3.5rem;
    --slide-padding: clamp(1rem, 3vw, 1.75rem);
  }

  .slide-columns {
    grid-template-columns: 1fr;
  }

  .tech-grid {
    grid-template-columns: 1fr;
  }

  .top-bar {
    padding: 0.5rem 1rem;
    padding-top: calc(0.5rem + var(--safe-top));
  }

  .brand-text {
    display: none;
  }

  .nav-controls {
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    padding-bottom: calc(0.5rem + var(--safe-bottom));
  }

  .overview-toggle {
    bottom: calc(var(--nav-height) + var(--safe-bottom) + 0.35rem);
    right: calc(1rem + env(safe-area-inset-right, 0px));
  }

  .slide-overview {
    padding: 1.25rem;
    padding-bottom: calc(1.25rem + var(--safe-bottom));
  }

  .slide-overview .overview-close {
    top: calc(0.75rem + var(--safe-top));
    right: calc(1rem + env(safe-area-inset-right, 0px));
  }
}

@media print {
  .top-bar, .nav-controls, .overview-toggle { display: none; }
  .slide { position: relative; opacity: 1; visibility: visible; page-break-after: always; }
}
