/* ====================================
   株式会社新翔工業 HP デザイン設定 (v3)
   ==================================== */

/* ここを変更すると全体の色が変わります */
:root {
  --navy: #122c4b;
  --navy-light: #203e5e;
  --red: #b71930;
  --white: #ffffff;
  --background: #f3f6f9;
  --text: #1c2d40;
  --muted: #617184;
  --border: #e1e7ee;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 85px;
}

body {
  margin: 0;
  font-family: "Noto Sans JP", "Yu Gothic", Meiryo, sans-serif;
  color: var(--text);
  background: var(--white);
}

button, a {
  -webkit-tap-highlight-color: transparent;
}

button {
  font-family: inherit;
  cursor: pointer;
}

a {
  text-decoration: none;
}

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

.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ヘッダー（グラスモーフィズム対応） */

.site-header {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(225, 231, 238, 0.7);
  position: sticky;
  top: 0;
  z-index: 100;
  transition: background 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.site-header.is-scrolled {
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom-color: rgba(225, 231, 238, 0.45);
  box-shadow: 0 8px 30px rgba(18, 44, 75, 0.08);
}

.header-inner {
  min-height: 78px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.logo {
  display: block;
  flex-shrink: 0;
}

.logo img {
  width: 245px;
  height: auto;
  max-height: 65px;
  object-fit: contain;
  object-position: left;
}

.logo-fallback {
  color: var(--red);
  font-size: 26px;
  font-weight: 900;
  font-style: italic;
}

.logo-fallback small {
  display: block;
  color: var(--navy);
  font-size: 11px;
  font-style: normal;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 17px;
}

.main-nav a {
  font-size: 13px;
  font-weight: 700;
  color: var(--navy);
  transition: color .2s;
}

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

.main-nav .nav-contact {
  color: white;
  background: var(--navy);
  padding: 13px 18px;
  border-radius: 4px;
  transition: background-color .2s;
}

.main-nav .nav-contact:hover {
  background: var(--red);
  color: white;
}

.menu-toggle {
  display: none;
  border: 0;
  background: var(--navy);
  color: white;
  padding: 12px 16px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 700;
}

/* メインビジュアル */

.hero {
  position: relative;
  min-height: 540px;
  display: flex;
  align-items: center;
  overflow: hidden;
  background-color: var(--navy);
}

.hero-slider {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.hero-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 1.5s ease-in-out;
  pointer-events: none;
}

.hero-slide.active {
  opacity: 1;
}

.hero-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transform: scale(1);
  transition: transform 6s cubic-bezier(0.25, 1, 0.5, 1);
}

.hero-slide.active img {
  transform: scale(1.06);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  background: linear-gradient(
    90deg,
    rgba(12, 32, 55, 0.94) 0%,
    rgba(12, 32, 55, 0.70) 55%,
    rgba(12, 32, 55, 0.25) 100%
  );
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 2;
  width: 100%;
  padding-top: 85px;
  padding-bottom: 85px;
}

.eyebrow,
.section-label {
  display: inline-block;
  color: var(--red);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .18em;
}

.eyebrow,
.light-label {
  color: #f2b6c1;
}

.hero h1 {
  font-size: clamp(34px, 5vw, 60px);
  line-height: 1.4;
  letter-spacing: .035em;
  font-weight: 900;
  color: white;
  margin: 15px 0 20px;
}

.accent-line {
  width: 50px;
  height: 4px;
  background: var(--red);
}

.hero p {
  color: #e7edf4;
  line-height: 2;
  font-size: 14px;
  margin: 22px 0 28px;
}

.button-group {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.button {
  display: inline-block;
  padding: 13px 21px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
  border: 1px solid transparent;
  transition: transform .2s, opacity .2s;
}

.button:hover {
  transform: translateY(-2px);
  opacity: .9;
}

.button-red {
  color: white;
  background: var(--red);
}

.button-white {
  color: var(--navy);
  background: white;
}

.button-outline {
  background: transparent;
  border-color: var(--navy);
  color: var(--navy);
}

.button-instagram {
  background: #ffffff;
  color: var(--navy);
  border: 1px solid rgba(255, 255, 255, 0.9);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease, background-color .2s ease;
}

.button-instagram:hover {
  background-color: #ffffff;
  border-color: #e1306c;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(225, 48, 108, 0.3);
}

.instagram-logo-img {
  width: 22px;
  height: 22px;
  border-radius: 5px;
  flex-shrink: 0;
  display: block;
}

/* 共通セクション */

.section {
  padding: 75px 0;
}

.section-light {
  background: var(--background);
}

.section h2 {
  font-size: clamp(23px, 3vw, 34px);
  font-weight: 900;
  color: var(--navy);
  line-height: 1.45;
  margin: 13px 0 18px;
}

.lead {
  color: var(--muted);
  font-size: 14px;
  line-height: 2;
  max-width: 820px;
}

.small-note {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.8;
  margin-top: 18px;
}

/* 4事業カード */

.card-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 17px;
  margin-top: 32px;
}

.service-card,
.work-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 5px 18px rgba(18, 44, 75, .05);
  display: flex;
  flex-direction: column;
}

