/* ==========================================================================
   BASE.CSS — Reset, CSS Variables, Typography
   Mersin Su Tesisatçısı — Premium Design System
   ========================================================================== */

:root {
  /* ---- Brand Colors (Light) ---- */
  --color-navy-950: #04101f;
  --color-navy-900: #0a2540;
  --color-navy-800: #0f3159;
  --color-navy-700: #163f70;
  --color-blue-600: #1d6fe0;
  --color-blue-500: #2e86f5;
  --color-blue-400: #5fa4f7;
  --color-cyan-500: #0ea9c4;
  --color-cyan-400: #22d3ee;
  --color-orange-600: #e85a2a;
  --color-orange-500: #ff6a39;
  --color-orange-400: #ff8c61;

  /* ---- Neutrals ---- */
  --color-white: #ffffff;
  --color-gray-50: #f7f9fc;
  --color-gray-100: #eef2f7;
  --color-gray-200: #e2e8f0;
  --color-gray-300: #cbd5e1;
  --color-gray-400: #94a3b8;
  --color-gray-500: #64748b;
  --color-gray-600: #475569;
  --color-gray-700: #334155;
  --color-gray-800: #1e293b;
  --color-gray-900: #0f172a;

  /* ---- Semantic ---- */
  --color-success: #16a34a;
  --color-whatsapp: #25d366;
  --color-star: #fbbf24;

  /* ---- Surface / Text (Light theme defaults) ---- */
  --surface-bg: var(--color-white);
  --surface-alt: var(--color-gray-50);
  --surface-card: var(--color-white);
  --surface-elevated: var(--color-white);
  --text-primary: var(--color-gray-900);
  --text-secondary: var(--color-gray-600);
  --text-muted: var(--color-gray-500);
  --text-on-dark: var(--color-white);
  --text-on-dark-muted: rgba(255, 255, 255, 0.72);
  --border-subtle: var(--color-gray-200);
  --border-strong: var(--color-gray-300);

  --brand-primary: var(--color-navy-900);
  --brand-primary-strong: var(--color-navy-950);
  --brand-accent: var(--color-blue-600);
  --brand-cta: var(--color-orange-500);
  --brand-cta-hover: var(--color-orange-600);

  /* ---- Gradients ---- */
  --gradient-hero: linear-gradient(135deg, #04101f 0%, #0a2540 45%, #10406f 100%);
  --gradient-accent: linear-gradient(120deg, var(--color-blue-600), var(--color-cyan-500));
  --gradient-cta: linear-gradient(120deg, #ff8c4a, var(--brand-cta));
  --gradient-overlay: linear-gradient(180deg, rgba(4, 16, 31, 0.15) 0%, rgba(4, 16, 31, 0.85) 100%);

  /* ---- Elevation / Shadow System ---- */
  --shadow-xs: 0 1px 2px rgba(10, 37, 64, 0.06);
  --shadow-sm: 0 2px 8px rgba(10, 37, 64, 0.07), 0 1px 2px rgba(10, 37, 64, 0.05);
  --shadow-md: 0 8px 24px rgba(10, 37, 64, 0.10), 0 2px 6px rgba(10, 37, 64, 0.06);
  --shadow-lg: 0 20px 48px rgba(10, 37, 64, 0.14), 0 6px 16px rgba(10, 37, 64, 0.08);
  --shadow-xl: 0 32px 72px rgba(10, 37, 64, 0.18);
  --shadow-glow-accent: 0 12px 32px rgba(29, 111, 224, 0.28);
  --shadow-glow-cta: 0 12px 28px rgba(255, 106, 57, 0.35);

  /* ---- Radius ---- */
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --radius-pill: 999px;

  /* ---- 8pt Spacing Scale ---- */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 40px;
  --space-8: 48px;
  --space-9: 64px;
  --space-10: 80px;
  --space-11: 96px;
  --space-12: 128px;

  /* ---- Typography ---- */
  --font-heading: "Manrope", "Segoe UI", sans-serif;
  --font-body: "Inter", "Segoe UI", sans-serif;

  --fs-xs: 0.8125rem;
  --fs-sm: 0.9375rem;
  --fs-base: 1rem;
  --fs-md: 1.125rem;
  --fs-lg: 1.25rem;
  --fs-xl: 1.5rem;
  --fs-2xl: 1.875rem;
  --fs-3xl: 2.375rem;
  --fs-4xl: 3rem;
  --fs-5xl: 3.75rem;

  --lh-tight: 1.15;
  --lh-snug: 1.35;
  --lh-normal: 1.6;
  --lh-relaxed: 1.75;

  /* ---- Motion ---- */
  --ease-standard: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out-back: cubic-bezier(0.16, 1, 0.3, 1);
  --duration-fast: 150ms;
  --duration-base: 260ms;
  --duration-slow: 480ms;

  /* ---- Layout ---- */
  --container-max: 1240px;
  --container-pad: clamp(20px, 5vw, 48px);
  --header-height: 84px;

  /* ---- Blur ---- */
  --blur-glass: blur(18px);
  --z-header: 100;
  --z-mobile-bar: 90;
  --z-modal: 200;
}

/* ==========================================================================
   Dark theme tokens — activated by [data-theme="dark"] on <html>
   ========================================================================== */
[data-theme="dark"] {
  --surface-bg: #071223;
  --surface-alt: #0b1a30;
  --surface-card: #0d2038;
  --surface-elevated: #102947;
  --text-primary: #f3f7fc;
  --text-secondary: #b7c4d6;
  --text-muted: #8ea0b8;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.38);
  --shadow-lg: 0 20px 48px rgba(0, 0, 0, 0.45);
  --shadow-xl: 0 32px 72px rgba(0, 0, 0, 0.55);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-height);
  overflow-x: hidden;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: var(--lh-normal);
  color: var(--text-primary);
  background-color: var(--surface-bg);
  min-height: 100vh;
  overflow-x: hidden;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color var(--duration-base) var(--ease-standard), color var(--duration-base) var(--ease-standard);
}

img,
picture,
video {
  display: block;
  max-width: 100%;
  height: auto;
}

img {
  color: transparent;
}

/* ---- İkon SVG'leri ----
   Tüm satır-ikonlarımız icon() yardımcı fonksiyonuyla üretilir ve her biri
   viewBox="0 0 24 24" kalıbını kullanır. Açık bir width/height/max-width
   verilmediğinde tarayıcılar SVG'yi öntanımlı 300px genişliğe kadar
   büyütebiliyor (bu, önceki sürümdeki "devasa ok/ikon" hatasının kaynağıydı).
   Bu yüzden tüm ikonlara burada sabit, öngörülebilir bir taban boyut veriyoruz;
   bileşenler gerektiğinde components.css içinde bunu geçersiz kılar. */
svg[viewBox="0 0 24 24"] {
  display: inline-block;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  vertical-align: middle;
}

a {
  color: inherit;
  text-decoration: none;
}

ul,
ol {
  list-style: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

input,
textarea,
select {
  font: inherit;
  color: inherit;
}

table {
  border-collapse: collapse;
}

/* ==========================================================================
   Typography scale
   ========================================================================== */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 800;
  line-height: var(--lh-tight);
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(2.25rem, 4.4vw, var(--fs-5xl)); }
h2 { font-size: clamp(1.75rem, 3.2vw, var(--fs-3xl)); }
h3 { font-size: clamp(1.25rem, 2vw, var(--fs-xl)); }
h4 { font-size: var(--fs-md); }

p {
  color: var(--text-secondary);
  line-height: var(--lh-relaxed);
}

strong { font-weight: 700; color: var(--text-primary); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: var(--fs-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand-accent);
  max-width: 100%;
  white-space: normal;
}

[data-theme="dark"] .eyebrow { color: var(--color-cyan-400); }

.lead {
  font-size: var(--fs-md);
  line-height: var(--lh-relaxed);
  color: var(--text-secondary);
}

/* Focus states — accessibility */
:focus-visible {
  outline: 3px solid var(--color-blue-500);
  outline-offset: 3px;
  border-radius: 4px;
}

a:focus-visible,
button:focus-visible {
  outline-offset: 4px;
}

::selection {
  background: var(--color-blue-500);
  color: #fff;
}

/* Skip link */
.skip-link {
  position: fixed;
  top: -60px;
  left: var(--space-4);
  background: var(--brand-primary);
  color: #fff;
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-sm);
  z-index: 999;
  transition: top var(--duration-base) var(--ease-standard);
}

.skip-link:focus {
  top: var(--space-4);
}
