/* =========================
   MAIN THEME
   Modern, warm, inspiring CSS architecture
   ========================= */

@layer reset, base, layout, components, utilities;

/* =========================
   RESET LAYER - Clean foundation
   ========================= */
@layer reset {
  *, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
  }
  
  html {
    scroll-behavior: smooth;
    font-size: 16px;
  }
  
  @media (prefers-reduced-motion: reduce) {
    html {
      scroll-behavior: auto;
    }
  }
}

/* =========================
   BASE LAYER - Typography & Colors
   ========================= */
@layer base {
  body {
    font-family: 'Lexend', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    font-size: var(--text-base);
    font-weight: var(--weight-normal);
    line-height: var(--leading-relaxed);
    color: var(--text-primary);
    background: var(--surface-primary);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }
  
  img {
    display: block;
    max-width: 100%;
    height: auto;
  }
  
  /* === INSPIRING TYPOGRAPHY === */
  h1, h2, h3, h4, h5, h6 {
    font-weight: var(--weight-bold);
    line-height: var(--leading-tight);
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
  }
  
  h1 {
    font-size: var(--text-3xl);
    font-weight: var(--weight-black);
    letter-spacing: -0.02em;
  }
  
  .hero-title {
    font-size: var(--text-hero);
    font-weight: var(--weight-black);
    line-height: var(--leading-tight);
    color: var(--text-primary);
    margin-bottom: var(--space-md);
  }
  
  h2 {
    font-size: var(--text-2xl);
    color: var(--energy-primary);
  }
  
  h3 {
    font-size: var(--text-xl);
    color: var(--wisdom-primary);
  }
  
  p {
    margin-bottom: var(--space-md);
    color: var(--text-secondary);
  }
  
  .lead-text {
    font-size: var(--text-lg);
    color: var(--text-primary);
    font-weight: var(--weight-medium);
    line-height: var(--leading-relaxed);
    max-width: 65ch;
  }
  
  .text-center .lead-text {
    margin-left: auto;
    margin-right: auto;
  }
  
  /* === INSPIRING LINKS === */
  a {
    color: var(--energy-primary);
    text-decoration: none;
    font-weight: var(--weight-semibold);
    transition: all var(--duration-smooth) var(--ease-gentle);
    position: relative;
  }
  
  a:hover {
    color: var(--energy-secondary);
    transform: translateY(-1px);
  }
  
  a:focus-visible {
    outline: 2px solid var(--energy-primary);
    outline-offset: 3px;
    border-radius: var(--radius-sm);
  }
  
  /* === LISTS === */
  ul, ol {
    margin-left: var(--space-lg);
    margin-bottom: var(--space-md);
  }
  
  li {
    margin-bottom: var(--space-xs);
    color: var(--text-secondary);
  }
  
  ul li::marker {
    color: var(--energy-primary);
  }
}

/* =========================
   LAYOUT LAYER - Structure & Grid
   ========================= */
