/* Brilliant Republic � design tokens from mockup */
:root {
  --header-bg: #b8c4cc;
  --header-text: #3d4f5c;
  --white: #ffffff;
  --hero-shadow: 0 2px 24px rgba(0, 0, 0, 0.35);
  --feature-bar-bg: linear-gradient(
    to top,
    rgba(12, 28, 38, 0.92) 0%,
    rgba(12, 28, 38, 0.55) 70%,
    transparent 100%
  );
  --cat-label: #6ec8f5;
  --font-ja: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  --font-en: "Montserrat", "Noto Sans JP", sans-serif;
  --header-height: 118px;
  --logo-gap: clamp(0.75rem, 2vw, 1.5rem);
  --logo-half: clamp(3.75rem, 8vw, 6.25rem);
  --logo-slot: calc(var(--logo-half) + var(--logo-gap));
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 0.75rem);
}

body {
  font-family: var(--font-ja);
  color: var(--header-text);
  background: var(--header-bg);
  min-height: 100vh;
  line-height: 1.5;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ??? Header ??? */
.site-header {
  background: var(--header-bg);
  position: relative;
  z-index: 100;
}

.header-inner {
  width: 100%;
  margin: 0 auto;
  padding: 0.75rem clamp(5.25rem, 9.5vw, 8.75rem) 0.75rem 1.25rem;
  min-height: var(--header-height);
}

/* Logo: center column � always visible, outside collapsible menu */
.site-logo {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translate(-50%, -50%);
  pointer-events: auto;
}

.site-logo-img {
  display: block;
  width: clamp(110px, 16vw, 200px);
  height: auto;
  max-width: min(200px, 42vw);
  max-height: clamp(44px, 9vw, 84px);
  object-fit: contain;
  object-position: center;
  background: transparent;
}

.nav {
  width: 100%;
  min-height: calc(var(--header-height) - 1.5rem);
}

.nav-list {
  list-style: none;
  display: flex;
  gap: clamp(0.5rem, 1.5vw, 1.5rem);
  min-width: 0;
  position: absolute;
  bottom: 0.75rem;
  max-width: calc(50% - var(--logo-slot) - 0.75rem);
}

.nav-list-left {
  right: calc(50% + var(--logo-slot));
  justify-content: flex-end;
}

.nav-list-right {
  left: calc(50% + var(--logo-slot));
  justify-content: flex-start;
}

.nav-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0.25rem 0.15rem;
  transition: opacity 0.2s;
}

.nav-link:hover,
.nav-link.is-active {
  opacity: 0.75;
}

.nav-ja {
  font-size: clamp(0.7rem, 1.1vw, 0.85rem);
  font-weight: 500;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.nav-en {
  font-family: var(--font-en);
  font-size: clamp(0.55rem, 0.85vw, 0.65rem);
  font-weight: 500;
  letter-spacing: 0.04em;
  opacity: 0.9;
  margin-top: 0.1rem;
}

/* Social � right edge; does not shift logo center */
.header-social {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
  position: absolute;
  right: clamp(0.75rem, 2vw, 1.25rem);
  top: 50%;
  z-index: 11;
  transform: translateY(-50%);
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, opacity 0.2s;
}

.social-link:hover {
  transform: scale(1.05);
  opacity: 0.85;
}

.social-icon {
  display: block;
  width: clamp(28px, 3.5vw, 36px);
  height: clamp(28px, 3.5vw, 36px);
  object-fit: contain;
}

.social-icon--profile {
  width: clamp(34px, 4.5vw, 44px);
  height: clamp(34px, 4.5vw, 44px);
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.65);
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 8px;
  border: none;
  background: transparent;
  cursor: pointer;
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 110;
}

.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--header-text);
  border-radius: 1px;
  transition: transform 0.25s, opacity 0.25s;
}

/* Hero � image_Topmaim.png */
.hero {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 1;
  min-height: clamp(200px, 32vw, 520px);
  max-height: min(72vh, 640px);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  background: #4a6a7a;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  object-fit: cover;
  object-position: center center;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Feature bar */
.feature-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  background: var(--feature-bar-bg);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.feature-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  text-align: center;
  padding: 1.25rem 0.75rem 1.5rem;
  color: var(--white);
  text-decoration: none;
  border-right: 1px solid rgba(255, 255, 255, 0.25);
  min-height: 140px;
  cursor: pointer;
  transition: background-color 0.2s ease, opacity 0.2s ease;
}

.feature-item:hover {
  background-color: rgba(255, 255, 255, 0.1);
  opacity: 1;
}

.feature-item:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.85);
  outline-offset: -2px;
  background-color: rgba(255, 255, 255, 0.12);
}

.feature-item:last-child {
  border-right: none;
}

.feature-category {
  font-size: clamp(0.55rem, 0.85vw, 0.7rem);
  font-weight: 500;
  letter-spacing: 0.02em;
  margin-bottom: 0.35rem;
  color: var(--cat-label);
}

.feature-name {
  font-family: var(--font-en);
  font-size: clamp(0.805rem, 1.265vw, 1.235rem);
  font-weight: 600;
  letter-spacing: 0.03em;
  margin-bottom: 0.4rem;
  line-height: 1.25;
}

.feature-desc {
  font-size: clamp(0.55rem, 0.8vw, 0.68rem);
  font-weight: 400;
  line-height: 1.45;
  opacity: 0.95;
  max-width: 12em;
}

