/* ==========================================================
   HOEKSEMA.GITHUB.IO — STYLE
   Dark theme. Geist Mono. Orange where humans touch.
   ========================================================== */

/* ─── Reset / Base ─────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    background: #141414;
    color: #F0F0F0;
    font-family: 'Geist Mono', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.4;
}

body {
    display: block;
    min-height: 100vh;
    background: #141414;
}

/* ─── Sidebar Nav ──────────────────────────────────────── */
.nav-toggle {
    display: none;
}

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 72px;
    background: #0D0D0D;
    border-right: 1px solid #2A2A2A;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: width 150ms ease;
    z-index: 100;
    padding-top: 12px;
}

.nav-hamburger {
    display: none;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 66px;
    cursor: pointer;
    color: #666;
    font-size: 30px;
    flex-shrink: 0;
    transition: color 80ms;
}

.nav-hamburger:hover {
    color: #F0F0F0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 0 21px;
    text-decoration: none;
    color: #666;
    min-height: 66px;
    white-space: nowrap;
    transition: color 80ms;
    font-size: 17px;
    font-weight: 500;
    letter-spacing: 0.05em;
    border-left: 3px solid transparent;
    flex-shrink: 0;
}

.nav-item i {
    font-size: 27px;
    flex-shrink: 0;
    width: 30px;
    text-align: center;
}

.nav-item:hover {
    color: #F0F0F0;
    text-decoration: none;
}

.nav-item.active {
    color: #FF6200;
    border-left-color: #FF6200;
}

.nav-label {
    font-size: 17px;
    letter-spacing: 0.05em;
    font-weight: 500;
}

/* Desktop: expand on hover */
@media (min-width: 641px) {
    .sidebar:hover {
        width: 200px;
    }
}

/* ─── Content Area ─────────────────────────────────────── */
.content {
    max-width: 640px;
    width: 100%;
    margin: 0 auto;
    padding: 32px;
}

/* On screens too narrow to center without overlapping sidebar */
@media (max-width: 736px) {
    .content {
        margin-left: 72px;
        margin-right: 0;
        max-width: calc(100vw - 72px);
    }
}

/* ─── Typography ───────────────────────────────────────── */
h1 {
    font-size: 32px;
    font-weight: 700;
    line-height: 1.2;
    color: #FF6200;
    margin-bottom: 24px;
}

h2 {
    font-size: 24px;
    font-weight: 700;
    line-height: 1.2;
    color: #F0F0F0;
    margin-top: 24px;
    margin-bottom: 16px;
}

h3 {
    font-size: 20px;
    font-weight: 500;
    line-height: 1.2;
    color: #F0F0F0;
    margin-top: 16px;
    margin-bottom: 12px;
}

h4, h5, h6 {
    font-size: 16px;
    font-weight: 500;
    line-height: 1.2;
    color: #F0F0F0;
    margin-top: 12px;
    margin-bottom: 8px;
}

p {
    margin-bottom: 16px;
    color: #F0F0F0;
}

ul, ol {
    padding-left: 20px;
    margin-bottom: 16px;
}

li {
    margin-bottom: 8px;
}

strong {
    font-weight: 700;
}

/* ─── Links ────────────────────────────────────────────── */
a {
    color: #FF6200;
    text-decoration: none;
    transition: text-decoration 80ms;
}

a:hover {
    text-decoration: underline;
}

a:focus-visible {
    outline: 2px solid #FF6200;
    outline-offset: 2px;
    border-radius: 2px;
}

/* Nav items override link colors */
.nav-item,
.nav-item:hover {
    color: inherit;
}

/* ─── Post / Project Card Lists ────────────────────────── */
.post-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.post-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    background: #1A1A1A;
    border: 1px solid #2A2A2A;
    border-radius: 2px;
    min-height: 44px;
    text-decoration: none;
    color: #F0F0F0;
    transition: border-color 80ms, background 80ms;
}

.post-item:hover {
    border-color: #FF6200;
    background: #1E1E1E;
    text-decoration: none;
    color: #F0F0F0;
}

.post-title {
    color: #F0F0F0;
    font-size: 14px;
}

.post-item:hover .post-title {
    color: #FF6200;
}

