:root{
  /* Apple-ish light */
  --bg:#f5f5f7;
  --bg2:#ffffff;
  --txt:#111113;
  --muted:#6e6e73;

  --line: rgba(0,0,0,.10);
  --line2: rgba(0,0,0,.07);

  --shadow: 0 14px 40px rgba(0,0,0,.10);
  --shadow2: 0 10px 24px rgba(0,0,0,.08);

  --radius-lg: 22px;
  --radius-md: 16px;

  --navH: 72px;
  --navH-small: 56px;

  --navAlpha: .72;
  --navAlphaSolid: .92;

  --acc1:#2f7dff;
  --acc2:#00c2a8;
}

html[data-theme="corporate"]{
  --bg:#f5f5f7;
  --bg2:#ffffff;
  --txt:#111113;
  --muted:#6e6e73;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  color:var(--txt);
  background:
    radial-gradient(1200px 600px at 20% -10%, rgba(47,125,255,.10), transparent 60%),
    radial-gradient(1000px 520px at 80% 0%, rgba(0,194,168,.10), transparent 60%),
    linear-gradient(180deg, var(--bg), var(--bg2));
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a{ color:inherit; text-decoration:none; }
a:hover{ text-decoration:none; }

/* ===== Global Nav (glass) ===== */
.g-nav{
  position:fixed; inset-inline:0; top:0; z-index:100;
  height:var(--navH);
  display:flex; align-items:center; justify-content:center;

  background: rgba(255,255,255,var(--navAlpha));
  border-bottom: 1px solid var(--line);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);

  transition: height .28s ease, background-color .28s ease, box-shadow .28s ease;
}
.g-wrap{
  width:100%;
  max-width:min(1380px, 96vw);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
  padding:0 10px;
  flex-wrap: nowrap;
}
.brand{
  display:flex; align-items:center; gap:10px;
  color:inherit; text-decoration:none;
  white-space:nowrap;
  min-width: 0;
}
.brand img{ height:28px; width:auto; display:block; }
.brand .name{
  font-weight:800;
  font-size: clamp(12px,1.9vw,16px);
  max-width: 52vw;
  overflow:hidden;
  white-space:nowrap;
  text-overflow:ellipsis;
}

.nav-right{ display:flex; align-items:center; gap:14px; flex-wrap: nowrap; }
.nav-links{ display:flex; align-items:center; gap: clamp(16px, 2.8vw, 28px); flex-wrap: nowrap; }
.nav-links > a,
.nav-links > .dd > a{
  font-weight:800;
  font-size:13px;
  padding:7px 10px;
  border-radius:10px;
  border:1px solid transparent;
  color: inherit;
}
.nav-links > a:hover,
.nav-links > .dd:hover > a{
  border-color: var(--line);
  background: rgba(0,0,0,.04);
}

.dd{ position:relative; }
.dd-menu{
  position:absolute;
  top: calc(100% + 10px);
  left:0;
  min-width: 240px;
  max-width: 80vw;

  background: rgba(255,255,255,.92);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 8px;
  display:none;

  box-shadow: var(--shadow2);
  backdrop-filter: saturate(160%) blur(16px);
  -webkit-backdrop-filter: saturate(160%) blur(16px);
}
.dd.open .dd-menu{ display:block; }
.dd-menu a{
  display:block;
  padding: 10px 12px;
  border-radius: 12px;
  font-weight: 800;
  color: inherit;
}
.dd-menu a:hover{ background: rgba(0,0,0,.045); }

.lang-switch{ display:flex; gap:8px; }
.lang-switch a{
  border:1px solid var(--line);
  padding:6px 10px;
  border-radius:10px;
  font-weight:800;
  color: inherit;
  background: rgba(255,255,255,.55);
}
.lang-switch a:hover{ background: rgba(255,255,255,.95); }

.nav-cta{
  display:inline-flex; align-items:center; gap:.55em;
  padding:10px 12px;
  border-radius: 12px;
  font-weight: 900;
  color: #fff;
  background: linear-gradient(135deg, var(--acc1), var(--acc2));
  box-shadow: 0 10px 22px rgba(47,125,255,.20);
  white-space:nowrap;
}
.tel-cta{ display:none; }
.sp-toggle{ display:none; }

.g-nav.shrink{
  height: var(--navH-small);
  background: rgba(255,255,255,var(--navAlphaSolid));
  box-shadow: 0 10px 22px rgba(0,0,0,.08);
}

/* ===== Drawer (SP) ===== */
.drawer{ display:none; }