@layer layout {
  .container {
    width: 100%;
    max-width: var(--content-width);
    margin: 0 auto;
    padding: 0 var(--space-lg);
  }
  
  .hero-container {
    width: 100%;
    max-width: var(--hero-width);
    margin: 0 auto;
    padding: 0 var(--space-lg);
  }
  
  main {
    min-height: 100vh;
  }
  
  section {
    padding: var(--space-2xl) 0;
    scroll-margin-top: var(--space-3xl);
  }
  
  .section-hero {
    padding: var(--space-3xl) 0;
    background: linear-gradient(135deg, var(--surface-primary) 0%, var(--surface-warm) 100%);
    position: relative;
    overflow: hidden;
  }
  
  .section-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 70% 30%, var(--energy-light) 0%, transparent 50%);
    opacity: 0.6;
    z-index: var(--z-behind);
  }
  
  /* === FLEXIBLE GRID SYSTEM === */
  .grid {
    display: grid;
    gap: var(--space-lg);
  }
  
  .grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  }
  
  .grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  }
  
  /* Responsive adjustments */
  @media (max-width: 1024px) {
    .grid-3 {
      grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    }
  }
  
  @media (max-width: 768px) {
    .grid-2 {
      grid-template-columns: 1fr;
    }
    
    .grid-3 {
      grid-template-columns: 1fr;
    }
  }
  
  .hero-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: var(--space-2xl);
    align-items: flex-start;
    min-height: 70vh;
  }

  .hero-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-md);
    max-width: none;
    padding-right: var(--space-lg);
  }

  .hero-image-container {
    display: flex;
    justify-content: center;
    align-items: flex-start;
  }

  @media (max-width: 768px) {
    .hero-grid {
      grid-template-columns: 1fr;
      gap: var(--space-lg);
      min-height: auto;
      text-align: center;
      align-items: center;
    }

    .hero-content {
      align-items: center;
      text-align: center;
    }

    .hero-image-container {
      justify-content: center;
      align-items: center;
    }
  }

  .section-hero-with-background {
    position: relative;
    min-height: 70vh;
    display: flex;
    align-items: center;
    overflow: visible;
    z-index: var(--z-sticky);
  }

  .section-hero-with-background img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center right;
    z-index: var(--z-behind);
    clip-path: inset(0);
  }

  .section-hero-with-background .hero-container {
    position: relative;
    z-index: var(--z-elevated);
  }

  .section-hero-with-background .hero-content {
    max-width: 800px;
    background: rgba(254, 252, 250, 0.95);
    padding: var(--space-2xl);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-inspiring);
    position: relative;
    z-index: var(--z-sticky);
  }
  
  .section-hero-with-background .hero-content.text-center,
  .section-hero-with-background.hero-content-center .hero-content {
    text-align: center;
  }
  
  .section-hero-with-background .hero-content.text-center .hero-title,
  .section-hero-with-background.hero-content-center .hero-title,
  .section-hero-with-background .hero-content.text-center h1,
  .section-hero-with-background.hero-content-center h1 {
    text-align: center;
  }

  .section-hero-with-background .hero-title {
    font-size: clamp(2.5rem, 2rem + 2vw, 4.5rem);
  }

  .section-hero-with-background.hero-content-right .hero-container {
    display: flex;
    justify-content: flex-end;
  }

  .section-hero-with-background.hero-content-right img {
    object-position: center left;
  }

  .section-hero-with-background.hero-content-bottom {
    min-height: 60vh;
    align-items: flex-end;
    padding-bottom: var(--space-2xl);
  }

  .section-hero-with-background.hero-content-bottom img {
    object-position: center;
  }

  .section-hero-with-background.hero-content-bottom .hero-container {
    width: 100%;
    display: flex;
    justify-content: center;
    transform: translateY(60%);
  }

  .section-hero-with-background.hero-content-bottom .hero-content {
    text-align: left;
    max-width: 90%;
    margin: 0 auto;
  }

  @media (max-width: 1300px) {
    .section-hero-with-background:not(.hero-content-center) {
      min-height: auto;
      display: flex;
      flex-direction: column;
      align-items: stretch;
      padding: var(--space-lg) 0 0 0;
    }

    .section-hero-with-background:not(.hero-content-center) img {
      position: relative;
      width: 100%;
      height: 50vh;
      min-height: 300px;
      object-fit: cover;
      order: 2;
    }

    .section-hero-with-background:not(.hero-content-center) .hero-container {
      display: contents;
    }

    .section-hero-with-background:not(.hero-content-center) .hero-content {
      display: contents;
    }
    
    .section-hero-with-background:not(.hero-content-center) .hero-title,
    .section-hero-with-background:not(.hero-content-center) h1.hero-title {
      padding: 0 var(--space-lg) var(--space-lg) var(--space-lg);
      margin-bottom: 0;
      order: 1;
      width: 100%;
      box-sizing: border-box;
      text-align: center;
    }
    
    .section-hero-with-background:not(.hero-content-center) .hero-content > *:not(.hero-title):not(h1.hero-title) {
      padding: 0 var(--space-lg);
      order: 3;
      width: 100%;
      box-sizing: border-box;
      text-align: left;
    }
    
    .section-hero-with-background:not(.hero-content-center) .hero-content > p:not(.hero-title) {
      margin-bottom: var(--space-md);
    }
    
    .section-hero-with-background:not(.hero-content-center) .hero-content > *:not(.hero-title):not(h1.hero-title):first-of-type {
      padding-top: var(--space-md);
    }
    
    .section-hero-with-background:not(.hero-content-center) .hero-content > *:last-child:not(.hero-title):not(h1.hero-title) {
      padding-bottom: var(--space-xl);
    }
    
    .section-hero-with-background:not(.hero-content-center) .hero-content .btn-group,
    .section-hero-with-background:not(.hero-content-center) .hero-content .btn-group.btn-group--loose {
      justify-content: center !important;
      padding-top: var(--space-md);
      margin-left: auto;
      margin-right: auto;
    }
  }

  @media (max-width: 600px) {
    .grid {
      gap: var(--space-md);
    }

    section {
      padding: var(--space-xl) 0;
      scroll-margin-top: var(--space-2xl);
    }

    .section-hero-with-background:not(.hero-content-center) img {
      height: 40vh;
      min-height: 250px;
    }
  }
}

