/* ============================================
   リベ大税理士法人 - 共通スタイル
   ============================================ */

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: 'Noto Sans JP', 'Yu Gothic', YuGothic, 'Hiragino Kaku Gothic ProN', sans-serif;
  color: var(--text-black);
  background-color: var(--bg-page);
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a {
  color: var(--brand-blue);
  text-decoration: none;
  transition: opacity 0.3s ease;
}

a:hover {
  opacity: 0.7;
}

ul, ol {
  list-style: none;
}

/* --- CSS Variables --- */
:root {
  /* Brand Colors */
  --brand-brown: #6A3E23;
  --brand-blue: #4755CC;
  --brand-yellow: #FDD424;
  --brand-yellow-light: rgba(253, 236, 48, 0.19);

  /* Text Colors */
  --text-black: #3E3A39;
  --text-white: #FFFFFF;
  --text-gray: #666666;
  --text-light: #999999;

  /* Background Colors */
  --bg-white: #FFFFFF;
  --bg-page: #f5f8fd;
  --bg-light-blue: #eaedfb;
  --bg-light-gray: rgba(217, 217, 217, 0.24);
  --bg-light-yellow: rgba(244, 231, 82, 0.47);

  /* Accent */
  --accent-blue-light: rgba(69, 169, 251, 0.15);
  --accent-blue-header: rgba(71, 85, 204, 0.13);

  /* Spacing */
  --section-padding: 80px 0;
  --container-width: 1080px;
  --container-padding: 0 24px;

  /* Font */
  --font-heading: 'Zen Maru Gothic', 'Noto Sans JP', sans-serif;
  --font-body: 'Noto Sans JP', 'Yu Gothic', YuGothic, sans-serif;
  --font-en: 'Inter', 'Manrope', sans-serif;

  /* Shadow */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 0 16px rgba(0, 0, 0, 0.1);

  /* Border Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-full: 30px;
}

/* --- Layout --- */
.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: var(--container-padding);
}

.container--narrow {
  max-width: 800px;
}

.container--wide {
  max-width: 1200px;
}

section {
  padding: var(--section-padding);
}

/* --- Typography --- */
.heading-xl {
  font-family: var(--font-heading);
  font-size: 40px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--text-black);
}

.heading-lg {
  font-family: var(--font-heading);
  font-size: 35px;
  font-weight: 700;
  line-height: 1.6;
  color: var(--text-black);
  text-align: center;
}

.heading-md {
  font-family: var(--font-heading);
  font-size: 28px;
  font-weight: 700;
  line-height: 1.6;
  color: var(--text-black);
}

.heading-sm {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.5;
  color: var(--text-black);
}

.section-subtitle {
  font-size: 18px;
  text-align: center;
  color: var(--text-black);
  margin-bottom: 8px;
}

.section-heading {
  font-family: var(--font-heading);
  font-size: 35px;
  font-weight: 700;
  text-align: center;
  color: var(--text-black);
  margin-bottom: 40px;
  line-height: 1.6;
}

.section-heading::after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  background: var(--brand-blue);
  margin: 16px auto 0;
  border-radius: 2px;
}

/* --- Header --- */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 70px;
  background: var(--bg-white);
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header__logo {
  margin-left: 24px;
  display: flex;
  align-items: center;
}

.header__logo img {
  height: 35px;
  width: auto;
}

.header__nav {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-right: 0;
}

.header__nav-link {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
  color: var(--brand-brown);
  white-space: nowrap;
  transition: color 0.3s ease;
}

.header__nav-link:hover {
  opacity: 0.7;
}

.header__nav-link--external {
  display: flex;
  align-items: center;
  gap: 4px;
}

.header__nav-link--external .icon-external {
  font-size: 14px;
}

.header__cta {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--brand-blue);
  color: var(--text-white);
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
  padding: 0 32px;
  height: 70px;
  letter-spacing: 1.2px;
  white-space: nowrap;
  transition: background 0.3s ease;
}

.header__cta:hover {
  background: #3644b0;
  opacity: 1;
}

/* Mobile Menu */
.header__hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 12px;
  cursor: pointer;
  background: none;
  border: none;
  margin-right: 16px;
}

.header__hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--brand-brown);
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.header__hamburger.is-active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.header__hamburger.is-active span:nth-child(2) {
  opacity: 0;
}

.header__hamburger.is-active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.mobile-nav {
  display: none;
  position: fixed;
  top: 70px;
  left: 0;
  width: 100%;
  background: var(--bg-white);
  box-shadow: var(--shadow-md);
  z-index: 999;
  padding: 24px 0;
}

.mobile-nav.is-open {
  display: block;
}

.mobile-nav__list {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.mobile-nav__link {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
  color: var(--brand-brown);
}

/* --- Footer --- */
.footer {
  background: var(--text-black);
  color: var(--text-white);
  padding: 60px 0 32px;
}

.footer__group-title {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 20px;
}

.footer__group-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  margin-bottom: 40px;
}

.footer__group-link {
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
  transition: color 0.3s ease;
}

.footer__group-link:hover {
  color: var(--text-white);
  opacity: 1;
}

