/**
 * ============================================
 * DESIGN SYSTEM - 株式会社オテアゲ
 * Swiss Modern & Bento Style
 * ============================================
 */

/* ============================================
   1. CSS CUSTOM PROPERTIES (TOKENS)
   ============================================ */

:root {
  /* ----------------------------------------
     Colors - Monochrome Base
     ---------------------------------------- */
  --color-bg: #F5F7FA;
  --color-bg-alt: #EEF1F5;
  --color-bg-dark: #0A0A0A;
  --color-bg-darker: #050505;

  --color-text: #0A0A0A;
  --color-text-muted: #525C68; /* WCAG AA準拠: コントラスト比 5.5:1 */
  --color-text-light: #6B7280; /* WCAG AA準拠: コントラスト比 5.4:1 */
  --color-text-inverse: #FAFAFA;

  /* ----------------------------------------
     Colors - Accent (淡いブルー + セカンダリ)
     ---------------------------------------- */
  --color-accent: #60A5FA;
  --color-accent-hover: #3B82F6;
  --color-accent-light: #DBEAFE;
  --color-accent-dark: #2563EB;

  /* Secondary Accent (洗練されたパープル) */
  --color-accent-secondary: #A78BFA;
  --color-accent-secondary-light: #EDE9FE;

  /* Gradient Accents */
  --gradient-accent: linear-gradient(135deg, #60A5FA 0%, #A78BFA 100%);
  --gradient-accent-subtle: linear-gradient(135deg, rgba(96, 165, 250, 0.1) 0%, rgba(167, 139, 250, 0.1) 100%);

  /* ----------------------------------------
     Colors - Border & Divider
     ---------------------------------------- */
  --color-border: #E5E7EB;
  --color-border-light: #F3F4F6;
  --color-border-dark: #374151;

  /* ----------------------------------------
     Colors - Semantic
     ---------------------------------------- */
  --color-success: #10B981;
  --color-warning: #F59E0B;
  --color-error: #EF4444;

  /* ----------------------------------------
     Typography - Font Family
     ---------------------------------------- */
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", monospace;

  /* ----------------------------------------
     Typography - Font Size (Swiss Scale)
     ---------------------------------------- */
  --text-xs: 0.75rem;      /* 12px */
  --text-sm: 0.875rem;     /* 14px */
  --text-base: 1rem;       /* 16px */
  --text-lg: 1.125rem;     /* 18px */
  --text-xl: 1.25rem;      /* 20px */
  --text-2xl: 1.5rem;      /* 24px */
  --text-3xl: 2rem;        /* 32px */
  --text-4xl: 2.5rem;      /* 40px */
  --text-5xl: 3rem;        /* 48px */
  --text-6xl: 3.75rem;     /* 60px */
  --text-7xl: 4.5rem;      /* 72px */
  --text-hero: clamp(2.5rem, 8vw, 5rem);

  /* ----------------------------------------
     Typography - Font Weight
     ---------------------------------------- */
  --font-light: 300;
  --font-normal: 400;
  --font-medium: 500;
  --font-semibold: 600;
  --font-bold: 700;
  --font-extrabold: 800;

  /* ----------------------------------------
     Typography - Line Height
     ---------------------------------------- */
  --leading-none: 1;
  --leading-tight: 1.15;
  --leading-snug: 1.375;
  --leading-normal: 1.5;
  --leading-relaxed: 1.7;
  --leading-loose: 2;

  /* ----------------------------------------
     Typography - Letter Spacing
     ---------------------------------------- */
  --tracking-tighter: -0.05em;
  --tracking-tight: -0.025em;
  --tracking-normal: 0;
  --tracking-wide: 0.025em;
  --tracking-wider: 0.05em;
  --tracking-widest: 0.1em;

  /* ----------------------------------------
     Spacing System (4px base)
     ---------------------------------------- */
  --space-0: 0;
  --space-1: 0.25rem;    /* 4px */
  --space-2: 0.5rem;     /* 8px */
  --space-3: 0.75rem;    /* 12px */
  --space-4: 1rem;       /* 16px */
  --space-5: 1.25rem;    /* 20px */
  --space-6: 1.5rem;     /* 24px */
  --space-8: 2rem;       /* 32px */
  --space-10: 2.5rem;    /* 40px */
  --space-12: 3rem;      /* 48px */
  --space-16: 4rem;      /* 64px */
  --space-20: 5rem;      /* 80px */
  --space-24: 6rem;      /* 96px */
  --space-32: 8rem;      /* 128px */
  --space-40: 10rem;     /* 160px */
  --space-48: 12rem;     /* 192px */

  /* ----------------------------------------
     Layout
     ---------------------------------------- */
  --container-max: 1200px;
  --container-lg: 1024px;
  --container-md: 768px;
  --container-sm: 640px;
  --container-padding: var(--space-6);

  /* ----------------------------------------
     Border Radius
     ---------------------------------------- */
  --radius-none: 0;
  --radius-sm: 0.25rem;    /* 4px */
  --radius-md: 0.5rem;     /* 8px */
  --radius-lg: 0.75rem;    /* 12px */
  --radius-xl: 1rem;       /* 16px */
  --radius-2xl: 1.5rem;    /* 24px */
  --radius-3xl: 2rem;      /* 32px */
  --radius-full: 9999px;

  /* ----------------------------------------
     Shadows (Minimal Swiss Style)
     ---------------------------------------- */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 16px 32px rgba(0, 0, 0, 0.12);
  --shadow-2xl: 0 24px 48px rgba(0, 0, 0, 0.15);
  --shadow-inner: inset 0 2px 4px rgba(0, 0, 0, 0.05);

  /* Accent Shadow */
  --shadow-accent: 0 4px 14px rgba(96, 165, 250, 0.25);
  --shadow-accent-lg: 0 8px 24px rgba(96, 165, 250, 0.3);

  /* ----------------------------------------
     Transitions
     ---------------------------------------- */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 350ms ease;
  --transition-slower: 500ms ease;

  /* Easing */
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
  --ease-in: cubic-bezier(0.4, 0, 1, 1);
  --ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
  --ease-spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);

  /* ----------------------------------------
     Z-Index Scale
     ---------------------------------------- */
  --z-behind: -1;
  --z-base: 0;
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-fixed: 300;
  --z-modal-backdrop: 400;
  --z-modal: 500;
  --z-popover: 600;
  --z-tooltip: 700;
  --z-max: 9999;

  /* ----------------------------------------
     Section Spacing
     ---------------------------------------- */
  --section-gap: var(--space-32);
  --section-gap-sm: var(--space-20);
}

