/* ==========================================
   NewFuture Corporate Site - Global Styles
   ========================================== */

:root {
  --color-primary: #003399;
  --color-primary-mid: #1A47B8;
  --color-primary-alt: #6688CE;
  --color-bg: #FBFCEF;
  --color-bg-alt: #F0F1E3;
  --color-ink: #1A1A1A;
  --color-ink-light: #5C5C5C;
  --color-accent: #C4A265;
  --color-white: #FFFFFF;

  --font-jp: 'Noto Sans JP', sans-serif;
  --font-sc: 'Noto Sans SC', sans-serif;
  --font-en: 'Inter', sans-serif;

  --max-width: 1200px;
  --nav-height: 72px;
}

[hidden] { display: none !important; }

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-height);
  font-size: 115%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-jp), var(--font-sc), var(--font-en), sans-serif;
  background: var(--color-bg);
  color: var(--color-ink);
  line-height: 1.8;
  letter-spacing: 0.01em;
}
html:lang(ja) body { font-family: var(--font-jp), var(--font-sc), var(--font-en), sans-serif; }
html:lang(zh) body { font-family: var(--font-sc), var(--font-jp), var(--font-en), sans-serif; }
html:lang(en) body { font-family: var(--font-en), var(--font-sc), var(--font-jp), sans-serif; }

img { max-width: 100%; height: auto; display: block; }
a { color: var(--color-primary-mid); text-decoration: none; transition: color 0.2s ease; }
a:hover { color: var(--color-primary); }

/* --- Typography --- */
h1, h2, h3, h4 { font-weight: 600; line-height: 1.3; color: var(--color-primary); }
h1 { font-size: clamp(2.5rem, 6vw, 3rem); }
h2 { font-size: clamp(1.75rem, 3.5vw, 2.5rem); }
h3 { font-size: clamp(1.25rem, 2.2vw, 1.6rem); }

/* --- Layout --- */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 clamp(1rem, 4vw, 2rem); }
.section { padding: clamp(60px, 8vw, 100px) 0; }
.section-alt { background: var(--color-bg-alt); }
.section-heading { text-align: center; margin-bottom: clamp(32px, 6vw, 56px); }
.section-heading h2 { margin-bottom: 0.5rem; }
.section-heading .accent-line { display: block; width: 48px; height: 2px; background: var(--color-accent); margin: 0 auto; }

/* --- Placeholder Images --- */
.img-placeholder {
  display: flex; align-items: center; justify-content: center;
  color: var(--color-ink-light); font-size: 0.8rem; text-align: center;
  transition: box-shadow 0.4s ease, transform 0.4s ease;
}
.img-placeholder img { width: 100%; height: auto; display: block; }
.img-placeholder:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(0, 0, 0, 0.08); }
.img-placeholder-label {
  position: absolute; bottom: 0; left: 0; right: 0;
  color: var(--color-white);
  font-size: 0.7rem; padding: 4px 8px; text-align: center;
}

/* ==========================================
   NAVBAR
   ========================================== */
.navbar {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--nav-height); z-index: 1000;
  background: linear-gradient(135deg, #002A7A 0%, var(--color-primary) 40%, #2459df 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  transition: box-shadow 0.3s ease;
}
.navbar.scrolled { box-shadow: 0 2px 20px rgba(0, 0, 0, 0.25); }
.navbar .container { display: flex; align-items: center; justify-content: space-between; height: 100%; }
.nav-logo { flex-shrink: 0; display: flex; align-items: center; }
.nav-brand-text { font-family: var(--font-en); font-size: 1.1rem; font-weight: 700; color: var(--color-white); letter-spacing: -0.01em; }
.nav-links { display: flex; list-style: none; gap: clamp(1rem, 2.5vw, 2rem); }
.nav-links a {
  font-size: 0.9rem; font-weight: 500; color: rgba(255, 255, 255, 0.75);
  letter-spacing: 0.02em; padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
  transition: border-color 0.2s ease, color 0.2s ease;
}
.nav-links a:hover, .nav-links a.active { color: var(--color-white); border-bottom-color: var(--color-accent); }

