/* Header - 2025 Dynamic Typography Design
   ================================================== */
@layer base, layout, components, utilities, pages;

@layer components {

/* Variables */
.im-header {
  --h-bg: rgba(255,255,255,.97);
  --h-text: #111;
  --h-muted: #666;
  --h-accent: #0055cc;
  --h-border: rgba(0,0,0,.06);
  --h-font-ja: "Noto Sans JP","Hiragino Kaku Gothic ProN",sans-serif;
  --h-font-en: "Inter","Helvetica Neue",Arial,sans-serif;
  --h-max: var(--content-max,1200px);
  --h-gutter: var(--gutter,clamp(16px,4vw,32px));
}

/* ===========================================
   Header Bar
   =========================================== */
.im-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--h-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--h-border);
  transition: box-shadow .3s;
}

.im-header.is-scrolled { box-shadow: 0 4px 30px rgba(0,0,0,.08); }

.im-header__inner {
  max-width: var(--h-max);
  margin: 0 auto;
  padding: 12px var(--h-gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

/* Brand */
.im-header__brand-group { display: flex; align-items: center; gap: 16px; }

.im-header__logo {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  transition: opacity .2s;
}
.im-header__logo:hover { opacity: .7; }
.im-header__logo img { display: block; height: clamp(28px,3vw,40px); width: auto; }

.im-header__operator {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 16px;
  border-left: 1px solid var(--h-border);
}

.im-header__operator-label {
  font: 500 9px/1 var(--h-font-ja);
  color: var(--h-muted);
  letter-spacing: .08em;
}

.im-header__operator-link { display: inline-flex; transition: opacity .2s; }
.im-header__operator-link:hover { opacity: .7; }
.im-header__operator-link img { display: block; height: 16px; width: auto; }

/* Controls */
.im-header__controls {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-left: auto;
}

.im-header__nav-inline { display: flex; }

.im-header__menu-inline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 2px;
}

.im-header__menu-inline a {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  font: 500 13px/1 var(--h-font-ja);
  color: var(--h-text);
  text-decoration: none;
  border-radius: 8px;
  transition: all .2s;
}
.im-header__menu-inline a:hover,
.im-header__menu-inline a[aria-current="page"] {
  color: var(--h-accent);
  background: rgba(0,85,204,.06);
}

/* CTA Buttons */
.im-header__actions { display: flex; align-items: center; gap: 8px; }

.im-header__actions .btn {
  font: 600 12px/1 var(--h-font-ja);
  padding: 10px 16px;
  border-radius: 8px;
  transition: all .2s;
}

.im-header__cta {
  background: #fff;
  color: var(--h-accent);
  border: 1px solid var(--h-accent);
}
.im-header__cta:hover { background: var(--h-accent); color: #fff; }

.im-header__actions .btn--primary {
  background: var(--h-accent);
  color: #fff;
  border: 1px solid var(--h-accent);
}
.im-header__actions .btn--primary:hover { background: #003d99; border-color: #003d99; }

/* Hamburger */
.im-header__toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background .2s;
}
.im-header__toggle:hover { background: rgba(0,0,0,.04); }

.im-header__burger { position: relative; width: 20px; height: 14px; }

.im-header__burger span {
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--h-text);
  border-radius: 2px;
  transition: all .3s;
}
.im-header__burger span:nth-child(1) { top: 0; }
.im-header__burger span:nth-child(2) { top: 6px; }
.im-header__burger span:nth-child(3) { bottom: 0; }

.im-header.is-open .im-header__burger span:nth-child(1) { top: 6px; transform: rotate(45deg); }
.im-header.is-open .im-header__burger span:nth-child(2) { opacity: 0; }
.im-header.is-open .im-header__burger span:nth-child(3) { bottom: 6px; transform: rotate(-45deg); }

/* ===========================================
   Fullscreen Navigation - 2025 Dynamic Style
   =========================================== */
.im-fullnav {
  --nav-bg: #fafafa;
  --nav-text: #111;
  --nav-muted: #777;
  --nav-accent: #0055cc;
  --nav-gutter: clamp(20px,5vw,60px);

  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--nav-bg);
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transition: opacity .4s cubic-bezier(.4,0,.2,1),visibility .4s;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.im-fullnav.is-active { opacity: 1; visibility: visible; }

/* Header */
.im-fullnav__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px var(--nav-gutter);
  min-height: 64px;
  flex-shrink: 0;
  background: #fff;
  border-bottom: 1px solid rgba(0,0,0,.06);
}

