/* service/css/style.css - Service page (service)
   Shared header/footer/CTA/Case via ../css/common.css. Page-specific: banner + service blog.
   Banner in ../img ; photos/icons in ../../assets/img. */

/* ===== Page banner (FV) - same as other sub-pages ===== */
/* =============================================
   Page banner (FV)  —  Figma node 4142:367
   Frame: 1440 × 660. White diagonal-pattern bg + businessman photo
   fading into the white on its left edge.
   ============================================= */
.page-banner {
  position: relative;
  width: 100%;
  height: 660px; /* Figma spec */
  /* White overlay on top fades the pattern — raise the 0.6 (0–1) to fade more */
  background:
    linear-gradient(rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0.6)),
    url("../../assets/img/banner-bg.webp") center / cover no-repeat,
    #ffffff;
  overflow: hidden;
}

/* Media layer (photo + scroll indicator) sits behind the text overlay */
.page-banner__media {
  position: absolute;
  inset: 0;
  z-index: 1;
}

/* Businessman photo — Figma Mask group x371 y-46.78 w1201.73 h748.09 (of 1440×660).
   Masked so it fades to transparent on the left, blending into the white bg
   (Figma Rectangle 32: linear gradient transparent → opaque from ~2% to ~45%). */
.page-banner__photo {
  position: absolute;
  top: 0;
  right: 0;        /* anchored to the right edge → always fills to the edge on wide
                      screens (like the homepage hero), so no white gap appears */
  width: 74.24%;   /* left edge lands at the design x371 (25.76% of 1440) */
  height: 100%;
  background: url("../img/banner-pc.webp") center top / cover no-repeat;
  -webkit-mask-image: linear-gradient(90deg, transparent 4%, #000 44%);
          mask-image: linear-gradient(90deg, transparent 4%, #000 44%);
}

/* SCROLL indicator — far-left edge (Figma line x42 y274 h153, text x37 y461) */
.page-banner__scroll {
  position: absolute;
  /* 35px from the centered 1440 container's left edge (not the viewport) on wide screens */
  left: max(35px, calc(50% - 685px));
  top: 274px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 34px; /* line bottom y427 → SCROLL text y461 */
  z-index: 3;
  animation: pb-scroll-bob 2.4s ease-in-out infinite;
}
@keyframes pb-scroll-bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(10px); }
}
@media (prefers-reduced-motion: reduce) {
  .page-banner__scroll { animation: none; }
}
.page-banner__scroll-line {
  width: 1px;
  height: 153px; /* Figma spec */
  background: #000000;
}
.page-banner__scroll-text {
  writing-mode: vertical-rl;
  text-orientation: upright;
  font-family: var(--font-jp-serif);
  font-size: 18px; /* Figma spec */
  font-weight: 400;
  letter-spacing: 6.3px;
  color: #000000;
}

/* Text overlay — centered 1440 container, 100px side padding (matches Figma x origins) */
.page-banner__inner {
  position: relative;
  height: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 100px;
  z-index: 2;
}

/* "Features" — decorative en heading (Figma x100 y51, 100px, rgba(65,99,136,0.1)) */
.page-banner__en {
  position: absolute;
  top: 51px;
  left: 100px;
  margin: 0;
  font-family: var(--font-jp-serif);
  font-weight: 500;
  font-size: 100px; /* Figma spec */
  line-height: 1;
  color: rgba(65, 99, 136, 0.1);
  white-space: nowrap;
  pointer-events: none;
}

/* 私たちの強み — jp sub-title (Figma x100 y154, 36px, #868181, ls 15%) */
.page-banner__jp {
  position: absolute;
  top: 138px;
  left: 100px;
  margin: 0;
  font-family: var(--font-jp-serif);
  font-weight: 500;
  font-size: 36px; /* Figma spec */
  letter-spacing: 0.15em;
  color: #868181;
}

