/* ============================================
   Konoha Masks - 木の葉マスク
   Design System & Global Styles
   ============================================ */

/* ---------- CSS Custom Properties ---------- */
:root {
  /* Colors - Nature-inspired palette */
  --color-primary: #4a7c59;
  --color-primary-dark: #3a6347;
  --color-primary-light: #6b9e7a;
  --color-accent: #8cb369;
  --color-green-deep: #2d5a3d;
  --color-green-muted: #a3c585;
  --color-cream: #f8f6f0;
  --color-cream-warm: #faf8f2;
  --color-white: #ffffff;
  --color-text: #3a3a3a;
  --color-text-light: #6b6b6b;
  --color-text-muted: #8a8a8a;
  --color-border: #e0ddd5;
  --color-overlay: rgba(0, 0, 0, 0.03);

  /* Typography */
  --font-jp: 'Noto Sans JP', 'Hiragino Kaku Gothic ProN', 'Yu Gothic', sans-serif;
  --font-en: 'Inter', sans-serif;
  --font-serif: 'Noto Serif JP', serif;

  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2.5rem;
  --space-xl: 4rem;
  --space-2xl: 6rem;
  --space-3xl: 8rem;

  /* Layout */
  --max-width: 1200px;
  --nav-height: 80px;

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.45, 0, 0.55, 1);
  --duration-fast: 0.2s;
  --duration-normal: 0.4s;
  --duration-slow: 0.8s;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 16px 50px rgba(0, 0, 0, 0.12);
}

/* ---------- Reset & Base ---------- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-jp);
  color: var(--color-text);
  background-color: var(--color-white);
  line-height: 1.8;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  text-decoration: none;
  color: inherit;
  transition: color var(--duration-fast) var(--ease-out);
}

ul {
  list-style: none;
}

/* ---------- Utility ---------- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.section-divider {
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
  margin: var(--space-md) auto;
  border-radius: 1px;
}

/* ---------- Scroll Reveal Animations ---------- */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-left {
  opacity: 0;
  transform: translateX(-60px);
  transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
}

.reveal-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.reveal-right {
  opacity: 0;
  transform: translateX(60px);
  transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
}

.reveal-right.visible {
  opacity: 1;
  transform: translateX(0);
}

.reveal-scale {
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
}

.reveal-scale.visible {
  opacity: 1;
  transform: scale(1);
}

/* ---------- Navigation ---------- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--nav-height);
  z-index: 1000;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid transparent;
  transition: all var(--duration-normal) var(--ease-out);
}

.navbar.scrolled {
  background: rgba(255, 255, 255, 0.97);
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.nav-logo {
  height: 60px;
  width: auto;
  transition: transform var(--duration-normal) var(--ease-out);
}

.nav-logo:hover {
  transform: scale(1.03);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.nav-links a {
  font-size: 0.9rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  color: var(--color-text);
  position: relative;
  padding: 0.25rem 0;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
  border-radius: 1px;
  transition: width var(--duration-normal) var(--ease-out);
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

.nav-links a:hover {
  color: var(--color-primary);
}

/* Mobile Nav Toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 5px;
  background: none;
  border: none;
  z-index: 1001;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-text);
  border-radius: 2px;
  transition: all var(--duration-normal) var(--ease-out);
}

.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: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.4) 0%,
    rgba(255, 255, 255, 0.1) 50%,
    rgba(255, 255, 255, 0.3) 100%
  );
}

.hero .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-xl);
}

.hero-content {
  position: relative;
  z-index: 1;
  padding: calc(var(--nav-height) + var(--space-3xl)) 0 var(--space-3xl);
  max-width: 600px;
  flex-shrink: 0;
}

.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  font-weight: 700;
  line-height: 1.35;
  color: var(--color-text);
  margin-bottom: var(--space-lg);
  letter-spacing: 0.02em;
}

.hero-subtitle {
  font-size: clamp(0.9rem, 1.5vw, 1.05rem);
  line-height: 2;
  color: var(--color-text-light);
  max-width: 480px;
}

.hero-mask {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  max-width: 475px;
  filter: drop-shadow(0 16px 40px rgba(0, 0, 0, 0.15));
  animation: heroMaskFloat 6s ease-in-out infinite;
}

.hero-mask img {
  width: 100%;
  height: auto;
}

@keyframes heroMaskFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-15px) rotate(2deg); }
}

/* Floating leaf decorations */
.hero .leaf-float {
  position: absolute;
  opacity: 0.08;
  animation: leafFloat 12s ease-in-out infinite;
  pointer-events: none;
}

