/* Shared navigation prototype for the HOME, UI/HMI, and Product Design pages. */
:root {
  --nav-background: var(--color-background, #fff);
  --nav-surface: var(--color-surface, #f5f8fb);
  --nav-border: var(--color-border, #d9e2ec);
  --nav-primary: var(--color-primary, #003366);
  --nav-muted: var(--color-muted, #667085);
  --nav-transition: var(--transition, .22s ease);
  --nav-header-height: var(--header-height, var(--header, 68px));
  --nav-container-max: var(--container-max, 1200px);
}

/* Lower-page Hero trial tokens. Page-specific classes retain visual composition. */
:root {
  --page-hero-content-top: 72px;
  --page-hero-content-bottom: 72px;
  --page-hero-h1-size: 48px;
  --page-hero-h1-line-height: 1.25;
  --page-hero-lead-size: 18px;
  --page-hero-lead-line-height: 1.7;
  --page-hero-mobile-content-top: 56px;
  --page-hero-mobile-content-bottom: 56px;
  --page-hero-mobile-h1-size: 32px;
}

.page-hero .page-hero__inner { padding-top: var(--page-hero-content-top); padding-bottom: var(--page-hero-content-bottom); }
.page-hero .page-hero__content, .page-hero .page-hero__visual { min-width: 0; }
.page-hero .page-hero__eyebrow { margin-bottom: 12px; font-size: 12px; font-weight: 800; line-height: 1.2; letter-spacing: .16em; }
.page-hero .page-hero__title { margin-bottom: 20px; font-size: var(--page-hero-h1-size); font-weight: 700; line-height: var(--page-hero-h1-line-height); letter-spacing: -.03em; text-wrap: balance; }
.page-hero .page-hero__lead { margin-bottom: 18px; font-size: var(--page-hero-lead-size); font-weight: 500; line-height: var(--page-hero-lead-line-height); }
.page-hero .page-hero__description { margin-bottom: 24px; font-size: 16px; font-weight: 400; line-height: 1.8; }
.page-hero .page-hero__note { margin-bottom: 24px; font-size: 15px; font-weight: 600; line-height: 1.75; }
.page-hero .page-hero__actions { display: flex; flex-wrap: wrap; gap: 12px; }
.page-hero .page-hero__actions .button { min-height: 48px; }
.hero-keep { display: inline-block; white-space: nowrap; }
.hero-break-mobile { display: none; }
.hero-multilingual-mobile { display: none; }

/* Keep large Japanese headings balanced without forcing manual line breaks. */
main h1,
main h2,
main h3 {
  text-wrap: balance;
}

/* Legacy lower-page Hero compatibility layer. Service TOP Heroes are excluded. */
main > .hero:not(.home-hero):not(.product-hero):not(.graphic-service-hero):not(.web-service-hero) .hero__inner,
main > .case-hero .case-hero__inner {
  padding-top: var(--page-hero-content-top);
  padding-bottom: var(--page-hero-content-bottom);
}

main > .hero:not(.home-hero):not(.product-hero):not(.graphic-service-hero):not(.web-service-hero) h1,
main > .case-hero h1 {
  font-size: var(--page-hero-h1-size);
  font-weight: 700;
  line-height: var(--page-hero-h1-line-height);
  text-wrap: balance;
}

main > .hero:not(.home-hero):not(.product-hero):not(.graphic-service-hero):not(.web-service-hero) .eyebrow,
main > .case-hero .eyebrow {
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: .16em;
}

main > .hero:not(.home-hero):not(.product-hero):not(.graphic-service-hero):not(.web-service-hero) .hero__lead,
main > .case-hero .case-hero__lead {
  font-size: var(--page-hero-lead-size);
  font-weight: 500;
  line-height: var(--page-hero-lead-line-height);
}

main > .hero:not(.home-hero):not(.product-hero):not(.graphic-service-hero):not(.web-service-hero) .hero__description,
main > .case-hero .case-hero__description {
  font-size: 16px;
  font-weight: 400;
  line-height: 1.8;
}

/* Case/project metadata stays visibly subordinate to the page H1. */
main > .hero:not(.home-hero):not(.product-hero):not(.graphic-service-hero):not(.web-service-hero) .hero__project,
main > .case-hero .case-hero__project {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.6;
  letter-spacing: normal;
}

main > .hero:not(.home-hero):not(.product-hero):not(.graphic-service-hero):not(.web-service-hero) .button,
main > .case-hero .button {
  min-height: 48px;
}

@media (max-width: 767px) {
  .page-hero .page-hero__inner { width: min(calc(100% - 40px), var(--container-max)); padding-top: var(--page-hero-mobile-content-top); padding-bottom: var(--page-hero-mobile-content-bottom); }
  .page-hero .page-hero__title { font-size: var(--page-hero-mobile-h1-size); line-height: 1.3; }
  .page-hero .page-hero__lead { font-size: 16px; line-height: 1.7; }
  .page-hero .page-hero__description { font-size: 15px; }
  .page-hero .page-hero__actions { flex-direction: column; }
  .page-hero .page-hero__actions .button { width: 100%; }
  main > .hero:not(.home-hero):not(.product-hero):not(.graphic-service-hero):not(.web-service-hero) .hero__inner,
  main > .case-hero .case-hero__inner { width: min(calc(100% - 40px), var(--container-max)); padding-top: var(--page-hero-mobile-content-top); padding-bottom: var(--page-hero-mobile-content-bottom); }
  main > .hero:not(.home-hero):not(.product-hero):not(.graphic-service-hero):not(.web-service-hero) h1,
  main > .case-hero h1 { font-size: var(--page-hero-mobile-h1-size) !important; line-height: 1.3 !important; }
  main > .hero:not(.home-hero):not(.product-hero):not(.graphic-service-hero):not(.web-service-hero) .hero__lead,
  main > .case-hero .case-hero__lead { font-size: 16px; line-height: 1.7; }
  main > .hero:not(.home-hero):not(.product-hero):not(.graphic-service-hero):not(.web-service-hero) .hero__description,
  main > .case-hero .case-hero__description { font-size: 15px; line-height: 1.8; }
  .hero-break-mobile { display: block; }
  .hero-multilingual-desktop { display: none; }
  .hero-multilingual-mobile { display: inline-block; }
}

html {
  scroll-padding-top: calc(var(--nav-header-height) + 20px);
}

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 1000;
  height: var(--nav-header-height);
  border-bottom: 1px solid var(--nav-border);
  background: var(--nav-background);
  transition: box-shadow var(--nav-transition);
}

.site-header.is-scrolled {
  box-shadow: 0 8px 24px rgba(11, 37, 69, .08);
}

.site-header__inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-brand {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.site-brand__name {
  color: var(--nav-primary);
  font-family: var(--font-latin, sans-serif);
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -.04em;
}

.site-brand__tagline {
  margin-top: 6px;
  color: var(--nav-muted);
  font-family: var(--font-latin, sans-serif);
  font-size: .5rem;
  font-weight: 700;
  letter-spacing: .2em;
}

/* The shared outlined lockup keeps the brand geometry independent of browser font rendering. */
.site-brand__lockup {
  display: block;
  width: 112px;
  max-width: 100%;
  height: auto;
}

.site-footer__brand-link {
  display: inline-flex;
  width: 112px;
  max-width: 100%;
}

.site-footer__brand-link .site-brand__lockup {
  width: 100%;
}

.site-nav {
  margin-left: auto;
}

.site-nav__toggle {
  display: flex;
  min-width: 48px;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 1px 6px;
  border: 0;
  background: transparent;
  color: var(--nav-primary);
  font: inherit;
  cursor: pointer;
}

.site-nav__toggle-label {
  color: inherit;
  font-family: var(--font-latin, sans-serif);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .1em;
}

.site-nav__toggle-icon {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.site-nav__toggle-icon span {
  display: block;
  width: 22px;
  height: 2px;
  background: currentColor;
  transition: transform var(--nav-transition), opacity var(--nav-transition);
}

.site-nav__toggle[aria-expanded="true"] .site-nav__toggle-icon span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.site-nav__toggle[aria-expanded="true"] .site-nav__toggle-icon span:nth-child(2) {
  opacity: 0;
}

.site-nav__toggle[aria-expanded="true"] .site-nav__toggle-icon span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.site-nav__panel {
  position: fixed;
  inset: var(--nav-header-height) 0 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 24px 20px;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--nav-background);
  visibility: hidden;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity var(--nav-transition), transform var(--nav-transition), visibility var(--nav-transition);
}

.site-nav__panel.is-open {
  visibility: visible;
  opacity: 1;
  transform: none;
}

.site-nav__links {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.site-nav__link {
  display: flex;
  min-height: 48px;
  align-items: center;
  padding: 12px 8px;
  border-bottom: 1px solid var(--nav-border);
  color: var(--nav-primary);
  font-weight: 600;
  text-decoration: none;
}

.site-nav__link[aria-current="page"] {
  font-weight: 800;
}

.site-nav__action {
  margin-top: 0;
}

.site-nav__cta {
  width: 100%;
  margin: 0;
  white-space: nowrap;
}

/* Keep the global Contact CTA consistent with page-specific button rules. */
.site-header .site-nav__cta {
  width: 120px;
  min-width: 120px;
  height: 48px;
  min-height: 48px;
  padding: 10px 18px;
  border-radius: 8px;
  font-family: var(--font-ja, sans-serif);
  font-size: .82rem;
  font-weight: 600;
  line-height: 1.4;
}

.site-nav__toggle:focus-visible,
.site-nav__link:focus-visible,
.site-nav__cta:focus-visible {
  outline: 3px solid rgba(0, 123, 255, .32);
  outline-offset: 3px;
}

body.is-menu-open {
  overflow: hidden;
}

.breadcrumb,
.ep-breadcrumb {
  padding-top: calc(var(--nav-header-height) + 18px);
  padding-bottom: 18px;
  color: var(--nav-muted);
  font-size: .78rem;
  line-height: 1.75;
}

.breadcrumb ol,
.ep-breadcrumb__list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
}

.breadcrumb li,
.ep-breadcrumb__item {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  overflow-wrap: anywhere;
}

.breadcrumb li:not(:last-child)::after,
.ep-breadcrumb__item:not(:last-child)::after {
  width: 1px;
  height: .9em;
  margin-left: 6px;
  background: #a6b2bf;
  content: "";
  transform: rotate(20deg);
}

.breadcrumb a,
.ep-breadcrumb a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.page-index {
  margin: 0 auto;
  padding: 20px 0;
  border-top: 1px solid var(--nav-border);
  border-bottom: 1px solid var(--nav-border);
}

.page-index__label {
  margin: 0 0 12px;
  color: var(--nav-muted);
  font-family: var(--font-latin, sans-serif);
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .16em;
}

.page-index__list {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.page-index__link {
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 10px;
  padding: 4px 16px;
  border-left: 1px solid var(--nav-border);
  color: var(--nav-primary);
  font-size: .86rem;
  font-weight: 600;
  line-height: 1.5;
  text-decoration: none;
}

.page-index__link::before {
  content: attr(data-index);
  flex: 0 0 auto;
  color: var(--nav-muted);
  font-family: var(--font-latin, sans-serif);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .08em;
}

.page-index__item:first-child .page-index__link,
.page-index__item:nth-child(5n + 1) .page-index__link {
  padding-left: 0;
  border-left: 0;
}

.page-index__link:hover {
  color: var(--nav-muted);
}

.page-index__link:focus-visible {
  outline: 3px solid rgba(0, 123, 255, .32);
  outline-offset: 3px;
}

:where(.page-index__target, section[id], h2[id]) {
  scroll-margin-top: calc(var(--nav-header-height) + 20px);
}

@media (min-width: 1024px) {
  .site-nav__toggle {
    display: none;
  }

  .site-nav__panel {
    position: static;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 28px;
    padding: 0;
    overflow: visible;
    background: transparent;
    visibility: visible;
    opacity: 1;
    transform: none;
  }

  .site-nav__links {
    flex-direction: row;
    align-items: center;
    gap: 24px;
  }

  .site-nav__link {
    min-height: 0;
    padding: 10px 0;
    border-bottom: 0;
    color: var(--nav-muted);
    font-size: .84rem;
  }

  .site-nav__link:hover,
  .site-nav__link[aria-current="page"] {
    color: var(--nav-primary);
  }

  .site-nav__action {
    margin-left: 4px;
  }

  .site-nav__cta {
    width: auto;
    padding: 10px 18px;
  }
}

@media (min-width: 1200px) {
  #primary-areas .domain-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  #focus .ui-hmi-focus-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 767px) {
  .page-index {
    padding: 18px 0;
  }

  .page-index__list {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .page-index__link,
  .page-index__item:first-child .page-index__link {
    padding: 8px 0;
    border-left: 0;
  }

  .site-header .site-nav__cta {
    width: 100%;
    min-width: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .site-header,
  .site-nav__panel,
  .site-nav__toggle-icon span {
    transition: none;
  }

  html {
    scroll-behavior: auto;
  }
}

/* Shared service-top Hero rhythm. Page-specific visuals remain outside these rules. */
:root {
  --service-hero-h1-size: 56px;
  --service-hero-content-top: 80px;
  --service-hero-lead-size: 20px;
  --service-hero-accent-height: 5px;
}

@media (min-width: 768px) {
  .uihmi-hero__inner,
  .product-hero .hero__inner,
  .graphic-service-hero .hero__grid,
  .web-service-hero .hero__inner {
    padding-top: var(--service-hero-content-top);
  }

  .uihmi-hero__title,
  .product-hero .hero__title,
  .graphic-service-hero h1,
  .web-service-hero h1 {
    font-size: var(--service-hero-h1-size);
    font-weight: 700;
    line-height: 1.22;
  }

  .uihmi-hero .eyebrow,
  .product-hero .eyebrow,
  .graphic-service-hero .eyebrow,
  .web-service-hero .eyebrow {
    margin-bottom: 12px;
    font-size: 12px;
    line-height: 1.2;
    letter-spacing: .16em;
  }

  .uihmi-hero__lead,
  .product-hero .hero__lead,
  .graphic-service-hero .hero__lead,
  .web-service-hero .hero__lead {
    font-size: var(--service-hero-lead-size);
    font-weight: 600;
    line-height: 1.6;
  }

  .uihmi-hero__description,
  .product-hero .hero__description,
  .graphic-service-hero .hero__description {
    font-size: 16px;
    font-weight: 400;
    line-height: 1.8;
  }

  .uihmi-hero__assurance,
  .product-hero .hero__assurance,
  .graphic-service-hero .hero__assurance {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.75;
  }

  .uihmi-hero__actions,
  .product-hero .hero__actions,
  .graphic-service-hero .hero__actions {
    gap: 12px;
  }

  .uihmi-hero__actions .button,
  .product-hero .hero__actions .button,
  .graphic-service-hero .hero__actions .button {
    min-height: 48px;
  }

  .uihmi-hero::after,
  .product-hero::after {
    height: var(--service-hero-accent-height);
  }

  .graphic-service-hero {
    border-bottom: var(--service-hero-accent-height) solid transparent;
    border-image: linear-gradient(90deg, #007bff, #7bc4e2) 1;
  }

  .graphic-service-hero .hero__grid {
    padding-bottom: 44px;
  }

  .web-service-hero .hero__lead {
    font-size: 19px;
    font-weight: 500;
    line-height: 1.7;
    color: rgba(255, 255, 255, .84);
  }

  .web-service-hero .hero-collage {
    min-height: 420px;
  }

  .web-service-hero .hero-collage__item--tech {
    left: 0;
    top: 50px;
    width: 54%;
    height: 387px;
  }

  .web-service-hero .hero-collage__item--meta {
    right: 0;
    top: 0;
    width: 48%;
    height: 306px;
  }

  .web-service-hero .hero-collage__item--fringee {
    right: 27px;
    bottom: 0;
    width: 49%;
    height: 252px;
  }

  .web-service-hero .hero__inner {
    align-items: center;
  }
}

@media (max-width: 767px) {
  .uihmi-hero__inner,
  .product-hero .hero__inner,
  .graphic-service-hero .hero__grid,
  .web-service-hero .hero__inner {
    padding-top: 68px;
  }

  .uihmi-hero__title,
  .product-hero .hero__title,
  .graphic-service-hero h1,
  .web-service-hero h1 {
    font-size: 34px;
    font-weight: 700;
    line-height: 1.3;
  }

  .uihmi-hero .eyebrow,
  .product-hero .eyebrow,
  .graphic-service-hero .eyebrow,
  .web-service-hero .eyebrow {
    margin-bottom: 12px;
    font-size: 12px;
    line-height: 1.2;
    letter-spacing: .16em;
  }

  .uihmi-hero__lead,
  .product-hero .hero__lead,
  .graphic-service-hero .hero__lead,
  .web-service-hero .hero__lead {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.7;
  }

  .uihmi-hero__description,
  .product-hero .hero__description,
  .graphic-service-hero .hero__description {
    font-size: 16px;
    font-weight: 400;
    line-height: 1.8;
  }

  .uihmi-hero__assurance,
  .product-hero .hero__assurance,
  .graphic-service-hero .hero__assurance {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.75;
  }

  .uihmi-hero__actions,
  .product-hero .hero__actions,
  .graphic-service-hero .hero__actions {
    gap: 12px;
  }

  .uihmi-hero__actions .button,
  .product-hero .hero__actions .button,
  .graphic-service-hero .hero__actions .button {
    min-height: 48px;
  }

  .web-service-hero .hero__inner {
    width: min(calc(100% - 40px), var(--container));
  }

  .uihmi-hero::after,
  .product-hero::after {
    height: var(--service-hero-accent-height);
  }

  .graphic-service-hero {
    border-bottom: var(--service-hero-accent-height) solid transparent;
    border-image: linear-gradient(90deg, #007bff, #7bc4e2) 1;
  }

  .graphic-service-hero .hero__grid {
    padding-bottom: 8px;
  }

  .web-service-hero .hero__lead {
    font-size: 17px;
    font-weight: 500;
    line-height: 1.7;
    color: rgba(255, 255, 255, .84);
  }

  .web-service-hero .hero-collage {
    min-height: 340px;
  }

  .web-service-hero .hero__inner {
    align-items: start;
  }
}
