/* Layout: 처음엔 큰 이름이 올라오고 i의 빨간 점이 떨어진 뒤, 이름이 헤더 로고 자리로 줄어들며 포트폴리오가 올라온다.
   그다음은 보통 스크롤: 포트폴리오 → 진행 방식 → 문의하기. 빨간 점은 메뉴에서 지금 보는 곳을, 포트폴리오에서 고른 작업물을 가리킨다 */
:root {
  --bg: #FFFFFF;
  --ink: #12171F;
  --ink-2: #525B69;
  --ink-3: #6B7380;
  --line: #E5E8ED;
  --soft: #F4F6F8;
  --sky: #E1EEFB;
  --blue: #1A80E6;
  --red: #E93547;
  --go: #1466B8;
  --go-dark: #0F5294;
  --err: #C0362C;
  --kr: "IBM Plex Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  --lat: "Instrument Sans", "IBM Plex Sans KR", system-ui, sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --spring: cubic-bezier(.3, 1.5, .5, 1);
  --head: 64px;
  --gut: max(16px, 4vw);
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-padding-top: var(--head); scrollbar-gutter: stable; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--kr); font-size: 1rem; line-height: 1.7; word-break: keep-all; overflow-wrap: anywhere; -webkit-font-smoothing: antialiased; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 40; background: var(--bg); }
h1, h2, h3, h4 { margin: 0; text-wrap: balance; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: inherit; text-underline-offset: 3px; }
button { font: inherit; color: inherit; }
img { display: block; }
:focus-visible { outline: 2px solid var(--go); outline-offset: 3px; border-radius: 6px; }
.wrap { padding-left: max(var(--gut), env(safe-area-inset-left, 0px)); padding-right: max(var(--gut), env(safe-area-inset-right, 0px)); }
.vh { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 22px; border-radius: 10px; font-weight: 600; text-decoration: none; white-space: nowrap; border: 1px solid transparent; cursor: pointer; transition: background-color .2s var(--ease), border-color .2s var(--ease); }
.btn-go { background: var(--go); color: #FFFFFF; }
.btn-go:hover { background: var(--go-dark); }
.btn-line { background: var(--bg); border-color: var(--line); color: var(--ink); }
.btn-line:hover { border-color: var(--ink-3); }
.btn-sm { min-height: 40px; padding: 0 16px; font-size: 0.875rem; }

/* 로고: you는 검정, niz는 파랑, i의 점만 빨강(빨간 i 위에 점 없는 파란 ı를 겹침) */
.niz { color: var(--blue); }
.i { position: relative; display: inline-block; }
.i-r { color: var(--red); }
.i-b { position: absolute; left: 0; top: 0; color: var(--blue); }
.logo { font-family: var(--lat); font-weight: 600; font-size: 1.375rem; letter-spacing: -0.065em; line-height: 0.9; color: var(--ink); text-decoration: none; white-space: nowrap; }

/* 헤더와 메뉴. 메뉴 아래 빨간 점이 지금 보는 곳(마우스를 올리면 그 메뉴)으로 튀어 옮겨 간다 */
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 30; background: var(--bg); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; gap: 24px; height: var(--head); }
.nav { position: relative; display: flex; gap: clamp(18px, 2.4vw, 36px); margin-left: auto; font-size: 0.9375rem; color: var(--ink-2); }
.nav a { padding-block: 10px; text-decoration: none; white-space: nowrap; transition: color .25s var(--ease); }
.nav a:hover, .nav a.cur { color: var(--ink); }
.navdot { position: absolute; left: 0; bottom: 3px; width: 7px; height: 7px; background: var(--red); opacity: 0; pointer-events: none; transition: transform .55s var(--spring), opacity .3s var(--ease); }
.navdot.on { opacity: 1; }
@media (max-width: 480px) { .nav { gap: 16px; font-size: 0.875rem; } .top .logo { font-size: 1.25rem; } }

/* 인트로 (자바스크립트가 html에 intro를 붙인 첫 방문에만).
   run: 글자가 아래에서 올라오고 i의 빨간 점이 떨어져 튄다 → go: 이름이 헤더 로고 자리로 줄어들고 포트폴리오가 올라온다 → done */
