/* style.css */

:root {
    --bg-color: #16130f;
    --bg-alt: #1e1a14;
    --text-color: #ece5d5;
    --text-secondary: #a89f8c;
    --text-muted: #908776;
    --heading-color: #f3efe6;
    --accent: #d97757;
    --border-color: #3a342a;
    --btn-bg: #241f18;
    --btn-hover: #2d271e;
}

body.light-mode, html.light-mode {
    --bg-color: #f3efe6;
    --bg-alt: #ece5d5;
    --text-color: #221f1a;
    --text-secondary: #6b6354;
    --text-muted: #696153;
    --heading-color: #1f1c17;
    --accent: #a13d2b;
    --border-color: #ddd3c0;
    --btn-bg: #ece5d5;
    --btn-hover: #e2d8c3;
}

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

html { scroll-behavior: smooth; }

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 2px;
}

@media (prefers-reduced-motion: no-preference) {
    .theme-btn:hover { transform: scale(1.08); }
    .social-row a:hover { transform: translateY(-2px); }
    .lightbox-btn:hover { transform: scale(1.05); }
    .lightbox-nav:hover { transform: translateY(-50%) scale(1.05); }
}
@media (prefers-reduced-motion: reduce) {
    * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Newsreader', serif;
    font-size: 16px;
    line-height: 1.75;
    font-weight: 400;
    transition: background-color 0.3s, color 0.3s;
    -webkit-font-smoothing: antialiased;
}

body.scroll-locked {
    overflow: hidden;
}

.mono {
    font-family: 'JetBrains Mono', monospace;
}

/* --- TOP NAV --- */
.site-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 32px;
    border-bottom: 0.5px solid var(--border-color);
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    max-width: 780px;
    margin: 0 auto;
}

.site-nav .brand {
    color: var(--heading-color);
    font-weight: 700;
    text-decoration: none;
    letter-spacing: -0.2px;
}
.site-nav .brand:hover { text-decoration: none; color: var(--accent); }

.site-nav .nav-items {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.site-nav .nav-items a {
    color: var(--text-secondary);
    text-decoration: none;
    padding-bottom: 3px;
    border-bottom: 1px solid transparent;
}
.site-nav .nav-items a:hover { color: var(--text-color); text-decoration: none; }
.site-nav .nav-items a.active {
    color: var(--accent);
    border-bottom: 1px solid var(--accent);
}

/* --- MAIN CONTAINER --- */
.container {
    width: 100%;
    max-width: 660px;
    padding: 56px 24px 70px;
    margin: 0 auto;
}

/* --- HOME: IDENTITY BLOCK --- */
.identity-block {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 28px;
}

.profile-pic {
    width: 88px;
    height: 88px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    flex-shrink: 0;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
}

body.light-mode .profile-pic { box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08); }

h1 {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.15rem;
    color: var(--heading-color);
    font-weight: 700;
    letter-spacing: -0.2px;
    margin-bottom: 4px;
    text-wrap: balance;
}

.tagline {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    color: var(--text-muted);
}

h2 {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-top: 40px;
    margin-bottom: 16px;
    font-weight: 500;
}

.about-text p { margin-top: 12px; color: var(--text-color); text-wrap: pretty; }
.about-text p:first-child { margin-top: 0; }
.about-text { max-width: 560px; }

.inline-link { color: var(--accent); text-decoration: underline; text-decoration-color: var(--border-color); text-underline-offset: 2px; }
.inline-link:hover { text-decoration-color: var(--accent); }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* --- CV LINK --- */
.cv-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 0.78rem;
    color: var(--accent);
    text-decoration: none;
    margin-top: 22px;
    margin-bottom: 6px;
    padding: 7px 14px;
    border: 1px solid var(--accent);
    border-radius: 20px;
}
.cv-link:hover { background: var(--accent); color: var(--bg-color); text-decoration: none; }

/* --- SOCIAL / QUICK LINKS ROW --- */
.social-row {
    display: flex;
    gap: 20px;
    margin-top: 16px;
    flex-wrap: wrap;
}
.social-row a {
    font-size: 1.3rem;
    color: var(--text-muted);
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: -8px;
}
.social-row a:hover { color: var(--accent); text-decoration: none; }

/* --- LIST PAGES (Notes / Projects / Read-Watch) --- */
.container-single { max-width: 720px; }

.back-link {
    display: inline-block;
    margin-bottom: 28px;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
}
.back-link:hover { color: var(--accent); text-decoration: none; }

.page-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 7px;
}
.page-label::before {
    content: "";
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--accent);
    display: inline-block;
}

.page-intro {
    color: var(--text-secondary);
    margin-bottom: 32px;
    max-width: 560px;
    font-size: 0.95rem;
}

