/* ===== リセット・変数 ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --blue:        #3060c0;
  --blue-dark:   #244fa0;
  --blue-light:  #e8eef8;
  --dark:        #2d2d2d;
  --dark-mid:    #3f3f3f;
  --mid:         #5a5a5a;
  --subtle:      #888888;
  --gray-bg:     #f2f4f8;
  --gray-light:  #f8f9fb;
  --gray-border: #dde1ea;
  --text:        #1a1a1a;
  --white:       #ffffff;
  --max-w:       1080px;
  --font:        'Segoe UI', 'Hiragino Sans', 'Meiryo', sans-serif;
  --radius:      3px;
  --trans:       0.22s ease;
}

html { scroll-behavior: smooth; }
body { font-family: var(--font); color: var(--text); background: var(--white); line-height: 1.75; overflow-x: hidden; }
a { text-decoration: none; color: inherit; }
ul, ol { list-style: none; }

/* ===== ヘッダー ===== */
#header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 900;
  background: var(--white);
  border-bottom: 3px solid var(--blue);
  box-shadow: 0 2px 10px rgba(0,0,0,0.07);
}

.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 2rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

/* ロゴ */
.site-logo {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-shrink: 0;
}

.logo-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 1;
}

.logo-text {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--dark);
  white-space: nowrap;
  letter-spacing: 0.02em;
  line-height: 1;
}

/* グローバルナビ */
.global-nav ul { display: flex; align-items: center; gap: 0; }

.nav-item {
  display: block;
  padding: 0.45rem 1rem;
  font-size: 0.87rem;
  font-weight: 600;
  color: var(--mid);
  letter-spacing: 0.03em;
  border-bottom: 3px solid transparent;
  margin-bottom: -3px;
  transition: color var(--trans), border-color var(--trans);
}
.nav-item:hover,
.nav-item.active { color: var(--blue); border-bottom-color: var(--blue); }

.contact-link {
  background: var(--blue) !important;
  color: var(--white) !important;
  border-radius: var(--radius);
  padding: 0.42rem 1.15rem !important;
  border-bottom-color: transparent !important;
  margin-left: 0.8rem;
  transition: background var(--trans);
}
.contact-link:hover { background: var(--blue-dark) !important; }

/* ハンバーガー */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none; border: none;
  cursor: pointer; padding: 4px;
}
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--dark); border-radius: 1px; }

/* ===== ヒーロー ===== */
.hero {
  padding-top: 64px;
  min-height: 520px;
  background: #2d2d2d;
  position: relative;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.hero-bg { position: absolute; inset: 0; overflow: hidden; }

/* 名刺コーナーの水色三角を再現 */
.hero-bg::before {
  content: '';
  position: absolute;
  top: 0; right: -8%;
  width: 52%;
  height: 100%;
  background: linear-gradient(160deg, #5aa0e8 0%, #3a78d0 60%, #2860b8 100%);
  clip-path: polygon(14% 0, 100% 0, 100% 100%, 0% 100%);
  opacity: 0.7;
}
/* 名刺の暗いコーナー三角を右上に追加 */
.hero-bg::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, #3a78d0, #5aa0e8);
}

.hero-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.05) 1px, transparent 1px);
  background-size: 48px 48px;
}

/* 名刺・右上の暗い三角 */
.hero-corner-dark {
  position: absolute;
  top: 0; right: 0;
  width: 0; height: 0;
  border-style: solid;
  border-width: 0 140px 140px 0;
  border-color: transparent #1e1e1e transparent transparent;
  opacity: 0.85;
}

/* 名刺・左下の水色三角 */
.hero-corner-blue-bl {
  position: absolute;
  bottom: 0; left: 0;
  width: 0; height: 0;
  border-style: solid;
  border-width: 100px 0 0 100px;
  border-color: transparent transparent transparent #3a78d0;
  opacity: 0.6;
}

/* ヒーロー底辺ライン → 赤 */

.hero-inner {
  position: relative;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 80px 2rem;
  width: 100%;
}

.hero-label {
  display: inline-block;
  font-size: 0.73rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: #a8d0f8;
  border: 1px solid rgba(90,160,232,0.5);
  padding: 0.2rem 0.7rem;
  margin-bottom: 1.5rem;
  text-transform: uppercase;
}

