/* ========================================
   ZENTERA DESIGN SYSTEM & WEBSITE STYLES
   Version: 1.5 (Bulletproof Edition)
   Date: 15.08.2025
   ======================================== */

/* ========================================
   1. CSS VARIABLES & TOKENS
   ======================================== */
:root {
  /* Primitive Color Tokens */
  --color-white: rgba(255, 255, 255, 1);
  --color-black: rgba(0, 0, 0, 1);
  --color-cream-50: rgba(252, 252, 249, 1);
  --color-gray-200: rgba(245, 245, 245, 1);
  --color-slate-500: rgba(98, 108, 113, 1);
  --color-charcoal-700: rgba(31, 33, 33, 1);
  --color-charcoal-800: rgba(38, 40, 40, 1);
  --color-slate-900: rgba(19, 52, 59, 1);
  --color-teal-300: rgba(50, 184, 198, 1);
  --color-teal-400: rgba(45, 166, 178, 1);
  --color-teal-500: rgba(33, 128, 141, 1);
  --color-teal-600: rgba(29, 116, 128, 1);
  
  /* Semantic Tokens (Light Theme) */
  --color-background: var(--color-cream-50);
  --color-surface: var(--color-white);
  --color-text: var(--color-slate-900);
  --color-text-secondary: var(--color-slate-500);
  --color-primary: var(--color-teal-500);
  --color-primary-hover: var(--color-teal-600);
  --color-border: rgba(94, 82, 64, 0.15);
  --color-focus-ring-glow: rgba(33, 128, 141, 0.2);
  --color-hover-highlight: rgba(33, 128, 141, 0.1);
  
  /* Decorative Gradients */
  --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  
  /* Typography */
  --font-family-base: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-size-base: 16px;
  --font-size-lg: 18px;
  --font-size-xl: 20px;
  --font-size-2xl: 24px;
  --font-size-3xl: 30px;
  --font-size-4xl: 48px;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-bold: 700;
  --line-height-tight: 1.2;
  --line-height-normal: 1.6;
  
  /* Spacing */
  --space-8: 8px;
  --space-12: 12px;
  --space-16: 16px;
  --space-20: 20px;
  --space-24: 24px;
  --space-32: 32px;
  --space-64: 64px;
  --space-80: 80px;
  
  /* Radii (Borders) */
  --radius-base: 8px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  
  /* Shadows */
  --shadow-md: 0 4px 10px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.07);
  --shadow-card-hover: 0 20px 40px rgba(99, 102, 241, 0.15);
  
  /* Layout */
  --container-xl: 1140px;
}

/* ========================================
   2. DARK THEME
   ======================================== */
[data-color-scheme="dark"] {
  --color-background: var(--color-charcoal-700);
  --color-surface: var(--color-charcoal-800);
  --color-text: var(--color-gray-200);
  --color-text-secondary: rgba(167, 169, 169, 0.7);
  --color-primary: var(--color-teal-300);
  --color-primary-hover: var(--color-teal-400);
  --color-border: rgba(119, 124, 124, 0.3);
  --color-focus-ring-glow: rgba(50, 184, 198, 0.2);
  --color-hover-highlight: rgba(50, 184, 198, 0.1);
}

/* ========================================
   3. RESET & BASE STYLES
   ======================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  font-family: var(--font-family-base);
  color: var(--color-text);
  background-color: var(--color-background);
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
}
body {
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
  transition: background-color 0.3s ease, color 0.3s ease;
}
ul { list-style: none; }
a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color 0.2s ease;
}
a:hover { color: var(--color-primary-hover); }

/* ========================================
   4. TYPOGRAPHY
   ======================================== */
h1, h2, h3, h4 {
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
  color: var(--color-text);
}
h1 { font-size: var(--font-size-4xl); }
h2 { font-size: var(--font-size-3xl); }
h3 { font-size: var(--font-size-2xl); }
h4 { font-size: var(--font-size-xl); }
p { margin-bottom: var(--space-16); }
p:last-child { margin-bottom: 0; }

/* ========================================
   5. LAYOUT & COMPONENTS
   ======================================== */
