:root {
  --color-bg: #f9fafb; /* Softer background for better readability */
  --color-fg: #111827; /* Slightly softer black for text */
  --color-primary: #0f766e; /* Teal primary */
  --color-secondary: #14b8a6; /* Brighter teal for accents */
  --color-accent: #d946ef; /* Vibrant pink for focus and highlights */
  --color-stripe-light: rgba(20,184,166,0.06); /* Enhanced stripe opacity for subtle artistic flair */
  --color-stripe-dark: rgba(15,118,110,0.1);
  --font-sans: 'Inter', system-ui, sans-serif;
  --font-mono: 'Fira Code', monospace;
  --space-xs: 0.375rem; /* Adjusted for finer spacing control */
  --space-s: 0.75rem;
  --space-m: 1.25rem;
  --space-l: 2.5rem;
  --space-xl: 5rem;
  --radius: 1rem; /* Softer corners for a more inviting feel */
  --shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06); /* Deeper shadow for card depth */
  --transition: all 200ms ease-out; /* Global transition for smooth interactions */
}

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

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--color-fg);
  background-color: var(--color-bg);
  background-image: radial-gradient(circle at 50% 0, rgba(20,184,166,0.1), transparent 60%); /* Enhanced gradient for artistic depth */
  line-height: 1.7; /* Improved line height for readability */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.3;
  margin: 0 0 var(--space-s);
  color: var(--color-primary);
}

p {
  margin: 0 0 var(--space-s);
}

a {
  color: var(--color-secondary);
  text-decoration: underline wavy var(--color-accent); /* Wavy underline for creative touch */
  text-underline-offset: 2px;
}

a:hover,
a:focus {
  color: var(--color-primary);
}

img, svg, video, canvas, audio, iframe, embed, object {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
}

code, pre {
  font-family: var(--font-mono);
  background: rgba(15,118,110,0.08);
  padding: 0.2em 0.4em;
  border-radius: 0.375rem;
}

pre {
  overflow-x: auto;
  padding: var(--space-s);
  margin: var(--space-m) 0;
  border: 1px solid var(--color-stripe-dark);
}

.container {
  width: min(95vw, 65rem); /* Wider container for better content flow */
  margin-inline: auto;
  padding: var(--space-xl) var(--space-l);
}

.card {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: var(--space-l);
  transition: var(--transition);
}

.card:hover {
  transform: translateY(-2px); /* Subtle lift on hover for engagement */
  box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
}

.button {
  display: inline-flex;
  align-items: center;
  padding: var(--space-s) var(--space-l);
  border-radius: var(--radius);
  font-weight: 600;
  background: linear-gradient(to right, var(--color-primary), var(--color-secondary)); /* Gradient for artistic appeal */
  color: white;
  transition: var(--transition);
  border: none;
  cursor: pointer;
}

.button:hover,
.button:focus {
  background: linear-gradient(to right, var(--color-secondary), var(--color-primary));
  transform: scale(1.05); /* Slight scale for interactive feedback */
}

.bg-stripes {
  background-image: repeating-linear-gradient(
    45deg,
    var(--color-stripe-light) 0,
    var(--color-stripe-light) 12px,
    var(--color-stripe-dark) 12px,
    var(--color-stripe-dark) 24px
  ); /* Thicker stripes for more visual interest */
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #0f172a;
    --color-fg: #f1f5f9;
    --color-stripe-light: rgba(14,165,233,0.08);
    --color-stripe-dark: rgba(20,184,166,0.08);
    --shadow: 0 4px 6px -1px rgba(0,0,0,0.5), 0 2px 4px -1px rgba(0,0,0,0.3);
  }
  body {
    background-image: radial-gradient(circle at 50% 0, rgba(14,165,233,0.15), transparent 60%);
  }
  .card {
    background: #1e293b;
  }
  code, pre {
    background: rgba(14,165,233,0.1);
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .card:hover, .button:hover, .button:focus {
    transform: none;
  }
}

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  border: 0;
}

.grid {
  display: grid;
  gap: var(--space-l); /* Larger gap for better section separation */
}

.flex {
  display: flex;
  gap: var(--space-m);
  align-items: center; /* Center alignment for nav items */
}

.justify-between {
  justify-content: space-between;
}

/* Additional styles for artistic engagement */
ul, ol {
  margin: var(--space-m) 0;
  padding-left: var(--space-l);
  list-style-type: none; /* Custom bullets for creativity */
}

ul li::before, ol li::before {
  content: '✏️ '; /* Pencil emoji for artistic prompt feel */
  margin-right: var(--space-xs);
}

#prompt-output {
  font-style: italic;
  color: var(--color-primary);
  padding: var(--space-s);
  background: var(--color-stripe-light);
  border-radius: var(--radius);
  border-left: 4px solid var(--color-secondary); /* Highlight for generated prompts */
}

nav a {
  position: relative;
  padding-bottom: var(--space-xs);
  transition: var(--transition);
}

nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-accent);
  transition: width 300ms ease;
}

nav a:hover::after,
nav a:focus::after {
  width: 100%;
}