/* Lead copy (Figma x100 y359, 29px, line-height 180%, #000) */
.page-banner__lead {
  position: absolute;
  top: 359px;
  left: 100px;
  margin: 0;
  font-family: var(--font-jp-serif);
  font-weight: 400;
  font-size: 29px; /* Figma spec */
  line-height: 1.8;
  color: #000000;
}

/* Breadcrumb — bottom of banner (Figma x0 y615, padding 11px 0 11px 100px) */
.page-banner__breadcrumb {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  padding: 11px 0;
  /* align with the 1440 container's left padding on wide screens */
  padding-left: max(100px, calc(50% - 620px));
  z-index: 3;
}
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  list-style: none;
  margin: 0;
  padding: 0;
  font-family: var(--font-jp-serif);
  font-size: 18px; /* Figma spec */
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0.04em;
  color: #323232;
}
.breadcrumb li {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.breadcrumb a {
  color: #323232;
}
.breadcrumb__sep {
  display: inline-flex;
  width: 10px;  /* Figma arrow 10×10 */
  height: 10px;
  color: #323232;
}
.breadcrumb__current {
  color: #323232;
}

/* =============================================
   Banner — Tablet (≤ 1200px)
   ============================================= */
@media (max-width: 1200px) {
  .page-banner {
    height: 560px;
  }
  .page-banner__inner {
    padding: 0 48px;
  }
  .page-banner__en {
    left: 48px;
    font-size: 80px;
  }
  .page-banner__jp {
    left: 48px;
    font-size: 30px;
  }
  .page-banner__lead {
    left: 48px;
    font-size: 24px;
  }
  .page-banner__scroll {
    left: 28px;
    top: 150px;        /* fit inside the 560px banner, clear of the breadcrumb */
  }
  .page-banner__scroll-line {
    height: 120px;
  }
  .page-banner__breadcrumb {
    padding-left: 48px;
  }
}

/* =============================================
   Banner — SP (< 768px)  —  Figma node 4142:833 (390×560)
   Flatten to a single column: title → breadcrumb → photo → lead
   ============================================= */
@media (max-width: 767px) {
  .page-banner {
    height: auto;
    display: flex;
    flex-direction: column;
    padding: 0;
    background-position: top center;
  }
  /* Let the overlay children flow into the column */
  .page-banner__inner {
    display: contents;
  }

  /* Title group (Figma h2 x19 y17) */
  .page-banner__en {
    position: static;
    order: 1;
    padding: 17px 0 0 19px;
    font-size: 50px; /* Figma SP spec */
    color: rgba(65, 99, 136, 0.2); /* Figma SP spec */
  }
  .page-banner__jp {
    position: static;
    margin-top: -15px;
    order: 1;
    padding: 4px 0 0 24px; /* x19 group + x5 = 24 */
    font-size: 20px; /* Figma SP spec */
  }

  /* Breadcrumb between title and photo (per SP design) */
  .page-banner__breadcrumb {
    position: static;
    order: 2;
    width: 100%;
    padding: 10px 0 10px 20px;
  }
  .breadcrumb {
    font-size: 13px;
  }

  /* Photo block (Figma Mask group x37 y166 w352.64 h271) */
  .page-banner__media {
    position: relative;
    order: 3;
    inset: auto;
    margin: 12px 0 0 9.5%; /* 37 / 390 */
    width: 90.4%;          /* 352.64 / 390 */
    aspect-ratio: 352.64 / 271;
  }
  .page-banner__photo {
    position: absolute;
    inset: 0;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("../img/banner-sp.webp"); /* SP-specific crop */
    -webkit-mask-image: none;
            mask-image: none;
  }
  /* SCROLL on the left of the photo (Figma x12 y210 inside FV) */
  .page-banner__scroll {
    left: -25px;
    top: 44px; /* image top y166 → scroll y210 */
    gap: 12px;
  }
  .page-banner__scroll-line {
    height: 76px; /* Figma SP spec */
  }
  .page-banner__scroll-text {
    font-size: 14px; /* Figma SP spec */
    letter-spacing: 4.9px;
  }

  /* Lead copy — centered below photo (Figma x21 y478, 16px, center) */
  .page-banner__lead {
    position: static;
    order: 4;
    padding: 24px 20px 32px;
    font-size: 16px; /* Figma SP spec */
    text-align: center;
  }
}

/* =============================================
   Service (Ã£â€šÂµÃ£Æ’Â¼Ã£Æ’â€œÃ£â€šÂ¹)
   ============================================= */
/* Shared gradient wrapper for Service + Case */
.service-case-bg {
  width: 100%;
  /* Figma Ã£â€šÂµÃ£Æ’Â¼Ã£Æ’â€œÃ£â€šÂ¹Ã£â€šÂ»Ã£â€šÂ¯Ã£â€šÂ·Ã£Æ’Â§Ã£Æ’Â³ fill: gradient spanning both inner blocks */
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 1) 0%,
    rgba(74, 129, 199, 1) 47%,
    rgba(36, 63, 97, 1) 100%
  );
}