.im-fullnav__logo {
  display: inline-flex;
  align-items: center;
  height: 40px;
  transition: opacity .2s;
}
.im-fullnav__logo:hover { opacity: .7; }
.im-fullnav__logo img { height: clamp(28px,3vw,40px); width: auto; }

/* Close Button - Dynamic Circle */
.im-fullnav__close {
  position: relative;
  width: 44px;
  height: 44px;
  padding: 0;
  background: var(--nav-text);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform .4s cubic-bezier(.34,1.56,.64,1),background .3s;
  overflow: hidden;
}
.im-fullnav__close::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--nav-accent);
  border-radius: 50%;
  transform: scale(0);
  transition: transform .4s cubic-bezier(.34,1.56,.64,1);
}
.im-fullnav__close:hover { transform: rotate(90deg); }
.im-fullnav__close:hover::before { transform: scale(1); }

.im-fullnav__close span {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 2px;
  background: #fff;
  border-radius: 1px;
  z-index: 1;
}
.im-fullnav__close span:first-child { transform: translate(-50%,-50%) rotate(45deg); }
.im-fullnav__close span:last-child { transform: translate(-50%,-50%) rotate(-45deg); }

/* Body */
.im-fullnav__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 48px var(--nav-gutter) 32px;
}

/* Menu - Dynamic Split Layout */
.im-fullnav__menu {
  list-style: none;
  margin: 0;
  padding: 0;
  width: 100%;
  max-width: 1000px;
  display: grid;
  grid-template-columns: repeat(2,1fr);
  gap: 0;
}

.im-fullnav__item {
  border-bottom: 1px solid rgba(0,0,0,.07);
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .6s cubic-bezier(.4,0,.2,1),transform .6s cubic-bezier(.4,0,.2,1);
}

.im-fullnav__item:nth-child(odd) { border-right: 1px solid rgba(0,0,0,.07); }

.im-fullnav.is-active .im-fullnav__item { opacity: 1; transform: translateY(0); }

/* Stagger Animation */
.im-fullnav.is-active .im-fullnav__item:nth-child(1) { transition-delay: .05s; }
.im-fullnav.is-active .im-fullnav__item:nth-child(2) { transition-delay: .1s; }
.im-fullnav.is-active .im-fullnav__item:nth-child(3) { transition-delay: .15s; }
.im-fullnav.is-active .im-fullnav__item:nth-child(4) { transition-delay: .2s; }
.im-fullnav.is-active .im-fullnav__item:nth-child(5) { transition-delay: .25s; }
.im-fullnav.is-active .im-fullnav__item:nth-child(6) { transition-delay: .3s; }
.im-fullnav.is-active .im-fullnav__item:nth-child(7) { transition-delay: .35s; }
.im-fullnav.is-active .im-fullnav__item:nth-child(8) { transition-delay: .4s; }
.im-fullnav.is-active .im-fullnav__item:nth-child(9) { transition-delay: .45s; }
.im-fullnav.is-active .im-fullnav__item:nth-child(10) { transition-delay: .5s; }

/* Link */
.im-fullnav__link {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 28px 32px;
  text-decoration: none;
  position: relative;
  transition: background .3s,padding-left .3s cubic-bezier(.34,1.56,.64,1);
  overflow: hidden;
}