@keyframes leafFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  33% { transform: translateY(-20px) rotate(5deg); }
  66% { transform: translateY(-10px) rotate(-3deg); }
}

/* ---------- Section Headers ---------- */
.section-header {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.section-header h2 {
  font-family: var(--font-serif);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--color-text);
}

/* ---------- Products Section ---------- */
.products {
  padding: var(--space-3xl) 0;
  background: var(--color-white);
}

/* Product Card */
.product-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: var(--space-xl);
  margin-bottom: var(--space-3xl);
  position: relative;
}

.product-card:last-child {
  margin-bottom: 0;
}

.product-card.reverse {
  direction: rtl;
}

.product-card.reverse > * {
  direction: ltr;
}

.product-image-wrapper {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
}

.product-bg {
  width: 100%;
  height: 100%;
  min-height: 350px;
  object-fit: cover;
  border-radius: 16px;
}

.product-mask {
  position: absolute;
  width: 80%;
  max-width: 400px;
  bottom: 5%;
  left: 0;
  right: 0;
  margin: 0 auto;
  filter: drop-shadow(0 12px 30px rgba(0, 0, 0, 0.12));
  transition: transform var(--duration-slow) var(--ease-out);
}

.product-card:hover .product-mask {
  transform: translateY(-8px) scale(1.02);
}

.product-info {
  padding: var(--space-lg);
}

.product-name {
  font-family: var(--font-serif);
  font-size: clamp(1.4rem, 2.5vw, 1.9rem);
  font-weight: 600;
  margin-bottom: var(--space-xs);
  color: var(--color-text);
  letter-spacing: 0.05em;
}

.product-subtitle {
  font-size: 0.95rem;
  color: var(--color-primary);
  font-weight: 500;
  margin-bottom: var(--space-md);
  letter-spacing: 0.03em;
}

.product-description {
  font-size: 0.92rem;
  line-height: 2;
  color: var(--color-text-light);
}

/* Green decorative line for product cards */
.product-info::before {
  content: '';
  display: block;
  width: 40px;
  height: 3px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
  border-radius: 2px;
  margin-bottom: var(--space-md);
}

/* ---------- Philosophy Section ---------- */
.philosophy {
  position: relative;
  padding: var(--space-3xl) 0;
  overflow: hidden;
}

.philosophy-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.philosophy-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.philosophy-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.88) 0%,
    rgba(255, 255, 255, 0.75) 100%
  );
}

.philosophy .container {
  position: relative;
  z-index: 1;
}

.philosophy-title {
  font-family: var(--font-serif);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 600;
  text-align: center;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-lg);
  color: var(--color-text);
}

.philosophy-text {
  font-size: 0.95rem;
  line-height: 2.2;
  color: var(--color-text-light);
  max-width: 700px;
  margin: 0 auto var(--space-2xl);
  text-align: center;
}

.philosophy-icons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-xl);
  max-width: 800px;
  margin: 0 auto;
}

.philosophy-icon-item {
  text-align: center;
  transition: transform var(--duration-normal) var(--ease-out);
}

.philosophy-icon-item:hover {
  transform: translateY(-6px);
}

.philosophy-icon-img {
  width: 90px;
  height: 90px;
  margin: 0 auto var(--space-md);
  border-radius: 50%;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.7);
  box-shadow: var(--shadow-md);
  transition: box-shadow var(--duration-normal) var(--ease-out);
}

