/* ==========================================================================
   STUDIO GYEOL — Design System
   그누보드5 테마 이식 시:
   - :root 토큰과 base/utility 블록은 theme 공통 css(예: css/common.css)로
   - 섹션별 블록은 각 콘텐츠 include에 필요한 만큼만 분리해서 옮기면 됩니다.
   ========================================================================== */

@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/variable/pretendardvariable.css');

:root {
  /* Color: 오프화이트 + 잉크블랙 뉴트럴, 단일 포인트 컬러(딥 파인그린) */
  --paper: #f2f0ea;
  --paper-deep: #e7e3d9;
  --ink: #16171a;
  --ink-soft: #53555b;
  --ink-faint: #8a8c90;
  --line: rgba(22, 23, 26, 0.12);
  --line-on-dark: rgba(244, 243, 239, 0.16);
  --dark: #101113;
  --dark-2: #1a1c1f;
  --on-dark: #f4f3ef;
  --on-dark-soft: #b7b8ba;
  --accent: #1f3d2f;
  --accent-hover: #2b5641;
  --on-accent: #f4f3ef;

  /* Type */
  --font: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, 'Malgun Gothic', sans-serif;

  /* Shape: 카드/이미지/인풋은 각(0), 버튼만 필(pill) — 문서화된 이중 규칙 */
  --radius-sharp: 0px;
  --radius-pill: 999px;

  /* Layout */
  --container: 1280px;
  --edge: clamp(1.25rem, 4vw, 3rem);
  --nav-h: 76px;

  /* Motion */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
body {
  margin: 0;
  font-family: var(--font);
  background: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
ul { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, p { margin: 0; }
::selection { background: var(--accent); color: var(--on-accent); }

.container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--edge);
}

.section {
  padding-block: clamp(4.5rem, 9vw, 8rem);
}

.eyebrow {
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: 600;
}

.headline {
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.headline--section {
  font-size: clamp(1.75rem, 1.2rem + 2.4vw, 2.75rem);
  max-width: 18ch;
}

.body-copy {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--ink-soft);
  max-width: 62ch;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
  border-radius: var(--radius-pill);
  padding: 0.9rem 1.75rem;
  font-size: 0.95rem;
  font-weight: 600;
  border: 1px solid transparent;
  transition: transform 0.35s var(--ease), background-color 0.35s var(--ease), border-color 0.35s var(--ease), color 0.35s var(--ease);
}
.btn:active { transform: scale(0.98); }

.btn--primary {
  background: var(--accent);
  color: var(--on-accent);
}
.btn--primary:hover { background: var(--accent-hover); }

.btn--ghost-light {
  background: transparent;
  border-color: rgba(244, 243, 239, 0.55);
  color: var(--on-dark);
}
.btn--ghost-light:hover { border-color: var(--on-dark); background: rgba(244, 243, 239, 0.1); }

.btn--outline {
  background: transparent;
  border-color: var(--ink);
  color: var(--ink);
}
.btn--outline:hover { background: var(--ink); color: var(--paper); }

/* ---------- Nav ---------- */
.nav {
  position: fixed;
  inset-inline: 0;
  top: 0;
  z-index: 60;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  transition: background-color 0.45s var(--ease), border-color 0.45s var(--ease), box-shadow 0.45s var(--ease);
  border-bottom: 1px solid transparent;
}
.nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}
.nav__logo {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--on-dark);
  transition: color 0.45s var(--ease);
}
.nav__links {
  display: flex;
  align-items: center;
}
/* .nav__menu: 그누보드5 메뉴 출력이 채워질 자리. ul/li 구조를 유지하면
   메뉴 항목 수가 늘어나도(드롭다운 없는 1뎁스 기준) 자동으로 정렬됩니다. */
.nav__menu {
  display: flex;
  align-items: center;
  gap: 2.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav__menu a {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--on-dark-soft);
  transition: color 0.3s var(--ease);
}
.nav__menu a:hover { color: var(--on-dark); }
.nav__right { display: flex; align-items: center; gap: 1.5rem; }
.nav__toggle {
  display: none;
  background: none;
  border: none;
  color: var(--on-dark);
  font-size: 1.5rem;
  line-height: 0;
}

.nav.is-scrolled {
  background: rgba(242, 240, 234, 0.86);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom-color: var(--line);
  box-shadow: 0 1px 0 rgba(0,0,0,0.02);
}
.nav.is-scrolled .nav__logo,
.nav.is-scrolled .nav__menu a:hover { color: var(--ink); }
.nav.is-scrolled .nav__menu a { color: var(--ink-soft); }
.nav.is-scrolled .nav__toggle { color: var(--ink); }
.nav.is-scrolled .btn--ghost-light {
  border-color: var(--line);
  color: var(--ink);
}
.nav.is-scrolled .btn--ghost-light:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }

@media (max-width: 860px) {
  .nav__links { display: none; }
  .nav__toggle { display: block; }
}

/* ---------- Hero (Video / Media Mask) ---------- */
.hero {
  position: relative;
  min-height: 100dvh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  background: var(--dark);
}
.hero__media {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero__media video,
.hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero__scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(16,17,19,0.55) 0%, rgba(16,17,19,0.05) 32%, rgba(16,17,19,0.15) 55%, rgba(16,17,19,0.86) 100%);
}
.hero__content {
  position: relative;
  z-index: 2;
  width: 100%;
  padding-top: 4.5rem; /* Hero top padding cap: pt-24 이하 */
  padding-bottom: clamp(3rem, 8vw, 5.5rem);
}
.hero__body {
  max-width: 640px;
}
.hero__headline {
  color: var(--on-dark);
  font-size: clamp(2.4rem, 1.5rem + 3.4vw, 4rem);
  line-height: 1.18;
}
.hero__sub {
  margin-top: 1.5rem;
  color: var(--on-dark-soft);
  font-size: 1.05rem;
  line-height: 1.6;
  max-width: 46ch;
}
.hero__actions {
  margin-top: 2.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.hero__meta {
  position: absolute;
  right: var(--edge);
  bottom: clamp(3rem, 8vw, 5.5rem);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
  color: var(--on-dark-soft);
  font-size: 0.85rem;
  text-align: right;
}
@media (max-width: 720px) {
  .hero__meta { display: none; }
}

/* ---------- Manifesto (Editorial statement) ---------- */
.manifesto {
  background: var(--paper);
}
.manifesto__inner {
  max-width: 920px;
  margin-inline: auto;
  text-align: left;
}
.manifesto__text {
  font-size: clamp(1.5rem, 1rem + 2.2vw, 2.5rem);
  line-height: 1.45;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.manifesto__text em {
  font-style: normal;
  font-weight: 700;
  color: var(--ink);
  box-shadow: inset 0 -0.32em 0 rgba(31, 61, 47, 0.22);
}
.manifesto__foot {
  margin-top: 2.5rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 2rem;
  flex-wrap: wrap;
}
.manifesto__foot .body-copy { max-width: 42ch; }

/* ---------- Projects (Asymmetric Bento Grid) ---------- */
.projects { background: var(--paper); }
.projects__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 2rem;
  flex-wrap: wrap;
  margin-bottom: clamp(2.5rem, 5vw, 3.5rem);
}
.bento {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-template-areas:
    "a a a a b b"
    "a a a a c c"
    "d d d e e e";
  gap: clamp(0.75rem, 1.6vw, 1.5rem);
}
.bento__item {
  position: relative;
  overflow: hidden;
  background: var(--paper-deep);
}
.bento__item--a { grid-area: a; }
.bento__item--b { grid-area: b; }
.bento__item--c { grid-area: c; }
.bento__item--d { grid-area: d; }
.bento__item--e { grid-area: e; }

.bento__frame { position: relative; height: 100%; aspect-ratio: var(--ar, 4 / 3); overflow: hidden; }
.bento__item--a .bento__frame { aspect-ratio: 16 / 11; }
.bento__item--b .bento__frame,
.bento__item--c .bento__frame { aspect-ratio: 4 / 3; }
.bento__frame img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 1.1s var(--ease);
}
.bento__item:hover .bento__frame img { transform: scale(1.045); }

.bento__cap {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding-top: 0.9rem;
}
.bento__cap-name { font-weight: 600; font-size: 0.98rem; color: var(--ink); }
.bento__cap-meta { font-size: 0.85rem; color: var(--ink-faint); white-space: nowrap; }

@media (max-width: 860px) {
  .bento {
    grid-template-columns: 1fr;
    grid-template-areas:
      "a"
      "b"
      "c"
      "d"
      "e";
  }
}

/* ---------- Process (verb-noun strip, connective line) ---------- */
.process { background: var(--dark); color: var(--on-dark); }
.process__head { max-width: 640px; }
.process__head .headline--section { color: var(--on-dark); }
.process__head .body-copy { color: var(--on-dark-soft); }
.process__row {
  margin-top: clamp(2.5rem, 5vw, 4rem);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  position: relative;
}
.process__row::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 1px;
  background: var(--line-on-dark);
}
.process__step {
  padding: 1.75rem 1.5rem 0 0;
  border-left: 1px solid var(--line-on-dark);
  padding-left: 1.5rem;
}
.process__step:first-child { border-left: none; padding-left: 0; }
.process__step-name { font-size: 1.2rem; font-weight: 700; }
.process__step-desc { margin-top: 0.65rem; font-size: 0.92rem; line-height: 1.6; color: var(--on-dark-soft); max-width: 26ch; }

