/* ===================================
 THEME TOKENS
=================================== */
:root {
  --brand-50: #f5f0ff;
  --brand-100: #f3e8ff;
  --brand-200: #e9d5ff;
  --brand-300: #d6bcfa;
  --brand-400: #c4b5fd;
  --brand-450: #bfa8ff;
  --brand-500: #a78bfa;
  --brand-600: #6d28d9;
  --brand-700: #5b21b6;
  --brand-800: #4c1d95;
  --brand-900: #2e1065;
  --brand-hover: #7a3cff; /* 既存hover色の変数化 */
  --ink: #1f2937;
  --ink-weak: #374151;
  --ink-strong: #000000; /* テキストシャドウ等 */
  --surface: #ffffff;
  --border: #e5e7eb;
  --placeholder:#6b7280;
  --on-brand: #ffffff; /* ブランド面上の文字色 */
  --brand-600-rgb: 109, 40, 217;

  /* 追加（未定義参照の補完） */
  --ink-900: #111827;
  --card: #ffffff;
  --shadow: 0 2px 6px rgba(0,0,0,.06);
}
/* ===================================
 COMMON
=================================== */
* {
  margin:0;
  padding:0;
  line-height:1.6em;
  font-size:100%;
  font-family:
  "Noto Sans JP",
  "Meiryo",
  "Yu Gothic UI", "Yu Gothic",
  "Hiragino Sans", "Hiragino Kaku Gothic ProN",
  sans-serif;
}
html {
  box-sizing: border-box;
}
*, *::before, *::after {
  box-sizing: inherit;
}
body{
  min-width:1150px;
}
a:hover img{
  opacity:0.8;
}
.clearfix:after {
  content: ".";
  display: block;
  clear: both;
  height: 0;
  visibility: hidden;
}
.clearfix {
  min-height: 1px;
}
#wrapper{
  text-align:center;
  margin:0 auto;
  width:100%;
}
.contentarea {
  max-width: 1110px;
  width: 100%;
  margin: 0 auto;
  padding: 0;
}
#header{
  width:100%;
  display:block;
  background-color: var(--brand-50);
  text-align:left;
  padding:20px 0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}
#logo {
  width: auto;
}
#logo img {
  display: block;
  height: 56px;
  width: auto;
  max-width: 100%;
}
#gnavi{
  list-style:none;
  margin: 0;
}
#gnavi li{
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-align: right;
  margin-left: 0;
}
#gnavi a{
  text-decoration:none;
  color: var(--ink);
}
#gnavi a:hover{
  color: var(--brand-hover);
}
#gnavi a.is-current {
  color: var(--brand-600);
  font-weight: 700;
  border-bottom: 2px solid var(--brand-600);
  padding-bottom: 6px;
}
/*
#gnavi a.is-current::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -6px;
  height: 2px;
  background: var(--brand-600);
  border-radius: 2px;
}
*/
#mainarea{
  max-width: 1110px;
  width: 100%;
  margin: 50px auto 0;
  text-align: left;
  padding: 0 16px;
}
.block{padding-bottom:50px;}
#footer {
  background-color: var(--brand-50);
  color: var(--ink);
  padding: 20px 0;
  font-size: 14px;
  margin-top: 50px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}
