/* =========================================
   VITAL WORKS — RIASEC診断
   Apple-inspired Design System
   ========================================= */

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

:root {
  --bg: #000000;
  --bg-secondary: #0a0a0a;
  --bg-card: #111111;
  --bg-card-hover: #1a1a1a;
  --border: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.18);
  --text-primary: #f5f5f7;
  --text-secondary: #a1a1a6;
  --text-tertiary: #6e6e73;
  --accent: #2997ff;
  --accent-glow: rgba(41, 151, 255, 0.15);
  --accent-hover: #4facff;
  --success: #30d158;

  /* Type colors */
  --r-color: #ff6b35;
  --i-color: #4facff;
  --a-color: #bf5af2;
  --s-color: #30d158;
  --e-color: #ff9f0a;
  --c-color: #5e5ce6;

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --transition: cubic-bezier(0.4, 0, 0.2, 1);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* =========================================
   PAGE TRANSITIONS
   ========================================= */

.page {
  display: none;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.5s var(--transition), transform 0.5s var(--transition);
}

.page.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

/* =========================================
   NAV
   ========================================= */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 40px;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
}

.nav-logo {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--text-primary);
  text-transform: uppercase;
}

/* =========================================
   HERO SECTION
   ========================================= */

.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 120px 24px 80px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -20%;
  left: 50%;
  transform: translateX(-50%);
  width: 900px;
  height: 900px;
  background: radial-gradient(ellipse, rgba(41, 151, 255, 0.08) 0%, transparent 60%);
  pointer-events: none;
}

.hero-eyebrow {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 24px;
  padding: 6px 16px;
  border: 1px solid rgba(41, 151, 255, 0.3);
  border-radius: 100px;
  display: inline-block;
}

.hero-title {
  font-size: clamp(42px, 7vw, 88px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin-bottom: 28px;
  background: linear-gradient(180deg, #ffffff 0%, #a1a1a6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: clamp(17px, 2.5vw, 21px);
  font-weight: 300;
  color: var(--text-secondary);
  line-height: 1.65;
  max-width: 640px;
  margin-bottom: 48px;
}

.hero-subtitle strong {
  color: var(--text-primary);
  font-weight: 500;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 16px 40px;
  background: var(--accent);
  color: #fff;
  font-family: var(--font);
  font-size: 17px;
  font-weight: 500;
  border: none;
  border-radius: 100px;
  cursor: pointer;
  transition: all 0.3s var(--transition);
  letter-spacing: -0.01em;
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: scale(1.02);
  box-shadow: 0 0 40px rgba(41, 151, 255, 0.4);
}

.btn-primary:active {
  transform: scale(0.98);
}

.hero-note {
  margin-top: 16px;
  font-size: 13px;
  color: var(--text-tertiary);
}

.br-desktop {
  display: none;
}

@media (min-width: 768px) {
  .br-desktop {
    display: block;
  }
}

/* =========================================
   FEATURES SECTION
   ========================================= */

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 2px;
  background: var(--border);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.feature-card {
  background: var(--bg);
  padding: 56px 40px;
  text-align: center;
  transition: background 0.3s var(--transition);
}

.feature-card:hover {
  background: var(--bg-card);
}

.feature-icon {
  font-size: 28px;
  margin-bottom: 20px;
  color: var(--accent);
}

.feature-card h3 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.feature-card p {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.65;
}

/* =========================================
   TYPES SECTION
   ========================================= */

.types-section {
  padding: 120px 24px;
  text-align: center;
}

.section-title {
  font-size: clamp(28px, 5vw, 48px);
  font-weight: 700;
  letter-spacing: -0.025em;
  margin-bottom: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #a1a1a6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section-sub {
  font-size: 17px;
  color: var(--text-secondary);
  margin-bottom: 64px;
}

.types-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  max-width: 800px;
  margin: 0 auto;
}

.type-chip {
  padding: 20px 32px;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.4;
  text-align: center;
  transition: transform 0.3s var(--transition), box-shadow 0.3s var(--transition);
  cursor: default;
  border: 1px solid;
}

.type-chip:hover {
  transform: translateY(-4px);
}

.type-chip span {
  display: block;
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 4px;
}

.type-chip small {
  font-size: 12px;
  opacity: 0.75;
}

.type-chip.realistic { background: rgba(255, 107, 53, 0.08); border-color: rgba(255, 107, 53, 0.25); color: var(--r-color); }
.type-chip.realistic:hover { box-shadow: 0 12px 40px rgba(255, 107, 53, 0.2); }

.type-chip.investigative { background: rgba(79, 172, 255, 0.08); border-color: rgba(79, 172, 255, 0.25); color: var(--i-color); }
.type-chip.investigative:hover { box-shadow: 0 12px 40px rgba(79, 172, 255, 0.2); }

.type-chip.artistic { background: rgba(191, 90, 242, 0.08); border-color: rgba(191, 90, 242, 0.25); color: var(--a-color); }
.type-chip.artistic:hover { box-shadow: 0 12px 40px rgba(191, 90, 242, 0.2); }

.type-chip.social { background: rgba(48, 209, 88, 0.08); border-color: rgba(48, 209, 88, 0.25); color: var(--s-color); }
.type-chip.social:hover { box-shadow: 0 12px 40px rgba(48, 209, 88, 0.2); }

.type-chip.enterprising { background: rgba(255, 159, 10, 0.08); border-color: rgba(255, 159, 10, 0.25); color: var(--e-color); }
.type-chip.enterprising:hover { box-shadow: 0 12px 40px rgba(255, 159, 10, 0.2); }

.type-chip.conventional { background: rgba(94, 92, 230, 0.08); border-color: rgba(94, 92, 230, 0.25); color: var(--c-color); }
.type-chip.conventional:hover { box-shadow: 0 12px 40px rgba(94, 92, 230, 0.2); }

/* =========================================
   CTA SECTION
   ========================================= */

.cta-section {
  padding: 120px 24px;
  text-align: center;
  background: linear-gradient(180deg, transparent 0%, rgba(41, 151, 255, 0.04) 50%, transparent 100%);
}

.cta-section h2 {
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.15;
  margin-bottom: 24px;
  background: linear-gradient(180deg, #ffffff 0%, #a1a1a6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.cta-section p {
  font-size: 19px;
  color: var(--text-secondary);
  margin-bottom: 40px;
}

/* =========================================
   FOOTER
   ========================================= */

.footer {
  padding: 32px 24px;
  text-align: center;
  border-top: 1px solid var(--border);
}

.footer p {
  font-size: 13px;
  color: var(--text-tertiary);
  letter-spacing: 0.02em;
}

/* =========================================
   QUIZ PAGE
   ========================================= */

#quiz {
  min-height: 100vh;
  background: var(--bg);
}

.quiz-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 16px 24px;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
}

