:root {
    --bg: #b2b8ee;
    --muted: #777799;
    --muted-2: #51526a;
    --glass-strong: rgba(255,255,255,0.92);
    --glass-medium: rgba(255,255,255,0.55);
    --accent: #4f4f65;
    --shadow-1: rgba(26, 30, 60, 0.06);
    --shadow-2: rgba(26, 30, 60, 0.12);

    --gap-sm: 8px;
    --gap-md: 18px;
    --gap-lg: 32px;
    --radius-lg: 12px;

    --base-font: 'Helvetica Neue', Arial, sans-serif;
    --base-size: 16px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--base-font);
}

body {
    background-color: var(--bg);
    color: var(--muted);
    overflow-x: hidden;
    background-image: url('./assets/background.svg');
    background-size: cover;
    background-repeat: no-repeat;
    background-attachment: fixed;
    font-size: var(--base-size);
}

.section {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

/* Default photos section for index.html */
#photos.section {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 20px;
    min-height: 100vh;
    justify-content: center;
}

/* Sugar photo page specific styling */
body.sugar-photo #photos.section {
    height: 100vh;
    display: block;
    padding: 0;
    overflow-y: auto;
    scroll-snap-type: y mandatory;
    -webkit-overflow-scrolling: touch;
    justify-content: unset;
}

.profile-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.profile-photo {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    margin-bottom: 20px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    object-fit: cover;
}

.profile-info {
    max-width: 600px;
}

.profile-card {
    background: var(--glass-medium);
    backdrop-filter: blur(6px) saturate(120%);
    -webkit-backdrop-filter: blur(6px) saturate(120%);
    padding: var(--gap-md);
    box-shadow: 0 12px 30px rgba(26, 30, 60, 0.08);
    border-radius: var(--radius-lg);
}

.intro {
    font-size: 1.2em;
    margin-bottom: 20px;
    line-height: 1.5;
}

.sns-links a {
    text-decoration: none;
    color: #4f4f65;
    margin: 0 10px;
    font-size: 1.2em;
}

.sns-links a:hover {
    text-decoration: underline;
}

section h2 {
    font-size: 2em;
    margin-bottom: 20px;
    text-align: center;
}

#wishlist ul {
    list-style: none;
    text-align: center;
}

#wishlist li {
    margin-bottom: 10px;
}

#wishlist a {
    text-decoration: none;
    color: #4f4f65;
}

#wishlist a:hover {
    text-decoration: underline;
}

/* Default photo grid for index.html */
.photo-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    padding: 20px 0;
    width: 100%;
    max-width: 1200px;
}

/* Sugar photo page specific photo grid */
body.sugar-photo .photo-grid {
    max-height: 80vh;
    overflow-y: auto;
    padding: 20px;
}

.photo-container {
    flex: 1 1 calc(33.333% - 15px);
    display: flex;
    justify-content: center;
    align-items: center;
    min-width: 250px;
    overflow: hidden;
    max-width: 260px;
    max-height: 260px;
}
.photo-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
    background: rgba(255,255,255,0.06);
}

#overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    cursor: pointer;
}

.overlay-hidden { opacity: 0; transition: opacity 220ms ease; }
.overlay-visible { display: flex; opacity: 1; transition: opacity 220ms ease; }

#overlay img {
    max-width: 90vw;
    max-height: 90vh;
    width: auto;
    height: auto;
    object-fit: contain;
    animation: zoomIn 0.45s cubic-bezier(.2,.9,.2,1);
    /* Ensure the image maintains aspect ratio and fits within the viewport */
    display: block;
    margin: auto;
}

/* Portrait images (taller than wide) */
#overlay img.portrait-image {
    max-width: 80vw;
    max-height: 95vh;
    width: auto;
    height: auto;
}

/* Landscape images (wider than tall) */
#overlay img.landscape-image {
    max-width: 95vw;
    max-height: 85vh;
    width: auto;
    height: auto;
}

#overlay .caption {
    position: absolute;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.6);
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    font-weight: 600;
}

.nav-buttons {
    position: absolute;
    width: 100%;
    display: flex;
    justify-content: space-between;
    top: 50%;
    transform: translateY(-50%);
}