#footer a {
  color: var(--brand-600);
}
#copyright {
  text-align: center;
}
/* ===================================
 TOP PAGE
=================================== */
#mainarea .intro{
  background:url("../img/top_mainimg.jpg");
  background-position:top left;
  margin-bottom:30px;
  width:1110px;
  height:500px;
  display:block;
  text-align:center;
  text-shadow: 1px 1px 3px var(--ink-strong);
}
#mainarea .maintxt{
  color: var(--on-brand);
  font-size:50px;
  font-weight:bold;
  letter-spacing:.1em;
  padding-bottom:30px;
  margin-bottom:30px;
  padding-top:155px;
}
#mainarea .maintxt span{
  padding-bottom:30px;
  border-bottom:1px solid var(--on-brand);
}
#mainarea .subtxt{
  color: var(--on-brand);
  font-size:20px;
  font-weight:normal;
  letter-spacing:.1em;
}
#btns ul{
  padding:0;
  margin:0;
  list-style:none;
}
#btns li{
  float:left;
  margin-right:6px;
}
#btns li:last-child{
  margin-right:0px;
}
#news{
  border:5px solid var(--brand-200);
  padding:20px;
}
#news .fl-l{
  float:left;
  width:327px;
}
#news .fl-r{
  float:right;
  margin:0 20px;
  width:690px;
}
#news .fl-l p{
  background-color: var(--brand-200);
  text-align:center;
  padding:10px;
  letter-spacing:3px;
}
#news .fl-r dt{
  width:100px;
  display:block;
  float:left;
}
#news .fl-r dd{
  display:block;
  float:right;
  width:570px;
}
#news dl{
  border-bottom:1px solid var(--brand-200);
  padding:10px 0;
}
#mainarea_second{
  width:1050px;
  margin:0 auto;
  text-align:left;
}
#mainarea_second ul{margin-left:20px;}
.mainarea_third{
  width:950px;
  margin:0 auto;
  text-align:left;
}
h1#title{
  color: var(--ink-900);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.1em 1rem 1em;
  box-shadow: var(--shadow);
  position: relative;
  font-size: clamp(1.6rem,3.6vw,2.1rem);
  margin: 1.6rem 0 1.2rem;
}
h1#title::before{
  content:""; position:absolute; left:0; top:0; width:100%; height:6px;
  border-radius:14px 14px 0 0;
  background: linear-gradient(90deg, var(--brand-700), var(--brand-400));
}
h1#title .en{
  margin-left:.75rem; letter-spacing:.12em; font-size:.7em;
  font-style: normal; text-transform: uppercase;
  background: rgba(138,96,230,.12); color: var(--brand-600);
  padding:.2em .6em; border-radius:999px;
}
h2.subtitle{
  display: flex; align-items: center; gap: .6rem;
  width: 100%;
  padding: .2em 0 .6em;
  font-weight: 700;
  font-size: clamp(1.25rem, 2.6vw, 1.55rem);
  border-bottom: none;
  position: relative;
  margin: 1.4rem 0 1.4rem;
}
h2.subtitle::before{
  content: ""; width: 12px; height: 12px; border-radius: 4px;
  background: conic-gradient(from 0deg, var(--brand-400), var(--brand-700));
}
h2.subtitle::after{
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--brand-700), var(--brand-400));
  border-radius: 2px;
}
h3.subtitle2{
  font-weight: 700;
  line-height: 1.4;
  font-size: clamp(1.1rem, 2.8vw, 1.4rem);
  margin: 1.2rem 0 .6rem;
  color: var(--ink);
}
/* ===================================
 SERVICES
=================================== */
.services_title{
  font-size:34px;
  font-weight:bold;
  color: var(--brand-600);
  margin-bottom:30px;
}
.services_txt{
  font-size:18px;
  margin-bottom:30px;
  background-image:url("../img/services_img.jpg");
  background-position:center right;
  background-repeat:no-repeat;
  padding-right:0;
}
.services_txt .name{
  margin-top:30px;
  font-size:120%;
  text-align:right;
}
.services-block {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 24px;
  align-items: start;
}
.services-visual img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
  border-radius: 8px;
}
/* ===================================
 WORKS
=================================== */
.filter-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 24px;
}
.filter-nav button {
  appearance: none;
  border: 1.5px solid var(--brand-400);
  background: var(--surface);
  color: var(--ink);
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
}
.filter-nav button.is-active,
.filter-nav button:hover {
  border-color: var(--brand-600);
  color: var(--brand-600);
  box-shadow: 0 0 0 4px rgba(var(--brand-600-rgb), .08);
}
.case-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}
.case-card {
  background: var(--surface);
  border: 1px solid var(--brand-300);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 2px 6px rgba(0,0,0,.06);
}
.case-thumb img {
  display: block;
  width: 100%;
  height: 180px;
  object-fit: cover;
  background: #f3f4f6;
}
.case-body { padding: 16px; }
.case-title {
  font-size: 18px;
  margin: 0 0 6px;
  color: var(--ink);
}
.case-lead {
  font-size: 14px;
  color: var(--ink-weak);
  margin: 0 0 12px;
}
.case-meta {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
}
.chip {
  font-size: 12px;
  background: var(--brand-100);
  color: var(--brand-700);
  border: 1px solid var(--brand-300);
  border-radius: 999px;
  padding: 4px 8px;
}
.badge {
  font-size: 12px;
  background: #f9fafb;
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px 8px;
}
.cta-box {
  margin-top: 36px;
  text-align: center;
  border: 1.5px solid var(--brand-400);
  border-radius: 12px;
  padding: 24px;
  background: var(--surface);
}
.works .btn-primary {
  display: inline-block;
  text-decoration: none;
  background: var(--brand-600);
  color: var(--on-brand);
  font-weight: 700;
  padding: 12px 24px;
  border-radius: 8px;
  margin-top: 12px;
}
.works .btn-primary:hover {
  background: var(--brand-hover);
}
/* ===================================
 COMPANY
=================================== */
#company{
  background-image:url("../img/company_img.jpg");
  background-position:top right;
  background-repeat:no-repeat;
}
#company dl{
  border-bottom:1px solid var(--brand-300);
  padding:10px 0;
  width:630px;
}
#company dt{
  width:70px;
  display:block;
  float:left;
}
#company dd{
  display:block;
  float:right;
  width:500px;
}
#company dd img{vertical-align:middle;}
#company dd span{
  width:100px;
  display:block;
  float:left;
}
#map iframe{
  width:950px;
  height:450px;
}
/* ===================================
 SECURITY POLICY
=================================== */
.policy p {
  margin: 0 0 16px;
  color: var(--ink);
  line-height: 1.8;
  padding-left: 1em;
  text-indent: 0;
}
.policy-list {
  list-style: decimal;
  margin: 8px 0 0 1.25em;
  padding-left: 1em;
}
.policy-list li {
  margin: 0 0 10px 0;
  line-height: 1.8;
}
.policy-signoff{
  text-align: right;
}
/* ===================================
 CAREERS
=================================== */
#careers{
  background-image:url("../img/careers_img.jpg");
  background-position:top right;
  background-repeat:no-repeat;
}
#careers2 table{
  width:100%;
  border-collapse:collapse;
  border-spacing:0;
}
#careers2 table th,
#careers2 table td{
  border:1px solid var(--brand-450);
  padding:10px;
  display:table-cell;
}
#careers2 table th{
  width:200px;
  text-align:center;
  background-color: var(--brand-100);
}
/* ===================================
 VOICE SECTION
=================================== */
.voice-section {
  background-color: var(--brand-50);
  padding: 40px 20px;
}
.voice-container {
  max-width: 900px;
  margin: 0 auto;
}
.voice-title {
  color: var(--brand-600);
  font-size: 28px;
  margin-bottom: 30px;
  text-align: center;
}
.voice-box {
  background: var(--surface);
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  border-left: 6px solid;
}
.voice-box.purple {
  border-color: var(--brand-600);
}
.voice-box.lavender {
  border-color: var(--brand-500);
}
/* ===================================
 CONTACT FORM
=================================== */
.contact-form {
  max-width: 720px;
  margin: 0 auto;
}
.contact-form .form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px 24px;
}
.contact-form .form-field {
  display: flex;
  flex-direction: column;
  grid-column: span 1;
}
.contact-form .form-field.full {
  grid-column: 1 / -1;
}
.contact-form label {
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--ink-weak);
}
.contact-form input,
.contact-form textarea {
  appearance: none;
  width: 100%;
  min-width: 0;
  padding: 12px 14px;
  border: 1.5px solid var(--brand-400);
  border-radius: 8px;
  font: inherit;
  line-height: 1.6;
  background: var(--surface);
  box-sizing: border-box;
}
.contact-form input::placeholder,
.contact-form textarea::placeholder {
  color: var(--placeholder);
}
.contact-form input:focus,
.contact-form textarea:focus {
  outline: 3px solid var(--brand-200);
  border-color: var(--brand-600);
  box-shadow: 0 0 0 4px rgba(var(--brand-600-rgb), .10);
}
.contact-form .reqd {
  margin-left: .5em;
  font-size: 12px;
  color: var(--brand-600);
  background: var(--brand-100);
  border: 1px solid var(--brand-300);
  border-radius: 999px;
  padding: 2px 6px;
}
.contact-form .form-actions {
  grid-column: 1 / -1;
  text-align: center;
  margin-top: 4px;
}
.contact-form .btn-primary {
  background: var(--brand-600);
  color: var(--on-brand);
  font-weight: 700;
  padding: 12px 24px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  width: min(100%, 240px);
}
.contact-form .btn-primary:hover {
  background: var(--brand-hover);
  transform: scale(1.03);
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}
/* ===================================
 THANKS PAGE
=================================== */
.thanks-box {
  max-width: 720px;
  margin: 60px auto;
  text-align: center;
  padding: 32px 24px;
  border: 1.5px solid var(--brand-400);
  border-radius: 12px;
  background: var(--surface);
}
.thanks-box h1 {
  margin-bottom: 12px;
}
.thanks-box p {
  margin: 0 0 20px;
}
.thanks-box .btn-primary {
  display: inline-block;
  text-decoration: none;
  background: var(--brand-600);
  color: var(--on-brand);
  font-weight: 700;
  padding: 12px 24px;
  border-radius: 8px;
}
.thanks-box .btn-primary:hover {
  background: var(--brand-hover);
}
/* ===== Hamburger button (base) ===== */
.menu-btn {
  display: none; /* PCでは非表示 */
  background: none;
  border: none;
  cursor: pointer;
  width: 44px;
  height: 44px;
  position: absolute;
  top: 18px;
  right: 16px;
  z-index: 1000;
}
.menu-btn .menu-bar {
  display: block;
  width: 28px;
  height: 3.5px;
  margin: 6px auto;
  background: var(--brand-600);
  border-radius: 2px;
  transition: transform .25s ease, opacity .2s ease, background-color .2s ease;
}
/* =========================================================
 MOBILE ONLY OVERRIDES (keep desktop as-is)
 ========================================================= */
