/* ============================================
   Precision Works - Manufacturing Corporate
   Navy & Silver, Heavy Industrial
   ============================================ */

:root {
  --primary: #1E3A5F;
  --primary-dark: #152B47;
  --primary-light: rgba(30,58,95,0.08);
  --accent: #F97316;
  --accent-light: rgba(249,115,22,0.1);
  --bg: #FFFFFF;
  --bg-alt: #F8FAFC;
  --text: #1E293B;
  --text-muted: #64748B;
  --text-secondary: #334155;
  --border: #E2E8F0;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.1);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.12);
  --radius: 8px;
  --radius-lg: 16px;
  --text-hero: clamp(36px, 5vw, 56px);
  --text-h2: clamp(28px, 3.5vw, 40px);
  --text-h3: clamp(20px, 2.5vw, 24px);
  --text-body: 16px;
  --text-small: 14px;
  --text-caption: 12px;
  --space-section: clamp(80px, 10vw, 120px);
  --space-group: clamp(40px, 5vw, 64px);
  --space-element: clamp(16px, 2vw, 24px);
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'IBM Plex Sans', 'Noto Sans JP', sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  animation: fadeIn 0.5s ease-out;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
img { max-width: 100%; height: auto; display: block; }
a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: inherit; border: none; }
ul, ol { list-style: none; }

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 clamp(20px, 5vw, 80px);
}

/* --- Animation --- */
.animate-on-scroll {
  opacity: 0; transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.animate-on-scroll.visible { opacity: 1; transform: translateY(0); }
.animate-on-scroll.visible .stagger-item:nth-child(1) { transition-delay: 0s; }
.animate-on-scroll.visible .stagger-item:nth-child(2) { transition-delay: 0.1s; }
.animate-on-scroll.visible .stagger-item:nth-child(3) { transition-delay: 0.15s; }
.animate-on-scroll.visible .stagger-item:nth-child(4) { transition-delay: 0.2s; }

/* --- Buttons --- */
.btn-accent {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 32px; background: var(--accent); color: #fff;
  font-size: 15px; font-weight: 600; border-radius: var(--radius);
  transition: all 0.2s ease; box-shadow: 0 2px 8px rgba(249,115,22,0.3);
}
.btn-accent:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(249,115,22,0.4); filter: brightness(1.05); }
.btn-white {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 32px; background: #fff; color: var(--primary);
  font-size: 15px; font-weight: 600; border-radius: var(--radius);
  transition: all 0.2s ease; box-shadow: var(--shadow-sm);
}
.btn-white:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn-outline-white {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 32px; background: transparent; color: #fff;
  font-size: 15px; font-weight: 600; border: 2px solid rgba(255,255,255,0.4);
  border-radius: var(--radius); transition: all 0.2s ease;
}
.btn-outline-white:hover { border-color: #fff; background: rgba(255,255,255,0.1); transform: translateY(-2px); }

/* --- Section Header --- */
.section-header { text-align: center; margin-bottom: var(--space-group); }
.section-label {
  font-size: 13px; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 12px;
}
.section-title {
  font-size: var(--text-h2); font-weight: 700; line-height: 1.3; letter-spacing: -0.02em;
}
.section-subtitle {
  font-size: var(--text-body); color: var(--text-muted); margin-top: 16px;
  max-width: 600px; margin-left: auto; margin-right: auto; line-height: 1.8;
}

/* ============================================
   HEADER (Navy)
   ============================================ */
header {
  position: fixed; top: 0; left: 0; width: 100%; z-index: 1000;
  background: var(--primary);
  transition: box-shadow 0.3s;
  padding: 0 clamp(20px, 5vw, 80px);
}
header.scrolled { box-shadow: 0 2px 8px rgba(0,0,0,0.3); }
.header-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; height: 72px;
}
.logo { font-size: 20px; font-weight: 700; color: #fff; letter-spacing: -0.02em; }
.logo span { color: var(--accent); font-weight: 400; }
.desktop-nav { display: flex; align-items: center; gap: 28px; }
.desktop-nav a { font-size: 14px; font-weight: 500; color: rgba(255,255,255,0.8); transition: color 0.2s; }
.desktop-nav a:hover { color: #fff; }
.header-cta .btn-accent { padding: 10px 24px; font-size: 14px; }
.hamburger { display: none; background: none; border: none; padding: 8px; cursor: pointer; color: #fff; }
.hamburger svg { display: block; }

/* Mobile Menu */
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); opacity: 0; pointer-events: none; transition: opacity 0.3s; z-index: 1000; }
.overlay.open { opacity: 1; pointer-events: auto; }
.mobile-menu {
  position: fixed; top: 0; right: -100%; width: 80%; max-width: 360px; height: 100vh;
  background: var(--primary); transition: right 0.3s ease; z-index: 1001; padding: 24px;
  display: flex; flex-direction: column;
}
.mobile-menu.open { right: 0; }
.mobile-menu-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 32px; }
.mobile-menu-close { background: none; border: none; padding: 8px; cursor: pointer; color: #fff; }
.mobile-menu nav { display: flex; flex-direction: column; }
.mobile-menu nav a { display: block; padding: 16px 0; font-size: 16px; font-weight: 500; color: rgba(255,255,255,0.8); border-bottom: 1px solid rgba(255,255,255,0.1); }
.mobile-menu .btn-accent { margin-top: 24px; justify-content: center; }

/* ============================================
   HERO (Ken Burns)
   ============================================ */
.hero {
  padding-top: 72px; position: relative; overflow: hidden;
  min-height: 100vh; display: flex; align-items: center;
}
.hero-bg {
  position: absolute; inset: 0;
}
.hero-bg img {
  width: 100%; height: 100%; object-fit: cover;
  animation: kenBurns 20s ease-in-out infinite alternate;
}
@keyframes kenBurns {
  0% { transform: scale(1); }
  100% { transform: scale(1.08); }
}
.hero-bg::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to right, rgba(30,58,95,0.9) 0%, rgba(30,58,95,0.5) 100%);
}
.hero-content {
  position: relative; z-index: 1; max-width: 640px; color: #fff;
}
.hero-content h1 {
  font-size: var(--text-hero); font-weight: 700; line-height: 1.2;
  letter-spacing: -0.03em; margin-bottom: 20px;
}
.hero-content p {
  font-size: 18px; color: rgba(255,255,255,0.85); line-height: 1.8; margin-bottom: 32px;
}
.hero-buttons { display: flex; gap: 16px; flex-wrap: wrap; }

