/* ========================================
   Portfolio — Style
   Luke Evans-inspired minimalist design
   ======================================== */

/* --- Custom Properties --- */
:root {
    --font-main: 'Roboto Flex', -apple-system, BlinkMacSystemFont, sans-serif;

    --bg: #ffffff;
    --bg-muted: #f7f7f5;
    --text: #1a1a1a;
    --text-secondary: #888888;
    --border: #e5e5e5;

    --nav-height: 80px;
}

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

html, body {
    height: 100%;
}

body {
    font-family: var(--font-main);
    font-weight: 100;
    font-size: 14px;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    overflow: hidden;
}

img {
    display: block;
    max-width: 100%;
}

button {
    font: inherit;
    border: none;
    background: none;
    cursor: pointer;
    color: inherit;
}

a {
    color: inherit;
    text-decoration: none;
}

.hidden {
    display: none !important;
}

/* --- Navigation --- */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    padding: 14px 24px 10px;
    z-index: 100;
    background: var(--bg);
    transition: background 0.5s ease, color 0.5s ease;
}

.nav-grid {
    display: grid;
    grid-template-columns: auto minmax(140px, auto) auto;
    justify-content: center;
}

/* Row 2 wrapper — display:contents so children participate in grid */
.nav-row2 {
    display: contents;
}

.nav-row2.hidden > * {
    display: none;
}

/* Shared cell style */
.nav-cell {
    padding: 5px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

/* Column 1: right-align (name + trip/series) */
.nav-cell-left {
    justify-content: flex-end;
    gap: 8px;
}

/* Row 1: rounded box with internal pipe separators */
.nav-grid > .nav-cell-left {
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    border-left: 1px solid var(--border);
    border-radius: 100px 0 0 100px;
    background: #cccccc;
}
.nav-grid > .nav-cell-mid {
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    border-left: 1px solid var(--border);
    background: #cccccc;
}
.nav-grid > .nav-cell-end {
    border: 1px solid var(--border);
    border-radius: 0 100px 100px 0;
    background: #cccccc;
}

/* Add vertical gap between rows so borders don't connect */
.nav-grid {
    row-gap: 4px;
}

/* Row 1 items */
.nav-name {
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #111111;
    transition: color 0.5s ease;
}

.nav-link {
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #111111;
    transition: color 0.2s;
    padding: 0;
}

.nav-link:hover,
.nav-link.active {
    color: #111111;
}
.nav-link.active,
.nav-name.active {
    background: #ffffff;
    border-radius: 100px;
    padding: 4px 16px;
}

.nav-dark .nav-name.active {
    background: #666666;
}

/* Row 2 mid cell: fixed width so text toggle doesn't resize the column */
.nav-row2 .nav-cell-mid {
    min-width: 0;
}

.nav-row2 .nav-cell-mid .selects-btn {
    display: inline-block;
    min-width: 9ch;
    text-align: center;
}

/* Row 2 left cell: absolutely positioned so it doesn't affect column width */
.nav-cell-trip {
    position: relative;
}

.selects-trip-wrap {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

/* Row 2 items */
.selects-trip {
    font-size: 13px;
    font-weight: 400;
    color: var(--text-secondary);
    letter-spacing: 0.01em;
}

.selects-counter {
    font-size: 12px;
    color: var(--text-secondary);
    letter-spacing: 0.02em;
}

.selects-btn {
    font-size: 12px;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
    transition: color 0.2s;
}

.selects-btn:hover {
    color: var(--text);
}

/* Dark nav (about view) */
.nav-dark {
    background: #1a1a1a;
    color: #ffffff;
}

.nav-dark .nav-grid {
    row-gap: 0;
}

.nav-dark .nav-grid > .nav-cell-left,
.nav-dark .nav-grid > .nav-cell-mid,
.nav-dark .nav-grid > .nav-cell-end {
    border-color: #444444;
    background: #333333;
}

.nav-dark .nav-link {
    color: #ffffff;
}

.nav-dark .nav-link:hover {
    color: #ffffff;
}

.nav-dark .nav-link.active {
    background: #666666;
}

.nav-dark .nav-name {
    color: #ffffff;
}

/* --- Panels Layout --- */
.panels-viewport {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
}

.panels-track {
    display: flex;
    width: 300%;
    height: 100%;
    transform: translateX(-33.333%);
    transition: transform 0.5s ease;
}

.panel {
    width: 33.333%;
    flex-shrink: 0;
    height: 100%;
    overflow: hidden;
}

/* --- Selects View (panel-selects) --- */
.panel-selects {
    display: flex;
    flex-direction: column;
    background: var(--bg);
}

/* Image container */
.selects-image-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px 24px;
    cursor: pointer;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
}

.selects-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border: 10px solid #cccccc;
    transition: opacity 0.15s ease;
}