/* =========================
   COMPONENTS LAYER - UI Elements
   ========================= */
@layer components {
  /* === INSPIRING BUTTONS === */
  .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    padding: var(--space-sm) var(--space-lg);
    font-size: var(--text-base);
    font-weight: var(--weight-semibold);
    text-decoration: none;
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--duration-smooth) var(--ease-inspiring);
    position: relative;
    overflow: hidden;
    z-index: var(--z-base);
    text-align: center;
    line-height: 1.35;
    white-space: normal;
  }
  
  .btn:focus-visible {
    outline: 3px solid rgba(242, 153, 74, 0.4);
    outline-offset: 3px;
  }
  
  .btn-primary {
    background: var(--energy-primary);
    color: var(--text-on-color);
    box-shadow: var(--shadow-energy);
  }
  
  .btn-primary:hover {
    background: var(--energy-secondary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-warm);
  }
  
  .btn-secondary {
    background: var(--surface-elevated);
    color: var(--energy-primary);
    border: 2px solid var(--energy-primary);
    box-shadow: var(--shadow-soft);
  }
  
  .btn-secondary:hover {
    background: var(--energy-primary);
    color: var(--text-on-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-warm);
  }
  
  .btn-wisdom {
    background: var(--wisdom-primary);
    color: var(--text-on-color);
    box-shadow: var(--shadow-wisdom);
  }
  
  .btn-wisdom:hover {
    background: var(--wisdom-secondary);
    transform: translateY(-2px);
  }
  
  .btn-growth {
    background: var(--growth-primary);
    color: var(--text-on-color);
    box-shadow: var(--shadow-growth);
  }
  
  .btn-growth:hover {
    background: var(--growth-secondary);
    transform: translateY(-2px);
  }
  
  .btn-pulse {
    background: var(--spark-primary);
    color: var(--text-on-color);
    box-shadow: var(--shadow-pulse);
    border-bottom: 3px solid var(--flow-primary);
  }
  
  .btn-pulse:hover {
    background: var(--spark-secondary);
    transform: translateY(-2px);
    border-bottom-color: var(--flow-secondary);
  }
  
  .btn-spark {
    background: var(--spark-primary);
    color: var(--text-on-color);
    box-shadow: var(--shadow-pulse);
  }
  
  .btn-spark:hover {
    background: var(--spark-secondary);
    transform: translateY(-2px);
  }
  
  .btn-flow {
    background: var(--flow-primary);
    color: var(--text-on-color);
    box-shadow: var(--shadow-pulse-teal);
  }
  
  .btn-flow:hover {
    background: var(--flow-secondary);
    transform: translateY(-2px);
  }

  .btn-group {
    --btn-group-gap: var(--space-md);
    display: flex;
    flex-wrap: wrap;
    column-gap: var(--btn-group-gap);
    row-gap: var(--space-sm);
    align-items: flex-start;
    justify-content: flex-start;
  }

  .btn-group--loose {
    --btn-group-gap: var(--space-lg);
  }

  .btn-group .btn {
    flex: 0 1 auto;
  }

  .text-center .btn-group {
    justify-content: center;
  }

  .card > .btn {
    margin-top: var(--space-md);
    align-self: flex-start;
  }
  
  /* === INSPIRING CARDS === */
  .card {
    background: var(--surface-elevated);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    box-shadow: var(--shadow-soft);
    transition: all var(--duration-smooth) var(--ease-gentle);
    position: relative;
    overflow: hidden;
  }
  
  .card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-energy);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--duration-smooth) var(--ease-inspiring);
  }
  
  .card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-inspiring);
  }
  
  .card:hover::before {
    transform: scaleX(1);
  }
  
  .card-wisdom::before {
    background: var(--gradient-wisdom);
  }
  
  .card-growth::before {
    background: var(--gradient-growth);
  }
  
  .card-warmth::before {
    background: linear-gradient(135deg, var(--warmth-primary) 0%, var(--warmth-secondary) 100%);
  }
  
  .card-pulse::before {
    background: var(--gradient-pulse);
  }
  
  .card-spark::before {
    background: linear-gradient(135deg, var(--spark-primary), var(--spark-secondary));
  }
  
  .card-flow::before {
    background: linear-gradient(135deg, var(--flow-primary), var(--flow-secondary));
  }
  
  .card-spectrum::before {
    background: var(--gradient-full-spectrum);
    height: 6px;
  }
  
  /* === PROFESSIONAL PHOTO === */
  .hero-image {
    width: min(420px, 100%);
    aspect-ratio: var(--hero-image-aspect, 4 / 5);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-inspiring);
    object-fit: cover;
    transition: transform var(--duration-gentle) var(--ease-gentle);
    position: relative;
  }
  
  .hero-image--portrait {
    --hero-image-aspect: 4 / 5;
  }
  
  .hero-image--wide {
    width: 100%;
    max-width: 100%;
    --hero-image-aspect: 16 / 10;
  }
  
  .hero-image:hover {
    transform: scale(1.02) rotate(-1deg);
  }
  
  @media (max-width: 768px) {
    .hero-image:not(.hero-image--wide) {
      width: min(320px, 85vw);
    }
  }
  
  @media (max-width: 480px) {
    .hero-image:not(.hero-image--wide) {
      width: min(260px, 80vw);
    }
  }
  
  /* === TESTIMONIAL COMPONENT === */
  .testimonial {
    background: var(--surface-warm);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    border-left: 4px solid var(--energy-primary);
    position: relative;
  }
  
  .testimonial-quote {
    font-size: var(--text-lg);
    font-style: italic;
    color: var(--text-primary);
    line-height: var(--leading-relaxed);
    margin-bottom: var(--space-md);
  }
  
  .testimonial-author {
    font-weight: var(--weight-semibold);
    color: var(--energy-primary);
  }
  
  /* === SECTION HEADERS === */
  .section-header {
    text-align: center;
    margin-bottom: var(--space-2xl);
  }
  
  .section-title {
    font-size: var(--text-3xl);
    font-weight: var(--weight-black);
    margin-bottom: var(--space-md);
    color: var(--text-primary);
    position: relative;
    padding-bottom: var(--space-sm);
  }
  
  .section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--gradient-pulse);
    border-radius: 2px;
  }
  
  .section-subtitle {
    font-size: var(--text-xl);
    color: var(--text-secondary);
    max-width: min(72ch, 900px);
    margin: 0 auto;
  }
}

