/* ============================================
   Responsive - Verus Rich Corporation
   ============================================ */

/* --- Wide Screen (1280px+) --- */
@media (min-width: 1280px) {
  :root {
    --container-padding: 40px;
  }
}

/* --- Desktop (1024px - 1279px) --- */
@media (max-width: 1279px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* --- Tablet (768px - 1023px) --- */
@media (max-width: 1023px) {
  :root {
    --font-size-hero: 36px;
    --font-size-3xl: 32px;
    --font-size-2xl: 26px;
    --spacing-section: 80px;
  }

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

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

  .footer__inner {
    grid-template-columns: 1fr 1fr;
  }

  .steps {
    flex-wrap: wrap;
  }

  .step {
    flex: 0 0 calc(50% - var(--spacing-lg) / 2);
  }

  .step:not(:last-child)::after {
    display: none;
  }

  .info-table th {
    width: 160px;
  }

  .loading-overlay__typewriter {
    font-size: 52px;
  }

  /* Reduce text effects for tablet */
  .tw-char {
    -webkit-text-stroke: 0.8px rgba(0, 0, 0, 0.55);
    text-shadow:
      -1px -1px 0 #000,
      1px -1px 0 #000,
      -1px 1px 0 #000,
      1px 1px 0 #000,
      -1px -1px 2px #FFFDF0,
      0 -2px 4px rgba(255, 253, 240, 0.4),
      2px 2px 0 #9A7A18,
      3px 3px 0 #7A5C10,
      4px 4px 0 #5C4408,
      5px 5px 5px rgba(0, 0, 0, 0.6),
      5px 7px 14px rgba(0, 0, 0, 0.4),
      0 0 16px rgba(245, 215, 64, 0.35);
  }

  .tw-char--xl {
    font-size: 1.6em;
    -webkit-text-stroke: 1px rgba(0, 0, 0, 0.6);
    text-shadow:
      -1px -1px 0 #000,
      1px -1px 0 #000,
      -1px 1px 0 #000,
      1px 1px 0 #000,
      -2px -2px 2px #FFFDF0,
      0 -3px 6px rgba(255, 253, 240, 0.45),
      2px 2px 0 #B08E20,
      3px 3px 0 #8A6E14,
      4px 4px 0 #6A520C,
      5px 5px 0 #4E3A06,
      6px 6px 6px rgba(0, 0, 0, 0.6),
      7px 8px 16px rgba(0, 0, 0, 0.4),
      0 0 24px rgba(245, 215, 64, 0.4),
      0 0 48px rgba(245, 215, 64, 0.15);
  }

  /* Hero catchcopy-accent — tablet (matches tw-char--xl tablet) */
  .hero__catchcopy-accent {
    font-size: 1.6em;
    -webkit-text-stroke: 1px rgba(0, 0, 0, 0.6);
    text-shadow:
      -1px -1px 0 #000,
      1px -1px 0 #000,
      -1px 1px 0 #000,
      1px 1px 0 #000,
      -2px -2px 2px #FFFDF0,
      0 -3px 6px rgba(255, 253, 240, 0.45),
      2px 2px 0 #B08E20,
      3px 3px 0 #8A6E14,
      4px 4px 0 #6A520C,
      5px 5px 0 #4E3A06,
      6px 6px 6px rgba(0, 0, 0, 0.6),
      7px 8px 16px rgba(0, 0, 0, 0.4),
      0 0 24px rgba(245, 215, 64, 0.4),
      0 0 48px rgba(245, 215, 64, 0.15);
  }

  /* Hero & loading & page-header craftsman — tablet: smaller */
  .hero__craftsman,
  .loading-overlay__craftsman,
  .page-header__craftsman {
    width: 35%;
    max-width: 360px;
  }

  /* Hero news — tablet: smaller */
  .hero__news {
    max-width: 280px;
    bottom: 30px;
    right: 16px;
  }

  /* CTA background image — tablet */
  .cta-section::after {
    opacity: 0.10;
  }
}

/* --- Mobile (max 767px) --- */
@media (max-width: 767px) {
  :root {
    --font-size-hero: 28px;
    --font-size-3xl: 26px;
    --font-size-2xl: 22px;
    --font-size-xl: 20px;
    --spacing-section: 60px;
    --header-height: var(--header-height-mobile);
  }

  /* Header */
  .hamburger {
    display: flex;
  }

  .nav {
    display: none;
  }

  .header__logo-text {
    font-size: var(--font-size-base);
  }

  /* Hero */
  .hero {
    min-height: 500px;
  }

  /* Hero & loading & page-header craftsman — hide on mobile (overlaps text) */
  .hero__craftsman,
  .loading-overlay__craftsman,
  .page-header__craftsman {
    display: none;
  }

  .hero__news {
    display: none;
  }

  .hero__tagline {
    font-size: 10px;
    letter-spacing: 3px;
    gap: 10px;
    white-space: nowrap;
  }

  .hero__tagline::before,
  .hero__tagline::after {
    width: 20px;
  }

  /* Show line break on mobile */
  .hero__catchcopy-br {
    display: block;
  }

  /* Mobile: white fill + stronger gold 3D shadow for impact */
  .hero__catchcopy {
    font-size: clamp(22px, 6.8vw, 32px);
    line-height: 1.4;
    letter-spacing: 0.03em;
    white-space: normal;
    font-feature-settings: "palt" 1;
    padding: 0 12px;
    margin-bottom: var(--spacing-md);
    /* Override desktop's translateX offset — mobile uses pure vertical animation */
    transform: translateY(30px);
    -webkit-text-fill-color: #ffffff;
    -webkit-text-stroke: 1px rgba(0, 0, 0, 0.6);
    text-shadow:
      -1px -1px 0 #000,
      1px -1px 0 #000,
      -1px 1px 0 #000,
      1px 1px 0 #000,
      -2px 0 0 #000,
      2px 0 0 #000,
      0 -2px 0 #000,
      0 2px 0 #000,
      -2px -3px 3px #FFFDF0,
      0 -3px 6px rgba(255, 253, 240, 0.7),
      2px 2px 0 #B08E20,
      3px 3px 0 #9A7A18,
      4px 4px 0 #7A5C10,
      5px 5px 0 #5C4408,
      6px 6px 0 #3E2E04,
      7px 7px 8px rgba(0, 0, 0, 0.75),
      0 0 30px rgba(245, 215, 64, 0.6),
      0 0 60px rgba(245, 215, 64, 0.3);
  }

  /* Mobile: override desktop's catchcopy-specific keyframe to use neutral heroReveal */
  .hero.is-loaded .hero__catchcopy {
    animation: heroReveal 1.0s ease-out 0.6s forwards;
  }

  .hero__catchcopy-accent {
    font-size: 1.6em;
    margin: 0;
    -webkit-text-fill-color: #ffffff;
    -webkit-text-stroke: 1.3px rgba(0, 0, 0, 0.65);
    text-shadow:
      -1px -1px 0 #000,
      1px -1px 0 #000,
      -1px 1px 0 #000,
      1px 1px 0 #000,
      -2px 0 0 #000,
      2px 0 0 #000,
      0 -2px 0 #000,
      0 2px 0 #000,
      -2px -3px 3px #FFFDF0,
      0 -4px 8px rgba(255, 253, 240, 0.8),
      2px 2px 0 #C29A24,
      3px 3px 0 #A8841C,
      4px 4px 0 #8A6E14,
      5px 5px 0 #6C560E,
      6px 6px 0 #4E3E08,
      7px 7px 0 #362A04,
      8px 8px 10px rgba(0, 0, 0, 0.8),
      0 0 40px rgba(245, 215, 64, 0.7),
      0 0 80px rgba(245, 215, 64, 0.4);
  }

  .hero__subcopy {
    font-size: 13px;
    line-height: 1.9;
    padding: 0 16px;
  }

  .hero__scroll-down {
    bottom: 20px;
  }

  .hero__gate {
    height: 50vh;
  }

  /* Hide mouse stalker on mobile */
  .mouse-stalker {
    display: none;
  }

  .loading-overlay__typewriter {
    font-size: 30px;
    letter-spacing: 0.02em;
    padding: 0 16px;
    line-height: 1.4;
    font-feature-settings: "palt" 1;
    max-width: 100%;
    box-sizing: border-box;
    flex-wrap: wrap;
    white-space: normal;
    min-height: 3em;
    row-gap: 0.3em;
  }

  /* Force line break after "で" on mobile */
  .tw-break {
    display: block;
    flex-basis: 100%;
    width: 100%;
    height: 0;
  }

  /* Mobile: white fill + full gold 3D shadows to match hero */
  .tw-char {
    background: none;
    -webkit-text-fill-color: #ffffff;
    -webkit-text-stroke: 1.2px rgba(0, 0, 0, 0.65);
    paint-order: stroke fill;
    text-shadow:
      -1px -1px 0 #000,
      1px -1px 0 #000,
      -1px 1px 0 #000,
      1px 1px 0 #000,
      -2px 0 0 #000,
      2px 0 0 #000,
      0 -2px 0 #000,
      0 2px 0 #000,
      -2px -3px 3px #FFFDF0,
      0 -3px 6px rgba(255, 253, 240, 0.7),
      2px 2px 0 #B08E20,
      3px 3px 0 #9A7A18,
      4px 4px 0 #7A5C10,
      5px 5px 0 #5C4408,
      6px 6px 0 #3E2E04,
      7px 7px 8px rgba(0, 0, 0, 0.75),
      0 0 25px rgba(245, 215, 64, 0.55),
      0 0 50px rgba(245, 215, 64, 0.3);
  }

  .tw-char--xl {
    font-size: 1.6em;
    background: none;
    -webkit-text-fill-color: #ffffff;
    -webkit-text-stroke: 1.3px rgba(0, 0, 0, 0.65);
    text-shadow:
      -1px -1px 0 #000,
      1px -1px 0 #000,
      -1px 1px 0 #000,
      1px 1px 0 #000,
      -2px 0 0 #000,
      2px 0 0 #000,
      0 -2px 0 #000,
      0 2px 0 #000,
      -2px -3px 3px #FFFDF0,
      0 -4px 8px rgba(255, 253, 240, 0.8),
      2px 2px 0 #C29A24,
      3px 3px 0 #A8841C,
      4px 4px 0 #8A6E14,
      5px 5px 0 #6C560E,
      6px 6px 0 #4E3E08,
      7px 7px 0 #362A04,
      8px 8px 10px rgba(0, 0, 0, 0.8),
      0 0 40px rgba(245, 215, 64, 0.7),
      0 0 80px rgba(245, 215, 64, 0.4);
  }

  /* Troubles tags — unified full-width buttons on mobile */
  .troubles__tags {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    max-width: 340px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 var(--spacing-md);
  }

  .troubles__tag {
    width: 100%;
    padding: 14px 18px;
    font-size: 13px;
    white-space: normal;
    text-align: center;
    box-sizing: border-box;
  }

  /* Troubles service (dark) */
  .troubles__service {
    grid-template-columns: 1fr;
  }

  .troubles__service-index {
    position: static;
    writing-mode: horizontal-tb;
    transform: none;
    text-align: center;
    margin-top: var(--spacing-md);
  }

  /* Layout */
  .grid--2col,
  .grid--3col,
  .grid--4col {
    grid-template-columns: 1fr;
  }

  .section-header__title {
    font-size: var(--font-size-xl);
  }

  /* Stats */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-lg);
  }

  .stat-item__number {
    font-size: var(--font-size-3xl);
  }

  /* Table */
  .info-table,
  .info-table tbody,
  .info-table tr,
  .info-table th,
  .info-table td {
    display: block;
    width: 100%;
  }

  .info-table th {
    padding-bottom: var(--spacing-xs);
    border-bottom: none;
  }

  .info-table td {
    padding-top: var(--spacing-xs);
    padding-bottom: var(--spacing-md);
  }

  /* Steps */
  .steps {
    flex-direction: column;
    gap: var(--spacing-xl);
  }

  .step {
    flex: auto;
  }

  /* News */
  .news-item {
    flex-direction: column;
    gap: var(--spacing-xs);
  }

  .news-item__date {
    min-width: auto;
  }

  /* Footer */
  .footer__inner {
    grid-template-columns: 1fr;
    gap: var(--spacing-xl);
  }

  .footer__bottom {
    flex-direction: column;
    gap: var(--spacing-md);
    text-align: center;
  }

  /* Pagination */
  .pagination {
    gap: 4px;
  }

  .pagination__btn {
    width: 36px;
    height: 36px;
  }

  /* Fixed Buttons */
  .fixed-cta {
    bottom: 0;
    right: 0;
    left: 0;
    padding: 0;
  }

  .fixed-cta__btn {
    border-radius: 0;
    width: 100%;
    justify-content: center;
    padding: 16px;
  }

  .page-top-btn {
    bottom: 70px;
    right: 16px;
    width: 40px;
    height: 40px;
  }

  /* Modal */
  .modal-overlay {
    padding: var(--spacing-sm);
    align-items: flex-end;
  }

  .modal {
    max-height: 85vh;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }

  /* Voice Carousel — mobile: swipe, no arrows */
  .home-voice__card {
    flex: 0 0 80%;
  }

  .home-voice__nav-btn {
    display: none;
  }

  .home-voice__carousel {
    gap: 0;
  }

  /* CTA Section */
  .cta-section {
    padding: var(--spacing-3xl) 0;
  }

  .cta-section::after {
    opacity: 0.05;
  }

  .cta-section__title {
    font-size: var(--font-size-xl);
  }

  .cta-section__buttons {
    flex-direction: column;
    align-items: center;
  }

  .cta-section__link {
    font-size: 1rem;
    padding: 20px 36px;
    gap: 16px;
    letter-spacing: 0.12em;
  }

  /* Breadcrumb */
  .breadcrumb {
    padding: var(--spacing-sm) 0;
  }

  .breadcrumb__list {
    font-size: var(--font-size-xs);
  }

  /* Page Header */
  .page-header {
    margin-top: calc(-1 * var(--header-height-mobile));
    padding: calc(var(--header-height-mobile) + var(--spacing-3xl)) 0 var(--spacing-2xl);
  }

  .page-header__title {
    font-size: var(--font-size-2xl);
  }

  .page-header__glow {
    top: calc(50% + var(--header-height-mobile) / 2);
    width: 300px;
    height: 200px;
  }

  /* Map */
  .map-container {
    padding-bottom: 60%;
  }

  /* Timeline */
  .timeline {
    padding-left: var(--spacing-xl);
  }
}