.service-sections {
  background: #eef2f5;
}

.service-section {
  scroll-margin-top: calc(var(--header-height) + 0.75rem);
  max-width: 720px;
  margin: 0 auto;
  padding: clamp(2.5rem, 6vw, 4rem) 1.5rem;
  border-bottom: 1px solid rgba(61, 79, 92, 0.12);
}

.service-section:last-child {
  border-bottom: none;
}

.service-section-label {
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 0.35rem;
  color: var(--cat-label);
}

.service-section-title {
  font-family: var(--font-en);
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--header-text);
  margin-bottom: 0.75rem;
}

.service-section-desc {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--header-text);
  opacity: 0.9;
}

/* Footer */
.site-footer {
  background: var(--header-bg);
  padding: 0.85rem 1.5rem;
  text-align: center;
}

.footer-copy {
  font-family: var(--font-en);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  opacity: 0.7;
}

/* --- Responsive --- */
@media (max-width: 1200px) {
  :root {
    --logo-half: clamp(3.25rem, 7vw, 5.5rem);
    --logo-gap: clamp(0.5rem, 1.5vw, 1rem);
  }

  .header-inner {
    padding-right: clamp(4.75rem, 8.5vw, 7rem);
  }

  .site-logo-img {
    width: clamp(96px, 14vw, 170px);
    max-height: clamp(40px, 8vw, 76px);
  }

  .nav-list {
    gap: 0.45rem;
  }

  .nav-ja {
    font-size: clamp(0.65rem, 1vw, 0.78rem);
  }

  .nav-en {
    font-size: 0.55rem;
  }
}

@media (max-width: 1100px) {
  .header-inner {
    padding-right: clamp(4.75rem, 8.5vw, 6.5rem);
  }

  .header-social {
    gap: 0.45rem;
  }

  .social-icon {
    width: 32px;
    height: 32px;
  }

  .social-icon--profile {
    width: 38px;
    height: 38px;
  }
}

@media (max-width: 900px) {
  :root {
    --header-height: auto;
  }

  .header-inner {
    display: grid;
    grid-template-columns: 44px 1fr auto;
    grid-template-areas:
      "toggle . social"
      "nav nav nav";
    align-items: center;
    column-gap: 0.5rem;
    row-gap: 0;
    padding: clamp(3.25rem, 13vw, 4.25rem) 0.75rem 0.5rem;
    min-height: auto;
  }

  .site-logo {
    top: clamp(2.25rem, 10vw, 3rem);
    transform: translate(-50%, -50%);
  }

  .nav-toggle {
    display: flex;
    position: static;
    transform: none;
    grid-area: toggle;
    justify-self: start;
  }

  .site-logo-img {
    width: clamp(100px, 36vw, 180px);
    max-width: 100%;
    max-height: clamp(40px, 12vw, 72px);
  }

  .header-social {
    position: static;
    transform: none;
    grid-area: social;
    justify-self: end;
    z-index: 11;
  }

  .nav {
    grid-area: nav;
    display: flex;
    flex-direction: column;
    width: 100%;
    min-height: 0;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    padding: 0;
    transition: max-height 0.35s ease, opacity 0.25s ease;
    gap: 0;
  }

  .nav.is-open {
    max-height: 520px;
    opacity: 1;
    padding: 0.5rem 0 1rem;
  }

  .nav-list {
    position: static;
    max-width: none;
    flex-direction: column;
    align-items: center;
    width: 100%;
    gap: 0.25rem;
  }

  .nav-list-left,
  .nav-list-right {
    justify-content: center;
  }

  .hero {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    aspect-ratio: auto;
    min-height: 0;
    max-height: none;
    overflow: visible;
  }

  .hero-bg {
    position: relative;
    inset: auto;
    flex: 0 0 auto;
    width: 100%;
    height: auto;
    max-height: none;
    object-fit: contain;
    object-position: center top;
  }

  .feature-bar {
    position: static;
    flex: 0 0 auto;
    width: 100%;
    grid-template-columns: repeat(3, 1fr);
    background: rgba(12, 28, 38, 0.94);
    border-top: none;
  }

  .feature-item {
    min-height: 100px;
    padding: 0.85rem 0.5rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  }

  .feature-item:nth-child(3n) {
    border-right: none;
  }
}

@media (max-width: 520px) {
  .site-logo-img {
    width: clamp(88px, 42vw, 150px);
    max-height: clamp(36px, 14vw, 60px);
  }

  .header-social {
    gap: 0.35rem;
  }

  .social-icon {
    width: 28px;
    height: 28px;
  }

  .social-icon--profile {
    width: 32px;
    height: 32px;
  }

  .feature-bar {
    grid-template-columns: 1fr 1fr;
  }

  .feature-item {
    min-height: 88px;
    padding: 0.65rem 0.4rem 0.75rem;
  }

  .feature-category {
    font-size: 0.6rem;
    margin-bottom: 0.2rem;
  }

  .feature-name {
    font-size: 1.235rem;
    margin-bottom: 0.25rem;
  }

  .feature-desc {
    font-size: 0.58rem;
    line-height: 1.35;
  }

  .feature-item:nth-child(3n) {
    border-right: 1px solid rgba(255, 255, 255, 0.25);
  }

  .feature-item:nth-child(2n) {
    border-right: none;
  }
}

/* Open menu icon */
.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

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

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