/* =============================================
   1tsprune — Simple portfolio
   ============================================= */
:root {
    --bg: #0f1117;
    --surface: #1a1d28;
    --surface2: #222636;
    --line: #2a3040;
    --accent: #d8b57a;
    --accent-soft: rgba(216, 181, 122, 0.1);
    --accent-line: rgba(216, 181, 122, 0.22);
    --white: #eaedf4;
    --muted: #8b93a7;
    --muted2: #5e6680;
    --font: "Montserrat", sans-serif;
    --mono: "JetBrains Mono", monospace;
    --maxw: 820px;
}

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

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
}

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

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

::selection {
    background: var(--accent);
    color: #0f1117;
}

.wrap {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 0 24px;
}

/* ── Nav ──────────────────────────────────── */
nav {
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(14px);
    background: rgba(15, 17, 23, 0.85);
    border-bottom: 1px solid var(--line);
}
.nav-inner {
    max-width: var(--maxw);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 24px;
}
.brand {
    text-decoration: none;
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    gap: 8px;
}
.brand .dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
    display: inline-block;
}
.nav-links {
    display: flex;
    align-items: center;
    gap: 20px;
}
.nav-links a {
    font-family: var(--mono);
    font-size: 0.76rem;
    color: var(--muted);
    transition: color 0.2s;
    letter-spacing: 0.03em;
}
.nav-links a:hover {
    color: var(--accent);
    text-decoration: none;
}
.nav-x svg {
    width: 18px;
    height: 18px;
}

.nav-theme-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--muted);
    padding: 4px;
    display: flex;
    align-items: center;
    transition: color 0.2s;
}
.nav-theme-btn:hover {
    color: var(--accent);
}
.nav-theme-btn svg {
    width: 18px;
    height: 18px;
}
.nav-theme-btn .sun {
    display: none;
}
.nav-theme-btn .moon {
    display: block;
}

/* Light mode */
html:not(.dark) .nav-theme-btn .sun {
    display: block;
}
html:not(.dark) .nav-theme-btn .moon {
    display: none;
}

/* ── Hero ─────────────────────────────────── */
.hero {
    padding: 80px 0 40px;
    text-align: center;
}
.hero h1 {
    font-size: 2.8rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 10px;
}
.hero p {
    color: var(--muted);
    font-size: 1.02rem;
    max-width: 520px;
    margin: 0 auto 20px;
    line-height: 1.7;
}
.hero-links {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}
.hero-links a {
    font-family: var(--mono);
    font-size: 0.78rem;
    color: var(--muted);
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 8px 16px;
    transition: all 0.2s;
}
.hero-links a:hover {
    color: var(--accent);
    border-color: var(--accent-line);
    text-decoration: none;
}

/* ── Blog Posts ───────────────────────────── */
#posts {
    padding: 0 0 60px;
}

.post-preview {
    display: flex;
    gap: 24px;
    align-items: flex-start;
    padding: 22px 0;
    border-top: 1px solid var(--line);
}
.post-preview:first-of-type {
    border-top: none;
}

.post-date-box {
    flex-shrink: 0;
    width: 60px;
    text-align: center;
}
.post-date {
    display: flex;
    flex-direction: column;
    align-items: center;
}
.post-day {
    font-family: var(--mono);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--accent);
    line-height: 1;
}
.post-my {
    font-family: var(--mono);
    font-size: 0.62rem;
    color: var(--muted2);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-top: 2px;
}

.post-info {
    flex: 1;
    min-width: 0;
}
.post-info h4 {
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 4px;
}
.post-info h4 a {
    color: var(--white);
}
.post-info h4 a:hover {
    color: var(--accent);
    text-decoration: none;
}
.post-info p {
    font-size: 0.88rem;
    color: var(--muted);
    line-height: 1.5;
}

/* ── About ────────────────────────────────── */
#about {
    padding: 60px 0;
    border-top: 1px solid var(--line);
}
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}
.about-col h3 {
    font-family: var(--mono);
    font-size: 0.66rem;
    color: var(--muted2);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 14px;
}
.about-col p {
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.7;
}

.exp-item {
    margin-bottom: 16px;
}
.exp-period {
    font-family: var(--mono);
    font-size: 0.64rem;
    color: var(--muted2);
}
.exp-role {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--white);
}
.exp-company {
    font-size: 0.84rem;
    color: var(--muted);
}

