/* ═══════════════════════════════════════════
   Photobox — Dark Archival Gallery
   ═══════════════════════════════════════════ */

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes modalIn {
    from { opacity: 0; transform: scale(0.96); }
    to { opacity: 1; transform: scale(1); }
}
@keyframes shimmer {
    0% { background-position: -400px 0; }
    100% { background-position: 400px 0; }
}

:root {
    /* Warm dark palette */
    --bg:           #0c0b09;
    --bg-elevated:  #151412;
    --bg-card:      #18171480;
    --bg-input:     #1c1b18;
    --border:       #2a2720;
    --border-light: #363228;

    /* Text */
    --text:         #e8e4db;
    --text-secondary: #9b9488;
    --text-dim:     #6b655b;

    /* Accent — warm amber/gold */
    --accent:       #c8a24e;
    --accent-glow:  #c8a24e30;
    --accent-hover: #dab55e;
    --accent-muted: #8a7236;

    /* Semantic */
    --green:  #7ec98a;
    --amber:  #d4a94e;
    --red:    #c97e7e;
    --teal:   #7eb8b0;

    /* Source colors */
    --wikimedia:  #7ec98a;
    --loc:        #c9a07e;
    --flickr:     #7e9ec9;
    --unsplash:   #7ec9c0;
    --pexels:     #c9c07e;

    --radius:     8px;
    --radius-lg:  12px;

    /* Typography */
    --font-display: 'DM Serif Display', Georgia, serif;
    --font-body:    'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    line-height: 1.55;
    min-height: 100vh;
}

::selection {
    background: var(--accent);
    color: var(--bg);
}

/* Noise overlay removed — caused pixelation on Retina displays */


/* ════════════════════════════════
   TOP NAV
   ════════════════════════════════ */

.topnav {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 0 32px;
    height: 56px;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 500;
    backdrop-filter: blur(12px);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--accent);
    flex-shrink: 0;
}

.logo-icon { display: flex; opacity: 0.8; }

.logo-text {
    font-family: var(--font-display);
    font-size: 20px;
    letter-spacing: 0.02em;
}

.nav-search {
    flex: 1;
    max-width: 420px;
}

.nav-search-inner {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 14px;
    height: 36px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 100px;
    transition: border-color 0.2s;
}

.nav-search-inner:focus-within {
    border-color: var(--accent-muted);
}

.nav-search-inner .search-icon {
    color: var(--text-dim);
    flex-shrink: 0;
}

.nav-search-inner input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: var(--text);
    font-family: var(--font-body);
    font-size: 13px;
}

.nav-search-inner input::placeholder { color: var(--text-dim); }


/* ════════════════════════════════
   CONTAINER
   ════════════════════════════════ */

.container {
    max-width: 1480px;
    margin: 0 auto;
    padding: 0 32px;
}


/* ════════════════════════════════
   HERO / LANDING
   ════════════════════════════════ */

.hero {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 56px);
    padding: 40px 0;
}

.hero-content {
    width: 100%;
    max-width: 680px;
    text-align: center;
    animation: fadeUp 0.6s ease-out;
}

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(48px, 8vw, 72px);
    font-weight: 400;
    color: var(--text);
    letter-spacing: -0.01em;
    line-height: 1.1;
    margin-bottom: 12px;
}

.hero-subtitle {
    font-size: 16px;
    color: var(--text-secondary);
    max-width: 460px;
    margin: 0 auto 40px;
    line-height: 1.6;
}

.hero-search {
    margin-bottom: 32px;
}

.hero-search-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 6px 6px 20px;
    background: var(--bg-input);
    border: 1px solid var(--border-light);
    border-radius: 100px;
    transition: border-color 0.25s, box-shadow 0.25s;
}

.hero-search-wrap:focus-within {
    border-color: var(--accent-muted);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.hero-search-wrap .search-icon {
    color: var(--text-dim);
    flex-shrink: 0;
}

.hero-input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: var(--text);
    font-family: var(--font-body);
    font-size: 16px;
    padding: 8px 0;
}

.hero-input::placeholder { color: var(--text-dim); }

.hero-btn {
    padding: 10px 28px;
    background: var(--accent);
    color: var(--bg);
    border: none;
    border-radius: 100px;
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
    white-space: nowrap;
}

