/**
 * ELSPINA holdings - Custom Styles
 */

/* ========================================
   Base Styles
   ======================================== */

html {
  scroll-behavior: smooth;
}

/* ========================================
   Background Patterns
   ======================================== */

.bg-grid {
  background-image:
    linear-gradient(rgba(0, 102, 179, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 102, 179, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
}

.bg-grid-dark {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 60px 60px;
}

/* ========================================
   Header Styles & Scroll Effect
   ======================================== */

#header {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

#header.scrolled {
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Header inner shrink on scroll */
#header .header-inner {
  transition: padding 0.3s ease, height 0.3s ease;
}

#header.scrolled .header-inner {
  padding-top: 0.4rem;
  padding-bottom: 0.4rem;
}

@media (min-width: 768px) {
  #header .header-inner {
    padding-top: 1rem;
    padding-bottom: 1rem;
  }
  #header.scrolled .header-inner {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
  }
}

/* Logo shrink on scroll */
.header-logo {
  transition: height 0.3s ease;
}

#header.scrolled .header-logo {
  height: 1.75rem; /* h-7 */
}

@media (min-width: 768px) {
  #header.scrolled .header-logo {
    height: 2rem; /* h-8 */
  }
}

.header-logotype {
  transition: height 0.3s ease, opacity 0.3s ease;
}

#header.scrolled .header-logotype {
  height: 0.7rem;
  opacity: 0.85;
}

/* Mobile Menu */
#mobileMenu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

#mobileMenu:not(.hidden) {
  max-height: 320px;
}

/* ========================================
   Animations
   ======================================== */

.fade-in {
  animation: fadeIn 0.8s ease-out forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }
.stagger-5 { animation-delay: 0.5s; }

/* ========================================
   Scroll Animations
   ======================================== */

.scroll-fade-in,
.scroll-slide-up,
.scroll-slide-left,
.scroll-slide-right {
  opacity: 0;
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.scroll-fade-in { transform: translateY(0); }
.scroll-slide-up { transform: translateY(30px); }
.scroll-slide-left { transform: translateX(30px); }
.scroll-slide-right { transform: translateX(-30px); }

.scroll-fade-in.is-visible,
.scroll-slide-up.is-visible,
.scroll-slide-left.is-visible,
.scroll-slide-right.is-visible {
  opacity: 1;
  transform: translate(0, 0);
}

.stagger-children > *:nth-child(1) { transition-delay: 0s; }
.stagger-children > *:nth-child(2) { transition-delay: 0.1s; }
.stagger-children > *:nth-child(3) { transition-delay: 0.15s; }
.stagger-children > *:nth-child(4) { transition-delay: 0.2s; }
.stagger-children > *:nth-child(5) { transition-delay: 0.25s; }
.stagger-children > *:nth-child(6) { transition-delay: 0.3s; }

/* ========================================
   Service / Group Cards
   ======================================== */

.service-card {
  position: relative;
  overflow: hidden;
}

.service-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #0066b3 0%, #0073e6 100%);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.service-card:hover::before {
  transform: scaleX(1);
}

/* ========================================
   Form Styles
   ======================================== */

input:focus,
textarea:focus,
select:focus {
  outline: none;
}

input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  box-shadow: 0 0 0 3px rgba(0, 102, 179, 0.15);
}

/* ========================================
   Placeholder frames (image TBD)
   ======================================== */

.placeholder-frame {
  width: 100%;
  background: repeating-linear-gradient(
    45deg,
    #f1f5f9,
    #f1f5f9 12px,
    #e2e8f0 12px,
    #e2e8f0 24px
  );
  border: 2px dashed #cbd5e1;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.placeholder-frame .placeholder-label {
  font-family: "Noto Sans JP", sans-serif;
  font-size: 12px;
  color: #64748b;
  background: rgba(255, 255, 255, 0.85);
  padding: 4px 10px;
  border-radius: 999px;
}

/* ========================================
   Variant switching (dev preview)
   ======================================== */

body[data-variant="wireframe"] [data-variant-only="arranged"] { display: none !important; }
body[data-variant="arranged"]  [data-variant-only="wireframe"] { display: none !important; }

/* Variant toggle — bottom-right floating panel */
#variantToggle {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 100;
  background: rgba(15, 23, 42, 0.92);
  color: #fff;
  border-radius: 999px;
  padding: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-family: "Noto Sans JP", sans-serif;
  font-size: 12px;
}

#variantToggle button {
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

#variantToggle button:hover {
  color: #fff;
}

#variantToggle button.is-active {
  background: #0066b3;
  color: #fff;
}

#variantToggle .label {
  padding: 0 8px 0 12px;
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: 0.08em;
  font-size: 10px;
  text-transform: uppercase;
}

/* ========================================
   Misc
   ======================================== */

img {
  opacity: 1;
  transition: opacity 0.3s ease;
}

img[data-src] {
  opacity: 0;
}

::selection {
  background: rgba(0, 102, 179, 0.2);
  color: inherit;
}

@media print {
  .fade-in,
  .scroll-fade-in,
  .scroll-slide-up,
  .scroll-slide-left,
  .scroll-slide-right {
    opacity: 1 !important;
    transform: none !important;
  }
  header,
  footer,
  #variantToggle {
    display: none;
  }
}
