/* =========================================================
   Responsive (BearAid LP)
   - breakpoints: mobile <=480px / tablet <=1024px
========================================================= */

/* ============= Tablet (<=1024px) ============= */
@media (max-width: 1024px){
  :root{
    --scroll-line-h: 56px;
    --scroll-gap: 10px;
    --scroll-font: 12px;
  }

  /* Header / Menu */
  .hamburger{
    left:14px;
    top:14px;
  }
  .menu-grid{ grid-template-columns:1fr; text-align:start; }
  .menu-left{ justify-content:flex-start; padding-bottom:0; }

  /* Hero */
  .hero{
    position:relative;
    min-height:100svh;
    min-height:100dvh;
    min-height:100vh;
    display:grid;
    place-items:center;
    padding-top:0;
    padding-bottom:14vh;
    overflow:hidden;
  }

  .hero-inner{
    width: 100%;
    max-width: 92vw;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    text-align: center;
  }

  .hero-logo{
    width: min(80vw, 380px);
    margin: 0 auto 20px;
    height:auto;
    display:block;
  }

  .catchcopy{
    white-space:nowrap;
    max-width: 90vw;
    overflow:hidden;
    text-overflow:clip;
    font-size: clamp(22px, 5vw, 32px);
    line-height:1.5;
    margin:6px auto 0;
    text-align:center;
  }

  .hero .scroll-indicator{
    right: 8px;
    bottom: max(72px, env(safe-area-inset-bottom) + 48px);
  }

  /* Overlay menu (tablet layout) */
  .menu-grid{
    display:grid; grid-template-columns:1.1fr 1fr;
    gap:clamp(28px,6vw,56px); align-items:stretch;
  }
  .menu-left{ display:flex; flex-direction:column; justify-content:flex-start; padding-top:2px; }
  .menu-left .contact-row{ margin-top:auto; }
  .menu-left .copyright{ margin-top:12px; font-size:12.5px; opacity:.65; }
  .menu-right .menu-caption{ margin:0 0 10px; font-size:14px; opacity:.8; letter-spacing:.08em; }
  .menu-list a{ font-size:clamp(20px,3vw,16px); font-weight:700; line-height:1.15; }

  /* Sections */
  .section{ padding:96px 24px 80px; }
  .service-item{ min-height:380px; column-gap:32px; }
  .service-media{ padding:16px; max-width:520px; margin:0 auto; }

  /* Contact block */
  .contact-card{ padding:56px 24px 44px; }
  .contact-card__inner{ padding:28px; }

  /* Footer skeleton */
  .footer{
    background:#171b1f;
  }
  .footer-inner{
    padding:48px 24px 24px;
  }
  .footer-top{
    display:grid;
    grid-template-columns:1fr;
    gap:28px;
    margin-bottom:12px;
  }
  .footer-logo{
    width:150px;
    height:auto;
    margin-bottom:16px;
  }
  .footer-nav a{
    font-size:17px;
    line-height:2;
    color:#f0f0f0;
    text-decoration:none;
  }
  .footer-nav a:hover{
    color:#e64b4b;
    transition:color .2s ease;
  }
  .info-col{
    color:#eaecef;
    text-align:left;
  }
  .company-name{
    font-weight:600;
    margin-bottom:6px;
  }
  .company-address{
    line-height:1.9;
    opacity:.85;
  }

  .footer .contact-bottom-row{
    display:flex;
    flex-direction:column;
    align-items:flex-start;
    gap:10px;
    margin-top:28px;
  }
  .footer .contact-row{
    display:flex;
    align-items:center;
    justify-content:flex-start;
    gap:10px;
  }
  .contact-label{
    font-size:14px;
    letter-spacing:.1em;
    color:#fff;
  }
  .footer .contact-row .contact-line{
    flex:0 0 60px;
    width:60px;
    height:1px;
    background:rgba(255,255,255,.18);
  }
  .contact-circle{
    width:42px;
    height:42px;
    display:grid;
    place-items:center;
    border-radius:999px;
    background:#242a30;
    color:#fff;
  }
  .footer .copyright{
    text-align:left;
    font-size:12.5px;
    opacity:.75;
    margin-top:4px;
  }
  .info-col{ justify-self: start; }
}

/* ============= Narrow tablet / phablet (<=820px) ============= */
@media (max-width: 820px){
  .service-item{ grid-template-columns:1fr; row-gap:28px; min-height:auto; }
  .service-item--reverse .service-text{ order:2; }
}

