:root {
  --navy: #1b1866;
  --navy-dark: #12104a;
  --navy-tint: #eef0f8;
  --blue-title: var(--navy);   /* section titles: same navy as the 견적문의 button */
  --blue-brand: var(--navy);   /* (주)큐브팩 in the hero headline */
  --text: #1d1f27;
  --text-soft: #555a66;
  --text-faint: #8a8f9c;
  --line: #e2e4ea;
  --line-strong: #c9ccd6;
  --bg: #ffffff;
  --bg-gray: #f6f7f9;
  --danger: #c62828;
  --ok: #1f7a3a;
  --radius: 6px;
  --wrap: 1180px;
  --header-h: 72px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); }
body {
  margin: 0;
  font-family: "Pretendard", -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  word-break: keep-all;
}
img, svg { display: block; }
a { color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.3; letter-spacing: -0.02em; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 50px; padding: 0 26px;
  border: 1px solid transparent; border-radius: var(--radius);
  font-family: inherit; font-size: 16px; font-weight: 600; line-height: 1;
  text-decoration: none; cursor: pointer;
  transition: background-color .15s, border-color .15s, color .15s;
}
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-dark); }
.btn-line { background: #fff; color: var(--navy); border-color: var(--line-strong); }
.btn-line:hover { border-color: var(--navy); }
.btn-sm { min-height: 40px; padding: 0 16px; font-size: 14px; }
.btn:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--navy); outline-offset: 2px;
}

/* ---------- header ---------- */
.top {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.top-in { display: flex; align-items: center; gap: 32px; height: var(--header-h); }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--navy); }
.logo-mark { width: 34px; height: 34px; flex: none; }
.logo-text { display: flex; flex-direction: column; line-height: 1.15; }
.logo-text b { font-size: 19px; font-weight: 800; letter-spacing: -0.01em; }
.logo-text small { font-size: 11px; font-weight: 600; letter-spacing: .18em; color: var(--text-faint); }
.nav { display: flex; gap: 34px; margin-left: auto; }
.nav a { text-decoration: none; font-weight: 600; font-size: 15px; color: var(--text); padding: 8px 0; }
.nav a:hover { color: var(--navy); }
.top-cta { margin-left: 4px; }

