/* --- Core & Reset --- */
:root {
    --bg-color: #fcfcfc;
    --text-primary: #1a1a1a;
    --text-muted: #767676;
    --border-color: rgba(0, 0, 0, 0.1);
    --font-serif: "Times New Roman", Times, Baskerville, Georgia, serif;
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --max-width: 800px;
    --transition-speed: 0.6s;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-sans);
    -webkit-font-smoothing: antialiased;
    line-height: 1.6;
}

body.modal-open {
    overflow: hidden;
}

.zen-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 80px 24px;
}

/* --- Screen Reader & Hidden SEO Optimization Rules --- */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* --- Structural Separator --- */
.fade-line {
    height: 1px;
    width: 100%;
    margin: 120px 0;
    background: linear-gradient(to right, transparent, var(--border-color) 20%, var(--border-color) 80%, transparent);
}

/* --- Portfolio Entries --- */
.portfolio-section {
    display: flex;
    flex-direction: column;
    gap: 80px;
}

.portfolio-entry {
    display: flex;
    flex-direction: column;
    gap: 20px;
    animation: fadeIn 0.8s ease forwards;
}

.entry-title {
    font-family: var(--font-serif);
    font-weight: 400;
    font-size: 1.75rem;
    letter-spacing: -0.01em;
}

.entry-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-top: 4px;
}

/* --- Fibonacci Spiral Proportional Grid System Engine --- */
.fibonacci-grid {
    display: grid;
    gap: 12px;
    width: 100%;
    background-color: var(--bg-color);
}

.fib-item {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    background-color: #fafafa;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fib-item img,
.fib-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}

.fib-item:hover img,
.fib-item:hover video {
    transform: scale(1.02);
}

/* 4+ Items: True Inward Golden Spiral (Counter-Clockwise Convergence) */
.fibonacci-grid.total-items-4 {
    display: grid;
    grid-template-columns: repeat(3, 1fr) 1fr 3fr;
    grid-template-rows: repeat(3, 120px);
    gap: 12px;
    width: 100%;
}
.fibonacci-grid.total-items-4 .cell-1 { grid-column: 1 / 4; grid-row: 1 / 4; }
.fibonacci-grid.total-items-4 .cell-2 { grid-column: 4 / 6; grid-row: 1 / 3; }
.fibonacci-grid.total-items-4 .cell-void { grid-column: 4 / 5; grid-row: 3 / 4; }
.fibonacci-grid.total-items-4 .cell-3 { grid-column: 5 / 6; grid-row: 3 / 4; }

/* 3 Items Layout Modification Adjustments */
.fibonacci-grid.total-items-3 {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-template-rows: repeat(2, 180px);
    gap: 12px;
    width: 100%;
}
.fibonacci-grid.total-items-3 .cell-1 { grid-column: 1 / 4; grid-row: 1 / 3; }
.fibonacci-grid.total-items-3 .cell-2 { grid-column: 4 / 6; grid-row: 1 / 2; }
.fibonacci-grid.total-items-3 .cell-3 { grid-column: 4 / 6; grid-row: 2 / 3; }

/* 2 Items Structural Split */
.fibonacci-grid.total-items-2 {
    grid-template-columns: 3fr 2fr;
    grid-template-rows: 300px;
}

/* 1 Item Isolated Frame Canvas */
.fibonacci-grid.total-items-1 {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
}
.fibonacci-grid.total-items-1 .cell-1 img,
.fibonacci-grid.total-items-1 .cell-1 video {
    max-height: 70vh;
    object-fit: contain;
}

/* Inner Void Counter Aesthetics */
.cell-void {
    background-color: #1a1a1a;
    color: #ffffff;
}

.void-content {
    position: absolute;
    z-index: 5;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: rgba(26, 26, 26, 0.85);
    transition: background 0.3s ease;
}

.cell-void:hover .void-content {
    background: rgba(26, 26, 26, 0.75);
}

.void-number {
    font-family: var(--font-serif);
    font-size: 1.75rem;
    font-weight: 300;
}

.void-label {
    font-size: 0.55rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 2px;
}

.void-bg {
    filter: blur(4px);
    opacity: 0.4;
}