.cert-list {
    list-style: none;
}
.cert-list li {
    font-size: 0.84rem;
    color: var(--muted);
    margin-bottom: 5px;
    display: flex;
    gap: 6px;
}
.cert-list li::before {
    content: "·";
    color: var(--accent);
    font-weight: 700;
}

/* ── Footer ───────────────────────────────── */
footer {
    padding: 28px 0;
    border-top: 1px solid var(--line);
    text-align: center;
}
footer p {
    font-family: var(--mono);
    font-size: 0.68rem;
    color: var(--muted2);
}

/* ── Responsive ───────────────────────────── */
@media (max-width: 640px) {
    .hero {
        padding: 50px 0 30px;
    }
    .hero h1 {
        font-size: 2rem;
    }
    .about-grid {
        grid-template-columns: 1fr;
        gap: 28px;
    }
    .post-date-box {
        width: 48px;
    }
    .post-day {
        font-size: 1.25rem;
    }
    .post-info h4 {
        font-size: 0.95rem;
    }
}

/* ── Light Mode ───────────────────────────── */
html:not(.dark) {
    --bg: #f5f5f5;
    --surface: #ffffff;
    --surface2: #e8e8e8;
    --line: #d4d4d4;
    --white: #1a1a1a;
    --muted: #555;
    --muted2: #888;
    --accent: #7c5e10;
    --accent-soft: rgba(124, 94, 16, 0.08);
    --accent-line: rgba(124, 94, 16, 0.3);
}
html:not(.dark) body {
    background: var(--bg);
    color: var(--white);
}
html:not(.dark) nav {
    background: rgba(245, 245, 245, 0.88);
    border-bottom-color: var(--line);
}
html:not(.dark) .post-info h4 a {
    color: #1a1a1a;
}
html:not(.dark) .post-info h4 a:hover {
    color: var(--accent);
}
html:not(.dark) .post-day {
    color: var(--accent);
}
html:not(.dark) a {
    color: var(--accent);
}
html:not(.dark) ::selection {
    background: var(--accent);
    color: #fff;
}

/* ── Pagination ───────────────────────────── */
.pagination { min-height: 48px; margin-top: 28px;
    display: flex;
    justify-content: center;
    gap: 4px;
    padding: 32px 0 0;
}
.pg-btn {
    font-family: var(--mono);
    font-size: 0.72rem;
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    background: transparent;
    border: 1px solid var(--line);
    color: var(--muted);
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}
.pg-btn:hover {
    color: var(--accent);
    border-color: var(--accent-line);
}
.pg-btn.active {
    background: var(--accent);
    color: #1a1206;
    border-color: var(--accent);
}
html:not(.dark) .pg-btn.active {
    color: #fff;
}
.post-hidden {
    display: none;
}

/* ── Blog + Sidebar Layout ───────────────── */
.blog-layout {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 48px;
    align-items: start;
}
@media (max-width: 800px) {
    .blog-layout {
        grid-template-columns: 1fr;
    }
}

/* ── Sidebar (Maland-style) ───────────────── */
.blog-sidebar {
    font-size: 0.84rem;
}
.sidebar-section {
    margin-bottom: 24px;
}
.sidebar-heading {
    font-family: var(--mono);
    font-size: 0.66rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 10px;
}
.sidebar-section p {
    color: var(--white);
    line-height: 1.6;
    font-size: 0.84rem;
}
.sidebar-sub-title {
    font-family: var(--mono);
    font-size: 0.6rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted2);
    margin-bottom: 8px;
    margin-top: 16px;
}
.sidebar-list {
    list-style: none;
}
.sidebar-item {
    display: flex;
    gap: 8px;
    padding: 4px 0;
    font-size: 0.82rem;
    color: var(--muted);
    align-items: baseline;
}
.sidebar-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--accent);
    flex-shrink: 0;
    margin-top: 7px;
}
.sidebar-period {
    font-family: var(--mono);
    font-size: 0.64rem;
    color: var(--muted2);
    margin-bottom: 1px;
}
.sidebar-desc {
    color: var(--white);
    font-size: 0.84rem;
    line-height: 1.45;
}
.sidebar-desc .short {
    font-size: 0.7rem;
    color: var(--muted2);
}
.sidebar-section a {
    font-size: 0.82rem;
    line-height: 1.8;
    display: block;
}
.blog-layout {
    display: grid;
    grid-template-columns: 1fr 260px;
    gap: 56px;
    align-items: start;
}
@media (max-width: 800px) {
    .blog-layout {
        grid-template-columns: 1fr;
    }
}

