/* ============================================
   Factoring Hub - Vault Precision Design
   ============================================ */

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

:root {
  /* Color Palette - Vault Precision */
  --navy-900: #060e1a;
  --navy-800: #0a1628;
  --navy-700: #0f2038;
  --navy-600: #1a3050;
  --navy-500: #1e3a5f;
  --slate: #2a4a6e;
  --gold-500: #c9a84c;
  --gold-400: #d4b96a;
  --gold-300: #e0ca88;
  --gold-200: #f0e0b8;
  --gold-100: #f8f0d8;
  --text-primary: #e8ecf2;
  --text-secondary: #9aabb8;
  --text-muted: #6a7f90;
  --bg-dark: #060e1a;
  --bg-card: #0f1e30;
  --bg-card-hover: #162840;
  --border-subtle: rgba(201,168,76,0.15);
  --border-gold: rgba(201,168,76,0.4);
  --shadow-gold: 0 0 20px rgba(201,168,76,0.08);
  --transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: all 0.2s ease;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Noto Sans JP', 'Outfit', sans-serif;
  font-size: 16px;
  line-height: 1.8;
  color: var(--text-primary);
  background-color: var(--bg-dark);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

a { color: var(--gold-400); text-decoration: none; transition: var(--transition-fast); }
a:hover { color: var(--gold-300); }

h1, h2, h3, h4, h5, h6 {
  font-family: 'Outfit', 'Noto Sans JP', sans-serif;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-primary);
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); margin-bottom: 1.5rem; }
h2 { font-size: clamp(1.75rem, 4vw, 2.5rem); margin-bottom: 1.2rem; }
h3 { font-size: clamp(1.25rem, 3vw, 1.75rem); margin-bottom: 1rem; }
h4 { font-size: clamp(1.1rem, 2vw, 1.35rem); margin-bottom: 0.8rem; }

p { margin-bottom: 1.5rem; color: var(--text-secondary); line-height: 1.9; }

img { max-width: 100%; height: auto; }

/* ============================================
   Header / Navigation
   ============================================ */
.main-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background: rgba(6,14,26,0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  transition: var(--transition);
}

.main-nav.scrolled {
  background: rgba(6,14,26,0.95);
  box-shadow: 0 4px 24px rgba(0,0,0,0.4);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.nav-logo {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.logo-text {
  font-family: 'Outfit', sans-serif;
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--gold-500);
  letter-spacing: 1px;
}

.logo-sub {
  font-size: 0.65rem;
  color: var(--text-muted);
  letter-spacing: 2px;
  text-transform: uppercase;
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav-menu li a {
  display: block;
  padding: 8px 12px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: 6px;
  transition: var(--transition-fast);
  white-space: nowrap;
}

.nav-menu li a:hover {
  color: var(--gold-400);
  background: rgba(201,168,76,0.08);
}

/* Hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 1001;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--gold-500);
  transition: var(--transition);
  border-radius: 2px;
}

.nav-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.nav-toggle.active span:nth-child(2) { opacity: 0; }
.nav-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* ============================================
   Hero Section
   ============================================ */
.hero {
  position: relative;
  min-height: 85vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  margin-top: 72px;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: none;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(6,14,26,0.88) 0%,
    rgba(10,22,40,0.75) 40%,
    rgba(15,32,56,0.6) 100%
  );
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 1200px;
  margin: 0 auto;
  padding: 80px 24px;
}

.hero-title {
  margin-bottom: 1.5rem;
}

.hero h1,
.hero-title {
  font-family: 'Outfit', 'Noto Sans JP', sans-serif;
  font-weight: 800;
  color: #ffffff;
  text-shadow:
    2px 2px 0 #000,
    -2px 2px 0 #000,
    2px -2px 0 #000,
    -2px -2px 0 #000,
    0 4px 8px rgba(0,0,0,0.5);
}

.title-main {
  display: block;
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  line-height: 1.2;
  margin-bottom: 0.3rem;
}

.title-sub {
  display: block;
  font-size: clamp(1rem, 2vw, 1.4rem);
  font-weight: 400;
  color: var(--gold-300);
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
  letter-spacing: 2px;
}

.hero-description {
  font-size: clamp(1rem, 1.5vw, 1.15rem);
  color: rgba(255,255,255,0.8);
  max-width: 600px;
  margin-bottom: 2.5rem;
  line-height: 1.9;
}

/* Hero Stats */
.hero-stats {
  display: flex;
  gap: 40px;
  margin-top: 2rem;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.stat-number {
  font-family: 'Outfit', sans-serif;
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  font-weight: 800;
  color: var(--gold-400);
  line-height: 1.2;
}

.stat-label {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.6);
  margin-top: 4px;
  letter-spacing: 1px;
}

/* ============================================
   Section Styles
   ============================================ */
.section-header {
  text-align: center;
  margin-bottom: 3.5rem;
}

.section-header h2 {
  position: relative;
  display: inline-block;
  padding-bottom: 16px;
}

.section-header h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: var(--gold-500);
  border-radius: 2px;
}

.section-header p {
  max-width: 640px;
  margin: 1rem auto 0;
  color: var(--text-muted);
}

section {
  padding: 80px 0;
}

/* ============================================
   Feature Cards
   ============================================ */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 32px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--gold-500), transparent);
  opacity: 0;
  transition: var(--transition);
}

.feature-card:hover {
  border-color: var(--border-gold);
  transform: translateY(-4px);
  box-shadow: var(--shadow-gold);
}

.feature-card:hover::before { opacity: 1; }

.feature-icon {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  background: rgba(201,168,76,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  margin-bottom: 20px;
  border: 1px solid rgba(201,168,76,0.2);
}

.feature-card h3 {
  font-size: 1.15rem;
  margin-bottom: 12px;
}

.feature-card p {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.feature-card .card-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gold-400);
}

.feature-card .card-link::after {
  content: '→';
  transition: var(--transition-fast);
}

.feature-card:hover .card-link::after {
  transform: translateX(4px);
}

/* ============================================
   Topics / Content Grid
   ============================================ */
.topics-section {
  background: var(--navy-800);
}

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

.topic-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  transition: var(--transition);
  text-decoration: none;
}

.topic-card:hover {
  border-color: var(--border-gold);
  background: var(--bg-card-hover);
}

.topic-number {
  font-family: 'Outfit', sans-serif;
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--gold-500);
  opacity: 0.5;
  min-width: 48px;
  text-align: center;
}

.topic-card h4 {
  font-size: 0.95rem;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.topic-card p {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 0;
}

/* ============================================
   Stats Section (horizontal bar)
   ============================================ */
.stats-bar {
  background: var(--navy-700);
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  padding: 48px 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 32px;
  text-align: center;
}

.stats-grid .stat-item {
  align-items: center;
}

/* ============================================
   CTA Section
   ============================================ */
.cta-section {
  background: linear-gradient(135deg, var(--navy-600), var(--navy-800));
  text-align: center;
  position: relative;
  overflow: hidden;
}

.cta-section::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(201,168,76,0.06), transparent 70%);
  border-radius: 50%;
}

.cta-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 2rem;
}

.cta-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: var(--transition);
  text-decoration: none;
  border: none;
  cursor: pointer;
}

.cta-button.primary {
  background: var(--gold-500);
  color: var(--navy-900);
}

.cta-button.primary:hover {
  background: var(--gold-400);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(201,168,76,0.25);
}

.cta-button.secondary {
  background: transparent;
  color: var(--gold-400);
  border: 1px solid var(--border-gold);
}

.cta-button.secondary:hover {
  background: rgba(201,168,76,0.1);
  transform: translateY(-2px);
}

/* ============================================
   Latest News
   ============================================ */
.latest-news {
  background: var(--navy-800);
}

.news-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.news-list li {
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  font-size: 0.92rem;
  color: var(--text-secondary);
  transition: var(--transition-fast);
}

.news-list li:hover {
  border-color: var(--border-gold);
}

.news-list li small {
  color: var(--text-muted);
}

.news-link {
  margin-top: 1.5rem;
  text-align: right;
}

.news-link a {
  font-weight: 600;
  font-size: 0.9rem;
}

/* ============================================
   Footer
   ============================================ */
footer {
  background: var(--navy-900);
  border-top: 1px solid var(--border-subtle);
  padding: 60px 0 30px;
}

.footer-content {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

.footer-section h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--gold-400);
  margin-bottom: 16px;
  letter-spacing: 0.5px;
}

.footer-section p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.7;
}

.footer-section ul {
  list-style: none;
}

.footer-section ul li {
  margin-bottom: 8px;
}

.footer-section ul li a {
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: var(--transition-fast);
}

.footer-section ul li a:hover {
  color: var(--gold-400);
  padding-left: 4px;
}

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

.footer-bottom p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ============================================
   Sub Pages (page-*.html)
   ============================================ */
.page-hero {
  position: relative;
  min-height: 45vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  margin-top: 72px;
}

.page-hero .hero-bg {
  position: absolute;
  inset: 0;
}

.page-hero .hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.page-hero .hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(6,14,26,0.85) 0%,
    rgba(6,14,26,0.7) 100%
  );
}

.page-hero .hero-content {
  position: relative;
  z-index: 2;
}

.page-hero h1 {
  font-family: 'Outfit', 'Noto Sans JP', sans-serif;
  font-weight: 800;
  color: #ffffff;
  text-shadow:
    2px 2px 0 #000,
    -2px 2px 0 #000,
    2px -2px 0 #000,
    -2px -2px 0 #000,
    0 4px 8px rgba(0,0,0,0.5);
}

/* Content area for sub pages */
.content-section,
.page-content,
main {
  padding: 60px 0;
}

.content-section .container,
.page-content .container,
main .container {
  max-width: 900px;
}

.content-section h2,
.page-content h2,
main h2 {
  border-left: 4px solid var(--gold-500);
  padding-left: 16px;
  margin: 2.5rem 0 1.2rem;
}

.content-section h3,
.page-content h3,
main h3 {
  color: var(--gold-300);
  margin: 2rem 0 1rem;
}

.content-section p,
.page-content p,
main p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.content-section ul, .content-section ol,
.page-content ul, .page-content ol,
main ul, main ol {
  margin: 1rem 0 1.5rem 1.5rem;
  color: var(--text-secondary);
}

.content-section li, .page-content li, main li {
  margin-bottom: 0.5rem;
  line-height: 1.8;
}

.content-section table,
.page-content table,
main table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.9rem;
}

.content-section th, .page-content th, main th {
  background: var(--navy-700);
  color: var(--gold-300);
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  border: 1px solid var(--border-subtle);
}

.content-section td, .page-content td, main td {
  padding: 12px 16px;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.content-section tr:nth-child(even) td,
.page-content tr:nth-child(even) td,
main tr:nth-child(even) td {
  background: rgba(15,30,48,0.5);
}

blockquote {
  border-left: 3px solid var(--gold-500);
  padding: 16px 20px;
  margin: 1.5rem 0;
  background: rgba(201,168,76,0.05);
  border-radius: 0 8px 8px 0;
  color: var(--text-secondary);
  font-style: italic;
}

/* Glossary link */
.glossary-link {
  color: var(--gold-400);
  border-bottom: 1px dotted var(--gold-400);
}

.glossary-link:hover {
  color: var(--gold-300);
  border-bottom-style: solid;
}

/* ============================================
   Animations
   ============================================ */
.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 1024px) {
  .nav-menu {
    gap: 2px;
  }

  .nav-menu li a {
    padding: 6px 8px;
    font-size: 0.78rem;
  }

  .footer-content {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .nav-toggle { display: flex; }

  .nav-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: var(--navy-800);
    flex-direction: column;
    padding: 80px 24px 40px;
    transition: var(--transition);
    gap: 0;
    border-left: 1px solid var(--border-subtle);
    overflow-y: auto;
  }

  .nav-menu.active { right: 0; }

  .nav-menu li a {
    padding: 12px 16px;
    font-size: 0.92rem;
    border-radius: 8px;
  }

  .hero { min-height: 70vh; }

  .hero-stats {
    flex-direction: column;
    gap: 20px;
  }

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

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

  .stats-grid { grid-template-columns: repeat(2, 1fr); }

  .footer-content { grid-template-columns: 1fr; }

  section { padding: 60px 0; }

  .cta-buttons { flex-direction: column; align-items: center; }

  .page-hero { min-height: 35vh; }
}

@media (max-width: 480px) {
  .container { padding: 0 16px; }

  .hero { min-height: 60vh; }

  .hero-content { padding: 60px 16px; }

  .title-main { font-size: 1.8rem; }

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

  .feature-card { padding: 24px; }
}
