/* css/top-b.css */

:root {
  --bg-white: #fff45c;
  --bg-soft: #fdf281;
  --text-main: #00a16a;
  --text-muted: #2c5648;
  --border: rgba(0, 161, 106, 0.2);
  --primary-green: #00a16a;
  --primary-blue: #00a16a;
}

body.top-b {
  font-family: 'Zen Kaku Gothic New', 'Noto Sans JP', sans-serif;
  background-color: var(--bg-white);
  color: var(--text-main);
  overflow-x: clip; /* Fix horizontal overflow without breaking sticky */
  margin: 0;
  padding: 0;
}

/* Canvas Background */
#bg-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  pointer-events: none;
}

/* Header cleanup (Let common.css handle Glassmorphism) */
.top-b .logo-img.logo-invert { filter: invert(41%) sepia(97%) saturate(1476%) hue-rotate(134deg) brightness(91%) contrast(101%); }
.top-b .main-nav a, .top-b .main-nav a span { color: var(--text-main) !important; font-weight: 700; }
.top-b .menu-toggle span { background: var(--text-main) !important; }
/* Menu overrides removed to let common.css handle dynamic theming */

/* Sections */
.section-b {
  position: relative;
  min-height: 100vh;
  padding: 10vh 5vw;
}

.text-center { text-align: center; }

/* Labels */
.b-label {
  font-family: 'Outfit', sans-serif;
  font-size: 1.2rem;
  letter-spacing: 0.3em;
  color: var(--primary-green);
  margin-bottom: 2rem;
  display: block;
}

/* HUGE TYPOGRAPHY */
.huge-title {
  font-family: 'Outfit', sans-serif;
  font-size: clamp(3rem, 10vw, 12rem);
  font-weight: 900;
  line-height: 0.9;
  text-transform: uppercase;
  margin: 0;
  white-space: nowrap;
}

.title-full-width {
  font-size: clamp(2rem, 8vw, 13.5vw); /* Responsive clamp */
  width: 100vw;
  margin-left: calc(50% - 50vw);
  letter-spacing: -1px;
  white-space: nowrap; /* Prevent unnatural wrapping */
  overflow: hidden; /* Safely clip if it ever tries to break viewport */
  text-overflow: clip;
}

.vertical-title {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-size: clamp(3rem, 8vw, 8rem);
  line-height: 0.8;
  white-space: nowrap;
}

/* Outline Animation Gimmick */
.outline-anim {
  color: transparent;
  -webkit-text-stroke: 1px rgba(0, 161, 106, 0.2);
  position: relative;
  display: inline-block;
}

.outline-anim::before {
  content: attr(data-text);
  position: absolute;
  left: 0;
  top: 0;
  color: var(--text-main);
  -webkit-text-stroke: 0;
  width: 0%;
  overflow: hidden;
  transition: width 2s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}

.outline-anim.in-view::before {
  width: 100%;
}

.typo-ja-huge {
  font-size: clamp(1.8rem, 4vw, 3.5rem);
  font-weight: 900;
  line-height: 1.6;
  margin-top: 5vh;
  letter-spacing: 0.05em;
}

.typo-ja-mid {
  font-size: clamp(1.5rem, 3vw, 2.5rem);
  font-weight: 700;
  line-height: 1.8;
}

/* ROMAJI TSUKKOMI TEXT */
.romaji-text {
  font-family: 'Outfit', sans-serif;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 3rem;
  letter-spacing: 0.1em;
  text-align: center;
  line-height: 1.8;
  font-weight: 400;
  text-transform: uppercase;
  display: inline-block;
  border: 1px dashed var(--border);
  padding: 1rem 2rem;
  opacity: 0.8;
  border-radius: 5px;
}

/* GREEN BUTTONS */
.btn-b {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  font-family: 'Outfit', 'Zen Kaku Gothic New', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--bg-white) !important;
  background: var(--primary-green) !important;
  padding: 1.2rem 3.5rem;
  border-radius: 50px;
  text-decoration: none !important;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  letter-spacing: 0.15em;
  position: relative;
  overflow: hidden;
}

.btn-b::before {
  content: "";
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: rgba(255,255,255,0.2);
  transform: skewX(-20deg);
  transition: left 0.5s;
}

.btn-b:hover::before {
  left: 100%;
}

.btn-b:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 30px rgba(195, 255, 0, 0.3);
  background: var(--text-main) !important;
  color: var(--bg-white) !important;
}


/* SERVICE STICKY CARDS */
.service-sticky-container {
  position: relative;
  padding-bottom: 25vh;
  margin-top: 5vh;
}

.service-card {
  position: sticky;
  background: var(--primary-green);
  border: 1px solid var(--border);
  padding: 5rem 4rem;
  margin-bottom: 2rem;
  border-radius: 2rem;
  box-shadow: 0 -15px 50px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  will-change: transform, opacity;
}

