/* 무연건축 — site styles */
:root {
  --ground: #F2F1EE;
  --ink: #111111;
  --muted: #5F5D58;
  --line: #111111;
  --ph: #E2E0DA;
  --accent: #B4441B;
  --gutter: clamp(16px, 4vw, 56px);
  --max: 1440px;
  --sans: 'Noto Sans KR', system-ui, -apple-system, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ground); color: var(--ink); font-family: var(--sans); font-weight: 400; line-height: 1.6; word-break: keep-all; overflow-wrap: break-word; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
.mono { font-family: var(--mono); letter-spacing: 0.04em; }
.muted { color: var(--muted); }
.accent { color: var(--accent); }
.small { font-size: 12px; }
.wrap { max-width: var(--max); margin: 0 auto; padding-inline: var(--gutter); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--ground); padding: 8px 12px; z-index: 100; }
.skip:focus { left: 8px; }

/* header */
.site-header { background: var(--ground); }
.header-inner { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 48px; padding-top: clamp(24px, 4vw, 56px); padding-bottom: clamp(20px, 3vw, 40px); }
/* logo: square + circle + wordmark. Size is set by --h (height of the mark). */
.logo { --h: 36px; display: inline-flex; align-items: center; gap: calc(var(--h) * 0.3); color: var(--ink); }
.logo-mark { height: var(--h); width: auto; flex: 0 0 auto; display: block; fill: currentColor; }
.logo-type { display: flex; flex-direction: column; justify-content: space-between; height: calc(var(--h) * 0.9); font-family: 'Jost', var(--sans); font-weight: 400; font-size: calc(var(--h) * 0.34); line-height: 0.8; letter-spacing: 0.12em; white-space: nowrap; align-items: flex-start; }
/* MOOYEON is set larger so both lines end at the same width (refined by site.js once the font loads) */
.logo-type > span:first-child { font-size: 1.2em; }
.brand { display: inline-flex; min-height: 44px; align-items: center; }
.brand:hover .logo { color: var(--ink); }
.brand .logo { --h: clamp(44px, 4.6vw, 66px); }
.nav { display: flex; flex-wrap: wrap; gap: 0 clamp(24px, 5vw, 72px); font-family: 'Jost', var(--sans); font-size: clamp(14px, 1.2vw, 17px); letter-spacing: 0.1em; margin-bottom: -10px; }
.nav a { display: inline-flex; align-items: center; min-height: 44px; }
.nav a[aria-current="page"] { color: var(--accent); }

/* hero */
.hero { padding-top: 0; }
.hero-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 32px; border-bottom: 1px solid var(--line); padding-bottom: 32px; }
.hero-title { margin: 0; }
.hero-title .logo { --h: clamp(64px, 12vw, 176px); }
.hero-side { display: flex; flex-direction: column; gap: 10px; max-width: 360px; padding-bottom: 8px; }
.hero-side p:first-child { font-size: 18px; }
.slider { position: relative; display: grid; }
.slide { margin: 0; grid-area: 1 / 1; opacity: 0; visibility: hidden; transition: opacity 2s ease-in-out, visibility 0s linear 2s; }
.slide.is-active { opacity: 1; visibility: visible; transition: opacity 2s ease-in-out, visibility 0s; }
/* hero: whole photo, never cropped — letterboxed on the ground colour */
.slide a { display: flex; align-items: center; justify-content: center; height: clamp(260px, 62vw, 820px); max-height: 74vh; }
.slide img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.hero-caption { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px 32px; padding: 14px 0 0; }
.slide-label { font-size: 12px; min-height: 1em; }
.hero-office { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; margin-left: auto; }
.hero-office-name { font-size: clamp(18px, 1.8vw, 26px); font-weight: 300; letter-spacing: 0.04em; }
.hero-office-info { display: flex; flex-direction: column; font-size: 12px; line-height: 1.5; color: var(--muted); letter-spacing: 0.06em; }
@keyframes fade { from { opacity: 0.2; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .slide, .slide.is-active { transition: none; } html { scroll-behavior: auto; } }
.slide-label { transition: opacity 0.6s ease; }
.slide-label.is-changing { opacity: 0; }

/* sections */
.section { padding-top: clamp(72px, 9vw, 128px); }
.section-tight { padding-top: clamp(48px, 6vw, 88px); }
.section-tight.last, .section:last-child { padding-bottom: clamp(72px, 9vw, 128px); }
.home .section:last-child { padding-bottom: clamp(72px, 9vw, 128px); }
.section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 12px 24px; margin-bottom: 40px; }
h2, .h2 { font-size: clamp(28px, 3.4vw, 48px); font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 40px; }
.split.rule { border-top: 1px solid var(--line); padding-top: 32px; }
@media (max-width: 760px) { .split { grid-template-columns: minmax(0, 1fr); gap: 24px; } }

