/* =========================================================
   meruzh.com v2 — profile + post layout
   ========================================================= */

:root {
    --bg: #f4f2ee;
    --card: #ffffff;
    --border: rgba(140, 140, 140, 0.2);
    --text: rgba(0, 0, 0, 0.9);
    --text-2: rgba(0, 0, 0, 0.6);
    --text-3: rgba(0, 0, 0, 0.45);
    --primary: #0a66c2;
    --primary-hover: #004182;
    --primary-soft: rgba(10, 102, 194, 0.1);
    --hover: rgba(0, 0, 0, 0.06);
    --radius: 8px;
    --nav-h: 52px;
    --font: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
            "Fira Sans", Ubuntu, Oxygen, "Oxygen Sans", Cantarell, "Droid Sans", "Apple Color Emoji",
            "Segoe UI Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Lucida Grande", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-padding-top: calc(var(--nav-h) + 16px); }

body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.43;
}

a { color: var(--primary); }

button { font: inherit; }

/* ---------- top navigation ---------- */

.topnav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--card);
    border-bottom: 1px solid var(--border);
}

.topnav-inner {
    max-width: 1128px;
    height: var(--nav-h);
    margin: 0 auto;
    padding: 0 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.brand {
    flex: none;
    width: 34px;
    height: 34px;
    border-radius: 4px;
    overflow: hidden;
    display: block;
}

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

.search {
    position: relative;
    flex: 0 1 280px;
    min-width: 0;
}

.search > i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-2);
    font-size: 13px;
}

.search input {
    width: 100%;
    height: 34px;
    border: none;
    border-radius: 4px;
    background: #edf3f8;
    padding: 0 10px 0 36px;
    font: inherit;
    color: var(--text);
}

.search input:focus {
    outline: 2px solid var(--primary);
}

.search-results {
    position: absolute;
    top: 40px;
    left: 0;
    width: min(420px, calc(100vw - 32px));
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: 0 0 0 1px var(--border), 0 4px 16px rgba(0, 0, 0, 0.15);
    padding: 6px 0;
    max-height: 70vh;
    overflow-y: auto;
}

.search-results a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    color: var(--text);
    text-decoration: none;
}

.search-results a:hover { background: var(--hover); }

.search-results img {
    width: 48px;
    height: 32px;
    object-fit: cover;
    border-radius: 4px;
    flex: none;
}

.search-results .empty {
    margin: 8px 12px;
    color: var(--text-2);
}

.nav-links {
    margin-left: auto;
    display: flex;
    height: 100%;
}

.nav-links a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 80px;
    padding: 0 8px;
    color: var(--text-2);
    text-decoration: none;
    font-size: 12px;
    border-bottom: 2px solid transparent;
}

.nav-links a i { font-size: 20px; margin-bottom: 2px; }

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

.nav-links a.active { border-bottom-color: var(--text); }

/* ---------- layout ---------- */

.page {
    max-width: 1128px;
    margin: 24px auto;
    padding: 0 16px;
    display: grid;
    gap: 24px;
    align-items: start;
}

.profile-layout { grid-template-columns: minmax(0, 1fr) 300px; }
.post-layout {
    max-width: 1440px;
    grid-template-columns: 225px minmax(0, 1fr) 260px;
}

.post-page .topnav-inner { max-width: 1440px; }

.main-col, .center-col, .side-col, .left-col, .right-col {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.left-col, .right-col, .side-col {
    position: sticky;
    top: calc(var(--nav-h) + 24px);
}

.card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: 0 0 0 1px var(--border);
    overflow: hidden;
}

.section { padding: 20px 24px 8px; }

.section h2 {
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 12px;
}

.section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}

.sub {
    margin: -10px 0 12px;
    color: var(--primary);
    font-weight: 600;
    font-size: 14px;
}

.muted { color: var(--text-2); }

/* ---------- profile header ---------- */

