/* ===========================================================================
   Design system — dark, monospace body + Expletus Sans display, pink accent.
   Inspired by the layout language of alexrabin.com.
=========================================================================== */
:root {
    --bg:         #0a0f1c;
    --bg-soft:    #111a2e;
    --bg-card:    #131d33;
    --border:     rgba(255, 255, 255, 0.10);
    --border-2:   rgba(255, 255, 255, 0.18);
    --text:       #ffffff;
    --text-dim:   rgba(226, 234, 255, 0.72);
    --text-mute:  rgba(196, 208, 235, 0.48);
    --accent:     #4f7cff;
    --accent-2:   #7ea0ff;
    --radius:     14px;
    --maxw:       1040px;
    --readw:      760px;
    --mono:       "Source Code Pro", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    --display:    "Expletus Sans", "Source Code Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    color: var(--text);
    font-family: var(--mono);
    font-size: 15.5px;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-family: var(--display); line-height: 1.15; font-weight: 700; }

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

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

code {
    font-family: var(--mono);
    font-size: 0.88em;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.1em 0.4em;
}

/* ---------------------------------------------------------------------------
   Header / nav
--------------------------------------------------------------------------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.1rem clamp(1.1rem, 4vw, 2.5rem);
    background: color-mix(in srgb, var(--bg) 82%, transparent);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}
.brand { display: inline-flex; }
.brand:hover { text-decoration: none; }
.brand-mark {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
}
.vinyl {
    display: block;
    border-radius: 50%;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.55);
    animation: vinyl-spin 3.2s linear infinite;
    transition: filter 0.2s ease;
}
.brand:hover .vinyl { animation-duration: 1.1s; filter: drop-shadow(0 0 6px rgba(79, 124, 255, 0.55)); }

@keyframes vinyl-spin {
    to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
    .vinyl { animation: none; }
}

.site-nav { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.site-nav a {
    padding: 0.4rem 0.85rem;
    border-radius: 8px;
    color: var(--accent);
    font-size: 0.95rem;
}
.site-nav a:hover { text-decoration: none; background: var(--bg-soft); }
.site-nav a.active { color: #fff; background: var(--accent); }

/* ---------------------------------------------------------------------------
   Main layout
--------------------------------------------------------------------------- */
.site-main {
    flex: 1 0 auto;
    width: 100%;
    max-width: var(--maxw);
    margin: 0 auto;
    padding: clamp(2rem, 6vw, 4.5rem) clamp(1.1rem, 4vw, 2.5rem) 5rem;
}

.block { margin-top: 3.5rem; max-width: var(--readw); }
.block:first-child { margin-top: 0; }
.block > h2 {
    font-size: 1.5rem;
    margin-bottom: 1.4rem;
    position: relative;
    padding-left: 1rem;
}
.block > h2::before {
    content: "";
    position: absolute;
    left: 0; top: 0.15em; bottom: 0.15em;
    width: 4px; border-radius: 4px;
    background: var(--accent);
}

.lede { color: var(--text-dim); font-size: 1.05rem; }
.note { color: var(--text-mute); font-size: 0.92rem; margin-top: 1rem; }
.empty {
    color: var(--text-dim);
    background: var(--bg-soft);
    border: 1px dashed var(--border-2);
    border-radius: var(--radius);
    padding: 1.5rem;
}

/* ---------------------------------------------------------------------------
   Hero (About)
--------------------------------------------------------------------------- */
.hero {
    display: flex;
    gap: 2.5rem;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    min-height: 40vh;
}
.hero-text { flex: 1 1 420px; }
.hero-intro {
    color: var(--accent);
    font-family: var(--mono);
    font-size: 1rem;
    letter-spacing: 0.02em;
    margin: 0 0 0.6rem;
}
.hero-name {
    font-size: clamp(2.6rem, 7vw, 4.4rem);
    margin: 0 0 0.6rem;
    letter-spacing: -0.01em;
}
.headline { color: var(--text); font-weight: 500; font-family: var(--mono); margin: 0 0 0.5rem; opacity: 0.9; }
.hero-location {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0 0 1rem;
    color: var(--text-dim);
    font-family: var(--mono);
    font-size: 0.9rem;
}
.hero-location .pin { color: var(--accent); flex: 0 0 auto; }
.hero-links { display: flex; gap: 0.75rem; margin-top: 1.6rem; flex-wrap: wrap; }
.avatar {
    border-radius: 20px;
    border: 1px solid var(--border-2);
    object-fit: cover;
    flex: 0 0 auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.btn {
    display: inline-block;
    padding: 0.6rem 1.3rem;
    border-radius: 10px;
    background: var(--accent);
    color: #fff;
    font-family: var(--mono);
    font-weight: 600;
    font-size: 0.92rem;
    border: 1px solid transparent;
    transition: transform 0.15s ease, filter 0.15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); filter: brightness(1.08); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border-2); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* ---------------------------------------------------------------------------
   Experience (grouped by company)