.splash { display: none; }
html.intro:not(.intro-done) { overflow: hidden; }
html.intro:not(.intro-done) .splash { position: fixed; inset: calc(var(--head) + env(safe-area-inset-top, 0px)) 0 0; z-index: 40; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; padding: 0 var(--gut) 6svh; pointer-events: none; }
html.intro:not(.intro-done) .top .logo:not(:focus-visible), html.intro:not(.intro-done) .navdot { opacity: 0; }
html.intro .top { border-bottom-color: transparent; }
html.intro-go .top { border-bottom-color: var(--line); transition: border-color .6s var(--ease); }

.word { width: max-content; padding-bottom: .12em; font-family: var(--lat); font-weight: 600; font-size: min(30vw, 50svh); letter-spacing: -0.065em; line-height: 0.9; white-space: nowrap; color: var(--ink); transform-origin: 0 0; }
.word .l { display: inline-block; clip-path: inset(-60% -8% -30% -8%); }
.word .l > span { display: inline-block; transform: translateY(140%); }
.w-i { position: relative; }
.w-ir { position: absolute; left: 0; top: 0; color: var(--red); clip-path: inset(0 0 70% 0); opacity: 0; transform: translateY(-160%); }
html.intro-run .word .l > span { animation: up .9s var(--ease) forwards; animation-delay: calc(var(--k) * 55ms); }
html.intro-run .w-ir { animation: drop .95s .62s forwards; }
html.intro-go .word { transition: transform .85s cubic-bezier(.75, 0, .2, 1); }
.slogan { margin-top: max(16px, 3svh); padding-left: .1em; font-size: clamp(1.25rem, 2.4vw, 2.25rem); font-weight: 600; letter-spacing: -0.03em; line-height: 1.35; color: var(--ink-2); opacity: 0; transform: translateY(12px); }
html.intro-run .slogan { opacity: 1; transform: none; transition: opacity .8s 1.35s var(--ease), transform .8s 1.35s var(--ease); }
html.intro-go .slogan { opacity: 0; transform: translateY(-16px); transition: opacity .35s var(--ease), transform .5s var(--ease); }
@keyframes up { to { transform: none; } }
@keyframes drop {
  0% { transform: translateY(-160%); opacity: 1; animation-timing-function: cubic-bezier(.55, 0, 1, .45); }
  55% { transform: translateY(0); animation-timing-function: cubic-bezier(0, .55, .45, 1); }
  72% { transform: translateY(-14%); animation-timing-function: cubic-bezier(.55, 0, 1, .45); }
  86% { transform: translateY(0); animation-timing-function: cubic-bezier(0, .55, .45, 1); }
  93% { transform: translateY(-3%); }
  100% { transform: translateY(0); opacity: 1; }
}

/* 인트로 동안 본문은 숨었다가, 이름이 줄어들기 시작하면 제목과 작업물이 차례로 올라온다 */
html.intro .pf .sec-h, html.intro .card { opacity: 0; transform: translateY(48px); }
html.intro-go .pf .sec-h, html.intro-go .card { opacity: 1; transform: none; transition: opacity .6s var(--ease), transform .8s var(--ease); }
html.intro-go .pf .sec-h { transition-delay: .5s; }
html.intro-go .card { transition-delay: calc(.56s + var(--k) * 60ms); }
html.intro .flow-sec, html.intro .ask { opacity: 0; }
html.intro-go .flow-sec, html.intro-go .ask { opacity: 1; transition: opacity .6s 1s var(--ease); }

/* 구역 공통 제목 */
.sec-h { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-bottom: clamp(20px, 2.6vw, 40px); }
.sec-h h2 { font-size: clamp(1.75rem, 3.4vw, 3.125rem); font-weight: 700; letter-spacing: -0.035em; line-height: 1.1; }
.sec-h p { font-size: clamp(0.875rem, 1.2vw, 1.125rem); color: var(--ink-3); white-space: nowrap; }

