/* ==========================================================================
   Minimal HabitFusion Styles
   ========================================================================== */

/* CSS Custom Properties */
:root {
  --color-black: #0a0a0a;
  --color-white: #ffffff;
  --color-gray: #666666;
  --color-gray-light: #e5e5e5;
  --color-bg: #fafafa;
  
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  
  --radius: 1rem;
}

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

html {
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-black);
  background-color: var(--color-bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

/* Skip Link (Accessibility) */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-md);
  background: var(--color-black);
  color: var(--color-white);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius);
  font-weight: 500;
  z-index: 100;
}

.skip-link:focus {
  top: var(--space-md);
  outline: 2px solid var(--color-white);
  outline-offset: 2px;
}

main {
  flex: 1;
}

/* Hero Section */
.hero {
  position: relative;
  display: flex;
  flex-direction: column;
}

.hero-inner {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: var(--space-2xl) var(--space-xl);
  gap: var(--space-2xl);
  max-width: 480px;
  margin: 0 auto;
  width: 100%;
}

.hero-content {
  text-align: center;
  width: 100%;
}

.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.brand img {
  width: 64px;
  height: 64px;
  border-radius: var(--radius);
}

.hero h1 {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--color-black);
  letter-spacing: -0.02em;
}

.tagline {
  font-size: 1.0625rem;
  color: var(--color-gray);
  margin-bottom: var(--space-xl);
  line-height: 1.6;
  max-width: 360px;
  margin-left: auto;
  margin-right: auto;
}

/* App Store Button */
.app-store-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  background: var(--color-black);
  color: var(--color-white);
  padding: 0.875rem 1.5rem;
  border-radius: 100px;
  font-weight: 600;
  font-size: 1rem;
  transition: transform 0.2s, box-shadow 0.2s;
  border: 2px solid var(--color-black);
}

.app-store-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.app-store-btn:focus-visible {
  outline: 3px solid var(--color-gray);
  outline-offset: 3px;
}

.app-store-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* Screenshots */
.screenshots {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 0 var(--space-md) var(--space-2xl);
  margin-top: var(--space-xl);
  overflow: visible;
}

.screenshot {
  position: relative;
}

.screenshot img {
  width: 240px;
  height: auto;
  border-radius: 0;
  filter: drop-shadow(0 25px 25px rgba(0, 0, 0, 0.2));
}

.screenshot-dark {
  z-index: 1;
  transform: rotate(-6deg) translateX(40px);
}

.screenshot-light {
  z-index: 2;
  transform: rotate(6deg) translateX(-40px);
}

.screenshot-dark img {
  filter: drop-shadow(0 20px 20px rgba(0, 0, 0, 0.35));
}

.screenshot-light img {
  filter: drop-shadow(0 20px 20px rgba(0, 0, 0, 0.25));
}

/* Footer */
footer {
  padding: var(--space-lg) var(--space-xl);
  text-align: center;
  background: var(--color-white);
  border-top: 1px solid var(--color-gray-light);
  position: relative;
  z-index: 1;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: var(--space-lg);
  margin-bottom: var(--space-md);
  flex-wrap: wrap;
}

.footer-links a {
  font-size: 0.9375rem;
  color: var(--color-gray);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--color-black);
}

.footer-links a:focus-visible {
  outline: 2px solid var(--color-black);
  outline-offset: 2px;
  border-radius: 2px;
}

.copyright {
  font-size: 0.875rem;
  color: var(--color-gray);
}

/* ==========================================================================
   Legal Pages (Privacy & Terms)
   ========================================================================== */

.legal-page {
  max-width: 680px;
  margin: 0 auto;
  padding: var(--space-2xl) var(--space-xl);
  flex: 1;
  background: var(--color-white);
}

.legal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-2xl);
  padding-bottom: var(--space-lg);
  border-bottom: 1px solid var(--color-gray-light);
}

.legal-header .logo {
  font-weight: 700;
  font-size: 1.25rem;
}

.legal-header .back-link {
  font-size: 0.9375rem;
  color: var(--color-gray);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.legal-header .back-link:hover {
  color: var(--color-black);
}

.legal-page h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: var(--space-sm);
  line-height: 1.2;
}

.last-updated {
  font-size: 0.875rem;
  color: var(--color-gray);
  margin-bottom: var(--space-xl);
}

.legal-page h2 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-top: var(--space-xl);
  margin-bottom: var(--space-md);
  line-height: 1.3;
}

.legal-page p {
  font-size: 1rem;
  color: var(--color-gray);
  margin-bottom: var(--space-md);
  line-height: 1.7;
}

.legal-page ul {
  color: var(--color-gray);
  margin-bottom: var(--space-md);
  padding-left: var(--space-lg);
}

.legal-page li {
  margin-bottom: var(--space-sm);
  line-height: 1.6;
}

.legal-page a {
  color: var(--color-black);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.legal-page a:hover {
  text-decoration: none;
}

.legal-footer {
  margin-top: var(--space-2xl);
  padding-top: var(--space-xl);
  border-top: 1px solid var(--color-gray-light);
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (min-width: 640px) {
  .hero-inner {
    padding-top: var(--space-2xl);
    gap: var(--space-xl);
  }
  
  .screenshot img {
    width: 280px;
  }
  
  .screenshot-dark {
    transform: rotate(-5deg) translateX(60px);
  }
  
  .screenshot-light {
    transform: rotate(5deg) translateX(-60px);
  }
}

@media (max-width: 480px) {
  .hero-inner {
    padding: var(--space-xl) var(--space-lg);
  }
  
  .brand img {
    width: 56px;
    height: 56px;
  }
  
  .hero h1 {
    font-size: 1.75rem;
  }
  
  .screenshot img {
    width: 180px;
  }
  
  .screenshot-dark {
    transform: rotate(-5deg) translateX(25px);
  }
  
  .screenshot-light {
    transform: rotate(5deg) translateX(-25px);
  }
  
  .footer-links {
    flex-direction: column;
    gap: var(--space-sm);
  }
  
  .legal-page {
    padding: var(--space-xl) var(--space-lg);
  }
  
  .legal-header {
    flex-direction: column;
    gap: var(--space-md);
    text-align: center;
  }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  
  html {
    scroll-behavior: auto;
  }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
  .app-store-btn {
    border: 3px solid currentColor;
  }
}
