/* ==========================================================================
   AILO Construction A02 — 아뜰리에 선 (건축사사무소)
   원형: 아키텍처 포트폴리오 미니멀(왼쪽 세로 레일 + 메이슨리 아카이브) / 타이포: Instrument Serif + Gothic A1 200·300
   컬러: 오프화이트 + 블랙 헤어라인(무채색만) / 모션: 이미지 클립 리빌, 느린 페이드
   ========================================================================== */
:root {
  --ailo-bg: #f7f6f3;
  --ailo-fg: #0f0f0f;
  --ailo-muted: #6f6c66;
  --ailo-line: rgba(15, 15, 15, .14);
  --ailo-accent: #0f0f0f;
  --ailo-header-h: 64px;
  --a02-rail: 248px;
  --a02-serif: "Instrument Serif", "Gothic A1", serif;
  --a02-ko: "Pretendard Variable", Pretendard, sans-serif;
  --a02-pad: clamp(20px, 4.4vw, 72px);
  --a02-sec: clamp(96px, 12vw, 180px);
}

body { background: var(--ailo-bg); color: var(--ailo-fg); font-weight: 400; }
::selection { background: #0f0f0f; color: #fff; }
em { font-style: italic; }

/* ---------- 섹션 머리 ---------- */
.sec-h {
  display: grid; grid-template-columns: 80px 1fr auto; align-items: end; gap: 16px;
  padding-bottom: 22px; border-bottom: 1px solid var(--ailo-fg); margin-bottom: clamp(36px, 5vw, 64px);
}
.sec-h__no { font-family: var(--a02-serif); font-size: 22px; line-height: 1; color: var(--ailo-muted); }
.sec-h__t { font-family: var(--a02-serif); font-weight: 400; font-size: clamp(46px, 7vw, 112px); line-height: .9; letter-spacing: -.02em; }
.sec-h__more { font-size: 14px; display: inline-flex; gap: 10px; align-items: center; border-bottom: 1px solid currentColor; padding-bottom: 3px; }
.sec-h__more:hover i { translate: 4px 0; }
.sec-h__more i { transition: translate .25s; }

/* ---------- Header rail ---------- */
.rail {
  position: fixed; top: 0; left: 0; bottom: 0; width: var(--a02-rail); z-index: 100;
  display: flex; flex-direction: column; padding: 36px 28px 32px; border-right: 1px solid var(--ailo-line); background: var(--ailo-bg);
}
.rail__logo { display: flex; flex-direction: column; gap: 16px; }
.rail__mark { width: 42px; height: 42px; border: 1px solid var(--ailo-fg); position: relative; display: block; }
.rail__mark i { position: absolute; left: -1px; right: -1px; top: 50%; height: 1px; background: var(--ailo-fg); rotate: -45deg; }
.rail__name { font-family: var(--a02-serif); font-size: 32px; line-height: 1; display: flex; flex-direction: column; gap: 8px; }
.rail__name small { font-family: var(--a02-ko); font-size: 14px; font-weight: 500; color: var(--ailo-muted); letter-spacing: .02em; }
.rail__nav { margin-top: 64px; display: flex; flex-direction: column; }
.rail__nav a { display: flex; align-items: baseline; gap: 14px; padding: 9px 0; font-family: var(--a02-serif); font-size: 26px; line-height: 1.1; transition: padding .3s var(--ailo-ease), color .2s; }
.rail__nav a span { font-family: var(--a02-ko); font-size: 14px; color: var(--ailo-muted); width: 16px; }
.rail__nav a:hover { padding-left: 10px; font-style: italic; }
.rail__foot { margin-top: auto; }
.rail__cta { display: flex; justify-content: space-between; align-items: center; height: 50px; padding: 0 18px; background: var(--ailo-fg); color: #fff; font-size: 14.5px; font-weight: 500; transition: background .25s, color .25s; border: 1px solid var(--ailo-fg); }
.rail__cta:hover { background: transparent; color: var(--ailo-fg); }
.rail__addr { margin-top: 18px; font-size: 14px; color: var(--ailo-muted); line-height: 1.7; }
.rail .ailo-burger { position: absolute; right: 8px; top: 10px; }

main, .ft { margin-left: var(--a02-rail); }

.mnav { background: var(--ailo-bg); }
.mnav__in { min-height: 100%; padding: calc(var(--ailo-header-h) + 32px) 20px 40px; display: flex; flex-direction: column; }
.mnav__in > a:not(.mnav__cta) { display: flex; align-items: baseline; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--ailo-line); font-family: var(--a02-serif); font-size: 44px; line-height: 1; }
.mnav__in > a span { font-family: var(--a02-ko); font-size: 14px; color: var(--ailo-muted); width: 20px; }
.mnav__in > a small { margin-left: auto; font-family: var(--a02-ko); font-size: 14px; color: var(--ailo-muted); }
.mnav__cta { margin-top: 32px; display: flex; justify-content: space-between; align-items: center; height: 58px; padding: 0 20px; background: var(--ailo-fg); color: #fff; font-size: 16px; }

/* ---------- Hero ---------- */
.hero {
  position: relative; min-height: 100svh; display: grid; grid-template-columns: 1.15fr .85fr; align-items: end; gap: clamp(28px, 4vw, 72px);
  padding: clamp(48px, 8vw, 120px) var(--a02-pad) clamp(40px, 5vw, 72px);
}
.hero__grid { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(4, 1fr); pointer-events: none; z-index: 0; }
.hero__grid i { border-right: 1px solid var(--ailo-line); }
.hero__txt, .hero__fig { position: relative; z-index: 1; }
.hero__k { font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--ailo-muted); margin-bottom: clamp(28px, 4vw, 48px); }
.hero__t { font-weight: 400; }
.hero__en { display: block; font-family: var(--a02-serif); font-size: clamp(60px, 8.6vw, 156px); line-height: .88; letter-spacing: -.03em; }
.hero__ko { display: block; margin-top: clamp(22px, 3vw, 36px); font-family: var(--a02-ko); font-weight: 200; font-size: clamp(22px, 2.3vw, 36px); letter-spacing: -.04em; }
.hero__d { margin-top: 22px; max-width: 460px; color: var(--ailo-muted); font-size: 16px; line-height: 1.85; }
.hero__fig { align-self: stretch; display: flex; flex-direction: column; justify-content: flex-end; }
.hero__fig img { aspect-ratio: 10 / 13; height: auto; max-height: 76svh; }
.hero__fig figcaption, .studio__fig figcaption { margin-top: 12px; font-size: 14px; color: var(--ailo-muted); display: flex; gap: 12px; }
.hero__fig figcaption span { font-family: var(--a02-serif); font-size: 15px; color: var(--ailo-fg); }
/* 이미지 클립 리빌 (AOS 커스텀) */
[data-aos="a02-reveal"] { clip-path: inset(0 0 100% 0); transition-property: clip-path; }
[data-aos="a02-reveal"].aos-animate { clip-path: inset(0 0 0 0); }

/* ---------- Facts ---------- */
.facts { padding: 0 var(--a02-pad); }
.facts__row { display: grid; grid-template-columns: repeat(4, 1fr); border-block: 1px solid var(--ailo-fg); margin: 0; }
.facts__row > div { padding: 28px 24px 26px 0; border-right: 1px solid var(--ailo-line); }
.facts__row > div + div { padding-left: 24px; }
.facts__row > div:last-child { border-right: 0; }
.facts dt { font-family: var(--a02-ko); font-size: 14px; font-weight: 500; color: var(--ailo-muted); }
.facts dd { margin: 10px 0 0; font-family: var(--a02-serif); font-size: clamp(48px, 5.4vw, 88px); line-height: 1; letter-spacing: -.02em; }

/* ---------- Works (masonry) ---------- */
.works, .studio, .services, .process, .journal { padding: var(--a02-sec) var(--a02-pad) 0; }
.filter { display: flex; flex-wrap: wrap; gap: 4px 22px; justify-content: flex-end; }
.filter button { background: none; border: 0; padding: 4px 0; font-family: var(--a02-ko); font-size: 15px; color: var(--ailo-muted); position: relative; transition: color .2s; }
.filter button sup { font-family: var(--a02-serif); font-size: 14px; margin-left: 2px; }
.filter button::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--ailo-fg); transform: scaleX(0); transition: transform .3s var(--ailo-ease); }
.filter button:hover { color: var(--ailo-fg); }
.filter button.is-on { color: var(--ailo-fg); font-weight: 700; }
.filter button.is-on::after { transform: scaleX(1); }
.mason { columns: 3; column-gap: clamp(18px, 2.4vw, 40px); }
.wk { break-inside: avoid; margin-bottom: clamp(28px, 3.4vw, 52px); }
.wk[hidden] { display: none; }
.wk.is-in { animation: a02-in .7s var(--ailo-ease); }
@keyframes a02-in { from { opacity: 0; translate: 0 18px; } }
.wk a { display: block; }
.wk__img { overflow: hidden; background: #e2e0db; }
.wk__img img { height: auto; filter: grayscale(1) contrast(1.05); transition: filter .6s var(--ailo-ease), transform 1s var(--ailo-ease); }
.wk a:hover .wk__img img, .wk a:focus-visible .wk__img img { filter: grayscale(0); transform: scale(1.03); }
.wk__cap { display: grid; grid-template-columns: 44px 1fr; column-gap: 8px; padding-top: 14px; }
.wk__cap span { font-family: var(--a02-serif); font-size: 15px; color: var(--ailo-muted); grid-row: span 2; }
.wk__cap h3 { font-family: var(--a02-ko); font-size: 17px; font-weight: 500; letter-spacing: -.03em; }
.wk__cap p { font-size: 14px; color: var(--ailo-muted); margin-top: 2px; }
.wk a:hover h3 { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }

/* ---------- Studio ---------- */
.studio__body { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 5vw, 80px); }
.studio__lead { font-family: var(--a02-ko); font-weight: 200; font-size: clamp(26px, 3vw, 46px); line-height: 1.4; letter-spacing: -.05em; }
.studio__lead b { font-weight: 500; }
.principles li { display: grid; grid-template-columns: 48px 1fr; padding: 22px 0; border-top: 1px solid var(--ailo-line); }
.principles li:last-child { border-bottom: 1px solid var(--ailo-line); }
.principles span { font-family: var(--a02-serif); font-style: italic; font-size: 22px; grid-row: span 2; line-height: 1.2; }
.principles h3 { font-family: var(--a02-ko); font-size: 19px; font-weight: 500; letter-spacing: -.03em; }
.principles p { color: var(--ailo-muted); font-size: 16px; margin-top: 4px; }
.studio__fig { grid-column: 1 / -1; }
.studio__fig img { aspect-ratio: 2 / 1; height: auto; }

