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

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

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

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #ffffff;
}

/* Top Navigation */
.top-nav {
    position: fixed;
    top: 4%;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 4%;
    z-index: 1000;
    transition: opacity 0.3s ease;
}

.nav-name {
    font-family: 'NeueHaas', -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 500;
    font-size: clamp(14px, 2vw, 18px);
    color: #000000;
}

.nav-btn {
    background: none;
    border: none;
    font-family: 'NeueHaas', -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 400;
    font-size: clamp(14px, 2vw, 18px);
    color: rgba(0, 0, 0, 0.5);
    cursor: pointer;
    transition: color 0.2s ease;
    padding: 0;
}

.nav-btn:hover {
    color: #000000;
}

.card-stack-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card {
    position: absolute;
    width: var(--card-width, 400px);
    height: var(--card-height, 400px);
    border-radius: calc(var(--card-width, 300px) * 0.08);
    cursor: grab;
    user-select: none;
    touch-action: none;
    will-change: transform;
    box-shadow:
        0 4px 6px rgba(0, 0, 0, 0.025),
        0 10px 20px rgba(0, 0, 0, 0.04),
        0 20px 40px rgba(0, 0, 0, 0.05);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.card:active {
    cursor: grabbing;
}

.card.dragging {
    cursor: grabbing;
    box-shadow:
        0 10px 20px rgba(0, 0, 0, 0.05),
        0 20px 40px rgba(0, 0, 0, 0.06),
        0 40px 80px rgba(0, 0, 0, 0.075);
}

.card-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: calc(var(--card-width, 300px) * 0.08);
    pointer-events: none;
}

.card-content {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: calc(var(--card-width, 300px) * 0.08);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.9);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 24px;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.card-number {
    font-size: 64px;
    font-weight: 700;
    opacity: 0.3;
}

/* Card clones for infinite grid effect */
.card-clone {
    user-select: none;
    cursor: pointer;
}

/* Card Info Text Display */
.card-info {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    padding-bottom: 4%;
    padding-top: 100px;
    text-align: center;
    z-index: 1000;
    pointer-events: none;
    transition: opacity 0.3s ease;
    background: linear-gradient(
        to bottom,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 1) 100%
    );
}

.card-info-inner {
    opacity: 0;
    -webkit-transition: opacity 0.25s ease-out;
    transition: opacity 0.25s ease-out;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    will-change: opacity;
}

.card-info-inner.visible {
    opacity: 1;
}

.card-info-inner.fade-out {
    opacity: 0;
}

/* First-time visitor tip - Full screen overlay */
.drag-tip {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.drag-tip.visible {
    opacity: 1;
    pointer-events: auto;
}

.drag-tip span {
    color: white;
    font-family: 'NeueHaas', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: clamp(18px, 4vw, 24px);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.card-info-title {
    font-family: 'NeueHaas', -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 500;
    font-size: clamp(24px, 4vw, 42px);
    color: #000000;
    margin-bottom: 3px;
    letter-spacing: -0.02em;
}

.card-info-description {
    font-family: 'NeueHaas', -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 400;
    font-size: clamp(14px, 2vw, 18px);
    color: rgba(0, 0, 0, 0.6);
    max-width: 400px;
    margin: 0 auto;
    line-height: 1.5;
}

/* Detail Page */
.detail-page {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    overscroll-behavior: none;
    z-index: 1000; /* Higher than expanded card's 999 */
    pointer-events: none;
    opacity: 0;
    transition: none; /* No fade - card animates directly to banner */
    background: transparent;
}

.detail-page.visible {
    pointer-events: auto;
    opacity: 1;
    background: #ffffff;
}

/* White overlay to hide cards behind detail page */
.detail-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #ffffff;
    z-index: 997;
}

/* Banner at top of detail page (scrolls with content) */
.detail-banner {
    width: 100vw;
    height: clamp(200px, 30vh, 400px); /* Responsive height with min/max */
    overflow: hidden;
    position: relative;
    left: 50%;
    transform: translateX(-50%); /* Center full-width banner regardless of padding */
    margin-bottom: clamp(24px, 4vh, 48px);
}

.detail-banner video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    border-radius: 0;
}

/* Dynamic back button (above banner) */
.detail-back-btn {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1100;
    background: #ffffff;
    border: none;
    border-radius: 20px;
    color: rgba(0, 0, 0, 0.5);
    font-family: 'NeueHaas', -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 400;
    font-size: 16px;
    cursor: pointer;
    padding: 10px 16px;
    transition: color 0.2s ease;
}

