/* 
 * Hanegi Works Co., Ltd. - Unified Premium Stylesheet
 * Rebuilt and modernized from the original 2019 minimalist site.
 */

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

/* --- Design Tokens --- */
:root {
  --primary: #8E1C38;
  --primary-light: #B02A4B;
  --primary-dark: #641124;
  --primary-rgb: 142, 28, 56;
  --dark: #121416;
  --dark-rgb: 18, 20, 22;
  --light: #FAF9F6;
  --white: #ffffff;
  --gray-light: #F1F3F5;
  --gray-medium: #E9ECEF;
  --gray-dark: #6C757D;
  --border-color: rgba(142, 28, 56, 0.08);
  
  --font-sans: 'Plus Jakarta Sans', 'Noto Sans JP', -apple-system, BlinkMacSystemFont, sans-serif;
  
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.03), 0 2px 4px -1px rgba(0, 0, 0, 0.02);
  --shadow-md: 0 10px 25px -5px rgba(18, 20, 22, 0.05), 0 8px 10px -6px rgba(18, 20, 22, 0.03);
  --shadow-lg: 0 20px 40px -10px rgba(142, 28, 56, 0.08), 0 15px 15px -10px rgba(0, 0, 0, 0.03);
  --shadow-glow: 0 0 30px rgba(142, 28, 56, 0.15);
  
  --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-fast: all 0.2s ease;
  
  --radius-lg: 20px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --radius-full: 9999px;
  
  --container-width: 1100px;
}

/* --- Base Resets & Structure --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  height: 100%;
}

body {
  font-family: var(--font-sans);
  background-color: var(--light);
  color: var(--dark);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
}

/* Premium Background Ambient Glows */
body::before, body::after {
  content: '';
  position: absolute;
  width: 600px;
  height: 600px;
  border-radius: var(--radius-full);
  z-index: -1;
  pointer-events: none;
  filter: blur(140px);
  opacity: 0.25;
}

body::before {
  top: -100px;
  right: -200px;
  background: radial-gradient(circle, rgba(142, 28, 56, 0.3) 0%, rgba(255, 255, 255, 0) 70%);
}

body::after {
  bottom: 200px;
  left: -200px;
  background: radial-gradient(circle, rgba(18, 20, 22, 0.15) 0%, rgba(255, 255, 255, 0) 70%);
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.25;
  color: var(--dark);
}

a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition-fast);
}

/* --- Header Section (Modernized) --- */
.header {
  width: 100%;
  background: var(--white);
  border-bottom: 1px solid var(--gray-medium);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(10px);
}

.header-banner {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: var(--white);
  padding: 18px 0;
  position: relative;
  overflow: hidden;
}

.header-banner::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -30%;
  width: 80%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0) 60%);
  transform: rotate(-15deg);
  pointer-events: none;
}

.header-banner-container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Brand Logo Styling */
.brand {
  display: flex;
  align-items: center;
  gap: 16px;
  position: relative;
  z-index: 2;
}

.brand-icon-wrapper {
  background: rgba(255, 255, 255, 0.15);
  padding: 10px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: var(--transition-smooth);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.brand:hover .brand-icon-wrapper {
  transform: scale(1.05) rotate(-3deg);
  background: rgba(255, 255, 255, 0.25);
  box-shadow: var(--shadow-glow);
}

.brand-logo-svg {
  width: 32px;
  height: 32px;
  fill: var(--white);
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-size: 22px;
  letter-spacing: 2px;
  font-weight: 700;
  text-transform: uppercase;
}

.brand-subname {
  font-size: 10px;
  letter-spacing: 4px;
  text-transform: uppercase;
  opacity: 0.7;
  font-weight: 500;
  margin-top: -2px;
}

/* Language Switcher */
.lang-switcher {
  display: flex;
  gap: 16px;
  align-items: center;
  z-index: 2;
}

.lang-link {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  opacity: 0.8;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  transition: var(--transition-fast);
  border: 1px solid transparent;
}

.lang-link:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.lang-link.active {
  opacity: 1;
  background: var(--white);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.flag-icon {
  width: 18px;
  height: auto;
  border-radius: 2px;
}

/* Navigation Bar */
.nav-bar {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 64px;
}

.nav-links {
  display: flex;
  gap: 8px;
  height: 100%;
  align-items: center;
}

.nav-link {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 10px 24px;
  border-radius: var(--radius-sm);
  transition: var(--transition-smooth);
  color: var(--gray-dark);
  position: relative;
}

.nav-link:hover {
  color: var(--primary);
  background: var(--gray-light);
}

.nav-link.active {
  background: var(--primary);
  color: var(--white);
  box-shadow: 0 4px 12px rgba(142, 28, 56, 0.2);
}

/* Mobile Nav Toggle */
.mobile-nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-sm);
}

.mobile-nav-toggle:hover {
  background: var(--gray-light);
}

.burger-bar {
  display: block;
  width: 22px;
  height: 2px;
  background-color: var(--dark);
  margin: 5px 0;
  transition: var(--transition-smooth);
}

/* --- Main Layout --- */
.main-content {
  flex: 1;
  max-width: var(--container-width);
  width: 100%;
  margin: 48px auto 80px auto;
  padding: 0 24px;
}