.hero-heading {
  font-size: clamp(1.9rem, 4vw, 2.9rem);
  font-weight: 800;
  color: var(--white);
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin-bottom: 1.2rem;
}
.hero-heading span { color: #8ecaf8; }

.hero-sub {
  font-size: 0.95rem;
  color: rgba(255,255,255,0.55);
  line-height: 1.9;
  margin-bottom: 2.5rem;
}

.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }

/* スクロール */
.hero-scroll {
  position: absolute;
  bottom: 2rem; left: 50%;
  transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 0.4rem;
}
.scroll-line {
  display: block; width: 1px; height: 38px;
  background: rgba(90,160,232,0.6);
  animation: scrollDown 1.8s ease-in-out infinite;
}
.scroll-label { font-size: 0.62rem; letter-spacing: 0.15em; color: rgba(160,210,255,0.5); }
@keyframes scrollDown {
  0%   { transform: scaleY(0); transform-origin: top; }
  50%  { transform: scaleY(1); transform-origin: top; }
  51%  { transform: scaleY(1); transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}

/* ===== ボタン ===== */
.btn {
  display: inline-block;
  font-size: 0.87rem;
  font-weight: 700;
  padding: 0.7rem 1.5rem;
  border-radius: var(--radius);
  letter-spacing: 0.04em;
  transition: all var(--trans);
  white-space: nowrap;
  cursor: pointer;
  border: 2px solid transparent;
}
.btn-primary { background: var(--white); color: var(--dark); border-color: var(--white); }
.btn-primary:hover { background: var(--gray-light); transform: translateY(-1px); }

/* セクション内のプライマリボタン */
.section .btn-primary,
.used-note .btn-primary {
  background: var(--dark);
  color: var(--white);
  border-color: var(--dark);
}
.section .btn-primary:hover,
.used-note .btn-primary:hover { background: var(--dark-mid); border-color: var(--dark-mid); }

.btn-outline {
  background: transparent;
  color: rgba(255,255,255,0.85);
  border-color: rgba(255,255,255,0.4);
}
.btn-outline:hover { border-color: rgba(255,255,255,0.8); background: rgba(255,255,255,0.06); }

.btn-sm {
  font-size: 0.78rem;
  padding: 0.42rem 0.95rem;
  background: var(--blue);
  color: var(--white);
  border-color: var(--blue);
}
.btn-sm:hover { background: var(--blue-dark); border-color: var(--blue-dark); }

/* ===== 強み ===== */
.strengths {
  background: var(--gray-light);
  border-bottom: 1px solid var(--gray-border);
}
.strengths .inner {
  max-width: var(--max-w); margin: 0 auto; padding: 0 2rem;
  display: grid; grid-template-columns: repeat(3, 1fr);
}

.strength-item {
  padding: 2.4rem 2rem;
  border-right: 1px solid var(--gray-border);
}
.strength-item:last-child { border-right: none; }

.strength-num {
  font-size: 0.7rem; font-weight: 800; letter-spacing: 0.12em;
  color: var(--blue); margin-bottom: 0.5rem;
}
.strength-item h3 { font-size: 1rem; font-weight: 700; color: var(--dark); margin-bottom: 0.55rem; }
.strength-item p { font-size: 0.84rem; color: var(--mid); line-height: 1.8; }

/* ===== セクション共通 ===== */
.section { padding: 80px 0; }
.section-gray { background: var(--gray-bg); }

.inner { max-width: var(--max-w); margin: 0 auto; padding: 0 2rem; }

.section-header { text-align: center; margin-bottom: 3rem; }

.section-en {
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--blue); margin-bottom: 0.3rem;
}

.section-title {
  font-size: clamp(1.4rem, 2.5vw, 1.9rem);
  font-weight: 800; color: var(--dark);
  margin-bottom: 0.7rem; letter-spacing: -0.01em;
}

.title-bar { width: 80px; height: 2px; background: #3a78d0; margin: 0 auto 1rem; }

.section-desc { font-size: 0.88rem; color: var(--subtle); }

/* ===== 会社案内 ===== */
.about-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: start;
}

