:root {
    --bg: #fafafa;
    --text: #1a1a1a;
    --text-muted: #888;
    --text-light: #aaa;
    --border: #e8e8e8;
    --card-bg: #fff;
    --accent: #1a1a1a;
    --gear-bg: #f8f8f8;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0a0a0a;
        --text: #e8e8e8;
        --text-muted: #888;
        --text-light: #666;
        --border: #222;
        --card-bg: #111;
        --accent: #e8e8e8;
        --gear-bg: #151515;
    }
}

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

html {
    font-size: 16px;
}

body {
    font-family: 'DM Sans', -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.5;
    font-weight: 300;
}

/* Header */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
}

.header-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1.5rem;
    font-weight: 300;
    letter-spacing: 0.02em;
    color: var(--text);
    text-decoration: none;
}

nav {
    display: flex;
    gap: 2rem;
    align-items: center;
}

nav a {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-decoration: none;
    letter-spacing: 0.03em;
    transition: color 0.2s ease;
}

nav a:hover {
    color: var(--text);
}

.btn {
    padding: 0.6rem 1.4rem;
    border-radius: 2px;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    border: none;
    font-family: inherit;
}

.btn-outline {
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text);
}

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

.btn-solid {
    border: 1px solid var(--text);
    background: var(--text);
    color: var(--bg);
}

.btn-solid:hover {
    opacity: 0.85;
}

/* Main Content */
main {
    padding-top: 80px;
    min-height: 100vh;
}

/* Feed */
.feed {
    max-width: 680px;
    margin: 0 auto;
    padding: 3rem 1.5rem;
}