/* --- Small Mobile (max 374px) --- */
@media (max-width: 374px) {
  :root {
    --font-size-hero: 24px;
    --font-size-2xl: 20px;
    --container-padding: 16px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .loading-overlay__typewriter {
    font-size: 20px;
    letter-spacing: 0.01em;
    padding: 0 4px;
  }

  .tw-char {
    background: none;
    -webkit-text-fill-color: #ffffff;
    -webkit-text-stroke: 0.5px rgba(0, 0, 0, 0.4);
    text-shadow:
      -1px -1px 0 #000,
      1px -1px 0 #000,
      -1px 1px 0 #000,
      1px 1px 0 #000,
      1px 1px 0 #9A7A18,
      2px 2px 0 #7A5C10,
      3px 3px 3px rgba(0, 0, 0, 0.5),
      0 0 10px rgba(245, 215, 64, 0.25);
  }

  .tw-char--xl {
    font-size: 1.2em;
    background: none;
    -webkit-text-fill-color: #ffffff;
    -webkit-text-stroke: 0.6px rgba(0, 0, 0, 0.45);
    text-shadow:
      -1px -1px 0 #000,
      1px -1px 0 #000,
      -1px 1px 0 #000,
      1px 1px 0 #000,
      1px 1px 0 #B08E20,
      2px 2px 0 #8A6E14,
      3px 3px 4px rgba(0, 0, 0, 0.5),
      0 0 12px rgba(245, 215, 64, 0.3);
  }

  /* Hero catchcopy — small mobile white fill */
  .hero__catchcopy {
    -webkit-text-fill-color: #ffffff;
    -webkit-text-stroke: 0.5px rgba(0, 0, 0, 0.4);
    text-shadow:
      -1px -1px 0 #000,
      1px -1px 0 #000,
      -1px 1px 0 #000,
      1px 1px 0 #000,
      1px 1px 0 #9A7A18,
      2px 2px 0 #7A5C10,
      3px 3px 3px rgba(0, 0, 0, 0.5),
      0 0 10px rgba(245, 215, 64, 0.25);
  }

  .hero__catchcopy-accent {
    font-size: 1.2em;
    -webkit-text-fill-color: #ffffff;
    -webkit-text-stroke: 0.6px rgba(0, 0, 0, 0.45);
    text-shadow:
      -1px -1px 0 #000,
      1px -1px 0 #000,
      -1px 1px 0 #000,
      1px 1px 0 #000,
      1px 1px 0 #B08E20,
      2px 2px 0 #8A6E14,
      3px 3px 4px rgba(0, 0, 0, 0.5),
      0 0 12px rgba(245, 215, 64, 0.3);
  }
}