.post-date {
    color: #666;
    font-size: 11px;
    letter-spacing: 0.05em;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ─── Profile Photo ────────────────────────────────────── */
.profile-photo {
    width: 450px;
    height: 450px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    margin: 0 auto 24px;
    border: 1px solid #2A2A2A;
}

/* ─── Home Centered Layout ────────────────────────────── */
.home-centered {
    text-align: center;
    font-size: 21px;
}

.home-centered h1 {
    font-size: 48px;
}

/* ─── Code ─────────────────────────────────────────────── */
code {
    background: #1A1A1A;
    border: 1px solid #2A2A2A;
    border-radius: 2px;
    padding: 1px 4px;
    font-family: 'Geist Mono', 'Courier New', monospace;
    font-size: 13px;
    color: #00D4FF;
}

pre {
    background: #1A1A1A;
    border: 1px solid #2A2A2A;
    border-radius: 2px;
    padding: 16px;
    overflow-x: auto;
    margin-bottom: 16px;
}

pre code {
    background: none;
    border: none;
    padding: 0;
    color: #F0F0F0;
}

/* ─── Images ───────────────────────────────────────────── */
.content img {
    max-width: 100%;
    height: auto;
}

/* ─── Post Page ─────────────────────────────────────────── */
.post-header {
    margin-bottom: 32px;
    padding-bottom: 16px;
    border-bottom: 1px solid #2A2A2A;
}

.post-header time {
    display: block;
    color: #666;
    font-size: 11px;
    letter-spacing: 0.05em;
    margin-top: 8px;
}

/* ─── Horizontal Rule ───────────────────────────────────── */
hr {
    border: none;
    border-top: 1px solid #2A2A2A;
    margin: 24px 0;
}

/* ─── Blockquote ────────────────────────────────────────── */
blockquote {
    border-left: 2px solid #FF6200;
    padding: 8px 16px;
    margin: 16px 0;
    background: #1A1A1A;
    color: #F0F0F0;
}

blockquote p:last-child {
    margin-bottom: 0;
}

/* ─── Contact Methods ─────────────────────────────────────── */
.contact-method {
    margin-bottom: 24px;
}

/* ─── Mobile ─────────────────────────────────────────────── */
@media (max-width: 640px) {
    .nav-hamburger {
        display: flex;
    }

    /* On mobile, hover does nothing; use toggle */
    .sidebar:hover {
        width: 72px;
    }

    .nav-toggle:checked ~ .sidebar {
        width: 200px;
    }

    .content {
        padding: 16px 12px;
    }

    h1 {
        font-size: 24px;
    }

    h2 {
        font-size: 20px;
    }

    .profile-photo {
        width: clamp(288px, 60vw, 360px);
        height: clamp(288px, 60vw, 360px);
    }

    .home-centered {
        font-size: clamp(12px, 3.5vw, 15px);
    }

    .home-centered h1 {
        font-size: clamp(29px, 7vw, 36px);
    }
}

/* ─── Minesweeper ─────────────────────────────────────── */
#minesweeper-wrap {
    position: fixed;
    bottom: 0;
    left: 72px;
    right: 0;
    height: 25vh;
    min-height: 120px;
    background: #FF6200;
    z-index: 10;
    overflow: hidden;
}

#minesweeper {
    display: grid;
    width: 100%;
    height: 100%;
    gap: 2px;
    background: #FF6200;
}

.ms-slot {
    position: relative;
    background: #FF6200;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ms-content {
    font-family: 'Geist Mono', monospace;
    font-weight: 700;
    font-size: 18px;
    color: #141414;
    user-select: none;
    pointer-events: none;
}

.ms-bomb {
    font-size: 22px;
}

.ms-num { color: #FFFFFF; }

.ms-cell {
    position: absolute;
    inset: 0;
    background: #E8E8E8;
    border: none;
    padding: 0;
    cursor: pointer;
    font-size: 0;
    box-shadow:
        inset  2px  2px 0 0 #FFFFFF,
        inset -2px -2px 0 0 #999999,
        inset  1px  1px 0 0 #D4D4D4,
        inset -1px -1px 0 0 #AAAAAA;
    transition: transform 0.35s ease-in, opacity 0.35s ease-in;
    transform-origin: bottom center;
    backface-visibility: hidden;
}

.ms-cell:hover:not(.revealed) {
    background: #F0F0F0;
}

.ms-cell:active:not(.revealed) {
    box-shadow:
        inset -1px -1px 0 0 #FFFFFF,
        inset  1px  1px 0 0 #999999;
}

.ms-cell.flagged::after {
    content: '\2691';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 54px;
    color: #141414;
    pointer-events: none;
}

.ms-cell.victory-reveal {
    background: #00FF66;
}

.ms-cell.revealed {
    animation: tile-fall 0.35s ease-in forwards;
    pointer-events: none;
}

@keyframes tile-fall {
    0%   { transform: perspective(400px) rotateX(0deg); opacity: 1; }
    100% { transform: perspective(400px) rotateX(90deg) translateY(20px); opacity: 0; }
}

.page-home .content {
    padding-bottom: 28vh;
}

/* Modal */
#ms-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(0, 0, 0, 0.7);
    align-items: center;
    justify-content: center;
}

#ms-modal.active {
    display: flex;
}

#ms-modal-inner {
    background: #1A1A1A;
    border: 1px solid #FF6200;
    border-radius: 2px;
    padding: 24px 36px;
    text-align: center;
    font-family: 'Geist Mono', monospace;
}

#ms-modal-inner h2 {
    color: #FF6200;
    margin: 0 0 16px;
    font-size: 20px;
}

#ms-modal-inner button {
    background: #FF6200;
    color: #141414;
    border: none;
    padding: 8px 24px;
    font-family: 'Geist Mono', monospace;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    border-radius: 2px;
}

#ms-modal-inner button:hover {
    background: #E55A00;
}

@media (max-width: 640px) {
    #minesweeper-wrap {
        left: 72px;
        height: 22vh;
    }

    .page-home .content {
        padding-bottom: 25vh;
    }
}
