/* Import Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Manrope:wght@400;600;800&display=swap');

@font-face {
    font-family: 'LT Remark';
    src: url('fonts/LTRemark-Bold.otf') format('opentype');
    font-weight: bold;
    font-style: normal;
}

@font-face {
    font-family: 'Chalet New York';
    src: url('fonts/chalet_newyorknineteeneighty.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
}

:root {
    --color-bg-start: #020204;
    --color-bg-end: #0a1a2a;
    --color-text-main: #ffffff;
    --color-text-muted: #8899a6;
    --color-accent: #3366ff;
    --color-border: rgba(255, 255, 255, 0.1);

    --font-main: 'Manrope', sans-serif;
    --font-display: 'Inter', sans-serif;
    --font-title: 'LT Remark', 'Inter', sans-serif;

    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 4rem;
    --spacing-xl: 8rem;
}

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

body {
    font-family: var(--font-main);
    background: linear-gradient(135deg, var(--color-bg-start) 0%, var(--color-bg-end) 100%);
    color: var(--color-text-main);
    line-height: 1.4;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Hero Section */
.hero-section {
    padding: var(--spacing-md);
    min-height: 90vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

.hero-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--spacing-xl);
    border-bottom: 1px solid var(--color-border);
    padding-bottom: var(--spacing-sm);
}

.hero-brand {
    font-family: 'Chalet New York', var(--font-display);
    font-weight: 700;
    font-size: 1.5rem;
    letter-spacing: -0.04em;
}

.hero-meta {
    display: flex;
    gap: var(--spacing-md);
    font-size: 0.8rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.hero-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.hero-title {
    font-family: var(--font-title);
    font-size: clamp(4rem, 12vw, 12rem);
    font-weight: 700;
    line-height: 0.8;
    text-transform: uppercase;
    display: flex;
    flex-direction: column;
    margin-bottom: var(--spacing-lg);
    letter-spacing: -0.06em;
}

.hero-title .line {
    display: block;
}

.hero-title .line.indent {
    margin-left: 2em;
}

.hero-title .line.right {
    text-align: right;
}

.hero-subtext {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    font-size: 0.9rem;
    color: var(--color-text-muted);
    border-bottom: 1px solid var(--color-border);
    padding-bottom: var(--spacing-md);
}

.align-right {
    text-align: right;
}

.font-chalet {
    font-family: 'Chalet New York', sans-serif;
    letter-spacing: -0.04em;
    /* Tight kerning for Chalet */
}

/* Navigation */
.sticky-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: transparent;
    backdrop-filter: blur(10px);
    border-bottom: none;
    padding: var(--spacing-sm) var(--spacing-md);
}

.nav-container {
    display: flex;
    gap: var(--spacing-md);
    overflow-x: auto;
    scrollbar-width: none;
}

.folder-tab {
    background: transparent;
    border: 1px solid var(--color-border);
    color: var(--color-text-muted);
    padding: 0.5rem 1.5rem;
    border-radius: 100px;
    cursor: pointer;
    font-family: var(--font-main);
    font-size: 0.85rem;
    text-transform: uppercase;
    transition: all 0.3s ease;
}

.folder-tab:hover {
    border-color: var(--color-text-main);
    color: var(--color-text-main);
}

.folder-tab.active {
    background: var(--color-text-main);
    color: var(--color-bg-start);
    border-color: var(--color-text-main);
}

/* Main Grid */
main {
    padding: var(--spacing-md);
    max-width: 1800px;
    margin: 0 auto;
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: var(--spacing-xs);
}

.project-card {
    position: relative;
    background: transparent;
    border: none;
    border-radius: 0;
    overflow: hidden;
    transition: transform 0.3s ease;
    cursor: pointer;
}

.project-card:hover {
    transform: translateY(-5px);
}

.card-media-wrapper {
    width: 100%;
    aspect-ratio: 4/5;
    overflow: hidden;
    position: relative;
}

.card-media {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
    filter: grayscale(20%);
}

.project-card:hover .card-media {
    transform: scale(1.05);
    filter: grayscale(0%);
}