/* ============================================
   PRODUCTS (Tabs)
   ============================================ */
.products { padding: var(--space-section) 0; background: var(--bg); }
.tab-nav {
  display: flex; justify-content: center; gap: 8px; margin-bottom: var(--space-group); flex-wrap: wrap;
}
.tab-btn {
  padding: 10px 24px; font-size: var(--text-small); font-weight: 600;
  background: var(--bg-alt); color: var(--text-muted); border: 1px solid var(--border);
  border-radius: 100px; cursor: pointer; transition: all 0.2s;
}
.tab-btn.active, .tab-btn:hover {
  background: var(--primary); color: #fff; border-color: var(--primary);
}
.tab-content { display: none; }
.tab-content.active { display: block; }
.product-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.product-card {
  display: flex; gap: 24px; background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 24px; transition: all 0.3s ease;
}
.product-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--accent); }
.product-card-image {
  width: 120px; height: 120px; flex-shrink: 0; border-radius: var(--radius);
  overflow: hidden; background: var(--bg-alt);
}
.product-card-image img { width: 100%; height: 100%; object-fit: cover; }
.product-card-body { flex: 1; }
.product-card-body h3 { font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.product-card-body p { font-size: var(--text-small); color: var(--text-muted); line-height: 1.7; }

/* ============================================
   STRENGTH
   ============================================ */
.strength { padding: var(--space-section) 0; background: var(--bg-alt); }
.strength-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.strength-card {
  text-align: center; padding: 40px 24px; background: var(--bg);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); transition: all 0.3s ease;
}
.strength-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.strength-icon {
  width: 72px; height: 72px; border-radius: 50%; background: var(--primary-light);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 20px; color: var(--primary);
}
.strength-card h3 { font-size: 18px; font-weight: 700; margin-bottom: 12px; }
.strength-card p { font-size: var(--text-small); color: var(--text-muted); line-height: 1.8; }