.philosophy-icon-item:hover .philosophy-icon-img {
  box-shadow: var(--shadow-lg);
}

.philosophy-icon-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.philosophy-icon-text {
  font-size: 0.82rem;
  line-height: 1.8;
  color: var(--color-text-light);
}

/* ---------- Coverage / Map Section ---------- */
.coverage {
  padding: var(--space-3xl) 0;
  background: var(--color-cream-warm);
}

.coverage-title {
  font-family: var(--font-serif);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 600;
  text-align: center;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-md);
  color: var(--color-text);
}

.coverage-subtitle {
  font-size: 0.92rem;
  line-height: 2;
  color: var(--color-text-light);
  max-width: 700px;
  margin: 0 auto var(--space-2xl);
  text-align: center;
}

.coverage-map-wrapper {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
}

.coverage-map {
  width: 100%;
  border-radius: 16px;
  box-shadow: var(--shadow-md);
}

/* Map Pins */
.map-pins {
  position: absolute;
  inset: 0;
}

.map-pin {
  position: absolute;
  cursor: pointer;
}

.map-pin .pin-dot {
  width: 12px;
  height: 12px;
  background: var(--color-primary);
  border-radius: 50%;
  border: 2px solid var(--color-white);
  box-shadow: var(--shadow-md);
  position: relative;
  z-index: 2;
  transition: transform var(--duration-fast) var(--ease-out);
}

.map-pin:hover .pin-dot {
  transform: scale(1.3);
}

.map-pin .pin-pulse {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 24px;
  height: 24px;
  background: rgba(74, 124, 89, 0.25);
  border-radius: 50%;
  animation: pinPulse 2s ease-out infinite;
}

@keyframes pinPulse {
  0% { transform: translate(-50%, -50%) scale(0.5); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(2); opacity: 0; }
}

.map-pin .pin-label {
  position: absolute;
  white-space: nowrap;
  background: var(--color-white);
  padding: var(--space-sm) var(--space-md);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transition: all var(--duration-normal) var(--ease-out);
  z-index: 3;
  min-width: 180px;
}

.map-pin:hover .pin-label,
.map-pin.active .pin-label {
  opacity: 1;
  pointer-events: auto;
}

.map-pin .pin-label h4 {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--color-primary);
}

.map-pin .pin-label p {
  font-size: 0.78rem;
  line-height: 1.6;
  color: var(--color-text-light);
}

/* Pin positions */
.map-pin.europe {
  top: 36%;
  left: 54%;
}

.map-pin.europe .pin-label {
  bottom: calc(100% + 10px);
  left: -20px;
}

.map-pin.asia {
  top: 64%;
  left: 75%;
}

.map-pin.asia .pin-label {
  bottom: calc(100% + 10px);
  left: -20px;
}

.map-pin.japan {
  top: 51%;
  left: 88%;
}

.map-pin.japan .pin-label {
  bottom: calc(100% + 10px);
  right: -20px;
  left: auto;
}

/* Region Cards (hidden on desktop, shown on mobile) */
.region-cards {
  display: none;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
  margin-top: var(--space-xl);
}

.region-card {
  background: var(--color-white);
  border-radius: 16px;
  padding: var(--space-lg);
  box-shadow: var(--shadow-sm);
  transition: all var(--duration-normal) var(--ease-out);
  border: 1px solid rgba(0, 0, 0, 0.04);
}

.region-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.region-card h4 {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: var(--space-xs);
}

.region-card p {
  font-size: 0.82rem;
  line-height: 1.9;
  color: var(--color-text-light);
}

/* ---------- Contact Section ---------- */
.contact {
  position: relative;
  padding: var(--space-3xl) 0;
  overflow: hidden;
}

.contact-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.contact-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.contact-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.9) 0%,
    rgba(255, 255, 255, 0.8) 100%
  );
}