.service-card:nth-child(1) { top: 15vh; z-index: 10; }
.service-card:nth-child(2) { top: 18vh; z-index: 11; }
.service-card:nth-child(3) { top: 21vh; z-index: 12; }

.s-num {
  position: absolute;
  top: -3rem;
  right: -2rem;
  font-family: 'Outfit';
  font-size: clamp(10rem, 20vw, 25rem);
  font-weight: 900;
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1px rgba(255, 255, 255, 0.1);
  z-index: 0;
  pointer-events: none;
  will-change: transform;
}

.s-content-wrap {
  position: relative;
  z-index: 1;
}

.service-card h3 {
  font-size: clamp(1.5rem, 2.5vw, 2.5rem);
  font-weight: 900;
  margin-bottom: 2rem;
  letter-spacing: 0.05em;
  color: var(--bg-white); /* Yellow text on Green bg */
}

.service-card p {
  font-size: clamp(1rem, 1.5vw, 1.2rem);
  line-height: 2.2;
  color: rgba(255, 255, 255, 0.9); /* Almost white for readability */
  max-width: 800px;
  font-weight: 400;
}

/* ABOUT FLEX LAYOUT */
.b-flex {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 5vw;
}

@media (max-width: 992px) {
  .b-flex {
    flex-direction: column;
  }
  .vertical-title {
    writing-mode: horizontal-tb;
    transform: none;
  }
}

.typographic-block {
  max-width: 900px;
}
.typographic-block p {
  font-size: clamp(1.2rem, 2.5vw, 2.8rem);
  font-weight: 700;
  line-height: 1.8;
  margin-bottom: 2.5rem;
}

/* TEAM INSIDE BLOCK */
.team-section {
  background-color: var(--bg-soft);
  color: var(--text-main);
  border-radius: 2rem;
  margin: 5vh auto;
  max-width: 95vw;
  border: 1px solid var(--border);
}

/* CONTACT GIMMICK */
.contact-huge {
  display: inline-block;
  font-size: clamp(2rem, 5vw, 6rem); /* 以前の 8rem からサイズダウン */
  font-weight: 900;
  line-height: 1.3;
  text-decoration: none;
  color: transparent;
  -webkit-text-stroke: 2px var(--text-main);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  margin-bottom: 1rem;
}

.contact-huge::after {
  content: attr(data-text);
  position: absolute;
  left: 0;
  top: 0;
  color: var(--primary-green);
  -webkit-text-stroke: 0;
  clip-path: polygon(0 100%, 100% 100%, 100% 100%, 0 100%);
  transition: clip-path 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: pre-line;
}

.contact-huge:hover {
  -webkit-text-stroke: 2px transparent;
}
.contact-huge:hover::after {
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
}

/* GIMMICK REVEAL (IN-VIEW) */
.gimmick-reveal {
  opacity: 0;
  transform: translateY(40px) skewY(2deg);
  filter: blur(8px);
  transition: opacity 1.2s cubic-bezier(0.16, 1, 0.3, 1), 
              transform 1.2s cubic-bezier(0.16, 1, 0.3, 1),
              filter 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.gimmick-reveal.in-view {
  opacity: 1;
  transform: translateY(0) skewY(0);
  filter: blur(0);
}

/* --- FIRST VIEW --- */
.fv-section {
  position: relative;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5vw;
  overflow: hidden;
}

.fv-logo-wrap {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10;
}

.fv-logo {
  width: 100%;
  max-width: 80vw;
  height: auto;
  filter: invert(41%) sepia(97%) saturate(1476%) hue-rotate(134deg) brightness(91%) contrast(101%);
  transform: scale(0.9);
  transition: transform 2s cubic-bezier(0.16, 1, 0.3, 1), filter 2s ease;
}

.fv-logo-wrap.in-view .fv-logo {
  transform: scale(1);
  filter: invert(41%) sepia(97%) saturate(1476%) hue-rotate(134deg) brightness(91%) contrast(101%) drop-shadow(0 0 40px rgba(0, 161, 106, 0.2));
}

.fv-scroll {
  position: absolute;
  bottom: 5vh;
  left: 0;
  width: 100%;
  font-family: 'Outfit', sans-serif;
  font-size: 0.8rem;
  letter-spacing: 0.3em;
  color: var(--text-main);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  opacity: 1; /* Full opacity for yellow bg */
  z-index: 10;
}

.fv-scroll-line {
  width: 1px;
  height: 80px;
  background: rgba(0, 161, 106, 0.2);
  position: relative;
  overflow: hidden;
}

.fv-scroll-line::after {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: var(--text-main);
  animation: scrollLine 2s infinite cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes scrollLine {
  0% { transform: translateY(-100%); }
  50% { transform: translateY(0); }
  100% { transform: translateY(100%); }
}

/* --- WORKS INFINITE MARQUEE --- */
.works-marquee-wrapper {
  margin-top: 5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  overflow: hidden;
  width: 100vw;
  margin-left: calc(50% - 50vw);
}

.works-track {
  display: flex;
  width: max-content;
}

.works-track-left {
  animation: marqueeLeft 40s linear infinite;
}

.works-track-right {
  animation: marqueeRight 40s linear infinite;
}

.works-item {
  width: 30vw;
  min-width: 300px;
  margin-right: 1.5rem;
  border-radius: 1rem;
  overflow: hidden;
  position: relative;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s;
  cursor: pointer;
  background-color: var(--bg-soft);
}

.works-item img {
  width: 100%;
  height: auto;
  aspect-ratio: 16/10;
  object-fit: cover;
  display: block;
  opacity: 0.5;
  transition: opacity 0.4s, transform 0.8s;
  filter: grayscale(80%) contrast(1.2);
}

.works-item:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 15px 30px rgba(0, 161, 106, 0.2);
  z-index: 10;
}

.works-item:hover img {
  opacity: 1;
  transform: scale(1.05);
  filter: grayscale(0%) contrast(1);
}

@keyframes marqueeLeft {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); } 
}