.cover {
    height: 200px;
    background:
        radial-gradient(circle at 20% 120%, rgba(255, 255, 255, 0.25) 0 18%, transparent 19%),
        radial-gradient(circle at 85% -10%, rgba(255, 255, 255, 0.18) 0 25%, transparent 26%),
        linear-gradient(120deg, #0a3a6b 0%, #0a66c2 55%, #70b5f9 100%);
}

.profile-body {
    position: relative;
    padding: 0 24px 24px;
}

.avatar-lg {
    width: 152px;
    height: 152px;
    border-radius: 50%;
    border: 4px solid var(--card);
    object-fit: cover;
    margin-top: -112px;
    display: block;
    background: var(--card);
}

.profile-row {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    margin-top: 12px;
}

.profile-id h1 {
    font-size: 24px;
    line-height: 1.25;
    font-weight: 600;
    margin: 0;
}

.headline {
    font-size: 16px;
    margin: 4px 0 8px;
}

.meta {
    margin: 0 0 4px;
    color: var(--text-2);
}

.meta a { font-weight: 600; text-decoration: none; }
.meta a:hover { text-decoration: underline; }
.meta.strong { color: var(--primary); font-weight: 600; }

.profile-orgs {
    list-style: none;
    margin: 0;
    padding: 0;
    flex: 0 1 232px;
}

.profile-orgs li {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    margin-bottom: 8px;
}

.profile-orgs .logo { width: 32px; height: 32px; font-size: 12px; }


/* ---------- about / see more ---------- */

.about-text p,
.entry-desc p { margin: 0 0 8px; }

.clamp {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.clamp p { display: inline; }
.clamp p + p::before { content: " "; }

.see-more {
    background: none;
    border: none;
    padding: 0;
    color: var(--text-2);
    cursor: pointer;
    margin-bottom: 8px;
}

.see-more:hover { color: var(--primary); text-decoration: underline; }


/* ---------- activity ---------- */

.activity-list { display: flex; flex-direction: column; }

.activity-item {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-top: 1px solid var(--border);
    color: var(--text);
    text-decoration: none;
}

.activity-item:first-child { border-top: none; padding-top: 0; }
.activity-item.is-extra { display: none; }

.activity-item img {
    width: 160px;
    height: 100px;
    object-fit: cover;
    border-radius: 6px;
    flex: none;
    background: var(--bg);
}

.activity-text { min-width: 0; }

.activity-meta {
    margin: 0 0 2px;
    font-size: 12px;
    color: var(--text-2);
}

.activity-item h3 {
    margin: 0 0 4px;
    font-size: 16px;
    font-weight: 600;
}

.activity-item:hover h3 { color: var(--primary); text-decoration: underline; }

.activity-desc {
    margin: 0;
    color: var(--text-2);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.show-all {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: calc(100% + 48px);
    margin: 8px -24px -8px;
    padding: 12px;
    background: none;
    border: none;
    border-top: 1px solid var(--border);
    color: var(--text-2);
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
}

.show-all:hover { background: var(--hover); color: var(--text); }

/* ---------- experience / education / projects ---------- */

.entries { list-style: none; margin: 0; padding: 0; }

.entry {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-top: 1px solid var(--border);
}

.entry:first-child { border-top: none; padding-top: 0; }

.logo {
    width: 48px;
    height: 48px;
    flex: none;
    border-radius: 4px;
    color: #fff;
    font-weight: 700;
    font-size: 16px;
    display: grid;
    place-items: center;
}

.logo.has-img {
    background: #fff;
    overflow: hidden;
}

.logo.plain {
    background: transparent;
    font-size: 26px;
}

.logo.has-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.entry-body { min-width: 0; flex: 1; }
.entry-body > p { margin: 0; }

.entry-body h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.entry-desc { margin-top: 8px; }

.skills {
    display: flex;
    gap: 6px;
    margin-top: 4px !important;
    font-weight: 600;
}

.skills i { margin-top: 3px; }

/* ---------- side cards ---------- */

.side-card { padding: 16px; }

.side-card h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 12px;
}

.side-card .sub { margin-top: -10px; color: var(--text-2); font-weight: 400; }

.link-list { list-style: none; margin: 0; padding: 0; }

.link-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    word-break: break-all;
}

.link-list i { width: 18px; text-align: center; color: var(--text-2); font-size: 16px; }
.link-list a { text-decoration: none; font-weight: 600; }
.link-list a:hover { text-decoration: underline; }

.mini-posts { list-style: none; margin: 0; padding: 0; }

.mini-posts a {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 6px 0;
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
}

.mini-posts a:hover span { color: var(--primary); text-decoration: underline; }

.mini-posts img {
    width: 56px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
    flex: none;
}

.site-footer {
    text-align: center;
    color: var(--text-2);
    font-size: 12px;
    padding: 8px;
}

/* ---------- contact modal ---------- */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: grid;
    place-items: center;
    z-index: 200;
    padding: 16px;
}

.modal {
    background: var(--card);
    border-radius: var(--radius);
    width: min(552px, 100%);
    max-height: 90vh;
    overflow-y: auto;
}

.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
}

.modal-head h2 { margin: 0; font-size: 20px; font-weight: 600; }

.icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: none;
    color: var(--text-2);
    font-size: 20px;
    cursor: pointer;
}

.icon-btn:hover { background: var(--hover); }

.modal-body { padding: 16px 24px 24px; }
.modal-body h3 { font-size: 20px; font-weight: 600; margin: 0 0 16px; }

