/* ==========================================================================
   Footer - 2025 Design Trends
   Bilingual Typography (English Primary + Japanese Sub)
   Matching Header Aesthetic
   ========================================================================== */

@layer base, layout, components, utilities, pages;

@layer components {

/* ==========================================================================
   1. CSS CUSTOM PROPERTIES
   ========================================================================== */

.im-footer {
  /* Typography */
  --font-display: 'Cormorant Garamond', serif;
  --font-body: 'Noto Sans JP', sans-serif;

  /* Colors */
  --footer-bg: #0f0f0f;
  --footer-bg-alt: #0a0a0a;
  --footer-text: #fafafa;
  --footer-text-muted: rgba(250, 250, 250, 0.5);
  --footer-link: rgba(250, 250, 250, 0.75);
  --footer-link-hover: #fff;
  --footer-accent: #c9a84c;
  --footer-accent-muted: rgba(201, 168, 76, 0.6);
  --footer-border: rgba(250, 250, 250, 0.08);

  /* Transitions */
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
  --duration-fast: 0.2s;
  --duration-normal: 0.35s;

  position: relative;
  background: var(--footer-bg);
  color: var(--footer-text);
  overflow: hidden;
}

/* Top accent line */
.im-footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--footer-accent) 30%,
    var(--footer-accent) 70%,
    transparent 100%
  );
  opacity: 0.6;
}


/* ==========================================================================
   2. MAIN SECTION
   ========================================================================== */

.im-footer__main {
  padding: clamp(56px, 10vw, 88px) 0;
}

.im-footer__container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 clamp(24px, 5vw, 56px);
}

.im-footer__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 48px;
}

@media (min-width: 1024px) {
  .im-footer__grid {
    grid-template-columns: 380px 1fr;
    gap: clamp(60px, 8vw, 120px);
    align-items: start;
  }
}


/* ==========================================================================
   3. BRAND SECTION
   ========================================================================== */

.im-footer__brand {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

/* Logo */
.im-footer__logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  transition: opacity var(--duration-fast) var(--ease-smooth);
}

.im-footer__logo:hover {
  opacity: 0.8;
}

.im-footer__logo img {
  max-width: 180px;
  height: auto;
  filter: brightness(0) invert(1);
  opacity: 0.9;
}

.im-footer__site-title {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2vw, 1.5rem);
  font-weight: 600;
  color: var(--footer-text);
  letter-spacing: 0.02em;
}


/* ==========================================================================
   4. COMPANY INFO
   ========================================================================== */

.im-footer__company {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Company Name - Bilingual */
.im-footer__company-name {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
}

.im-footer__company-name-en {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 500;
  font-style: italic;
  letter-spacing: 0.02em;
  color: var(--footer-accent);
  line-height: 1.2;
}

.im-footer__company-name-ja {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--footer-text-muted);
  line-height: 1.3;
}


/* ==========================================================================
   5. LOCATIONS
   ========================================================================== */

.im-footer__locations {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

@media (min-width: 480px) {
  .im-footer__locations {
    flex-direction: row;
    gap: 32px;
  }
}

.im-footer__location {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.im-footer__location-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.im-footer__location-en {
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 500;
  font-style: italic;
  letter-spacing: 0.02em;
  color: var(--footer-accent);
  line-height: 1.2;
}

.im-footer__location-ja {
  font-family: var(--font-body);
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--footer-text-muted);
  line-height: 1.3;
}

.im-footer__location-address {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 400;
  font-style: normal;
  letter-spacing: 0.02em;
  color: var(--footer-text);
  line-height: 1.5;
}

/* Tel Link */
.im-footer__tel {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  color: var(--footer-text);
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: color var(--duration-fast) var(--ease-smooth);
}

.im-footer__tel svg {
  color: var(--footer-accent);
  flex-shrink: 0;
}

.im-footer__tel:hover {
  color: var(--footer-accent);
}


/* ==========================================================================
   6. BADGES
   ========================================================================== */

.im-footer__badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding-top: 8px;
}

.im-footer__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--footer-border);
  border-radius: 12px;
  transition:
    background var(--duration-fast) var(--ease-smooth),
    border-color var(--duration-fast) var(--ease-smooth);
}

.im-footer__badge:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
}

.im-footer__badge img {
  display: block;
  max-height: 48px;
  width: auto;
  opacity: 0.8;
}

/* Badge Link */
.im-footer__badge--link {
  position: relative;
  text-decoration: none;
  color: var(--footer-text);
}