.contact .container {
  position: relative;
  z-index: 1;
}

.contact-content {
  max-width: 600px;
}

.contact-title {
  font-family: var(--font-serif);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 600;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-lg);
  color: var(--color-text);
}

.contact-text {
  font-size: 0.92rem;
  line-height: 2;
  color: var(--color-text-light);
  margin-bottom: var(--space-xl);
}

.contact-email {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 1rem;
  color: var(--color-text);
  font-weight: 500;
  padding: var(--space-sm) var(--space-lg);
  background: var(--color-white);
  border-radius: 50px;
  box-shadow: var(--shadow-md);
  transition: all var(--duration-normal) var(--ease-out);
  letter-spacing: 0.02em;
}

.contact-email:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  color: var(--color-primary);
}

.contact-email img {
  width: 22px;
  height: auto;
}

/* ---------- Footer ---------- */
.footer {
  padding: var(--space-lg) 0;
  background: var(--color-cream);
  border-top: 1px solid var(--color-border);
}

.footer .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-logo {
  height: 65px;
  width: auto;
}

.footer-text {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  letter-spacing: 0.03em;
}

/* ---------- Scroll-to-Top Button ---------- */
.scroll-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--color-primary);
  color: var(--color-white);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all var(--duration-normal) var(--ease-out);
  box-shadow: var(--shadow-lg);
  z-index: 999;
}

.scroll-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.scroll-top:hover {
  background: var(--color-primary-dark);
  transform: translateY(-3px);
  box-shadow: var(--shadow-xl);
}

.scroll-top svg {
  width: 20px;
  height: 20px;
}

/* ---------- Loading / Page Entrance ---------- */
.page-loader {
  position: fixed;
  inset: 0;
  background: var(--color-white);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.6s var(--ease-out), visibility 0.6s;
}

.page-loader.hidden {
  opacity: 0;
  visibility: hidden;
}

.loader-leaf {
  width: 40px;
  height: 40px;
  animation: loaderSpin 1.2s linear infinite;
}

@keyframes loaderSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .product-card {
    gap: var(--space-lg);
  }

  .philosophy-icons {
    gap: var(--space-lg);
  }
}

@media (max-width: 768px) {
  :root {
    --nav-height: 64px;
  }

  .nav-toggle {
    display: flex;
  }

  .nav-links {
    position: fixed;
    top: 0;
    right: 0;
    width: 280px;
    height: 100vh;
    flex-direction: column;
    justify-content: center;
    gap: var(--space-lg);
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    transform: translateX(100%);
    transition: transform var(--duration-normal) var(--ease-out);
    box-shadow: -8px 0 30px rgba(0, 0, 0, 0.08);
  }

  .nav-links.open {
    transform: translateX(0);
  }

  .nav-links a {
    font-size: 1.05rem;
  }

  /* Hero */
  .hero {
    min-height: 85vh;
  }

  .hero .container {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-mask {
    max-width: 250px;
    align-self: center;
  }

  .hero-content {
    padding: calc(var(--nav-height) + var(--space-xl)) var(--space-sm) var(--space-sm);
  }

  /* Products */
  .product-card {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
    margin-bottom: var(--space-2xl);
  }

  .product-card.reverse {
    direction: ltr;
  }

  .product-mask {
    width: 55%;
  }

  .product-bg {
    min-height: 280px;
  }

  /* Philosophy */
  .philosophy-icons {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
    max-width: 300px;
  }

  /* Coverage */
  .region-cards {
    display: grid;
    grid-template-columns: 1fr;
  }

  /* Footer */
  .footer .container {
    flex-direction: column;
    gap: var(--space-sm);
    text-align: center;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 1.8rem;
  }

  .section-header h2,
  .philosophy-title,
  .coverage-title,
  .contact-title {
    font-size: 1.4rem;
  }

  .product-name {
    font-size: 1.2rem;
  }

  .philosophy-icon-img {
    width: 70px;
    height: 70px;
  }
}