--------------------------------------------------------------------------- */
.xp-company { margin-bottom: 2.2rem; }
.xp-company:last-child { margin-bottom: 0; }
.xp-company-name {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 1.2rem;
    margin: 0 0 0.9rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
    color: var(--accent);
}
.xp-company-name a { color: var(--accent); }
.xp-logo {
    width: 28px;
    height: 28px;
    border-radius: 7px;
    object-fit: contain;
    background: #fff;
    padding: 3px;
    flex: 0 0 auto;
}
.timeline a.timeline-company:hover { text-decoration: underline; }
.xp-role { padding: 0.6rem 0 0.6rem 1.1rem; border-left: 2px solid var(--border-2); margin-bottom: 0.5rem; }
.xp-role:last-child { margin-bottom: 0; }
.xp-head { display: flex; justify-content: space-between; gap: 0.6rem; flex-wrap: wrap; align-items: baseline; }
.xp-title { font-weight: 600; color: #fff; }
.xp-period { color: var(--text-mute); font-size: 0.82rem; white-space: nowrap; }
.xp-place { margin: 0.1rem 0 0; color: var(--text-mute); font-size: 0.82rem; }
.xp-points { margin: 0.6rem 0 0; padding-left: 1.1rem; }
.xp-points li { margin: 0.4rem 0; color: var(--text-dim); }
.xp-points li::marker { color: var(--accent); }

/* ---------------------------------------------------------------------------
   Timeline (education)
--------------------------------------------------------------------------- */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li {
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
    flex-wrap: wrap;
    padding: 0.9rem 0;
    border-bottom: 1px solid var(--border);
}
.timeline li:last-child { border-bottom: none; }
.timeline-role { font-weight: 600; }
.timeline-company { color: var(--accent); }
.timeline-period { margin-left: auto; color: var(--text-mute); font-size: 0.85rem; }

/* ---------------------------------------------------------------------------
   Skills & languages
--------------------------------------------------------------------------- */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; }
.two-col h2 { font-size: 1.5rem; margin-bottom: 1.1rem; }
.pills { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.pill {
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    font-size: 0.85rem;
    color: var(--text-dim);
}
.lang-list { list-style: none; margin: 0; padding: 0; }
.lang-list li {
    display: flex;
    justify-content: space-between;
    gap: 0.6rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
}
.lang-list li:last-child { border-bottom: none; }
.lang-level { color: var(--text-mute); font-size: 0.85rem; }

/* ---------------------------------------------------------------------------
   Cards (projects)
--------------------------------------------------------------------------- */
.cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 1rem;
}
.card {
    display: block;
    padding: 1.15rem 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    transition: border-color 0.15s ease, transform 0.15s ease;
}
.card:hover { text-decoration: none; border-color: var(--accent); transform: translateY(-3px); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.card-head h3 { margin: 0; font-size: 1.05rem; }
.card p { margin: 0.5rem 0 0; color: var(--text-dim); font-size: 0.88rem; }
.tag {
    font-size: 0.7rem;
    color: var(--accent-2);
    background: color-mix(in srgb, var(--accent) 18%, transparent);
    border-radius: 999px;
    padding: 0.15rem 0.6rem;
    white-space: nowrap;
    font-family: var(--mono);
}

/* ---------------------------------------------------------------------------
   Blog
--------------------------------------------------------------------------- */
.block h1 { font-size: clamp(2rem, 5vw, 2.8rem); margin: 0 0 1.5rem; }
.post-list { list-style: none; margin: 0; padding: 0; }
.post-list li { padding: 1.5rem 0; border-bottom: 1px solid var(--border); }
.post-list h2 { margin: 0; font-size: 1.35rem; }
.post-list h2::before { display: none; }
.post-date { color: var(--accent); font-family: var(--mono); font-size: 0.82rem; margin: 0.3rem 0; }
.post-excerpt { color: var(--text-dim); margin: 0.4rem 0 0; }
.back { display: inline-block; margin-bottom: 1rem; color: var(--text-mute); font-size: 0.9rem; }
.post h2 { font-size: clamp(1.8rem, 4vw, 2.4rem); margin: 0.3rem 0; }
.post h2::before { display: none; }

.prose { margin-top: 1.5rem; color: var(--text-dim); }
.prose h1, .prose h2, .prose h3 { color: #fff; margin: 1.8rem 0 0.6rem; }
.prose h2::before { display: none; }
.prose p { margin: 0.9rem 0; }
.prose a { text-decoration: underline; }
.prose ul, .prose ol { padding-left: 1.4rem; }
.prose li::marker { color: var(--accent); }
.prose pre {
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    overflow-x: auto;
}
.prose pre code { background: none; border: none; padding: 0; }
.prose blockquote {
    margin: 1rem 0;
    padding: 0.4rem 1rem;
    border-left: 3px solid var(--accent);
    color: var(--text-mute);
}

/* ---------------------------------------------------------------------------
   Records (Discogs)
--------------------------------------------------------------------------- */
.records { max-width: var(--maxw); }
.records-head { text-align: center; margin-bottom: 2rem; }
.records-head h1 { font-size: clamp(2.2rem, 6vw, 3.4rem); margin: 0 0 0.4rem; }
.records-sub { color: var(--text-dim); font-family: var(--mono); font-size: 0.95rem; margin: 0; }
.records-sub a { color: var(--accent); }

.records-controls {
    display: flex;
    gap: 0.75rem;
    align-items: stretch;
    flex-wrap: wrap;
    max-width: var(--readw);
    margin: 0 auto 0.75rem;
}
.sort-field { position: relative; display: flex; flex-direction: column; gap: 0.2rem; }
.control-label {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-mute);
    padding-left: 0.9rem;
}
#record-sort {
    appearance: none;
    -webkit-appearance: none;
    background: var(--bg-soft);
    color: #fff;
    border: 1px solid var(--border-2);
    border-radius: 10px;
    padding: 0.55rem 2.2rem 0.55rem 0.9rem;
    font-family: var(--mono);
    font-size: 0.9rem;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%234f7cff' stroke-width='3'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.8rem center;
}
.order-btn {
    align-self: flex-end;
    width: 44px; height: 42px;
    background: var(--bg-soft);
    color: var(--accent);
    border: 1px solid var(--border-2);
    border-radius: 10px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: border-color 0.15s ease;
}
.order-btn:hover { border-color: var(--accent); }
.record-search {
    flex: 1 1 260px;
    align-self: flex-end;
    background: var(--bg-soft);
    color: #fff;
    border: 1px solid var(--border-2);
    border-radius: 10px;
    padding: 0.55rem 0.9rem;
    height: 42px;
    font-family: var(--mono);
    font-size: 0.9rem;
}
.record-search::placeholder { color: var(--text-mute); }
.record-search:focus, #record-sort:focus, .order-btn:focus-visible {
    outline: none;
    border-color: var(--accent);
}
.records-count {
    max-width: var(--readw);
    margin: 0 auto 1.5rem;
    color: var(--text-mute);
    font-size: 0.8rem;
    letter-spacing: 0.04em;
}

