/* -----------------------------------------------
   Portfolio — Dark Minimal
   IBM Plex Mono, narrow column, printer-paper feel
----------------------------------------------- */

:root {
    --bg:      #0e0e0e;
    --surface: #141414;
    --border:  #272727;
    --text:    #c8c8c8;
    --dim:     #5a5a5a;
    --accent:  #e8e8e8;
    --link:    #a8c4a2;
    --width:   660px;
    --mono:    'IBM Plex Mono', 'Courier New', monospace;
}

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

html { font-size: 14px; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--mono);
    line-height: 1.75;
    padding: 0 1rem;
}

/* ---- Layout ---- */
.container {
    max-width: var(--width);
    margin: 0 auto;
    padding: 3rem 0 4rem;
}

/* ---- Header / Nav ---- */
header {
    margin-bottom: 3rem;
}

.site-name {
    font-size: 1rem;
    font-weight: 500;
    color: var(--accent);
    margin-bottom: 0.5rem;
    letter-spacing: 0.03em;
}

.site-name a {
    color: inherit;
    text-decoration: none;
}

nav {
    font-size: 0.85rem;
    color: var(--dim);
}

nav a {
    color: var(--dim);
    text-decoration: none;
    transition: color 0.15s;
}

nav a:hover,
nav a.active {
    color: var(--accent);
}

nav .sep {
    margin: 0 0.4rem;
    color: var(--border);
}

/* ---- Typography ---- */
h1, h2, h3 {
    font-family: var(--mono);
    font-weight: 500;
    color: var(--accent);
    letter-spacing: 0.02em;
}

h1 { font-size: 1.1rem; margin-bottom: 1.5rem; }
h2 { font-size: 0.9rem; margin-bottom: 1rem; color: var(--dim); text-transform: uppercase; letter-spacing: 0.12em; }
h3 { font-size: 1rem; margin-bottom: 0.25rem; }

p { margin-bottom: 1rem; }

a {
    color: var(--link);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-color: #3a5a36;
    transition: color 0.15s, text-decoration-color 0.15s;
}

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

hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 2rem 0;
}
.accent-line {
  border-bottom: 1px solid #2c2c2c; 
  padding-bottom: 2px;
  font-weight: 700;
}

/* ---- Sections ---- */
section {
    margin-bottom: 3rem;
}

.section-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--dim);
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.project-list + .section-label::after { display: none; }

/* ---- Entry (Experience / Education) ---- */
.entry {
    margin-bottom: 1.75rem;
    padding-left: 0;
}

.entry-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.2rem;
}

.entry-title { color: var(--accent); font-weight: 500; }
.entry-date  { color: var(--dim); font-size: 0.8rem; white-space: nowrap; }
.entry-sub   { color: var(--dim); font-size: 0.85rem; margin-bottom: 0.4rem; }
.entry-desc  { font-size: 0.9rem; color: var(--text); }

/* ---- Projects ---- */
.project-list { list-style: none; }

.project-item {
    padding: 1.25rem 0;
    border-bottom: 1px solid var(--border);
}
.project-desc {
  white-space: pre-wrap;
  line-height: 1.7;
  max-width: 720px;
}

.featured-list .project-item:last-child {
    border-bottom: none;
}

.project-item:first-child { 
    border-top: 1px solid var(--border); 
}
.project-item:LAST-child { 
    border-bottom: none; 
}
.project-item:last-child {
    border-bottom: none;
}
.project-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.3rem;
}

.project-title { color: var(--accent); font-weight: 500; }
.project-year  { color: var(--dim); font-size: 0.8rem; }

.project-desc { font-size: 0.9rem; margin-bottom: 0.5rem; }

.project-challenges, .project-tech {
    font-size: 0.85rem;
    color: var(--text);
    margin-top: 0.35rem;
}

.project-challenges-label, .project-tech-label {
    color: var(--dim);
    font-size: 0.78rem;
}

.project-links {
    margin-top: 0.4rem;
    font-size: 0.82rem;
    display: flex;
    gap: 1rem;
}

.tag {
    display: inline-block;
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 0.1rem 0.45rem;
    font-size: 0.75rem;
    color: var(--dim);
    border-radius: 2px;
}

/* ---- Blog ---- */
.post-list { list-style: none; }

.post-item {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border);
}

.post-item:first-child { border-top: 1px solid var(--border); }

.post-title a { color: var(--text); font-size: 0.9rem; }
.post-title a:hover { color: var(--accent); }
.post-date { color: var(--dim); font-size: 0.78rem; white-space: nowrap; }

/* Single post */
.post-content {
    font-size: 0.95rem;
    line-height: 1.85;
}

.post-content p    { margin-bottom: 1.2rem; }
.post-content h2   { margin: 2rem 0 0.75rem; }
.post-content code {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 0.1em 0.3em;
    font-size: 0.88em;
    border-radius: 2px;
}