.footer__divider {
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  margin: 0 0 24px;
}

.footer__bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.footer__links {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

.footer__link {
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
}

.footer__link:hover {
  color: var(--text-white);
  opacity: 1;
}

.footer__copyright {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.6);
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 700;
  border-radius: var(--radius-full);
  transition: all 0.3s ease;
  cursor: pointer;
  border: none;
  text-decoration: none;
}

.btn--primary {
  background: var(--brand-blue);
  color: var(--text-white);
  font-size: 18px;
  padding: 16px 48px;
}

.btn--primary:hover {
  background: #3644b0;
  opacity: 1;
}

.btn--outline {
  background: transparent;
  color: var(--text-black);
  font-size: 18px;
  padding: 14px 48px;
  border: 2px solid var(--text-black);
}

.btn--outline:hover {
  background: var(--text-black);
  color: var(--text-white);
  opacity: 1;
}

.btn--large {
  font-size: 20px;
  padding: 20px 64px;
}

.btn--dark {
  background: var(--text-black);
  color: var(--text-white);
  font-size: 20px;
  padding: 16px 48px;
}

.btn--dark:hover {
  background: #2a2726;
  opacity: 1;
}

/* --- CTA Section --- */
.cta-section {
  background: linear-gradient(135deg, #4755CC 0%, #3644b0 50%, #4755CC 100%);
  padding: 80px 24px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.cta-section::before {
  content: '';
  position: absolute;
  top: -60%;
  right: -20%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.08) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.cta-section::after {
  content: '';
  position: absolute;
  bottom: -40%;
  left: -10%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(253, 212, 36, 0.1) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.cta-section__text {
  color: var(--text-white);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.6;
  margin-bottom: 32px;
}

.cta-section .btn--primary {
  background: var(--text-white);
  color: var(--brand-blue);
  font-size: 20px;
  padding: 18px 64px;
}

.cta-section .btn--primary:hover {
  background: #f0f0f0;
  opacity: 1;
}

/* --- Cards --- */
.card {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

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

.card a {
  display: block;
  color: inherit;
  text-decoration: none;
}

/* --- FAQ Accordion --- */
.faq-list {
  max-width: 800px;
  margin: 0 auto;
}

.faq-item {
  border-bottom: 1px solid #e0e0e0;
}

.faq-item__question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 0;
  cursor: pointer;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-black);
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
  line-height: 1.6;
  gap: 16px;
}

.faq-item__question::before {
  content: 'Q';
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--brand-blue);
  color: var(--text-white);
  font-family: var(--font-en);
  font-size: 16px;
  font-weight: 700;
}

.faq-item__icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  position: relative;
  transition: transform 0.3s ease;
}

.faq-item__icon::before,
.faq-item__icon::after {
  content: '';
  position: absolute;
  background: var(--text-black);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  transition: transform 0.3s ease;
}

.faq-item__icon::before {
  width: 16px;
  height: 2px;
}

.faq-item__icon::after {
  width: 2px;
  height: 16px;
}

.faq-item.is-open .faq-item__icon::after {
  transform: translate(-50%, -50%) rotate(90deg);
}

.faq-item__answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, padding 0.4s ease;
}

.faq-item.is-open .faq-item__answer {
  max-height: 500px;
  padding-bottom: 24px;
}

.faq-item__answer-inner {
  padding: 0 0 0 52px;
  font-size: 16px;
  line-height: 1.8;
  color: var(--text-gray);
}

/* --- Step Flow --- */
.flow-list {
  max-width: 700px;
  margin: 0 auto;
}

.flow-item {
  display: flex;
  gap: 24px;
  padding: 32px 0;
  position: relative;
}

.flow-item:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 28px;
  top: 72px;
  bottom: 0;
  width: 2px;
  background: var(--brand-blue);
  opacity: 0.3;
}

.flow-item__number {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.flow-item__step-label {
  font-family: var(--font-en);
  font-size: 12px;
  font-weight: 700;
  color: var(--brand-blue);
  letter-spacing: 1px;
}

.flow-item__step-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--brand-blue);
  color: var(--text-white);
  font-family: var(--font-en);
  font-size: 24px;
  font-weight: 700;
}

.flow-item__content {
  padding-top: 8px;
}

.flow-item__title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-black);
  margin-bottom: 8px;
}

.flow-item__desc {
  font-size: 15px;
  line-height: 1.8;
  color: var(--text-gray);
}

/* --- Price Table --- */
.price-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 16px;
}

.price-table th,
.price-table td {
  padding: 16px 20px;
  text-align: center;
  border: 1px solid #e0e0e0;
}

.price-table thead th {
  background: var(--brand-blue);
  color: var(--text-white);
  font-weight: 700;
  font-size: 15px;
}

.price-table tbody td {
  background: var(--bg-white);
}

.price-table tbody td:first-child {
  font-weight: 700;
  background: #f8f9fc;
}

.price-table .price-amount {
  font-size: 28px;
  font-weight: 700;
  color: var(--brand-blue);
}

.price-table .price-unit {
  font-size: 14px;
  color: var(--text-gray);
}