.container {
  width: 100%;
  max-width: var(--container-xl);
  margin: 0 auto;
  padding: 0 var(--space-20);
}
.header {
  position: sticky; top: 0;
  background: rgba(255, 255, 255, 0.8);
  border-bottom: 1px solid var(--color-border);
  z-index: 1000;
  padding: var(--space-16) 0;
}
@supports (backdrop-filter: blur(10px)) or (-webkit-backdrop-filter: blur(10px)) {
  .header {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }
}
[data-color-scheme="dark"] .header { background: rgba(38, 40, 40, 0.8); }
.nav-container { display: flex; justify-content: space-between; align-items: center; }
.logo img { display: block; height: 40px; width: auto; }
.nav-menu { display: flex; gap: var(--space-32); }
.nav-menu a {
  color: var(--color-text-secondary);
  font-weight: var(--font-weight-medium);
  font-size: var(--font-size-base);
}
.nav-menu a:hover, .nav-menu a.active { color: var(--color-primary); }
.hero {
  background: var(--primary-gradient);
  position: relative; overflow: hidden;
  padding: var(--space-80) 0;
  color: var(--color-white);
  display: flex; align-items: center;
}
.hero::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(circle at 20% 80%, rgba(255, 107, 157, 0.2) 0%, transparent 40%),
                radial-gradient(circle at 80% 20%, rgba(81, 226, 245, 0.2) 0%, transparent 40%);
    opacity: 0.7;
}
.hero-content {
  position: relative; z-index: 2;
  max-width: 800px; margin: 0 auto; text-align: center;
}
.hero-title {
  /* --- IMPROVEMENT: Fallback for clamp() --- */
  font-size: 2.5rem;
  font-size: clamp(2.5rem, 6vw, 3.5rem);
  font-weight: 800; line-height: 1.1; margin-bottom: var(--space-24);
  background: linear-gradient(135deg, var(--color-white) 70%, #f0f9ff 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.hero-subtitle {
  font-size: var(--font-size-lg); opacity: 0.9; margin-bottom: var(--space-32);
  font-weight: var(--font-weight-normal); max-width: 650px; margin-left: auto; margin-right: auto;
}
.btn, .cta-button, .store-button {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.cta-button {
  display: inline-block; padding: var(--space-16) var(--space-32); border-radius: var(--radius-full);
  font-weight: var(--font-weight-bold); font-size: var(--font-size-base);
  text-transform: uppercase; letter-spacing: 0.5px; border: none; cursor: pointer; text-align: center;
  background: var(--secondary-gradient); color: var(--color-white);
  box-shadow: 0 8px 24px rgba(245, 87, 108, 0.25);
  will-change: transform;
}
.cta-button:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 12px 32px rgba(245, 87, 108, 0.35);
}
.btn {
  display: inline-block;
  padding: var(--space-12) var(--space-24);
  border-radius: var(--radius-base);
  text-transform: none;
  font-weight: var(--font-weight-medium);
  border: none;
  cursor: pointer;
  transition-property: background-color, border-color;
}
.btn--secondary {
  background: var(--color-border); color: var(--color-text-secondary); cursor: not-allowed;
}
.btn--outline {
  background: transparent; border: 1px solid var(--color-border); color: var(--color-text);
}
.btn--outline:hover { background-color: var(--color-hover-highlight); }
.section { padding: var(--space-80) 0; }
.section--alternate-bg {
  background-color: var(--color-surface);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}
.section-header {
  text-align: center; margin-bottom: var(--space-64);
  max-width: 700px; margin-left: auto; margin-right: auto;
}
.section-header h2 { margin-bottom: var(--space-16); }
.section-header p { font-size: var(--font-size-lg); color: var(--color-text-secondary); }
.features-grid, .projects-grid, .process-grid { display: grid; gap: var(--space-32); }
.features-grid { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.projects-grid { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.process-grid { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.feature-card {
  background: var(--color-background); padding: var(--space-32); border-radius: var(--radius-lg);
  border: 1px solid var(--color-border); box-shadow: var(--shadow-md); text-align: center;
}
.feature-card .feature-icon { font-size: 2.5rem; margin-bottom: var(--space-16); }
.feature-card h3 { font-size: var(--font-size-xl); margin-bottom: var(--space-8); }
.project-card {
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow-lg); display: flex; flex-direction: column;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  will-change: transform;
}
.project-card:hover { transform: translateY(-8px); box-shadow: var(--shadow-card-hover); }
.project-image {
  height: 200px; background-color: var(--color-background);
  display: flex; align-items: center; justify-content: center;
  border-bottom: 1px solid var(--color-border);
}
.project-info { padding: var(--space-24); flex-grow: 1; display: flex; flex-direction: column; }
.project-info h3 { margin-bottom: var(--space-8); }
.project-info p { flex-grow: 1; }
.project-info .btn { margin-top: var(--space-24); }
.process-step { border-left: 3px solid var(--color-primary); padding-left: var(--space-24); }
.process-step h4 { margin-bottom: var(--space-8); font-size: var(--font-size-lg); }
.footer {
  background: var(--color-surface); padding: var(--space-64) 0;
  border-top: 1px solid var(--color-border);
}
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: var(--space-64); margin-bottom: var(--space-64); }
.footer-about p { color: var(--color-text-secondary); margin-top: var(--space-16); max-width: 300px; }
.footer-links h4 {
  font-size: var(--font-size-base); font-weight: var(--font-weight-bold);
  margin-bottom: var(--space-16); text-transform: uppercase; letter-spacing: 0.5px;
}
.footer-links ul li { margin-bottom: var(--space-8); }
.footer-links a { color: var(--color-text-secondary); }
.footer-links a:hover { color: var(--color-primary); }
.footer-bottom {
  padding-top: var(--space-24); border-top: 1px solid var(--color-border);
  text-align: center; color: var(--color-text-secondary); font-size: 14px;
}

/* ========================================
   6. PRODUCT PAGE & 404 STYLES
   ======================================== */
.product-hero { padding: var(--space-64) 0; background-color: var(--color-surface); }
.product-hero-content { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: var(--space-64); }
.product-hero-text h1 { font-size: 2.2rem; font-size: clamp(2.2rem, 5vw, 3rem); }
.product-hero-text p {
  font-size: var(--font-size-lg); color: var(--color-text-secondary);
  margin: var(--space-24) 0 var(--space-32); max-width: 500px;
}
.product-hero-image { text-align: center; }
.product-hero-image img { max-width: 100%; height: auto; max-height: 500px; }
.text-center { text-align: center; max-width: 700px; margin-left: auto; margin-right: auto; }
.store-buttons { display: flex; justify-content: center; flex-wrap: wrap; gap: var(--space-16); margin-top: var(--space-32); }
.store-button {
  display: inline-flex; align-items: center; gap: var(--space-16);
  background-color: transparent; color: var(--color-primary);
  padding: var(--space-8) var(--space-20); border-radius: var(--radius-base);
  text-decoration: none; border: 2px solid var(--color-primary);
  transition-property: transform, background-color, box-shadow;
  will-change: transform;
}
.store-button:hover {
  transform: scale(1.05); background-color: var(--color-hover-highlight);
  box-shadow: 0 0 15px var(--color-focus-ring-glow);
}
.store-button img { height: 32px; width: auto; }
.store-button-text { display: flex; flex-direction: column; text-align: left; }
.store-button-subtitle { font-size: 11px; line-height: 1; text-transform: uppercase; opacity: 0.8; }
.store-button-title { font-size: 18px; line-height: 1.2; font-weight: var(--font-weight-medium); }
.screenshots-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: var(--space-32); margin-top: var(--space-32);
}
.screenshot-item { text-align: center; }
.screenshot-item img {
  width: 100%; height: auto; border-radius: var(--radius-lg);
  border: 1px solid var(--color-border); box-shadow: var(--shadow-md);
  margin-bottom: var(--space-16);
}
.screenshot-item h4 {
  font-size: var(--font-size-base); color: var(--color-text-secondary);
  font-weight: var(--font-weight-medium);
}
.how-it-works-grid { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }

/* ========================================
   7. CONTENT & DOCUMENT PAGES
   ======================================== */
.section--page-header {
  padding: var(--space-64) 0;
  background-color: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}
.page-subtitle {
  font-size: var(--font-size-lg); color: var(--color-text-secondary);
  max-width: 700px; margin: var(--space-16) auto 0;
}
.faq-container, .document-container { max-width: 800px; }
.faq-item { border-bottom: 1px solid var(--color-border); }
.faq-item:last-of-type { border-bottom: none; }
.faq-question {
  display: block; position: relative; width: 100%;
  padding: var(--space-20) var(--space-32) var(--space-20) 0;
  font-size: var(--font-size-lg); font-weight: var(--font-weight-medium);
  cursor: pointer; list-style: none;
}
.faq-question::-webkit-details-marker { display: none; }
.faq-question::after {
  content: '+'; position: absolute; right: 0; top: 50%;
  transform: translateY(-50%); font-size: var(--font-size-xl);
  color: var(--color-primary); transition: transform 0.2s ease;
}
details[open] > .faq-question::after { content: '−'; }
.faq-answer {
  padding: 0 var(--space-16) var(--space-24) 0;
  color: var(--color-text-secondary); line-height: var(--line-height-normal);
}
.faq-answer p, .faq-answer ul { margin-bottom: var(--space-16); }
.faq-answer h4 {
    margin-top: var(--space-24); margin-bottom: var(--space-8);
    font-size: 1rem; color: var(--color-text);
}
.faq-answer ul { list-style-type: disc; padding-left: var(--space-20); }
.faq-answer code {
  background-color: var(--color-border); padding: 2px 6px;
  border-radius: 4px; font-size: 0.9em; color: var(--color-text);
}
.faq-contact-box {
  margin-top: var(--space-64); padding: var(--space-32);
  border: 1px solid var(--color-border); border-radius: var(--radius-lg);
  background-color: var(--color-surface); text-align: center;
}
.faq-contact-box h3 { margin-bottom: var(--space-16); }
.faq-contact-box p { color: var(--color-text-secondary); }
.faq-contact-box ul {
    list-style-position: inside; text-align: left;
    max-width: 400px; margin: var(--space-16) auto;
}
.faq-contact-box .btn { margin-top: var(--space-24); }
.footer-links .active-link {
    color: var(--color-primary);
    font-weight: var(--font-weight-medium);
}
.document-container h2 {
  font-size: var(--font-size-2xl); margin-top: var(--space-32);
  margin-bottom: var(--space-16); padding-bottom: var(--space-8);
  border-bottom: 1px solid var(--color-border);
}
.document-container h3 {
  font-size: var(--font-size-xl); margin-top: var(--space-24);
  margin-bottom: var(--space-16);
}
.document-container p, .document-container ul {
  margin-bottom: var(--space-16); color: var(--color-text);
  line-height: var(--line-height-normal);
}
.document-container ul { list-style-type: disc; padding-left: var(--space-20); }

/* ========================================
   8. CONTACT FORM STYLES
   ======================================== */
.contact-form-container {
  max-width: 700px; margin: 0 auto; padding: var(--space-32);
  background-color: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
}
.form-group { margin-bottom: var(--space-20); }
.form-group label {
  display: block; font-weight: var(--font-weight-medium);
  margin-bottom: var(--space-8); color: var(--color-text);
}
.form-group input,
.form-group textarea {
  width: 100%; padding: var(--space-16); border: 1px solid var(--color-border);
  border-radius: var(--radius-base); background-color: var(--color-background);
  color: var(--color-text); font-size: var(--font-size-base);
  font-family: var(--font-family-base);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.form-group input:focus,
.form-group textarea:focus {
  outline: none; border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-focus-ring-glow);
}
.contact-form-container .cta-button { width: 100%; padding: var(--space-16); }

/* ========================================
   9. ACCESSIBILITY IMPROVEMENTS
   ======================================== */
.btn:focus-visible,
.cta-button:focus-visible,
.store-button:focus-visible,
.faq-question:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: var(--radius-base);
}

/* ========================================
   10. RESPONSIVE DESIGN
   ======================================== */
@media (max-width: 768px) {
  .nav-menu { display: none; }
  .footer-grid { grid-template-columns: 1fr; text-align: center; }
  .footer-about, .footer-links { margin-bottom: var(--space-32); }
  .footer-about p { margin-left: auto; margin-right: auto; }
  .product-hero-content { grid-template-columns: 1fr; text-align: center; }
  .product-hero-text p { margin-left: auto; margin-right: auto; }
  .product-hero-image { margin-top: var(--space-32); }
  .screenshots-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .section { padding: var(--space-64) 0; }
  .hero { padding: var(--space-64) 0; }
  .hero-title { font-size: 2.2rem; font-size: clamp(2.2rem, 8vw, 2.5rem); }
  .section-header h2 { font-size: var(--font-size-2xl); }
}
/* ========================================
   11. POST-OPTIMIZATION FIXES
   ======================================== */

/* Fix for centering the 'Learn More' button inside project cards */
.project-info .btn {
  align-self: center;
}