.home-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 50%;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.2s var(--transition);
}

.home-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  color: var(--text-primary);
  transform: scale(1.05);
}

.quiz-logo {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--text-tertiary);
  text-transform: uppercase;
  text-align: center;
}

.progress-info {
  text-align: right;
  font-size: 13px;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.progress-bar-wrap {
  position: fixed;
  top: 73px;
  left: 0;
  right: 0;
  z-index: 99;
}

.progress-bar-track {
  width: 100%;
  height: 2px;
  background: var(--border);
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-hover) 100%);
  transition: width 0.4s var(--transition);
  border-radius: 0 2px 2px 0;
}

.quiz-body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 120px 24px 60px;
  max-width: 680px;
  margin: 0 auto;
}

.question-area {
  width: 100%;
  text-align: center;
  margin-bottom: 56px;
}

.question-category {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 20px;
  min-height: 18px;
}

.question-text {
  font-size: clamp(24px, 4vw, 38px);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.question-prompt {
  font-size: 15px;
  color: var(--text-tertiary);
}

/* =========================================
   ANSWER BUTTONS
   ========================================= */

.answers-grid {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.answer-btn {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 18px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s var(--transition);
  text-align: left;
  font-family: var(--font);
  color: var(--text-primary);
  -webkit-tap-highlight-color: transparent;
}

.answer-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  transform: translateX(4px);
}

.answer-btn:active {
  transform: scale(0.99) translateX(4px);
}

.answer-btn.selected {
  background: rgba(41, 151, 255, 0.1);
  border-color: var(--accent);
  transform: translateX(8px);
}

.answer-circle {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all 0.2s var(--transition);
}

.answer-btn:hover .answer-circle {
  border-color: var(--accent);
  color: var(--accent);
}

.answer-btn.selected .answer-circle {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.answer-label {
  font-size: 16px;
  font-weight: 400;
  color: var(--text-secondary);
  transition: color 0.2s var(--transition);
}

.answer-btn:hover .answer-label,
.answer-btn.selected .answer-label {
  color: var(--text-primary);
}

/* =========================================
   RESULT PAGE
   ========================================= */

#result {
  padding-top: 80px;
}

.nav-result {
  position: fixed;
}

.result-hero {
  text-align: center;
  padding: 120px 24px 80px;
  position: relative;
  overflow: hidden;
}

.result-hero::before {
  content: '';
  position: absolute;
  top: -20%;
  left: 50%;
  transform: translateX(-50%);
  width: 700px;
  height: 700px;
  background: radial-gradient(ellipse, rgba(41, 151, 255, 0.06) 0%, transparent 60%);
  pointer-events: none;
}

.result-eyebrow {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--success);
  margin-bottom: 24px;
  padding: 6px 16px;
  border: 1px solid rgba(48, 209, 88, 0.3);
  border-radius: 100px;
  display: inline-block;
}

