/* ==========================================================================
   KAYAN LUXURY FASHION — BASE CSS & RESET
   ========================================================================== */

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: var(--color-bg);
  color: var(--color-text);
  transition: background-color var(--duration-medium) var(--ease-out-expo),
              color var(--duration-medium) var(--ease-out-expo);
}

body {
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-bg);
  overflow-x: hidden;
  position: relative;
}

/* RTL Typography adjust */
[dir="rtl"] body {
  font-family: var(--font-arabic), var(--font-sans);
}

[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3, [dir="rtl"] .font-display {
  font-family: var(--font-arabic), var(--font-display);
  letter-spacing: normal;
}

/* Selection */
::selection {
  background-color: var(--color-accent);
  color: #FFFFFF;
}

/* Focus Outline */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: var(--radius-xs);
}

:focus:not(:focus-visible) {
  outline: none;
}

/* Accessibility: Skip Link */
.skip-link {
  position: absolute;
  top: -100px;
  inset-inline-start: var(--space-md);
  z-index: 9999;
  background: var(--color-primary);
  color: var(--color-primary-contrast);
  padding: var(--space-xs) var(--space-md);
  font-weight: 600;
  border-radius: var(--radius-sm);
  transition: top var(--duration-fast) var(--ease-out-quart);
  text-decoration: none;
}

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

/* Visually Hidden Helper */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Links */
a {
  color: inherit;
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-smooth);
}

/* Typography elements */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--color-text);
  margin-bottom: var(--space-xs);
}

h1 { font-size: var(--text-3xl); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-lg); }
h5 { font-size: var(--text-md); }
h6 { font-size: var(--text-base); }

p {
  margin-bottom: var(--space-sm);
  color: var(--color-text-muted);
}

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

/* Images & Media */
img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

img {
  object-fit: cover;
}

/* Form Elements */
input, button, textarea, select {
  font: inherit;
  color: inherit;
  border: none;
  background: transparent;
}

button {
  cursor: pointer;
  user-select: none;
}

/* Scrollbar Customization */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--color-bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--color-border-strong);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-subtle);
}

/* Custom Grain Overlay for Editorial Feel */
.grain-overlay {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 998;
  opacity: 0.022;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}