.about-lead {
  font-size: 1.28rem; font-weight: 700; color: var(--dark);
  line-height: 1.5; margin-bottom: 1.2rem;
  padding-bottom: 1.2rem; border-bottom: 2px solid #3a78d0;
}

.about-text p {
  font-size: 0.88rem; color: #444; line-height: 1.95; margin-bottom: 1rem;
}

.company-table { width: 100%; border-collapse: collapse; }
.company-table tr { border-bottom: 1px solid #3a78d0; }
.company-table tr:first-child { border-top: 1px solid #3a78d0; }
.company-table th {
  width: 7em; padding: 0.85rem 1rem 0.85rem 0;
  font-size: 0.82rem; font-weight: 600; color: var(--subtle);
  text-align: left; vertical-align: top; white-space: nowrap;
}
.company-table td {
  padding: 0.85rem 0; font-size: 0.85rem; color: var(--text); line-height: 1.7;
}

/* ===== 中古情報 ===== */
.machine-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.4rem;
  margin-bottom: 2.5rem;
}

.machine-card {
  background: var(--white);
  border: 1px solid var(--gray-border);
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  transition: box-shadow var(--trans), transform var(--trans);
}
.machine-card:hover { box-shadow: 0 5px 20px rgba(0,0,0,0.09); transform: translateY(-3px); }

.card-status {
  position: absolute; top: 0.7rem; left: 0.7rem;
  font-size: 0.68rem; font-weight: 700;
  padding: 0.18rem 0.5rem; border-radius: 2px;
  letter-spacing: 0.05em; z-index: 1;
}
.status-sale { background: var(--blue); color: var(--white); }
.status-hold { background: #7a7a7a; color: var(--white); }

.card-thumb {
  height: 128px;
  display: flex; align-items: center; justify-content: center;
}
.card-thumb.mc      { background: linear-gradient(135deg, #1c3d7a, #3060c0); }
.card-thumb.lathe   { background: linear-gradient(135deg, #2d2d2d, #3060c0); }
.card-thumb.grinder { background: linear-gradient(135deg, #2d2d2d, #445577); }

.thumb-icon { font-size: 2.8rem; opacity: 0.25; color: var(--white); }

.card-body { padding: 1.05rem 1.2rem 1.2rem; }

.card-maker {
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.1em;
  color: var(--blue); text-transform: uppercase; margin-bottom: 0.2rem;
}

.card-name { font-size: 0.97rem; font-weight: 700; color: var(--dark); margin-bottom: 0.7rem; }

.card-spec {
  border-top: 1px solid var(--gray-border); padding-top: 0.7rem;
  margin-bottom: 0.9rem;
  display: flex; flex-direction: column; gap: 0.28rem;
}
.card-spec li { display: flex; font-size: 0.77rem; color: var(--mid); }
.card-spec li span { width: 5.5em; flex-shrink: 0; color: #aaa; font-size: 0.72rem; }

.card-footer {
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.5rem;
  border-top: 1px solid var(--gray-border); padding-top: 0.8rem;
}
.card-price { font-size: 0.87rem; font-weight: 700; color: var(--dark); }
.card-price small { font-size: 0.7rem; font-weight: 400; color: var(--subtle); }

.used-note {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 1rem;
  padding: 1.2rem 1.5rem;
  background: var(--white); border: 1px solid var(--gray-border); border-radius: var(--radius);
}
.used-note p { font-size: 0.8rem; color: var(--subtle); }

/* ===== お問い合わせ ===== */
.contact-layout {
  display: grid; grid-template-columns: 270px 1fr;
  gap: 4rem; align-items: start;
}

.contact-info { display: flex; flex-direction: column; gap: 1.75rem; }
.info-block { border-left: 3px solid #3a78d0; padding-left: 1rem; }
.info-label {
  font-size: 0.73rem; font-weight: 700; letter-spacing: 0.06em;
  color: var(--subtle); margin-bottom: 0.3rem; text-transform: uppercase;
}
.info-tel { font-size: 1.5rem; font-weight: 800; color: var(--dark); letter-spacing: 0.04em; }
.info-hours { font-size: 0.77rem; color: var(--subtle); margin-top: 0.2rem; }
.info-mail { font-size: 0.9rem; color: var(--dark); font-weight: 600; }

.contact-form { display: flex; flex-direction: column; gap: 1.05rem; }
.form-group { display: flex; flex-direction: column; gap: 0.32rem; }

label { font-size: 0.82rem; font-weight: 600; color: var(--text); }

.req {
  display: inline-block; font-size: 0.67rem; font-weight: 700;
  background: var(--blue); color: var(--white);
  padding: 0.1rem 0.38rem; border-radius: 2px;
  margin-left: 0.35rem; vertical-align: 1px;
}

input, select, textarea {
  width: 100%;
  padding: 0.63rem 0.85rem;
  border: 1px solid var(--gray-border);
  border-radius: var(--radius);
  font-size: 0.88rem; font-family: var(--font);
  color: var(--text); background: var(--white);
  outline: none;
  transition: border-color var(--trans), box-shadow var(--trans);
}
input:focus, select:focus, textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(48,96,192,0.12);
}
input.is-err, select.is-err, textarea.is-err { border-color: #888; }
textarea { resize: vertical; min-height: 120px; }

.form-err { font-size: 0.75rem; color: #777; min-height: 1em; }

.form-submit { margin-top: 0.4rem; }
.btn-submit {
  border: none; padding: 0.82rem 2.4rem; font-size: 0.9rem; cursor: pointer;
  background: #3a78d0;
  color: var(--white);
  border-color: #3a78d0;
}
.btn-submit:hover { background: #2d68c0; border-color: #2d68c0; }
.btn-submit:disabled { opacity: 0.5; cursor: not-allowed; }

.form-success {
  display: none;
  background: #f2f2f2; border: 1px solid var(--gray-border);
  color: var(--dark-mid);
  padding: 1rem 1.2rem; border-radius: var(--radius);
  font-size: 0.87rem; font-weight: 600; margin-top: 0.5rem;
}
.form-success.show { display: block; }

/* ===== フッター ===== */
.footer { background: var(--dark); color: rgba(255,255,255,0.45); padding: 50px 0 24px; }

.footer-body {
  display: flex; justify-content: space-between; align-items: flex-start;
  flex-wrap: wrap; gap: 2rem;
  margin-bottom: 3rem; padding-bottom: 2rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.footer-logo { font-size: 1.05rem; font-weight: 800; color: var(--white); margin-bottom: 0.3rem; white-space: nowrap; }
.footer-catch { font-size: 0.79rem; color: rgba(255,255,255,0.35); }

.footer-nav { display: flex; gap: 2rem; flex-wrap: wrap; align-items: center; }
.footer-nav a { font-size: 0.82rem; color: rgba(255,255,255,0.45); transition: color var(--trans); }
.footer-nav a:hover { color: var(--white); }

.footer-bottom { text-align: center; font-size: 0.75rem; color: rgba(255,255,255,0.25); }

/* ===== フェードイン ===== */
.fade-in { opacity: 0; transform: translateY(18px); transition: opacity 0.5s ease, transform 0.5s ease; }
.fade-in.visible { opacity: 1; transform: translateY(0); }

/* ===== レスポンシブ ===== */
@media (max-width: 900px) {
  .about-layout     { grid-template-columns: 1fr; gap: 2.5rem; }
  .machine-grid     { grid-template-columns: repeat(2, 1fr); }
  .contact-layout   { grid-template-columns: 1fr; gap: 2.5rem; }
  .strengths .inner { grid-template-columns: 1fr; }
  .strength-item    { border-right: none; border-bottom: 1px solid var(--gray-border); }
  .strength-item:last-child { border-bottom: none; }
}

@media (max-width: 640px) {
  .global-nav {
    display: none;
    position: fixed; top: 64px; left: 0; right: 0; bottom: 0;
    background: var(--white); flex-direction: column;
    padding: 2rem; border-top: 1px solid var(--gray-border); overflow-y: auto;
  }
  .global-nav.open { display: flex; }
  .global-nav ul { flex-direction: column; gap: 0; }
  .nav-item { padding: 1rem 0; border-bottom: 1px solid var(--gray-border); font-size: 1rem; }
  .contact-link { margin-left: 0; margin-top: 1rem; text-align: center; }
  .nav-toggle { display: flex; }
  .machine-grid { grid-template-columns: 1fr; }
  .hero-heading { font-size: 1.7rem; }
  .used-note { flex-direction: column; }
}
