/* ============================================
   CSS Reset & Base Styles
   ============================================ */

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

/* Regular - 400 */
@font-face {
  font-family: 'Open Sauce Sans';
  src: url('./assets/fonts/open-sauce/OpenSauceOne-Regular.woff2') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* Medium - 500 */
@font-face {
  font-family: 'Open Sauce Sans';
  src: url('./assets/fonts/open-sauce/OpenSauceOne-Medium.woff2') format('truetype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

/* Semi Bold - 600 */
@font-face {
  font-family: 'Open Sauce Sans';
  src: url('./assets/fonts/open-sauce/OpenSauceOne-SemiBold.woff2') format('truetype');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

/* Bold - 700 */
@font-face {
  font-family: 'Open Sauce Sans';
  src: url('./assets/fonts/open-sauce/OpenSauceOne-Bold.woff2') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* Black - 900 */
@font-face {
  font-family: 'Open Sauce Sans';
  src: url('./assets/fonts/open-sauce/open-sauce.sans-black.woff2') format('truetype');
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --color-primary: #D2482A;
  --color-primary-hover: #D43B2C;
  --color-secondary: #0052C9;
  --color-accent: #FFB84D;
  --color-text: #0052C9;
  --color-text-light: #0052C9;
  --color-background: #FFF9E1;
  --color-white: #FFFFFF;

  /* Typography */
  --font-primary: 'Open Sauce Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-size-base: 16px;
  --font-size-lg: 1.125rem; /* 18px */
  --font-size-xl: 1.5rem; /* 24px */
  --font-size-2xl: 2rem; /* 32px */
  --font-size-3xl: 2.5rem; /* 40px */
  --font-size-4xl: 3rem; /* 48px */
  --line-height-tight: 1.2;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.7;

  /* Spacing */
  --space-xs: 0.5rem; /* 8px */
  --space-sm: 1rem; /* 16px */
  --space-md: 1.5rem; /* 24px */
  --space-lg: 2rem; /* 32px */
  --space-xl: 3rem; /* 48px */
  --space-2xl: 4rem; /* 64px */
  --space-3xl: 6rem; /* 96px */

  /* Layout */
  --container-max-width: 1200px;
  --container-padding: 1.5rem;
  --border-radius: 2rem;
  --border-radius-sm: 0.5rem;

  /* Transitions */
  --transition-fast: 150ms ease-in-out;
  --transition-base: 250ms ease-in-out;
  --transition-slow: 350ms ease-in-out;
}

html, body {
  max-width: 100%;
  overflow-x: hidden;
}

.site-header::after {
  max-width: 100vw;
}

html {
  font-size: var(--font-size-base);
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-primary);
  color: var(--color-text);
  font-weight: 600;
  background-color: var(--color-background);
  line-height: var(--line-height-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 900;
}

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

a {
  text-decoration: none;
  color: inherit;
  transition: color var(--transition-base);
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ============================================
   Layout Components
   ============================================ */

.container {
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

/* ============================================
   Header
   ============================================ */

.site-header {
  padding-top: var(--space-xl);
  padding-bottom: 0;
  background-color: var(--color-background);
  position: relative;
  overflow: visible;
}

.site-header::after {
  content: '';
  position: absolute;
  top: -80px;
  right: -140px;
  width: 300px;
  height: 400px;
  background-image: url('./assets/fostr-top-right-line.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: top right;
  pointer-events: none;
  z-index: 1;
}

.site-header .container {
  display: flex;
  justify-content: center;
  align-items: start;
  position: relative;
  z-index: 2;
}

.logo img {
  height: 2.5rem;
  width: auto;
}

.logo-left img {
  height: 5rem;
}

.logo-left {
  position: absolute;
  left: 0;
}

.logo-center img {
  height: 10rem;
}

@media (min-width: 768px) {
  .logo-left img {
    height: 7.5rem;
  }

  .site-header::after {
    width: 400px;
    height: 500px;
  }
}

@media (min-width: 1024px) {
  .site-header::after {
    width: 500px;
    height: 600px;
  }
}

/* ============================================
   Hero Section
   ============================================ */

.hero {
  padding-top: var(--space-3xl) 0;
  padding-bottom: 0;
  text-align: center;
}

.hero-content {
  max-width: 600px;
  margin: 0 auto;
}

.hero-title {
  font-size: 4rem;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.10rem;
  color: var(--color-secondary);
  margin-bottom: var(--space-xs);
}

.hero-subtitle {
  font-size: var(--font-size-2xl);
  font-weight: 400;
  line-height: var(--line-height-relaxed);
  color: var(--color-text);
  margin-bottom: var(--space-xs);
}

.hero-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  font-size: var(--font-size-lg);
  font-weight: 400;
  color: var(--color-text-light);
}

.badge-icon {
  width: 96px;
  height: 96px;
  flex-shrink: 0;
}

/* ============================================
   Buttons
   ============================================ */

.btn {
  display: inline-block;
  padding: 2rem 5rem;
  font-size: var(--font-size-xl);
  font-weight: 700;
  text-align: center;
  border-radius: 3rem;
  transition: all var(--transition-base);
  cursor: pointer;
  text-decoration: none;
}

.btn-primary {
  background-color: var(--color-primary);
  color: var(--color-white);
  box-shadow: 0 4px 14px rgba(233, 76, 61, 0.3);
}

.btn-primary:hover,
.btn-primary:focus {
  background-color: var(--color-primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(233, 76, 61, 0.4);
}

.btn-primary:active {
  transform: translateY(0);
}

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

/* ============================================
   Phone Showcase Section
   ============================================ */

.phone-showcase {
  padding: 0;
  display: flex;
  justify-content: flex-end;
  position: relative;
  overflow: visible;
}

.phone-showcase::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: url('./assets/fostr-behind-phone.png');
  background-size: cover;
  background-position: center;
  background-repeat: repeat;
  pointer-events: none;
  z-index: 0;
}


.phone-mockup {
  width: 150%;
  max-width: 2000px;
  margin-right: -40vw;
  z-index: 1;
}

.phone-mockup img {
  width: 100%;
  height: auto;
  display: block;
}

/* ============================================
   How It Works Section
   ============================================ */

.how-it-works {
  padding: 0;
}

.section-title {
  font-size: 4rem;
  font-weight: 700;
  text-align: center;
  color: var(--color-secondary);
  margin-bottom: var(--space-sm);
  line-height: var(--line-height-tight);
}

.section-subtitle {
  text-align: center;
  font-weight: 600;
  max-width: 600px;
  margin: 0 auto var(--space-lg);
  line-height: var(--line-height-tight);
  color: var(--color-primary);
}

.steps {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
}

.step {
  display: flex;
  flex-direction: row;
  align-items: center;
  text-align: center;
  gap: var(--space-xs);
  max-height: 250px;
}

.step-illustration {
  width: 200px;
  height: 200px;
  flex-shrink: 0;
}

.step-illustration img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.step-content {
  max-width: 400px;
}

.step-title {
  font-size: var(--font-size-lg);
  font-weight: 900;
  margin-bottom: var(--space-sm);
  color: var(--color-primary);
}

.step-description {
  font-size: var(--font-size-base);
  font-weight: 500;
  line-height: var(--line-height-relaxed);
  color: var(--color-text);
  text-align: center;
}

/* ============================================
   CTA Section
   ============================================ */

.cta-section {
  padding: var(--space-xs) 0;
  text-align: center;
}

.cta-description {
  max-width: 600px;
  margin: 0 auto var(--space-xl);
  font-size: var(--font-size-lg);
  line-height: var(--line-height-relaxed);
  color: var(--color-text);
}

/* ============================================
   Bottom Hero Section
   ============================================ */

.bottom-hero {
  padding: 0;
  overflow: hidden;
}

.bottom-hero-image {
  width: 100%;
  position: relative;
}

.bottom-hero-image img {
  width: 100%;
  height: auto;
  display: block;
}

/* ============================================
   Community Section
   ============================================ */

.community-section {
  width: 100%;
  background-color: var(--color-background);
  position: relative;
  padding-top: 4rem;
}

.community-top-image {
  position: absolute;
  top: 0;
  left: 50%;
  width: 50%;
  transform: translateX(-50%);
  height: auto;
  display: block;
  z-index: 1;
}

.community-main-image {
  width: 100%;
  height: auto;
  display: block;
}

/* Increase spacing on larger screens */
@media (min-width: 768px) {
  .community-section {
    padding-top: 8rem;
  }
}

@media (min-width: 1024px) {
  .community-section {
    padding-top: 12rem;
  }
}

/* ============================================
   Footer
   ============================================ */

.site-footer {
  padding: var(--space-xs) 0;
  background-color: var(--color-background);
  color: var(--color-text);
  text-align: center;
  margin-top: clamp(-10rem, -2rem + -1vw * 8, -2rem);
}

.footer-nav {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-md);
  margin-bottom: var(--space-sm);
}

.footer-nav a {
  color: var(--color-text-light);
  font-size: 0.875rem;
  opacity: 0.9;
  transition: opacity var(--transition-base);
}

.footer-nav a:hover,
.footer-nav a:focus {
  opacity: 1;
}

.copyright {
  font-size: 0.875rem;
  color: var(--color-text-light);
  opacity: 0.8;
}

/* ============================================
   Responsive Design - Tablet
   ============================================ */

@media (min-width: 768px) {
  :root {
    --container-padding: 2rem;
    --font-size-3xl: 3rem;
    --font-size-4xl: 3.5rem;
  }

}

/* ============================================
   Responsive Design - Desktop
   ============================================ */

@media (min-width: 1024px) {
  :root {
    --container-padding: 3rem;
  }

  .footer-nav {
    gap: var(--space-xl);
  }
}

/* ============================================
   Animations & Interactions
   ============================================ */

@media (prefers-reduced-motion: no-preference) {
  .step {
    opacity: 0;
    animation: fadeInUp 0.6s ease-out forwards;
  }

  .step:nth-child(1) {
    animation-delay: 0.1s;
  }

  .step:nth-child(2) {
    animation-delay: 0.2s;
  }

  .step:nth-child(3) {
    animation-delay: 0.3s;
  }

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

/* ============================================
   Print Styles
   ============================================ */

@media print {
  .site-header,
  .menu-toggle,
  .btn,
  .site-footer {
    display: none;
  }

  body {
    background-color: white;
    color: black;
  }
}

/* ============================================
   Accessibility - High Contrast Mode
   ============================================ */

@media (prefers-contrast: high) {
  :root {
    --color-text: #000000;
    --color-background: #FFFFFF;
  }

  .btn-primary {
    border: 2px solid var(--color-text);
  }
}