/* =========================================
   FELO — Design System
   style.css — Tokens & Global Styles
   ========================================= */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@300;400;500;600;700;900&family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* ── Design Tokens ─────────────────────── */
:root {
  /* Colors */
  --primary: #2D8CFF;
  --primary-dark: #1A6FD4;
  --primary-light: #6AAFFF;
  --secondary: #0A1128;
  --secondary-soft: #111827;
  --accent: #FF6B2D;
  --accent-dark: #E05518;
  --danger: #EF4444;

  --white: #FFFFFF;
  --off-white: #F7F9FC;
  --gray-50: #F8FAFC;
  --gray-100: #F1F5F9;
  --gray-200: #E2E8F0;
  --gray-400: #94A3B8;
  --gray-500: #64748B;
  --gray-600: #475569;
  --gray-800: #1E293B;

  /* Glassmorphism */
  --glass-bg: rgba(255, 255, 255, 0.10);
  --glass-bg-heavy: rgba(255, 255, 255, 0.18);
  --glass-border: rgba(255, 255, 255, 0.20);
  --glass-blur: 16px;
  --glass-blur-sm: 8px;

  /* Shadow */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.12);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.16);
  --shadow-blue: 0 8px 32px rgba(45, 140, 255, 0.30);

  /* Typography */
  --font-jp: 'Noto Sans JP', YuGothic, 'Yu Gothic', sans-serif;
  --font-global: 'Inter', 'Helvetica Neue', sans-serif;

  /* ── Font Size Scale (3 levels only) ── */
  /* Large  : page/section titles, hero headlines, h1/h2 */
  --fs-lg: clamp(1.6rem, 3.5vw, 2.5rem);
  /* Medium : sub-headings, card titles, body copy, h3/h4 */
  --fs-md: 1rem;
  /* Small  : labels, captions, meta, badges, nav links */
  --fs-sm: 0.82rem;

  /* Border Radius */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 32px;
  --radius-pill: 100px;

  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 0.75rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 5rem;

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition: 0.25s ease;
  --transition-slow: 0.4s ease;

  /* Z-index scale */
  --z-base: 1;
  --z-sticky: 100;
  --z-sidebar: 200;
  --z-modal: 300;
  --z-toast: 400;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-jp);
  font-weight: 400;
  color: var(--secondary);
  background: var(--white);
  line-height: 1.7;
  overflow-x: hidden;
}

img,
video {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

ul,
ol {
  list-style: none;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}

input,
textarea,
select {
  font-family: inherit;
  outline: none;
}

/* ── Typography Scale (3 sizes only) ───── */
/* Large: hero, h1, h2, section titles */
.text-hero,
.text-display,
.text-h2 {
  font-size: var(--fs-lg);
  line-height: 1.25;
}
.text-hero  { font-weight: 900; letter-spacing: -0.02em; }
.text-display { font-weight: 800; letter-spacing: -0.01em; }
.text-h2    { font-weight: 700; }

/* Medium: h3, h4, body copy, card titles */
.text-h3,
.text-body {
  font-size: var(--fs-md);
  line-height: 1.7;
}
.text-h3 { font-weight: 600; line-height: 1.4; }
.text-body { font-weight: 400; }

/* Small: labels, captions, meta, badges */
.text-small,
.text-xs {
  font-size: var(--fs-sm);
}

/* ── Layout Utilities ───────────────────── */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-xl);
}

.container-wide {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--space-xl);
}

.section {
  padding: var(--space-3xl) 0;
}

.section-sm {
  padding: var(--space-2xl) 0;
}

.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.items-center {
  align-items: center;
}

.justify-center {
  justify-content: center;
}

.justify-between {
  justify-content: space-between;
}

.gap-sm {
  gap: var(--space-sm);
}

.gap-md {
  gap: var(--space-md);
}

.gap-lg {
  gap: var(--space-lg);
}

.gap-xl {
  gap: var(--space-xl);
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-xl);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-xl);
}

.text-center {
  text-align: center;
}

.text-left {
  text-align: left;
}

/* ── Color Utilities ────────────────────── */
.text-primary {
  color: var(--primary);
}

.text-secondary {
  color: var(--secondary);
}