/* --- Native Semantic Collapsible Field Log --- */
.field-log-collapsible {
    width: 100%;
    margin-top: 10px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.collapsible-trigger {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    cursor: pointer;
    list-style: none; /* Clear native safari markers */
    user-select: none;
}

.collapsible-trigger::-webkit-details-marker {
    display: none; /* Hide Chrome/Safari native summary marker */
}

.trigger-text {
    font-size: 0.75rem;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
}

.trigger-icon {
    position: relative;
    width: 10px;
    height: 10px;
}

.trigger-icon::before,
.trigger-icon::after {
    content: '';
    position: absolute;
    background-color: var(--text-muted);
    transition: transform 0.3s ease;
}

/* Vertical line */
.trigger-icon::before {
    top: 0; left: 4px; width: 2px; height: 10px;
}
/* Horizontal line */
.trigger-icon::after {
    top: 4px; left: 0; width: 10px; height: 2px;
}

/* Dynamic State Rotations */
.field-log-collapsible[open] .trigger-icon::before {
    transform: rotate(90deg);
}
.field-log-collapsible[open] .trigger-icon::after {
    transform: rotate(180deg);
}

.collapsible-content {
    padding: 10px 0 25px 0;
    animation: fadeIn 0.4s ease forwards;
}

/* Itemized Technical Records Listing */
.log-entry-row {
    display: flex;
    gap: 30px;
    padding: 15px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.03);
}

.log-entry-row:last-of-type {
    border-bottom: none;
}

.log-index-badge {
    font-family: var(--font-serif);
    font-size: 0.85rem;
    font-style: italic;
    color: var(--text-muted);
    min-width: 60px;
    padding-top: 2px;
}

.log-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 20px;
    flex-grow: 1;
}

.log-column {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.log-label {
    font-size: 0.6rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 600;
}

.log-value {
    font-family: var(--font-serif);
    font-size: 0.85rem;
    color: var(--text-primary);
    line-height: 1.4;
}

.log-venue-footer {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px dashed rgba(0, 0, 0, 0.05);
    display: flex;
    gap: 10px;
    align-items: center;
}

.entry-description {
    font-size: 0.95rem;
    color: var(--text-muted);
    max-width: 600px;
}

/* --- Pagination Elements --- */
.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-top: 20px;
}

.page-btn {
    background: none;
    border: none;
    font-size: 0.9rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px 12px;
    transition: color 0.3s ease;
}

.page-btn:hover:not(:disabled),
.page-btn.active {
    color: var(--text-primary);
}

.page-btn:disabled {
    opacity: 0.15;
    cursor: not-allowed;
}

/* --- Full-Screen Lightbox Modal Overlay --- */
.lightbox-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(252, 252, 252, 0.98);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.lightbox-modal[aria-hidden="false"] {
    display: flex;
    opacity: 1;
}

.modal-content {
    max-width: 90vw;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

#modal-media-target img,
#modal-media-target video {
    max-width: 100%;
    max-height: 78vh;
    object-fit: contain;
    animation: fadeIn 0.4s ease forwards;
}

#modal-caption-target {
    font-family: var(--font-serif);
    font-size: 0.95rem;
    color: var(--text-muted);
    text-align: center;
}

.modal-close {
    position: absolute;
    top: 24px;
    right: 24px;
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text-primary);
    cursor: pointer;
    padding: 10px;
    z-index: 2100;
}

.modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text-primary);
    cursor: pointer;
    padding: 30px;
    z-index: 2100;
    transition: opacity 0.3s ease;
}

.modal-nav:disabled { opacity: 0.1; cursor: not-allowed; }
.modal-nav.prev { left: 10px; }
.modal-nav.next { right: 10px; }

/* --- About Me Section --- */
.about-section {
    display: flex;
    align-items: center;
    gap: 40px;
}

.about-profile-pic img {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    object-fit: cover;
    filter: grayscale(100%);
}

.about-text p {
    font-size: 1rem;
    color: var(--text-primary);
    max-width: 550px;
}

/* --- Contact & Booking Section --- */
.contact-section {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.contact-info h3 {
    font-family: var(--font-serif);
    font-weight: 400;
    font-size: 1.3rem;
    margin-bottom: 12px;
}

.contact-info a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.3s ease;
}

.contact-info a:hover {
    color: var(--text-primary);
}

.booking-widget {
    width: 100%;
}

.booking-widget iframe {
    color-scheme: light;
    border: none;
}

/* --- Footer --- */
.main-footer {
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    letter-spacing: 0.03em;
}

/* --- Animations --- */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Responsive Adjustments --- */
@media (max-width: 640px) {
    .about-section {
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }

    .zen-container {
        padding: 40px 16px;
    }

    .fibonacci-grid.total-items-4 {
        grid-template-rows: repeat(3, 85px);
    }
    
    .log-entry-row {
        flex-direction: column;
        gap: 10px;
    }
    
    .log-index-badge {
        border-bottom: 1px dashed rgba(0,0,0,0.05);
        padding-bottom: 4px;
    }
}