/* ============================================================
   desca.dev — Styles
   Minimalist architectural gallery aesthetic
   Single achromatic palette with cool grays
   ============================================================ */

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background-color: #f8f9fa;
    color: #1f2937;
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 400;
    line-height: 1.72;
    letter-spacing: 0.005em;
    overflow: hidden;
}

/* --- Scroll Container --- */
.scroll-container {
    height: 100vh;
    overflow-y: auto;
    scroll-snap-type: y mandatory;
}

/* --- Panel Base --- */
.panel {
    min-height: 100vh;
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    padding: 64px 24px;
}

/* --- Panel Offsets (lateral drift) --- */
.panel-offset-left .panel-content {
    max-width: 680px;
    width: 100%;
    text-align: left;
    margin-left: auto;
    margin-right: auto;
}

.panel-offset-right .panel-content {
    max-width: 680px;
    width: 100%;
    text-align: left;
    margin-left: auto;
    margin-right: auto;
}

@media (min-width: 1200px) {
    .panel-offset-left .panel-content {
        transform: translateX(-4vw);
    }
    .panel-offset-right .panel-content {
        transform: translateX(4vw);
    }
}

/* --- The Threshold --- */
.panel-threshold {
    justify-content: center;
    align-items: center;
}

.threshold-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    top: -5%;
}

.site-title {
    font-family: 'Cormorant Garamond', 'Times New Roman', serif;
    font-weight: 300;
    font-size: clamp(2.8rem, 5.5vw, 5rem);
    letter-spacing: -0.02em;
    line-height: 1.15;
    color: #1f2937;
    opacity: 0;
    transition: opacity 1.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.site-title.visible {
    opacity: 1;
}

/* --- Double Rule --- */
.double-rule {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    margin-top: 24px;
    opacity: 0;
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.double-rule.visible {
    opacity: 1;
}

.rule-line {
    display: block;
    width: 120px;
    height: 1px;
    background-color: #d1d5db;
}

/* Threshold rule uses medium gray #6b7280 per design spec */
.threshold-content .rule-line {
    background-color: #6b7280;
}

/* --- Heading Rule (under section headings) --- */
.heading-rule {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 16px;
    margin-bottom: 40px;
}

.heading-rule .rule-line {
    width: 120px;
    height: 1px;
    background-color: #d1d5db;
}

/* --- Scroll Chevron --- */
.scroll-chevron {
    margin-top: 32px;
    opacity: 0;
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    animation: chevronPulse 3s ease-in-out infinite;
}

.scroll-chevron.visible {
    opacity: 1;
}

@keyframes chevronPulse {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(6px);
    }
}

/* --- Section Headings --- */
.section-heading {
    font-family: 'Cormorant Garamond', 'Times New Roman', serif;
    font-weight: 300;
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    letter-spacing: -0.02em;
    line-height: 1.15;
    color: #1f2937;
}

/* --- Body Text --- */
.body-text {
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.6vw, 1.125rem);
    line-height: 1.72;
    letter-spacing: 0.005em;
    color: #4b5563;
    max-width: 38em;
    margin-bottom: 24px;
}

.body-text:last-child {
    margin-bottom: 0;
}

/* --- Text Links (Hover underline animation) --- */
.text-link {
    color: #334155;
    text-decoration: none;
    background-image: linear-gradient(#64748b, #64748b);
    background-size: 0% 1px;
    background-repeat: no-repeat;
    background-position: 0 100%;
    transition: background-size 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    padding-bottom: 2px;
}

.text-link:hover {
    background-size: 100% 1px;
}

/* --- Section Marker (Circle with dot) --- */
.section-marker {
    margin-bottom: 40px;
}

.circle-dot {
    width: 48px;
    height: 48px;
    border: 1px solid #d1d5db;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: default;
}

.circle-dot:hover {
    background-color: #d1d5db;
}

.dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background-color: #9ca3af;
}