.card-content-text {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: var(--spacing-md);
    text-align: center;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 2rem;
    line-height: 1.1;
    text-transform: uppercase;
}

.card-info {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: var(--spacing-sm);
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    pointer-events: none;
    /* Let clicks pass through to card */
}

.project-card:hover .card-info {
    opacity: 1;
    transform: translateY(0);
}

.card-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #ffffff;
    /* Ensure white text on dark overlay */
    letter-spacing: 0.05em;
}

.card-category {
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.7);
    /* Lighter white for category */
    text-transform: uppercase;
    margin-top: 4px;
    letter-spacing: 0.1em;
}

.card-arrow {
    font-size: 1.2rem;
    color: #ffffff !important;
    opacity: 1 !important;
    transition: transform 0.3s ease;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    width: auto !important;
    height: auto !important;
}

.project-card:hover .card-arrow {
    background: var(--color-text-main);
    color: var(--color-bg-start);
    transform: rotate(-45deg);
}

/* Responsive */
@media (max-width: 768px) {
    .hero-title {
        font-size: 3.5rem;
    }

    .hero-title .line.indent {
        margin-left: 0;
    }

    .hero-subtext {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-sm);
    }

    .align-right {
        text-align: left;
    }

    .project-grid {
        grid-template-columns: 1fr;
    }
}

/* Project Detail Overlay */
.project-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--color-bg-start);
    z-index: 500;
    overflow-y: auto;
    padding: var(--spacing-lg) var(--spacing-md);
    opacity: 1;
    transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.project-overlay.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px);
}

.close-project-btn {
    position: fixed;
    top: var(--spacing-md);
    right: var(--spacing-md);
    background: transparent;
    border: 1px solid var(--color-border);
    color: var(--color-text-main);
    padding: 0.5rem 1rem;
    border-radius: 100px;
    cursor: pointer;
    font-family: var(--font-mono);
    z-index: 501;
    transition: all 0.2s;
}

.close-project-btn:hover {
    background: var(--color-text-main);
    color: var(--color-bg-start);
}

.project-content-container {
    max-width: 1200px;
    margin: 0 auto;
    padding-top: var(--spacing-lg);
}

.project-header {
    margin-bottom: var(--spacing-xl);
    border-bottom: 1px solid var(--color-border);
    padding-bottom: var(--spacing-md);
}

.detail-title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 5rem);
    text-transform: uppercase;
    line-height: 0.9;
    margin-bottom: var(--spacing-md);
}

.detail-meta {
    display: flex;
    gap: var(--spacing-md);
    font-family: var(--font-mono);
    color: var(--color-text-muted);
    margin-bottom: var(--spacing-md);
    align-items: center;
    text-transform: uppercase;
}

.detail-category-select {
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    color: var(--color-accent);
    border: none;
    border-bottom: 1px dashed var(--color-accent);
    padding: 0 1.5rem 0 0;
    font-family: var(--font-mono);
    font-size: 1rem;
    text-transform: uppercase;
    border-radius: 0;
    cursor: pointer;
    outline: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%233366ff%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 0 center;
    background-size: 0.65em auto;
}

.detail-category-select.hidden {
    display: none;
}

.detail-description {
    font-size: 1.2rem;
    max-width: 600px;
    color: var(--color-text-main);
}

.detail-gallery {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
}

.detail-image {
    width: auto;
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
    display: block;
    margin: 0 auto;
}

.detail-image-wrapper {
    position: relative;
}

.delete-gallery-img-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 24px;
    height: 24px;
    background: rgba(255, 0, 0, 0.8);
    color: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-family: var(--font-mono);
    font-weight: bold;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 10;
}

.detail-image-wrapper:hover .delete-gallery-img-btn,
.detail-image-wrapper:active .delete-gallery-img-btn {
    opacity: 1;
}

.delete-gallery-img-btn:hover {
    background: red;
    transform: scale(1.1);
}