.im-footer__badge--link:hover {
  border-color: var(--footer-accent);
}

.im-footer__badge--link:hover img {
  opacity: 1;
}

/* External link icon - positioned at top right */
.im-footer__badge-external {
  position: absolute;
  top: 6px;
  right: 6px;
  color: var(--footer-text-muted);
  background: rgba(0, 0, 0, 0.6);
  border-radius: 4px;
  padding: 3px;
  transition: color var(--duration-fast) var(--ease-smooth);
}

.im-footer__badge--link:hover .im-footer__badge-external {
  color: var(--footer-accent);
}


/* ==========================================================================
   7. NAVIGATION
   ========================================================================== */

.im-footer__nav {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px 24px;
}

@media (min-width: 640px) {
  .im-footer__nav {
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
  }
}

.im-footer__nav-group {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Nav Title - Bilingual */
.im-footer__nav-title {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--footer-border);
}

.im-footer__nav-title-en {
  font-family: var(--font-display);
  font-size: 0.9375rem;
  font-weight: 500;
  font-style: italic;
  letter-spacing: 0.02em;
  color: var(--footer-accent);
  line-height: 1.2;
}

.im-footer__nav-title-ja {
  font-family: var(--font-body);
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--footer-text-muted);
  line-height: 1.3;
}

/* Nav List */
.im-footer__nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.im-footer__nav-list li {
  line-height: 1;
}

.im-footer__nav-list a {
  position: relative;
  display: inline-flex;
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--footer-link);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-smooth);
}

.im-footer__nav-list a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0;
  height: 1px;
  background: var(--footer-accent);
  transition: width var(--duration-normal) var(--ease-out);
}

.im-footer__nav-list a:hover {
  color: var(--footer-link-hover);
}

.im-footer__nav-list a:hover::after {
  width: 100%;
}


/* ==========================================================================
   8. BOTTOM BAR
   ========================================================================== */

.im-footer__bottom {
  padding: clamp(20px, 3vw, 28px) 0;
  background: var(--footer-bg-alt);
  border-top: 1px solid var(--footer-border);
}

.im-footer__bottom-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px 24px;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 clamp(24px, 5vw, 56px);
}

/* Legal Links */
.im-footer__legal {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(16px, 2.5vw, 28px);
  list-style: none;
  margin: 0;
  padding: 0;
}

.im-footer__legal li {
  line-height: 1;
}

.im-footer__legal a {
  position: relative;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--footer-text-muted);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-smooth);
}

.im-footer__legal a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0;
  height: 1px;
  background: var(--footer-accent);
  transition: width var(--duration-normal) var(--ease-out);
}

.im-footer__legal a:hover {
  color: var(--footer-link-hover);
}

.im-footer__legal a:hover::after {
  width: 100%;
}

/* Copyright */
.im-footer__copyright {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--footer-text-muted);
}

.im-footer__copyright-symbol {
  font-size: 0.875rem;
}


/* ==========================================================================
   9. RESPONSIVE
   ========================================================================== */

@media (max-width: 1023px) {
  .im-footer__grid {
    gap: 40px;
  }
}

@media (max-width: 639px) {
  .im-footer__main {
    padding: 48px 0;
  }

  .im-footer__nav {
    gap: 28px 20px;
  }

  .im-footer__bottom-inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
  }

  .im-footer__legal {
    justify-content: center;
  }

  .im-footer__badges {
    flex-direction: column;
    align-items: flex-start;
  }

  .im-footer__badge {
    width: 100%;
    justify-content: flex-start;
  }
}


/* ==========================================================================
   10. ACCESSIBILITY
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  .im-footer__logo,
  .im-footer__tel,
  .im-footer__badge,
  .im-footer__nav-list a,
  .im-footer__nav-list a::after,
  .im-footer__legal a,
  .im-footer__legal a::after {
    transition: none !important;
  }
}

@media (forced-colors: active) {
  .im-footer {
    border-top: 2px solid CanvasText;
  }

  .im-footer__nav-title {
    border-bottom: 2px solid CanvasText;
  }
}

/* Focus visible */
.im-footer__logo:focus-visible,
.im-footer__tel:focus-visible,
.im-footer__badge:focus-visible,
.im-footer__nav-list a:focus-visible,
.im-footer__legal a:focus-visible {
  outline: 2px solid var(--footer-accent);
  outline-offset: 4px;
}

}