/* project grid */
/* justified rows: every photo keeps its own proportion, rows share one height.
   --r = width / height of the photo (set at build time, corrected by JS on load). */
.jrow { --row: 300px; display: flex; flex-wrap: wrap; gap: 56px 28px; align-items: flex-start; }
.jrow::after { content: ""; flex: 10000 1 0; }
.jrow > * { --r: 1.333; flex: var(--r) 1 calc(var(--r) * var(--row)); min-width: 0; max-width: 100%; }
@media (max-width: 760px) { .jrow { --row: 220px; gap: 40px 16px; } }
.card { display: flex; flex-direction: column; gap: 14px; }
.card-img { position: relative; aspect-ratio: var(--r); overflow: hidden; background: var(--ph); }
.card-img img { width: 100%; height: 100%; object-fit: contain; transition: opacity 0.9s ease, transform 0.9s cubic-bezier(.2,.7,.2,1); }
.card:hover .card-img img, .card:focus-visible .card-img img { transform: scale(1.04); }
/* 마우스를 올리면 흑백 대표 사진 위로 같은 컷의 컬러 사진이 서서히 나타남 */
.card-img img.hover { position: absolute; inset: 0; opacity: 0; }
.card:hover .card-img img.hover, .card:focus-visible .card-img img.hover { opacity: 1; }
.tag { position: absolute; top: 14px; left: 16px; font-family: var(--sans); font-size: 14px; font-weight: 400; color: #FFFFFF; text-shadow: 0 0 10px rgba(0, 0, 0, 0.7), 0 1px 3px rgba(0, 0, 0, 0.55); pointer-events: none; }
.card-text { display: flex; flex-direction: column; gap: 6px; border-top: 1px solid var(--line); padding-top: 12px; }
.card-title { font-size: 19px; font-weight: 500; line-height: 1.4; }
.card-loc { font-family: var(--sans); font-size: 13px; font-weight: 300; color: var(--muted); letter-spacing: 0; }
.ph { width: 100%; height: 100%; background-image: repeating-linear-gradient(135deg, rgba(17,17,17,0.09) 0 1px, transparent 1px 11px); }

/* text */
.quote { font-size: clamp(26px, 3vw, 40px); font-weight: 700; letter-spacing: -0.01em; line-height: 1.3; margin-bottom: 20px; }
.lead { font-size: clamp(19px, 2vw, 26px); font-weight: 300; line-height: 1.6; }
.more { display: inline-flex; align-items: center; min-height: 44px; margin-top: 16px; font-size: 13px; border-bottom: 1px solid var(--accent); }
.prose { display: flex; flex-direction: column; gap: 1.1em; font-size: 17px; line-height: 1.85; max-width: 760px; }
.sign { font-weight: 500; letter-spacing: 0.2em; }
.poem { font-size: clamp(17px, 1.6vw, 20px); font-weight: 300; line-height: 2; margin-bottom: 40px; padding-left: 20px; border-left: 2px solid var(--accent); }
/* 시: 한 줄씩 블록으로, 줄이 넘치면 들여쓰기로 이어짐 */
.poem .pl { display: block; padding-left: 1em; text-indent: -1em; }
@media (max-width: 760px) {
  .poem { font-size: clamp(13px, 3.6vw, 17px); line-height: 1.9; padding-left: 14px; letter-spacing: -0.02em; margin-bottom: 32px; }
  .prose { font-size: 15px; line-height: 1.8; }
  .quote { font-size: 24px; }
}
.sub { display: flex; flex-direction: column; gap: 8px; }
.sub + .sub { margin-top: 16px; }
.sub h3 { font-size: 18px; font-weight: 700; }

/* page head */
.page-head { padding-top: clamp(40px, 6vw, 80px); padding-bottom: 8px; display: flex; flex-direction: column; gap: 14px; }
.page-head h1 { font-size: clamp(36px, 6vw, 88px); line-height: 1.02; font-weight: 700; letter-spacing: -0.03em; }
.back { display: inline-flex; align-items: center; min-height: 44px; color: var(--muted); align-self: flex-start; }
.proj-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px 32px; padding-bottom: 28px; border-bottom: 1px solid var(--line); }
.proj-head > div { display: flex; flex-direction: column; gap: 12px; }
.proj-cover-wrap { display: flex; justify-content: center; padding-top: 32px; }
.proj-cover { --r: 1.333; display: block; width: min(100%, calc(82vh * var(--r))); height: auto; aspect-ratio: var(--r); object-fit: cover; }

