/**
 * Design Tokens
 * CSS Custom Properties for consistent design system
 */

:root {
  /* ========================================
   * Layout & Container
   * ======================================== */
  --container-max-width: 1200px;
  --container-padding: 20px;
  --container-padding-mobile: 16px;
  
  /* Grid & Layout */
  --grid-gap: 24px;
  --grid-gap-mobile: 16px;
  --section-padding: 80px;
  --section-padding-mobile: 48px;

  /* ========================================
   * Breakpoints (for media queries)
   * ======================================== */
  --bp-mobile: 390px;
  --bp-tablet: 768px;
  --bp-desktop: 1024px;
  --bp-large: 1440px;

  /* ========================================
   * Spacing Scale (8px base system)
   * ======================================== */
  --space-xs: 8px;      /* 0.5rem */
  --space-sm: 16px;     /* 1rem */
  --space-md: 24px;     /* 1.5rem */
  --space-lg: 32px;     /* 2rem */
  --space-xl: 48px;     /* 3rem */
  --space-xxl: 64px;    /* 4rem */
  --space-3xl: 96px;    /* 6rem */
  --space-4xl: 128px;   /* 8rem */

  /* ========================================
   * Typography Scale (1.25 ratio)
   * ======================================== */
  --font-family-primary: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-family-secondary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  
  /* Font Sizes - Mobile First with clamp() */
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);     /* 12-14px */
  --text-sm: clamp(0.875rem, 0.8rem + 0.375vw, 1rem);       /* 14-16px */
  --text-base: clamp(1rem, 0.9rem + 0.5vw, 1.125rem);       /* 16-18px */
  --text-lg: clamp(1.125rem, 1rem + 0.625vw, 1.25rem);      /* 18-20px */
  --text-xl: clamp(1.25rem, 1.1rem + 0.75vw, 1.5rem);       /* 20-24px */
  --text-2xl: clamp(1.5rem, 1.3rem + 1vw, 2rem);            /* 24-32px */
  --text-3xl: clamp(2rem, 1.7rem + 1.5vw, 3rem);            /* 32-48px */
  --text-4xl: clamp(2.5rem, 2rem + 2.5vw, 4rem);            /* 40-64px */
  
  /* Font Weights */
  --font-weight-light: 300;
  --font-weight-regular: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  
  /* Line Heights */
  --line-height-tight: 1.25;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.75;

  /* ========================================
   * Color Palette
   * ======================================== */
  
  /* Primary Colors */
  --color-primary: #0066ff;
  --color-primary-hover: #0052cc;
  --color-primary-light: rgba(0, 102, 255, 0.1);
  
  /* Secondary Colors */
  --color-secondary: #667eea;
  --color-secondary-hover: #5a67d8;
  
  /* Neutral Colors */
  --color-white: #ffffff;
  --color-gray-50: #f8f9fa;
  --color-gray-100: #f1f3f4;
  --color-gray-200: #e8eaed;
  --color-gray-300: #dadce0;
  --color-gray-400: #bdc1c6;
  --color-gray-500: #9aa0a6;
  --color-gray-600: #80868b;
  --color-gray-700: #5f6368;
  --color-gray-800: #3c4043;
  --color-gray-900: #202124;
  
  /* Semantic Colors */
  --color-text: var(--color-gray-900);
  --color-text-light: var(--color-gray-600);
  --color-text-muted: var(--color-gray-500);
  --color-bg: var(--color-white);
  --color-bg-light: var(--color-gray-50);
  --color-bg-dark: var(--color-gray-900);
  
  /* Status Colors */
  --color-success: #34a853;
  --color-warning: #fbbc04;
  --color-error: #ea4335;
  --color-info: var(--color-primary);

  /* ========================================
   * Border & Radius
   * ======================================== */
  --border-width: 1px;
  --border-color: var(--color-gray-200);
  --border-color-light: var(--color-gray-100);
  
  --radius-none: 0;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl: 24px;
  --radius-full: 9999px;

  /* ========================================
   * Shadows
   * ======================================== */
  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);

  /* ========================================
   * Z-Index Scale
   * ======================================== */
  --z-dropdown: 1000;
  --z-sticky: 1010;
  --z-fixed: 1020;
  --z-modal-backdrop: 1030;
  --z-modal: 1040;
  --z-popover: 1050;
  --z-tooltip: 1060;

  /* ========================================
   * Transitions & Animations
   * ======================================== */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 350ms ease;
  --transition-slower: 500ms ease;
  
  --ease-in: cubic-bezier(0.4, 0, 1, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);

  /* ========================================
   * Component Specific Tokens
   * ======================================== */
  
  /* Header */
  --header-height: 80px;
  --header-height-mobile: 64px;
  --header-bg: rgba(255, 255, 255, 0.95);
  --header-backdrop-filter: blur(10px);
  
  /* Buttons */
  --btn-padding-x: var(--space-lg);
  --btn-padding-y: var(--space-sm);
  --btn-height: 48px;
  --btn-radius: var(--radius-md);
  
  /* Cards */
  --card-padding: var(--space-xl);
  --card-radius: var(--radius-lg);
  --card-shadow: var(--shadow-md);
  --card-shadow-hover: var(--shadow-lg);
  
  /* Forms */
  --input-height: 48px;
  --input-padding-x: var(--space-md);
  --input-border-radius: var(--radius-md);
  --input-border-color: var(--color-gray-300);
  --input-border-color-focus: var(--color-primary);

  /* ========================================
   * About Section Tokens
   * ======================================== */
  --about-watermark-opacity-default: 0.08;
  --about-watermark-opacity-hover: 0.15;
  --about-card-scale-default: 1;
  --about-card-scale-hover: 0.95;
  --about-img-scale-default: 1;
  --about-img-scale-hover: 1.08;

  /* Button Scan Effect Tokens */
  --btn-scan-line-color: rgba(0, 102, 255, 0.25);
  --btn-scan-line-hover-color: rgba(0, 102, 255, 0.6);
  --btn-scan-bg: var(--color-gray-900);
  --btn-scan-bg-hover: var(--color-primary);

  /* Animation Timing */
  --timing-about-smooth: cubic-bezier(0.19, 1, 0.22, 1);
  --timing-about-duration: 900ms;
  --timing-watermark-duration: 1200ms;
  --timing-scan-duration: 500ms;
}