/* 1. 포트폴리오: 이름, 분야, 한 줄 설명만. 마우스를 올린 작업물 모서리로 빨간 점이 옮겨 간다 */
.pf { padding-block: clamp(28px, 4vw, 60px) clamp(64px, 8vw, 120px); }
.grid-wrap { position: relative; }
.grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(28px, 2.6vw, 40px) clamp(16px, 1.8vw, 28px); }
.card .th { aspect-ratio: 4 / 3; display: flex; align-items: center; justify-content: center; overflow: hidden; border-radius: clamp(12px, 1.2vw, 18px); background: var(--soft); }
.card .th img { width: 32%; height: auto; border-radius: 22%; transition: transform .6s var(--ease); }
.card .th.txt { font-family: var(--lat); font-size: clamp(1.5rem, 3vw, 2.75rem); font-weight: 600; letter-spacing: -0.03em; color: #B7BFCA; }
.card:hover .th img { transform: scale(1.07); }
.card .nm { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-top: 14px; }
.card h3 { font-size: clamp(1rem, 1.35vw, 1.25rem); font-weight: 600; letter-spacing: -0.02em; line-height: 1.35; }
.card .nm span { flex: none; font-size: 0.8125rem; color: var(--ink-3); }
.card p { margin-top: 4px; font-size: clamp(0.875rem, 1vw, 0.9375rem); line-height: 1.55; color: var(--ink-2); }
.pfdot { position: absolute; left: 0; top: 0; width: 10px; height: 10px; background: var(--red); opacity: 0; pointer-events: none; transition: transform .55s var(--spring), opacity .3s var(--ease); }
.pfdot.on { opacity: 1; }
@media (hover: none) { .pfdot { display: none; } }
@media (max-width: 1000px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 700px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* 2. 진행 방식: 화면에 들어오면 단계에 도달 → 파장이 다 퍼진 뒤 → 선이 다음 단계로(1초) 순서로 진행한다.
   여섯 단계는 칸 가운데 정렬이라 양쪽 끝 여백이 같다 */
.flow-sec { padding-block: clamp(56px, 7vw, 112px); border-top: 1px solid var(--line); }
.flow { --seg: 1s; position: relative; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 20px; margin-top: 8px; }
.flow::before, .flow::after { content: ""; position: absolute; left: calc((100% - 100px) / 12); right: calc((100% - 100px) / 12); top: 14px; height: 2px; }
.flow::before { background: var(--line); }
.flow::after { background: var(--blue); transform: scaleX(var(--p, 0)); transform-origin: 0 50%; transition: transform var(--seg) linear; }
.flow.reset::after { transition: none; }
.flow li { position: relative; display: grid; justify-items: center; gap: 2px; align-content: start; text-align: center; }
.dot { position: relative; z-index: 1; width: 30px; height: 30px; margin-bottom: 10px; display: grid; place-items: center; border-radius: 50%; background: var(--bg); border: 2px solid var(--line); font-family: var(--lat); font-weight: 600; font-size: 0.8125rem; color: var(--ink-3); transition: background-color .35s var(--ease), border-color .35s var(--ease), color .35s var(--ease); }
.dot::before, .dot::after { content: ""; position: absolute; inset: -2px; border-radius: 50%; border: 2px solid var(--blue); opacity: 0; pointer-events: none; }
.flow h3 { font-size: clamp(1rem, 1.4vw, 1.25rem); font-weight: 700; letter-spacing: -0.02em; }
.flow p { font-size: 0.8125rem; color: var(--ink-2); }
html.js .flow h3, html.js .flow p { opacity: .35; transition: opacity .4s var(--ease); }
.flow li.on .dot { background: var(--blue); border-color: var(--blue); color: #FFFFFF; }
html.js .flow li.on h3, html.js .flow li.on p { opacity: 1; }
/* 도달하면 고리 두 개가 차례로 퍼짐(약 1.25초). 마지막 '관리'는 계속 퍼짐 */
.flow li.on .dot::after { animation: wave 1s cubic-bezier(.2, .6, .3, 1) forwards; }
.flow li.on .dot::before { animation: wave 1s cubic-bezier(.2, .6, .3, 1) .25s forwards; }
.flow li.last .dot::after, .flow li.last .dot::before { animation-iteration-count: infinite; animation-duration: 1.6s; }
@keyframes wave { 0% { transform: scale(1); opacity: .65; } 100% { transform: scale(2.4); opacity: 0; } }
@media (max-width: 760px) {
  .flow { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 24px; }
  .flow::before, .flow::after { display: none; }
}

/* 3. 문의하기: 화면을 채우는 좌우 두 칸. 왼쪽은 제목과 사업자 정보(하늘색), 오른쪽은 입력 네 칸 */
.ask { min-height: calc(100svh - var(--head)); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); grid-template-rows: minmax(0, 1fr) auto; grid-template-areas: "side form" "foot form"; }
.ask-side { grid-area: side; padding-block: max(32px, 6svh) 24px; background: var(--sky); }
.ask-side h2 { font-size: clamp(3rem, 7.4vw, 7.5rem); font-weight: 700; letter-spacing: -0.06em; line-height: 1; }
.ask-side .lead { margin-top: 20px; max-width: 20em; font-size: clamp(1.0625rem, 1.4vw, 1.375rem); color: var(--ink-2); }
.ask-foot { grid-area: foot; display: grid; gap: 6px; padding-block: 20px max(24px, 4svh); background: var(--sky); font-size: 0.8125rem; color: var(--ink-3); }
.ask-foot .logo { font-size: 1.25rem; }
.biz { display: flex; flex-wrap: wrap; gap: 2px 16px; }
.moved a { color: var(--ink-2); }

.form, .done { grid-area: form; min-width: 0; padding-block: max(32px, 6svh) max(24px, 4svh); }
.form { display: flex; flex-direction: column; gap: max(10px, 1.6svh); }
.fld { display: grid; gap: 4px; }
.fld label { font-size: 0.875rem; font-weight: 600; color: var(--ink-2); }
.need, .opt { margin-left: 6px; font-size: 0.75rem; font-weight: 600; }
.need { color: var(--go); }
.opt { color: var(--ink-3); font-weight: 400; }
.fld input, .fld textarea { width: 100%; padding: 8px 0 12px; border: 0; border-bottom: 2px solid var(--line); border-radius: 0; background: transparent; font: inherit; font-size: clamp(1.125rem, 1.6vw, 1.5rem); color: var(--ink); transition: border-color .2s var(--ease); }
.fld input::placeholder, .fld textarea::placeholder { color: #B4BBC5; }
.fld input:focus, .fld textarea:focus { outline: none; border-bottom-color: var(--go); }
.fld [aria-invalid="true"] { border-bottom-color: var(--err); }
.msg { min-height: 1.3em; font-size: 0.8125rem; color: var(--err); }
.fld.grow { flex: 1; display: flex; flex-direction: column; min-height: 120px; }
.fld.grow textarea { flex: 1; min-height: 120px; margin-top: 6px; padding: 14px 16px; border: 2px solid var(--line); border-radius: 12px; background: var(--bg); resize: none; line-height: 1.5; }
.fld.grow textarea:focus { border-color: var(--go); }
.send { display: flex; }
.send .btn { flex: 1; min-height: 56px; padding: 0 36px; font-size: 1.0625rem; }
.done { display: grid; align-content: center; gap: 14px; }
.done h3 { font-size: clamp(2rem, 4vw, 3.5rem); font-weight: 700; letter-spacing: -0.04em; line-height: 1.15; }
.done h3:focus { outline: none; }
.done p { font-size: 1.125rem; color: var(--ink-2); }
.done-act { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.done .addr { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; font-family: var(--lat); font-size: clamp(1.125rem, 1.6vw, 1.5rem); font-weight: 600; color: var(--ink); }
.done .addr span { user-select: all; }
@media (max-width: 900px) {
  .ask { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; grid-template-areas: "side" "form" "foot"; }
  .ask-side { padding-block: 40px 28px; }
  .form, .done { padding-block: 28px 40px; }
}

/* 움직임 줄이기: 인트로 없이 바로 본문. 점과 진행 방식은 움직이지 않고 제자리에 */
@media (prefers-reduced-motion: reduce) {
  .navdot, .pfdot, .card .th img, .flow::after, .dot, .flow h3, .flow p { transition: none !important; }
  .dot::before, .dot::after { animation: none !important; }
}