/* ---------- Services ---------- */
.svc { display: grid; grid-template-columns: repeat(3, 1fr); border-left: 1px solid var(--ailo-line); }
.svc li { padding: 32px 28px 40px; border-right: 1px solid var(--ailo-line); border-bottom: 1px solid var(--ailo-line); position: relative; transition: background .35s, color .35s; min-height: 240px; display: flex; flex-direction: column; }
.svc li:nth-child(-n+3) { border-top: 1px solid var(--ailo-line); }
.svc__en { font-family: var(--a02-serif); font-style: italic; font-size: 20px; color: var(--ailo-muted); transition: color .35s; }
.svc h3 { margin-top: auto; font-family: var(--a02-ko); font-weight: 300; font-size: clamp(24px, 2.2vw, 32px); letter-spacing: -.05em; }
.svc p { margin-top: 8px; font-size: 16px; color: var(--ailo-muted); transition: color .35s; }
.svc li:hover { background: var(--ailo-fg); color: #fff; }
.svc li:hover .svc__en, .svc li:hover p { color: #bdbab3; }

/* ---------- Process table ---------- */
.process .sec-h, .journal .sec-h { border-bottom: 0; padding-bottom: 0; }
.ptable { border-top: 1px solid var(--ailo-fg); }
.ptable__row { display: grid; grid-template-columns: 1.1fr 2.4fr .7fr 1.1fr; gap: 24px; padding: 24px 0; border-bottom: 1px solid var(--ailo-line); align-items: baseline; transition: background .3s, padding .3s; }
.ptable__row:not(.ptable__row--head):hover { background: #efede8; padding-inline: 14px; }
.ptable__row--head { padding: 12px 0; font-size: 13px; letter-spacing: .08em; color: var(--ailo-muted); }
.ptable__row span:first-child { font-family: var(--a02-ko); font-size: 20px; font-weight: 500; letter-spacing: -.03em; display: flex; gap: 14px; align-items: baseline; }
.ptable__row--head span:first-child { font-size: 14px; font-weight: 400; }
.ptable__row b { font-family: var(--a02-serif); font-weight: 400; font-size: 26px; }
.ptable__row span:nth-child(2) { color: #3b3a37; font-size: 16px; }
.ptable__row span:nth-child(3) { font-family: var(--a02-serif); font-size: 20px; }
.ptable__row span:nth-child(4) { font-size: 14px; color: var(--ailo-muted); }
.ptable__row--head span { color: var(--ailo-muted) !important; font-family: var(--a02-ko) !important; font-size: 14px !important; }

/* ---------- Journal ---------- */
.jn { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(16px, 2vw, 32px); }
.jn a { display: flex; flex-direction: column; height: 100%; padding-top: 18px; border-top: 1px solid var(--ailo-fg); }
.jn time { font-family: var(--a02-serif); font-size: 17px; }
.jn__tag { font-size: 14px; color: var(--ailo-muted); margin-top: 4px; }
.jn h3 { margin-top: 28px; font-family: var(--a02-ko); font-weight: 400; font-size: clamp(18px, 1.5vw, 22px); line-height: 1.45; letter-spacing: -.04em; transition: font-weight .2s; }
.jn a:hover h3 { text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 1px; }
.clients { margin-top: clamp(64px, 8vw, 120px); display: grid; grid-template-columns: 200px 1fr; gap: 24px; padding-block: 28px; border-block: 1px solid var(--ailo-line); align-items: baseline; }
.clients__k { font-family: var(--a02-serif); font-style: italic; font-size: 20px; }
.clients__list { display: flex; flex-wrap: wrap; gap: 10px 0; }
.clients__list li { font-family: var(--a02-ko); font-weight: 400; font-size: clamp(18px, 1.6vw, 24px); color: #44423e; letter-spacing: -.04em; }
.clients__list li:not(:last-child)::after { content: "/"; margin: 0 16px; color: #bdbab3; font-weight: 200; }

/* ---------- Commission ---------- */
.commission { padding: var(--a02-sec) var(--a02-pad); }
.commission__in { display: grid; grid-template-columns: 1fr 1.25fr; gap: clamp(40px, 6vw, 110px); background: var(--ailo-fg); color: #f2f1ee; padding: clamp(32px, 5vw, 80px); }
.commission .sec-h__no { color: #8d8a83; margin-bottom: 18px; }
.commission__t { font-family: var(--a02-serif); font-weight: 400; font-size: clamp(48px, 6vw, 96px); line-height: .92; letter-spacing: -.02em; }
.commission__d { margin-top: 26px; color: #bdbab3; font-size: 16px; line-height: 1.85; max-width: 440px; }
.commission__info { margin: 36px 0 0; }
.commission__info div { display: grid; grid-template-columns: 70px 1fr; padding: 12px 0; border-top: 1px solid rgba(255, 255, 255, .15); font-size: 14.5px; }
.commission__info dt { font-family: var(--a02-serif); font-style: italic; font-weight: 400; font-size: 17px; color: #8d8a83; }
.commission__info dd { margin: 0; overflow-wrap: anywhere; }
.cform { display: grid; grid-template-columns: 1fr 1fr; gap: 26px 28px; align-content: start; }
.cf { display: flex; flex-direction: column; min-width: 0; }
.cf--full { grid-column: 1 / -1; }
.cf label { font-size: 13px; letter-spacing: .04em; color: #8d8a83; }
.cf input, .cf select, .cf textarea {
  background: transparent; border: 0; border-bottom: 1px solid rgba(255, 255, 255, .3); color: #fff; padding: 10px 0 12px; font: inherit; font-size: 16px; border-radius: 0; width: 100%;
  transition: border-color .25s;
}
.cf select { appearance: none; background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23bbb'/%3E%3C/svg%3E") no-repeat right 4px center; }
.cf select option { color: #111; }
.cf input::placeholder, .cf textarea::placeholder { color: #66645f; }
.cf input:focus, .cf select:focus, .cf textarea:focus { outline: none; border-bottom-color: #fff; }
.cf textarea { resize: vertical; }
.cf-agree { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; color: #bdbab3; cursor: pointer; }
.cf-agree input { width: 18px; height: 18px; accent-color: #fff; margin-top: 2px; flex: none; }
.cf-agree a { color: #fff; text-decoration: underline; }
.commission :focus-visible { outline-color: #fff; }
.cform__btn { grid-column: 1 / -1; justify-self: start; display: inline-flex; align-items: center; gap: 18px; height: 58px; padding: 0 30px; background: #f2f1ee; color: #0f0f0f; border: 1px solid #f2f1ee; font-size: 16px; font-weight: 500; transition: background .25s, color .25s, gap .25s; }
.cform__btn:hover { background: transparent; color: #fff; gap: 26px; }

/* ---------- Footer ---------- */
.ft { padding: 0 var(--a02-pad) 32px; }
.ft__big { font-family: var(--a02-serif); font-size: clamp(76px, 15vw, 260px); line-height: .85; letter-spacing: -.04em; padding-bottom: 20px; border-bottom: 1px solid var(--ailo-fg); white-space: nowrap; }
.ft__row { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; padding-top: 24px; }
.ft__info { font-size: 15px; color: var(--ailo-muted); line-height: 1.85; }
.ft__nav { display: flex; gap: 22px; font-size: 14px; }
.ft__nav a:hover { text-decoration: underline; text-underline-offset: 4px; }
.ft__copy { margin-top: 20px; font-size: 14px; color: var(--ailo-muted); }

/* ---------- 반응형 ---------- */
@media (max-width: 1199.98px) {
  .mason { columns: 2; }
  .jn { grid-template-columns: repeat(2, 1fr); row-gap: 40px; }
  .ptable__row { grid-template-columns: 1fr 2fr .8fr; }
  .ptable__row span:nth-child(4) { grid-column: 2 / -1; margin-top: -14px; }
  .ptable__row--head span:nth-child(4) { display: none; }
}
@media (max-width: 991.98px) {
  .rail { bottom: auto; width: 100%; height: var(--ailo-header-h); flex-direction: row; align-items: center; padding: 0 12px 0 20px; border-right: 0; border-bottom: 1px solid transparent; transition: border-color .3s; }
  .rail.is-scrolled { border-bottom-color: var(--ailo-line); }
  .rail__logo { flex-direction: row; align-items: center; gap: 12px; }
  .rail__mark { width: 30px; height: 30px; }
  .rail__name { font-size: 24px; }
  .rail__name small { display: none; }
  .rail__nav, .rail__foot { display: none; }
  .rail .ailo-burger { position: static; margin-left: auto; }
  main, .ft { margin-left: 0; }
  main { padding-top: var(--ailo-header-h); }
  .hero { grid-template-columns: 1fr; min-height: auto; padding-top: 40px; }
  .hero__fig img { max-height: none; aspect-ratio: 4 / 5; }
  .hero__grid { grid-template-columns: repeat(2, 1fr); }
  .facts__row { grid-template-columns: repeat(2, 1fr); }
  .facts__row > div { padding: 22px 16px 22px 0 !important; }
  .facts__row > div:nth-child(even) { padding-left: 16px !important; border-right: 0; }
  .facts__row > div:nth-child(-n+2) { border-bottom: 1px solid var(--ailo-line); }
  .studio__body, .commission__in { grid-template-columns: 1fr; }
  .svc { grid-template-columns: repeat(2, 1fr); }
  .svc li:nth-child(3) { border-top: 0; }
  .clients { grid-template-columns: 1fr; }
}
@media (max-width: 575.98px) {
  .sec-h { grid-template-columns: 1fr; gap: 10px; }
  .sec-h__no { font-size: 16px; }
  .filter { justify-content: flex-start; gap: 4px 18px; margin-top: 6px; }
  .mason { columns: 1; }
  .hero__en { font-size: clamp(54px, 16vw, 72px); }
  .svc { grid-template-columns: 1fr; }
  .svc li { min-height: 0; padding: 24px 20px 28px; }
  .svc li:nth-child(2) { border-top: 0; }
  .svc h3 { margin-top: 20px; }
  .ptable__row--head { display: none; }
  .ptable__row { grid-template-columns: 1fr auto; gap: 8px 16px; }
  .ptable__row span:nth-child(2) { grid-column: 1 / -1; grid-row: 2; }
  .ptable__row span:nth-child(3) { grid-row: 1; grid-column: 2; }
  .ptable__row span:nth-child(4) { grid-column: 1 / -1; margin-top: 0; }
  .jn { grid-template-columns: 1fr; row-gap: 28px; }
  .jn h3 { margin-top: 14px; }
  .clients__list li:not(:last-child)::after { margin: 0 10px; }
  .commission { padding-inline: 0; }
  .commission__in { padding: 48px 20px; }
  .cform { grid-template-columns: 1fr; gap: 22px; }
  .cform__btn { justify-self: stretch; justify-content: space-between; }
  .ft__big { font-size: clamp(60px, 19vw, 90px); }
}
