/* ==============================
   HOME / TOP PAGE
   index.html 専用
   ============================== */

/* ==============================
   1) ページ変数・ヒーロー基本設定
   ============================== */
body.page-top {
  --hero-anim: hero-zoomfade;
  --hero-duration: 2.4s;
  --hero-scale-start: 1.08;
  --hero-gray-start: 100%;
  --hero-bright-start: 1.2;
  --cap-delay: 1.1s;
}

/* ==============================
   2) セクション共通余白
   ============================== */
.page-top .section {
  margin: 0 0 22px;
}

.page-top .panel--top {
  padding: 18px 20px 20px;
}

/* ==============================
   3) ヒーロー
   ============================== */
.page-top .top-img {
  min-height: clamp(340px, 48vh, 640px);
}

.page-top .top-img .cap {
  padding: clamp(14px, 2.2vw, 22px) clamp(18px, 3vw, 30px);
}

.page-top .top-img .cap-bg {
  padding: clamp(12px, 1.8vw, 18px) clamp(16px, 2.6vw, 24px);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.34);
}

.page-top .top-img .hero-title {
  font-size: clamp(30px, 4.5vw, 40px);
  line-height: 1.18;
}

.page-top .top-img .sub {
  font-size: clamp(15px, 1.9vw, 19px);
  line-height: 1.55;
}

/* HERO文字装飾 */
body.page-top .top-img .cap h1 {
  color: #fff;
  text-shadow:
    0 1px 0 rgba(0,0,0,.45),
    0 2px 6px rgba(0,0,0,.35),
    0 0 24px rgba(0,0,0,.15);
  background-image:
    linear-gradient(transparent calc(100% - 6px), rgba(255,255,255,0.55) 0);
  background-repeat: no-repeat;
  background-position: 0 0;
  background-size: 100% 100%;
}

body.page-top .top-img .cap p {
  color: rgba(255,255,255,.92);
  text-shadow:
    0 1px 0 rgba(0,0,0,.35),
    0 2px 10px rgba(0,0,0,.25);
}

/* ==============================
   4) セクション見出し
   ============================== */
body.page-top .section-head .eyebrow {
  width: 80px;
  text-align: center;
  white-space: nowrap;
  padding: 3px 0;
}

/* ==============================
   5) 新着情報
   ============================== */
.page-top .section--news .panel {
  padding-top: 16px;
  padding-bottom: 18px;
}

.page-top .section--news .company-head {
  margin-bottom: 14px;
}

.page-top .section--news .news-item {
  display: grid;
  grid-template-columns: 96px 88px minmax(0, 1fr);
  align-items: center;
  column-gap: 12px;
  padding: 8px 14px;
  margin-bottom: 8px;
  border-radius: 12px;
  line-height: 1.3;
}

.page-top .section--news .news-date {
  font-size: 15px;
  color: #6b7280;
}

.page-top .section--news .news-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 14px;
  line-height: 1.2;
  white-space: nowrap;
}

.page-top .section--news .news-link {
  font-size: 15px;
  line-height: 1.6;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}

/* ==============================
   6) 会社情報カード
   ============================== */
.page-top .company-grid {
  gap: 16px;
}

.page-top .company-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid #e5e7eb;
  background: #fff;
  box-shadow: 0 6px 18px rgba(2,6,23,.06);
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}

.page-top .company-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(2,6,23,.12);
  border-color: #dbe1ea;
}

.page-top .company-thumb {
  height: 200px;
  background: #f6f8fb;
  overflow: hidden;
}

.page-top .company-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(0.92);
  transition: transform .25s ease;
}

.page-top .company-card:hover .company-thumb img {
  transform: scale(1.02);
}

.page-top .company-body {
  flex: 1;
  display: flex;
  gap: 8px;
  padding: 8px 18px 18px;
}

.page-top .company-label {
  display: inline-block;
  width: max-content;
  padding: 3px 10px;
  line-height: 1;
  font-size: 12px;
  letter-spacing: .08em;
  color: #1e40af;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
}

.page-top .company-card .company-title {
  margin: 2px 0 0;
  font-size: 19px;
  font-weight: 600;
  color: #0f172a;
}

.page-top .company-desc {
  margin-top: auto;
  color: #475569;
  font-size: 15px;
  line-height: 1.65;
}

/* ==============================
   7) 施工実績 / 採用情報 ワイドバナー
   ============================== */
.page-top .wide {
  position: relative;
  height: 220px;
  margin: 10px 0 14px;
  border-radius: 18px;
  overflow: hidden;
}

.page-top .wide .bg {
  background-position: center center;
  transform: scale(1.01);
}

.page-top .wide:hover .bg {
  transform: scale(1.04);
}

.page-top .wide .overlay {
  background: linear-gradient(
    0deg,
    rgba(2, 6, 23, 0.52),
    rgba(2, 6, 23, 0.16)
  );
}

.page-top .wide .cap {
  position: absolute;
  inset: 0;
  z-index: 1;
  padding: 18px 20px 18px;
  color: #fff;
}

.page-top .wide .section-head {
  position: absolute;
  top: 18px;
  left: 20px;
  right: 20px;
  margin: 0;
  min-height: 42px;
  padding: 5px 14px;
  gap: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.68);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.page-top .wide .section-head .eyebrow {
  padding: 4px 12px;
  font-size: 0.78rem;
}

.page-top .wide .section-head h2 {
  width: auto;
  font-size: 22px;
  line-height: 1.25;
}