.hero-tagline {
    font-size: 0.9rem;
    color: var(--muted);
    max-width: 520px;
    margin: 0 auto 8px;
    font-style: italic;
}

/* ── Cert Badges (About page) ─────────────── */
.cert-badge {
    font-family: var(--mono);
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    color: var(--accent);
    background: var(--accent-soft);
    border: 1px solid var(--accent-line);
    padding: 6px 16px;
    border-radius: 999px;
    white-space: nowrap;
}
.about-hero {
    display: flex;
    align-items: center;
    gap: 28px;
    justify-content: center;
    text-align: left;
}
.about-hero h1 {
    margin-bottom: 4px;
}
.profile-pic {
    width: 140px;
    height: 140px;
    flex-shrink: 0;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--accent-line);
}
@media (max-width: 560px) {
    .about-hero {
        flex-direction: column;
        text-align: center;
    }
}
.search-toggle-btn { background: none; border: none; cursor: pointer; color: var(--muted); padding: 4px; display: flex; align-items: center; transition: color 0.2s; }
.search-toggle-btn:hover { color: var(--accent); }
.search-toggle-btn svg { width: 17px; height: 17px; }
.search-overlay { display: none; position: fixed; inset: 0; z-index: 200; background: rgba(0,0,0,0.6); backdrop-filter: blur(4px); align-items: flex-start; justify-content: center; padding-top: 16vh; }
.search-overlay.open { display: flex; }
.search-popup { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 20px; width: 440px; max-width: 90vw; box-shadow: 0 20px 60px rgba(0,0,0,0.5); }
.search-popup input::placeholder { color: var(--muted2); }
.search-results { max-height: 260px; overflow-y: auto; margin-top: 4px; }
.search-result { display: block; padding: 8px 0; font-size: 0.84rem; color: var(--muted); text-decoration: none; border-bottom: 1px solid var(--line); }
.search-result:hover { color: var(--accent); }
.search-result-none { text-align: center; color: var(--muted2); font-size: 0.8rem; padding: 16px 0; }
.search-box { display: flex; align-items: center; gap: 4px; margin-left: 4px; }
.search-box input { width: 120px; padding: 4px 8px; font-family: var(--mono); font-size: 0.72rem; background: var(--surface); border: 1px solid var(--line); color: var(--muted); border-radius: 5px; outline: none; transition: all 0.2s; }
.search-box input:focus { border-color: var(--accent); color: var(--white); width: 160px; }
.search-box input::placeholder { color: var(--muted2); }
.search-box-icon { width: 14px; height: 14px; color: var(--muted2); flex-shrink: 0; }
/* smooth page feel */
body { opacity: 1; transition: opacity 0.15s; }
@media (max-width: 560px) {
  .nav-inner { padding: 10px 16px; }
  .nav-links { gap: 10px; }
  .nav-links a { font-size: 0.7rem; }
  .brand { font-size: 0.95rem; }
  .search-box input { width: 80px; font-size: 0.68rem; }
  .search-box input:focus { width: 100px; }
  .nav-theme-btn { padding: 2px; }
  .nav-theme-btn svg { width: 15px; height: 15px; }
}

.hamburger { display: none; flex-direction: column; gap: 4px; background: none; border: none; cursor: pointer; padding: 4px; }
.hamburger span { display: block; width: 20px; height: 2px; background: var(--muted); border-radius: 2px; transition: all 0.2s; }
@media (max-width: 640px) {
  .hamburger { display: flex; }
  .nav-links { display: none; position: absolute; top: 100%; right: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 8px; flex-direction: column; gap: 2px; min-width: 160px; z-index: 99; }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 8px 14px; border-radius: 6px; }
  .nav-links .search-box { padding: 8px 14px; }
  .nav-inner { position: relative; }
}

#posts { padding-bottom: 60px; }
footer { padding: 40px 0 32px; }
.scroll-btn { position: fixed; right: 20px; z-index: 150; width: 36px; height: 36px; border-radius: 50%; background: var(--surface); border: 1px solid var(--line); color: var(--muted); cursor: pointer; font-size: 1rem; display: flex; align-items: center; justify-content: center; transition: all 0.2s; }
.scroll-btn:hover { color: var(--accent); border-color: var(--accent-line); }
.scroll-top { bottom: 90px; }
.scroll-btm { bottom: 44px; }