.contact-row {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

.contact-row i { font-size: 20px; width: 24px; color: var(--text-2); margin-top: 2px; }
.contact-row p { margin: 0; font-weight: 600; }
.contact-row a { word-break: break-all; text-decoration: none; }
.contact-row a:hover { text-decoration: underline; }

/* ---------- post page ---------- */

.mini-profile {
    text-align: center;
    padding-bottom: 12px;
}

.mini-profile .cover { height: 56px; }

.avatar-md {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    border: 2px solid var(--card);
    object-fit: cover;
    margin: -38px auto 8px;
    display: block;
}

.mini-name {
    display: block;
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
    padding: 0 12px;
}

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

.mini-headline, .mini-location {
    margin: 4px 12px 0;
    font-size: 12px;
    color: var(--text-2);
}

.mini-link {
    display: block;
    margin: 12px 0 0;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    font-weight: 600;
    text-decoration: none;
}

.mini-link:hover { text-decoration: underline; }

.post-head {
    display: flex;
    gap: 8px;
    padding: 12px 16px 0;
}

.avatar-sm {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.post-author { min-width: 0; }

.author-name {
    color: var(--text);
    font-weight: 600;
    text-decoration: none;
}

.author-name:hover { color: var(--primary); text-decoration: underline; }

.author-headline, .post-date {
    margin: 0;
    font-size: 12px;
    color: var(--text-2);
}

.lang-switch {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 12px 16px 0;
    padding: 4px 12px;
    border-radius: 16px;
    box-shadow: inset 0 0 0 1px var(--primary);
    font-weight: 600;
    text-decoration: none;
}

.lang-switch:hover { background: var(--primary-soft); }


/* =========================================================
   Article content — kept from the original stylesheet so
   articles look the same inside the post card.
   ========================================================= */

#container {
    display: block;
    background: white;
}

#container > .wrapper {
    display: block;
    margin: 0 auto;
    background: white;
    padding: 4px 16px 16px;
    font-family: 'Roboto', var(--font);
    color: #393939;
    font-size: 18px;
    font-weight: 400;
    line-height: 30px;
    letter-spacing: .005em;
    overflow-wrap: break-word;
}

#container h1, #container h2, #container h3 {
    text-transform: uppercase;
    margin-top: 50px;
    font-weight: bold;
    line-height: 1.4;
}

#container > .wrapper > h1:first-child,
#container > .wrapper > :first-child h1:first-child {
    margin-top: 16px;
}

#container img {
    display: block;
    width: 90%;
    max-width: 100%;
    margin: 0 auto;
}

#container iframe,
#container video { max-width: 100%; }

#container pre { overflow-x: auto; }

span.code {
    font-family: 'Courier New', monospace;
    background: #dcdcdc;
    border-radius: 5px;
    border: 1px rgb(197, 197, 197) solid;
    font-style: initial;
}

div.divider {
    display: block;
    margin: 50px auto;
    text-align: center;
    letter-spacing: 15px;
}

#container p { white-space: break-spaces; }
#container p.dialogue { white-space: normal !important; }

#container p.dialogue > span {
    font-style: italic;
    padding: 10px 5%;
    margin: 15px 0;
    display: block;
    width: fit-content;
    border-radius: 10px 60px 10px 60px;
}

#container p.dialogue .dialogue-1 { background-color: #eafde5; }
#container p.dialogue .dialogue-2 { background-color: #fff7e8; }

.linkedin { overflow: hidden; }
.linkedin > iframe { width: 500px; max-width: 100%; height: 760px; }

#container span.bold { font-weight: bold; }
#container span.italic { font-style: italic; }

#container p.quote {
    font-size: 26px;
    font-weight: 100;
    color: #6B6B6B;
    max-width: 700px;
    text-align: left;
    margin: 20px auto;
    letter-spacing: 1px;
    line-height: 40px;
}

.hljs-ln-numbers {
    user-select: none;
    text-align: center;
    color: #ccc;
    border-right: 1px solid #CCC;
    vertical-align: top;
    padding-right: 5px;
}

.hljs-ln-code { padding-left: 10px !important; }

.cover-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.cover-wrapper .dark {
    background: rgba(0, 0, 0, 0.56);
    position: absolute;
    width: 100%;
    height: 100%;
}

.cover-wrapper .play-button {
    font-size: 90px;
    position: absolute;
    color: #d5d5d5;
}

.play-button:hover { cursor: pointer; font-size: 95px; }

.cover-wrapper video { width: 100%; height: 100%; }

.video-preloader { position: absolute; }

.interactive-image-alt { display: none !important; }

.interactive-image { width: 100%; border: none; }

@media (max-width: 1000px) {
    .interactive-image.only-desktop { display: none; }
    .interactive-image-alt { display: initial !important; }
}

