:root {
  --bg-base: #F7F6F2;
  --text-dark: #20313A;
  --teal-primary: #2F6F68;
  --teal-dark: #285C57;
  --soft-teal: #A9DCD3;
  --soft-peach: #F7D2B9;
  --sky-blue: #CBDCF3;
  --soft-lilac: #DDD4F2;
  --muted-text: #5C6C75;
  --border-color: #DDE5E2;
  --warning-red: #9A4343;
  --white: #FFFFFF;
  
  --font-sans: 'Manrope', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', Consolas, Menlo, monospace;
}

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

html, body {
  width: 100%;
  height: 100%;
  background-color: #111C20;
  color: var(--text-dark);
  font-family: var(--font-sans);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  touch-action: pan-y;
}

/* Presentation Container */
.deck-wrapper {
  position: relative;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-width: 177.78vh; /* 16:9 ratio on desktop */
  max-height: 56.25vw;
  margin: auto;
  background-color: var(--bg-base);
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 50px rgba(0,0,0,0.5);
  overflow: hidden;
}

/* Top Progress Bar */
.progress-bar-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: rgba(47, 111, 104, 0.15);
  z-index: 100;
}

.progress-bar {
  height: 100%;
  width: 9.09%;
  background: var(--teal-primary);
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Header Bar */
.slide-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 36px 10px 36px;
  flex-shrink: 0;
  z-index: 10;
  border-bottom: 1px solid rgba(221, 229, 226, 0.5);
}

.brand-indicator {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-logo-text {
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 800;
  color: var(--teal-primary);
  letter-spacing: 0.05em;
}

.brand-category-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  background-color: var(--soft-teal);
  color: var(--text-dark);
  padding: 3px 8px;
  border-radius: 6px;
  text-transform: uppercase;
}

.slide-actions {
  display: flex;
  gap: 8px;
}

.btn-icon {
  background: rgba(32, 49, 58, 0.06);
  border: 1px solid var(--border-color);
  color: var(--text-dark);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  user-select: none;
}

.btn-icon:hover {
  background: var(--soft-teal);
  border-color: var(--teal-primary);
}

/* Slides Canvas */
.slides-canvas {
  flex: 1;
  position: relative;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  min-height: 0;
}

.slide {
  display: none;
  min-height: 100%;
  padding: 16px 36px 20px 36px;
  flex-direction: column;
  justify-content: flex-start;
  animation: fadeIn 0.25s ease-out forwards;
}

.slide.active {
  display: flex;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Title Block */
.slide-title-block {
  margin-bottom: 14px;
  flex-shrink: 0;
}

.slide-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-dark);
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.slide-subtitle {
  font-size: 13px;
  color: var(--muted-text);
  margin-top: 4px;
  font-weight: 500;
}

/* Split Layouts & Photos */
.slide-split-photo {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 20px;
  flex: 1;
  align-items: stretch;
}

.photo-frame {
  background: var(--white);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(32, 49, 58, 0.06);
  max-height: 480px;
}

.photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.photo-frame.contain img {
  object-fit: contain;
  background: #F0F4F4;
}

/* Hero Slide Layout */
.slide-hero {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 24px;
  background: var(--white);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 24px;
  flex: 1;
  box-shadow: 0 10px 30px rgba(32, 49, 58, 0.05);
}

.hero-title-group h1 {
  font-size: 42px;
  font-weight: 800;
  color: var(--teal-primary);
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.hero-subtitle {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-dark);
  letter-spacing: 0.05em;
  margin-top: 6px;
}

.hero-desc {
  font-size: 14px;
  color: var(--muted-text);
  margin: 12px 0 16px 0;
  line-height: 1.45;
}

.hero-features {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
}

/* Cards & UI elements */
.card {
  background: var(--white);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 4px 12px rgba(32, 49, 58, 0.04);
  display: flex;
  flex-direction: column;
}

.card-teal-border {
  border: 2px solid var(--soft-teal);
  background: #FAFDFD;
}

.card-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  display: inline-block;
  margin-bottom: 8px;
  width: fit-content;
  text-transform: uppercase;
}

.badge-red { background: #FFEEEE; color: var(--warning-red); }
.badge-teal { background: var(--soft-teal); color: var(--text-dark); }
.badge-peach { background: var(--soft-peach); color: var(--text-dark); }
.badge-sky { background: var(--sky-blue); color: var(--text-dark); }

.card-heading {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 6px;
}

.card-text {
  font-size: 12px;
  color: var(--muted-text);
  line-height: 1.45;
}

.check-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
  font-size: 13px;
}

.check-list li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  line-height: 1.35;
}

.check-icon {
  color: var(--teal-primary);
  font-weight: 800;
  shrink: 0;
}

.metric-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-color);
  font-size: 13px;
}

.metric-highlight {
  font-family: var(--font-mono);
  font-weight: 800;
  color: var(--teal-primary);
}

/* Grids */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  flex: 1;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  flex: 1;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  flex: 1;
}

/* Table */
.table-wrapper {
  background: var(--white);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: auto;
  box-shadow: 0 4px 12px rgba(32, 49, 58, 0.04);
}

.custom-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  text-align: left;
}

.custom-table th {
  background: #F0F4F4;
  padding: 10px 12px;
  font-weight: 700;
  color: var(--text-dark);
  border-bottom: 1px solid var(--border-color);
  font-family: var(--font-mono);
  font-size: 11px;
}

.custom-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-dark);
}