@media (max-width: 860px) {
  .process__row { grid-template-columns: 1fr; }
  .process__row::before { display: none; }
  .process__step {
    border-left: none;
    padding-left: 1.5rem;
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
    border-top: 1px solid var(--line-on-dark);
    position: relative;
  }
  .process__step:first-child { border-top: none; }
}

/* ---------- Stats band ---------- */
.stats { background: var(--dark); color: var(--on-dark); padding-top: 0; }
.stats__row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line-on-dark);
}
.stats__item {
  padding: clamp(2rem, 4vw, 3rem) 1.5rem clamp(2.5rem, 5vw, 4rem);
  border-left: 1px solid var(--line-on-dark);
}
.stats__item:first-child { border-left: none; }
.stats__num {
  font-size: clamp(2.25rem, 1.4rem + 3vw, 3.75rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}
.stats__label {
  margin-top: 0.75rem;
  font-size: 0.92rem;
  color: var(--on-dark-soft);
}
@media (max-width: 720px) {
  .stats__row { grid-template-columns: 1fr; }
  .stats__item { border-left: none; border-top: 1px solid var(--line-on-dark); }
  .stats__item:first-child { border-top: none; }
}

/* ---------- Testimonials (crossfade carousel) ---------- */
.quote { background: var(--paper); }

.testimonials { max-width: 820px; margin-inline: auto; }
/* 기본값(JS 없음): 슬라이드를 그냥 세로로 쌓지 않고 첫 번째만 노출
   (progressive enhancement, .reveal과 동일한 원칙) */
.testimonial-slide { text-align: left; }
.testimonial-slide + .testimonial-slide { display: none; }

html.has-js .testimonials__track {
  position: relative;
  min-height: clamp(200px, 24vw, 260px);
}
html.has-js .testimonial-slide {
  display: block;
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.6s var(--ease);
}
html.has-js .testimonial-slide.is-visible {
  opacity: 1;
  visibility: visible;
}
@media (prefers-reduced-motion: reduce) {
  html.has-js .testimonial-slide { transition: none; }
}

.testimonials__controls {
  margin-top: 1.5rem;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
}
html.has-js .testimonials__controls { display: flex; }
.quote-arrow {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--ink);
  font-size: 1.1rem;
  transition: border-color 0.3s var(--ease), background-color 0.3s var(--ease);
}
.quote-arrow:hover { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.quote-arrow:active { transform: scale(0.96); }

.testimonials__dots {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.testimonials__dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--line);
  transition: background-color 0.3s var(--ease), transform 0.3s var(--ease);
}
.testimonials__dot:hover { background: var(--ink-faint); }
.testimonials__dot[aria-current="true"] {
  background: var(--accent);
  transform: scale(1.2);
}

.quote__mark {
  font-size: 3rem;
  color: var(--accent);
  line-height: 1;
  font-weight: 700;
}
.quote__text {
  margin-top: 1rem;
  font-size: clamp(1.35rem, 1rem + 1.4vw, 1.9rem);
  line-height: 1.55;
  font-weight: 600;
  color: var(--ink);
}
.quote__attr {
  margin-top: 1.75rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.92rem;
  color: var(--ink-soft);
}
.quote__attr strong { color: var(--ink); font-weight: 700; }
.quote__attr .dot { width: 4px; height: 4px; border-radius: 50%; background: var(--ink-faint); }

/* ---------- Detail gallery (horizontal pan, pinned) ---------- */
.detailgallery {
  background: var(--paper);
  position: relative;
}
.detailgallery__head {
  max-width: 640px;
  margin-bottom: clamp(2rem, 5vw, 3rem);
}
.pan-wrap { position: relative; overflow: hidden; }
.pan-track {
  display: flex;
  gap: clamp(1rem, 2vw, 2rem);
  will-change: transform;
}
.pan-card {
  position: relative;
  flex: 0 0 auto;
  width: min(72vw, 620px);
  height: min(78vh, 560px);
  overflow: hidden;
  background: var(--paper-deep);
}
.pan-card img { width: 100%; height: 100%; object-fit: cover; }
.pan-card__cap {
  position: absolute;
  left: 1.25rem;
  bottom: 1.25rem;
  color: var(--on-dark);
  font-size: 0.95rem;
  font-weight: 600;
  text-shadow: 0 1px 12px rgba(0,0,0,0.45);
}
/* fallback (reduced motion / no-JS pin): 가로 스크롤 스냅 */
.pan-wrap[data-mode="scroll"] .pan-track {
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 0.5rem;
}
.pan-wrap[data-mode="scroll"] .pan-card { scroll-snap-align: start; }

