:root {
  --md-sys-color-primary: #d32f2f;
  --md-sys-color-primary-container-darker : #b71c1c;
  --md-sys-color-primary-light: #ff6659;
  --md-sys-color-on-primary: #ffffff;

  --md-sys-color-background: #f9fafb;
  --md-sys-color-surface: rgba(255, 255, 255, 0.75);
  --md-sys-color-on-surface: #111827;
  --md-sys-color-on-surface-variant: #4b5563;
  --md-sys-color-outline: rgba(0, 0, 0, 0.08);

  --gradient-glow: radial-gradient(circle at top right, rgba(211, 47, 47, 0.12), transparent 60%);
}

@media (prefers-color-scheme: dark) {
  :root {
    --md-sys-color-primary: #ef5350;
    --md-sys-color-primary-container-darker : #d32f2f;
    --md-sys-color-primary-light: #ff8a80;
    --md-sys-color-on-primary: #000000;

    --md-sys-color-background: #0f1115;
    --md-sys-color-surface: rgba(25, 28, 35, 0.75);
    --md-sys-color-on-surface: #f9fafb;
    --md-sys-color-on-surface-variant: #a1a1aa;
    --md-sys-color-outline: rgba(255, 255, 255, 0.08);

    --gradient-glow: radial-gradient(circle at top right, rgba(239, 83, 80, 0.15), transparent 60%);
  }
}

html, body {
  padding: 0;
  margin: 0;
  font-family: 'Inter', sans-serif;
  background-color: var(--md-sys-color-background);
  background-image: var(--gradient-glow);
  background-attachment: fixed;
  color: var(--md-sys-color-on-surface);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.6;
}

h1, h2, h3, h4, .app-title {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  line-height: 1.1;
  color: var(--md-sys-color-on-surface);
  letter-spacing: -0.02em;
}

p {
  color: var(--md-sys-color-on-surface-variant);
  font-size: 1.125rem;
  margin-bottom: 2rem;
}

/* === Header === */
.app-header {
  background: var(--md-sys-color-surface);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  width: 100%;
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid var(--md-sys-color-outline);
}

.app-header .container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.app-logo-link {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.app-logo {
  height: 40px;
  width: 40px;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(211, 47, 47, 0.3);
}

.app-title {
  font-size: 1.4rem;
  font-weight: 800;
  margin-left: 0.75rem;
}

main {
  flex: 1;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* === Button CTA === */
.download-button {
  text-decoration: none;
}

.mdc-button.cta-button {
  background-color: var(--md-sys-color-primary);
  color: #fff;
  border-radius: 999px;
  padding: 0.75rem 1.75rem;
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 4px 14px rgba(211, 47, 47, 0.4);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  text-decoration: none;
}

.mdc-button.cta-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(211, 47, 47, 0.5);
  background-color: var(--md-sys-color-primary-light);
}

/* === Section Layouts (Scrollytelling) === */
.split-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
  padding: 6rem 0;
}

.hero {
  padding: 8rem 0 6rem 0;
}

.hero h1 {
  font-size: 3.5rem;
  margin-bottom: 1.5rem;
  background: linear-gradient(135deg, var(--md-sys-color-primary), var(--md-sys-color-primary-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero p {
  font-size: 1.25rem;
  max-width: 90%;
  margin-bottom: 2.5rem;
}

@media (max-width: 900px) {
  .split-section {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 3rem;
  }
  .hero {
    padding: 4rem 0 2rem 0;
  }
  .hero h1 {
    font-size: 2.5rem;
  }
  .hero p {
    margin: 0 auto 2.5rem auto;
  }
  .split-section.reverse .content-block {
    order: -1;
  }
}

.section-title {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

/* === CSS Device Frame Mockup === */
.device-container {
  display: flex;
  justify-content: center;
  perspective: 1000px;
}

.device-frame {
  position: relative;
  width: 100%;
  max-width: 320px;
  background-color: #000;
  border-radius: 40px;
  padding: 12px;
  box-shadow: 
    0 25px 50px -12px rgba(0, 0, 0, 0.3),
    inset 0 0 0 2px #333,
    inset 0 0 0 6px #111;
  transform: rotateY(-8deg) rotateX(4deg);
  transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

.device-frame::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 24px;
  background-color: #000;
  border-bottom-left-radius: 12px;
  border-bottom-right-radius: 12px;
  z-index: 10;
}

.device-frame:hover {
  transform: rotateY(0deg) rotateX(0deg) translateY(-10px);
}

.device-frame.right-tilt {
  transform: rotateY(8deg) rotateX(4deg);
}
.device-frame.right-tilt:hover {
  transform: rotateY(0deg) rotateX(0deg) translateY(-10px);
}

.device-screen {
  position: relative;
  overflow: hidden;
  border-radius: 32px;
  background-color: #121212;
  border: 1px solid #222;
  aspect-ratio: 9 / 19.5; /* Modern phone ratio */
}

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

/* === Animations === */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s cubic-bezier(0.25, 1, 0.5, 1), transform 0.8s cubic-bezier(0.25, 1, 0.5, 1);
}

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

.fade-in {
  opacity: 0;
  transition: opacity 1s ease-in-out;
}

.fade-in.active {
  opacity: 1;
}

/* Delay for staggered items */
.delay-1 { transition-delay: 0.1s; }
.delay-2 { transition-delay: 0.2s; }
.delay-3 { transition-delay: 0.3s; }

/* === Footer === */
footer {
  text-align: center;
  margin-top: 4rem;
  padding: 3rem 1.5rem;
  border-top: 1px solid var(--md-sys-color-outline);
  color: var(--md-sys-color-on-surface-variant);
  font-size: 0.95rem;
}

footer a {
  color: var(--md-sys-color-primary);
  text-decoration: none;
  font-weight: 500;
}

footer a:hover {
  text-decoration: underline;
}

/* 404 Pages */
.page-404 main {
  text-align: center;
  padding: 8rem 1rem;
}
.page-404 main h1 {
  font-size: 4rem;
  color: var(--md-sys-color-primary);
  margin-bottom: 1rem;
}
.page-404 main a {
  display: inline-block;
  margin-top: 2rem;
  font-size: 1.2rem;
}