/* --- Utility --- */
.text-center { text-align: center; }
.text-blue { color: var(--brand-blue); }
.text-brown { color: var(--brand-brown); }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }
.mb-40 { margin-bottom: 40px; }
.mb-48 { margin-bottom: 48px; }
.mb-64 { margin-bottom: 64px; }
.mt-80 { margin-top: 80px; }
.pt-header { padding-top: 70px; }

.note {
  font-size: 14px;
  color: var(--text-light);
  line-height: 1.6;
}

/* --- Scroll Animations --- */
.anim-ready,
.fade-in,
.fade-in-up,
.fade-in-left,
.fade-in-right,
.scale-in {
  opacity: 0;
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.anim-ready { transform: translateY(30px); }
.fade-in-up { transform: translateY(40px); }
.fade-in-left { transform: translateX(-40px); }
.fade-in-right { transform: translateX(40px); }
.scale-in { transform: scale(0.92); }

.anim-ready.is-visible,
.fade-in.is-visible,
.fade-in-up.is-visible,
.fade-in-left.is-visible,
.fade-in-right.is-visible,
.scale-in.is-visible {
  opacity: 1;
  transform: translateY(0) translateX(0) scale(1);
}

/* --- Decorative Background Text --- */
.section-heading {
  position: relative;
}

[data-en]::before {
  content: attr(data-en);
  position: absolute;
  top: -0.5em;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-en);
  font-size: 80px;
  font-weight: 700;
  color: var(--brand-blue);
  opacity: 0.04;
  white-space: nowrap;
  pointer-events: none;
  z-index: 0;
  letter-spacing: 4px;
}

/* --- Section Wave / Diagonal Transitions --- */
.section-wave-top {
  position: relative;
}

.section-wave-top::before {
  content: '';
  position: absolute;
  top: -40px;
  left: 0;
  width: 100%;
  height: 40px;
  background: inherit;
  clip-path: ellipse(55% 100% at 50% 100%);
  z-index: 1;
}

.section-diagonal {
  position: relative;
  clip-path: polygon(0 40px, 100% 0, 100% calc(100% - 40px), 0 100%);
  padding-top: 120px !important;
  padding-bottom: 120px !important;
  margin-top: -40px;
  margin-bottom: -40px;
}

/* --- Enhanced Card Hover Effects --- */
.services__card,
.target-card,
.voice-card,
.inh-service__card,
.group-service__card {
  transition: box-shadow 0.4s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.services__card:hover,
.target-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 40px rgba(71, 85, 204, 0.12);
}

.voice-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

/* --- Button Hover Enhancements --- */
.btn {
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.5s ease, height 0.5s ease;
}

.btn:hover::after {
  width: 300px;
  height: 300px;
}

/* --- Gradient Accent Lines --- */
.section-heading::after {
  background: linear-gradient(90deg, var(--brand-blue), var(--brand-yellow));
}

/* --- Photo Style: Rounded with Shadow --- */
.photo-frame {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
}

.photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.photo-frame:hover img {
  transform: scale(1.05);
}

/* --- Floating Decoration Dots --- */
.deco-dots {
  position: absolute;
  width: 80px;
  height: 80px;
  background-image: radial-gradient(circle, var(--brand-blue) 1.5px, transparent 1.5px);
  background-size: 12px 12px;
  opacity: 0.08;
  pointer-events: none;
}

/* --- Header Scroll Effect Enhancement --- */
.header.is-scrolled {
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.95);
}

/* --- Responsive --- */
@media (max-width: 1140px) {
  .header__nav {
    gap: 16px;
  }
  .header__nav-link {
    font-size: 14px;
  }
}

@media (max-width: 840px) {
  :root {
    --section-padding: 60px 0;
  }

  .header__nav {
    display: none;
  }

  .header__hamburger {
    display: flex;
  }

  .header__cta {
    display: none;
  }

  .section-heading {
    font-size: 28px;
  }

  .heading-xl {
    font-size: 30px;
  }

  .heading-lg {
    font-size: 28px;
  }

  .heading-md {
    font-size: 22px;
  }

  .cta-section__text {
    font-size: 20px;
  }

  .flow-item {
    gap: 16px;
  }
}

@media (max-width: 540px) {
  :root {
    --section-padding: 48px 0;
    --container-padding: 0 16px;
  }

  .section-heading {
    font-size: 24px;
    margin-bottom: 32px;
  }

  .heading-xl {
    font-size: 26px;
  }

  .heading-lg {
    font-size: 24px;
  }

  .btn--primary,
  .btn--outline {
    font-size: 16px;
    padding: 14px 32px;
  }

  .btn--large {
    font-size: 18px;
    padding: 16px 40px;
  }

  .faq-item__question {
    font-size: 16px;
    padding: 20px 0;
  }

  .cta-section__text {
    font-size: 18px;
  }

  .cta-section .btn--primary {
    font-size: 18px;
    padding: 16px 40px;
  }

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

  .price-table {
    font-size: 14px;
  }

  .price-table th,
  .price-table td {
    padding: 12px 8px;
  }

  .price-table .price-amount {
    font-size: 22px;
  }
}