.text-white {
  color: var(--white);
}

.text-muted {
  color: var(--gray-600);
}

.bg-primary {
  background: var(--primary);
}

.bg-secondary {
  background: var(--secondary);
}

.bg-off-white {
  background: var(--off-white);
}

.bg-white {
  background: var(--white);
}

/* ── Buttons ────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 0.85rem 2rem;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: var(--fs-md);
  transition: all var(--transition);
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary);
  color: var(--white);
  box-shadow: var(--shadow-blue);
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(45, 140, 255, 0.40);
}

.btn-outline {
  background: transparent;
  color: var(--secondary);
  border: 2px solid var(--gray-200);
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-2px);
}

.btn-outline-white {
  background: transparent;
  color: var(--white);
  border: 2px solid rgba(255, 255, 255, 0.5);
}

.btn-outline-white:hover {
  border-color: var(--white);
  background: rgba(255, 255, 255, 0.1);
}

.btn-dark {
  background: var(--secondary);
  color: var(--white);
}

.btn-dark:hover {
  background: var(--gray-800);
  transform: translateY(-2px);
}

.btn-accent {
  background: var(--accent);
  color: var(--white);
  box-shadow: 0 8px 24px rgba(255, 107, 45, 0.30);
}

.btn-accent:hover {
  background: var(--accent-dark);
  transform: translateY(-2px);
}

/* ── Section Headers ────────────────────── */
.section-label {
  display: inline-block;
  font-size: var(--fs-sm);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: var(--space-md);
  background: transparent !important;
  padding: 0 !important;
}

.section-title {
  font-size: var(--fs-lg);
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: var(--space-md);
}

.section-subtitle {
  font-size: var(--fs-md);
  color: var(--gray-600);
  line-height: 1.7;
  max-width: 640px;
}

/* ── Divider ────────────────────────────── */
.divider {
  width: 48px;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  border-radius: 2px;
  margin: var(--space-md) auto;
}

.divider-left {
  margin: var(--space-md) 0;
}

/* ── Badge ──────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: var(--fs-sm);
  font-weight: 600;
  background: transparent !important;
  padding: 0 !important;
}

.badge-blue {
  color: var(--primary);
}

.badge-green {
  color: #059669;
}

.required-badge {
  font-size: var(--fs-sm);
  font-weight: 700;
  color: white;
  background: var(--accent);
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  margin-left: 4px;
}

.optional-badge {
  font-size: var(--fs-sm);
  color: var(--gray-400);
  margin-left: 4px;
}

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

::-webkit-scrollbar-track {
  background: var(--gray-100);
}

::-webkit-scrollbar-thumb {
  background: var(--gray-200);
  border-radius: 3px;
}

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

/* ── Responsive ─────────────────────────── */
@media (max-width: 1024px) {
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid-2 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  :root {
    --fs-lg: clamp(1.35rem, 6vw, 1.9rem);
    --fs-md: 0.95rem;
    --fs-sm: 0.78rem;
  }

  .container {
    padding: 0 var(--space-lg);
  }

  .grid-3 {
    grid-template-columns: 1fr;
  }

  .section {
    padding: var(--space-2xl) 0;
  }

  .btn {
    padding: 0.75rem 1.5rem;
  }
}

@media (max-width: 480px) {
  :root {
    --fs-lg: clamp(1.25rem, 7vw, 1.7rem);
    --fs-md: 0.9rem;
    --fs-sm: 0.75rem;
  }

  .container {
    padding: 0 var(--space-md);
  }
}

/* ── Mobile-first touch improvements ───── */
@media (hover: none) and (pointer: coarse) {
  /* iOS/Android: larger tap targets */
  .btn { min-height: 44px; }
  .nav-link { min-height: 44px; display: flex; align-items: center; }
  .lang-btn { min-height: 36px; min-width: 36px; }
  .filter-chip { min-height: 36px; }
}

/* ── Safe area insets (iPhone notch/home bar) */
@supports (padding: env(safe-area-inset-bottom)) {
  #footer {
    padding-bottom: calc(var(--space-xl) + env(safe-area-inset-bottom));
  }
  #navbar {
    padding-top: env(safe-area-inset-top);
  }
}