/* ============================================
   HeyMark Decks — Shared Base Styles
   Themes must define CSS custom properties:
   --bg-primary, --bg-secondary, --text-primary,
   --text-secondary, --accent, --accent-dim,
   --font, --section-pad
   ============================================ */

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  overflow-x: hidden;
  line-height: 1.6;
  font-size: 18px;
}

img, video {
  display: block;
  max-width: 100%;
}

a {
  color: var(--text-primary);
  text-decoration: none;
  transition: color 0.3s;
}
a:hover {
  color: var(--accent);
}

/* --- Layout --- */
.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
}

.section {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--section-pad) 0;
  position: relative;
}

.section:nth-child(even) {
  background: var(--bg-secondary);
}

.section__title {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 700;
  text-align: center;
  margin-bottom: 0.5em;
  letter-spacing: -0.02em;
}

.section__subtitle {
  text-align: center;
  color: var(--text-secondary);
  font-size: clamp(1.15rem, 2.5vw, 1.5rem);
  margin-bottom: 3rem;
}

/* --- Phone Mockup --- */
.phone__frame {
  width: clamp(200px, 22vw, 280px);
  aspect-ratio: 9 / 19.5;
  background: #1a1a1a;
  border-radius: 30px;
  border: 3px solid #2a2a2a;
  position: relative;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.phone__notch {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 22px;
  background: #0a0a0a;
  border-radius: 0 0 14px 14px;
  z-index: 2;
}

.phone__screen {
  position: absolute;
  inset: 0;
  border-radius: 27px;
  overflow: hidden;
}

.phone__screen video,
.phone__screen img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.phone__frame--sm {
  width: clamp(110px, 10vw, 140px);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5);
}

/* --- Laptop Mockup --- */
.laptop {
  width: clamp(220px, 22vw, 280px);
}

.laptop__screen {
  aspect-ratio: 16 / 10;
  background: #1a1a1a;
  border-radius: 8px 8px 0 0;
  border: 2px solid #2a2a2a;
  overflow: hidden;
  position: relative;
}

.laptop__screen img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top left;
}

.laptop__base {
  height: 10px;
  background: #2a2a2a;
  border-radius: 0 0 4px 4px;
  margin: 0 -4px;
  position: relative;
}

.laptop__base::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 40%;
  height: 3px;
  background: #3a3a3a;
  border-radius: 0 0 3px 3px;
}

/* --- KPI Cards --- */
.kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  margin-top: 2rem;
}

.kpi {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.kpi__value {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--accent);
}

.kpi__label {
  font-size: 1.05rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* --- Chart Wrapper --- */
.chart-wrapper {
  width: 100%;
  max-width: 900px;
  position: relative;
  aspect-ratio: 16 / 9;
}

.chart-wrapper canvas {
  width: 100% !important;
  height: 100% !important;
}

/* --- Back to Menu Button --- */
.back-btn {
  position: fixed;
  top: 1.5rem;
  left: 1.5rem;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.3s;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  text-decoration: none;
}

.back-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

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

/* --- Responsive --- */
@media (max-width: 768px) {
  .kpis {
    grid-template-columns: repeat(2, 1fr);
    gap: 3rem 1.5rem;
  }
}

@media (max-width: 480px) {
  .kpis {
    grid-template-columns: 1fr;
  }
}