.service-card img,
.work-card img,
.image-placeholder {
  width: 100%;
  height: 160px;
  object-fit: cover;
}

.image-placeholder {
  background: #e4eaf0;
  color: #536981;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 12px;
  line-height: 1.8;
}

.card-body {
  padding: 20px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.card-number {
  color: var(--red);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .09em;
}

.card-body h3 {
  color: var(--navy);
  font-size: 18px;
  margin: 10px 0;
}

.card-body p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.9;
  margin-bottom: 12px;
  flex-grow: 1;
}

.text-button {
  border: none;
  background: transparent;
  padding: 8px 0;
  color: var(--red);
  font-size: 12px;
  font-weight: 800;
  text-align: left;
  transition: opacity .2s;
}

.text-button:hover {
  opacity: .75;
}

#serviceDetail[hidden] {
  display: none;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.tag {
  color: var(--navy);
  background: #e4eaf1;
  padding: 10px 14px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
}

.detail-actions {
  margin-top: 28px;
}

/* 実績数字 */

.statistics {
  background: var(--navy);
  color: white;
}

.statistics h2 {
  color: white;
}

.statistics > .container > p {
  color: #d6e0eb;
  font-size: 13px;
  line-height: 1.9;
}

.statistics-grid {
  margin-top: 30px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}

.stat-item {
  padding: 15px;
  text-align: center;
  border-right: 1px solid #506780;
}

.stat-item:last-child {
  border: none;
}

.stat-item strong {
  display: block;
  color: white;
  font-size: clamp(20px, 2.6vw, 30px);
  font-weight: 900;
}

.stat-item span {
  display: block;
  color: #d7e1ec;
  font-size: 12px;
  line-height: 1.7;
  margin-top: 12px;
}

/* 強み */

.strength-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 28px;
}

.strength-card {
  background: var(--background);
  border-top: 4px solid var(--red);
  padding: 25px;
  border-radius: 4px;
}

.strength-card span {
  color: var(--red);
  font-size: 11px;
  font-weight: 800;
}

.strength-card h3 {
  color: var(--navy);
  margin: 14px 0;
}

.strength-card p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.9;
}

/* 施工実績 */

.filter-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin: 28px 0;
}

.filter {
  background: white;
  border: 1px solid #cbd5df;
  color: var(--navy);
  padding: 10px 16px;
  border-radius: 4px;
  font-weight: 800;
  font-size: 12px;
  transition: all .2s;
}

.filter.active {
  background: var(--navy);
  color: white;
  border-color: var(--navy);
}

.works-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.work-card img,
.work-card .image-placeholder {
  height: 190px;
}

.work-card h3 {
  color: var(--navy);
  font-size: 16px;
}

.work-card[data-hidden="true"] {
  display: none;
}

/* 会社概要 */

.company-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: start;
  gap: 45px;
}

.company-box {
  background: var(--background);
  padding: 27px;
  border-top: 4px solid var(--red);
  border-radius: 4px;
}

.company-box h3 {
  color: var(--navy);
  margin-top: 0;
}

.company-box dl {
  display: grid;
  grid-template-columns: 105px 1fr;
  gap: 0;
  margin: 0;
}

.company-box dt,
.company-box dd {
  font-size: 12px;
  padding: 14px 0;
  margin: 0;
  border-bottom: 1px solid #d9e2eb;
}

.company-box dt {
  font-weight: 800;
}

/* 採用・協力会社 */

.two-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 28px;
}

.dark-card {
  background: var(--navy);
  padding: 38px;
  border-radius: 6px;
  color: white;
}

.dark-card span {
  font-size: 11px;
  letter-spacing: .15em;
  color: #ebb2bd;
  font-weight: 800;
}

.dark-card h3 {
  font-size: 25px;
  margin: 15px 0;
}

.dark-card p {
  font-size: 13px;
  line-height: 2;
  color: #d8e2ec;
  margin-bottom: 24px;
}

/* 社会貢献 */
.social-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-top: 32px;
}