/* ============================================
   2. RESPONSIVE TOKENS
   ============================================ */

@media (max-width: 1024px) {
  :root {
    --section-gap: var(--space-24);
    --section-gap-sm: var(--space-16);
    --container-padding: var(--space-5);
  }
}

@media (max-width: 768px) {
  :root {
    --section-gap: var(--space-20);
    --section-gap-sm: var(--space-12);
    --container-padding: var(--space-4);
    --text-hero: clamp(2rem, 10vw, 3rem);
  }
}

@media (max-width: 480px) {
  :root {
    --section-gap: var(--space-16);
    --section-gap-sm: var(--space-10);
  }
}

/* ============================================
   3. UTILITY CLASSES
   ============================================ */

/* Container */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--container-padding);
  padding-right: var(--container-padding);
}

.container--lg { max-width: var(--container-lg); }
.container--md { max-width: var(--container-md); }
.container--sm { max-width: var(--container-sm); }
.container--full { max-width: 100%; }

/* Section */
.section {
  padding-top: var(--section-gap);
  padding-bottom: var(--section-gap);
}

.section--sm {
  padding-top: var(--section-gap-sm);
  padding-bottom: var(--section-gap-sm);
}

.section--dark {
  background-color: var(--color-bg-dark);
  color: var(--color-text-inverse);
}

.section--alt {
  background-color: var(--color-bg-alt);
}

/* Text Colors */
.text-primary { color: var(--color-text); }
.text-muted { color: var(--color-text-muted); }
.text-light { color: var(--color-text-light); }
.text-inverse { color: var(--color-text-inverse); }
.text-accent { color: var(--color-accent); }

/* Text Alignment */
.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }

/* Font Sizes */
.text-xs { font-size: var(--text-xs); }
.text-sm { font-size: var(--text-sm); }
.text-base { font-size: var(--text-base); }
.text-lg { font-size: var(--text-lg); }
.text-xl { font-size: var(--text-xl); }
.text-2xl { font-size: var(--text-2xl); }
.text-3xl { font-size: var(--text-3xl); }
.text-4xl { font-size: var(--text-4xl); }
.text-5xl { font-size: var(--text-5xl); }

/* Font Weights */
.font-light { font-weight: var(--font-light); }
.font-normal { font-weight: var(--font-normal); }
.font-medium { font-weight: var(--font-medium); }
.font-semibold { font-weight: var(--font-semibold); }
.font-bold { font-weight: var(--font-bold); }

/* Spacing Utilities */
.mt-auto { margin-top: auto; }
.mb-auto { margin-bottom: auto; }
.mx-auto { margin-left: auto; margin-right: auto; }

/* Display */
.hidden { display: none; }
.block { display: block; }
.inline-block { display: inline-block; }
.flex { display: flex; }
.grid { display: grid; }

/* Flex Utilities */
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

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

/* ============================================
   4. ANIMATION KEYFRAMES
   ============================================ */

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

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

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

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

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

/* ============================================
   5. ANIMATION UTILITIES
   ============================================ */

.animate-fade-in {
  animation: fadeIn var(--transition-slow) var(--ease-out) forwards;
}

.animate-fade-in-up {
  animation: fadeInUp var(--transition-slow) var(--ease-out) forwards;
}

.animate-fade-in-down {
  animation: fadeInDown var(--transition-slow) var(--ease-out) forwards;
}

.animate-scale-in {
  animation: scaleIn var(--transition-slow) var(--ease-out) forwards;
}

.animate-slide-in-left {
  animation: slideInLeft var(--transition-slow) var(--ease-out) forwards;
}

.animate-slide-in-right {
  animation: slideInRight var(--transition-slow) var(--ease-out) forwards;
}

/* Scroll Animation (Initial State) */
[data-animate] {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity var(--transition-slow) var(--ease-out),
              transform var(--transition-slow) var(--ease-out);
}

[data-animate].is-visible {
  opacity: 1;
  transform: translateY(0);
}

[data-animate="fade"] {
  transform: none;
}

[data-animate="scale"] {
  transform: scale(0.95);
}

[data-animate="scale"].is-visible {
  transform: scale(1);
}

[data-animate="slide-left"] {
  transform: translateX(-30px);
}

[data-animate="slide-left"].is-visible {
  transform: translateX(0);
}

[data-animate="slide-right"] {
  transform: translateX(30px);
}

[data-animate="slide-right"].is-visible {
  transform: translateX(0);
}

/* Stagger Animation Delays */
[data-animate-delay="1"] { transition-delay: 100ms; }
[data-animate-delay="2"] { transition-delay: 200ms; }
[data-animate-delay="3"] { transition-delay: 300ms; }
[data-animate-delay="4"] { transition-delay: 400ms; }
[data-animate-delay="5"] { transition-delay: 500ms; }

/* ============================================
   6. HOVER EFFECTS
   ============================================ */

/* hover-lift - components.cssで定義 */

.hover-scale {
  transition: transform var(--transition-base) var(--ease-out);
}

.hover-scale:hover {
  transform: scale(1.02);
}

.hover-brightness {
  transition: filter var(--transition-base) var(--ease-out);
}

.hover-brightness:hover {
  filter: brightness(1.05);
}

/* ============================================
   7. GRADIENT & COLOR ENHANCEMENTS
   ============================================ */

/* Gradient Text */
.text-gradient {
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Animated gradient text */
.text-gradient-animate {
  background: linear-gradient(135deg, #60A5FA 0%, #A78BFA 50%, #60A5FA 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {
  0% { background-position: 0% center; }
  50% { background-position: 100% center; }
  100% { background-position: 0% center; }
}

/* Subtle gradient backgrounds */
.bg-gradient-subtle {
  background: var(--gradient-accent-subtle);
}

/* Glow effects */
.glow-accent {
  box-shadow: 0 0 20px rgba(96, 165, 250, 0.3);
}

.glow-secondary {
  box-shadow: 0 0 20px rgba(167, 139, 250, 0.3);
}

/* Hover glow enhancement */
.hover-glow:hover {
  box-shadow: 0 8px 30px rgba(96, 165, 250, 0.15),
              0 0 20px rgba(167, 139, 250, 0.1);
}

/* Accent border gradient */
.border-gradient {
  border: 2px solid transparent;
  background: linear-gradient(var(--color-bg), var(--color-bg)) padding-box,
              var(--gradient-accent) border-box;
}

/* Shine effect on hover */
.hover-shine {
  position: relative;
  overflow: hidden;
}

.hover-shine::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.1),
    transparent
  );
  transition: left 0.5s ease;
  pointer-events: none;
}

.hover-shine:hover::before {
  left: 100%;
}