.hero-btn:hover { background: var(--accent-hover); transform: scale(1.02); }
.hero-btn:active { transform: scale(0.98); }

/* Filter pills */
.hero-filters {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 14px;
    flex-wrap: wrap;
}

.pill-check { cursor: pointer; }
.pill-check input { display: none; }

.pill {
    display: inline-block;
    padding: 5px 14px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-dim);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    transition: all 0.2s;
    user-select: none;
}

.pill-check input:checked + .pill {
    color: var(--text);
    border-color: var(--border-light);
    background: var(--bg-card);
}

.pill-hd { letter-spacing: 0.06em; text-transform: uppercase; font-size: 11px; }

.pill-check input:checked + .pill-hd {
    color: var(--green);
    border-color: #7ec98a40;
}

.pill-photos { letter-spacing: 0.02em; }

.pill-check input:checked + .pill-photos {
    color: var(--accent);
    border-color: var(--accent-muted);
}

/* Suggestions */
.hero-suggestions {
    margin-top: 48px;
    animation: fadeUp 0.6s ease-out 0.2s both;
}

.suggestion-label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-dim);
    margin-bottom: 14px;
}

.suggestion-tags {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}

.suggestion {
    padding: 6px 16px;
    border-radius: 100px;
    font-size: 13px;
    color: var(--text-secondary);
    text-decoration: none;
    background: transparent;
    border: 1px solid var(--border);
    transition: all 0.2s;
}

.suggestion:hover {
    color: var(--accent);
    border-color: var(--accent-muted);
    background: var(--accent-glow);
}


/* ════════════════════════════════
   RESULTS PAGE
   ════════════════════════════════ */

.results-page {
    padding: 20px 0 60px;
}

.results-controls {
    margin-bottom: 20px;
}