@media (max-width: 960px){
  .nav-links, .lang-switch, .nav-cta{ display:none; }
  .tel-cta{ display:inline-flex; }
  .sp-toggle{ display:inline-flex; align-items:center; gap:6px; }

  .tel-cta,
  .sp-toggle button{
    white-space: nowrap;
    word-break: keep-all;
  }
  .sp-toggle,
  .tel-cta{ flex: 0 0 auto; }

  .sp-toggle button{
    background: rgba(0,0,0,.03);
    border: 1px solid var(--line);
    color: inherit;
    padding: 8px 10px;
    border-radius: 12px;
    font-weight: 900;
    display:inline-flex; align-items:center; line-height:1;
  }

  .drawer{
    position:fixed; inset:0;
    background: rgba(0,0,0,.20);
    z-index: 90;
    display:none;
  }
  .drawer-panel{
    position:fixed;
    top: calc(var(--navH-small) + 8px);
    right:0;
    height: calc(100% - (var(--navH-small) + 8px));
    width: min(86vw, 330px);

    background: rgba(255,255,255,.96);
    border-left: 1px solid var(--line);
    box-shadow: -20px 0 40px rgba(0,0,0,.12);

    padding: 14px;
    overflow:auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;

    transform: translateX(100%);
    transition: transform .28s ease;
    border-top-left-radius: 18px;
    border-bottom-left-radius: 18px;
  }
  .drawer.show{ display:block; }
  .drawer.show .drawer-panel{ transform: translateX(0); }

  .drawer a{
    display:block;
    padding: 14px 12px;
    border-bottom: 1px solid var(--line2);
    color: inherit;
  }

  .drawer .close{
    position: sticky;
    top: 0;
    padding: 6px 0 10px;
    margin-bottom: 8px;
    background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(255,255,255,.82));
    z-index: 1;
    text-align: right;
  }
  .drawer .close button{
    border: 1px solid var(--line);
    background: rgba(0,0,0,.03);
    color: inherit;
    padding: 8px 10px;
    border-radius: 10px;
    font-weight: 900;
  }

  .drawer .group-title{
    margin: 8px 6px 4px;
    color: var(--muted);
    font-weight: 900;
    font-size: 12px;
    letter-spacing: .02em;
  }

  /* Accordion (JS生成) */
  .acc-head{ display:flex; align-items:center; justify-content:space-between; gap:8px; margin:6px 0 2px; }
  .acc-link{
    display:inline-flex; align-items:center;
    padding: 12px 10px;
    border:1px solid var(--line);
    border-radius: 12px;
    background: rgba(0,0,0,.03);
    font-weight: 900;
    flex: 1 1 auto;
  }
  .acc-btn{
    width: 40px; height: 40px;
    display:inline-flex; align-items:center; justify-content:center;
    border:1px solid var(--line);
    border-radius: 12px;
    background: rgba(0,0,0,.03);
    color: inherit;
    font-weight: 900;
  }
  .acc-btn .chev{ transition: transform .2s ease; }
  .acc-btn[aria-expanded="true"] .chev{ transform: rotate(90deg); }
  .acc-panel{ display:none; }
  .acc-panel.open{ display:block; }
  .acc-panel a{ padding-left: 18px; }
}

/* ===== Hero ===== */
html{ scroll-padding-top: var(--navH); }
@media (max-width:960px){ html{ scroll-padding-top: var(--navH-small); } }

.hero{
  position:relative;
  min-height: 44svh;
  display:grid;
  place-items:center;
  padding-top: calc(var(--navH) + 16px);

  /* 画像を“くっきり”見せつつ、Appleっぽく明るく */
  background:
    linear-gradient(180deg, rgba(245,245,247,.56), rgba(245,245,247,.76)),
    url("https://www.nikko-kikai.co.jp/img/profile3.png") center/cover no-repeat;

  border-bottom: 1px solid var(--line);
  overflow:hidden;
}
.hero::after{
  content:"";
  position:absolute; inset:0;
  background: radial-gradient(120% 80% at 50% -10%, rgba(47,125,255,.14) 0%, transparent 55%);
  opacity:.28;
  pointer-events:none;
}
.hero-inner{ position:relative; z-index:1; }
.hero .title{
  margin:0;
  font-size: clamp(22px, 4.4vw, 40px);
  font-weight: 950;
  letter-spacing: .02em;
}
.hero .lead{
  margin:.4em 0 0;
  color: var(--muted);
  font-weight: 800;
}
.hero .subcopy{
  margin-top: 1em;
  color: var(--txt);
  font-weight: 950;
  letter-spacing: .06em;
  opacity: .86;
}

/* ===== Content ===== */
.section{
  max-width:min(1100px, 92vw);
  margin: clamp(28px, 6vw, 72px) auto;
}
.sec{ margin-bottom: clamp(18px, 3vw, 28px); }