.entry-list { max-width: 620px; }

.entry-item {
    padding: 18px 0;
    border-bottom: 0.5px solid var(--border-color);
}
.entry-item:first-child { padding-top: 0; }

.entry-title {
    font-family: 'Newsreader', serif;
    font-size: 1.05rem;
    color: var(--heading-color);
    display: block;
    margin-bottom: 6px;
    text-wrap: balance;
}
.entry-title:hover { text-decoration: underline; }

.entry-meta {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    color: var(--accent);
    display: block;
    margin-bottom: 6px;
}

.entry-desc {
    color: var(--text-color);
    font-size: 0.92rem;
    opacity: 0.85;
    text-wrap: pretty;
}

.status-badge {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
    padding: 2px 7px;
    border-radius: 3px;
    margin-left: 4px;
    font-weight: 500;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    vertical-align: middle;
}

.empty-note {
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
}

/* --- PHOTOGRAPHY PAGE WIDE LAYOUT --- */
body.photography-page .container-single {
    max-width: 1100px;
}

/* --- PHOTOGRAPHY: MASONRY & CARDS --- */
.photo-grid {
    display: flex;
    align-items: flex-start;
    gap: 18px;
    margin-top: 8px;
    width: 100%;
}

.photo-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-width: 0;
}

.photo-card {
    width: 100%;
    border-radius: 6px;
    overflow: hidden;
    border: 0.5px solid var(--border-color);
    background: var(--bg-alt);
    min-height: 140px;
    display: flex;
    flex-direction: column;
    transition: border-color 0.2s;
}

.photo-card:hover {
    border-color: var(--accent);
}

.photo-card a {
    display: block;
    cursor: zoom-in;
    background: var(--bg-alt);
}

.photo-card img {
    width: 100%;
    height: auto;
    display: block;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}
body.light-mode .photo-card img {
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.photo-caption {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.68rem;
    color: var(--text-muted);
    padding: 7px 10px;
    border-top: 0.5px solid var(--border-color);
    background: var(--bg-alt);
    word-break: break-word;
    overflow-wrap: break-word;
    line-height: 1.4;
}

/* --- LIGHTBOX OVERLAY --- */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(18, 15, 12, 0.94);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease-out, visibility 0s linear 0.2s;
}

.lightbox-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: opacity 0.2s ease-out, visibility 0s linear 0s;
}

.lightbox-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 2010;
}

.lightbox-counter {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: #ece5d5;
}

.lightbox-btn {
    background: rgba(30, 26, 20, 0.7);
    color: #ece5d5;
    border: 1px solid rgba(221, 211, 192, 0.25);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.lightbox-btn:hover {
    background: rgba(45, 39, 30, 0.9);
    border-color: #d97757;
    color: #d97757;
}

.lightbox-stage {
    position: relative;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 70px;
    cursor: default;
}

.lightbox-img-wrapper {
    position: relative;
    max-width: 100%;
    max-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-img {
    max-width: 100%;
    max-height: calc(100vh - 140px);
    max-height: calc(100dvh - 140px);
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    transition: filter 0.2s ease-out;
}

.lightbox-img.loading-placeholder {
    filter: blur(8px);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2010;
}

.lightbox-prev { left: 16px; }
.lightbox-next { right: 16px; }

.lightbox-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    min-height: 46px;
    padding: 10px 24px 16px;
    text-align: center;
    z-index: 2010;
}

.lightbox-caption {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.74rem;
    color: #a89f8c;
    word-break: break-word;
}

/* --- THEME BUTTON --- */
.theme-btn {
    position: fixed;
    top: 20px;
    right: 30px;
    background-color: var(--btn-bg);
    color: var(--text-color);
    border: 0.5px solid var(--border-color);
    border-radius: 50%;
    width: 38px;
    height: 38px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
.theme-btn:hover { background-color: var(--btn-hover); }

@media (max-width: 900px) {
    .lightbox-stage { padding: 60px 48px; }
}

@media (max-width: 640px) {
    .site-nav { flex-direction: column; align-items: flex-start; gap: 12px; padding: 16px 20px; }
    .site-nav .nav-items { gap: 14px; }
    .container { padding: 32px 20px 48px; }
    .identity-block { gap: 14px; }
    .profile-pic { width: 68px; height: 68px; }
    .photo-grid { gap: 12px; }
    .photo-column { gap: 12px; }
    .theme-btn { top: 14px; right: 14px; }
    .lightbox-stage { padding: 50px 10px; }
    .lightbox-prev { left: 8px; }
    .lightbox-next { right: 8px; }
    .lightbox-btn { width: 36px; height: 36px; font-size: 0.95rem; }
}