.page-top .wide .section-head h2::after {
  width: 72px;
  height: 4px;
}

.page-top .wide .cap p {
  position: relative;
  left: 0;
  right: 0;
  margin: 0;
  max-width: 920px;
  font-size: 16px;
  line-height: 1.7;
  color: #f8fafc;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.36);
}

.page-top .section--works .wide .cap p:first-of-type,
.page-top .section--recruit .wide .cap p:first-of-type {
  margin-top: 90px;
}

.page-top .section--works .wide .cap p + p,
.page-top .section--recruit .wide .cap p + p {
  margin-top: 2px;
}

/* ==============================
   8) PC限定アニメーション
   ============================== */
@media (min-width: 769px) {
  body.page-top .top-img .cap h1 {
    position: relative;
    z-index: 0;
    background: none;
    background-image: none;
    opacity: 0;
    transform: translateY(6px);
    animation: hero-title-in 1.10s ease-out calc(var(--cap-delay, 1s) + .05s) forwards;
    text-shadow: 0 2px 8px rgba(0,0,0,.55), 0 0 1px rgba(0,0,0,.8);
    color: #fff;
  }

  body.page-top .top-img .cap h1::before {
    content: "";
    position: absolute;
    left: -10px;
    right: -10px;
    bottom: -8px;
    height: 14px;
    border-radius: 8px;
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
    opacity: .92;
    transform-origin: left center;
    transform: scaleX(0);
    animation: hero-highlight 1.3s cubic-bezier(.2,.8,.2,1) calc(var(--cap-delay, 1s) + .10s) forwards;
    z-index: -1;
  }

  body.page-top .top-img .cap .sub {
    position: relative;
    display: inline-block;
    margin-top: 10px;
    opacity: 0;
    transform: translateY(8px);
    animation: sub-fade-in 0.8s ease-out calc(var(--cap-delay,1s) + 1.3s) forwards;
  }

  body.page-top .top-img .cap .sub::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -12px;
    width: 100%;
    height: 14px;
    background: url("data:image/svg+xml;utf8,\
      <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 240 14' preserveAspectRatio='none'>\
        <path d='M0 7 \
                 Q10 0,20 7 T40 7 T60 7 T80 7 T100 7 \
                 T120 7 T140 7 T160 7 T180 7 T200 7 T220 7 T240 7' \
              fill='none' stroke='%2360a5fa' stroke-width='3' stroke-linecap='round'/>\
      </svg>") no-repeat left center;
    background-size: 100% 100%;
    transform-origin: left center;
    transform: scaleX(0);
    opacity: 0;
    animation: sub-wave-grow 1.8s ease-out calc(var(--cap-delay,1s) + 1.7s) forwards;
  }

  @keyframes hero-highlight {
    from { transform: scaleX(0); }
    to   { transform: scaleX(1); }
  }

  @keyframes hero-title-in {
    from { opacity: 0; transform: translateY(6px); filter: blur(1px); }
    to   { opacity: 1; transform: translateY(0); filter: blur(0); }
  }

  @keyframes sub-fade-in {
    0%   { opacity: 0; transform: translateY(8px); }
    100% { opacity: 1; transform: translateY(0); }
  }

  @keyframes sub-wave-grow {
    0%   { transform: scaleX(0); opacity: 0; }
    30%  { opacity: 1; }
    100% { transform: scaleX(1); opacity: 1; }
  }
}

/* ==============================
   9) モーション軽減
   ============================== */
@media (prefers-reduced-motion: reduce) {
  body.page-top .top-img .cap h1::before,
  body.page-top .top-img .cap h1,
  body.page-top .top-img .cap .sub {
    animation: none !important;
    opacity: 1;
    transform: none;
  }
}

/* ==============================
   10) SP調整
   ============================== */
@media (max-width: 768px) {
  .page-top .section {
    margin-bottom: 18px;
  }

  .page-top .panel--top {
    padding: 16px 14px 18px;
  }

  .page-top .top-img {
    min-height: clamp(280px, 38vh, 420px);
  }

  .page-top .top-img .hero-title {
    font-size: clamp(24px, 6vw, 32px);
  }

  .page-top .top-img .sub {
    white-space: nowrap;
    font-size: clamp(14px, 3.6vw, 17px);
    line-height: 1.4;
    letter-spacing: 0.02em;
    text-align: left;
  }

  .page-top .section--news .news-item {
    grid-template-columns: 1fr;
    row-gap: 6px;
    padding: 10px 12px;
  }

  .page-top .section--news .news-date {
    font-size: 12px;
  }

  .page-top .section--news .news-tag {
    justify-self: start;
    min-height: 24px;
    font-size: 11px;
  }

  .page-top .section--news .news-link {
    font-size: 13px;
    line-height: 1.65;
  }

  .page-top .company-grid {
    gap: 14px;
  }

  .page-top .company-thumb {
    height: 180px;
  }

  .page-top .wide {
    height: 240px;
  }

  .page-top .wide .cap {
    padding: 14px 14px 16px;
  }

  .page-top .wide .section-head {
    top: 14px;
    left: 14px;
    right: 14px;
    min-height: 40px;
    padding: 5px 12px;
  }

  .page-top .wide .section-head h2 {
    font-size: 20px;
  }

  .page-top .wide .cap p {
    font-size: 13.5px;
    line-height: 1.68;
  }

  .page-top .section--works .wide .cap p:first-of-type,
  .page-top .section--recruit .wide .cap p:first-of-type {
    margin-top: 78px;
  }
}