/* ============================================
   HISTORY (Timeline)
   ============================================ */
.history { padding: var(--space-section) 0; background: var(--bg); }
.timeline { max-width: 800px; margin: 0 auto; position: relative; padding-left: 40px; }
.timeline::before {
  content: ''; position: absolute; left: 15px; top: 0; bottom: 0;
  width: 2px; background: var(--border);
}
.timeline-item { position: relative; margin-bottom: 32px; padding-left: 32px; }
.timeline-item::before {
  content: ''; position: absolute; left: -29px; top: 6px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--primary); border: 3px solid var(--bg);
  box-shadow: 0 0 0 2px var(--primary);
}
.timeline-year {
  font-size: var(--text-small); font-weight: 700; color: var(--accent); margin-bottom: 4px;
}
.timeline-item h3 { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.timeline-item p { font-size: var(--text-small); color: var(--text-muted); line-height: 1.7; }

/* ============================================
   GLOBAL
   ============================================ */
.global-section { padding: var(--space-section) 0; background: var(--primary); color: #fff; text-align: center; }
.global-section .section-label { color: var(--accent); }
.global-section .section-title { color: #fff; }
.global-section .section-subtitle { color: rgba(255,255,255,0.7); }
.global-stats {
  display: flex; justify-content: center; gap: clamp(32px, 5vw, 64px);
  margin-top: var(--space-group); flex-wrap: wrap;
}
.global-stat-item { text-align: center; }
.global-stat-value {
  font-size: clamp(36px, 5vw, 52px); font-weight: 700; letter-spacing: -0.03em; line-height: 1.2;
}
.global-stat-value span { color: var(--accent); }
.global-stat-label { font-size: var(--text-small); color: rgba(255,255,255,0.6); margin-top: 8px; }

/* ============================================
   RECRUIT
   ============================================ */
.recruit {
  padding: clamp(48px, 6vw, 80px) 0; background: var(--bg-alt);
}
.recruit-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 32px; flex-wrap: wrap;
}
.recruit-text h2 { font-size: var(--text-h3); font-weight: 700; margin-bottom: 8px; }
.recruit-text p { font-size: var(--text-body); color: var(--text-muted); }

/* ============================================
   FOOTER
   ============================================ */
footer {
  background: var(--primary-dark); color: #CBD5E1; padding: 64px 0 0;
}
.footer-grid {
  display: grid; grid-template-columns: 2fr repeat(3, 1fr); gap: 48px; margin-bottom: 48px;
}
.footer-brand .logo { margin-bottom: 16px; }
.footer-brand p { font-size: var(--text-small); color: #94A3B8; line-height: 1.8; }
.footer-column h4 { font-size: var(--text-small); font-weight: 700; color: #fff; margin-bottom: 16px; }
.footer-column a { display: block; font-size: var(--text-small); color: #94A3B8; padding: 6px 0; transition: color 0.2s; }
.footer-column a:hover { color: #fff; }
.footer-certs { display: flex; gap: 16px; margin-top: 24px; flex-wrap: wrap; }
.cert-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: var(--text-caption); font-weight: 600; color: #94A3B8;
  background: rgba(255,255,255,0.05); padding: 6px 12px; border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,0.1);
}
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1); padding: 24px 0;
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px;
}
.footer-bottom p { font-size: var(--text-caption); color: #64748B; }
.footer-links { display: flex; gap: 24px; }
.footer-links a { font-size: var(--text-caption); color: #64748B; transition: color 0.2s; }
.footer-links a:hover { color: #94A3B8; }

/* Back to Top */
.back-to-top {
  position: fixed; bottom: 32px; right: 32px; width: 48px; height: 48px;
  border-radius: 50%; background: var(--primary); color: #fff; border: none;
  box-shadow: var(--shadow-md); opacity: 0; transform: translateY(20px);
  transition: all 0.3s ease; z-index: 999; display: flex;
  align-items: center; justify-content: center; cursor: pointer;
}
.back-to-top.show { opacity: 1; transform: translateY(0); }
.back-to-top:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
  .product-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .desktop-nav, .header-cta { display: none; }
  .hamburger { display: block; }
  .hero { min-height: auto; padding-top: 100px; padding-bottom: 60px; }
  .strength-grid { grid-template-columns: 1fr; }
  .global-stats { flex-direction: column; gap: 24px; }
  .recruit-inner { flex-direction: column; text-align: center; }
  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .footer-links { flex-wrap: wrap; justify-content: center; }
}
@media (max-width: 480px) {
  .hero-content h1 { font-size: 32px; }
  .hero-buttons { flex-direction: column; }
  .hero-buttons .btn-accent,
  .hero-buttons .btn-outline-white { width: 100%; justify-content: center; }
  .tab-nav { flex-direction: column; align-items: stretch; }
}

/* ============================================
   Sub-page Styles (Phase 3)
   ============================================ */

/* Navigation Active State */
.nav-link.active { color: var(--accent); font-weight: 600; }

/* Page Hero */
.page-hero {
  padding: clamp(120px, 15vw, 160px) 0 clamp(40px, 5vw, 60px);
  background: var(--bg-alt);
}
.breadcrumb {
  display: flex; align-items: center; gap: 8px;
  font-size: var(--text-small); color: var(--text-muted); margin-bottom: 16px;
}
.breadcrumb a { color: var(--text-muted); transition: color 0.2s; }
.breadcrumb a:hover { color: var(--accent); }

/* CTA Band */
.cta-band {
  padding: var(--space-section) 0;
  background: var(--primary); color: #fff; text-align: center;
}
.cta-band h2 { font-size: var(--text-h2); margin-bottom: 16px; }
.cta-band p { opacity: 0.9; margin-bottom: 32px; }
.cta-band .btn-accent { background: var(--accent); }

/* Section More Link */
.section-more { text-align: center; margin-top: var(--space-group); }
.more-link {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: var(--text-body); font-weight: 600; color: var(--accent); transition: gap 0.2s;
}
.more-link:hover { gap: 8px; }

/* Vision Section */
.vision-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center;
}
.vision-image { border-radius: var(--radius-lg); overflow: hidden; }
.vision-image img { width: 100%; height: 400px; object-fit: cover; }
.vision-content h2 { font-size: var(--text-h2); font-weight: 700; margin-bottom: 16px; }
.vision-content p { font-size: var(--text-body); color: var(--text-muted); line-height: 1.8; margin-bottom: 16px; }

/* Company Table */
.company-table {
  width: 100%; border-collapse: collapse; margin-top: var(--space-group);
}
.company-table th, .company-table td {
  padding: 16px 20px; font-size: var(--text-body); border-bottom: 1px solid var(--border);
  text-align: left; vertical-align: top;
}
.company-table th {
  width: 160px; font-weight: 600; color: var(--primary); background: var(--bg-alt);
}

/* Quality Grid */
.quality-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.quality-card {
  padding: 32px; background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-lg); transition: all 0.3s ease;
}
.quality-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--accent); }
.quality-card h3 { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.quality-card p { font-size: var(--text-small); color: var(--text-muted); line-height: 1.8; }
.quality-icon {
  width: 56px; height: 56px; border-radius: var(--radius); background: var(--accent-light);
  display: flex; align-items: center; justify-content: center; margin-bottom: 16px; color: var(--accent);
}

/* Contact Form */
.contact-grid {
  display: grid; grid-template-columns: 1.5fr 1fr; gap: 48px;
}
.contact-form { display: flex; flex-direction: column; gap: 20px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: var(--text-small); font-weight: 600; color: var(--text); }
.form-group input, .form-group select, .form-group textarea {
  padding: 12px 16px; font-size: var(--text-body); border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--bg); color: var(--text);
  transition: border-color 0.2s; font-family: inherit;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light);
}
.form-group textarea { min-height: 140px; resize: vertical; }

