/* ═══════════════════════════════════════════════
   NEOLAB — Design System v2 (shared by subpages)
   Top page (index.html) carries its own inline copy.
   ═══════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --ink:        #111318;
  --ink-2:      #2b2e35;
  --ink-muted:  #62666f;
  --ink-soft:   #a3a7ae;
  --night:      #0b0d10;
  --surface:    #f5f4f1;
  --surface-2:  #ecebe6;
  --white:      #ffffff;
  --accent:     #b89a6e;
  --accent-dk:  #8c7350;
  --accent-lt:  #e8dfd3;
  --line:       rgba(17,19,24,.09);
  --line-dark:  rgba(255,255,255,.12);

  --font-en:    'Inter', 'Noto Sans JP', sans-serif;
  --font-ja:    'Noto Sans JP', 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', sans-serif;
  --fs-display: clamp(40px, 6vw, 84px);
  --fs-h2:      clamp(30px, 4.2vw, 52px);
  --fs-h3:      clamp(20px, 2vw, 26px);
  --fs-lead:    clamp(15px, 1.3vw, 17px);
  --fs-body:    15px;
  --fs-small:   13px;
  --fs-label:   12px;

  --nav-h:      64px;
  --container:  1200px;
  --narrow:     880px;
  --gutter:     clamp(20px, 4vw, 40px);
  --section-y:  clamp(72px, 9vw, 128px);
  --radius-sm:  12px;
  --radius:     20px;
  --radius-lg:  28px;
  --pill:       999px;
  --shadow-1:   0 1px 2px rgba(17,19,24,.04), 0 8px 24px rgba(17,19,24,.06);
  --shadow-2:   0 2px 6px rgba(17,19,24,.05), 0 24px 56px rgba(17,19,24,.12);

  --ease-out:   cubic-bezier(0.23, 1, 0.32, 1);
  --ease-io:    cubic-bezier(0.77, 0, 0.175, 1);
  --ease-emph:  cubic-bezier(0.16, 1, 0.3, 1);
  --dur-press:  120ms;
  --dur-ui:     260ms;
  --dur-reveal: 900ms;
}

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 16px); -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-ja);
  font-size: var(--fs-body);
  color: var(--ink);
  background: var(--white);
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
body.menu-open { overflow: hidden; }
img, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 8px; }
strong, b { font-weight: 700; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }
.container.narrow { max-width: calc(var(--narrow) + var(--gutter) * 2); }

/* ─── Type primitives ─── */
.label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-en);
  font-size: var(--fs-label);
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
}
.label::before { content: ''; width: 18px; height: 1px; background: currentColor; flex: none; }
.section-title {
  font-family: var(--font-en);
  font-size: var(--fs-h2);
  font-weight: 700;
  letter-spacing: -.03em;
  line-height: 1.12;
  text-wrap: balance;
  word-break: auto-phrase;
}
.label + .section-title, .label + h2, .label + h1 { margin-top: 16px; }
.section-title em { font-style: normal; color: var(--ink-soft); }
.body-text { font-size: var(--fs-body); line-height: 2; color: var(--ink-muted); }
.lead { font-size: var(--fs-lead); line-height: 1.9; color: var(--ink-muted); }
.divider { display: none; }

/* ─── Buttons (new + legacy class names) ─── */
.btn, .btn-white, .btn-dark, .btn-line, .btn-ghost, .btn-primary, .btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 28px;
  border-radius: var(--pill);
  font-family: var(--font-ja);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .02em;
  line-height: 1.2;
  text-transform: none;
  text-align: center;
  white-space: nowrap;
  border: 1px solid transparent;
  opacity: 1;
  transition:
    background-color var(--dur-ui) var(--ease-out),
    color var(--dur-ui) var(--ease-out),
    border-color var(--dur-ui) var(--ease-out),
    transform var(--dur-press) var(--ease-out);
}
.btn:active, .btn-white:active, .btn-dark:active, .btn-line:active, .btn-ghost:active, .btn-primary:active, .btn-outline:active { transform: scale(0.97); }
.btn .arrow { display: inline-block; transition: transform var(--dur-ui) var(--ease-out); }
.btn-primary, .btn-dark { background: var(--ink); color: var(--white); }
.btn-light, .btn-white { background: var(--white); color: var(--ink); }
.btn-ghost, .btn-line, .btn-outline { background: transparent; border-color: rgba(17,19,24,.18); color: var(--ink); }
.btn-accent { background: var(--accent); color: var(--ink); }
.on-dark-block .btn-ghost, .cta-block .btn-ghost, .page-hero .btn-ghost {
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.28);
  color: var(--white);
}

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}
.link-arrow::after { content: '→'; font-family: var(--font-en); transition: transform var(--dur-ui) var(--ease-out); }
.link-arrow.ext::after { content: '↗'; }