.post-content pre {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 1rem;
    overflow-x: auto;
    margin: 1.25rem 0;
    font-size: 0.85rem;
}

.post-meta {
    color: var(--dim);
    font-size: 0.8rem;
    margin-bottom: 2rem;
}

/* ---- Contact / Form ---- */
.form-group { margin-bottom: 1.25rem; }

label {
    display: block;
    font-size: 0.8rem;
    color: var(--dim);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.4rem;
}

input[type="text"],
input[type="email"],
textarea {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    font-family: var(--mono);
    font-size: 0.9rem;
    padding: 0.6rem 0.75rem;
    outline: none;
    transition: border-color 0.15s;
    border-radius: 0;
    -webkit-appearance: none;
}

input[type="text"]:focus,
input[type="email"]:focus,
textarea:focus {
    border-color: var(--dim);
}

textarea { min-height: 140px; resize: vertical; }

button, .btn {
    background: transparent;
    border: 1px solid var(--dim);
    color: var(--text);
    font-family: var(--mono);
    font-size: 0.85rem;
    padding: 0.5rem 1.25rem;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s;
    text-decoration: none;
    display: inline-block;
}

button:hover, .btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* ---- Alerts ---- */
.alert {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    font-size: 0.85rem;
    margin-bottom: 1.5rem;
}

.alert-success { border-color: #3a5a36; color: var(--link); }
.alert-error   { border-color: #5a3636; color: #c4a2a2; }

/* ---- Footer ---- */
footer {
    margin-top: 4rem;
}

footer p {
    color: var(--dim);
    font-size: 0.78rem;
    margin-top: 1rem;
}

/* ---- Admin ---- */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.admin-table th {
    text-align: left;
    color: var(--dim);
    font-weight: 400;
    padding: 0.4rem 0.75rem 0.4rem 0;
    border-bottom: 1px solid var(--border);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
}

.admin-table td {
    padding: 0.6rem 0.75rem 0.6rem 0;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}

.admin-table tr:hover td { background: var(--surface); }

.admin-actions a { margin-right: 0.75rem; font-size: 0.8rem; }

/* ---- Misc ---- */
.back { font-size: 0.82rem; color: var(--dim); margin-bottom: 2rem; display: inline-block; }
.back:hover { color: var(--accent); }

.cursor::after {
    content: '_';
    animation: blink 1.2s step-end infinite;
    color: var(--dim);
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0; }
}

@media (max-width: 480px) {
    html { font-size: 13px; }
    .entry-header, .project-header { flex-direction: column; }
    .post-item { flex-direction: column; gap: 0.1rem; }
}

/* ---- Project Gallery (public) ---- */
.project-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 6px;
    margin-top: 0.85rem;
    margin-bottom: 0.5rem;
}

.gallery-thumb {
    display: block;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border: 1px solid var(--border);
    text-decoration: none;
    transition: border-color 0.15s, opacity 0.15s;
}

.gallery-thumb:hover {
    border-color: var(--dim);
    opacity: 0.85;
}

.gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ---- Lightbox ---- */
.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.lightbox.active {
    display: flex;
}

.lightbox-figure {
    position: relative;
    max-width: min(92vw, 900px);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    margin: 0;
}

.lightbox-figure img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    display: block;
    border: 1px solid var(--border);
}

.lightbox-caption {
    color: var(--dim);
    font-family: var(--mono);
    font-size: 0.78rem;
    text-align: center;
    min-height: 1em;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: fixed;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--dim);
    font-family: var(--mono);
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
    line-height: 1;
    padding: 0;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
    color: var(--accent);
    border-color: var(--dim);
}

.lightbox-close {
    top: 1.25rem;
    right: 1.25rem;
    font-size: 1rem;
    width: 2rem;
    height: 2rem;
}

.lightbox-prev,
.lightbox-next {
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.5rem;
    width: 2.5rem;
    height: 2.5rem;
}

.lightbox-prev { left: 1rem; }
.lightbox-next { right: 1rem; }

/* ---- Admin Gallery ---- */
.admin-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 8px;
    margin-bottom: 1rem;
}

.admin-gallery-item {
    position: relative;
    border: 1px solid var(--border);
}

.admin-gallery-item img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block;
}

.admin-gallery-caption {
    font-size: 0.72rem;
    color: var(--dim);
    padding: 0.25rem 0.4rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-gallery-delete {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(14,14,14,0.85);
    border: 1px solid var(--border);
    color: var(--dim);
    font-size: 0.7rem;
    width: 1.4rem;
    height: 1.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: color 0.15s, border-color 0.15s;
    line-height: 1;
}

.admin-gallery-delete:hover {
    color: #c4a2a2;
    border-color: #5a3636;
}