.youtube-iframe {
    display: block;
    margin: auto;
    width: 80%;
    height: 400px;
}

p.cite {
    font-size: 1.5rem;
    color: #555;
    font-style: italic;
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
}

.hacker-text {
    color: #306303;
    font-family: monospace;
    font-weight: bold;
}

/* ---------- responsive ---------- */

@media (max-width: 1200px) {
    .post-layout { grid-template-columns: minmax(0, 1fr) 260px; }
    .post-layout .left-col { display: none; }
}

@media (max-width: 1000px) {
    .post-layout { grid-template-columns: minmax(0, 1fr); }
    .post-layout .right-col { position: static; }
}

@media (max-width: 860px) {
    .profile-layout,
    .post-layout { grid-template-columns: minmax(0, 1fr); }
    .side-col, .right-col { position: static; }
    .nav-links a { min-width: 56px; }
    .nav-links a span { display: none; }
}

@media (max-width: 600px) {
    .page { margin: 0 auto 16px; padding: 0; gap: 8px; }
    .card { border-radius: 0; }
    .cover { height: 110px; }
    .avatar-lg { width: 104px; height: 104px; margin-top: -60px; }
    .profile-body, .section { padding-left: 16px; padding-right: 16px; }
    .show-all { width: calc(100% + 32px); margin: 8px -16px -8px; }
    .profile-row { flex-direction: column; gap: 8px; }
    .profile-orgs { flex-basis: auto; }
    .activity-item img { width: 96px; height: 72px; }
    .activity-desc { -webkit-line-clamp: 2; }
    .topnav-inner { padding: 0 8px; }
    .search { flex: 1 1 auto; }
    .nav-links a { min-width: 44px; padding: 0 4px; }
    #container > .wrapper { padding: 4px 12px 12px; font-size: 17px; }
    .youtube-iframe { width: 100%; height: 220px; }
    .site-footer { padding-bottom: 16px; }
}

/* =========================================================
   Cybersecurity accents — layered on top of the main design.
   Remove this block to go back to the plain look.
   ========================================================= */

:root {
    --cyber: #00c896;
    --cyber-text: #00875f;
    --cyber-soft: rgba(0, 200, 150, 0.14);
    --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

body {
    background-color: #eceae5;
    background-image: radial-gradient(rgba(0, 0, 0, 0.055) 1px, transparent 1px);
    background-size: 22px 22px;
}

/* animated network drawn by script.js behind all content */
#bg-net {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

::selection { background: var(--cyber-soft); }

/* banner: dark navy with a faint grid */
.cover {
    position: relative;
    background:
        linear-gradient(rgba(0, 200, 150, 0.09) 1px, transparent 1px) 0 0 / 24px 24px,
        linear-gradient(90deg, rgba(0, 200, 150, 0.09) 1px, transparent 1px) 0 0 / 24px 24px,
        radial-gradient(circle at 78% 25%, rgba(10, 102, 194, 0.6), transparent 55%),
        radial-gradient(circle at 15% 110%, rgba(0, 200, 150, 0.25), transparent 45%),
        linear-gradient(135deg, #06111c 0%, #0b2540 60%, #0a3a6b 100%);
}

.cover-term {
    position: absolute;
    right: 24px;
    bottom: 18px;
    max-width: calc(100% - 200px);
    font-family: var(--mono);
    font-size: 13px;
    color: rgba(255, 255, 255, 0.85);
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(0, 200, 150, 0.35);
    border-radius: 6px;
    padding: 6px 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cover-term .prompt { color: var(--cyber); }

.cover-term .cursor {
    display: inline-block;
    width: 7px;
    height: 14px;
    margin-left: 4px;
    vertical-align: -2px;
    background: var(--cyber);
    animation: blink 1.1s steps(1) infinite;
}

@keyframes blink { 50% { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
    .cover-term .cursor { animation: none; }
}

/* small accents */
.avatar-lg { box-shadow: 0 0 0 2px var(--cyber), 0 0 18px rgba(0, 200, 150, 0.35); }
.avatar-md { box-shadow: 0 0 0 2px var(--cyber); position: relative; z-index: 1; }

.brand { box-shadow: 0 0 0 1px var(--cyber); }

.nav-links a.active { border-bottom-color: var(--cyber); }

.search input:focus { outline-color: var(--cyber); }

.section h2::before,
.side-card h3::before {
    content: "//";
    font-family: var(--mono);
    color: var(--cyber-text);
    margin-right: 8px;
    font-weight: 500;
}

.logo { font-family: var(--mono); }

.activity-item img { box-shadow: 0 0 0 1px var(--border); }

@media (max-width: 600px) {
    .cover-term {
        right: 12px;
        bottom: 10px;
        max-width: calc(100% - 140px);
        font-size: 11px;
    }
}