.feed-header {
    margin-bottom: 3rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.feed-header h1 {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1.1rem;
    font-weight: 400;
    color: var(--text-muted);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.back-link {
    display: inline-block;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-decoration: none;
    margin-bottom: 1rem;
    transition: color 0.2s ease;
}

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

.filtered-count {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-top: 0.5rem;
}

.filtered-grid {
    margin-top: 2rem;
}

/* Photo Card */
.photo-card {
    margin-bottom: 4rem;
    animation: fadeIn 0.6s ease;
}

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

.photo-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.photo-author {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.author-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 400;
    overflow: hidden;
}

.author-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.author-info {
    display: flex;
    flex-direction: column;
}

.author-name {
    font-size: 0.9rem;
    color: var(--text);
    text-decoration: none;
    font-weight: 400;
    cursor: pointer;
}

.author-name:hover {
    text-decoration: underline;
}

.photo-time {
    font-size: 0.75rem;
    color: var(--text-light);
}

.photo-image-container {
    position: relative;
    background: var(--card-bg);
    border: 1px solid var(--border);
    overflow: hidden;
}

.photo-image {
    width: 100%;
    display: block;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.photo-image:hover {
    opacity: 0.97;
}

.photo-footer {
    padding: 1rem 0;
}

.photo-actions {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.photo-action {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    font-family: inherit;
    transition: color 0.2s ease;
}

.photo-action:hover {
    color: var(--text);
}

.photo-action.liked {
    color: #e74c3c;
}

.photo-action svg {
    width: 20px;
    height: 20px;
}

.photo-caption {
    font-size: 0.9rem;
    color: var(--text);
    line-height: 1.6;
    margin-bottom: 0.75rem;
}

.photo-caption strong {
    font-weight: 500;
}

/* Gear Dropdown */
.gear-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    color: var(--text-light);
    cursor: pointer;
    transition: color 0.2s ease;
    background: none;
    border: none;
    padding: 0;
    font-family: inherit;
}

.gear-toggle:hover {
    color: var(--text-muted);
}

.gear-toggle svg {
    width: 12px;
    height: 12px;
    transition: transform 0.2s ease;
}

.gear-toggle.open svg {
    transform: rotate(180deg);
}

.gear-details {
    display: none;
    margin-top: 0.75rem;
    padding: 1rem;
    background: var(--gear-bg);
    border-radius: 2px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.gear-details.visible {
    display: block;
    animation: slideDown 0.2s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.gear-row {
    display: flex;
    justify-content: space-between;
    padding: 0.3rem 0;
}

.gear-label {
    color: var(--text-light);
}

.gear-value {
    color: var(--text);
    font-weight: 400;
}

.gear-value a {
    color: var(--text);
    text-decoration: none;
    border-bottom: 1px solid var(--border);
    transition: border-color 0.2s ease;
}

.gear-value a:hover {
    border-color: var(--text);
}

/* Upload Modal */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 200;
    align-items: center;
    justify-content: center;
    animation: fadeInOverlay 0.2s ease;
}

.modal-overlay.visible {
    display: flex;
}

@keyframes fadeInOverlay {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal {
    background: var(--bg);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 2.5rem;
    position: relative;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
    line-height: 1;
}

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

.modal h2 {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1.5rem;
    font-weight: 400;
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.form-input {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid var(--border);
    background: var(--card-bg);
    font-size: 0.9rem;
    font-family: inherit;
    color: var(--text);
    transition: border-color 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--text-muted);
}

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

textarea.form-input {
    min-height: 80px;
    resize: vertical;
}

.upload-zone {
    border: 2px dashed var(--border);
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 1.5rem;
}

.upload-zone:hover {
    border-color: var(--text-muted);
}

.upload-zone.dragover {
    border-color: var(--text);
    background: var(--gear-bg);
}

.upload-zone p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.upload-zone input {
    display: none;
}

.upload-preview {
    max-width: 100%;
    max-height: 200px;
    margin-top: 1rem;
    display: none;
}

.gear-section {
    border-top: 1px solid var(--border);
    padding-top: 1.5rem;
    margin-top: 0.5rem;
}

.gear-section-title {
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.gear-section-title span {
    font-size: 0.7rem;
    color: var(--text-light);
    text-transform: none;
    letter-spacing: normal;
}

.gear-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.modal-actions {
    margin-top: 2rem;
    display: flex;
    gap: 1rem;
}

.modal-actions .btn {
    flex: 1;
    text-align: center;
}

/* Profile Page */
.profile {
    max-width: 900px;
    margin: 0 auto;
    padding: 3rem 1.5rem;
}

.profile-header {
    display: flex;
    gap: 3rem;
    align-items: flex-start;
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border);
}

.profile-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 2.5rem;
    color: var(--text-muted);
    flex-shrink: 0;
    overflow: hidden;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-info {
    flex: 1;
}

.profile-name {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 2rem;
    font-weight: 400;
    margin-bottom: 0.25rem;
}

.profile-username {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.profile-bio {
    font-size: 0.9rem;
    color: var(--text);
    line-height: 1.6;
    max-width: 400px;
}

.profile-stats {
    display: flex;
    gap: 2rem;
    margin-top: 1.5rem;
}

.stat {
    text-align: center;
}

.stat-number {
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--text);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.profile-actions {
    margin-top: 1.5rem;
}

/* Photo Grid */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
}

.grid-item {
    aspect-ratio: 1;
    overflow: hidden;
    cursor: pointer;
}

.grid-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.2s ease;
}

.grid-item:hover img {
    opacity: 0.9;
}

/* Auth Pages */
.auth-container {
    max-width: 380px;
    margin: 0 auto;
    padding: 4rem 1.5rem;
}

.auth-header {
    text-align: center;
    margin-bottom: 3rem;
}

.auth-header .logo {
    font-size: 2rem;
    display: block;
    margin-bottom: 1rem;
}

.auth-header p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.auth-form {
    margin-bottom: 2rem;
}

.auth-footer {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.auth-footer a {
    color: var(--text);
    text-decoration: none;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* Landing Page */
.landing {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 80px);
}

.hero {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 4rem 2rem;
}

.hero-content {
    max-width: 600px;
}

.hero h1 {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 300;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    letter-spacing: -0.01em;
}

.hero p {
    font-size: 1.1rem;
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 2.5rem;
    font-weight: 300;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.features {
    border-top: 1px solid var(--border);
    padding: 5rem 2rem;
}

.features-grid {
    max-width: 900px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 3rem;
}

.feature {
    text-align: center;
}

.feature h3 {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1.25rem;
    font-weight: 400;
    margin-bottom: 0.75rem;
}

.feature p {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.6;
}

/* Footer */
footer {
    border-top: 1px solid var(--border);
    padding: 2rem;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-light);
}

/* Loading States */
.loading {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
}

.spinner {
    width: 24px;
    height: 24px;
    border: 2px solid var(--border);
    border-top-color: var(--text);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
}

.empty-state h3 {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1.5rem;
    font-weight: 400;
    margin-bottom: 0.5rem;
    color: var(--text);
}

/* Responsive */
@media (max-width: 768px) {
    .header-inner {
        padding: 1rem;
    }

    nav {
        gap: 1rem;
    }

    nav a:not(.btn) {
        display: none;
    }

    .feed {
        padding: 2rem 1rem;
    }

    .profile-header {
        flex-direction: column;
        gap: 1.5rem;
        align-items: center;
        text-align: center;
    }

    .profile-avatar {
        width: 100px;
        height: 100px;
    }

    .profile-bio {
        max-width: 100%;
    }

    .profile-stats {
        justify-content: center;
    }

    .photo-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .features-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .hero-actions {
        flex-direction: column;
    }

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

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

    .modal {
        margin: 1rem;
        padding: 1.5rem;
    }
}