/* Contact Info Card */
.contact-info-card {
  padding: 32px; background: var(--bg-alt); border-radius: var(--radius-lg);
}
.contact-info-card h3 { font-size: 18px; font-weight: 700; margin-bottom: 24px; }
.contact-info-item { display: flex; gap: 16px; margin-bottom: 20px; }
.info-icon {
  width: 44px; height: 44px; flex-shrink: 0; border-radius: var(--radius);
  background: var(--primary-light); display: flex; align-items: center;
  justify-content: center; color: var(--primary);
}
.info-text h4 { font-size: var(--text-small); font-weight: 600; margin-bottom: 4px; }
.info-text p { font-size: var(--text-small); color: var(--text-muted); line-height: 1.7; }

/* FAQ Accordion */
.faq-list { max-width: 800px; margin: 0 auto; }
.faq-item { border-bottom: 1px solid var(--border); }
.faq-question {
  width: 100%; padding: 20px 0; font-size: var(--text-body); font-weight: 600;
  text-align: left; background: none; color: var(--text); display: flex;
  justify-content: space-between; align-items: center; gap: 16px;
}
.faq-question svg { flex-shrink: 0; transition: transform 0.3s; color: var(--text-muted); }
.faq-item.open .faq-question svg { transform: rotate(180deg); }
.faq-answer {
  max-height: 0; overflow: hidden; transition: max-height 0.3s ease;
}
.faq-answer p { padding: 0 0 20px; font-size: var(--text-small); color: var(--text-muted); line-height: 1.8; }
.faq-item.open .faq-answer { max-height: 300px; }

