/* ============================================================
   NSP inc. — Global Design System v4
   Apple-inspired card system
   ============================================================ */

:root {
  --bg:          #f5f5f7;
  --card-bg:     #ffffff;
  --dark-bg:     #1d1d1f;
  --white:       #1d1d1f;
  --muted:       #6e6e73;
  --dim:         #a1a1a6;
  --border:      rgba(0, 0, 0, 0.08);
  --border-mid:  rgba(0, 0, 0, 0.15);
  --shadow:      0 2px 24px rgba(0, 0, 0, 0.06), 0 1px 4px rgba(0, 0, 0, 0.04);
  --shadow-hover:0 20px 64px rgba(0, 0, 0, 0.13), 0 4px 16px rgba(0, 0, 0, 0.06);
  --font: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Inter', 'Segoe UI', sans-serif;
  --header-h:   52px;
  --ease:        cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out:    cubic-bezier(0, 0, 0.2, 1);
  --r-card:      20px;
  --r-pill:      980px;
  --gap:         16px;
}

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

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

body {
  background: var(--bg);
  color: var(--white);
  font-family: var(--font);
  line-height: 1.75;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: var(--white);
  color: var(--bg);
}

/* ----- Layout ----- */
.container {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 80px;
  min-width: 0;
}

/* ----- Header ----- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 200;
  height: var(--header-h);
  border-bottom: 1px solid var(--border);
  background: rgba(245, 245, 247, 0.88);
  backdrop-filter: blur(28px) saturate(1.8);
  -webkit-backdrop-filter: blur(28px) saturate(1.8);
}

.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 48px;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 80px;
  min-width: 0;
}

.site-logo {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--white);
  text-decoration: none;
  flex-shrink: 0;
  transition: opacity 0.25s var(--ease);
}

.site-logo:hover { opacity: 0.5; }

.site-nav {
  display: flex;
  gap: 28px;
  flex: 1;
}

.nav-link {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  letter-spacing: 0.01em;
  transition: color 0.2s var(--ease);
}

.nav-link:hover { color: var(--white); }

/* ----- Language Switcher ----- */
.lang-switcher {
  display: flex;
  gap: 4px;
  margin-left: auto;
  flex-shrink: 0;
}

.lang-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--dim);
  font-family: var(--font);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  cursor: pointer;
  padding: 5px 12px;
  border-radius: var(--r-pill);
  transition: all 0.2s var(--ease);
}

.lang-btn:hover:not(.active) {
  color: var(--white);
  border-color: var(--border-mid);
}

.lang-btn.active {
  color: var(--white);
  border-color: rgba(0, 0, 0, 0.28);
  background: rgba(0, 0, 0, 0.06);
}

/* ----- Hero ----- */
.hero-section {
  padding: calc(var(--header-h) + 180px) 0 180px;
}

.section-eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 32px;
}

.display-text,
.display-text--hero {
  font-size: clamp(1.6rem, 7.8vw, 9.6rem);
  font-weight: 800;
  letter-spacing: -0.05em;
  line-height: 1.04;
  color: var(--white);
  margin-bottom: 64px;
  word-break: keep-all;
  overflow-wrap: break-word;
}

.display-text--hero div {
  width: max-content;
  max-width: 100%;
}

.lead-text {
  font-size: 1.05rem;
  color: var(--muted);
  max-width: 520px;
  line-height: 1.9;
  margin-bottom: 80px;
  letter-spacing: 0.003em;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--white);
  text-decoration: none;
  border-bottom: 1px solid rgba(0, 0, 0, 0.18);
  padding-bottom: 2px;
  transition: border-color 0.2s, gap 0.25s var(--ease);
}

.text-link:hover {
  border-color: var(--white);
  gap: 12px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
}

/* ----- Marquee ----- */
.marquee-wrap {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  padding: 15px 0;
  user-select: none;
}

.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee-scroll 36s linear infinite;
}