/* ═══════════ Navigation ═══════════ */
.site-nav {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--nav-h);
  z-index: 100;
  display: flex;
  align-items: center;
  color: var(--ink);
  transition: color var(--dur-ui) var(--ease-out), box-shadow var(--dur-ui) var(--ease-out);
}
.site-nav::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgba(255,255,255,.72);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  transition: opacity var(--dur-ui) var(--ease-out);
}
.site-nav.scrolled { box-shadow: 0 1px 0 var(--line); }
.site-nav.on-dark { color: var(--white); box-shadow: none; }
.site-nav.on-dark::before { opacity: 0; }
.nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; width: 100%; }
.nav-logo { display: flex; align-items: center; min-height: 44px; }
.nav-logo img { height: 15px; width: auto; transition: filter var(--dur-ui) var(--ease-out); }
.on-dark .nav-logo img { filter: invert(1); }
.nav-links { display: flex; align-items: center; gap: 2px; list-style: none; }
.nav-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  font-family: var(--font-en);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .01em;
  opacity: .72;
  transition: opacity var(--dur-ui) var(--ease-out);
}
.nav-links a[aria-current="page"] { opacity: 1; }
.nav-right { display: flex; align-items: center; gap: 8px; }
.nav-cta {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 18px;
  border-radius: var(--pill);
  background: var(--ink);
  color: var(--white);
  font-family: var(--font-en);
  font-size: 13px;
  font-weight: 600;
  transition: background-color var(--dur-ui) var(--ease-out), color var(--dur-ui) var(--ease-out), transform var(--dur-press) var(--ease-out);
}
.nav-cta:active { transform: scale(0.97); }
.on-dark .nav-cta { background: var(--white); color: var(--ink); }
.hamburger { display: none; position: relative; width: 44px; height: 44px; margin-right: -10px; }
.hamburger span {
  position: absolute;
  left: 12px;
  right: 12px;
  height: 1.5px;
  border-radius: 2px;
  background: currentColor;
  transition: transform 320ms var(--ease-out), top 320ms var(--ease-out);
}
.hamburger span:nth-child(1) { top: 18px; }
.hamburger span:nth-child(2) { top: 25px; }
.hamburger.open span:nth-child(1) { top: 21.5px; transform: rotate(45deg); }
.hamburger.open span:nth-child(2) { top: 21.5px; transform: rotate(-45deg); }

.mobile-nav {
  position: fixed;
  inset: 0;
  z-index: 99;
  display: flex;
  flex-direction: column;
  padding: calc(var(--nav-h) + 16px) var(--gutter) 40px;
  background: rgba(255,255,255,.97);
  -webkit-backdrop-filter: blur(24px);
  backdrop-filter: blur(24px);
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transition: opacity 280ms var(--ease-out), visibility 0s linear 280ms;
}
.mobile-nav.open { opacity: 1; visibility: visible; transition: opacity 280ms var(--ease-out), visibility 0s; }
.m-link {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  min-height: 56px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-en);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -.02em;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 360ms var(--ease-out), transform 360ms var(--ease-out);
  transition-delay: calc(var(--i, 0) * 30ms);
}
.m-link small { font-family: var(--font-ja); font-size: 12px; font-weight: 400; color: var(--ink-muted); letter-spacing: 0; }
.mobile-nav .btn {
  margin-top: 28px;
  width: 100%;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 360ms var(--ease-out), transform 360ms var(--ease-out), background-color var(--dur-ui);
  transition-delay: 280ms;
}
.mobile-nav.open .m-link, .mobile-nav.open .btn { opacity: 1; transform: none; }
body.menu-open .site-nav { color: var(--ink); }
body.menu-open .site-nav::before { opacity: 0; }
body.menu-open .nav-logo img { filter: none; }

