/* ── Custom shadow variables ── */
:root {
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.04);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.06), 0 2px 4px -2px rgb(0 0 0 / 0.06);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.08), 0 4px 6px -4px rgb(0 0 0 / 0.04);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.08), 0 8px 10px -6px rgb(0 0 0 / 0.04);
  --shadow-glass: 0 8px 32px rgb(21 71 201 / 0.10);

  --color-background: #F8FAFC;
  --color-foreground: #0F172A;
  --color-surface: #FFFFFF;
  --color-primary: #1547c9;
  --color-primary-light: #2f6df6;
  --color-primary-dark: #0f2f7d;
  --color-accent: #2f6df6;
  --color-accent-light: #dbe7ff;
  --color-muted: #94A3B8;
  --color-muted-light: #CBD5E1;
  --color-border: #E2E8F0;
  --color-danger: #EF4444;
  --color-success: #10B981;
}

/* ── Keyframes ── */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(24px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

/* ── Utility animation classes ── */
.animate-fade-in-up {
  animation: fadeInUp 0.5s ease-out both;
  animation-delay: var(--stagger, 0ms);
}

.animate-fade-in {
  animation: fadeIn 0.4s ease-out both;
  animation-delay: var(--stagger, 0ms);
}

.animate-slide-in-right {
  animation: slideInRight 0.5s ease-out both;
  animation-delay: var(--stagger, 0ms);
}

.animate-shimmer {
  background: linear-gradient(
    90deg,
    var(--color-border) 25%,
    var(--color-muted-light) 50%,
    var(--color-border) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
}

/* ── Grain texture overlay ── */
body {
  position: relative;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0.018;
  pointer-events: none;
  z-index: 9999;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 128px 128px;
}

/* ── Custom scrollbar ── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--color-muted-light);
  border-radius: 3px;
}

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

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--color-muted-light) transparent;
}

/* ── Selection color ── */
::selection {
  background-color: rgb(13 148 136 / 0.2);
  color: var(--color-primary-dark);
}

::-moz-selection {
  background-color: rgb(13 148 136 / 0.2);
  color: var(--color-primary-dark);
}

/* ── Base styles ── */
html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  background-color: var(--color-background);
  color: var(--color-foreground);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* ── Focus visible ring ── */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: 4px;
}