/* --- Diagonal Cue --- */
.diagonal-cue {
    position: absolute;
    bottom: 32px;
    right: 32px;
    width: 32px;
    height: 32px;
}

.diagonal-cue::before {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 32px;
    height: 1px;
    background-color: #d1d5db;
    transform: rotate(-45deg);
    transform-origin: bottom right;
}

/* --- Margin Notes --- */
.margin-note {
    display: none;
    position: absolute;
    left: 48px;
    top: 50%;
    transform: translateY(-50%) translateX(-12px);
    font-family: 'DM Sans', 'Helvetica Neue', sans-serif;
    font-weight: 400;
    font-variant: small-caps;
    font-size: 0.6875rem;
    letter-spacing: 0.12em;
    color: #9ca3af;
    opacity: 0;
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.margin-note.active {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

.margin-note.dimmed {
    opacity: 0.3;
    transform: translateY(-50%) translateX(0);
}

@media (min-width: 1200px) {
    .margin-note {
        display: block;
    }
}

/* --- Reveal Animation Base --- */
.reveal-element {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-element.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* --- Photography Sections --- */
.panel-photo-section {
    justify-content: flex-start;
    padding-top: 10vh;
}

.photo-container {
    width: 100%;
    max-width: 100vw;
    position: relative;
    margin-top: 48px;
    aspect-ratio: 16 / 9;
    overflow: hidden;
}

.photo-image {
    width: 100%;
    height: 100%;
}

.photo-placeholder {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-mask {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #f8f9fa;
    z-index: 2;
    transform: translateX(0);
    transition: transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.photo-container.revealed .photo-mask {
    transform: translateX(100%);
}

.photo-border {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: #d1d5db;
    opacity: 0;
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1) 1.2s;
    z-index: 3;
}

.photo-container.revealed .photo-border {
    opacity: 1;
}

/* --- Closing Section --- */
.panel-closing {
    justify-content: center;
    align-items: center;
}

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

.closing-text {
    font-family: 'Cormorant Garamond', 'Times New Roman', serif;
    font-weight: 300;
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    letter-spacing: -0.02em;
    line-height: 1.15;
    color: #1f2937;
}

.closing-meta {
    font-family: 'DM Sans', 'Helvetica Neue', sans-serif;
    font-weight: 400;
    font-variant: small-caps;
    font-size: 0.6875rem;
    letter-spacing: 0.12em;
    color: #9ca3af;
    margin-top: 24px;
}

/* --- Alternate Section Backgrounds --- */
/* Fog (#f1f3f5) for even sections, Glacier White (#f8f9fa) for odd */
.panel:nth-child(even) {
    background-color: #f1f3f5;
}

.panel:nth-child(odd) {
    background-color: #f8f9fa;
}

/* Photo mask matches panel background for even sections */
.panel:nth-child(even) .photo-mask {
    background-color: #f1f3f5;
}

/* --- Responsive Adjustments --- */
@media (max-width: 768px) {
    .panel {
        padding: 48px 20px;
    }

    .panel-offset-left .panel-content,
    .panel-offset-right .panel-content {
        max-width: 100%;
    }

    .diagonal-cue {
        bottom: 20px;
        right: 20px;
    }

    .photo-container {
        aspect-ratio: 3 / 2;
    }

    .panel-photo-section {
        padding-top: 8vh;
    }
}

@media (max-width: 480px) {
    .panel {
        padding: 32px 16px;
    }

    .heading-rule {
        margin-bottom: 28px;
    }

    .body-text {
        margin-bottom: 18px;
    }
}

/* --- Selection Color --- */
::selection {
    background-color: #d1d5db;
    color: #1f2937;
}

/* --- Scrollbar Styling --- */
.scroll-container::-webkit-scrollbar {
    width: 4px;
}

.scroll-container::-webkit-scrollbar-track {
    background: #f8f9fa;
}

.scroll-container::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 2px;
}

.scroll-container::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}
