/* ==========================================================
   XLINK — 엑스링크 홈페이지
   Palette
     --ink    #1B1433  짙은 플럼 (본문·다크 섹션)
     --paper  #FFFFFF  기본 배경
     --mist   #F4F1FB  연한 라일락 면
     --dm     #3797F0  인스타그램 DM 말풍선 블루
     --violet #7B3FE4  브랜드 포인트
   Motif: 인스타그램 스토리 링(그라데이션 원) + DM 말풍선
   ========================================================== */

:root {
  --ink: #1B1433;
  --ink-2: #4A4361;
  --ink-3: #7A7490;
  --paper: #FFFFFF;
  --mist: #F4F1FB;
  --line: #E4DFF0;
  --dm: #3797F0;
  --violet: #7B3FE4;
  --ring: conic-gradient(from 210deg, #FEDA75, #FA7E1E, #D62976, #962FBF, #4F5BD5, #FEDA75);

  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;

  --wrap: 1180px;
  --gutter: clamp(20px, 4vw, 40px);
  --sec: clamp(80px, 11vw, 140px);
  --header-h: 72px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--paper);
  word-break: keep-all;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3, h4, p, ul, ol, dl, dd, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }

:focus-visible { outline: 3px solid var(--dm); outline-offset: 3px; border-radius: 6px; }

