/* =====================================================
   common.css — shared shell across all SalesFinder pages
   Contents: design tokens, reset, container, header / nav
   / hamburger, footer, .section-head, .button.
   Page-specific styles stay inline in each HTML <style>.
   ===================================================== */

@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Noto+Sans+JP:wght@400;500;600;700;800&display=swap");

:root {
  --bg: #f5f5f5;
  --surface: #ffffff;
  --text: #1f2937;
  --muted: #4a5568;
  --line: #e5e7eb;
  --primary: #1350d4;
  --accent: #5d96ff;
  --max-width: 1920px;
  --font-base:
    "Inter", "Noto Sans JP", -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  margin: 0;
  font-family: var(--font-base);
  font-feature-settings: "palt" 1, "kern" 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: var(--text);
  background: var(--bg);
  line-height: 1.75;
  letter-spacing: 0.01em;
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
}

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

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

.container {
  width: min(calc(100% - 32px), var(--max-width));
  margin: 0 auto;
}

/* Conditional line break helpers.
   <br class="br-sp"> appears only on small viewports;
   <br class="br-pc"> hides on small viewports. */
.br-sp {
  display: none;
}
@media (max-width: 640px) {
  .br-sp {
    display: inline;
  }
  .br-pc {
    display: none;
  }
}

/* ===== HEADER — floating pill of frosted glass ===== */
.header {
  position: sticky;
  top: clamp(0.75rem, 1.5vw, 1.25rem);
  z-index: 50;
  margin: clamp(0.75rem, 1.5vw, 1.25rem) clamp(0.75rem, 1.8vw, 1.5rem) 0;
  padding: 0 clamp(0.9rem, 2vw, 2.25rem);
  border-radius: clamp(22px, 2.4vw, 36px);
  border: 1px solid rgba(255, 255, 255, 0.42);
  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.32) 0%,
      rgba(255, 255, 255, 0.10) 100%
    );
  backdrop-filter: blur(36px) saturate(220%);
  -webkit-backdrop-filter: blur(36px) saturate(220%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.65) inset,
    0 -1px 0 rgba(255, 255, 255, 0.12) inset,
    0 22px 48px -12px rgba(15, 23, 42, 0.12);
  overflow: visible;
  transition:
    background 0.35s ease,
    backdrop-filter 0.35s ease,
    -webkit-backdrop-filter 0.35s ease,
    border-color 0.35s ease,
    box-shadow 0.35s ease;
}

/* Specular highlight — sharp glassy gleam along the top edge */
.header::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.5) 0%,
    rgba(255, 255, 255, 0.06) 28%,
    transparent 55%
  );
  opacity: 0.7;
  mix-blend-mode: screen;
}

.header.is-scrolled {
  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.55) 0%,
      rgba(255, 255, 255, 0.24) 100%
    );
  backdrop-filter: blur(44px) saturate(240%);
  -webkit-backdrop-filter: blur(44px) saturate(240%);
  border-color: rgba(93, 150, 255, 0.22);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.75) inset,
    0 -1px 0 rgba(255, 255, 255, 0.16) inset,
    0 28px 60px -10px rgba(15, 23, 42, 0.18);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: clamp(4rem, 3.75vw, 4.5rem);
  gap: clamp(1rem, 1.25vw, 1.5rem);
}

.logo {
  width: clamp(10rem, 13.96vw, 16.75rem);
  height: auto;
}

.logo img {
  width: 100%;
  height: auto;
}

.nav {
  display: flex;
  gap: clamp(1.25rem, 3.75vw, 4.5rem);
  flex-wrap: wrap;
  margin-right: clamp(0rem, 1.25vw, 1.5rem);
}

.nav a {
  position: relative;
  display: inline-block;
  color: rgba(15, 23, 42, 0.88);
  font-size: clamp(0.95rem, 1vw, 1.2rem);
  font-weight: 600;
  letter-spacing: 0.04em;
  min-width: 8.5em;
  text-align: center;
  transition: color 0.25s ease;
}

.nav a:hover {
  color: var(--primary);
}

/* Disabled navigation links — used for pages that are still WIP.
   Stay visible (so the IA reads), but lose hover/clickability. */
