/* =========================================================
   NexLoop — 메인 스타일
   ========================================================= */

:root {
  --ink: #2E3134;
  --charcoal: #3A3D40;
  --charcoal-dark: #2A2C2F;
  --text-sub: #50555A;
  --text-muted: #5E6368;
  --green: #4E7F1F;
  --green-dark: #3A6316;
  --green-mid: #7DBB42;
  --green-light: #B7E08A;
  --green-bg: #FAFCF7;
  --green-bg-2: #F3F6EF;
  --green-tint: #F1F6EA;
  --line: #E3E8DC;
  --line-2: #DCE3D3;
  --input-line: #CDD3C6;
  --white: #FFFFFF;
  --radius-card: 22px;
  --container: 1200px;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Noto Sans KR', 'Montserrat', sans-serif;
  color: var(--ink);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  word-break: keep-all;
  overflow-wrap: break-word;
}

img { max-width: 100%; display: block; }
a { color: var(--green); }
a:hover { color: var(--green-dark); }
input, select, textarea, button { font: inherit; }

.wrap {
  max-width: var(--container);
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
}

.eyebrow {
  margin: 0;
  font-family: Montserrat, sans-serif;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 3px;
  color: var(--green);
}

.h2 {
  margin: 0;
  font-size: 38px;
  line-height: 1.3;
  font-weight: 800;
  letter-spacing: -1px;
  color: var(--ink);
}

.lead {
  margin: 0;
  font-size: 17px;
  line-height: 1.75;
  color: var(--text-sub);
}

.section { padding: 112px 0; }
.stack-48 { display: flex; flex-direction: column; gap: 48px; }
.section-head { display: flex; flex-direction: column; gap: 12px; max-width: 680px; }
.section-head-row {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 20px;
}

.ico { fill: none; stroke: currentColor; stroke-width: 1.8px; stroke-linecap: round; stroke-linejoin: round; }

/* 버튼 */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 52px; padding: 0 28px;
  border-radius: 999px;
  font-weight: 700; font-size: 16px;
  text-decoration: none;
  border: 1.5px solid transparent;
  cursor: pointer;
}
.btn-primary { background: var(--green); color: var(--white); }
.btn-primary:hover { background: var(--green-dark); color: var(--white); }
.btn-outline { border-color: var(--charcoal); color: var(--charcoal); background: transparent; }
.btn-outline:hover { background: var(--charcoal); color: var(--white); }
.btn-dark { min-height: 44px; padding: 0 22px; background: var(--charcoal); color: var(--white); font-size: 15px; }
.btn-dark:hover { background: var(--ink); color: var(--white); }

.text-link {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 44px; font-weight: 700; font-size: 15px; text-decoration: none;
}

/* =========================================================
   상단 띠
   ========================================================= */