/* ---------- hero ---------- */
.hero { padding: 80px 0; border-bottom: 1px solid var(--line); }
.hero-in { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.eyebrow { margin: 0 0 18px; color: var(--navy); font-weight: 700; font-size: 15px; letter-spacing: .02em; }
.hero h1 { font-size: clamp(32px, 4.4vw, 50px); font-weight: 800; margin-bottom: 22px; }
.hero h1 .brand { color: var(--blue-brand); }
.lead { font-size: 18px; color: var(--text-soft); margin: 0 0 36px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- image slots ---------- */
.media { margin: 0; position: relative; overflow: hidden; background: var(--bg-gray); border-radius: var(--radius); aspect-ratio: 4 / 3; }
.media img { width: 100%; height: 100%; object-fit: cover; }
.media.is-empty {
  display: grid; place-items: center;
  background: linear-gradient(135deg, #f1f2f5, #e7e9ee);
}
.media.is-empty::before {
  content: ""; width: 44px; height: 44px; opacity: .35;
  background: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231b1866' stroke-width='1.6' stroke-linejoin='round'%3E%3Cpath d='M3 7.5 12 3l9 4.5v9L12 21l-9-4.5z'/%3E%3Cpath d='M3 7.5 12 12l9-4.5M12 12v9'/%3E%3C/svg%3E");
}
.hero-media { aspect-ratio: 5 / 4; }

/* ---------- sections ---------- */
.section { padding: 100px 0; }
.section-gray { background: var(--bg-gray); border-block: 1px solid var(--line); }
.sec-head { margin-bottom: 48px; }
.sec-eyebrow { margin: 0 0 8px; color: var(--navy); font-size: 13px; font-weight: 700; letter-spacing: .16em; }
.sec-head h2 { font-size: clamp(28px, 3.4vw, 38px); font-weight: 800; color: var(--blue-title); }
.sec-sub { margin: 12px 0 0; color: var(--text-soft); }

/* about */
.about { display: grid; grid-template-columns: 1.25fr 1fr; gap: 64px; align-items: start; }
.about-lead { font-size: clamp(22px, 2.4vw, 28px); font-weight: 700; line-height: 1.45; margin: 0 0 24px; letter-spacing: -0.02em; }
.about-text p:not(.about-lead) { margin: 0 0 14px; color: var(--text-soft); }
.facts { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; border-top: 2px solid var(--navy); }
.facts li { padding: 22px 4px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
.facts li:nth-child(odd) { padding-right: 16px; }
.facts strong { font-size: 18px; color: var(--navy); }
.facts span { font-size: 14px; color: var(--text-soft); }

/* products */
.products { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.product { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.product .media { border-radius: 0; aspect-ratio: 1 / 1; }
.product-body { padding: 22px 22px 26px; }
.product h3 { font-size: 19px; font-weight: 700; margin-bottom: 8px; }
.product p { margin: 0; font-size: 15px; color: var(--text-soft); line-height: 1.65; }

/* process */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); border-top: 2px solid var(--navy); }
.steps li { padding: 28px 24px 8px 0; position: relative; }
.steps li + li { padding-left: 24px; border-left: 1px solid var(--line); }
.step-n { display: block; font-size: 14px; font-weight: 800; color: var(--navy); letter-spacing: .06em; margin-bottom: 10px; }
.steps h3 { font-size: 19px; font-weight: 700; margin-bottom: 8px; }
.steps p { margin: 0; font-size: 15px; color: var(--text-soft); }

/* quote */
.quote-layout { display: grid; grid-template-columns: 340px 1fr; gap: 32px; align-items: start; }
.quote-guide { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.quote-guide .media { aspect-ratio: 4 / 3; margin-bottom: 18px; }
.quote-guide h3 { font-size: 17px; font-weight: 700; margin-bottom: 8px; }
.quote-guide p { margin: 0; font-size: 14px; color: var(--text-soft); }
.quote-guide b { color: var(--text); }
.quote { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 36px; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px 20px; }
.f { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; border: 0; min-width: 0; }
.f-full { grid-column: 1 / -1; }
.f > span, .f legend { font-weight: 600; font-size: 14px; padding: 0; color: var(--text); }
.f i { color: var(--danger); font-style: normal; }
input, select, textarea {
  width: 100%; font-family: inherit; font-size: 16px; line-height: 1.4; color: var(--text);
  padding: 12px 14px; background: #fff;
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  transition: border-color .15s;
}
input:hover, select:hover, textarea:hover { border-color: #a9adb9; }
input:focus, select:focus, textarea:focus { border-color: var(--navy); outline: none; box-shadow: 0 0 0 3px rgba(27, 24, 102, .12); }
input::placeholder, textarea::placeholder { color: var(--text-faint); }
textarea { resize: vertical; }
input[aria-invalid="true"] { border-color: var(--danger); }
.dims { display: flex; align-items: center; gap: 10px; }
.dims b { color: var(--text-faint); font-weight: 400; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.chips label { cursor: pointer; }
.chips input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chips span {
  display: inline-block; padding: 9px 16px; font-weight: 500; font-size: 14px;
  border: 1px solid var(--line-strong); border-radius: var(--radius); background: #fff;
  transition: background-color .15s, color .15s, border-color .15s;
}
.chips label:hover span { border-color: var(--navy); }
.chips input:checked + span { background: var(--navy); color: #fff; border-color: var(--navy); }
.chips input:focus-visible + span { outline: 2px solid var(--navy); outline-offset: 2px; }
.form-msg { min-height: 1.7em; margin: 20px 0 0; font-size: 15px; font-weight: 600; }
.form-msg.err { color: var(--danger); }
.form-msg.ok { color: var(--ok); }
.form-cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; padding-top: 24px; border-top: 1px solid var(--line); }

/* contact */
.contact-layout { display: grid; grid-template-columns: 1.4fr 1fr; gap: 40px; align-items: stretch; }
.info { margin: 0; border-top: 2px solid var(--navy); }
.info > div { display: grid; grid-template-columns: 120px 1fr; gap: 16px; padding: 18px 4px; border-bottom: 1px solid var(--line); }
.info > div[hidden] { display: none; }
.info dt { font-weight: 700; color: var(--navy); font-size: 15px; }
.info dd { margin: 0; color: var(--text); }
.info a { text-decoration: none; }
.info a:hover { text-decoration: underline; }
.copy-link {
  font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0;
  cursor: pointer; text-align: left;
  border-bottom: 1px dashed transparent;
}
.copy-link:hover { color: var(--navy); border-bottom-color: currentColor; }
.copy-link::after {
  content: "복사"; display: inline-block; margin-left: 8px; padding: 1px 6px;
  font-size: 12px; font-weight: 600; color: var(--text-faint);
  border: 1px solid var(--line); border-radius: 4px; vertical-align: 1px;
}
.copy-link:hover::after { color: var(--navy); border-color: var(--line-strong); }
.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 50;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  max-width: calc(100% - 32px);
  background: #17181d; color: #fff; padding: 12px 20px; border-radius: var(--radius);
  font-size: 15px; font-weight: 500; box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
  transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.map-card {
  background: var(--navy-tint); border-radius: var(--radius);
  padding: 36px 32px; display: flex; flex-direction: column; justify-content: center; gap: 14px;
}
.map-card svg { width: 34px; height: 34px; fill: none; stroke: var(--navy); stroke-width: 1.8; }
.map-card p { margin: 0; font-weight: 600; }
.map-links { display: flex; gap: 8px; flex-wrap: wrap; }

/* footer */
.foot { background: #17181d; color: #b4b7c0; padding: 44px 0; font-size: 13px; }
.logo-foot { color: #fff; margin-bottom: 16px; }
.logo-foot .logo-text small { color: #80848f; }
.biz { margin: 0 0 6px; line-height: 1.8; }
.copy { margin: 0; color: #80848f; }

/* ---------- responsive ---------- */
@media (max-width: 1040px) {
  .products { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .steps li:nth-child(3) { padding-left: 0; border-left: 0; }
  .steps li:nth-child(n+3) { border-top: 1px solid var(--line); }
  .quote-layout { grid-template-columns: 1fr; }
  .quote-guide { display: grid; grid-template-columns: 220px 1fr; gap: 0 22px; align-items: center; }
  .quote-guide .media { grid-row: span 2; margin-bottom: 0; }
}
@media (max-width: 820px) {
  :root { --header-h: 64px; }
  .nav { display: none; }
  .top-cta { margin-left: auto; }
  .hero { padding: 48px 0 56px; }
  .hero-in, .about, .contact-layout { grid-template-columns: 1fr; gap: 36px; }
  .section { padding: 72px 0; }
  .sec-head { margin-bottom: 32px; }
}
@media (max-width: 560px) {
  .wrap { padding: 0 16px; }
  .products, .steps, .grid, .facts { grid-template-columns: 1fr; }
  .facts li:nth-child(odd) { padding-right: 4px; }
  .steps li, .steps li + li { padding: 22px 0 18px; border-left: 0; }
  .steps li + li { border-top: 1px solid var(--line); }
  .quote { padding: 24px 18px; }
  .quote-guide { display: block; }
  .quote-guide .media { margin-bottom: 16px; }
  .info > div { grid-template-columns: 84px 1fr; gap: 10px; }
  .hero-cta .btn, .form-cta .btn { width: 100%; }
  .lead br { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