@keyframes marqueeRight {
  0% { transform: translateX(-50%); }
  100% { transform: translateX(0); }
}

@media (max-width: 768px) {
  .works-item { width: 70vw; min-width: 250px; margin-right: 1rem; }
}

/* --- News Section (Top B) --- */
.news-section-b {
  background-color: var(--text-main);
  color: var(--bg-white);
  padding: 80px 5vw;
  margin: 60px auto;
  max-width: 95vw;
  border-radius: 2rem;
  min-height: auto !important; /* Override section-b min-height */
}

.news-header-b {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 3rem;
}

.news-header-b .b-label {
  color: var(--bg-white);
  margin-bottom: 0;
}

.news-view-all-b {
  font-family: 'Outfit';
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--bg-white);
  text-decoration: none;
  border-bottom: 2px solid var(--bg-white);
  padding-bottom: 4px;
  transition: opacity 0.3s;
}

.news-view-all-b:hover {
  opacity: 0.7;
}

.news-list-b {
  display: flex;
  flex-direction: column;
}

.news-item-b {
  display: flex;
  align-items: center;
  padding: 1.5rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  text-decoration: none;
  color: var(--bg-white) !important;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.news-item-b:hover {
  background: rgba(255, 255, 255, 0.05);
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

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

.news-date-b {
  font-family: 'Outfit';
  font-size: 1.1rem;
  font-weight: 700;
  width: 140px;
  flex-shrink: 0;
  color: #fff45c !important; /* Explicit Yellow for visibility */
}

.news-cat-b {
  font-family: 'Outfit';
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.2em;
  background: var(--bg-white);
  color: var(--text-main);
  padding: 4px 12px;
  margin-right: 3rem;
  text-transform: uppercase;
  flex-shrink: 0;
}

.news-title-b {
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #fff45c !important; /* Explicit Yellow for visibility */
}

@media (max-width: 768px) {
  .news-section-b {
    padding: 60px 20px;
    margin: 40px auto;
  }
  .news-header-b {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.5rem;
    margin-bottom: 2rem;
  }
  .news-item-b {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1.5rem 0;
  }
  .news-item-b:hover {
    padding-left: 0;
    padding-right: 0;
  }
  .news-date-b {
    width: auto;
    font-size: 1rem;
  }
  .news-cat-b {
    margin-right: 0;
  }
  .news-title-b {
    font-size: 1.15rem;
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  /* Service Card Mobile Adjustments */
  .service-card {
    padding: 2.5rem 1.5rem !important;
  }
  .service-card h3 {
    font-size: 1.3rem !important;
    margin-bottom: 1.2rem !important;
  }
  .service-card p {
    font-size: 0.95rem !important;
    line-height: 1.8 !important;
  }

  /* Intro Section Mobile Adjustments */
  .typo-ja-huge {
    font-size: 2.4rem !important; /* サイズを一気に大きくしてインパクトを出す */
    line-height: 1.3 !important;
    font-weight: 900; /* さらに太く */
    letter-spacing: -0.02em; /* 文字間を詰め、密度を高める */
  }

  /* Contact Huge Mobile Adjustments */
  .contact-huge {
    -webkit-text-stroke: 0 !important;
    color: var(--text-main) !important;
    font-size: clamp(2rem, 6.5vw, 3rem);
    line-height: 1.2;
    text-shadow: none;
  }
  .contact-huge::after {
    display: none; /* ホバー効果を無効化 */
  }
}