@media (max-width: 767px) {
  /* ベース調整（固定幅の解除・はみ出し防止） */
  /* body { min-width:0; } ← 重複を整理のため削除（～1024px側に集約） */
  img, video, iframe { max-width: 100%; height: auto; }
  #header { padding: 12px 0; }
  #logo img { height: clamp(48px, 9vw, 56px); }
  /* ラッパー/余白 */
  #mainarea,
  .contentarea,
  #mainarea_second,
  .mainarea_third {
    max-width: 100%;
    width: 100%;
    margin: 24px auto 0;
    padding: 0 12px;
  }
  #mainarea .intro {
    width: 100%;
    height: 300px;
    background-position: center;
    background-size: cover;
    margin-bottom: 20px;
  }
  #mainarea .maintxt {
    font-size: clamp(24px, 6vw, 32px);
    padding-top: 110px;
    padding-bottom: 16px;
    margin-bottom: 12px;
  }
  #mainarea .subtxt {
    font-size: clamp(14px, 3.8vw, 16px);
    letter-spacing: .06em;
  }
  /* トップ：ボタン並び（横スクロールよりも折り返し） */
  #btns ul { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
  #btns li { float: none; margin-right: 0; }
  /* NEWS：2カラム→1カラム */
  #news { padding: 16px; }
  #news .fl-l,
  #news .fl-r {
    float: none;
    width: 100%;
    margin: 0;
  }
  #news .fl-r dt,
  #news .fl-r dd {
    float: none;
    width: 100%;
  }
  #news dl { padding: 8px 0; }
  .services_txt {
    width: 100%;
    padding-right: 0;
  }
  .services_txt .name {
    text-align: left;
    margin-top: 16px;
  }
  /* SERVICES：2カラム→1カラム（縦並び） */
  .services-block {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .services-visual { order: 0; }
  /* WORKS：カードグリッドは1列に */
  .case-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .case-thumb img {
    height: 160px;
    object-fit: cover;
  }
  /* COMPANY：定義リストを縦並びに */
  #company dl { width: 100%; }
  #company dt,
  #company dd {
    float: none;
    width: 100%;
  }
  #company dd span {
    float: none;
    display: inline-block;
    width: auto;
    margin-right: 8px;
  }
  /* MAP：はみ出し防止 */
  #map iframe {
    width: 100%;
    height: 260px; /* ← 本来のスマホ時高さ */
  }
  /* フッター：余白少しコンパクトに */
  #footer { padding: 16px 0; font-size: 13px; }
}
/* さらに狭い端末向け（<= 480px）：微調整 */
@media (max-width: 480px) {
  #mainarea .intro { height: 240px; }
  #mainarea .maintxt { padding-top: 80px; }
  .voice-section { padding: 28px 12px; }
}
/* =========================================
 HEADER: タブレットまでハンバーガー化
 （ヘッダーだけ 1024px 以下を対象）
 ========================================= */
