/* ========================================
   CSS Variables & Root Styles
   ======================================== */
:root {
  --color-bg: #0f0f0f;
  --color-text: #f9f9f9;
  --color-border: #2a2a2a;
  --spacing-unit: 16px;
  --spacing-sm: calc(var(--spacing-unit) * 0.5);
  --spacing-md: var(--spacing-unit);
  --spacing-lg: calc(var(--spacing-unit) * 2);
  --spacing-xl: calc(var(--spacing-unit) * 3);
  --font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  --font-size-base: 16px;
  --font-size-h1: 2.5rem;
  --line-height: 1.6;
  --transition: all 0.2s ease-in-out;
}

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

html,
body {
  height: 100%;
  width: 100%;
}

body {
  font-family: var(--font-family);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: var(--line-height);
  font-size: var(--font-size-base);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow-x: hidden;
   height: 100%;
    margin: 0;
    overflow: hidden;
}

/* ========================================
   Typography
   ======================================== */
h1 {
  font-size: var(--font-size-h1);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: var(--spacing-md);
  text-align: center;
}

p {
  margin-bottom: var(--spacing-md);
}

/* ========================================
   Layout & Container
   ======================================== */
.container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100%;
  width: 100%;
  padding: var(--spacing-lg);
  max-width: 800px;
  margin: 0 auto;
   overflow-y: auto;
   height: 100%;
overscroll-behavior-y: contain; 
}

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
}

/* ========================================
   Images
   ======================================== */
img {
  width: 100%;
  max-width: 600px;
  height: auto;
  aspect-ratio: auto;
  border-radius: 8px;
  border: 1px solid var(--color-border);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  transition: var(--transition);
}

img:focus {
  outline: 2px solid var(--color-text);
  outline-offset: 4px;
}

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

/* Small devices (mobile) */
@media (max-width: 480px) {
  :root {
    --font-size-h1: 1.75rem;
  }

  .container {
    padding: var(--spacing-md);
  }

  img {
    max-width: 100%;
    border-radius: 6px;
  }
}

/* Medium devices (tablets) */
@media (max-width: 768px) {
  :root {
    --font-size-h1: 2rem;
  }

  .container {
    padding: var(--spacing-lg);
  }
}

/* Large devices (desktop) */
@media (min-width: 1024px) {
  :root {
    --font-size-base: 18px;
  }
}

/* ========================================
   Accessibility & Focus States
   ======================================== */
:focus-visible {
  outline: 2px solid var(--color-text);
  outline-offset: 4px;
  border-radius: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: more) {
  :root {
    --color-bg: #000;
    --color-text: #fff;
    --color-border: #333;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Light mode support (optional) */
@media (prefers-color-scheme: light) {
  :root {
    --color-bg: #f9f9f9;
    --color-text: #1a1a1a;
    --color-border: #e0e0e0;
  }

  img {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  }
}

/* Print styles */
@media print {
  body {
    background-color: white;
    color: black;
  }

  img {
    border: none;
    box-shadow: none;
  }
}