/* Section Header styling */
.section-title-wrapper {
  text-align: center;
  margin-bottom: 48px;
  position: relative;
}

.section-title {
  font-size: 32px;
  letter-spacing: 4px;
  text-transform: uppercase;
  display: inline-block;
  padding-bottom: 12px;
  position: relative;
  font-weight: 700;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: var(--primary);
  border-radius: var(--radius-full);
}

/* --- Service Cards Grid --- */
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
}

.service-card {
  background: var(--white);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 32px;
  transition: var(--transition-smooth);
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.service-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 0;
  background: var(--primary);
  transition: var(--transition-smooth);
}

.service-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(142, 28, 56, 0.15);
}

.service-card:hover::before {
  height: 100%;
}

.service-icon-container {
  background: rgba(142, 28, 56, 0.05);
  color: var(--primary);
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  transition: var(--transition-smooth);
}

.service-card:hover .service-icon-container {
  background: var(--primary);
  color: var(--white);
  transform: scale(1.05);
}

.service-icon {
  width: 28px;
  height: 28px;
  fill: currentColor;
}

.service-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 14px;
  letter-spacing: 0.5px;
  color: var(--dark);
}

.service-desc {
  font-size: 14px;
  color: var(--gray-dark);
  line-height: 1.7;
  font-weight: 400;
}

/* --- Contact Layout --- */
.contact-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 50px;
  align-items: start;
}

.contact-info-card {
  background: var(--white);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: var(--shadow-md);
}

.company-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 24px;
  color: var(--primary);
}

.contact-details {
  margin-bottom: 32px;
}

.contact-item {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.contact-item-icon {
  color: var(--primary);
  width: 20px;
  height: 20px;
  margin-top: 3px;
  flex-shrink: 0;
}

.contact-item-text {
  font-size: 15px;
  color: var(--dark);
}

.contact-item-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--gray-dark);
  margin-bottom: 2px;
}

/* Map Embed Modern Styling */
.map-container {
  width: 100%;
  height: 280px;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-medium);
  transition: var(--transition-smooth);
}

.map-container:hover {
  box-shadow: var(--shadow-md);
}

.map-container iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

/* Contact Form Styling */
.contact-form-card {
  background: var(--white);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: var(--shadow-md);
}

.form-group {
  margin-bottom: 24px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--gray-dark);
  margin-bottom: 8px;
}

.form-input, .form-textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--gray-medium);
  border-radius: var(--radius-sm);
  background-color: var(--light);
  font-family: var(--font-sans);
  font-size: 15px;
  color: var(--dark);
  transition: var(--transition-fast);
}

.form-input:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  background-color: var(--white);
  box-shadow: 0 0 0 4px rgba(142, 28, 56, 0.08);
}

.form-textarea {
  resize: vertical;
  min-height: 150px;
}

.btn-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  padding: 14px 28px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  transition: var(--transition-smooth);
  box-shadow: 0 4px 15px rgba(142, 28, 56, 0.25);
}

.btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(142, 28, 56, 0.4);
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
}

.btn-submit:active {
  transform: translateY(0);
}

/* Toast Success Alert */
.success-toast {
  display: none;
  margin-top: 16px;
  padding: 12px 16px;
  background-color: #E6F4EA;
  color: #137333;
  border: 1px solid #CEEAD6;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  transition: var(--transition-smooth);
}

/* --- Footer (Modernized) --- */
.footer {
  background-color: var(--dark);
  color: rgba(255, 255, 255, 0.6);
  padding: 40px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  margin-top: auto;
  position: relative;
  overflow: hidden;
}

.footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80%;
  height: 1px;
  background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.1) 50%, rgba(255,255,255,0) 100%);
}

.footer-container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  text-align: center;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.footer-logo-svg {
  width: 24px;
  height: 24px;
  fill: rgba(255, 255, 255, 0.4);
}

.footer-brand-name {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--white);
}

.footer-copyright {
  font-size: 12px;
  letter-spacing: 0.5px;
}

/* --- Responsive Media Queries --- */
@media (max-width: 992px) {
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }
  
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }
}

@media (max-width: 768px) {
  .header-banner {
    padding: 14px 0;
  }
  
  .brand-name {
    font-size: 18px;
  }
  
  .brand-subname {
    font-size: 9px;
  }
  
  .nav-bar {
    height: 56px;
  }
  
  .mobile-nav-toggle {
    display: block;
    z-index: 101;
  }
  
  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: var(--white);
    flex-direction: column;
    padding: 80px 24px 24px 24px;
    box-shadow: -10px 0 30px rgba(0,0,0,0.1);
    transition: var(--transition-smooth);
    z-index: 100;
    align-items: flex-start;
  }
  
  .nav-links.active {
    right: 0;
  }
  
  .nav-link {
    width: 100%;
    padding: 12px 16px;
  }
  
  .services-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .main-content {
    margin: 32px auto 60px auto;
  }
  
  .section-title {
    font-size: 26px;
  }
  
  /* Burger Animation */
  .mobile-nav-toggle.active .burger-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }
  .mobile-nav-toggle.active .burger-bar:nth-child(2) {
    opacity: 0;
  }
  .mobile-nav-toggle.active .burger-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }
}