/* =========================
   UTILITIES LAYER - Helper Classes
   ========================= */
@layer utilities {
  .text-center { text-align: center; }
  .text-left { text-align: left; }
  .text-right { text-align: right; }
  
  .space-top-md { margin-top: var(--space-md); }
  .space-top-lg { margin-top: var(--space-lg); }
  .space-top-xl { margin-top: var(--space-xl); }
  .space-top-2xl { margin-top: var(--space-2xl); }
  
  .font-bold { font-weight: var(--weight-bold); }
  .font-semibold { font-weight: var(--weight-semibold); }
  .font-medium { font-weight: var(--weight-medium); }
  
  .text-energy { color: var(--energy-primary); }
  .text-wisdom { color: var(--wisdom-primary); }
  .text-growth { color: var(--growth-primary); }
  .text-warmth { color: var(--warmth-primary); }
  .text-spark { color: var(--spark-primary); }
  .text-flow { color: var(--flow-primary); }
  
  .bg-energy-light { background-color: var(--energy-light); }
  .bg-wisdom-light { background-color: var(--wisdom-light); }
  .bg-growth-light { background-color: var(--growth-light); }
  .bg-warmth-light { background-color: var(--warmth-light); }
  .bg-spark-light { background-color: var(--spark-light); }
  .bg-flow-light { background-color: var(--flow-light); }
  
  /* Gradient text - opt-in only for special emphasis */
  .gradient-text {
    background: var(--gradient-energy);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
  }
  
  .gradient-text-pulse {
    background: var(--gradient-pulse);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
  }
  
  /* Subtle gradient underline - for minimal accent */
  .gradient-underline {
    position: relative;
    padding-bottom: 4px;
  }
  
  .gradient-underline::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gradient-pulse);
    border-radius: 1px;
  }
  
  .shadow-soft { box-shadow: var(--shadow-soft); }
  .shadow-warm { box-shadow: var(--shadow-warm); }
  .shadow-inspiring { box-shadow: var(--shadow-inspiring); }
  
  .animate-fade-in {
    opacity: 0;
    transform: translateY(32px);
    will-change: transform, opacity;
  }
  
  .animate-fade-in.in-view {
    animation: fadeInUp var(--duration-inspiring) var(--ease-inspiring) forwards;
    animation-delay: var(--fade-delay, 0ms);
  }
  
  @keyframes fadeInUp {
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  
  .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
}