.service {
  width: 100%;
  /* top + sides padding only — bottom gap comes from .case padding-top */
  padding: 100px;
  background: transparent;
}

.service__inner {
  position: relative;
  max-width: 1240px;
  margin: 0 auto;
  height: 803.04px; /* Figma spec minus heading offset 241.34px */
}

/* h2: "Service" decorative big + "Ã£â€šÂµÃ£Æ’Â¼Ã£Æ’â€œÃ£â€šÂ¹" smaller */
.service__heading {
  position: absolute;
  top: 0;
  left: 0;
  width: 597.06px;
  height: 127px;
  margin: 0;
}
.service__heading-en {
  position: absolute;
  top: 0;
  left: 0.26px;
  display: block;
  font-family: var(--font-jp-serif);
  font-weight: 500;
  font-size: 100px;
  line-height: 1.25;
  color: rgba(65, 99, 136, 0.2); /* fill_JKUYCN */
  white-space: nowrap;
}
.service__heading-jp {
  position: absolute;
  top: 83.86px;
  left: 0;
  display: block;
  font-family: var(--font-jp-serif);
  font-weight: 500;
  font-size: 35px;
  line-height: 1;
  letter-spacing: 5.25px;
  color: #868181; /* fill_JUHZIY */
}

/* Top-right button "Ã¤Âºâ€¹Ã¤Â¾â€¹Ã¤Â¸â‚¬Ã¨Â¦Â§Ã£â€šâ€™Ã¨Â¦â€¹Ã£â€šâ€¹" Ã¢â‚¬â€  increased specificity to beat .detail-btn defined later */
.detail-btn.service__btn {
  position: absolute;
  top: 54px; /* Figma spec */
  left: 967px; /* Figma spec */
}
.detail-btn.service__btn-sp {
  display: none; /* shown only on SP */
}

/* Consultant image (left, below heading) */
.service__image {
  position: absolute;
  top: 102.66px; /* 344 - 241.34 */
  left: 35px;
  width: 528px;
  height: 395px;
  background: url("../../assets/img/home-sv/service-consultant.webp") center/cover no-repeat;
}

/* Description text below image */
.service__desc {
  position: absolute;
  top: 521.66px; /* 763 - 241.34 */
  left: 35px;
  width: 528px;
  font-family: var(--font-jp-serif);
  font-weight: 400;
  font-size: 18px;
  line-height: 40px; /* Figma spec absolute lh */
  color: #000;
}

/* Decorative logo (semi-transparent, behind list) */
.service__logo-deco {
  position: absolute;
  top: 40.66px; /* 282 - 241.34 */
  left: 628px;
  width: 610.53px;
  height: 693px;
  pointer-events: none;
  object-fit: contain;
}

/* ===== Decorative frame lines around the service list =====
   All positions are within .service__inner, derived from Figma:
   list group origin (y=241.34) + child y offset within group. */