.marquee-group {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.marquee-item {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--dim);
  padding: 0 28px;
  white-space: nowrap;
}

.marquee-sep {
  color: var(--border-mid);
  font-size: 10px;
}

@keyframes marquee-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ----- Generic Section ----- */
.section {
  padding: 176px 0;
  border-top: 1px solid var(--border);
}

.section-header {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 56px;
}

.section-num {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--dim);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.section-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}

/* =====================================================
   CARD SYSTEM — Apple-inspired floating cards
   ===================================================== */

/* ----- Card Grid ----- */
.services-grid,
.products-grid,
.articles-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--gap);
  /* シャドウが四辺から見えるよう余白を確保 */
  padding: 8px;
  margin: -8px;
}

/* ----- Shared Card Base ----- */
.service-item,
.product-card,
.article-card {
  background: var(--card-bg);
  border-radius: var(--r-card);
  box-shadow: var(--shadow);
  transition: box-shadow 0.35s var(--ease), transform 0.35s var(--ease), background 0.25s var(--ease);
}

/* ----- Service Cards ----- */
.service-item {
  padding: 64px 60px;
}

.service-item:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-4px);
}

.service-category {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 28px;
}

.service-name {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--white);
  line-height: 1.35;
  margin-bottom: 20px;
  word-break: keep-all;
}

.service-desc {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.95;
}

/* ----- Product Cards ----- */
.product-card {
  padding: 64px 60px;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.product-card[href]:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-6px);
}

.product-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 28px;
}

.product-card-icon {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  margin-bottom: 32px;
  display: block;
  flex-shrink: 0;
}

.product-name {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--white);
  line-height: 1.2;
  margin-bottom: 16px;
  word-break: keep-all;
}

.product-desc {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.9;
  flex: 1;
  margin-bottom: 40px;
}

.product-footer {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.product-price {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--white);
  letter-spacing: -0.03em;
}

.product-price-note {
  font-size: 11px;
  color: var(--dim);
  letter-spacing: 0.04em;
}

.product-price-live {
  color: #34c759;
  font-weight: 600;
}

.product-arrow {
  margin-left: auto;
  font-size: 1rem;
  color: var(--dim);
  transition: transform 0.3s var(--ease), color 0.3s var(--ease);
}

.product-card[href]:hover .product-arrow {
  transform: translateX(8px);
  color: var(--white);
}

.product-card--dim {
  opacity: 0.28;
  pointer-events: none;
}

/* ----- Article Cards ----- */
.article-card {
  padding: 52px 52px;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.article-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-4px);
}

.article-meta {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 10px;
}

.article-date {
  font-variant-numeric: tabular-nums;
}

.article-title {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--white);
  line-height: 1.55;
  margin-bottom: 14px;
  word-break: break-word;
  overflow-wrap: break-word;
  flex: 1;
}

.article-excerpt {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.9;
  word-break: break-word;
  overflow-wrap: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.articles-placeholder {
  font-size: 0.9rem;
  color: var(--muted);
}

.articles-more {
  margin-top: 32px;
}

/* ----- Contact Section: Dark ----- */
.section--dark {
  background: var(--dark-bg);
  border-top: none;
}

.section--dark .section-num,
.section--dark .section-label {
  color: rgba(255, 255, 255, 0.35);
}

.section--dark .cta-heading {
  color: #f5f5f7;
}

/* ----- Contact Grid ----- */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
  margin-top: 64px;
  margin-bottom: 64px;
  padding: 8px;
  margin-left: -8px;
  margin-right: -8px;
}

.contact-item {
  padding: 52px 44px;
  border-radius: var(--r-card);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.09);
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease), transform 0.3s var(--ease);
}

.contact-item:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-3px);
}

.contact-item-title {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: #f5f5f7;
  margin-bottom: 14px;
  line-height: 1.4;
}

.contact-item-desc {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.5);
  line-height: 1.85;
}

.contact-cta {
  display: inline-block;
}