.nav-buttons button {
    background: rgba(255,255,255,0.06);
    border: none;
    color: #ffffff;
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6em;
    cursor: pointer;
    transition: background 160ms ease, transform 160ms ease;
    border-radius: 999px;
}

*:focus { outline: none; }
button:focus, a:focus { outline: 3px solid rgba(81,82,106,0.18); outline-offset: 4px; border-radius: 6px; }

@media (max-width: 600px) {
    .artwork { padding: 24px 12px; }
}

.nav-buttons button:hover {
    background: rgba(255,255,255,0.18);
    transform: translateY(-2px);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 12px;
    background: transparent;
    border: 1px solid rgba(0,0,0,0.04);
    color: var(--accent);
    border-radius: 8px;
    cursor: pointer;
    transition: background 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}
.btn:hover { background: rgba(255,255,255,0.08); }
.btn:focus { outline: 3px solid rgba(81,82,106,0.14); outline-offset: 4px; }

.control-round {
    width: 56px;
    height: 56px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--glass-strong);
    box-shadow: 0 10px 30px var(--shadow-2);
}


@keyframes zoomIn {
    from {
        transform: scale(0.5);
        opacity: 0;
    }

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


.scroll-indicator {
    position: fixed;
    left: 50%;
    bottom: 30px;
    transform: translateX(-50%);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 999px;
    background: rgba(12, 14, 22, 0.48);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    box-shadow: 0 8px 22px rgba(12,14,22,0.18);
    pointer-events: none;
}
.scroll-indicator .arrow {
    display: block;
    width: 14px;
    height: 14px;
    border-left: 3px solid rgba(255,255,255,0.95);
    border-bottom: 3px solid rgba(255,255,255,0.95);
    transform: rotate(-45deg);
    margin: 0;
    animation: bounce 1.2s infinite;
    opacity: 0.95;
}

.ring-link {
    text-decoration: none;
    color: inherit;
    font-size: 0.8em;
}

.gallery-rail {
    height: auto;
    /* Remove scroll-snap from here - moved to parent container */
    -webkit-overflow-scrolling: touch;
}
.artwork {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    scroll-snap-align: start;
    padding: 40px 20px;
    background: transparent;
}
.artwork .frame {
    background: var(--glass-strong);
    padding: var(--gap-md);
    box-shadow: 0 22px 50px rgba(41, 47, 85, 0.14);
    border-radius: var(--radius-lg);
    max-width: 84%;
    max-height: 74vh;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 36vh;
}
.artwork img {
    max-width: 100%;
    max-height: 68vh;
    object-fit: contain;
    border-radius: 8px;
    min-height: 26vh;
}

.artwork img { opacity: 0; transition: opacity 400ms ease, transform 400ms ease; transform: translateY(6px); }
.artwork img.is-loaded { opacity: 1; transform: translateY(0); }

.current-indicator {
    position: fixed;
    right: 18px;
    bottom: 18px;
    background: rgba(255,255,255,0.92);
    color: #33324a;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    box-shadow: 0 10px 30px rgba(26, 30, 60, 0.12);
    font-weight: 700;
    z-index: 1600;
}
.artwork .caption {
    margin-top: 18px;
    color: #51526a;
    font-size: 0.95rem;
    text-align: center;
    background: rgba(255,255,255,0.9);
    padding: 6px 10px;
    border-radius: 999px;
    box-shadow: 0 8px 22px rgba(26, 30, 60, 0.06);
}

@media (max-width: 600px) {
    .artwork .frame { padding: 12px; max-width: 94%; }
    .artwork .caption { font-size: 0.95rem; }
    
    /* Mobile overlay image adjustments */
    #overlay img {
        max-width: 95vw;
        max-height: 85vh;
    }
    
    #overlay img.portrait-image {
        max-width: 90vw;
        max-height: 90vh;
    }
    
    #overlay img.landscape-image {
        max-width: 98vw;
        max-height: 80vh;
    }
    
    #overlay .close-btn {
        top: 16px;
        right: 16px;
        padding: 6px 10px;
        font-size: 0.9rem;
    }
}

#overlay .close-btn {
    position: absolute;
    top: 24px;
    right: 24px;
    background: rgba(255,255,255,0.06);
    border: 2px solid rgba(255,255,255,0.2);
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
}
#overlay .close-btn:hover { background: rgba(255,255,255,0.12); }