.im-fullnav__link::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  background: var(--nav-accent);
  transition: width .3s cubic-bezier(.4,0,.2,1);
}

.im-fullnav__link:hover { background: #fff; padding-left: 40px; }
.im-fullnav__link:hover::before { width: 4px; }

/* English - Sub */
.im-fullnav__en {
  font: 600 10px/1 var(--h-font-en);
  color: var(--nav-muted);
  letter-spacing: .15em;
  text-transform: uppercase;
  transition: color .3s,transform .3s;
}

/* Japanese - Main */
.im-fullnav__ja {
  font: 700 clamp(18px,2.5vw,26px)/1.3 var(--h-font-ja);
  color: var(--nav-text);
  transition: color .3s,transform .3s;
}

/* Arrow - Dynamic Circle */
.im-fullnav__arrow {
  position: absolute;
  right: 24px;
  top: 50%;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(0,0,0,.1);
  border-radius: 50%;
  transform: translateY(-50%);
  transition: all .4s cubic-bezier(.34,1.56,.64,1);
}

.im-fullnav__arrow::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 8px;
  border-top: 2px solid var(--nav-muted);
  border-right: 2px solid var(--nav-muted);
  transform: translate(-60%,-50%) rotate(45deg);
  transition: border-color .3s,transform .3s;
}

.im-fullnav__link:hover .im-fullnav__en { color: var(--nav-accent); }
.im-fullnav__link:hover .im-fullnav__ja { color: var(--nav-accent); }
.im-fullnav__link:hover .im-fullnav__arrow {
  background: var(--nav-accent);
  border-color: var(--nav-accent);
  transform: translateY(-50%) scale(1.1);
}
.im-fullnav__link:hover .im-fullnav__arrow::before {
  border-color: #fff;
  transform: translate(-50%,-50%) rotate(45deg);
}

/* Sub Links - Sitemap & Privacy */
.im-fullnav__sub {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin-top: 32px;
  padding-top: 24px;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .5s .5s,transform .5s .5s;
}

.im-fullnav.is-active .im-fullnav__sub {
  opacity: 1;
  transform: translateY(0);
}

.im-fullnav__sub-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: 500 13px/1 var(--h-font-ja);
  color: var(--nav-muted);
  text-decoration: none;
  padding: 8px 0;
  position: relative;
  transition: color .3s;
}

.im-fullnav__sub-link::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 4px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform .3s cubic-bezier(.4,0,.2,1);
}

.im-fullnav__sub-link:hover { color: var(--nav-text); }
.im-fullnav__sub-link:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* Footer */
.im-fullnav__footer {
  padding: 24px var(--nav-gutter) 32px;
  border-top: 1px solid rgba(0,0,0,.07);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-shrink: 0;
  background: #fff;
}

/* CTA - Dynamic Button */
.im-fullnav__cta { display: flex; gap: 12px; }

.im-fullnav__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 32px;
  font: 600 14px/1 var(--h-font-ja);
  text-decoration: none;
  border-radius: 100px;
  transition: all .4s cubic-bezier(.34,1.56,.64,1);
  position: relative;
  overflow: hidden;
}

.im-fullnav__btn svg {
  width: 18px;
  height: 18px;
  transition: transform .3s;
}

.im-fullnav__btn:not(.im-fullnav__btn--primary) {
  background: var(--nav-bg);
  color: var(--nav-text);
  border: 1px solid rgba(0,0,0,.12);
}
.im-fullnav__btn:not(.im-fullnav__btn--primary):hover {
  border-color: var(--nav-accent);
  color: var(--nav-accent);
}

.im-fullnav__btn--primary {
  background: var(--nav-accent);
  color: #fff;
  border: 2px solid var(--nav-accent);
  box-shadow: 0 4px 16px rgba(0,85,204,.2);
}
.im-fullnav__btn--primary:hover {
  background: #003d99;
  border-color: #003d99;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,85,204,.3);
}
.im-fullnav__btn--primary:hover svg { transform: translateX(4px); }