.detail-back-btn:hover {
    color: rgba(0, 0, 0, 0.9);
}

.back-btn {
    display: none; /* Using dynamic .detail-back-btn instead */
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1100;
    background: none;
    border: none;
    color: rgba(0, 0, 0, 0.6);
    font-family: 'NeueHaas', -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 400;
    font-size: 16px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s ease, color 0.2s ease;
    padding: 10px;
}

.detail-page.visible .back-btn {
    opacity: 1;
}

.back-btn:hover {
    color: #000000;
}

.detail-content {
    padding-top: clamp(40px, 6vh, 80px); /* Space for back button */
    padding-left: clamp(20px, 10%, 150px);
    padding-right: clamp(20px, 10%, 150px);
    padding-bottom: 100px;
    color: #000000;
    max-width: 1200px;
    margin: 0 auto;
}

.detail-title {
    font-family: 'NeueHaas', -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 500;
    font-size: clamp(32px, 5vw, 56px);
    margin-bottom: 16px;
    letter-spacing: -0.02em;
}

.detail-intro {
    font-family: 'NeueHaas', -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 400;
    font-size: clamp(18px, 2.5vw, 24px);
    color: rgba(0, 0, 0, 0.7);
    margin-bottom: clamp(24px, 4vh, 40px);
    line-height: 1.6;
    max-width: 600px;
}

.detail-image {
    width: 100%;
    height: clamp(150px, 25vh, 300px);
    border-radius: 16px;
    margin-bottom: clamp(24px, 4vh, 40px);
}

.detail-text {
    font-family: 'NeueHaas', -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 400;
    font-size: clamp(16px, 2vw, 18px);
    color: rgba(0, 0, 0, 0.6);
    line-height: 1.8;
    margin-bottom: clamp(24px, 4vh, 40px);
    max-width: 700px;
}

.detail-content-image {
    width: 100%;
    max-width: 700px;
    height: auto;
    margin-bottom: clamp(24px, 4vh, 40px);
    border-radius: 12px;
}

.detail-image-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    max-width: 700px;
    margin-bottom: clamp(24px, 4vh, 40px);
}

.detail-image-grid img,
.detail-image-grid video {
    width: 100%;
    height: auto;
    border-radius: 12px;
}

.detail-content-video {
    width: 100%;
    max-width: 700px;
    height: auto;
    margin-bottom: clamp(24px, 4vh, 40px);
    border-radius: 12px;
}

/* Modal Styles - Bottom Sheet */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    pointer-events: none;
}

.modal.visible {
    pointer-events: auto;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0);
    transition: background 0.3s ease;
}

.modal.visible .modal-overlay {
    background: rgba(0, 0, 0, 0.3);
}

.modal-card {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    max-height: 85vh;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 1));
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border-radius: 24px 24px 0 0;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.modal.visible .modal-card {
    transform: translateY(0);
}

.modal-handle {
    width: 36px;
    height: 4px;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 2px;
    margin: 12px auto 0;
}

.modal-back {
    display: block;
    background: none;
    border: none;
    font-family: 'NeueHaas', -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 400;
    font-size: 16px;
    color: rgba(0, 0, 0, 0.6);
    cursor: pointer;
    transition: color 0.2s ease;
    padding: 16px 24px;
    text-align: left;
}

.modal-back:hover {
    color: #000000;
}

.modal-content {
    max-width: 600px;
    padding: 0 40px 60px;
    margin: 0 auto;
    text-align: center;
}

.profile-image {
    width: clamp(120px, 24vw, 180px);
    height: clamp(120px, 24vw, 180px);
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 24px;
}

.modal-title {
    font-family: 'NeueHaas', -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 500;
    font-size: clamp(32px, 5vw, 48px);
    color: #000000;
    margin-bottom: 6px;
    letter-spacing: -0.02em;
}

.modal-text {
    font-family: 'NeueHaas', -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 400;
    font-size: clamp(16px, 2vw, 18px);
    color: rgba(0, 0, 0, 0.6);
    line-height: 1.8;
    margin-bottom: 24px;
}

.contact-social {
    display: flex;
    justify-content: center;
    gap: 24px;
}

.social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    color: rgba(0, 0, 0, 0.4);
    transition: color 0.2s ease, transform 0.2s ease;
}

.social-icon svg {
    width: 24px;
    height: 24px;
}

.social-icon:hover {
    color: #000000;
    transform: scale(1.1);
}
