/* ==========================================================================
   Base & Semantic Reset
   CSS Nesting ile modern semantik HTML stilleri
   ========================================================================== */

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

html {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  tab-size: 4;
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-page);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: clip;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

/* Semantik Metin & Başlıklar */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;

  &:is(h1) { font-size: clamp(2rem, 4vw + 1rem, 3.25rem); }
  &:is(h2) { font-size: clamp(1.5rem, 2.5vw + 0.75rem, 2.25rem); }
  &:is(h3) { font-size: clamp(1.25rem, 1.5vw + 0.5rem, 1.65rem); }
  &:is(h4) { font-size: 1.25rem; }
}

p {
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: 0.75rem;

  &:last-child {
    margin-bottom: 0;
  }
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition-fast);

  &:hover {
    color: var(--primary-hover);
  }
}

/* Görseller: loading="lazy", decoding="async" ve aspect-ratio desteği */
img, picture, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

picture {
  width: 100%;
  height: 100%;

  & > img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
}

/* Semantik Form Elemanları */
button, input, select, textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

ul, ol {
  list-style: none;
}

/* Dialog & Modal Yerleşik Tarayıcı Desteği */
dialog {
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-xl);
  background-color: var(--bg-surface);
  color: var(--text-primary);
  box-shadow: var(--shadow-xl);
  padding: 2rem;
  max-width: min(90vw, 480px);
  margin: auto;

  &::backdrop {
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
  }
}