/* ---------- Contact (headline + real form) ---------- */
.contact { background: var(--dark); color: var(--on-dark); }
.contact__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2.5rem, 6vw, 5rem);
  align-items: start;
}
.contact__headline { color: var(--on-dark); max-width: 20ch; }
.contact__body { margin-top: 1.25rem; color: var(--on-dark-soft); }
.contact__info {
  margin-top: 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  font-size: 0.95rem;
  color: var(--on-dark-soft);
}
.contact__info a:hover { color: var(--on-dark); }

.form-field { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 1.35rem; }
.form-field label { font-size: 0.88rem; font-weight: 600; color: var(--on-dark); }
.form-field input,
.form-field select,
.form-field textarea {
  font-family: inherit;
  font-size: 0.95rem;
  background: rgba(244, 243, 239, 0.06);
  border: 1px solid var(--line-on-dark);
  color: var(--on-dark);
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sharp);
  outline: none;
  transition: border-color 0.3s var(--ease), background-color 0.3s var(--ease);
}
.form-field textarea { resize: vertical; min-height: 110px; }
.form-field input::placeholder,
.form-field textarea::placeholder { color: var(--on-dark-soft); opacity: 0.75; }
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  border-color: var(--on-dark);
  background: rgba(244, 243, 239, 0.1);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.form-consent {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-size: 0.85rem;
  color: var(--on-dark-soft);
  margin-bottom: 1.5rem;
}
.form-consent input { margin-top: 0.2rem; accent-color: var(--accent); }
.form-consent a { text-decoration: underline; color: var(--on-dark); }

@media (max-width: 860px) {
  .contact__grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
}

/* ---------- Footer ---------- */
.footer {
  background: var(--dark);
  color: var(--on-dark-soft);
  border-top: 1px solid var(--line-on-dark);
}
.footer__top {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 2.5rem;
  padding-block: clamp(3rem, 6vw, 4.5rem);
}
.footer__brand { color: var(--on-dark); font-size: 1.15rem; font-weight: 700; }
.footer__desc { margin-top: 1rem; font-size: 0.92rem; line-height: 1.7; max-width: 34ch; }
.footer__social { margin-top: 1.5rem; display: flex; gap: 0.9rem; }
.footer__social a {
  width: 38px; height: 38px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line-on-dark);
  border-radius: var(--radius-pill);
  font-size: 1rem;
  transition: border-color 0.3s var(--ease), color 0.3s var(--ease);
}
.footer__social a:hover { border-color: var(--on-dark); color: var(--on-dark); }
.footer__col-title { color: var(--on-dark); font-size: 0.85rem; font-weight: 600; margin-bottom: 1rem; }
.footer__col a, .footer__col span { display: block; font-size: 0.92rem; margin-bottom: 0.7rem; }
.footer__col a:hover { color: var(--on-dark); }
.footer__bottom {
  border-top: 1px solid var(--line-on-dark);
  padding-block: 1.5rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.82rem;
}

@media (max-width: 860px) {
  .footer__top { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 540px) {
  .footer__top { grid-template-columns: 1fr; }
}

/* ---------- Mobile menu ---------- */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: var(--dark);
  color: var(--on-dark);
  display: flex;
  flex-direction: column;
  padding: 1.5rem var(--edge) 2.5rem;
  -webkit-font-smoothing: antialiased;
  transform: translateY(-100%);
  transition: transform 0.5s var(--ease);
}
.mobile-menu.is-open { transform: translateY(0); }
.mobile-menu__head { display: flex; justify-content: space-between; align-items: center; }
.mobile-menu__close { background: none; border: none; color: var(--on-dark); font-size: 1.5rem; }
.mobile-menu__links { margin-top: 3rem; }
.mobile-menu__menu {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.mobile-menu__menu a { font-size: 1.6rem; font-weight: 600; }
.mobile-menu__cta { margin-top: auto; }

/* ---------- Reveal (IntersectionObserver 기반, whileInView 대체) ----------
   기본값은 항상 보이는 상태(progressive enhancement). JS가 정상 구동될 때만
   html.has-js가 붙어 페이드업 연출이 활성화됩니다. JS가 차단/실패해도
   콘텐츠가 사라지지 않도록 하기 위한 안전장치입니다. */
.reveal { opacity: 1; transform: none; }
html.has-js .reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
html.has-js .reveal.is-visible { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  html.has-js .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------- Grain overlay (fixed, pointer-events:none — 성능 안전) ---------- */
.grain {
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
  opacity: 0.035;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

/* ---------- Skip link (a11y) ---------- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  padding: 0.75rem 1.25rem;
  z-index: 100;
}
.skip-link:focus { left: var(--edge); top: 0.75rem; }