.selects-image.loading {
    opacity: 0;
}

/* --- Information Panel --- */
.info-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    overflow-y: auto;
}

.info-content {
    max-width: 520px;
}

.info-title {
    font-size: 36px;
    line-height: 1.2;
    margin-bottom: 20px;
}

.info-caption {
    font-size: 15px;
    line-height: 1.7;
    color: var(--text);
    margin-bottom: 24px;
}

.info-place {
    font-size: 13px;
    color: var(--text-secondary);
    letter-spacing: 0.02em;
}

/* --- Index View (panel-index) --- */
.panel-index {
    overflow-y: auto;
    background: var(--bg);
    padding: 12px;
}

.index-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 4px;
}

.index-thumb {
    aspect-ratio: 1;
    overflow: hidden;
    cursor: pointer;
    position: relative;
}

.index-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.2s;
}

.index-thumb:hover img {
    opacity: 0.85;
}

/* --- About View (panel-about) --- */
.panel-about {
    background: #1a1a1a;
    color: #e0e0e0;
    overflow-y: auto;
}

.about {
    display: flex;
    justify-content: center;
    padding: 40px 24px 80px;
}

.about-content {
    max-width: 520px;
}

.about-heading {
    font-size: 42px;
    color: #ffffff;
    margin-bottom: 32px;
}

.about-text {
    font-size: 15px;
    line-height: 1.8;
    margin-bottom: 20px;
    color: #c0c0c0;
}

.about-label {
    font-size: 14px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #888888;
    margin-bottom: 6px;
    margin-top: 32px;
}

.about-link {
    font-size: 15px;
    color: #e0e0e0;
    transition: color 0.2s;
    display: inline-block;
}

.about-link:hover {
    color: #ffffff;
}

.about-contact,
.about-social {
    margin-top: 0;
}

/* --- About page (standalone, for direct URL access) --- */
.about-page {
    background: #1a1a1a;
    color: #e0e0e0;
    overflow: auto;
}

/* --- Responsive --- */

/* Tablet */
@media (max-width: 768px) {
    .selects-image-wrap {
        padding: 8px 16px 16px;
    }

    .panel-index {
        padding: 8px;
    }

    .index-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 3px;
    }

    .info-title {
        font-size: 28px;
    }
}

/* Mobile */
@media (max-width: 480px) {
    :root {
        --nav-height: 70px;
    }

    .nav {
        padding: 10px 12px 8px;
    }

    .nav-row {
        gap: 8px;
    }

    .nav-name {
        font-size: 12px;
    }

    .nav-link {
        font-size: 12px;
    }

    .nav-sep {
        font-size: 11px;
    }

    .selects-trip {
        font-size: 12px;
    }

    .selects-counter {
        font-size: 11px;
    }

    .selects-btn {
        font-size: 11px;
    }

    .selects-image-wrap {
        padding: 4px 8px 8px;
    }

    .panel-index {
        padding: 4px;
    }

    .index-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 2px;
    }

    .info-panel {
        padding: 24px 16px;
    }

    .info-title {
        font-size: 24px;
    }

    .info-caption {
        font-size: 14px;
    }

    .about {
        padding: 20px 16px 60px;
    }

    .about-heading {
        font-size: 32px;
    }
}