.custom-table tr:last-child td {
  border-bottom: none;
}

/* Interactive Calculator */
.calc-widget {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 16px;
  flex: 1;
}

.calc-items-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.calc-checkbox-item {
  background: var(--white);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 10px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.15s ease;
  user-select: none;
}

.calc-checkbox-item:hover {
  border-color: var(--teal-primary);
}

.calc-checkbox-item.checked {
  background: #F2F8F7;
  border-color: var(--teal-primary);
  box-shadow: 0 2px 6px rgba(47, 111, 104, 0.15);
}

.calc-item-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-dark);
}

.calc-item-watts {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted-text);
}

.check-status {
  font-family: var(--font-mono);
  font-weight: 800;
  color: var(--teal-primary);
  font-size: 12px;
}

.calc-results {
  background: var(--text-dark);
  border-radius: 12px;
  padding: 16px;
  color: var(--white);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.calc-summary-power {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.15);
}

.calc-res-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 10px 0;
}

.calc-res-box {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  padding: 8px;
  border-radius: 6px;
}

.calc-res-label {
  font-size: 10px;
  color: var(--soft-teal);
  font-weight: 600;
}

.calc-res-val {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 800;
  color: var(--soft-peach);
  margin-top: 2px;
}

/* Footer Controls */
.deck-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 36px 14px 36px;
  border-top: 1px solid var(--border-color);
  background: var(--bg-base);
  flex-shrink: 0;
  z-index: 10;
}

.footer-info {
  font-size: 11px;
  color: var(--muted-text);
}

.footer-nav {
  display: flex;
  align-items: center;
  gap: 12px;
}

.slide-counter {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 800;
  color: var(--teal-primary);
  min-width: 55px;
  text-align: center;
}

.nav-btn {
  background: var(--white);
  border: 1px solid var(--border-color);
  color: var(--text-dark);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.nav-btn:hover, .nav-btn:active {
  background: var(--teal-primary);
  color: var(--white);
  border-color: var(--teal-primary);
}

/* Modal Grid */
.modal-grid {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(17, 28, 32, 0.96);
  backdrop-filter: blur(10px);
  z-index: 200;
  display: none;
  flex-direction: column;
  padding: 24px;
}

.modal-grid.open {
  display: flex;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.modal-title {
  color: var(--soft-teal);
  font-size: 18px;
  font-weight: 800;
}

.modal-close {
  background: none;
  border: none;
  color: var(--white);
  font-size: 24px;
  cursor: pointer;
  padding: 4px;
}

.jump-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  overflow-y: auto;
  padding-bottom: 20px;
}

.jump-card {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  padding: 12px;
  color: var(--white);
  cursor: pointer;
  transition: all 0.15s ease;
}

.jump-card:hover, .jump-card:active {
  background: var(--teal-primary);
  border-color: var(--soft-teal);
}

.jump-num {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--soft-peach);
}

.jump-title {
  font-size: 12px;
  font-weight: 700;
  margin-top: 4px;
  line-height: 1.3;
}

/* ==========================================================
   RESPONSIVE MEDIA QUERIES (FOR ALL DEVICES)
   ========================================================== */

/* 1. TABLETS & SMALL LAPTOPS (<= 1024px) */
@media (max-width: 1024px) {
  .deck-wrapper {
    max-width: 100vw;
    max-height: 100vh;
    max-height: 100dvh;
    border-radius: 0;
  }
  
  .slide-header, .slide, .deck-footer {
    padding-left: 20px;
    padding-right: 20px;
  }
  
  .slide-title { font-size: 20px; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .jump-grid { grid-template-columns: repeat(3, 1fr); }
}

/* 2. MOBILE PHONES & PORTRAIT TABLETS (<= 768px) */
@media (max-width: 768px) {
  html, body {
    overflow: auto;
  }
  
  .deck-wrapper {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    max-width: 100%;
    max-height: 100%;
    box-shadow: none;
  }
  
  .slide-header {
    padding: 10px 14px;
  }
  
  .brand-logo-text { font-size: 15px; }
  .brand-category-badge { display: none; }
  
  .slide {
    padding: 12px 14px 20px 14px;
  }
  
  .slide-title { font-size: 18px; }
  .slide-subtitle { font-size: 12px; }
  
  .slide-split-photo {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  
  .photo-frame {
    max-height: 200px;
    min-height: 140px;
    order: -1; /* Place image on top on mobile */
  }
  
  .slide-hero {
    grid-template-columns: 1fr;
    padding: 16px;
    gap: 14px;
  }
  
  .hero-title-group h1 { font-size: 28px; }
  .hero-subtitle { font-size: 11px; }
  .hero-desc { font-size: 13px; margin: 8px 0 12px 0; }
  .hero-features { font-size: 12px; gap: 6px; }
  
  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  
  .calc-widget {
    grid-template-columns: 1fr;
  }
  
  .calc-items-grid {
    grid-template-columns: 1fr;
  }
  
  .deck-footer {
    padding: 8px 14px;
  }
  
  .footer-info { display: none; }
  
  .nav-btn {
    width: 40px;
    height: 40px;
    font-size: 18px;
  }
  
  .jump-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
}

/* 3. VERY SMALL SCREENS (<= 400px) */
@media (max-width: 400px) {
  .hero-title-group h1 { font-size: 24px; }
  .slide-title { font-size: 16px; }
  .jump-grid { grid-template-columns: 1fr; }
}