.record-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1.3rem;
}
.record { display: flex; flex-direction: column; }
.record[hidden] { display: none; }
.record-cover {
    position: relative;
    display: block;
    aspect-ratio: 1 / 1;
    border-radius: 10px;
    overflow: hidden;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    display: grid;
    place-items: center;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}
a.record-cover:hover { transform: translateY(-4px); box-shadow: 0 12px 30px rgba(0,0,0,0.55); text-decoration: none; }
.record-cover img { width: 100%; height: 100%; object-fit: cover; }
.record-placeholder { color: var(--text-mute); }
.record-badge {
    position: absolute;
    left: 0.5rem; bottom: 0.5rem;
    font-size: 0.65rem;
    font-family: var(--mono);
    background: rgba(0, 0, 0, 0.72);
    color: #fff;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    backdrop-filter: blur(4px);
}
.record-meta { margin-top: 0.7rem; }
.record-title {
    margin: 0;
    font-size: 0.92rem;
    font-family: var(--mono);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.record-artist {
    margin: 0.15rem 0 0;
    color: var(--text-mute);
    font-size: 0.82rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.records-noresults { text-align: center; margin-top: 1.5rem; }

/* ---------------------------------------------------------------------------
   Footer / contact (persistent, pinned to the bottom of every page)
--------------------------------------------------------------------------- */
.site-footer {
    flex-shrink: 0;
    margin-top: auto;
    background: var(--bg-soft);
    border-top: 1px solid var(--border);
    padding: 3rem 1.5rem;
}
.footer-inner { max-width: var(--maxw); margin: 0 auto; text-align: center; }
.footer-tagline {
    margin: 0 0 1.2rem;
    font-family: var(--display);
    font-weight: 600;
    font-size: 1.2rem;
    color: var(--text);
}
.contact-icons { display: flex; justify-content: center; gap: 1.1rem; }
.contact-icons a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    color: var(--text-dim);
    background: var(--bg-card);
    border: 1px solid var(--border);
    transition: color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.contact-icons a:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-3px); }
.footer-copy { margin: 1.6rem 0 0; color: var(--text-mute); font-size: 0.82rem; font-family: var(--mono); }

/* ---------------------------------------------------------------------------
   Responsive
--------------------------------------------------------------------------- */
@media (max-width: 640px) {
    .two-col { grid-template-columns: 1fr; gap: 2rem; }
    .hero { flex-direction: column-reverse; align-items: flex-start; text-align: left; min-height: auto; }
    .timeline-period { margin-left: 0; }
    .record-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 1rem; }
}