/* 問い合わせ */

.contact-section {
  background: #eaf0f5;
}

.contact-panel {
  background: var(--navy);
  padding: 45px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 25px;
}

.contact-panel h2 {
  color: white;
  margin: 10px 0 15px;
}

.contact-panel p {
  color: #dce5ef;
  font-size: 13px;
  line-height: 2;
  margin: 0;
}

.contact-panel .phone {
  display: block;
  color: white;
  font-weight: 900;
  font-size: 29px;
  margin-top: 15px;
  transition: opacity .2s;
}

.contact-panel .phone:hover {
  opacity: .85;
}

/* フッター */

.site-footer {
  background: #0d2035;
  color: #d4deea;
  padding: 36px 0;
}

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

.footer-inner strong {
  font-size: 20px;
  color: white;
  display: block;
  margin-bottom: 6px;
}

.footer-inner p {
  margin: 6px 0;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-links a {
  color: #d4deea;
  transition: color .2s;
}

.footer-links a:hover {
  color: white;
}

/* ====================================
   タブレット・スマートフォン
   ==================================== */

@media (max-width: 950px) {
  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    padding: 18px 24px;
    border-bottom: 1px solid rgba(225, 231, 238, 0.7);
    box-shadow: 0 16px 36px rgba(18, 44, 75, 0.12);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  .main-nav.open {
    display: flex;
  }

  .main-nav a {
    padding: 14px 5px;
    border-bottom: 1px solid var(--border);
  }

  .main-nav .nav-contact {
    text-align: center;
    margin-top: 12px;
  }

  .menu-toggle {
    display: block;
  }

  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .statistics-grid {
    grid-template-columns: repeat(2, 1fr);
    row-gap: 20px;
  }

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

  .works-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .strength-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .container {
    padding: 0 17px;
  }

  .header-inner {
    min-height: 68px;
  }

  .logo img {
    width: 190px;
  }

  .hero {
    min-height: 480px;
  }

  .hero-overlay {
    background: linear-gradient(
      180deg,
      rgba(12, 32, 55, 0.88) 0%,
      rgba(12, 32, 55, 0.82) 50%,
      rgba(12, 32, 55, 0.90) 100%
    );
  }

  .hero-content {
    padding-top: 55px;
    padding-bottom: 55px;
  }

  .hero p {
    font-size: 12px;
  }

  .section {
    padding: 50px 0;
  }

  .card-grid,
  .strength-grid,
  .works-grid,
  .social-grid,
  .company-grid,
  .two-cards {
    grid-template-columns: 1fr;
  }

  .statistics-grid {
    grid-template-columns: 1fr;
    row-gap: 15px;
  }

  .stat-item {
    border-right: none;
    border-bottom: 1px solid #506780;
    padding-bottom: 20px;
  }

  .stat-item:last-child {
    border-bottom: none;
  }

  .company-box dl {
    grid-template-columns: 90px 1fr;
  }

  .contact-panel {
    flex-direction: column;
    text-align: center;
    padding: 30px 20px;
  }

  .contact-panel .button-group {
    width: 100%;
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
    gap: 16px;
  }

  .footer-links {
    justify-content: center;
  }
}

/* ====================================
   スクロールアニメーション & インタラクション
   ==================================== */

.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* スタッガーアニメーション（グリッド内の子要素に時差） */
.stagger-group .reveal:nth-child(1) { transition-delay: 0.05s; }
.stagger-group .reveal:nth-child(2) { transition-delay: 0.15s; }
.stagger-group .reveal:nth-child(3) { transition-delay: 0.25s; }
.stagger-group .reveal:nth-child(4) { transition-delay: 0.35s; }
.stagger-group .reveal:nth-child(5) { transition-delay: 0.45s; }
.stagger-group .reveal:nth-child(6) { transition-delay: 0.55s; }

/* カードインタラクションの向上 */
.service-card,
.work-card,
.strength-card,
.dark-card,
.company-box {
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.service-card:hover,
.work-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 14px 32px rgba(18, 44, 75, 0.12);
}

.strength-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 24px rgba(18, 44, 75, 0.08);
}

.dark-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 32px rgba(12, 32, 55, 0.28);
}

/* 数字統計のアニメーション・強調 */
.stat-item {
  transition: transform 0.3s ease;
}

.stat-item:hover {
  transform: scale(1.03);
}

/* ユーザーの動作軽減設定（a11y） */
@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .hero-slide {
    transition: opacity 0.3s ease !important;
  }
  .hero-slide img {
    transform: none !important;
    transition: none !important;
  }
}