.result-title {
  font-size: clamp(36px, 6vw, 72px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin-bottom: 20px;
  background: linear-gradient(180deg, #ffffff 0%, #a1a1a6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.result-subtitle {
  font-size: 19px;
  color: var(--text-secondary);
}

/* Top type card */
.result-top-type {
  max-width: 800px;
  margin: 0 auto 80px;
  padding: 0 24px;
}

.top-type-card {
  border-radius: var(--radius-xl);
  padding: 56px 48px;
  text-align: center;
  border: 1px solid;
  position: relative;
  overflow: hidden;
}

.top-type-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: 50%;
  transform: translateX(-50%);
  width: 400px;
  height: 400px;
  border-radius: 50%;
  opacity: 0.08;
  filter: blur(60px);
}

.top-type-letter {
  font-size: 96px;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 12px;
  display: block;
}

.top-type-name {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
}

.top-type-japanese {
  font-size: 16px;
  opacity: 0.7;
  margin-bottom: 24px;
}

.top-type-desc {
  font-size: 17px;
  line-height: 1.7;
  opacity: 0.85;
  max-width: 540px;
  margin: 0 auto;
}

/* Chart */
.result-chart-section {
  padding: 80px 24px;
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}

.chart-container {
  margin-top: 48px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.chart-row {
  display: grid;
  grid-template-columns: 140px 1fr 48px;
  align-items: center;
  gap: 16px;
}

.chart-label {
  text-align: right;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
}

.chart-label span {
  display: block;
  font-size: 11px;
  color: var(--text-tertiary);
}

.chart-bar-track {
  height: 10px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 100px;
  overflow: hidden;
}

.chart-bar-fill {
  height: 100%;
  border-radius: 100px;
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.chart-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

/* Result description */
.result-description {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 24px 80px;
}

.desc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.desc-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
}

.desc-card h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-tertiary);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.desc-card p {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* Careers */
.result-careers {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 24px 80px;
}

.careers-section h2 {
  font-size: clamp(24px, 4vw, 36px);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 32px;
  background: linear-gradient(180deg, #ffffff 0%, #a1a1a6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.careers-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.career-tag {
  padding: 8px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 14px;
  color: var(--text-secondary);
  transition: all 0.2s var(--transition);
}

.career-tag:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
  background: var(--bg-card-hover);
}

.result-actions {
  text-align: center;
  padding: 0 24px 80px;
}

/* =========================================
   ANIMATIONS
   ========================================= */

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

.animate-in {
  animation: fadeUp 0.5s var(--transition) forwards;
}

/* Stagger for answer buttons */
.answer-btn:nth-child(1) { animation-delay: 0.05s; }
.answer-btn:nth-child(2) { animation-delay: 0.10s; }
.answer-btn:nth-child(3) { animation-delay: 0.15s; }
.answer-btn:nth-child(4) { animation-delay: 0.20s; }
.answer-btn:nth-child(5) { animation-delay: 0.25s; }

/* =========================================
   RESPONSIVE
   ========================================= */

@media (max-width: 600px) {
  .hero {
    padding: 100px 20px 60px;
  }

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

  .quiz-body {
    padding: 100px 16px 40px;
  }

  .answer-btn {
    padding: 16px 18px;
    gap: 14px;
  }

  .answer-label {
    font-size: 15px;
  }

  .top-type-card {
    padding: 40px 28px;
  }

  .chart-row {
    grid-template-columns: 100px 1fr 40px;
  }

  .result-hero {
    padding: 100px 20px 60px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