.service__deco {
  position: absolute;
  pointer-events: none;
}
/* Disable generic data-reveal slide on the section Ã¢â‚¬â€  we use per-deco reveal instead */
.service[data-reveal] {
  opacity: 1; transform: none; transition: none;
}
/* Service decorations: slash corners rotate in, horizontal lines draw out */
.service__deco--slash-tl,
.service__deco--slash-br {
  transition:
    transform 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.2s,
    opacity   0.5s ease 0.2s;
}
.service[data-reveal]:not(.is-visible) .service__deco--slash-tl,
.service[data-reveal]:not(.is-visible) .service__deco--slash-br {
  transform: rotate(-180deg) scale(0.3);
  opacity: 0;
}
.service__deco--top-line {
  transform-origin: left center;
  transition: transform 0.9s cubic-bezier(0.4, 0, 0.2, 1) 0.4s;
}
.service__deco--bottom-line {
  transform-origin: right center;
  transition: transform 0.9s cubic-bezier(0.4, 0, 0.2, 1) 0.4s;
}
.service[data-reveal]:not(.is-visible) .service__deco--top-line,
.service[data-reveal]:not(.is-visible) .service__deco--bottom-line {
  transform: scaleX(0);
}

/* Star sparkle reveal animations (mirror Case block) */
.service__deco--star-tr,
.service__deco--star-bl {
  transition:
    transform 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.6s,
    opacity   0.5s ease 0.6s;
}
.service[data-reveal]:not(.is-visible) .service__deco--star-tr,
.service[data-reveal]:not(.is-visible) .service__deco--star-bl {
  transform: rotate(-180deg) scale(0);
  opacity: 0;
}

@media (prefers-reduced-motion: reduce) {
  .service__deco--slash-tl, .service__deco--slash-br,
  .service__deco--top-line, .service__deco--bottom-line,
  .service__deco--star-tr, .service__deco--star-bl {
    transition: none;
  }
}
/* Top horizontal line: list-relative (29, 40.66) → inner (29, 40.66) */
.service__deco--top-line {
  top: 40.66px; /* 282 - 241.34 */
  left: 29px;
  width: 1211px;
  height: 1px;
  background: rgba(76, 72, 72, 0.7);
}
/* Bottom horizontal line: list-relative (0.24, 767.66) → inner (0.24, 767.66) */
.service__deco--bottom-line {
  top: 767.66px; /* 1009 - 241.34 */
  left: 0.24px;
  width: 1202.77px;
  height: 1px;
  background: rgba(76, 72, 72, 0.7);
}
/* Top-left diagonal slash: `\` slope */
.service__deco--slash-tl {
  top: 0px; /* 241.34 - 241.34 */
  left: 0;
  width: 69.38px;
  height: 69.3px;
}
.service__deco--slash-tl::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom right,
    transparent calc(50% - 0.5px),
    rgba(76, 72, 72, 0.7) calc(50% - 0.5px),
    rgba(76, 72, 72, 0.7) calc(50% + 0.5px),
    transparent calc(50% + 0.5px)
  );
}
/* Bottom-right diagonal slash: `\` slope */
.service__deco--slash-br {
  top: 733.65px; /* 974.99 - 241.34 */
  left: 1169.05px;
  width: 69.43px;
  height: 69.39px;
}
.service__deco--slash-br::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom right,
    transparent calc(50% - 0.5px),
    rgba(76, 72, 72, 0.7) calc(50% - 0.5px),
    rgba(76, 72, 72, 0.7) calc(50% + 0.5px),
    transparent calc(50% + 0.5px)
  );
}

/* Star sparkle decorations at top-right + bottom-left corners */
.service__deco--star-tr,
.service__deco--star-bl {
  width: 16px;
  height: 16px;
  background-color: rgba(76, 72, 72, 0.7);
  -webkit-mask: url("../../assets/img/slossy-icon.svg") center / contain no-repeat;
          mask: url("../../assets/img/slossy-icon.svg") center / contain no-repeat;
  display: block;
}
.service__deco--star-tr {
  top: 32.66px; /* aligned with top horizontal line (y=40.66) */
  right: -8px; /* extend slightly past right edge */
}
.service__deco--star-bl {
  top: 759.66px; /* aligned with bottom horizontal line (y=767.66) */
  left: -8px; /* extend slightly past left edge */
}