.nav a.is-disabled,
.footer-top-right-content a.is-disabled {
  pointer-events: none;
  cursor: not-allowed;
  color: rgba(15, 23, 42, 0.55);
  position: relative;
}
.nav a.is-disabled:hover,
.footer-top-right-content a.is-disabled:hover {
  color: rgba(15, 23, 42, 0.55);
}
.footer-top-right-content a.is-disabled {
  color: rgba(255, 255, 255, 0.38);
}
.nav a.is-disabled .nav-text-ja,
.nav a.is-disabled:hover .nav-text-en,
.nav a.is-disabled:hover .nav-text-ja {
  opacity: 0;
  transform: none;
}
.nav a.is-disabled .nav-text-en {
  opacity: 1;
}

.nav-text-en,
.nav-text-ja {
  display: block;
  transition:
    opacity 0.25s ease,
    transform 0.25s ease;
}

.nav-text-ja {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: translateY(6px);
  color: var(--accent);
}

.nav a:hover .nav-text-en {
  opacity: 0;
  transform: translateY(-6px);
}

.nav a:hover .nav-text-ja {
  opacity: 1;
  transform: translateY(0);
}

/* Hamburger — icon-only, sits flush in the glass header. */
.hamburger {
  appearance: none;
  -webkit-appearance: none;
  display: none;
  width: 42px;
  height: 42px;
  min-width: 42px;
  min-height: 42px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  cursor: pointer;
  position: relative;
  z-index: 140;
  flex: 0 0 42px;
  transition: transform 0.3s ease;
}

.hamburger:hover {
  transform: translateY(-1px);
}

.hamburger span {
  position: absolute;
  left: 50%;
  top: 50%;
  display: block;
  width: 18px;
  height: 1.5px;
  margin: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #1350d4, #5d96ff);
  transform-origin: center;
  transition:
    transform 0.3s ease,
    opacity 0.2s ease,
    background 0.3s ease;
}

.hamburger span:nth-child(1) {
  transform: translate(-50%, -6px);
}
.hamburger span:nth-child(2) {
  transform: translate(-50%, -50%);
}
.hamburger span:nth-child(3) {
  transform: translate(-50%, 6px);
}

.header.is-menu-open .hamburger span:nth-child(1) {
  transform: translate(-50%, -50%) rotate(45deg);
}
.header.is-menu-open .hamburger span:nth-child(2) {
  opacity: 0;
  transform: translate(-50%, -50%) scaleX(0);
}
.header.is-menu-open .hamburger span:nth-child(3) {
  transform: translate(-50%, -50%) rotate(-45deg);
}

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

/* ===== SECTION HEAD ===== */
.section-head {
  margin-bottom: clamp(1.25rem, 1.46vw, 1.75rem);
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
}

.section-head span {
  display: inline-block;
  color: var(--accent);
  font-size: clamp(1.25rem, 1.67vw, 2rem);
  margin-bottom: 8px;
  letter-spacing: 0.18em;
}

.section-head h2 {
  margin: 0;
  font-size: clamp(2rem, 4.5vw, 5.375rem);
  line-height: 1.2;
  text-align: center;
}

.section-head p {
  margin: clamp(1rem, 1.4vw, 1.5rem) 0 0;
  color: #2c3a4d;
  font-size: clamp(0.95rem, 1.1vw, 1.2rem);
  line-height: 1.95;
  font-weight: 500;
  text-align: center;
  max-width: 680px;
  margin-left: auto;
  margin-right: auto;
}

/* ===== BUTTON BASES ===== */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 clamp(1rem, 1.04vw, 1.25rem);
  border-radius: 12px;
  border: 1px solid transparent;
  width: clamp(14rem, 16.35vw, 19.625rem);
  height: clamp(4rem, 4.74vw, 5.6875rem);
  font-size: clamp(1rem, 1.4vw, 1.8rem);
  text-align: center;
}

.button-primary {
  background-color: var(--primary);
  color: #ffffff;
}

.button-secondary {
  background-color: #e2e9f9;
  border-color: var(--primary);
  color: var(--primary);
}

/* ===== FOOTER ===== */
.footer {
  padding: clamp(1.25rem, 1.46vw, 1.75rem) 0 clamp(2rem, 2.5vw, 3rem);
  color: #ffffff;
  background-color: #002e84;
  width: 100%;
}

.footer-top-container {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2rem;
  padding: 0 clamp(3rem, 10vw, 12rem);
}

.footer-title {
  font-size: clamp(1.5rem, 2vw, 2.5rem);
}

.footer-description {
  font-size: clamp(0.8rem, 1vw, 1.5rem);
  line-height: clamp(1rem, 1.2vw, 1.8rem);
  color: #c8c7c7;
  max-width: 560px;
  margin-top: 12px;
}