/* ═══════════ Page hero (dark) ═══════════ */
.page-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: var(--night);
  color: var(--white);
  padding: calc(var(--nav-h) + clamp(48px, 8vw, 112px)) 0 clamp(56px, 8vw, 104px);
}
.page-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(60% 80% at 92% 0%, rgba(184,154,110,.22) 0%, rgba(184,154,110,0) 60%),
    radial-gradient(40% 60% at 0% 100%, rgba(255,255,255,.05) 0%, rgba(255,255,255,0) 70%);
}
.page-hero::after {
  content: '';
  position: absolute;
  right: -2%;
  bottom: 8%;
  z-index: -1;
  width: min(52vw, 640px);
  aspect-ratio: 620 / 260;
  opacity: .45;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 620 260' fill='none'%3E%3Cpath d='M8 250 C 160 30, 420 -10, 612 120' stroke='%23b89a6e' stroke-width='1.2' stroke-dasharray='3 7'/%3E%3Ccircle cx='612' cy='120' r='5' fill='%23b89a6e'/%3E%3C/svg%3E") center / contain no-repeat;
  pointer-events: none;
}
.page-hero-inner { max-width: 760px; }
.page-hero .label { color: var(--accent); }
.page-hero .section-title,
.page-hero h1 {
  margin-top: 18px;
  font-family: var(--font-en);
  font-size: var(--fs-display);
  font-weight: 700;
  letter-spacing: -.04em;
  line-height: 1.04;
  color: var(--white);
}
.page-hero .section-title em, .page-hero h1 em { font-style: normal; color: var(--accent); }
.page-hero .body-text, .page-hero .page-lead {
  max-width: 600px;
  margin-top: 24px;
  font-size: var(--fs-lead);
  line-height: 1.95;
  color: rgba(255,255,255,.68);
}
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 28px;
  font-family: var(--font-en);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .04em;
  color: rgba(255,255,255,.4);
}
.breadcrumb a { color: rgba(255,255,255,.62); transition: color var(--dur-ui) var(--ease-out); }
.breadcrumb span { color: rgba(255,255,255,.4); }

/* Hero entrance */
.js .page-hero-inner > * { opacity: 0; transform: translateY(16px); animation: heroIn 900ms var(--ease-emph) forwards; }
.js .page-hero-inner > *:nth-child(2) { animation-delay: 60ms; }
.js .page-hero-inner > *:nth-child(3) { animation-delay: 120ms; }
.js .page-hero-inner > *:nth-child(4) { animation-delay: 180ms; }
.js .page-hero-inner > *:nth-child(5) { animation-delay: 240ms; }
.js .page-hero-inner > *:nth-child(n+6) { animation-delay: 300ms; }
@keyframes heroIn { to { opacity: 1; transform: none; } }

/* ═══════════ Shared blocks ═══════════ */
.page-section { padding: var(--section-y) 0; position: relative; }
.page-section.alt, .alt-bg { background: var(--surface); }
.sec-head { margin-bottom: clamp(32px, 4vw, 56px); }
.sec-head .lead, .sec-head .body-text { margin-top: 16px; max-width: 620px; }

/* Dark CTA card */
.cta-block {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  margin-top: clamp(56px, 7vw, 96px);
  padding: clamp(36px, 5vw, 64px);
  border-radius: var(--radius-lg);
  background: var(--night);
  color: var(--white);
}
.cta-block::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(70% 120% at 100% 0%, rgba(184,154,110,.26) 0%, rgba(184,154,110,0) 60%);
}
.cta-block .label { color: var(--accent); }
.cta-block-title {
  margin-top: 14px;
  font-size: clamp(24px, 2.8vw, 34px);
  font-weight: 700;
  letter-spacing: -.01em;
  line-height: 1.35;
  color: var(--white);
}
.cta-block-sub { margin-top: 12px; font-size: 14px; color: rgba(255,255,255,.62); line-height: 1.8; }
.cta-block-actions { display: flex; flex-wrap: wrap; gap: 12px; flex: none; }

/* ═══════════ Footer ═══════════ */
footer { background: var(--night); color: rgba(255,255,255,.6); padding: clamp(64px, 8vw, 104px) 0 40px; }
.footer-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: 48px;
  padding-bottom: 56px;
  border-bottom: 1px solid var(--line-dark);
}
.footer-brand img { height: 32px; width: auto; filter: invert(1); opacity: .9; }
.footer-tagline { margin-top: 14px; font-size: var(--fs-small); color: rgba(255,255,255,.45); }
.footer-nav { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; }
.footer-nav-title { margin-bottom: 16px; font-family: var(--font-en); font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: rgba(255,255,255,.38); }
.footer-nav-links { list-style: none; display: flex; flex-direction: column; gap: 2px; }
.footer-nav-links a { display: inline-flex; align-items: center; min-height: 34px; font-size: 14px; color: rgba(255,255,255,.72); transition: color var(--dur-ui) var(--ease-out); }
.footer-bottom { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 32px; }
.footer-copy { font-family: var(--font-en); font-size: 12px; color: rgba(255,255,255,.38); }
.footer-social { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.footer-social a { display: inline-flex; align-items: center; min-height: 44px; font-family: var(--font-en); font-size: 12px; font-weight: 500; letter-spacing: .06em; color: rgba(255,255,255,.55); transition: color var(--dur-ui) var(--ease-out); }

/* ═══════════ Mobile sticky CTA / swipe carousels ═══════════ */
.m-cta-bar { display: none; }
.swipe-dots { display: none; }

/* ═══════════ Scroll reveal ═══════════ */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity var(--dur-reveal) var(--ease-out), transform var(--dur-reveal) var(--ease-out); transition-delay: var(--d, 0ms); }
.js .reveal.in { opacity: 1; transform: none; }