/* Contact */
.im-fullnav__contact { display: flex; align-items: center; gap: 16px; }

.im-fullnav__tel {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  background: var(--nav-text);
  color: #fff;
  font: 500 13px/1 var(--h-font-ja);
  border-radius: 100px;
  text-decoration: none;
  transition: all .3s;
}
.im-fullnav__tel:hover {
  background: var(--nav-accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0,85,204,.25);
}

.im-fullnav__tel svg { width: 18px; height: 18px; }

.im-fullnav__tel-number {
  font: 700 17px/1 var(--h-font-en);
  letter-spacing: .02em;
  font-feature-settings: "tnum";
}

/* Social - Branded Icons */
.im-fullnav__social { display: flex; gap: 10px; }

.im-fullnav__social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  transition: transform .4s cubic-bezier(.34,1.56,.64,1),box-shadow .3s;
}

.im-fullnav__social svg { width: 22px; height: 22px; }

.im-fullnav__social-ig {
  background: #E1306C;
  color: #fff;
}
.im-fullnav__social-ig:hover {
  transform: translateY(-4px) scale(1.05);
  box-shadow: 0 8px 20px rgba(225,48,108,.35);
}

.im-fullnav__social-yt {
  background: #f00;
  color: #fff;
}
.im-fullnav__social-yt:hover {
  transform: translateY(-4px) scale(1.05);
  box-shadow: 0 8px 20px rgba(255,0,0,.35);
}

/* Operator */
.im-fullnav__operator {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-left: 24px;
  border-left: 1px solid rgba(0,0,0,.08);
}

.im-fullnav__operator-label {
  font: 600 10px/1 var(--h-font-ja);
  color: var(--nav-muted);
  letter-spacing: .08em;
}

.im-fullnav__operator a { display: inline-flex; transition: opacity .2s,transform .3s; }
.im-fullnav__operator a:hover { opacity: .8; transform: scale(1.05); }
.im-fullnav__operator img { height: 20px; width: auto; }

/* ===========================================
   Responsive
   =========================================== */
@media (max-width: 1200px) {
  .im-header__nav-inline,
  .im-header__menu-inline { display: none; }
}

@media (max-width: 768px) {
  .im-header__operator,
  .im-header__actions { display: none; }

  .im-fullnav__body { padding: 32px var(--nav-gutter) 24px; }
  .im-fullnav__menu { grid-template-columns: 1fr; }
  .im-fullnav__item { border-right: none !important; }
  .im-fullnav__link { padding: 22px 24px; }
  .im-fullnav__link:hover { padding-left: 32px; }
  .im-fullnav__arrow { right: 20px; width: 32px; height: 32px; }

  .im-fullnav__sub { flex-direction: column; align-items: center; gap: 16px; margin-top: 24px; }

  .im-fullnav__footer {
    flex-direction: column;
    align-items: stretch;
    gap: 20px;
    padding: 20px var(--nav-gutter) 28px;
  }
  .im-fullnav__cta { flex-direction: column; }
  .im-fullnav__btn { width: 100%; padding: 18px 24px; }
  .im-fullnav__contact { flex-wrap: wrap; justify-content: center; gap: 12px; }
  .im-fullnav__tel { width: 100%; justify-content: center; }
  .im-fullnav__social { justify-content: center; }
  .im-fullnav__operator {
    border-left: none;
    padding-left: 0;
    justify-content: center;
    width: 100%;
    padding-top: 20px;
    border-top: 1px solid rgba(0,0,0,.06);
  }
}

/* ===========================================
   Accessibility
   =========================================== */
body.is-menu-open { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  .im-header,
  .im-fullnav,
  .im-fullnav__item,
  .im-fullnav__close,
  .im-fullnav__link,
  .im-fullnav__arrow,
  .im-fullnav__btn,
  .im-fullnav__sub { transition: none !important; }
}

}