/* facts */
.facts { margin: 0; display: flex; flex-direction: column; }
.facts > div { display: flex; justify-content: space-between; gap: 16px; border-top: 1px solid var(--line); padding: 13px 0; }
.facts > div:last-child { border-bottom: 1px solid var(--line); }
.facts dt { font-size: 12px; color: var(--muted); flex: 0 0 auto; padding-top: 2px; }
.facts dd { margin: 0; font-size: 15px; text-align: right; }

/* about */
.ceo { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; }
.ceo-photo { width: min(320px, 100%); aspect-ratio: 4 / 5; object-fit: cover; }
.ceo-name { font-size: 28px; font-weight: 700; letter-spacing: 0.1em; margin-bottom: 6px; }
.career { list-style: none; padding: 0; margin: 28px 0 0; }
.career li { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 16px; border-top: 1px solid var(--line); padding: 12px 0; font-size: 15px; }
.career li:last-child { border-bottom: 1px solid var(--line); }
.career .mono { font-size: 13px; color: var(--muted); padding-top: 1px; }
.works { list-style: none; padding: 0; margin: 0; columns: 2 280px; column-gap: 40px; counter-reset: w; }
.works li { break-inside: avoid; border-top: 1px solid rgba(17,17,17,0.18); padding: 10px 0; font-size: 15px; counter-increment: w; display: flex; gap: 14px; }
.works li::before { content: counter(w, decimal-leading-zero); font-family: var(--mono); font-size: 12px; color: var(--muted); padding-top: 2px; }

/* contact */
.contact { display: flex; flex-direction: column; gap: 40px; }
.contact-mail { font-size: clamp(22px, 3.4vw, 48px); font-weight: 500; letter-spacing: -0.01em; border-bottom: 2px solid var(--accent); align-self: flex-start; padding-bottom: 4px; overflow-wrap: anywhere; }
.notice { border: 1px solid var(--line); padding: 20px 24px; display: flex; flex-direction: column; gap: 6px; }