.skip {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 8px; text-decoration: none;
}
.skip:focus { top: 12px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- Type scale ---------- */
.h2 {
  font-size: clamp(30px, 4.2vw, 48px);
  line-height: 1.25;
  font-weight: 800;
  letter-spacing: -0.035em;
}
.h2--light { color: #fff; }
.h3 {
  font-size: clamp(22px, 2.4vw, 28px);
  font-weight: 750;
  letter-spacing: -0.025em;
  line-height: 1.35;
}
.section { padding: var(--sec) 0; }
.section__head { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: end; margin-bottom: 56px; }
.section__lead { color: var(--ink-2); max-width: 34em; }
.section__lead--light { color: #CFC8E6; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 54px; padding: 0 26px;
  font: inherit; font-size: 16px; font-weight: 700;
  border-radius: 999px; border: 0; cursor: pointer; text-decoration: none;
  transition: background-color .2s, color .2s, box-shadow .2s;
}
.btn--primary { background: var(--ink); color: #fff; }
.btn--primary:hover { background: var(--violet); }
.btn--ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }
.btn--ghost:hover { background: var(--ink); color: #fff; }
.btn--light { background: #fff; color: var(--ink); }
.btn--light:hover { background: var(--dm); color: #fff; }
.btn--block { width: 100%; }

/* ---------- Header ---------- */
.header {
  position: fixed; inset: 0 0 auto 0; z-index: 50; height: var(--header-h);
  background: rgba(255,255,255,.9); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  transition: box-shadow .2s;
}
.header.is-scrolled { box-shadow: 0 1px 0 var(--line); }
.header__inner { height: 100%; display: flex; align-items: center; justify-content: space-between; }

.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.logo__mark {
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--ring); color: #fff; font-weight: 900; font-size: 16px;
}
.logo__text { font-weight: 850; font-size: 20px; letter-spacing: -0.02em; }
.logo--light .logo__text { color: #fff; }

.nav { display: flex; align-items: center; gap: 36px; font-size: 16px; font-weight: 600; }
.nav a { text-decoration: none; color: var(--ink-2); transition: color .2s; }
.nav a:hover, .nav a.is-active { color: var(--ink); }
.nav a.is-active:not(.nav__cta) { box-shadow: 0 2px 0 var(--ink); }
.nav .nav__cta { color: #fff; background: var(--ink); padding: 9px 20px; border-radius: 999px; }
.nav .nav__cta:hover { color: #fff; background: var(--violet); }

.menu-btn { display: none; width: 44px; height: 44px; border: 0; background: none; cursor: pointer; padding: 10px; }
.menu-btn span { display: block; height: 2px; background: var(--ink); margin: 5px 0; border-radius: 2px; transition: transform .25s, opacity .25s; }
.menu-btn[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-btn[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-btn[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero { padding: calc(var(--header-h) + clamp(48px, 8vw, 110px)) 0 clamp(72px, 9vw, 120px); background: linear-gradient(180deg, var(--paper) 0%, var(--mist) 100%); }
.hero__inner { display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(40px, 6vw, 90px); align-items: center; }
.hero__kicker { font-weight: 700; color: var(--violet); margin-bottom: 18px; }
.hero__title {
  font-size: clamp(44px, 7.2vw, 92px);
  line-height: 1.08;
  font-weight: 850;
  letter-spacing: -0.05em;
  margin-bottom: 28px;
}
.hero__lead { font-size: clamp(17px, 1.5vw, 19px); color: var(--ink-2); max-width: 31em; margin-bottom: 36px; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 52px; }
.hero__facts { display: flex; flex-wrap: wrap; gap: 14px 40px; color: var(--ink-2); font-size: 15px; }
.hero__facts li { display: flex; flex-direction: column; line-height: 1.4; }
.hero__facts strong { font-size: 26px; font-weight: 800; color: var(--ink); letter-spacing: -0.03em; }
.hero__facts small { color: var(--ink-3); font-size: 12px; }

/* DM chat — signature element */
.chat {
  background: #fff; border-radius: 28px; padding: 22px;
  box-shadow: 0 30px 60px -30px rgba(27,20,51,.35), 0 0 0 1px var(--line);
  max-width: 420px; justify-self: end; width: 100%;
}
.chat__head { display: flex; align-items: center; gap: 12px; padding-bottom: 16px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.chat__head b { display: block; font-size: 15px; line-height: 1.3; }
.chat__head small { color: var(--ink-3); font-size: 13px; }
.chat__body { display: flex; flex-direction: column; gap: 12px; min-height: 330px; }
.bubble { max-width: 86%; padding: 12px 16px; border-radius: 22px; font-size: 15px; line-height: 1.55; }
.bubble--comment { align-self: flex-start; background: var(--mist); border-bottom-left-radius: 6px; }
.bubble__who { display: block; font-size: 12px; font-weight: 700; color: var(--ink-3); margin-bottom: 2px; }
.bubble--dm { align-self: flex-end; background: var(--dm); color: #fff; border-bottom-right-radius: 6px; }
.bubble__link { display: flex; align-items: center; gap: 6px; margin-top: 10px; padding: 9px 12px; background: rgba(255,255,255,.2); border-radius: 12px; font-weight: 700; font-size: 14px; }
.bubble--reply { align-self: flex-start; background: var(--mist); border-bottom-left-radius: 6px; }
.chat__meta { align-self: center; margin-top: 6px; font-size: 13px; font-weight: 600; color: var(--violet); }

/* chat is revealed once, step by step (the page's single orchestrated motion) */
.js .chat [data-step] { opacity: 0; transform: translateY(10px); transition: opacity .45s ease, transform .45s ease; }
.js .chat [data-step].is-shown { opacity: 1; transform: none; }

/* Story ring */
.ring {
  --size: 92px;
  width: var(--size); height: var(--size); border-radius: 50%;
  background: var(--ring); padding: 3px; display: inline-grid; flex: none;
}
.ring > span {
  border-radius: 50%; background: var(--ink); color: #fff;
  border: 3px solid #fff;
  display: grid; place-items: center;
  font-weight: 800; font-size: calc(var(--size) * .22); letter-spacing: -0.03em;
}
.ring--sm { --size: 42px; }
.ring--sm > span { border-width: 2px; font-size: 14px; }

/* ---------- About ---------- */
.about__grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(40px, 6vw, 90px); margin-bottom: 72px; }
.about__text p { color: var(--ink-2); margin-bottom: 18px; max-width: 34em; }
.about__info { margin-top: 32px; border-top: 1px solid var(--line); }
.about__info div { display: grid; grid-template-columns: 96px 1fr; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.about__info dt { color: var(--ink-3); font-weight: 600; }
.about__info dd a { color: var(--ink); text-underline-offset: 3px; }

.pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.pillar { background: var(--mist); border-radius: 24px; padding: 36px 32px; }
.pillar i { font-size: 26px; color: var(--violet); margin-bottom: 22px; }
.pillar h3 { font-size: 21px; font-weight: 750; letter-spacing: -0.02em; margin-bottom: 10px; }
.pillar p { color: var(--ink-2); font-size: 16px; }

/* ---------- Marketing ---------- */
.marketing { background: var(--mist); }
.channels {
  display: grid; grid-template-columns: repeat(9, 1fr); gap: 12px;
  margin-bottom: clamp(72px, 9vw, 110px);
}
.channels a { display: flex; flex-direction: column; align-items: center; text-align: center; text-decoration: none; padding: 8px 0; border-radius: 16px; }
.channels .ring { margin-bottom: 12px; transition: transform .25s ease; }
.channels a:hover .ring { transform: scale(1.06); }
.channels b { font-size: 15px; font-weight: 750; line-height: 1.3; }
.channels small { font-size: 12px; color: var(--ink-3); line-height: 1.4; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }

.marketing .h3 { margin-bottom: 28px; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; counter-reset: none; }
.steps li { background: #fff; border-radius: 24px; padding: 32px; position: relative; }
.steps__num {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  background: var(--ink); color: #fff; font-weight: 800; margin-bottom: 22px;
}
.steps h4 { font-size: 20px; font-weight: 750; letter-spacing: -0.02em; margin-bottom: 8px; line-height: 1.4; }
.steps p { color: var(--ink-2); font-size: 16px; }

/* ---------- Platform (dark) ---------- */
.platform { background: var(--ink); color: #fff; }
.platform__grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(40px, 6vw, 90px); align-items: start; }
.platform__copy .section__lead { margin: 22px 0 34px; }
.free-list { display: flex; flex-direction: column; }
.free-list li { display: grid; grid-template-columns: 52px 1fr; gap: 20px; padding: 28px 0; border-top: 1px solid rgba(255,255,255,.14); }
.free-list li:last-child { border-bottom: 1px solid rgba(255,255,255,.14); }
.free-list i {
  width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center;
  background: var(--dm); font-size: 20px;
}
.free-list h3 { font-size: 22px; font-weight: 750; letter-spacing: -0.02em; margin-bottom: 6px; }
.free-list p { color: #CFC8E6; font-size: 16px; }
.platform__badges { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.platform__badges span { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 999px; background: rgba(255,255,255,.08); font-size: 15px; font-weight: 600; }

/* ---------- Solution ---------- */
.solution__grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(40px, 6vw, 90px); margin-bottom: 64px; }
.solution__quote {
  margin: 36px 0 22px; padding-left: 22px;
  border-left: 4px solid transparent; border-image: var(--ring) 1;
  font-size: clamp(22px, 2.4vw, 28px); font-weight: 750; line-height: 1.45; letter-spacing: -0.025em;
}
.solution__text { color: var(--ink-2); max-width: 32em; }
.services li { padding: 24px 0; border-top: 1px solid var(--line); }
.services li:last-child { border-bottom: 1px solid var(--line); }
.services h3 { font-size: 20px; font-weight: 750; letter-spacing: -0.02em; margin-bottom: 4px; }
.services p { color: var(--ink-2); font-size: 16px; }

.process { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 28px; }
.process li { display: flex; align-items: center; gap: 12px; background: var(--mist); border-radius: 999px; padding: 14px 20px; font-weight: 700; font-size: 16px; }
.process b { width: 30px; height: 30px; flex: none; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font-size: 14px; }
.stack { display: flex; flex-wrap: wrap; gap: 8px; }
.stack span { font-size: 14px; color: var(--ink-2); padding: 6px 14px; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--line); }

/* ---------- Portfolio ---------- */
.portfolio { background: var(--mist); }
.works { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.work { background: #fff; border-radius: 24px; overflow: hidden; display: flex; flex-direction: column; }
.work--feature { grid-column: 1 / -1; flex-direction: row; }
.work__visual { height: 180px; display: grid; place-items: center; }
.work--feature .work__visual { height: auto; min-height: 300px; flex: 1.1; }
.work__visual--xlink { background: var(--ink); }
.work__visual--rings { background: #fff; gap: 0; display: flex; justify-content: center; align-items: center; border-bottom: 1px solid var(--line); }
.work__visual--rings .ring { --size: 74px; margin: 0 -8px; }
.work__visual--ai { background: var(--violet); color: #fff; font-size: 48px; }
.work__visual--bot { background: var(--dm); color: #fff; font-size: 48px; }
.work__body { padding: 28px 30px 32px; flex: 1; }
.work--feature .work__body { padding: 44px; display: flex; flex-direction: column; justify-content: center; }
.work__type { display: inline-block; font-size: 13px; font-weight: 700; color: var(--violet); margin-bottom: 10px; }
.work h3 { font-size: 21px; font-weight: 750; letter-spacing: -0.02em; margin-bottom: 8px; line-height: 1.4; }
.work--feature h3 { font-size: clamp(24px, 2.6vw, 30px); }
.work p { color: var(--ink-2); font-size: 16px; }
.work__link { margin-top: 22px; font-weight: 700; text-underline-offset: 4px; }

.mini { width: min(80%, 360px); background: rgba(255,255,255,.06); border-radius: 18px; padding: 24px; }
.mini__row { display: flex; gap: 12px; margin-bottom: 22px; color: #fff; font-size: 22px; }
.mini__row i { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.1); }
.mini__bar { height: 10px; border-radius: 10px; background: rgba(255,255,255,.1); margin-top: 12px; overflow: hidden; }
.mini__bar span { display: block; height: 100%; border-radius: 10px; background: var(--dm); }

/* ---------- Contact ---------- */
.contact__grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(40px, 6vw, 90px); align-items: start; }
.contact .section__lead { margin-top: 22px; }
.form { background: var(--mist); border-radius: 28px; padding: clamp(24px, 4vw, 40px); }
.form__row { margin-bottom: 18px; }
.form label { display: block; font-size: 14px; font-weight: 700; margin-bottom: 6px; }
.form input, .form select, .form textarea {
  width: 100%; font: inherit; font-size: 16px; color: var(--ink);
  background: #fff; border: 1.5px solid var(--line); border-radius: 14px; padding: 13px 16px;
  transition: border-color .2s;
}
.form textarea { resize: vertical; }
.form input:focus, .form select:focus, .form textarea:focus { outline: none; border-color: var(--dm); }
.form input[aria-invalid="true"] { border-color: #D6336C; }
.form__error { min-height: 1.4em; color: #C2255C; font-size: 14px; font-weight: 600; margin-bottom: 8px; }

/* ---------- Footer ---------- */
.footer { background: var(--ink); color: #CFC8E6; padding: 56px 0 32px; font-size: 15px; }
.footer__inner { display: flex; justify-content: space-between; align-items: flex-start; gap: 32px; flex-wrap: wrap; margin-bottom: 40px; }
.footer__info { margin-top: 14px; }
.footer__nav { display: flex; flex-wrap: wrap; gap: 12px 28px; }
.footer__nav a { text-decoration: none; }
.footer__nav a:hover { color: #fff; }
.footer__copy { font-size: 13px; color: #8E87A8; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 60;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--ink); color: #fff; padding: 14px 22px; border-radius: 999px;
  font-size: 15px; font-weight: 600; transition: opacity .25s, transform .25s;
}
.toast.is-shown { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .channels { grid-template-columns: repeat(5, 1fr); row-gap: 24px; }
}
@media (max-width: 900px) {
  body { font-size: 16px; }
  .menu-btn { display: block; }
  .nav {
    position: fixed; top: var(--header-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: #fff; padding: 8px var(--gutter) 24px; box-shadow: 0 12px 24px -12px rgba(27,20,51,.2);
    display: none;
  }
  .nav.is-open { display: flex; }
  .nav a { padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 17px; }
  .nav a.is-active:not(.nav__cta) { box-shadow: none; }
  .nav .nav__cta { margin-top: 16px; text-align: center; padding: 14px; border-bottom: 0; }

  .hero__inner, .about__grid, .platform__grid, .solution__grid, .contact__grid, .section__head { grid-template-columns: 1fr; }
  .section__head { gap: 18px; }
  .chat { justify-self: stretch; max-width: none; }
  .pillars, .steps { grid-template-columns: 1fr; }
  .process { grid-template-columns: 1fr 1fr; }
  .works { grid-template-columns: 1fr; }
  .work--feature { flex-direction: column; }
  .work--feature .work__visual { min-height: 220px; }
  .work--feature .work__body { padding: 28px 30px 32px; }
}
@media (max-width: 560px) {
  .channels {
    grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 118px;
    overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px;
    margin-left: calc(var(--gutter) * -1); margin-right: calc(var(--gutter) * -1);
    padding-left: var(--gutter); padding-right: var(--gutter);
  }
  .channels li { scroll-snap-align: start; }
  .ring { --size: 80px; }
  .process { grid-template-columns: 1fr; }
  .hero__facts { gap: 14px 28px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .js .chat [data-step] { opacity: 1; transform: none; }
}