.box{
  background: rgba(255,255,255,.88);
  border: 1px solid var(--line2);
  border-radius: var(--radius-md);
  padding: 18px;
  box-shadow: 0 10px 24px rgba(0,0,0,.08);
}

/* Scroll-in（JSが.visible付与） */
.box{
  opacity:0;
  transform: translateY(22px);
  transition: opacity .7s ease, transform .7s ease;
}
.box.visible{
  opacity:1;
  transform: translateY(0);
}

.kicker{
  margin: 0 0 6px;
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(110,110,115,.92);
  font-weight: 950;
}

.h3{
  margin:0 0 10px;
  font-weight: 950;
  font-size: clamp(18px, 2.8vw, 24px);
  border-left: 3px solid rgba(47,125,255,.35);
  padding-left: 10px;
}

/* Secondary lead */
.lead2{
  margin: 0 0 14px;
  color: var(--muted);
  line-height: 1.85;
  font-weight: 800;
}

/* KPI */
.kpi-box{ position: relative; overflow: hidden; }
.kpi-grid{
  display:grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.kpi{
  background: rgba(0,0,0,.03);
  border: 1px solid var(--line2);
  border-radius: 16px;
  padding: 14px;
}
.kpi-num{
  font-weight: 950;
  font-size: clamp(22px, 3.2vw, 36px);
  line-height: 1.0;
  letter-spacing: .02em;
  display:flex;
  align-items: baseline;
  justify-content: center;
  gap: 6px;
}
.kpi-num .unit{
  font-size: 14px;
  font-weight: 900;
  color: var(--muted);
}
.kpi-label{
  margin-top: 8px;
  font-weight: 900;
  color: var(--txt);
  text-align:center;
  font-size: 13px;
  line-height: 1.5;
}
.note2{
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
}

/* Values */
.value-grid{
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.vcard{
  background: rgba(0,0,0,.03);
  border: 1px solid var(--line2);
  border-radius: 18px;
  padding: 16px;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.vcard:hover{
  transform: translateY(-2px);
  box-shadow: var(--shadow2);
  border-color: rgba(0,0,0,.12);
}
.vtitle{
  margin:0;
  font-weight: 950;
  font-size: 16px;
  letter-spacing: .02em;
  color: var(--txt);
}
.vdesc{
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.9;
  font-size: 14px;
}

/* CTA */
.cta-row{ display:flex; gap:12px; flex-wrap:wrap; margin-top:14px; }
.cta-btn{
  display:inline-flex; align-items:center; justify-content:center;
  padding: 12px 14px;
  border-radius: 14px;
  text-decoration:none;
  font-weight: 950;
  letter-spacing: .02em;
  background: linear-gradient(135deg, var(--acc1), var(--acc2));
  color: #fff;
  border: 1px solid rgba(0,0,0,.04);
  box-shadow: 0 10px 22px rgba(47,125,255,.18);
}
.cta-btn.ghost{
  background: rgba(0,0,0,.03);
  color: var(--txt);
  border: 1px solid var(--line);
  box-shadow: none;
}
.cta-btn.ghost:hover{
  background: rgba(0,0,0,.05);
  border-color: rgba(0,0,0,.12);
  transform: translateY(-1px);
}
.cta-btn:active{ transform: translateY(0); }
.cta-btn:focus-visible{
  outline: 3px solid rgba(47,125,255,.35);
  outline-offset: 3px;
}

/* Journey */
.steps{
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.step{
  display:flex; gap:12px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(0,0,0,.03);
  border: 1px solid var(--line2);
}
.step-no{
  width: 44px; height: 44px;
  border-radius: 14px;
  display:grid; place-items:center;
  font-weight: 950;
  color: var(--txt);
  background: linear-gradient(135deg, rgba(47,125,255,.12), rgba(0,194,168,.12));
  border: 1px solid rgba(0,0,0,.06);
}
.step-title{ font-weight: 950; }
.step-desc{
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.9;
  font-size: 14px;
}

/* Recruit */
.recruit-grid{
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}
.r-card{
  background: rgba(0,0,0,.03);
  border: 1px solid var(--line2);
  border-radius: 16px;
  padding: 14px;
  box-shadow: none;
}
.r-title{
  font-weight: 950;
  letter-spacing: .02em;
  margin-bottom: 8px;
}
.r-desc, .r-list{
  color: var(--muted);
  line-height: 1.85;
  margin: 0;
}
.r-list{ padding-left: 1.1em; margin: 0; }
.recruit-note{
  margin: 10px 0 0;
  color: var(--muted);
  font-size: .95rem;
}

/* 2カラム（理念 + 会社情報） */
.sec-row{
  display:flex;
  flex-wrap:wrap;
  gap: 24px;
  margin-bottom: clamp(18px, 3vw, 28px);
}
.half-box{ flex: 1 1 calc(50% - 12px); }
@media (max-width: 960px){ .half-box{ flex:1 1 100%; } }

/* 会社情報カード */
.company{ display:flex; flex-wrap:wrap; gap: 16px; font-size: .96rem; }
.c-card{
  flex: 1 1 calc(50% - 16px);
  background: rgba(255,255,255,.92);
  border: 1px solid var(--line2);
  border-left: 3px solid rgba(47,125,255,.35);
  border-radius: 12px;
  padding: .8em 1em;
  color: var(--txt);
}
.c-card strong{ display:block; font-size:.9em; color: var(--muted); margin-bottom:4px; }
.c-card span{ font-size:1.0em; color: var(--txt); }
@media (max-width: 600px){ .c-card{ flex: 1 1 100%; } }

/* メッセージ */
.msg{
  background: rgba(0,0,0,.03);
  border: 1px solid var(--line2);
  border-left: 3px solid rgba(47,125,255,.35);
  border-radius: 14px;
  padding: 16px;
  color: var(--txt);
}
.msg p{ margin: .8em 0; line-height: 1.85; color: var(--txt); }
.msg .author{ text-align:right; margin-top: 1em; font-style: italic; color: var(--muted); font-size: .92rem; }

/* 沿革（タイムライン） */
.timeline{
  display:grid;
  grid-template-columns: 150px 1fr;
  gap: 8px 10px;
  align-items:start;
}
.tl-year{
  font-weight: 950;
  color: var(--muted);
  padding-top:.4em;
  font-size: .95rem;
}
.tl-txt{
  background: rgba(0,0,0,.03);
  color: var(--txt);
  padding:.8em 1em;
  border-left: 3px solid rgba(47,125,255,.35);
  border-radius: 12px;
  line-height:1.6;
  font-size: .95rem;
  border: 1px solid var(--line2);
}
@media (max-width: 768px){
  .timeline{ grid-template-columns: 1fr; }
  .tl-year{ padding-top:0; }
}

/* 取扱商品（カテゴリ） */
.cat-grid{
  display:grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 8px;
}
.cat-block{
  background: rgba(0,0,0,.03);
  border: 1px solid var(--line2);
  border-radius: 14px;
  padding: 12px 14px;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.cat-block:hover{
  transform: translateY(-2px);
  border-color: rgba(0,0,0,.12);
  box-shadow: var(--shadow2);
}
.cat-title{
  font-weight: 950;
  color: var(--txt);
  font-size: 1rem;
  margin-bottom: 6px;
  border-bottom: 1px solid rgba(0,0,0,.08);
  padding-bottom: 4px;
  text-align: center;
}
.cat-sub{
  list-style: none;
  padding: 0;
  margin: 6px 0 0 0;
  text-align: center;
}
.cat-sub li{
  font-size: .88rem;
  color: var(--muted);
  line-height: 1.6;
}
@media (max-width: 960px){ .cat-grid{ grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px){ .cat-grid{ grid-template-columns: 1fr; } }

/* “dark-box”指定がHTMLに残っていてもライトに統一 */
.dark-box{
  background: rgba(255,255,255,.88) !important;
  border: 1px solid var(--line2) !important;
  color: var(--txt) !important;
}
.dark-box .h3,
.dark-box p, .dark-box span, .dark-box li, .dark-box strong,
.dark-box .msg, .dark-box .msg p, .dark-box .msg .author,
.dark-box .timeline .tl-txt, .dark-box .timeline .tl-year,
.dark-box .company .c-card, .dark-box .company .c-card strong, .dark-box .company .c-card span{
  color: var(--txt) !important;
}
.dark-box .timeline .tl-year{ color: var(--muted) !important; }

/* HTML内の inline color:#ffffff をライトに上書き（理念など） */
.section [style*="color:#ffffff"]{ color: var(--txt) !important; }
.section [style*="color: #ffffff"]{ color: var(--txt) !important; }

/* 関連ページのリンク（青文字指定の上書き） */
.section a[style*="color:#cfe1ff"],
.section a[style*="color: #cfe1ff"]{
  color: var(--txt) !important;
  text-decoration: none !important;
}

/* Footer */
footer{
  color: var(--muted);
  text-align:center;
  padding: 42px 12px 64px;
}
footer .copyright{
  font-size: 10px;
  color: var(--muted);
  margin: 10px 0;
}
footer .anniv{
  font-size: 12px;
  color: rgba(17,17,19,.78);
  margin-top: 6px;
  letter-spacing: .08em;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce){
  .box{ transition:none; }
}