/* gallery */
.gallery.jrow { --row: 380px; gap: 20px; }
@media (max-width: 760px) { .gallery.jrow { --row: 240px; gap: 12px; } }
.g-item { all: unset; box-sizing: border-box; cursor: zoom-in; display: block; aspect-ratio: var(--r); background: var(--ph); overflow: hidden; flex: var(--r) 1 calc(var(--r) * var(--row)); min-width: 0; max-width: 100%; }
.g-item:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.g-item img { width: 100%; height: 100%; object-fit: contain; transition: transform 0.9s cubic-bezier(.2,.7,.2,1); }
.g-item:hover img, .g-item:focus-visible img { transform: scale(1.04); }
@media (prefers-reduced-motion: reduce) { .card-img img, .g-item img { transition: opacity 0.9s ease; } .card:hover .card-img img, .g-item:hover img { transform: none; } }
@media (max-width: 760px) { .gallery { grid-template-columns: minmax(0, 1fr); gap: 16px; } }
.video { position: relative; aspect-ratio: 16 / 9; background: var(--ink); }
.video iframe, .video video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* lightbox */
.lightbox { border: 0; padding: 0; margin: 0; width: 100vw; height: 100vh; max-width: none; max-height: none; background: rgba(17,17,17,0.96); color: var(--ground); }
.lightbox::backdrop { background: rgba(17,17,17,0.96); }
.lightbox[open] { display: flex; align-items: center; justify-content: center; }
.lightbox img { max-width: calc(100vw - 140px); max-height: calc(100vh - 120px); object-fit: contain; }
.lightbox button { position: absolute; background: none; border: 0; color: var(--ground); cursor: pointer; min-width: 44px; min-height: 44px; font-size: 13px; }
.lb-close { top: 16px; right: 20px; letter-spacing: 0.08em; }
.lb-prev, .lb-next { top: 50%; transform: translateY(-50%); font-size: 28px !important; padding: 0 16px; }
.lb-prev { left: 8px; } .lb-next { right: 8px; }
.lightbox button:hover { color: #E8A07F; }
@media (max-width: 760px) { .lightbox img { max-width: 100vw; } }

/* project nav */
.proj-nav { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; padding-top: clamp(64px, 8vw, 112px); padding-bottom: clamp(64px, 8vw, 112px); }
.proj-nav a { display: flex; flex-direction: column; gap: 6px; border-top: 1px solid var(--line); padding-top: 16px; min-width: min(100%, 320px); font-size: 19px; font-weight: 500; }
.proj-nav a.right { align-items: flex-end; text-align: right; margin-left: auto; }

/* footer */
.site-footer { background: var(--ink); color: var(--ground); }
.site-footer a:hover { color: #E8A07F; }
.footer-inner { padding-block: 40px; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 24px; }
.footer-mark { display: block; line-height: 1; }
.footer-info { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: #BDBAB2; }

/* added: screen-reader text, footer logo */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.footer-mark .logo { --h: 40px; color: var(--ground); }

/* home: logo + menu + slideshow only, fits one screen */
.home .hero { padding-bottom: clamp(20px, 3vw, 40px); }
.home .slide a { height: calc(100svh - 270px); min-height: 260px; max-height: none; }
@media (max-width: 760px) { .home .slide a { height: auto; min-height: 0; } .home .slide img { max-height: 70svh; } }

/* hero photo whose proportion is close to the frame: fill the frame edge to edge,
   aligned with the logo (left) and the menu (right). Very different proportions stay whole. */
.slide img.is-fill { width: 100%; height: 100%; max-width: none; max-height: none; object-fit: cover; }

.slide img.is-tall { height: 100%; width: auto; max-height: none; }

/* projects list: tidy square grid */
.grid.square { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 56px 28px; }
.grid.square .card-img { aspect-ratio: 1 / 1; }
.grid.square .card-img img { object-fit: cover; }
@media (max-width: 760px) { .grid.square { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 12px; } .grid.square .card-title { font-size: 15px; } }

/* copied-to-clipboard notice */
.toast { position: fixed; left: 50%; bottom: 32px; transform: translate(-50%, 12px); background: var(--ink); color: var(--ground); font-size: 14px; padding: 12px 20px; opacity: 0; pointer-events: none; transition: opacity 0.3s ease, transform 0.3s ease; z-index: 50; }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* page transitions: the clicked project photo grows into the detail page's cover photo
   (cross-document View Transitions; browsers without support get a soft fade instead) */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 0.45s; animation-timing-function: ease; }
::view-transition-group(*) { animation-duration: 0.7s; animation-timing-function: cubic-bezier(.2, .7, .2, 1); }
::view-transition-old(*):only-child, ::view-transition-new(*):only-child { animation-duration: 0.45s; }
/* square thumbnail ↔ full-ratio cover: keep both snapshots filling the moving frame so they line up */
::view-transition-old(*), ::view-transition-new(*) { height: 100%; width: 100%; object-fit: cover; overflow: clip; }
@supports not (view-transition-name: none) {
  main { animation: page-in 0.5s ease both; }
  @keyframes page-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
}
@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  main { animation: none !important; }
}

/* Home intro · 조리개 — ivory square and circle on black; the square grows to fill the screen, then the site fades in */
html.intro-on::after { content: ""; position: fixed; inset: 0; background: #111; z-index: 1000; animation: intro-safety 0.3s 4s forwards; }
@keyframes intro-safety { to { opacity: 0; visibility: hidden; } }
.intro-c { position: fixed; inset: 0; z-index: 1001; cursor: pointer; background: #111; }
.intro-c svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.intro-c .intro-cap { position: absolute; left: 0; right: 0; text-align: center; font-family: 'Jost', sans-serif; color: var(--ground); letter-spacing: 0.42em; padding-left: 0.42em; opacity: 0; white-space: nowrap; }