/* ----- CTA Heading ----- */
.cta-heading {
  font-size: clamp(1.8rem, 4vw, 3.6rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.15;
  color: var(--white);
  margin-bottom: 0;
  max-width: 680px;
  word-break: keep-all;
  overflow-wrap: break-word;
}

.cta-sub {
  font-size: 1rem;
  color: var(--muted);
  max-width: 480px;
  line-height: 1.9;
  margin-bottom: 48px;
  letter-spacing: 0.003em;
}

/* Legacy — kept for backwards compat */
.contact-offer-list { display: none; }

/* ----- Buttons ----- */
.btn {
  display: inline-block;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: all 0.25s var(--ease);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.btn-white {
  background: #f5f5f7;
  color: var(--dark-bg);
  padding: 16px 44px;
  border-radius: var(--r-pill);
}

.btn-white:hover {
  background: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}

.btn-outline {
  background: transparent;
  color: var(--white);
  border: 1px solid var(--border-mid);
  padding: 15px 32px;
  border-radius: var(--r-pill);
}

.btn-outline:hover {
  border-color: rgba(0, 0, 0, 0.4);
  background: rgba(0, 0, 0, 0.05);
  transform: translateY(-1px);
}

/* ----- Footer ----- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 56px 0;
  background: var(--bg);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-copy {
  font-size: 11px;
  color: var(--dim);
  letter-spacing: 0.03em;
}

/* ----- Language Visibility ----- */
html[lang="en"] [lang-jp] { display: none !important; }
html[lang="jp"] [lang-en] { display: none !important; }

/* ===== ANIMATIONS ===== */

@keyframes hero-rise {
  from { opacity: 0; transform: translateY(36px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fade-reveal {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@media (prefers-reduced-motion: no-preference) {
  [data-anim] {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity 0.85s var(--ease-out), transform 0.85s var(--ease-out);
    will-change: opacity, transform;
  }

  [data-anim].in-view {
    opacity: 1;
    transform: translateY(0);
  }

  .hero-enter {
    animation: hero-rise 1s var(--ease-out) both;
    will-change: opacity, transform;
  }

  .marquee-wrap {
    animation: fade-reveal 0.7s var(--ease-out) 0.5s both;
  }
}

/* ----- Responsive ----- */
@media (max-width: 1200px) {
  .container,
  .header-inner {
    padding: 0 60px;
  }
}

@media (max-width: 1024px) {
  .container,
  .header-inner {
    padding: 0 48px;
  }

  .services-grid,
  .products-grid,
  .articles-grid,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .service-item,
  .product-card,
  .article-card {
    padding: 52px 48px;
  }

  .contact-item {
    padding: 44px 40px;
  }
}

@media (max-width: 768px) {
  .section {
    padding: 120px 0;
  }

  .hero-section {
    padding: calc(var(--header-h) + 100px) 0 120px;
  }
}

@media (max-width: 640px) {
  :root {
    --header-h: 56px;
    --gap: 12px;
  }

  .container,
  .header-inner {
    padding: 0 24px;
  }

  .header-inner { gap: 12px; }
  .site-nav { display: none; }

  .hero-section {
    padding-top: calc(var(--header-h) + 72px);
    padding-bottom: 96px;
  }

  .hero-actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .lead-text {
    font-size: 1rem;
    margin-bottom: 56px;
  }

  .section { padding: 96px 0; }
  .section-header { margin-bottom: 40px; }

  .service-item,
  .product-card,
  .article-card,
  .contact-item {
    padding: 44px 32px;
  }

  .product-name { font-size: 1.65rem; }
  .service-name { font-size: 1.25rem; }

  .display-text--hero {
    overflow-wrap: break-word;
    word-break: break-word;
  }

  .display-text--hero div {
    white-space: normal !important;
    width: auto !important;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .btn-white,
  .btn-outline {
    width: 100%;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .cta-heading { font-size: 1.65rem; }
}