/* ============= Mobile (<=480px) ============= */
@media (max-width: 480px){
  :root{
    --hero-rail:88vw;
    --section-bg-sp:#f8fafc;
    --scroll-line-h: 56px;
    --scroll-gap: 10px;
    --scroll-font: 12px;
  }

  html,body{ letter-spacing:.02em; }
  body{ font-size:15px; line-height:1.7; }

  /* セクション背景トーン統一 */
  .services,.philosophy,.company{ background:var(--section-bg-sp); }

  /* Hamburger / Menu */
  .hamburger{ left:10px; top:10px; }
  .menu-overlay__inner{ width:90vw; }
  .menu-grid{
    display:flex; flex-direction:column; align-items:flex-start;
    gap:48px;
  }
  .menu-right{ order:1; width:100%; }
  .menu-left{ order:2; width:100%; }
  .menu-right .menu-caption{ margin-bottom:12px; opacity:.8; font-size:16px; }
  .menu-list{ display:flex; flex-direction:column; gap:12px; text-align:left; }
  .menu-list a{ font-size:clamp(18px,7.2vw,13px); }
  .menu-copyright{ margin-top:10px; font-size:12px; }
  .menu-left .company-name,.menu-left .company-address{ line-height:1.6; font-size:14px; }
  .menu-left .contact-row{ margin-top:20px; }
  .menu-left .copyright{ margin-top:10px; font-size:12px; opacity:.7; }

  /* Hero */
  .hero{
    min-height:100vh;
    padding:0 0 16vh;
    overflow:hidden;
  }
  .hero-inner{ row-gap:20px; }
  .hero-logo{ width:min(68vw,280px); margin:0 auto 14px; }
  .catchcopy{
    white-space:nowrap; max-width:calc(100vw - 32px);
    overflow:hidden; text-overflow:ellipsis;
    font-size:clamp(16px,5.6vw,22px); line-height:1.15; letter-spacing:.02em;
    margin-top:12px; text-align:center;
  }

  .section:first-of-type{ margin-top:0; }

  /* Section title (01/02/03) */
  .section-title{ position:relative; overflow:visible; margin-bottom:18px; padding-left:56px; }
  .section-title .section-number{
    position:absolute; top:-24px; left:6px;
    font-size:clamp(64px,24vw,92px); line-height:1; font-weight:800;
    color:rgba(0,0,0,.09); z-index:0; pointer-events:none;
  }
  .section-title .section-en{ font-size:clamp(16px,4.8vw,20px); letter-spacing:.02em; font-weight:700; margin-bottom:6px; }
  .section-title .section-ja{ font-size:12.5px; color:#6f7680; margin-top:2px; }
  .section-title .section-en,.section-title .section-ja{ position:relative; z-index:1; }

  /* Services */
  .services .service-item{
    background:transparent !important; box-shadow:none !important; border-radius:0 !important;
    padding:8px 0 20px; margin-bottom:18px;
    display:flex; flex-direction:column; align-items:center; gap:16px;
  }
  .services .service-text{
    order:1;
    width:100%;
    text-align:left;
    margin-bottom:10px;
    padding-left: 4px;
    padding-right: 4px;
  }
  .services .service-media{
    order:2; width:100%; max-width:clamp(100px,34vw,140px);
    margin:0 auto; padding:0 !important; background:transparent !important; box-shadow:none !important; border-radius:0 !important; aspect-ratio:auto;
  }
  .services .service-media img,
  .service-media img{ width:100%; height:auto; object-fit:contain !important; object-position:center; display:block; }

  .services .section-title{ margin-bottom:16px; }
  .section{ padding:60px 0 70px; }
  .services{
    padding-top:56px;
    padding-left: 16px;
    padding-right: 16px;
  }

  /* Philosophy */
  .philosophy{ padding:52px 16px 44px; }
  .philosophy .section-title{ margin-bottom:14px; }
  .philosophy .philosophy-main,
  .philosophy p{ max-width:min(92vw,30em); margin-left:auto; margin-right:auto; }
  .philosophy .philosophy-main{
    margin-top:20px;
    margin-bottom:14px;
    line-height:1.55;
    font-size: clamp(18px, 6vw, 22px);
    white-space: nowrap;
    word-break: keep-all;
    overflow-wrap: normal;
    text-align: center;
  }
  .philosophy p{ font-size:14.8px; line-height:1.9; }
  .philosophy .section-title{ margin-bottom:20px; }

  /* Company */
  .company{ background:var(--section-bg-sp) !important; border-radius:0 !important; box-shadow:none !important; padding:32px 16px 26px; }
  .company .section-title{ position:relative; overflow:visible; margin-bottom:16px; }
  .company .section-title .section-number{ position:absolute; top:-24px; left:6px; font-size:clamp(64px,24vw,92px); line-height:1; font-weight:800; color:rgba(0,0,0,.09); z-index:0; }
  .company .section-title .section-en{ font-size:clamp(16px,4.8vw,20px); letter-spacing:.02em; font-weight:700; margin-bottom:6px; }
  .company .section-title .section-ja{ font-size:12.5px; color:#6f7680; margin-top:2px; }
  .company .section-title .section-en,.company .section-title .section-ja{ position:relative; z-index:1; }
  .company .company-row:first-child{ margin-top:6px; }
  .company-table{ width:100%; max-width:92vw; margin:0 auto; }
  .company-row{
    display:grid; grid-template-columns:108px 1fr; column-gap:12px; row-gap:12px;
    padding:12px 0; border-top:1px solid rgba(0,0,0,.06);
  }
  .company-row:first-child{ border-top:none; padding-top:0; }
  .company dt{ font-size:12.5px; line-height:1.6; letter-spacing:.08em; color:#7a8088; }
  .company dd{ font-size:15px; line-height:1.9; color:#222; word-break:break-word; }

  /* Contact */
  .contact-card,.contact-card__inner{ border-radius:0 !important; box-shadow:none !important; background:var(--section-bg-sp) !important; }
  .contact-card{ width:min(92vw,640px); margin:0 auto; padding:36px 16px 28px; }
  .contact-card__inner{ padding:18px 16px; max-width:30em; margin:0 auto; }
  .contact-card__text{ font-size:14.8px; line-height:1.9; margin-bottom:16px; }
  .contact-card__button{ font-size:15px; padding:12px 16px; width:220px; margin:10px auto 0; }

  .philosophy{
    background:
      radial-gradient(120px 100px at 12% 24%, rgba(0,0,0,.03), transparent 60%),
      radial-gradient(180px 140px at 88% 6%, rgba(0,0,0,.025), transparent 65%),
      var(--section-bg-sp);
  }
  .services{
    background:
      radial-gradient(160px 120px at 92% 8%, rgba(0,0,0,.025), transparent 65%),
      var(--section-bg-sp);
  }

  /* Footer */
  .footer{ background:#171b1f; }
  .footer-inner{ padding:44px 18px 24px; padding-bottom:max(20px, env(safe-area-inset-bottom)); }
  .footer-top{ display:grid; grid-template-columns:1fr; gap:24px; margin-bottom:6px; }
  .footer-logo{ width:135px; height:auto; }
  .footer-nav a{ font-size:17px; line-height:2; color:#f0f0f0; text-decoration:none; }
  .footer-nav a:hover{ color:#e64b4b; transition:color .2s ease; }
  .info-col{ color:#eaecef; }
  .company-name{ font-weight:600; margin-bottom:6px; }
  .company-address{ line-height:1.9; opacity:.85; }

  /* CONTACT */
  .footer .contact-bottom-row{
    display:flex; flex-direction:column; align-items:flex-start; gap:10px; margin-top:28px;
  }
  .footer .contact-row{ display:flex; align-items:center; justify-content:flex-start; gap:10px; }
  .contact-label{ font-size:14px; letter-spacing:.1em; color:#fff; }
  .footer .contact-row .contact-line{ flex:0 0 60px; width:60px; height:1px; background:rgba(255,255,255,.18); }
  .contact-circle{ width:42px; height:42px; display:grid; place-items:center; border-radius:999px; background:#242a30; color:#fff; }
  .footer .copyright{ text-align:left; font-size:12.5px; opacity:.75; margin-top:4px; }
  .info-col{ justify-self: start; }
}

/* ============= Mid-range (481px–1024px) ============= */
@media (max-width:1024px) and (min-width:481px){
  .section-title .section-en{ font-size:clamp(18px,2.2vw,22px); margin-bottom:6px; }
  .section-title .section-number{ font-size:clamp(72px,10vw,110px); color:rgba(0,0,0,.08); }

  /* Footer inherits tablet layout (already single-column) */

  .service-media,.service-item,.company,.company .company-row,.contact-card,.contact-card__inner{
    border-radius:0 !important;
  }
}

/* ============= Wide desktop (>=1200px) ============= */
@media (min-width:1200px){
  .service-media{ max-height:260px; }
  .service-item{ padding:16px; }
  .catchcopy{ font-size:clamp(18px,3vw,22px); }
}

/* ================== 481px–820px：PC縮小時の帯だけスマホ風に揃える ================== */
@media (max-width: 820px) and (min-width: 481px) {
  /* 縦並びに統一（逆順レイアウトも打ち消し） */
  .services .service-item {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 16px !important;
    padding: 8px 0 20px !important;
    margin-bottom: 18px !important;
    min-height: auto !important;
  }
  .services .service-text {
    order: 1 !important;
    width: 100% !important;
    text-align: left !important;
    margin: 0 0 10px !important;
    padding: 0 8px !important;
    max-width: 640px !important;
  }
  .services .service-media {
    order: 2 !important;
    width: 100% !important;
    max-width: clamp(120px, 36vw, 220px) !important;
    margin: 0 auto !important;

    /* style.css のカード風スタイルを無効化してスマホと同じ見た目に */
    padding: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    aspect-ratio: auto !important;
  }
  .services .service-media img {
    width: 100% !important;
    height: auto !important;
    object-fit: contain !important;
    object-position: center !important;
    display: block !important;
  }

  /* 交互配置を打ち消し（見出し→本文→画像 の順に固定） */
  .services .service-item--reverse .service-text  { order: 1 !important; }
  .services .service-item--reverse .service-media { order: 2 !important; }

  /* セクションタイトルの間隔もスマホ寄りに軽く */
  .services .section-title { margin-bottom: 16px !important; }
}