/* =========================
   RESPONSIVE REFINEMENTS
   ========================= */
@media (max-width: 768px) {
  .hero-title {
    font-size: var(--text-4xl);
  }
  
  .section-title {
    font-size: var(--text-2xl);
  }
  
  .btn {
    padding: var(--space-sm) var(--space-lg);
    font-size: var(--text-base);
  }
  
  .card {
    padding: var(--space-lg);
  }

  .btn-group {
    row-gap: var(--space-sm);
  }
}

@media (max-width: 640px) {
  .btn-group {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-group .btn {
    width: 100%;
  }
}

  @media (max-width: 480px) {
    .hero h1,
    h1.hero-title,
    .section-hero-with-background h1,
    .section-hero-with-background .hero-title {
      font-size: var(--text-hero);
      line-height: 1.1;
      letter-spacing: -0.01em;
    }
    
    .section-hero-with-background:not(.hero-content-center) .hero-title,
    .section-hero-with-background:not(.hero-content-center) h1.hero-title {
      padding: 0 var(--space-md) var(--space-md) var(--space-md);
      text-align: center;
    }
    
    .section-hero-with-background:not(.hero-content-center) .hero-content > *:not(.hero-title):not(h1.hero-title) {
      padding-left: var(--space-md);
      padding-right: var(--space-md);
      text-align: left;
    }
  
    .container,
    .hero-container {
      padding-left: var(--space-md);
      padding-right: var(--space-md);
      max-width: var(--content-width);
    }
  
    .card {
      padding: var(--space-md);
    }
  
    .btn {
      font-size: clamp(0.95rem, 0.9rem + 0.5vw, 1rem);
      padding: var(--space-sm) var(--space-md);
      line-height: 1.2;
      white-space: normal;
      word-break: break-word;
      min-height: 44px;
    }
  
    h2,
    .section-title {
      font-size: var(--text-3xl);
      line-height: 1.2;
    }
  
    h3 {
      font-size: var(--text-2xl);
      line-height: 1.25;
    }
  
    .lead-text {
      font-size: var(--text-lg);
      line-height: 1.5;
    }
  
    p, li {
      font-size: 1rem;
      line-height: 1.6;
    }
  
    section {
      padding-top: var(--space-xl);
      padding-bottom: var(--space-xl);
    }
  
    @supports (padding-left: max(0px)) {
      .container,
      .hero-container {
        padding-left: max(var(--space-md), env(safe-area-inset-left));
        padding-right: max(var(--space-md), env(safe-area-inset-right));
      }
    }
  }


@media (max-width: 360px) {
  .container,
  .hero-container {
    padding-left: var(--space-sm);
    padding-right: var(--space-sm);
    max-width: var(--content-width);
  }
  
  .card {
    padding: var(--space-sm);
  }
  
  .section-hero-with-background:not(.hero-content-center) .hero-title,
  .section-hero-with-background:not(.hero-content-center) h1.hero-title {
    padding: 0 var(--space-sm) var(--space-md) var(--space-sm);
    text-align: center;
  }
  
  .section-hero-with-background:not(.hero-content-center) .hero-content > *:not(.hero-title):not(h1.hero-title) {
    padding-left: var(--space-sm);
    padding-right: var(--space-sm);
    text-align: left;
  }
  
  .btn {
    padding: var(--space-sm) var(--space-md);
  }
}

/* =========================
   ACCESSIBILITY ENHANCEMENTS
   ========================= */
@media (prefers-reduced-motion: reduce) {
  .animate-fade-in,
  .animate-fade-in.in-view {
    animation: none;
    opacity: 1;
    transform: none;
  }
  
  .card:hover {
    transform: none;
  }
  
  .btn-primary:hover {
    transform: none;
  }
}
