/* Layout: 처음엔 이름이 화면 전체 → 스크롤 한 번에 아래 1/3이 열리며 포트폴리오 한 줄
   → 한 번 더 내려가 문의하기(맨 위에 진행 방식). 흰 바탕, 파랑은 문의 행동에만 */
:root {
  --bg: #FFFFFF;
  --ink: #12171F;
  --ink-2: #525B69;
  --ink-3: #6B7380;
  --line: #E5E8ED;
  --soft: #F4F6F8;
  --soft-2: #ECEFF3;
  --sky: #E1EEFB;
  --blue: #1A80E6;
  --red: #E93547;
  --go: #1466B8;
  --go-dark: #0F5294;
  --go-soft: #E1EEFB;
  --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);
  --head: 64px;
  --gut: max(16px, 4vw);
  --stage: calc(100svh - var(--head));
  --D: 70svh;
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
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; }
html { scroll-padding-top: var(--head); }
.wrap { padding-left: max(var(--gut), env(safe-area-inset-left, 0px)); padding-right: max(var(--gut), env(safe-area-inset-right, 0px)); }

.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); }

/* 헤더: 무대에서는 큰 이름이 보이므로 헤더 로고는 숨겼다가, 문의하기로 내려가면 나타난다 */
.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: 28px; height: var(--head); }
.logo { font-family: var(--lat); font-weight: 600; font-size: 1.375rem; letter-spacing: -0.06em; line-height: 0.92; text-decoration: none; white-space: nowrap; }
.top .logo { opacity: 0; transition: opacity .3s var(--ease); }
.top.logo-on .logo, .top .logo:focus-visible { opacity: 1; }
.nav { display: flex; gap: 28px; margin-left: auto; font-size: 0.9375rem; color: var(--ink-2); }
.nav a { text-decoration: none; padding-block: 10px; }
.nav a:hover { color: var(--ink); }
@media (max-width: 760px) { .nav { display: none; } .top .btn { margin-left: auto; } }

/* 무대: 이름 칸과 포트폴리오 칸 */
.story { position: relative; height: calc(var(--stage) + var(--D)); }
.stage { position: sticky; top: var(--head); height: var(--stage); display: flex; flex-direction: column; overflow: hidden; }
.band { position: relative; flex: 0 0 auto; overflow: hidden; }
.b-hero { height: var(--h0, 100%); display: flex; align-items: center; justify-content: center; }
.b-pf { height: var(--h1, 0%); }
.band-in { height: calc(var(--stage) / 3); display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 12px; padding-block: max(14px, 2.2svh); border-top: 1px solid var(--line); }
.band-h { display: flex; align-items: baseline; gap: 12px; }
.band-h h2 { font-size: clamp(1.125rem, 1.6vw, 1.375rem); font-weight: 700; letter-spacing: -0.03em; }
.band-h p { font-size: 0.875rem; color: var(--ink-3); }

/* 1. 이름과 문구 */
.hero-in { display: grid; justify-items: center; text-align: center; transform: scale(var(--hs, 1)); transform-origin: 50% 50%; will-change: transform; }
.mark { display: inline-block; white-space: nowrap; font-family: var(--lat); font-weight: 600; font-size: min(31vw, 52svh); line-height: 0.92; letter-spacing: -0.06em; }
.slogan { margin-top: max(12px, 2.4svh); font-size: clamp(1.25rem, 2.6vw, 2.25rem); font-weight: 600; letter-spacing: -0.03em; line-height: 1.35; }

/* 2. 포트폴리오: 한 줄로 저절로 흐름. 마우스를 올리면 멈춤 */
.marquee { min-height: 0; overflow: hidden; }
.mq { display: flex; width: max-content; height: 100%; animation: mq 48s linear infinite; }
.marquee:hover .mq, .marquee:focus-within .mq { animation-play-state: paused; }
@keyframes mq { to { transform: translateX(-50%); } }
.card { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; height: 100%; margin-right: 16px; }
.card .th { flex: none; height: calc(100% - 30px); width: auto; aspect-ratio: 1 / 1; border-radius: 10px; overflow: hidden; background: var(--soft-2); }
.card .th img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.card .th.wide { aspect-ratio: 1 / 1; }
.card .th.wide img { object-position: center; }
.card .th.logo { background: var(--bg); box-shadow: inset 0 0 0 1px var(--line); }
.card .th.logo img { object-fit: contain; object-position: center; }
.card .th.logo.pad { padding: 16%; }
.card .th.trio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-content: center; gap: 6px; padding: 12px; background: var(--soft); }
.card .th.trio img { width: 100%; height: auto; aspect-ratio: 1 / 1; border-radius: 8px; }
.card .th.text { aspect-ratio: 1 / 1; display: flex; flex-direction: column; justify-content: center; gap: 4px; padding: 14px 16px; background: var(--soft); font-size: 0.8125rem; color: var(--ink-2); }
.card .th.text b { font-family: var(--lat); font-weight: 600; font-size: clamp(1.25rem, 2vw, 1.75rem); line-height: 1.1; letter-spacing: -0.03em; color: var(--blue); }
.card .th.text b small { font-family: var(--kr); font-size: 0.55em; color: var(--ink); margin-left: 2px; }
.card .cap { display: flex; align-items: baseline; gap: 8px; white-space: nowrap; font-size: 0.875rem; }
.card .cap span { font-size: 0.75rem; color: var(--ink-3); }
.card .cap a, .card .cap b { font-weight: 700; text-decoration: none; }
.card .cap a:hover { color: var(--go); text-decoration: underline; }

/* 3. 문의하기 맨 위 진행 방식: 문의하기에 도착하면 단계에 도달 → 파장이 다 퍼진 뒤 → 선이 다음 단계로(1초) 순서로 진행한다.
   여섯 단계는 칸 가운데 정렬이라 양쪽 끝 여백이 같다 */
.contact { min-height: calc(100svh - var(--head)); display: flex; flex-direction: column; }
.ask-flow { flex: none; display: grid; gap: max(10px, 1.4svh); padding-block: max(16px, 2.4svh); border-bottom: 1px solid var(--line); }
.flow { --seg: 1s; --lead: .3s; position: relative; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 20px; }
.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: 12px; }
  .flow::before, .flow::after { display: none; }
  .dot { width: 24px; height: 24px; margin-bottom: 4px; font-size: 0.75rem; }
  .flow p { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .flow::after, .dot, .flow h3, .flow p { transition: none !important; }
  .dot::before, .dot::after { animation: none !important; }
}

/* 4. 문의하기: 진행 방식 아래 남은 화면을 채우는 좌우 두 칸. 왼쪽은 제목과 사업자 정보(하늘색), 오른쪽은 입력 네 칸 */
.ask { flex: 1; 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(24px, 4svh) 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; color: var(--ink); }
.biz { display: flex; flex-wrap: wrap; gap: 2px 16px; }

.form, .done { grid-area: form; min-width: 0; padding-block: max(24px, 4svh) max(20px, 3svh); }
.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; }
.send .btn { 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 p { font-size: 1.125rem; color: var(--ink-2); }
.done-act { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.done h3:focus { outline: none; }
.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) {
  .story { height: auto; }
  .stage { position: static; }
  .b-hero { height: calc(var(--stage) / 3); }
  .hero-in { transform: scale(.45); }
  .b-pf { height: auto; }
  .marquee { overflow-x: auto; }
  .mq { animation: none; }
  .mq .dup { display: none; }
  .top .logo { opacity: 1; }
}
