@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css');

:root {
    --custom-font-family: system-ui, -apple-system, "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif;
}

body {
    margin: 0;
    font-family: var(--custom-font-family, system-ui, -apple-system, "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif) !important;
    font-size: 14px;
    color: var(--custom-text-color, #333) !important;
}

a {
    color: inherit;
}

.page {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 60px 16px 80px;
    width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
    opacity: 0;
    animation: page-fade-in 0.3s ease-out forwards;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

@keyframes page-fade-in {
    to {
        opacity: 1;
    }
}

.card-wrapper {
    width: min(480px, 100%);
    perspective: 1200px;
    margin: 0 auto;
    flex-shrink: 0;
    opacity: 0;
    animation: slide-down 0.6s ease-out 0.2s forwards;
}

@keyframes slide-down {
    from {
        opacity: 0;
        translate: 0 -40px;
    }

    to {
        opacity: 1;
        translate: 0 0;
    }
}

.card {
    position: relative;
    width: 100%;
    max-width: 100%;
    aspect-ratio: 91 / 55;
    transform-style: preserve-3d;
    transform-origin: center center;
    transition: transform 0.8s ease;
    touch-action: pan-y;
    font-family: var(--custom-font-family);
}

.card-face {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    border-radius: 20px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.15);
    padding: 28px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    min-height: 300px;
}

.photo-container {
    width: 88px;
    height: 88px;
    border-radius: 18px;
    overflow: hidden;
    flex-shrink: 0;
}

.card-back {
    rotate: y 180deg;
}

.card-content {
    opacity: 0;
    animation: content-fade-in 0.4s ease-out 0.8s forwards;
}

@keyframes content-fade-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.front-top {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    width: 100%;
}

.front-top--no-photo {
    justify-content: flex-start;
}

.front-top--no-photo .front-text {
    text-align: left;
}

.front-photo {
    width: 88px;
    height: 88px;
    border-radius: 18px;

    object-fit: cover;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4);
    display: block;
}

.front-photo img {
    max-width: 88px;
    max-height: 88px;
    width: 88px;
    height: 88px;
    object-fit: cover;
    display: block;
    border-radius: 18px;
}

.front-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    flex: 1;
}

.front-text h1 {
    margin: 0;
    font-size: var(--custom-name-size, 18px);
    font-weight: var(--custom-name-weight, 700);
    color: var(--custom-name-color, inherit);
}

.furigana {
    margin: 0;
    font-size: var(--custom-furigana-size, 12px);
    letter-spacing: 0.1em;
    color: var(--custom-furigana-color, inherit);
}

.comment {
    margin: 0;
    font-size: var(--custom-comment-size, 12px);
    color: var(--custom-comment-color, inherit);
    font-family: var(--custom-comment-font, inherit);
}

.title {
    margin: 0;
    font-size: var(--custom-title-size, 14px);
    color: var(--custom-title-color, inherit);
}

.company-name {
    font-size: var(--custom-company-size, 14px);
    color: var(--custom-company-color, inherit);
}

.contact-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 10px;
}

.contact-list li {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr);
    gap: 10px;
    align-items: flex-start;
}

.contact-icon {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    margin-top: 4px;
}

.contact-list a {
    text-decoration: none;
    display: block;
    min-width: 0;
    width: fit-content;
    font-size: var(--custom-contact-size, 14px);
    color: var(--custom-contact-color, inherit);
}

.contact-list a:hover {
    opacity: 0.7;
}

.contact-phone .contact-text {
    font-size: var(--custom-phone-size, inherit);
    color: var(--custom-phone-color, inherit);
    font-family: var(--custom-phone-font, inherit);
}

.contact-email .contact-text {
    font-size: var(--custom-email-size, inherit);
    color: var(--custom-email-color, inherit);
    font-family: var(--custom-email-font, inherit);
}

.contact-address .contact-text {
    font-size: var(--custom-address-size, inherit);
    color: var(--custom-address-color, inherit);
    font-family: var(--custom-address-font, inherit);
}

.contact-text {
    display: block;
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    white-space: pre-line;
    line-height: 1.5;
    max-width: 100%;
    min-width: 0;
}

.catchphrase {
    display: none;
}

.company-name {
    margin: 10px 0 4px;
    text-align: center;
    font-size: 24px;
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    line-height: 1.3;
}

.services {
    margin: 0 0 18px;
    text-align: center;
    opacity: 0.8;
    font-size: var(--custom-services-size, 13px);
    color: var(--custom-services-color, inherit);
    font-family: var(--custom-services-font, inherit);
}

.card-hint {
    text-align: center;
    margin: 16px 0 0;
    font-size: 13px;
}

.social-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin: 48px 0 24px;
    width: 100%;
}

.social-link-item {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 24px;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    opacity: 0;
    animation: social-pop-in 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    overflow: hidden;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
        box-shadow 0.3s ease;
    transform: scale(1) rotate(0deg);
    position: relative;
}

/* シーケンシャル登場アニメーション */
@keyframes social-pop-in {
    0% {
        opacity: 0;
        transform: scale(0) translateY(30px);
    }

    60% {
        opacity: 1;
        transform: scale(1.1) translateY(-5px);
    }

    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* ホバー時のインタラクション：拡大 + 回転 + グロー */
.social-link-item:hover {
    transform: scale(1.2) rotate(8deg);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25),
        0 0 20px currentColor;
}

/* アクティブ時のフィードバック */
.social-link-item:active {
    transform: scale(0.95) rotate(0deg);
    transition: transform 0.1s ease;
}

/* モーダル用アニメーション */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-20px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.vcard-button-wrapper {
    display: flex;
    justify-content: center;
    margin: 32px 0 24px;
}

.vcard-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.vcard-button:hover {
    translate: 0 -2px;
}

.vcard-button:active {
    translate: 0 0;
}

.vcard-button i {
    font-size: 18px;
}

.footer {
    text-align: center;
    font-size: 12px;
    color: rgba(0, 0, 0, 0.4);
}

.qr-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.qr-container img {
    width: 150px !important;
    height: auto;
    max-width: 100%;
    display: block;
}

@media (max-width: 560px) {
    .card-face {
        padding: 22px;
    }
}

/* SNSアイコン内のWebフォントアイコンの位置調整（必要に応じて） */
.social-link-item i {
    display: flex;
    align-items: center;
    justify-content: center;
}