:root {
    --bg: #0e0f13;
    --bg-elev: #171922;
    --surface: #1e2030;
    --border: #2a2d3d;
    --text: #eef0f6;
    --text-dim: #a2a7b8;
    --accent: #d8a657;
    --radius: 12px;
    --maxw: 1200px;
    --font-body: 'Inter', system-ui, -apple-system, Segoe UI, sans-serif;
    --font-display: 'Fraunces', Georgia, serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

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

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

/* --- Header / footer --- */
.site-header {
    padding: 32px 24px 24px;
    max-width: var(--maxw);
    margin: 0 auto;
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.site-nav { display: flex; gap: 22px; }
.site-nav a { color: var(--text-dim); font-size: 0.95rem; }
.site-nav a:hover { color: var(--text); }
.brand { display: inline-flex; flex-direction: column; gap: 2px; }
.brand-title {
    font-family: var(--font-display);
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    font-weight: 600;
    letter-spacing: -0.01em;
}
.brand-tagline { color: var(--text-dim); font-size: 0.95rem; }

.site-main {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 8px 24px 64px;
    min-height: 60vh;
}

.site-footer {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 32px 24px;
    color: var(--text-dim);
    font-size: 0.85rem;
    border-top: 1px solid var(--border);
}

/* --- Prose (About etc.) --- */
.prose { max-width: 68ch; margin-top: 8px; }
.prose h1 { font-family: var(--font-display); font-size: clamp(1.8rem, 4vw, 2.6rem); margin: 0 0 20px; }
.prose p { font-size: 1.08rem; line-height: 1.75; color: #d7dae6; margin: 0 0 18px; }
.prose a { color: var(--accent); }
.prose a:hover { text-decoration: underline; }

/* --- Landing page --- */
.landing-hero {
    padding: 48px 0 40px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 36px;
}
.landing-hero h1 {
    font-family: var(--font-display);
    font-size: clamp(2.2rem, 6vw, 3.6rem);
    font-weight: 600; letter-spacing: -0.02em; margin: 0 0 10px;
}
.landing-tagline { color: var(--text-dim); font-size: 1.15rem; max-width: 60ch; margin: 0; }

.section-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}
.section-card {
    display: block; background: var(--bg-elev); border: 1px solid var(--border);
    border-radius: var(--radius); overflow: hidden;
    transition: transform 0.18s ease, border-color 0.18s ease;
}
.section-card:hover { transform: translateY(-3px); border-color: var(--accent); }
.section-cover { aspect-ratio: 16 / 9; background: var(--surface); overflow: hidden; }
.section-cover img { width: 100%; height: 100%; object-fit: cover; }
.section-meta { padding: 16px 18px 18px; }
.section-title { font-family: var(--font-display); font-size: 1.4rem; font-weight: 600; margin: 0 0 4px; }
.section-desc { color: var(--text-dim); font-size: 0.9rem; }

/* --- Album search (home) --- */
.album-search {
    display: flex; align-items: center; gap: 14px; margin-top: 8px;
}
.album-search input {
    -webkit-appearance: none; appearance: none;
    flex: 1; max-width: 460px;
    padding: 12px 18px 12px 46px;              /* left room for the icon */
    color: var(--text); font-family: inherit; font-size: 1rem;
    background-color: var(--bg-elev);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23a2a7b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 16px center;
    border: 1px solid var(--border);
    border-radius: 999px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}
.album-search input::placeholder { color: var(--text-dim); }
.album-search input:hover { border-color: #3a3e52; }
.album-search input:focus {
    outline: none;
    border-color: var(--accent);
    background-color: var(--surface);
    box-shadow: 0 0 0 3px rgba(216, 166, 87, 0.18);
}
/* Recolor the native clear (×) button for the dark theme */
.album-search input::-webkit-search-cancel-button {
    -webkit-appearance: none; appearance: none;
    height: 15px; width: 15px; cursor: pointer;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='15' height='15' viewBox='0 0 24 24' fill='none' stroke='%23a2a7b8' stroke-width='2.5' stroke-linecap='round'%3E%3Cline x1='18' y1='6' x2='6' y2='18'/%3E%3Cline x1='6' y1='6' x2='18' y2='18'/%3E%3C/svg%3E") no-repeat center;
}
.album-search input::-webkit-search-cancel-button:hover { filter: brightness(1.6); }
.album-search-clear {
    flex: none; padding: 9px 16px; border-radius: 999px; cursor: pointer;
    background: var(--bg-elev); border: 1px solid var(--border);
    color: var(--text-dim); font-family: inherit; font-size: 0.9rem;
    transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.album-search-clear:hover { color: var(--text); border-color: var(--accent); }
.album-search-count { color: var(--text-dim); font-size: 0.85rem; white-space: nowrap; }

/* --- Album grid (home) --- */
.album-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 24px;
    margin-top: 24px;
}
.album-card {
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform 0.18s ease, border-color 0.18s ease;
}
.album-card:hover { transform: translateY(-3px); border-color: var(--accent); }
.album-cover { aspect-ratio: 4 / 3; background: var(--surface); overflow: hidden; }
.album-cover img { width: 100%; height: 100%; object-fit: cover; }
.album-cover--empty {
    width: 100%; height: 100%;
    background: linear-gradient(135deg, var(--surface), var(--bg-elev));
}
.album-meta { padding: 14px 16px 16px; }
.album-title { font-family: var(--font-display); font-size: 1.2rem; font-weight: 600; margin: 0 0 4px; }
.album-count { color: var(--text-dim); font-size: 0.85rem; }

/* --- Album page --- */
.crumbs { margin: 8px 0 20px; }
.crumbs a { color: var(--text-dim); font-size: 0.9rem; }
.crumbs a:hover { color: var(--text); }
.album-header { margin-bottom: 28px; }
.album-header h1 { font-family: var(--font-display); font-size: clamp(1.8rem, 4vw, 2.6rem); margin: 0 0 8px; }
.album-description { color: var(--text-dim); max-width: 60ch; }

/* --- Photo grid --- */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
}
.photo-tile {
    padding: 0; border: none; background: var(--surface);
    border-radius: 8px; overflow: hidden; cursor: pointer;
    aspect-ratio: 1 / 1;
}
.photo-tile img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s ease; }
.photo-tile:hover img { transform: scale(1.05); }
.photo-tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* --- Empty state --- */
.empty-state { text-align: center; padding: 80px 20px; color: var(--text-dim); }
.empty-state h1 { font-family: var(--font-display); color: var(--text); }

/* --- Lightbox --- */
.lightbox {
    position: fixed; inset: 0; z-index: 100;
    background: rgba(8, 9, 12, 0.96);
    display: flex; align-items: center; justify-content: center;
    padding: 24px;
}
.lightbox[hidden] { display: none; }
.lb-image { max-width: 92vw; max-height: 88vh; object-fit: contain; border-radius: 4px; }
.lb-close, .lb-prev, .lb-next {
    position: absolute; background: rgba(255,255,255,0.08); color: #fff;
    border: none; cursor: pointer; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.15s ease;
}
.lb-close:hover, .lb-prev:hover, .lb-next:hover { background: rgba(255,255,255,0.2); }
.lb-close { top: 16px; right: 16px; width: 44px; height: 44px; font-size: 28px; }
.lb-prev, .lb-next { top: 50%; transform: translateY(-50%); width: 52px; height: 52px; font-size: 34px; }
.lb-prev { left: 16px; }
.lb-next { right: 16px; }
.lb-bar {
    position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%);
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    max-width: 80vw; text-align: center;
}
.lb-caption { color: var(--text-dim); font-size: 0.9rem; }
.lb-full {
    color: var(--accent); font-size: 0.85rem; text-decoration: none;
    border: 1px solid var(--accent); border-radius: 20px; padding: 5px 14px;
    transition: background 0.15s ease, color 0.15s ease;
}
.lb-full:hover { background: var(--accent); color: #1a1206; }

@media (max-width: 600px) {
    .site-header, .site-main, .site-footer { padding-left: 16px; padding-right: 16px; }
    .photo-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 6px; }
    .lb-prev, .lb-next { width: 40px; height: 40px; font-size: 26px; }
}