.footer-top-right {
  display: flex;
  justify-content: center;
  gap: clamp(2rem, 6vw, 6rem);
}

.footer-top-right-title {
  color: #5d96ff;
}

.footer-top-right > div > div {
  margin-top: clamp(0.3rem, 0.5vw, 0.8rem);
}

.footer-top-right-content {
  color: #c8c7c7;
}

.footer-divider {
  height: 0.5px;
  width: 100%;
  background-color: #5d96ff;
  margin: clamp(1rem, 1.5vw, 2rem) 0;
}

.footer-bottom {
  color: #c8c7c7;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.footer-bottom-right {
  display: flex;
  justify-content: flex-end;
  gap: clamp(1rem, 1.5vw, 2rem);
  flex-wrap: wrap;
}

.footer-bottom-right a {
  color: #c8c7c7;
  transition: color 0.25s ease;
}

.footer-bottom-right a:hover {
  color: #ffffff;
}

/* ===== RESPONSIVE — header, footer, section-head, hamburger ===== */
@media (max-width: 900px) {
  .container {
    width: min(calc(100% - 24px), var(--max-width));
  }

  .header {
    top: 0.6rem;
    margin: 0.6rem 0.6rem 0;
    padding: 0 0.85rem;
    border-radius: 22px;
  }

  .header-inner {
    min-height: 4rem;
    padding: 0;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 0;
  }

  .logo {
    width: 10.5rem;
    flex: 0 0 auto;
    position: relative;
    z-index: 70;
  }

  .hamburger {
    display: inline-flex;
    flex: 0 0 44px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    margin-left: auto;
  }

  .nav {
    position: fixed;
    top: 0;
    right: -1px; /* +1px past the edge so no hairline sub-pixel leak */
    width: min(82vw, 360px);
    height: 100svh;
    padding: 6.5rem 1.75rem 2rem;
    margin: 0;
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 0;
    background:
      linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.97) 0%,
        rgba(248, 250, 255, 0.93) 100%
      );
    border-left: 1px solid rgba(93, 150, 255, 0.18);
    box-shadow: none;
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    transform: translateX(105%);
    visibility: hidden;
    transition:
      transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1),
      box-shadow 0.4s ease,
      visibility 0s linear 0.4s;
    z-index: 120;
  }

  .header.is-menu-open .nav {
    transform: translateX(0);
    visibility: visible;
    box-shadow: -28px 0 60px rgba(15, 23, 42, 0.18);
    transition:
      transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1),
      box-shadow 0.4s ease,
      visibility 0s linear 0s;
  }

  .nav a {
    width: 100%;
    min-width: 0;
    padding: 1.1rem 0.25rem;
    text-align: left;
    font-size: 1.05rem;
    color: #0f172a;
    font-weight: 600;
    border-bottom: 1px solid rgba(93, 150, 255, 0.16);
  }

  /* Mobile menu shows HOME only — disabled items are hidden
     until the corresponding pages launch. */
  .nav a.is-disabled {
    display: none;
  }

  /* Drop the Japanese sub-label on mobile; HOME alone is sufficient. */
  .nav a .nav-text-ja {
    display: none;
  }

  .nav-text-en,
  .nav-text-ja {
    line-height: 1.7;
  }

  .nav-text-en {
    font-size: 0.95rem;
    letter-spacing: 0.08em;
  }

  .nav-text-ja {
    position: static;
    inset: auto;
    opacity: 1;
    transform: none;
    margin-top: 0.15rem;
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    color: var(--accent);
  }

  .nav a:hover .nav-text-en {
    opacity: 1;
    transform: none;
  }

  .nav a:hover .nav-text-ja {
    opacity: 1;
    transform: none;
  }

  .footer-top-container {
    grid-template-columns: 1fr;
    padding: 0 1rem;
  }

  .footer-top-right {
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 1.5rem 2rem;
  }

  .footer-bottom {
    grid-template-columns: 1fr;
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .footer-bottom-right {
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .header-inner {
    gap: 0.5rem;
    padding: 0.75rem 0;
  }

  .logo {
    width: 9.5rem;
  }

  .nav {
    width: min(84vw, 300px);
    padding-top: 5.5rem;
  }

  .footer-title {
    font-size: 1.25rem;
  }

  .footer-description,
  .footer-top-right-content,
  .footer-bottom {
    font-size: 0.9rem;
  }

  .section-head h2 {
    font-size: clamp(1.8rem, 9vw, 2.6rem);
  }

  .section-head p {
    font-size: 0.95rem;
  }
}