@media (max-width: 1024px) {
  body { min-width: 0; }
  #mainarea .intro {
    width: 100%;
    background-position: center;
    background-size: cover;
  }
  #mainarea_second, .mainarea_third {
    width: 100%;
    margin: 0 auto;
    padding: 0 12px;
  }
  #map iframe {
    width: 100%;
    height: 320px;
  }
  .menu-btn {
    display: block;
    top: 50%;
    right: 16px;
    transform: translateY(-50%);
    z-index: 1200;
  }
  #header {
    position: relative;
    padding: 12px 0;
  }
  body.menu-open {
    overflow: hidden;
  }
  body.menu-open::after {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.28);
    z-index: 900;
  }
  #gnavi {
    position: absolute;
    top: calc(100% + 10px);
    right: 12px; left: auto;
    width: min(92vw, 340px);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 12px 24px rgba(0,0,0,.12);
    padding: 8px;
    list-style: none;
    display: block; /* アニメ用に常時 block */
    opacity: 0;
    transform: translateY(-8px);
    visibility: hidden;
    pointer-events: none;
    z-index: 1100;
    transition: opacity .22s ease, transform .22s ease, visibility 0s linear .22s;
  }
  #gnavi.open {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
    pointer-events: auto;
    transition: opacity .22s ease, transform .22s ease, visibility 0s;
  }
  #gnavi li { margin: 0; }
  #gnavi li a {
    display: block;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    color: var(--ink);
  }
  #gnavi li:last-child a { border-bottom: none; }
  #gnavi::before {
    content: "";
    position: absolute;
    top: -6px;
    right: 32px;
    width: 12px;
    height: 12px;
    background: var(--surface);
    border-left: 1px solid var(--border);
    border-top: 1px solid var(--border);
    transform: rotate(45deg);
  }
}
/* =========================================
 DESKTOP: 1025px 以上は常に横並びに固定
 （縦積みにならないよう明示）
 ========================================= */
@media (min-width: 1025px) {
  #header, #header .contentarea {
    display: flex;
    align-items: center;
  }
  #header .contentarea {
    justify-content: space-between;
    gap: 16px;
  }
  #gnavi {
    display: flex;
    gap: 20px;
    align-items: center;
  }
  #gnavi li {
    float: none;
    /* margin-left: 0; ← 重複を削除（ベース側に既にあるため） */
  }
  #gnavi a {
    line-height: 1;
    padding: 8px 0;
  }
  #logo img {
    height: 56px;
    display: block;
  }
}

/* ====== 末尾の安全上書き（逆転解消の担保・最終勝ち） ====== */
@media (max-width: 767px){
  #map iframe { height: 260px; } /* これで～767pxは必ず260pxに */
}