/* Works Case Cards */
.case-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.case-card {
  padding: 32px; background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-lg); transition: all 0.3s ease;
}
.case-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.case-industry {
  display: inline-block; font-size: var(--text-caption); font-weight: 600;
  color: var(--accent); background: var(--accent-light); padding: 4px 12px;
  border-radius: 100px; margin-bottom: 12px;
}
.case-card h3 { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.case-card p { font-size: var(--text-small); color: var(--text-muted); line-height: 1.8; margin-bottom: 16px; }
.case-results { display: flex; gap: 24px; flex-wrap: wrap; }
.case-result-item { text-align: center; }
.case-result-value { font-size: 24px; font-weight: 700; color: var(--primary); }
.case-result-label { font-size: var(--text-caption); color: var(--text-muted); }

/* Logo Wall */
.logo-wall {
  display: flex; flex-wrap: wrap; gap: 24px; justify-content: center; align-items: center;
}
.logo-wall-item {
  padding: 16px 32px; background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); font-size: var(--text-small); font-weight: 600;
  color: var(--text-muted);
}

/* Numbers Bar */
.numbers-bar { padding: clamp(48px, 6vw, 64px) 0; background: var(--primary); }
.numbers-grid {
  display: flex; justify-content: center; gap: clamp(32px, 5vw, 64px); flex-wrap: wrap;
}
.number-item { text-align: center; color: #fff; }
.number-value {
  font-size: clamp(36px, 5vw, 48px); font-weight: 700; letter-spacing: -0.03em; line-height: 1.2;
}
.number-label { font-size: var(--text-small); color: rgba(255,255,255,0.7); margin-top: 4px; }

/* Recruit Info */
.recruit-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.recruit-card {
  padding: 32px; background: var(--bg-alt); border-radius: var(--radius-lg);
  text-align: center;
}
.recruit-card h3 { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.recruit-card p { font-size: var(--text-small); color: var(--text-muted); line-height: 1.8; }

/* Sub-page Responsive */
@media (max-width: 1024px) {
  .vision-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .case-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .quality-grid { grid-template-columns: 1fr; }
  .recruit-grid { grid-template-columns: 1fr; }
  .company-table th { width: 120px; }
}