.topbar { background: var(--charcoal-dark); color: #C3C7BE; font-size: 13px; }
.topbar .wrap {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center;
  gap: 8px; padding-top: 8px; padding-bottom: 8px;
}
.topbar-right { display: flex; gap: 18px; align-items: center; }
.topbar a { color: #C3C7BE; }
.topbar .lang-on { color: var(--white); font-weight: 700; }
.topbar .lang-link { color: #C3C7BE; text-decoration: none; display: inline-flex; align-items: center; min-height: 32px; }
.topbar .lang-link:hover { color: var(--white); }

/* =========================================================
   헤더
   ========================================================= */
.header {
  position: sticky; top: 0; z-index: 50;
  background: var(--white);
  border-bottom: 1px solid #ECEFE8;
}
.header .wrap {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding-top: 14px; padding-bottom: 14px;
}
.logo { display: flex; align-items: center; min-height: 44px; }
.logo img { height: 52px; width: auto; }

.nav { display: flex; align-items: center; gap: 28px; font-size: 15px; font-weight: 500; }
.nav a:not(.btn) {
  color: var(--charcoal); text-decoration: none;
  display: inline-flex; align-items: center; min-height: 44px;
}
.nav a:not(.btn):hover { color: var(--green); }

.nav-toggle {
  display: none;
  width: 44px; height: 44px;
  border: 0; background: transparent; color: var(--charcoal);
  cursor: pointer; padding: 0;
  align-items: center; justify-content: center;
}

/* =========================================================
   메인 비주얼
   ========================================================= */
.hero { position: relative; overflow: hidden; background: var(--green-bg); }
.hero-bg {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: 50% 60%;
  opacity: .08; filter: grayscale(.3);
  pointer-events: none;
}
.hero .wrap {
  position: relative;
  display: flex; flex-wrap: wrap; align-items: center; gap: 40px;
  padding-top: 80px; padding-bottom: 104px;
}
.hero-text { flex: 1 1 440px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.hero-text .eyebrow { font-size: 14px; }
.hero-title {
  margin: 0; font-family: 'Do Hyeon', 'Noto Sans KR', sans-serif;
  font-size: 62px; line-height: 1.18; font-weight: 700; letter-spacing: -0.5px; color: var(--ink);
}
.hero-title em { font-style: normal; color: var(--green); }
html[lang="en"] .hero-title { font-size: 46px; letter-spacing: 0; }
html[lang="en"] .h2 { letter-spacing: -0.5px; }
.hero-text .lead { font-size: 18px; max-width: 520px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; padding-top: 4px; }
.hero-checks {
  margin: 8px 0 0; padding: 0; list-style: none;
  display: flex; flex-wrap: wrap; gap: 10px 22px; font-size: 14px; color: var(--charcoal);
}
.hero-checks li { display: flex; align-items: center; gap: 6px; }
.hero-checks .ico { color: var(--green); }

.hero-visual { flex: 1 1 560px; min-width: 0; display: flex; justify-content: center; }

/* 레일 애니메이션 */
.railbox { position: relative; width: 600px; height: 400px; max-width: 100%; }
.rail { position: absolute; top: 0; left: 0; width: 600px; height: 400px; transform-origin: top left; }
.rail svg { position: absolute; top: 0; left: 0; }
.trk-edge { fill: none; stroke: #CBD5BF; stroke-width: 66px; }
.trk { fill: none; stroke: #F1F5EB; stroke-width: 58px; }
.belt { fill: none; stroke: #B9C4AC; stroke-width: 2px; stroke-dasharray: 6 10; animation: belt .32s linear infinite; }
.seat {
  position: absolute; width: 26px; height: 26px; border-radius: 50%;
  background: var(--white); border: 2px solid #C9D3BC;
}
.rail svg { overflow: visible; }
.rail-center {
  position: absolute; left: 192px; top: 132px; width: 216px; height: 136px;
  display: flex; align-items: center; justify-content: center;
}
.rail-center img { height: 38px; width: auto; }
.nl-counter { filter: drop-shadow(0 18px 18px rgba(30, 42, 28, .16)); }
.nl-island { filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .18)); }
.nl-seam { animation: seam 1.2s linear infinite; }
.nl-seam2 { animation: seam2 1.2s linear infinite; }
.pl2 {
  position: absolute; top: 0; left: 0; width: 50px; height: 50px; border-radius: 50%;
  background: radial-gradient(circle at 38% 32%, #FFFFFF 0, #FFFFFF 40%, #F1F1EE 70%, #E3E4E0 100%);
  offset-path: path('M180,80 H420 A120,120 0 0 1 420,320 H180 A120,120 0 0 1 180,80 Z');
  offset-rotate: 0deg;
  animation: loop 28s linear infinite;
}
.rim-g { box-shadow: 0 3px 6px rgba(20,30,20,.18), inset 0 0 0 4px #7DBB42, inset 0 0 0 8px rgba(255,255,255,.65); }
.rim-c { box-shadow: 0 3px 6px rgba(20,30,20,.18), inset 0 0 0 4px #3A3D40, inset 0 0 0 8px rgba(255,255,255,.65); }
.rim-s { box-shadow: 0 3px 6px rgba(20,30,20,.18), inset 0 0 0 4px #C9B48A, inset 0 0 0 8px rgba(255,255,255,.65); }
@keyframes seam { from { stroke-dashoffset: 0; } to { stroke-dashoffset: -16; } }
@keyframes seam2 { from { stroke-dashoffset: -1.6; } to { stroke-dashoffset: -17.6; } }
.plate {
  position: absolute; top: 0; left: 0; width: 48px; height: 48px; border-radius: 50%;
  background: var(--white); border: 5px solid var(--green-mid);
  box-shadow: 0 3px 8px rgba(40, 50, 30, .18);
  display: flex; align-items: center; justify-content: center;
  offset-path: path('M180,80 H420 A120,120 0 0 1 420,320 H180 A120,120 0 0 1 180,80 Z');
  offset-rotate: 0deg;
  animation: loop 24s linear infinite;
}
.plate .sushi { width: 24px; height: 13px; border-radius: 4px; }
.plate .maki { width: 18px; height: 18px; border-radius: 50%; background: #2F3A2A; border: 3px solid #EDEDE6; }

@keyframes loop { from { offset-distance: 0%; } to { offset-distance: 100%; } }
@keyframes belt { to { stroke-dashoffset: -16; } }
@keyframes belt2 { to { stroke-dashoffset: -13; } }

/* =========================================================
   제품
   ========================================================= */
.product-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px;
}
.product-card {
  display: flex; flex-direction: column;
  border: 1px solid var(--line); border-radius: var(--radius-card);
  background: var(--white); overflow: hidden;
}
.product-thumb { height: 180px; background: var(--green-tint); display: flex; align-items: center; justify-content: center; }
.product-body { padding: 28px; display: flex; flex-direction: column; gap: 14px; flex-grow: 1; }
.product-code { font-family: Montserrat, sans-serif; font-size: 12px; font-weight: 700; letter-spacing: 2px; color: var(--green); }
.product-body h3 { margin: 0; font-size: 22px; font-weight: 800; }
.product-body p { margin: 0; font-size: 15px; line-height: 1.7; color: var(--text-sub); }
.bullets { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; font-size: 14px; color: var(--charcoal); }
.bullets li { display: flex; gap: 8px; }
.bullets li::before { content: '·'; color: var(--green); font-weight: 800; }

/* =========================================================
   배치 유형
   ========================================================= */
.layouts { background: var(--green-bg-2); }
.layouts .wrap { display: flex; flex-direction: column; gap: 40px; }
.tabs { display: flex; flex-wrap: wrap; gap: 10px; }
.tab {
  min-height: 48px; padding: 0 22px; border-radius: 999px;
  border: 1.5px solid var(--input-line); background: var(--white); color: var(--charcoal);
  font-size: 15px; font-weight: 700; cursor: pointer;
}
.tab[aria-selected="true"] { background: var(--charcoal); color: var(--white); border-color: var(--charcoal); }

.layout-panel { display: flex; flex-wrap: wrap; gap: 32px; align-items: stretch; }
.layout-panel[hidden] { display: none; }
.diagram-card {
  flex: 3 1 560px; min-width: 0; padding: 28px; border-radius: 24px; background: var(--white);
  display: flex; justify-content: center;
}
.diagbox { position: relative; width: 520px; height: 340px; max-width: 100%; }
.diag { position: absolute; left: 0; top: 0; width: 520px; height: 340px; transform-origin: top left; }
.diag svg { position: absolute; left: 0; top: 0; }
.d-edge { fill: none; stroke: #CBD5BF; stroke-width: 30px; stroke-linejoin: round; }
.d-trk { fill: none; stroke: #EEF4E6; stroke-width: 24px; stroke-linejoin: round; }
.d-belt { fill: none; stroke: var(--green-mid); stroke-width: 2px; stroke-dasharray: 5 8; animation: belt2 .5s linear infinite; }
.d-kitchen {
  position: absolute; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  color: var(--white); font-size: 14px; font-weight: 700;
}
.d-kitchen small { font-size: 12px; font-weight: 400; color: #D5DACF; }
.d-seat {
  position: absolute; width: 20px; height: 20px; border-radius: 50%;
  background: var(--white); border: 2px solid #9AA68D;
}

.layout-info { flex: 2 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 18px; padding: 8px 0; }
.layout-code { font-family: Montserrat, sans-serif; font-size: 12px; font-weight: 700; letter-spacing: 2px; color: var(--green); }
.layout-info h3 { margin: 0; font-size: 28px; font-weight: 800; letter-spacing: -0.5px; }
.layout-info p { margin: 0; font-size: 16px; line-height: 1.75; color: var(--text-sub); }
.layout-info dl {
  margin: 0; display: grid; grid-template-columns: 96px 1fr; gap: 12px;
  font-size: 15px; padding: 20px 0; border-top: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2);
}
.layout-info dt { color: var(--text-muted); }
.layout-info dd { margin: 0; font-weight: 700; }

/* =========================================================
   진행 단계
   ========================================================= */
.steps {
  margin: 0; padding: 0; list-style: none;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px;
}
.steps li { display: flex; flex-direction: column; gap: 10px; padding-top: 24px; border-top: 3px solid var(--green-mid); }
.step-top { display: flex; justify-content: space-between; align-items: center; }
.step-num { font-family: Montserrat, sans-serif; font-weight: 800; font-size: 15px; color: var(--green); }
.step-time { font-size: 12px; color: var(--text-muted); }
.step-title { font-size: 20px; font-weight: 800; }
.step-desc { font-size: 15px; line-height: 1.7; color: var(--text-sub); }

/* =========================================================
   설치 사례
   ========================================================= */
.cases { background: var(--green-bg); border-top: 1px solid #ECEFE8; }
.case-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; }
.case-card { display: flex; flex-direction: column; gap: 14px; margin: 0; }
.case-photo {
  height: 240px; border-radius: 20px; overflow: hidden;
  background: repeating-linear-gradient(135deg, #E6F1DA 0, #E6F1DA 14px, #F1F7EA 14px, #F1F7EA 28px);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; color: var(--green); font-weight: 700;
}
.case-photo img { width: 100%; height: 100%; object-fit: cover; }
.case-card figcaption { font-size: 19px; font-weight: 800; }

/* =========================================================
   문의
   ========================================================= */
.contact { background: var(--charcoal); color: var(--white); }
.contact .wrap { display: flex; flex-wrap: wrap; gap: 56px; }
.contact-info { flex: 1 1 360px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.contact-info .eyebrow { color: var(--green-light); }
.contact-info .h2 { color: var(--white); }
.contact-info .lead { color: #DADDD6; }
.contact-info dl {
  margin: 16px 0 0; display: grid; grid-template-columns: 72px 1fr; row-gap: 14px; column-gap: 16px; font-size: 16px; line-height: 1.6;
}
.contact-info dt { color: var(--green-light); font-weight: 700; }
.contact-info dd { margin: 0; }
.contact-info dd a { color: var(--white); }

.contact-form {
  flex: 1 1 440px; min-width: 0;
  display: flex; flex-direction: column; gap: 16px;
  padding: 36px; border-radius: 24px; background: var(--white); color: var(--ink);
}
.contact-form h3 { margin: 0; font-size: 20px; font-weight: 800; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 700; }
.field input,
.field select,
.field textarea {
  min-height: 48px; padding: 0 14px;
  border: 1px solid var(--input-line); border-radius: 12px;
  font-size: 15px; font-weight: 400; background: var(--white); color: var(--ink);
}
.field textarea { padding: 12px 14px; resize: vertical; }
.field input:focus,
.field select:focus,
.field textarea:focus { outline: 2px solid var(--green); outline-offset: 1px; border-color: var(--green); }
.agree { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text-sub); min-height: 44px; }
.agree input { width: 20px; height: 20px; accent-color: var(--green); }
.submit {
  min-height: 54px; border: 0; border-radius: 999px;
  background: var(--green); color: var(--white); font-size: 16px; font-weight: 700; cursor: pointer;
}
.submit:hover { background: var(--green-dark); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.submit[disabled] { opacity: .6; cursor: wait; }
.form-msg { margin: 0; font-size: 14px; color: var(--green); min-height: 20px; }
.form-msg.error { color: #B3261E; }

/* =========================================================
   푸터
   ========================================================= */
.footer { background: var(--charcoal-dark); color: #C3C7BE; }
.footer .wrap {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px;
  padding-top: 48px; padding-bottom: 48px;
}
.footer img { height: 48px; width: auto; }
.footer p { margin: 0; font-size: 13px; line-height: 1.7; }

/* =========================================================
   반응형
   ========================================================= */
@media (max-width: 960px) {
  .nav-toggle { display: inline-flex; }
  .nav {
    position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 0;
    padding: 8px 24px 20px; background: var(--white);
    border-bottom: 1px solid #ECEFE8;
    display: none;
  }
  .nav.is-open { display: flex; }
  .nav a:not(.btn) { padding: 6px 0; border-bottom: 1px solid #F0F2EE; }
  .nav .btn { margin-top: 12px; justify-content: center; }
}

@media (max-width: 640px) {
  .section { padding: 80px 0; }
  .h2 { font-size: 28px; }
  .hero .wrap { padding-top: 56px; padding-bottom: 72px; }
  .hero-title,
  html[lang="en"] .hero-title { font-size: 40px; }
  .railbox { height: 220px; width: 330px; }
  .rail { transform: scale(.55); }
  .diagbox { height: 204px; }
  .diag { transform: scale(.6); }
  .diagram-card { padding: 20px; }
  .contact-form { padding: 24px; }
  .topbar .wrap { justify-content: center; text-align: center; }
  .logo img { height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  .plate, .belt, .d-belt, .pl2, .nl-seam, .nl-seam2 { animation: none; }
  html { scroll-behavior: auto; }
}

/* required marks */
.req { color: #c0392b; font-weight: 700; margin-left: 3px; }
.field input.invalid, .field textarea.invalid { border-color: #c0392b !important; outline: none; box-shadow: 0 0 0 3px rgba(192,57,43,.15) !important; }
.agree.invalid { color: #c0392b; }
.form-note { font-size: 13px; color: #888; margin: 0 0 14px; }
.form-note b { color: #c0392b; }

/* custom file picker (button text follows page language) */
.filebox { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border: 1px dashed #9AA68D; border-radius: 12px; background: var(--green-bg); min-width: 0; }
.field .file-input { position: absolute; width: 1px; height: 1px; padding: 0; border: 0; opacity: 0; overflow: hidden; }
.file-btn { flex: none; display: inline-block; padding: 7px 14px; border: 1px solid #9AA68D; border-radius: 8px; background: #fff; font-size: 14px; font-weight: 600; color: #2b2f2a; cursor: pointer; }
.file-btn:hover { border-color: var(--green, #4E7F23); color: var(--green, #4E7F23); }
.file-input:focus-visible + .file-btn { outline: 2px solid var(--green, #4E7F23); outline-offset: 2px; }
.file-name { font-size: 14px; font-weight: 400; color: #777; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.file-name.has { color: #2b2f2a; }

/* back to top */
.to-top { position: fixed; right: 28px; bottom: 28px; z-index: 50; width: 56px; height: 56px; border: 0; border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  background: var(--charcoal-dark); color: #fff; cursor: pointer; box-shadow: 0 8px 24px rgba(0,0,0,.18);
  opacity: 0; visibility: hidden; transform: translateY(12px); transition: opacity .3s, transform .3s, visibility .3s, background .2s; }
.to-top span { font: 700 10px/1 Montserrat, sans-serif; letter-spacing: .06em; }
.to-top.show { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { background: var(--green); }
.to-top:focus-visible { outline: 3px solid var(--green-mid); outline-offset: 3px; }
@media (max-width: 600px) { .to-top { right: 16px; bottom: 16px; width: 48px; height: 48px; } .to-top span { display: none; } }

/* select: same height on iPhone (Safari ignores min-height on native selects) */
.field select {
  -webkit-appearance: none; appearance: none;
  height: 48px; padding: 0 40px 0 14px; line-height: 46px; cursor: pointer;
  background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%2350555A' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 16px center;
}
.field input:not([type="file"]):not(.file-input) { height: 48px; }
/* iPhone zooms in on inputs under 16px; keep 16px on phones */
@media (max-width: 600px) { .field input, .field select, .field textarea { font-size: 16px; } }

/* mobile top bar: one slim line (tagline left, KOR/ENG right, no email) */
@media (max-width: 760px) {
  .topbar { font-size: 12px; }
  .topbar .wrap { flex-wrap: nowrap; justify-content: space-between; padding-top: 2px; padding-bottom: 2px; text-align: left; }
  .topbar .wrap > span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
  .topbar-right { flex: none; gap: 12px; }
  .topbar-right > a:first-child { display: none; }
}