/* ═══════════ Hover (pointer devices only) ═══════════ */
@media (hover: hover) and (pointer: fine) {
  .nav-links a:hover { opacity: 1; }
  .nav-cta:hover { background: var(--ink-2); }
  .on-dark .nav-cta:hover { background: #e9e9e9; }
  .btn-primary:hover, .btn-dark:hover { background: var(--ink-2); }
  .btn-light:hover, .btn-white:hover { background: #ececec; }
  .btn-ghost:hover, .btn-line:hover, .btn-outline:hover { border-color: var(--ink); }
  .cta-block .btn-ghost:hover, .page-hero .btn-ghost:hover, .on-dark-block .btn-ghost:hover { background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.5); }
  .btn-accent:hover { background: #c7ab82; }
  .btn:hover .arrow, .link-arrow:hover::after { transform: translateX(3px); }
  .link-arrow.ext:hover::after { transform: translate(2px, -2px); }
  .breadcrumb a:hover { color: var(--white); }
  .footer-nav-links a:hover, .footer-social a:hover { color: var(--white); }
}

/* ═══════════ Responsive ═══════════ */
@media (max-width: 1024px) {
  .nav-links, .nav-cta { display: none; }
  .hamburger { display: block; }
  .footer-top { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  :root { --nav-h: 56px; }
  .cta-block { flex-direction: column; align-items: flex-start; }
  .cta-block-actions { width: 100%; flex-direction: column; }
  .cta-block-actions > * { width: 100%; }
  .page-hero::after { width: 78vw; bottom: 4%; opacity: .3; }
  .page-hero .body-text br, .page-hero .page-lead br { display: none; }
  .footer-nav { grid-template-columns: 1fr 1fr; }
  .footer-bottom { flex-direction: column-reverse; align-items: flex-start; }

  .m-cta-bar {
    display: block;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 90;
    padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom));
    background: rgba(255,255,255,.8);
    -webkit-backdrop-filter: blur(20px) saturate(1.6);
    backdrop-filter: blur(20px) saturate(1.6);
    box-shadow: 0 -1px 0 var(--line);
    transform: translateY(110%);
    visibility: hidden;
    transition: transform 420ms var(--ease-out), visibility 0s linear 420ms;
  }
  .m-cta-bar.show { transform: none; visibility: visible; transition: transform 420ms var(--ease-out), visibility 0s; }
  body.menu-open .m-cta-bar { transform: translateY(110%); visibility: hidden; }
  .m-cta-bar .btn { width: 100%; }

  /* Horizontal swipe carousel: add .swipe to a card list, follow it with .swipe-dots */
  .swipe {
    display: flex;
    flex-direction: row;
    margin-left: calc(var(--gutter) * -1);
    margin-right: calc(var(--gutter) * -1);
    padding: 4px var(--gutter) 12px;
    gap: 12px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: var(--gutter);
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .swipe::-webkit-scrollbar { display: none; }
  .swipe > * { flex: 0 0 86%; scroll-snap-align: start; }
  .swipe-dots { display: flex; justify-content: center; gap: 6px; margin-top: 10px; }
  .swipe-dots span {
    width: 6px;
    height: 6px;
    border-radius: var(--pill);
    background: rgba(17,19,24,.18);
    transition: width var(--dur-ui) var(--ease-out), background-color var(--dur-ui) var(--ease-out);
  }
  .swipe-dots span.on { width: 18px; background: var(--ink); }
}

@media (prefers-reduced-transparency: reduce) {
  .site-nav::before, .m-cta-bar { background: #fff; -webkit-backdrop-filter: none; backdrop-filter: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .page-hero-inner > * { animation: none; opacity: 1; transform: none; }
  .js .reveal { transform: none; transition: opacity 400ms ease; }
  .m-link, .mobile-nav .btn { transform: none; }
  .m-cta-bar, .m-cta-bar.show, .swipe-dots span { transition: none; }
  .btn:active, .btn-white:active, .btn-dark:active, .btn-line:active, .btn-ghost:active, .btn-primary:active, .btn-outline:active, .nav-cta:active { transform: none; }
}
