* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    line-height: 1.5;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch; /* iOS smooth scrolling */
    --vh: 1vh;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* 부드러운 스크롤 애니메이션 */
body {
    scroll-behavior: smooth;
}

@font-face {
    font-family: 'AritaBuri';
    src: url('../fonts/AritaBuriKR-Medium.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
}

@font-face {
    font-family: 'AritaBuri';
    src: url('../fonts/AritaBuriKR-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
}

@font-face {
    font-family: 'Roustel';
    src: url('../fonts/Roustel.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Amandine';
    src: url('../fonts/Amandine_Regular.otf') format('opentype');
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: 'Amandine';
    src: url('../fonts/Amandine_Medium.otf') format('opentype');
    font-weight: 500;
    font-style: normal;
}

@font-face {
    font-family: 'Amandine';
    src: url('../fonts/Amandine_Bold.otf') format('opentype');
    font-weight: 700;
    font-style: normal;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'AritaBuri', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-weight: 500;
    line-height: 1.6;
    color: #333;
    background-color: #e6f3ff;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    position: relative;
    -webkit-overflow-scrolling: touch;
    min-height: 100vh;
}

a {
    color: inherit;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

ul, ol {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

button {
    border: none;
    background: none;
    cursor: pointer;
    font: inherit;
}

input, textarea, select {
    font: inherit;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 8px 12px;
}

table {
    border-collapse: collapse;
    width: 100%;
}

th, td {
    text-align: left;
    padding: 8px;
}

/* Common Slider Styles */
.slider-container,
.hero-slider-container {
    position: relative;
    width: 100%;
    height: 100%;
}

.slider {
    position: relative;
    width: 100%;
    height: 100%;
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

.slide.active {
    opacity: 1;
}

.slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* Slider Navigation */
.slider-nav {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 20px;
    width: 400px;
}

.slider-buttons {
    display: flex;
    gap: 15px;
}

.slider-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.7;
}

.slider-btn:hover {
    opacity: 1;
}

/* Progress Bar */
.progress-container {
    width: 100%;
    max-width: 600px;
    height: 2px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 1px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: white;
    width: 0;
    transition: width 100ms linear;
    border-radius: 1px;
    will-change: width;
    transform: translateZ(0);
}

/* ============================================================================
   스크롤 애니메이션 스타일
   ============================================================================ */

/* 애니메이션 준비 완료 마커 */
.scroll-animation-ready {
    content: 'ready';
    display: none;
}

/* 스크롤 애니메이션 초기 상태 */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.animate-on-scroll.visible {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

.animate-on-scroll.slide-left {
    opacity: 0;
    transform: translateX(80px);
}

.animate-on-scroll.slide-left.visible {
    opacity: 1 !important;
    transform: translateX(0) !important;
}

.animate-on-scroll.slide-right {
    opacity: 0;
    transform: translateX(-80px);
}

.animate-on-scroll.slide-right.visible {
    opacity: 1 !important;
    transform: translateX(0) !important;
}

.animate-on-scroll.fade-up {
    opacity: 0;
    transform: translateY(60px);
}

.animate-on-scroll.fade-up.visible {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

/* 스케일 애니메이션 추가 */
.animate-on-scroll.scale-up {
    opacity: 0;
    transform: scale(0.9);
}

.animate-on-scroll.scale-up.visible {
    opacity: 1 !important;
    transform: scale(1) !important;
}

/* 기본 애니메이션 키프레임 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideLeft {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideRight {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes sequentialFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 초기 숨김 상태 */
.hero-property-name,
.hero-title,
.hero-description,
.closing-title,
.closing-description {
    opacity: 0;
    transform: translateX(50px);
}

.closing-title,
.closing-description,
.closing-button {
    opacity: 0;
    transform: translateY(50px);
    will-change: opacity, transform;
    backface-visibility: hidden;
}

/* Essence 섹션 초기 숨김 상태 */
.property-name-en {
    opacity: 0;
    transform: translateX(-50px);
}

.essence-title,
.essence-description {
    opacity: 0;
    transform: translateY(30px);
}

.essence-thumbnails,
.essence-image {
    opacity: 0;
}

/* Rooms 섹션 초기 숨김 상태 */
.rooms-title {
    opacity: 0;
    transform: translateX(-50px);
}

.room-item {
    opacity: 0;
}


/* Gallery 섹션 초기 숨김 상태 */
.gallery-section-title {
    opacity: 0;
    transform: translateX(50px);
}

.gallery-title,
.gallery-description {
    opacity: 0;
    transform: translateY(30px);
}

.gallery-item {
    opacity: 0;
}


/* 애니메이션 클래스 */
.animate-fade-in {
    animation: fadeIn 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.animate-slide-up {
    animation: slideUp 1s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.animate-slide-left {
    animation: slideLeft 1s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.animate-slide-right {
    animation: slideRight 1s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

/* 모바일에서 기존 애니메이션 비활성화 및 섹션별 애니메이션 */
@media (max-width: 768px) {
    /* 기존 개별 요소 애니메이션 비활성화 */
    .hero-property-name,
    .hero-title,
    .hero-description,
    .property-name-en,
    .essence-title,
    .essence-description,
    .essence-thumbnails,
    .essence-image,
    .rooms-title,
    .room-item,
    .gallery-section-title,
    .gallery-title,
    .gallery-description,
    .gallery-item,
    .closing-title,
    .closing-description,
    .closing-button {
        opacity: 1 !important;
        transform: none !important;
        animation: none !important;
    }

    /* 모바일에서는 섹션 단위로 fadeUp 애니메이션 */
    .hero-text-content,
    .essence-content,
    .rooms-container,
    .gallery-container,
    .closing-content {
        opacity: 0;
        transform: translateY(30px);
    }

    .hero-text-content.animate-fade-up,
    .essence-content.animate-fade-up,
    .rooms-container.animate-fade-up,
    .gallery-container.animate-fade-up,
    .closing-content.animate-fade-up {
        opacity: 1;
        transform: translateY(0);
        transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    }
}

/* 순차적 애니메이션용 */
.sequential-item-hidden {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94), transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: opacity, transform;
    backface-visibility: hidden;
}

.animate-sequential-item {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

/* 타이핑 애니메이션용 */
.typing-container {
    overflow: hidden;
}

.typing-line {
    display: block;
    overflow: hidden;
    white-space: nowrap;
    border-right: 2px solid transparent;
    animation: blink-cursor 1.5s step-end infinite;
}

.typing-line:last-child {
    animation: blink-cursor 1.5s step-end infinite;
}

@keyframes blink-cursor {
    from, to {
        border-color: transparent;
    }
    50% {
        border-color: currentColor;
    }
}

/* 반응형 애니메이션 조정 */
@media (max-width: 768px) {
    @keyframes fadeIn {
        from {
            opacity: 0;
            transform: translateY(20px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    @keyframes slideUp {
        from {
            opacity: 0;
            transform: translateY(30px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .sequential-item-hidden {
        transform: translateY(20px);
    }
}

/* Main Container for page content */
.main-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 60px 20px 0px 20px;
}

/* Typing effect styles - Common for all pages */
.typing-text {
    position: relative;
    display: inline-block;
    white-space: nowrap;
    padding-bottom: 0.3em; /* g 같은 글자를 위한 여유 공간 */
}

.typing-text::before {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    padding-bottom: 0.3em; /* 하강 글자를 위한 패딩 */
    overflow-x: hidden; /* 가로만 숨김 */
    overflow-y: visible; /* 세로는 보이게 */
    white-space: nowrap;
    color: white;
    border-right: 2px solid white;
    animation: typing 2.5s linear forwards, blink-caret 0.5s step-end infinite;
    line-height: inherit;
}

.typing-text.typed::before {
    width: 100%;
    border-right: none;
    animation: typing 2s steps(8) forwards;
}

@keyframes typing {
    from { width: 0 }
    to { width: 100% }
}

@keyframes blink-caret {
    from, to { border-color: white }
    50% { border-color: transparent }
}

/* Property English Name Background Text Overlay */
.property-en-bg-text {
    position: absolute;
    top: 40px;
    left: 40px;
    font-family: 'Amandine', serif;
    font-size: 80px;
    font-weight: bold;
    font-style: italic;
    color: #c4d3de;
    text-transform: uppercase;
    letter-spacing: 3px;
    line-height: 1;
    z-index: 1;
    white-space: nowrap;
    pointer-events: none;
}

@media (max-width: 768px) {
    .property-en-bg-text {
        font-size: 60px;
        top: 20px;
        left: 20px;
    }
}

@media (max-width: 480px) {
    .property-en-bg-text {
        font-size: 40px;
        top: 15px;
        left: 15px;
    }
}

/* Scroll Down Icon */
.scroll-down-icon {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    cursor: pointer;
    z-index: 10;
    animation: bounce 2s infinite;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.scroll-down-icon:hover {
    opacity: 1;
}

.scroll-down-icon svg {
    width: 30px;
    height: 30px;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    40% {
        transform: translateX(-50%) translateY(-10px);
    }
    60% {
        transform: translateX(-50%) translateY(-5px);
    }
}

/* Logo Line Container - index.html과 main.html 공통 사용 */
.logo-line-container {
    display: flex;
    align-items: center;
    width: 100%;
    margin-bottom: 30px;
}

/* Property Name 공통 스타일 - index.html과 main.html */
.hero-property-name,
.logo-text-line {
    font-family: 'Roustel', serif;
    font-weight: normal;
    margin: 0;
    line-height: 1.2;
    letter-spacing: 2px;
    white-space: nowrap;
}

/* index.html hero 영역용 */
.hero-property-name {
    font-size: 64px;
    color: white;
    margin: 0 0 20px 0;
    display: inline-block;
    letter-spacing: 4px;
}

/* main.html logo line용 */
.logo-text-line {
    font-size: 48px;
    color: #658399;
    display: flex;
    align-items: center;
    gap: 20px;
}

.logo-text-line::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #658399;
}

/* 모바일 반응형 */
@media (max-width: 768px) {
    .hero-property-name {
        font-size: 48px;
    }

    .logo-text-line {
        font-size: 36px;
    }
}

@media (max-width: 480px) {
    .hero-property-name {
        font-size: 32px;
    }

    .logo-text-line {
        font-size: 24px;
        letter-spacing: 1px;
    }
}

.horizontal-line {
    flex: 1;
    height: 1px;
    background: #658399;
    opacity: 0.3;
}

/* 타이틀/설명과 아이콘 컨테이너 */
.text-content-with-icon {
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

/* 세로 네모 아이콘 */
.section-icon {
    width: 10px;
    height: 70px;
    background-color: #9ab4c6;
    flex-shrink: 0;
    margin-top: 5px;
}

.text-content {
    flex: 1;
}

/* 모션을 선호하지 않는 사용자를 위한 설정 */
@media (prefers-reduced-motion: reduce) {
    .animate-fade-in,
    .animate-slide-up,
    .animate-slide-left,
    .animate-slide-right {
        animation: none;
        opacity: 1;
        transform: none;
    }

    .sequential-item-hidden {
        opacity: 1;
        transform: none;
    }

    .animate-sequential-item {
        transition: none;
    }

    .typing-line {
        animation: none;
        border-right: none;
    }
}

/* ============================================================================
   공통 스크롤 애니메이션 스타일
   ============================================================================ */

/* 좌측에서 슬라이드인 초기 상태 */
.scroll-slide-left {
    opacity: 0;
    transform: translateX(-100px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

/* 우측에서 슬라이드인 초기 상태 */
.scroll-slide-right {
    opacity: 0;
    transform: translateX(100px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

/* 아래에서 슬라이드업 초기 상태 */
.scroll-slide-up {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

/* 페이드인 초기 상태 */
.scroll-fade-in {
    opacity: 0;
    transition: opacity 0.8s ease;
}

/* 스크롤 시 보이게 하는 클래스 */
.scroll-visible {
    opacity: 1;
    transform: translateX(0) translateY(0);
}

/* ============================================================================
   공통 페이지 히어로 영역 스타일 (모든 페이지 공통)
   ============================================================================ */

/* 기본 페이지 히어로 섹션 */
.page-hero-section {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

/* 히어로 배경 */
.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    opacity: 0;
    animation: heroFadeIn 1.5s ease forwards;
}

.hero-background img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

@keyframes heroFadeIn {
    to {
        opacity: 1;
    }
}

/* 페이지 타이틀 */
.page-title {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 3;
    text-align: center;
    opacity: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* 숙소명 한글 - 작은 글씨 */
.page-title .property-name-kr {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
    margin: 0;
    letter-spacing: 1px;
    opacity: 0;
    animation: fadeInUp 1s ease-out 0.5s forwards;
}

.page-title h1 {
    font-family: 'Roustel', serif;
    font-size: 80px;
    font-weight: normal;
    color: transparent;  /* 타이핑 효과를 위해 transparent로 변경 */
    margin: 0;
    line-height: 1;
    letter-spacing: 4px;
    position: relative;
    overflow: hidden;
    display: inline-block;
}

/* 타이핑 효과 */
.typing-text {
    position: relative;
    display: inline-block;
    color: transparent;
}

.typing-text::before {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    overflow: hidden;
    color: rgba(255, 255, 255, 0.9);
    border-right: 2px solid rgba(255, 255, 255, 0.9);
    white-space: nowrap;
    animation: typing 2s steps(8, end) forwards, blinkCursor 0.5s step-end infinite;
    animation-delay: 0.5s;
}

.typing-text.typed {
    color: rgba(255, 255, 255, 0.9);
}

.typing-text.typed::before {
    display: none;
}

@keyframes typing {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

@keyframes blinkCursor {
    50% {
        border-color: transparent;
    }
}

/* 페이지 히어로 반응형 */
@media (max-width: 1024px) {
    .page-title .property-name-kr {
        font-size: 16px;
    }

    .page-title h1 {
        font-size: 70px;
    }
}

@media (max-width: 768px) {
    .main-container {
        padding: 40px 20px 0px 20px;
    }

    .page-title .property-name-kr {
        font-size: 14px;
    }

    .page-title h1 {
        font-size: 60px;
    }
}

@media (max-width: 480px) {
    .main-container {
        padding: 30px 20px 0px 20px;
    }

    .page-title .property-name-kr {
        font-size: 16px;
    }

    .page-title h1 {
        font-size: 50px;
        letter-spacing: 1px;
    }
}

/* ============================================================================
   Full Banner 공통 스타일
   ============================================================================ */

.full-banner {
    position: relative;
    width: 100vw;
    height: 80vh;
    margin-top: 0;
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    overflow: hidden;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0;
    transition: opacity 1.5s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.full-banner.visible {
    opacity: 1;
}

.full-banner .closing-property-name {
    position: absolute;
    left: 150px;
    font-size: 30px;
    font-weight: bold;
    font-family: 'Roustel';
    letter-spacing: 5px;
    color: white;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    z-index: 2;
}

.full-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* 모바일 반응형 */
@media (max-width: 768px) {
    .full-banner {
        height: 60vh;
    }

    .full-banner .closing-property-name {
        left: 50px;
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    .full-banner {
        height: 50vh;
    }

    .full-banner .closing-property-name {
        left: 30px;
        font-size: 20px;
    }
}