/* Admin UI */
/* Admin Panel */
.admin-panel {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(10, 10, 10, 0.95);
    border: 1px solid var(--color-border);
    padding: 20px;
    border-radius: 12px;
    z-index: 1000;
    color: white;
    width: 300px;
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.admin-panel.hidden {
    display: none;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--color-text-main);
    font-family: var(--font-mono);
    font-weight: bold;
}

.color-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

input[type="color"] {
    -webkit-appearance: none;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    background: none;
    padding: 0;
    overflow: hidden;
}

input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

input[type="color"]::-webkit-color-swatch {
    border: 1px solid var(--color-border);
    border-radius: 50%;
}

.admin-btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    font-family: var(--font-mono);
}

.admin-btn.save {
    background: var(--color-accent);
    color: white;
}

.admin-btn.add {
    background: #333;
    color: var(--color-text-main);
    border: 1px solid var(--color-border);
}

.admin-btn.add:hover {
    background: var(--color-text-main);
    color: var(--color-bg-start);
}

.admin-btn.close {
    background: #333;
    color: #888;
}

.add-image-placeholder {
    width: 100%;
    height: 200px;
    border: 2px dashed var(--color-border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-muted);
    cursor: pointer;
    border-radius: 4px;
    font-family: var(--font-mono);
    transition: all 0.2s;
}

.add-image-placeholder:hover {
    border-color: var(--color-accent);
    color: var(--color-accent);
}

.admin-hint {
    color: #888;
    font-size: 0.8rem;
    font-family: var(--font-mono);
}

/* Edit Mode Highlights */
[contenteditable="true"] {
    outline: 1px dashed var(--color-accent);
    min-width: 20px;
    cursor: text;
}

[contenteditable="true"]:focus {
    outline: 2px solid var(--color-accent);
    background: rgba(51, 102, 255, 0.1);
}

.editable-image-container {
    position: relative;
    cursor: pointer;
}

.editable-image-container::after {
    content: "EDIT IMAGE";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
    font-family: var(--font-mono);
    pointer-events: none;
}

.editing-active .editable-image-container:hover::after {
    opacity: 1;
}

/* Add Project Card */
.project-card.add-card {
    border: 2px dashed var(--color-border);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--color-text-muted);
    transition: all 0.3s ease;
    min-height: 400px;
    /* Match approx height of other cards */
}

.project-card.add-card:hover {
    border-color: var(--color-accent);
    color: var(--color-accent);
    background: rgba(51, 102, 255, 0.05);
}

.add-card-icon {
    font-size: 3rem;
    margin-bottom: var(--spacing-sm);
}

.add-card-text {
    font-family: var(--font-mono);
    font-weight: bold;
    letter-spacing: 0.1em;
}

/* Delete Button */
.delete-project-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    background: rgba(255, 0, 0, 0.8);
    color: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    font-family: var(--font-mono);
    font-weight: bold;
    opacity: 0;
    transition: opacity 0.2s;
}

.project-card:hover .delete-project-btn {
    opacity: 1;
}

.delete-project-btn:hover {
    background: red;
    transform: scale(1.1);
}

/* Site Password Overlay */
.site-password-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000000;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease;
}

.site-password-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.password-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4rem;
    /* Increased gap for breathability */
}

.password-brand {
    margin-bottom: 1rem;
}

.password-logo {
    max-width: 150px;
    height: auto;
    display: block;
}

.password-input-wrapper {
    display: flex;
    gap: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 1rem;
    /* More space above line */
    width: 320px;
    /* Wider to fit text comfortably */
    justify-content: center;
}

#site-password-input {
    background: transparent;
    border: none;
    color: white;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    /* Smaller, sharper font */
    text-align: center;
    outline: none;
    width: 100%;
    letter-spacing: 0.3em;
    /* Wider spacing for premium feel */
    text-transform: uppercase;
}

#site-password-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
    letter-spacing: 0.2em;
    font-size: 0.85rem;
}

#site-password-submit {
    background: transparent;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    transition: transform 0.2s;
}

#site-password-submit:hover {
    transform: translateX(5px);
}

.password-error {
    color: #ff3333;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    letter-spacing: 0.1em;
}

.password-error.hidden {
    display: none;
}