/* ===== Service items list (right column) ===== */
.service__list {
  position: absolute;
  top: 0px; /* 241.34 - 241.34 */
  left: 0;
  width: 1240px;
  height: 803.04px;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Each service item: number + Japanese name + English label + accent line */
.service-item {
  position: absolute;
  display: grid;
  grid-template-columns: 33px max-content 1fr; /* num | name (auto) | english label */
  align-items: center;
  column-gap: 30px;
  width: 100%;
  height: 82px;
  padding-bottom: 25px;
  border-bottom: 1px solid rgba(76, 72, 72, 0.7); /* fill_GFB5R9 - divider */
}
/* Figma y-positions for each item */
.service-item:nth-of-type(1) { top: 65.55px; }
.service-item:nth-of-type(2) { top: 172.66px; }
.service-item:nth-of-type(3) { top: 279.66px; }
.service-item:nth-of-type(4) { top: 386.66px; }
.service-item:nth-of-type(5) { top: 494.34px; }
.service-item:nth-of-type(6) { top: 601.54px; }

/* All items start at x=617-618 from list origin */
.service-item {
  left: 618px;
  /* limit width so divider doesn't cross logo decoration or border slashes */
  width: 587px;
}

.service-item__num {
  font-family: "Nova Cut", serif;
  font-weight: 400;
  font-size: 24px;
  line-height: 1;
  /* Linear gradient text fill */
  background: linear-gradient(180deg, #00457C 0%, #007DE2 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.service-item__name {
  font-family: var(--font-jp-serif);
  font-weight: 700;
  font-size: 24px;
  line-height: 1;
  color: #4C4848;
  white-space: nowrap;
}
.service-item__en {
  font-family: "Padyakke Expanded One", serif;
  font-weight: 400;
  font-size: 18px;
  line-height: 1;
  color: #000;
}
/* Blue accent line under each item, aligned with number */
.service-item__accent {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 70px;
  height: 4px;
  background: #0340A4;
  transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
/* Hover: extend the blue underline to full item width */
.service-item:hover .service-item__accent {
  width: 100%;
}
.service-item { cursor: pointer; }

/* ===== Slot-machine text reveal (per-char) ===== */
.slot-mask {
  position: relative;
  display: inline-block;
  overflow: hidden;
  line-height: 1.15;
  vertical-align: top;
}
.slot-orig,
.slot-clone {
  display: inline-block;
  transition:
    transform 0.45s cubic-bezier(0.4, 0, 0.2, 1),
    opacity   0.45s ease;
  transition-delay: calc(var(--i, 0) * 0.025s);
}
.slot-clone {
  position: absolute;
  left: 0;
  top: 0;
  transform: translateY(100%);
  opacity: 0;
}
.service-item:hover .slot-orig {
  transform: translateY(-100%);
  opacity: 0;
}
.service-item:hover .slot-clone {
  transform: translateY(0);
  opacity: 1;
}

/* Scroll-into-view reveal: chars start hidden below mask, slide up when item enters viewport */
.service-item[data-reveal] {
  /* Disable generic data-reveal opacity/translate; we use per-char reveal */
  opacity: 1;
  transform: none;
  transition: none;
}
.service-item[data-reveal]:not(.is-visible) .slot-orig {
  transform: translateY(100%);
  opacity: 0;
}
/* When .is-visible class is added by IntersectionObserver, the override is dropped
   and existing .slot-orig transition (with per-char stagger) animates back to default. */
@media (prefers-reduced-motion: reduce) {
  .slot-orig, .slot-clone { transition: none; }
  .service-item__accent { transition: none; }
}

/* =============================================
   Service — Tablet (≤ 1200px)
   ============================================= */
@media (max-width: 1200px) {
  .service {
    padding: 80px 48px;
  }
  .service__inner {
    height: auto;
    display: flex;
    flex-direction: column;
    gap: 48px;
  }
  .service__heading,
  .service__image,
  .service__desc,
  .service__list,
  .service__logo-deco {
    position: static;
    width: auto;
    height: auto;
  }
  .detail-btn.service__btn {
    position: static;
    top: auto;
    left: auto;
    align-self: flex-end;
  }
  .service__image {
    width: 100%;
    max-width: 600px;
    height: 360px;
    align-self: center;
  }
  .service__logo-deco,
  .service__deco {
    display: none;
  }
  .service__list {
    width: 100%;
    height: auto;
    display: flex;
    flex-direction: column;
    gap: 0;
  }
  .service-item {
    position: relative;
    top: auto !important;
    left: auto;
    width: 100%;
  }
}

/* =============================================
   Service — SP (< 768px)
   ============================================= */
@media (max-width: 767px) {
  .service {
    padding: 40px 20px;
  }
  .service__inner {
    gap: 24px;
  }

  /* Heading: scaled down per Features SP pattern */
  .service__heading {
    position: relative;
    width: auto;
    height: 67px;
  }
  .service__heading-en {
    font-size: 50px;
  }
  .service__heading-jp {
    top: 41px;
    font-size: 18px;
    letter-spacing: 2.7px;
  }

  /* Hide top-right button on SP; show SP-only bottom button */
  .detail-btn.service__btn {
    display: none;
  }
  .detail-btn.service__btn-sp {
    display: flex; /* block-level so margin auto works */
    margin: 100px auto 0;
    width: 272px;
    height: 50px;
    font-size: 14px;
  }
  .service__btn-sp .detail-btn__edge--l,
  .service__btn-sp .detail-btn__edge--r {
    height: 30px;
  }

  /* Hide image + description text on SP (not in Figma SP design) */
  .service__image,
  .service__desc {
    display: none;
  }

  /* Items: smaller per Figma SP spec */
  .service__list {
    width: auto;
    gap: 0;
    margin: 20px;
    z-index: 1;
  }
  .service-item {
    grid-template-columns: 28px max-content 1fr;
    column-gap: 14px;
    height: 54px;
    padding: 16px 0;
  }
  .service-item__num {
    font-size: 18px;
  }
  .service-item__name {
    font-size: 14px;
  }
  .service-item__en {
    font-size: 14px;
  }
  .service-item__accent {
    width: 60px;
    height: 4px;
  }
  /* Breathing room above the first item so it clears the top frame line,
     matching the gap the last item leaves above the bottom line */
  .service-item:first-child {
    margin-top: 30px;
  }

  /* Show and position decorative frame on SP */
  .service__deco {
    display: block;
  }
  .service__deco--slash-tl,
  .service__deco--slash-br {
    width: 40px;
    height: 40px;
  }
  .service__deco--slash-tl {
    top: 71px;
    left: 0;
  }
  .service__deco--slash-br {
    top: 470px;
    left: auto;
    right: 0;
  }
  .service__deco--top-line {
    top: 91px;
    left: 20px;
    right: 10px;
    width: auto;
    height: 1px;
  }
  .service__deco--bottom-line {
    top: 490px;
    left: 10px;
    right: 20px;
    width: auto;
    height: 1px;
  }
  .service__deco--star-tr {
    top: 85px;
    right: 0;
    left: auto;
    width: 12px;
    height: 12px;
  }
  .service__deco--star-bl {
    top: 484px;
    left: 0;
    right: auto;
    width: 12px;
    height: 12px;
  }

  /* Center decorative background logo on SP */
  .service__logo-deco {
    display: block;
    position: absolute;
    top: 120px;
    left: 50%;
    transform: translateX(-50%);
    width: 280px;
    height: 280px;
    opacity: 0.8;
    z-index: 0;
  }
  /* Offset the list to match the homepage frame coordinates since subpage has no heading */
  .service__list {
    margin-top: 91px;
  }
}
