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

@layer theme {
  :root {
    /* Colors — light mode (default) */
    --color-bg-deep: #F8FAFC;
    --color-bg-surface: #FFFFFF;
    --color-bg-surface-glass: rgba(255, 255, 255, 0.75);

    --color-text-main: #334155;
    --color-text-heading: #0F172A;

    --color-accent-red: #E63946;
    --color-accent-blue: #457B9D;

    --color-border-glass: rgba(0, 0, 0, 0.08);

    /* Typography */
    --font-family-body: 'Inter', 'Geist', sans-serif;
    --font-family-heading: 'Rajdhani', 'Oswald', 'Roboto Condensed', sans-serif;

    /* Shapes */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;

    /* Spacing */
    --space-2xs: 0.25rem;
    --space-xs: 0.5rem;
    --space-sm: 0.75rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;

    /* Shadows & Glass */
    --glass-blur: 12px;
    --shadow-premium: 0 4px 20px rgba(0, 0, 0, 0.08);

    /* Transitions */
    --transition-physical: 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  }

  @media (prefers-color-scheme: dark) {
    :root {
      --color-bg-deep: #0B1120;
      --color-bg-surface: #0F172A;
      --color-bg-surface-glass: rgba(15, 23, 42, 0.65);
      --color-text-main: #CBD5E1;
      --color-text-heading: #FFFFFF;
      --color-border-glass: rgba(255, 255, 255, 0.1);
      --shadow-premium: 0 10px 30px rgba(0, 0, 0, 0.5);
    }
  }
}

@layer base {
  *, *::before, *::after {
    box-sizing: border-box;
  }

  body {
    background-color: var(--color-bg-deep);
    color: var(--color-text-main);
    font-family: var(--font-family-body);
    margin: 0;
    padding: 0;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
  }
  
  h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-family-heading);
    color: var(--color-text-heading);
    margin-top: 0;
    margin-bottom: var(--space-md);
    font-weight: 700;
  }
  
  a {
    color: var(--color-text-main);
    text-decoration: none;
    transition: color var(--transition-physical);
  }
  
  a:hover {
    color: var(--color-text-heading);
  }
}

@layer utilities {
  .l-container {
    max-width: 1200px;
    margin-inline: auto;
    padding-inline: var(--space-md);
  }

  .l-stack {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: var(--space-md);
  }

  .u-text-accent {
    color: var(--color-accent-blue);
  }

  .alert {
    padding: var(--space-md);
    margin-block: var(--space-md);
    border-radius: var(--radius-md);
    font-weight: 600;
    text-align: center;
    backdrop-filter: blur(var(--glass-blur));
  }

  .alert-success {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.2);
  }

  .alert-warning {
    background: rgba(234, 179, 8, 0.15);
    color: #facc15;
    border: 1px solid rgba(234, 179, 8, 0.2);
  }
}

@layer components {
  .static-page {
    padding-block: var(--space-3xl);
    flex-grow: 1;

    & .static-page__title {
      font-size: clamp(1.75rem, 3vw, 2.5rem);
      margin-bottom: var(--space-2xl);
      color: var(--color-text-heading);
    }

    & .static-page__content {
      color: var(--color-text-main);
      line-height: 1.8;
      max-width: 800px;

      & h2, & h3 { color: var(--color-text-heading); margin-top: var(--space-xl); }
      & a { color: var(--color-accent-blue); }
      & a:hover { text-decoration: underline; }
      & p { margin-bottom: var(--space-md); }
      & ul, & ol { padding-left: var(--space-xl); margin-bottom: var(--space-md); }
    }
  }
}