.lang-switch { display: flex; gap: 4px; }
.lang-switch button {
  font-family: var(--font-en); font-size: 0.75rem; font-weight: 500;
  padding: 4px 10px; border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 4px; background: transparent; color: rgba(255, 255, 255, 0.7);
  cursor: pointer; transition: all 0.2s ease; letter-spacing: 0.04em;
}
.lang-switch button:hover { border-color: var(--color-accent); color: var(--color-accent); }
.lang-switch button.active { background: var(--color-accent); color: var(--color-primary); border-color: var(--color-accent); }

.hamburger { display: none; flex-direction: column; gap: 5px; cursor: pointer; background: none; border: none; padding: 4px; z-index: 1001; }
.hamburger span { display: block; width: 24px; height: 2px; background: var(--color-white); transition: all 0.3s ease; border-radius: 2px; }
.hamburger.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* ==========================================
   HERO
   ========================================== */
.hero {
  min-height: 100vh; display: flex; align-items: center;
  padding-top: var(--nav-height); position: relative; overflow: hidden;
}
.hero-bg {
  position: absolute; inset: 0;
  background:transparent url("../images/hero.png") center / cover no-repeat;
  animation: heroZoom 8s ease-in-out infinite alternate;
}
@keyframes heroZoom {
  from { transform: scale(1); }
  to   { transform: scale(1.08); }
}
.hero::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(135deg, #295fc3a9 0%, #0033992b 60%, rgba(249, 249, 249, 0.055) 100%);
  z-index: 1;
}

.hero .container {
  position: relative; z-index: 2;
  display: grid; grid-template-columns: 1fr 1fr;
  gap: clamp(1.5rem, 4vw, 3rem); align-items: center; width: 100%;
}
.hero-content { max-width: 560px; }
.hero-image { display: flex; align-items: center; justify-content: center; }
.hero-logo-img { width: min(400px, 100%); height: auto; aspect-ratio: 1; object-fit: contain; filter: drop-shadow(0 4px 24px rgba(0, 51, 153, 0.15)); }
.hero-content { color: var(--color-white); text-shadow: 0 2px 12px rgba(0,0,0,0.35); }
.hero-content h1 { margin-bottom: 1rem; letter-spacing: 0.02em; color: var(--color-white); }
.hero-content h1 .accent-dot { display: inline-block; width: 8px; height: 8px; background: var(--color-accent); border-radius: 50%; margin-left: 0.25rem; vertical-align: middle; }
.hero-content .accent-line { display: block; width: 64px; height: 2px; background: var(--color-white); margin-bottom: 1rem; }
.hero-content p { font-size: clamp(1.1rem, 1.6vw, 1.25rem); color: var(--color-white); margin-bottom: 1.75rem; max-width: 520px; }
.hero-content .btn-primary { background: #C4A265; }
.hero-content .btn-primary:hover { background: #e8c078; }
.btn-primary {
  display: inline-block; font-family: var(--font-jp), var(--font-sc), sans-serif;
  font-size: 0.95rem; font-weight: 600; padding: 14px 36px;
  background: var(--color-primary); color: var(--color-white);
  border: none; border-radius: 4px; cursor: pointer;
  letter-spacing: 0.04em; transition: background 0.2s ease, transform 0.2s ease;
}
.btn-primary:hover { background: var(--color-primary-mid); transform: translateY(-1px); color: var(--color-white); }

/* ==========================================
   REVEAL ANIMATION (before component styles for cascade priority)
   ========================================== */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ==========================================
   ABOUT
   ========================================== */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1.5rem, 4vw, 3rem); align-items: center; }