/* ========================================
 * Responsive Design Token Overrides
 * ======================================== */

@media (max-width: 768px) {
  :root {
    --container-padding: var(--container-padding-mobile);
    --grid-gap: var(--grid-gap-mobile);
    --section-padding: var(--section-padding-mobile);
    --header-height: var(--header-height-mobile);
    --card-padding: var(--space-md);
  }
}

/* ========================================
 * Dark Mode Support (Future Enhancement)
 * ======================================== */

/*
 * DISABLED: Automatic dark mode causes issues on Safari iOS
 * - Mobile menu links appear white/invisible on white background
 * - Header background turns black unexpectedly
 *
 * Re-enable when proper dark mode implementation is ready with:
 * - Explicit dark mode toggle (not automatic)
 * - Full color scheme implementation
 * - Proper testing on iOS Safari
 */

/*
@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: var(--color-gray-900);
    --color-text: var(--color-white);
    --color-text-light: var(--color-gray-300);
    --color-bg-light: var(--color-gray-800);
    --border-color: var(--color-gray-700);
    --header-bg: rgba(32, 33, 36, 0.95);
  }
}
*/

/* ========================================
 * Reduced Motion Support
 * ======================================== */

@media (prefers-reduced-motion: reduce) {
  :root {
    --transition-fast: 0ms;
    --transition-base: 0ms;
    --transition-slow: 0ms;
    --transition-slower: 0ms;
  }
}