.results-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.results-filters {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.pill-check-sm .pill {
    padding: 3px 12px;
    font-size: 11px;
}

.filter-divider {
    width: 1px;
    height: 20px;
    background: var(--border);
    margin: 0 6px;
}

.results-summary {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    font-size: 13px;
    color: var(--text-dim);
}

.results-query {
    font-family: var(--font-display);
    font-style: italic;
    color: var(--text-secondary);
    font-size: 15px;
}

/* ─── Grid ─── */
.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

/* ─── Image Cards ─── */
.image-card {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: pointer;
    background: var(--bg-elevated);
    animation: fadeUp 0.4s ease-out both;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.image-card:hover {
    transform: translateY(-4px);
    box-shadow:
        0 8px 24px rgba(0,0,0,0.3),
        0 0 0 1px var(--border-light);
}

.card-image {
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #0e0d0b;
    position: relative;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.image-card:hover .card-image img {
    transform: scale(1.05);
}

.image-card.broken .card-image {
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-card.broken .card-image::after {
    content: 'Image unavailable';
    color: var(--text-dim);
    font-size: 12px;
}

/* Source dot indicator */
.card-source-dot {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    opacity: 0.9;
    box-shadow: 0 0 6px currentColor;
}

.source-wikimedia  { background: var(--wikimedia); color: var(--wikimedia); }
.source-loc        { background: var(--loc); color: var(--loc); }
.source-flickr     { background: var(--flickr); color: var(--flickr); }
.source-unsplash   { background: var(--unsplash); color: var(--unsplash); }
.source-pexels     { background: var(--pexels); color: var(--pexels); }
.source-upload     { background: var(--accent); color: var(--accent); }
.source-openverse  { background: #c97ec9; color: #c97ec9; }
.source-met        { background: #c9b87e; color: #c9b87e; }
.source-archiveorg { background: #7eaac9; color: #7eaac9; }
.source-europeana  { background: #7ec9a0; color: #7ec9a0; }
.source-artic      { background: #c9887e; color: #c9887e; }
.source-cleveland  { background: #9e7ec9; color: #9e7ec9; }

/* Card footer */
.card-footer {
    padding: 10px 14px 12px;
}

.card-title {
    font-size: 12.5px;
    color: var(--text-secondary);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 8px;
}

.card-meta {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

/* Card hover overlay */
.card-hover {
    position: absolute;
    top: 0;
    right: 0;
    padding: 10px;
    opacity: 0;
    transition: opacity 0.2s;
}

.image-card:hover .card-hover { opacity: 1; }

.card-action {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: none;
    background: rgba(12, 11, 9, 0.75);
    color: var(--text);
    cursor: pointer;
    backdrop-filter: blur(8px);
    transition: background 0.15s, transform 0.15s;
}

.card-action:hover {
    background: var(--accent);
    color: var(--bg);
    transform: scale(1.1);
}


/* ════════════════════════════════
   BADGES
   ════════════════════════════════ */

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    background: var(--bg-input);
    color: var(--text-dim);
}

/* Source badges */
.badge-wikimedia  { color: var(--wikimedia); background: #7ec98a15; }
.badge-loc        { color: var(--loc);       background: #c9a07e15; }
.badge-flickr     { color: var(--flickr);    background: #7e9ec915; }
.badge-unsplash   { color: var(--unsplash);  background: #7ec9c015; }
.badge-pexels     { color: var(--pexels);    background: #c9c07e15; }
.badge-upload     { color: var(--accent);    background: var(--accent-glow); }
.badge-openverse  { color: #c97ec9;          background: #c97ec915; }
.badge-met        { color: #c9b87e;          background: #c9b87e15; }
.badge-archiveorg { color: #7eaac9;          background: #7eaac915; }
.badge-europeana  { color: #7ec9a0;          background: #7ec9a015; }
.badge-artic      { color: #c9887e;          background: #c9887e15; }
.badge-cleveland  { color: #9e7ec9;          background: #9e7ec915; }

/* License badges */
.badge-public-domain { color: var(--green); background: #7ec98a15; }
.badge-cc-by,
.badge-cc-by-sa      { color: var(--teal);  background: #7eb8b015; }
.badge-cc-by-nc      { color: var(--amber); background: #d4a94e15; }
.badge-ambiguous      { color: var(--text-dim); }

/* Size badges */
.badge-size-hd   { color: var(--green); background: #7ec98a15; }
.badge-size-mid  { color: var(--amber); background: #d4a94e15; }
.badge-size-low  { color: var(--red);   background: #c97e7e15; }


/* ════════════════════════════════
   BUTTONS
   ════════════════════════════════ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius);
    text-decoration: none;
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--accent);
    color: var(--bg);
}
.btn-primary:hover { background: var(--accent-hover); }

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}
.btn-ghost:hover {
    color: var(--text);
    border-color: var(--border-light);
    background: var(--bg-card);
}

.btn-sm { padding: 6px 14px; font-size: 12px; }


/* ════════════════════════════════
   MODAL
   ════════════════════════════════ */

.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(6, 5, 4, 0.92);
    backdrop-filter: blur(8px);
    animation: fadeIn 0.2s ease-out;
}

.modal-content {
    position: relative;
    background: var(--bg-elevated);
    border-radius: var(--radius-lg);
    max-width: 1100px;
    width: 100%;
    max-height: calc(100vh - 48px);
    overflow: hidden;
    border: 1px solid var(--border);
    animation: modalIn 0.25s ease-out;
    box-shadow: 0 24px 80px rgba(0,0,0,0.5);
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(12, 11, 9, 0.6);
    border: 1px solid var(--border);
    border-radius: 50%;
    color: var(--text-secondary);
    cursor: pointer;
    z-index: 10;
    transition: all 0.15s;
    backdrop-filter: blur(8px);
}

.modal-close:hover {
    color: var(--text);
    background: var(--bg-input);
}

.modal-body {
    display: flex;
    height: 100%;
    max-height: calc(100vh - 48px);
}

.modal-image {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: #080706;
}

.modal-image img {
    max-width: 100%;
    max-height: 75vh;
    object-fit: contain;
    border-radius: 4px;
}

.modal-sidebar {
    width: 340px;
    flex-shrink: 0;
    border-left: 1px solid var(--border);
    overflow-y: auto;
}

.modal-sidebar-inner {
    padding: 28px 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.modal-header h2 {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 400;
    line-height: 1.4;
    color: var(--text);
}

.modal-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    max-height: 140px;
    overflow-y: auto;
}

.modal-desc::-webkit-scrollbar { width: 3px; }
.modal-desc::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.modal-meta {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.meta-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-dim);
}

.meta-value {
    font-size: 13px;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
}

.modal-attribution {
    font-size: 12px;
    color: var(--text-dim);
    font-style: italic;
    line-height: 1.5;
}

.modal-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: auto;
}

.modal-actions .btn { width: 100%; }


/* ════════════════════════════════
   PAGINATION
   ════════════════════════════════ */

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 40px 0 20px;
}

.page-numbers {
    display: flex;
    align-items: center;
    gap: 4px;
}

.page-num {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.15s;
}

.page-num:hover {
    color: var(--text);
    background: var(--bg-card);
}

.page-current {
    background: var(--accent);
    color: var(--bg);
}

.page-current:hover {
    background: var(--accent);
    color: var(--bg);
}

.page-ellipsis {
    width: 28px;
    text-align: center;
    color: var(--text-dim);
    font-size: 14px;
}

.page-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    border: 1px solid var(--border);
    transition: all 0.15s;
}

.page-btn:hover {
    color: var(--text);
    border-color: var(--border-light);
    background: var(--bg-card);
}

.results-page-info {
    color: var(--text-dim);
    font-size: 12px;
}


/* ════════════════════════════════
   EMPTY STATE
   ════════════════════════════════ */

.empty-state {
    text-align: center;
    padding: 80px 0;
    color: var(--text-dim);
    animation: fadeUp 0.4s ease-out;
}

.empty-state svg { margin-bottom: 16px; opacity: 0.4; }
.empty-state p { font-size: 15px; color: var(--text-secondary); margin-bottom: 6px; }
.empty-state span { font-size: 13px; }


/* ════════════════════════════════
   SCROLLBAR
   ════════════════════════════════ */

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-light); }


/* ════════════════════════════════
   NAV LINKS
   ════════════════════════════════ */

.nav-links {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-dim);
    text-decoration: none;
    transition: all 0.15s;
}

.nav-link:hover {
    color: var(--text);
    background: var(--bg-card);
}

.nav-link-workspace {
    color: var(--accent);
    border: 1px solid var(--accent-muted);
}

.nav-link-workspace:hover {
    background: var(--accent-glow);
    color: var(--accent-hover);
}


/* ════════════════════════════════
   AUTH
   ════════════════════════════════ */

.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 56px);
    padding: 40px 16px;
    background:
        radial-gradient(ellipse at 20% 50%, var(--accent-glow) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, #7ec98a10 0%, transparent 40%),
        var(--bg);
}

.auth-card {
    width: 100%;
    max-width: 400px;
    padding: 40px 36px 36px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow:
        0 4px 24px rgba(0, 0, 0, 0.3),
        0 0 80px var(--accent-glow);
    animation: fadeUp 0.5s ease-out;
}

.auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.auth-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
    color: var(--accent);
}

.auth-logo svg { opacity: 0.8; }

.auth-logo-text {
    font-family: var(--font-display);
    font-size: 22px;
}

.auth-title {
    font-family: var(--font-display);
    font-size: 26px;
    font-weight: 400;
    margin-bottom: 8px;
    color: var(--text);
}

.auth-subtitle {
    font-size: 14px;
    color: var(--text-dim);
    line-height: 1.5;
}

.auth-divider {
    height: 1px;
    background: var(--border);
    margin: 0 0 24px;
}

.auth-alert {
    padding: 10px 14px;
    border-radius: var(--radius);
    font-size: 13px;
    margin-bottom: 20px;
    text-align: center;
}

.auth-alert-error {
    background: #c97e7e12;
    color: var(--red);
    border: 1px solid #c97e7e25;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.form-group label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-dim);
    font-weight: 500;
}

.form-group input {
    padding: 12px 16px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 15px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent-muted);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-group input::placeholder {
    color: var(--text-dim);
}

.auth-btn {
    display: block;
    width: 100%;
    margin-top: 6px;
    padding: 13px 20px;
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.02em;
    border-radius: var(--radius);
    background: var(--accent);
    color: var(--bg);
    border: none;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.auth-btn:hover {
    background: var(--accent-hover);
}

.auth-btn:active {
    transform: scale(0.98);
}

.auth-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.auth-back {
    font-size: 13px;
    color: var(--text-dim);
    text-decoration: none;
    transition: color 0.15s;
}

.auth-back:hover { color: var(--text-secondary); }


/* ════════════════════════════════
   WORKSPACE
   ════════════════════════════════ */

.workspace-page {
    padding: 40px 0 60px;
    animation: fadeUp 0.4s ease-out;
}

.workspace-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 40px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

.workspace-title {
    font-family: var(--font-display);
    font-size: 32px;
    font-weight: 400;
    line-height: 1.2;
}

.workspace-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 6px;
}

.workspace-sections {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.workspace-card {
    padding: 32px 28px;
    background: var(--bg-elevated);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.workspace-card:hover {
    border-color: var(--border-light);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.workspace-card-placeholder {
    opacity: 0.5;
    border-style: dashed;
}

.workspace-card-placeholder:hover {
    opacity: 0.7;
}

.workspace-card-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: var(--bg-card);
    color: var(--text-dim);
    margin-bottom: 20px;
}

.workspace-card h3 {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 400;
    margin-bottom: 8px;
    color: var(--text);
}

.workspace-card p {
    font-size: 13px;
    color: var(--text-dim);
    line-height: 1.6;
}

.workspace-card-tag {
    display: inline-block;
    margin-top: 14px;
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--amber);
    background: #d4a94e15;
    border: 1px solid #d4a94e25;
}


/* ════════════════════════════════
   BOARD TABS & CARDS
   ════════════════════════════════ */

.workspace-card-tag-active {
    color: var(--green);
    background: #7ec98a15;
    border-color: #7ec98a25;
}

a.workspace-card {
    text-decoration: none;
    color: inherit;
    display: block;
    opacity: 1;
    border-style: solid;
}

a.workspace-card:hover {
    border-color: var(--accent-muted);
}

.board-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0;
}

.board-tab {
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-dim);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: color 0.15s, border-color 0.15s;
}

.board-tab:hover { color: var(--text-secondary); }

.board-tab-active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.board-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.board-card {
    display: block;
    text-decoration: none;
    color: inherit;
    background: var(--bg-elevated);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    overflow: hidden;
    transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
    animation: fadeUp 0.4s ease-out both;
}

.board-card:hover {
    border-color: var(--border-light);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.board-card-cover {
    aspect-ratio: 16 / 10;
    background: #0e0d0b;
    overflow: hidden;
}

.board-card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.board-card-placeholder-img {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--border);
}

.board-card-body { padding: 12px 14px 14px; }

.board-card-num {
    font-size: 11px;
    color: var(--text-dim);
    font-weight: 600;
}

.board-card-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    margin: 2px 0 4px;
    line-height: 1.3;
}

.board-card-gender {
    font-weight: 400;
    color: var(--text-dim);
    font-size: 12px;
}

.board-card-mele {
    font-family: var(--font-display);
    font-style: italic;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.board-card-count {
    font-size: 11px;
    color: var(--accent);
    font-weight: 500;
}


/* ════════════════════════════════
   BOARD DETAIL
   ════════════════════════════════ */

.board-detail { padding: 24px 0 60px; }

.board-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-dim);
    text-decoration: none;
    margin-bottom: 16px;
    transition: color 0.15s;
}

.board-back:hover { color: var(--text-secondary); }

.board-detail-header {
    margin-bottom: 28px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

.board-detail-num {
    font-size: 12px;
    font-weight: 600;
    color: var(--accent);
    letter-spacing: 0.04em;
}

.board-detail-title {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 400;
    line-height: 1.3;
    margin: 4px 0;
}

.board-detail-gender {
    font-size: 16px;
    color: var(--text-dim);
    font-weight: 400;
}

.board-detail-mele {
    font-family: var(--font-display);
    font-style: italic;
    font-size: 18px;
    color: var(--accent);
    margin-bottom: 8px;
}

.board-detail-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-dim);
    flex-wrap: wrap;
}

.meta-dot {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--border-light);
}

/* Two-column layout */
.board-detail-layout {
    display: flex;
    gap: 32px;
}

.board-detail-main {
    flex: 1;
    min-width: 0;
}

.board-sidebar {
    width: 280px;
    flex-shrink: 0;
}

/* Board sections */
.board-section {
    margin-bottom: 32px;
}

.board-section-title {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 400;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.board-section-count {
    font-family: var(--font-body);
    font-size: 12px;
    padding: 1px 8px;
    border-radius: 100px;
    background: var(--bg-card);
    color: var(--text-dim);
}

.board-section-hint {
    font-size: 12px;
    color: var(--text-dim);
    margin-bottom: 12px;
}

.board-description {
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-secondary);
}

.board-description p { margin-bottom: 12px; }

.board-empty-hint {
    font-size: 13px;
    color: var(--text-dim);
    padding: 20px 0;
}

.board-loading {
    font-size: 13px;
    color: var(--text-dim);
    padding: 20px 0;
}

/* Keyword search sections */
.keyword-section {
    margin-bottom: 24px;
}

.keyword-section-title {
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.keyword-section-label {
    padding: 3px 12px;
    border-radius: 100px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-style: italic;
}

/* Saved images grid */
.board-saved-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 8px;
}

.board-saved-card {
    position: relative;
    aspect-ratio: 1;
    border-radius: var(--radius);
    overflow: hidden;
    background: #0e0d0b;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
}

.board-saved-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.board-saved-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.board-remove-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: none;
    background: rgba(12, 11, 9, 0.7);
    color: var(--red);
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s;
}

.board-saved-actions {
    position: absolute;
    top: 4px;
    right: 4px;
    display: flex;
    gap: 3px;
    opacity: 0;
    transition: opacity 0.15s;
}

.board-saved-card:hover .board-saved-actions { opacity: 1; }

.board-saved-actions .board-dl-btn,
.board-saved-actions .board-remove-btn {
    width: 24px;
    height: 24px;
    position: static;
    opacity: 1;
}

/* Auto-search result grid */
.board-search-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
}

.board-result-card {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
}

.board-result-card img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    display: block;
}

.board-result-info {
    padding: 6px 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.board-result-title {
    font-size: 10px;
    color: var(--text-dim);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.board-save-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: none;
    background: rgba(12, 11, 9, 0.75);
    color: var(--text);
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s, background 0.15s;
    backdrop-filter: blur(4px);
}

.board-result-actions {
    position: absolute;
    top: 6px;
    right: 6px;
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.15s;
}

.board-result-card:hover .board-result-actions { opacity: 1; }

.board-save-btn:hover, .board-dl-btn:hover {
    background: var(--accent);
    color: var(--bg);
}

.board-dl-btn {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: none;
    background: rgba(12, 11, 9, 0.75);
    color: var(--text);
    cursor: pointer;
    text-decoration: none;
    backdrop-filter: blur(4px);
    transition: background 0.15s;
}

.board-save-btn-saved {
    opacity: 1 !important;
    background: var(--green);
    color: var(--bg);
}

/* Make save btn not position:absolute when inside actions div */
.board-result-actions .board-save-btn {
    position: static;
    opacity: 1;
}

/* Sidebar */
.sidebar-section {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.sidebar-section:last-child { border-bottom: none; }

.sidebar-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-dim);
    margin-bottom: 10px;
    font-weight: 600;
}

.sidebar-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.sidebar-tag {
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 12px;
    color: var(--text-secondary);
    background: var(--bg-card);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.15s;
    font-family: var(--font-body);
}

.sidebar-tag:hover {
    color: var(--accent);
    border-color: var(--accent-muted);
    background: var(--accent-glow);
}

.sidebar-tag-keyword {
    font-style: italic;
    color: var(--text-dim);
}

.sidebar-mele-list { display: flex; flex-direction: column; gap: 8px; }

.sidebar-mele-item { display: flex; flex-direction: column; gap: 2px; }

.sidebar-mele-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-dim);
}

.sidebar-mele-value {
    font-size: 13px;
    color: var(--text-secondary);
}


/* ════════════════════════════════
   RESPONSIVE
   ════════════════════════════════ */

@media (max-width: 900px) {
    .topnav { padding: 0 16px; }
    .container { padding: 0 16px; }
    .results-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
    .modal-body { flex-direction: column; }
    .modal-sidebar { width: 100%; border-left: none; border-top: 1px solid var(--border); }
    .modal-image { padding: 16px; }
    .board-detail-layout { flex-direction: column; }
    .board-sidebar { width: 100%; }
    .board-tabs { overflow-x: auto; }
}

@media (max-width: 600px) {
    .hero-title { font-size: 40px; }
    .hero-subtitle { font-size: 14px; }
    .results-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
    .card-footer { padding: 8px 10px; }
    .card-title { font-size: 11px; }
    .topnav { gap: 12px; }
    .logo-text { display: none; }
}