.about-text p { margin-bottom: 1rem; color: var(--color-ink-light); font-size: clamp(1rem, 1.3vw, 1.1rem); }
.about-image .img-placeholder { width: 100%; aspect-ratio: 1 / 1; }

/* ==========================================
   SERVICE
   ========================================== */
.service-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.25rem; }
.service-card {
  background: var(--color-white); padding: clamp(1.5rem, 3vw, 2rem);
  border-radius: 4px; border: 1px solid rgba(0, 0, 0, 0.06);
  transition: border-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}
.service-card:hover { border-color: var(--color-accent); transform: translateY(-4px); box-shadow: 0 8px 32px rgba(0, 0, 0, 0.06); }
.service-card h3 { font-size: 1.2rem; margin-bottom: 0.75rem; }
.service-card p { font-size: 0.95rem; color: var(--color-ink-light); line-height: 1.75; }

/* ==========================================
   PRODUCTS
   ========================================== */
.product-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.product-item { text-align: center; transition: transform 0.3s ease; }
.product-item:hover { transform: translateY(-4px); }
.product-item .img-placeholder { width: 100%; aspect-ratio: 1 / 1; margin-bottom: 1rem; }
.product-item h4 { font-size: 1rem; margin-bottom: 0.35rem; color: var(--color-ink); }
.product-item span { font-size: 0.8rem; color: var(--color-ink-light); }

/* ==========================================
   ADVANTAGE
   ========================================== */
.advantage-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; counter-reset: adv-counter; }
.advantage-item { text-align: center; padding: 1rem; counter-increment: adv-counter; }
.advantage-num {
  font-family: var(--font-en); font-size: 3rem; font-weight: 700;
  color: var(--color-bg-alt); line-height: 1; margin-bottom: 0.5rem; letter-spacing: -0.04em;
}
.advantage-num::before { content: counter(adv-counter, decimal-leading-zero); }
.advantage-item h3 { font-size: 1.1rem; margin-bottom: 0.5rem; }
.advantage-item p { font-size: 0.9rem; color: var(--color-ink-light); line-height: 1.7; }

/* ==========================================
   PARTNERS
   ========================================== */
.partner-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 1.25rem; }
.partner-item {
  background: var(--color-white); border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 4px; padding: 1.25rem;
  display: flex; align-items: center; justify-content: center;
  text-align: center; min-height: 90px;
  transition: border-color 0.3s ease, filter 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
  filter: grayscale(1); opacity: 0.6;
}
.partner-item:hover {
  filter: grayscale(0); opacity: 1;
  border-color: var(--color-primary-alt);
  transform: translateY(-3px);
  box-shadow: 0 4px 16px rgba(0, 51, 153, 0.08);
}
.partner-item span { font-size: 0.8rem; color: var(--color-ink-light); font-weight: 500; }

/* ==========================================
   CONTACT
   ========================================== */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1.5rem, 4vw, 3rem); }
.contact-info { display: flex; flex-direction: column; gap: 1.25rem; }
.contact-info-item { display: flex; gap: 1rem; align-items: flex-start; }
.contact-icon { width: 40px; height: 40px; flex-shrink: 0; background: var(--color-bg-alt); border-radius: 4px; display: flex; align-items: center; justify-content: center; }
.contact-info-label { font-size: 0.75rem; font-weight: 600; color: var(--color-ink-light); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 0.2rem; }
.contact-info-value { font-size: 0.95rem; color: var(--color-ink); }
.contact-map { width: 100%; aspect-ratio: 16 / 10; border: 1px solid rgba(0, 0, 0, 0.08); border-radius: 4px; overflow: hidden; }
.contact-map iframe { width: 100%; height: 100%; border: 0; }

/* ==========================================
   FOOTER
   ========================================== */
.footer { background: linear-gradient(135deg, #002A7A 0%, var(--color-primary) 40%, #2459df 100%); color: rgba(255, 255, 255, 0.7); padding: 2rem 0; font-size: 0.85rem; }
.footer .container { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1.5rem; }
.footer-brand { color: var(--color-white); font-weight: 600; font-size: 1rem; }
.footer .lang-switch button { color: rgba(255, 255, 255, 0.6); border-color: rgba(255, 255, 255, 0.2); }
.footer .lang-switch button:hover { border-color: var(--color-accent); color: var(--color-accent); }
.footer .lang-switch button.active { background: var(--color-accent); color: var(--color-primary); border-color: var(--color-accent); }

/* --- Back to Top --- */
.top-btn {
  position: fixed; bottom: 32px; right: 32px; z-index: 999;
  width: 48px; height: 48px; border: none; border-radius: 50%;
  background: var(--color-primary); color: var(--color-white);
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.04em;
  cursor: pointer; opacity: 0; visibility: hidden;
  transform: translateY(12px);
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}
.top-btn.visible { opacity: 1; visibility: visible; transform: translateY(0); }
.top-btn:hover { background: var(--color-primary-mid); transform: translateY(-2px); }

/* ==========================================
   RESPONSIVE - Tablet (768px - 1023px)
   ========================================== */
@media (max-width: 1023px) {
  .hamburger { display: flex; }

  .nav-links {
    position: fixed; top: 0; right: -100%; width: 280px; height: 100vh;
    flex-direction: column; background: linear-gradient(135deg, #002A7A 0%, var(--color-primary) 40%, #2459df 100%);
    padding: calc(var(--nav-height) + 2rem) 2rem 2rem;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.3); transition: right 0.3s ease;
  }
  .nav-links.open { right: 0; }
  .nav-links a { font-size: 1rem; padding: 0.75rem 0; }

  .hero .container { grid-template-columns: 1fr; text-align: center; }
  .hero-content { max-width: 100%; }
  .hero-image { order: 1; margin-top: 2rem; }
  .hero-logo-img { width: min(180px, 50vw); }
  .hero-content .accent-line { margin-left: auto; margin-right: auto; }
  .hero-content p { max-width: 100%; }
  .about-grid { grid-template-columns: 1fr; }
  .about-image { order: -1; max-width: 480px; margin: 0 auto; }
  .service-grid { grid-template-columns: repeat(2, 1fr); }
  .product-grid { grid-template-columns: repeat(3, 1fr); }
  .advantage-grid { grid-template-columns: repeat(2, 1fr); }
  .partner-grid { grid-template-columns: repeat(3, 1fr); }
  .contact-grid { grid-template-columns: 1fr; }
}

/* ==========================================
   RESPONSIVE - Mobile (<768px)
   ========================================== */
@media (max-width: 767px) {
  .lang-switch { gap: 2px; }
  .lang-switch button { font-size: 0.7rem; padding: 3px 8px; }
  .service-grid { grid-template-columns: 1fr; }
  .product-grid { grid-template-columns: repeat(2, 1fr); }
  .advantage-grid { grid-template-columns: 1fr 1fr; gap: 1rem; }
  .partner-grid { grid-template-columns: repeat(2, 1fr); }
  .footer .container { flex-direction: column; text-align: center; }

  .hero-bg {
    background-size: contain;
    background-color: #ffffff;
  }
  .hero::before {
    background: linear-gradient(135deg, #295fc3a9 0%, #0033992b 80%, rgba(249, 249, 249, 0.055) 100%);
  }
}

/* ==========================================
   MOBILE OVERLAY
   ========================================== */
.nav-overlay { display: none; position: fixed; inset: 0; z-index: 999; background: rgba(0, 0, 0, 0.3); }
.nav-overlay.open { display: block; }

/* ==========================================
   LANGUAGE-SPECIFIC HIDES
   ========================================== */
html[lang="zh"] .contact-map { display: none; }

/* ==========================================
   UTILITY
   ========================================== */
.text-center { text-align: center; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }
