/*
 * Minimal Theme for mmednikov.com
 * Based on Kepano's Minimal theme for Obsidian
 * https://github.com/kepano/obsidian-minimal
 */

/* ---- Color tokens ---- */
:root[data-theme="light"] {
    --bg1: #ffffff;
    --bg2: #f5f5f5;
    --bg3: hsla(0, 0%, 46%, 0.12);
    --tx1: #0f0f0f;
    --tx2: #757575;
    --tx3: #b5b5b5;
    --tx4: #5c5c5c;
    --ui1: #e6e6e6;
    --ui2: #d6d6d6;
    --ui3: #c2c2c2;
    --ax1: hsl(201, 17%, 50%);
    --ax2: hsl(201, 17%, 42%);
    --hl1: hsla(201, 50%, 76%, 0.3);
    --hl2: rgba(255, 225, 0, 0.5);
}

:root[data-theme="dark"] {
    --bg1: hsl(0, 0%, 15%);
    --bg2: hsl(0, 0%, 13%);
    --bg3: hsla(0, 0%, 55%, 0.12);
    --tx1: hsl(0, 0%, 82%);
    --tx2: hsl(0, 0%, 60%);
    --tx3: hsl(0, 0%, 35%);
    --tx4: hsl(0, 0%, 65%);
    --ui1: hsl(0, 0%, 21%);
    --ui2: hsl(0, 0%, 27%);
    --ui3: hsl(0, 0%, 35%);
    --ax1: hsl(201, 17%, 60%);
    --ax2: hsl(201, 17%, 68%);
    --hl1: hsla(201, 70%, 40%, 0.3);
    --hl2: rgba(255, 177, 80, 0.3);
}

/* ---- Semantic aliases ---- */
:root {
    --bg: var(--bg1);
    --bg-secondary: var(--bg2);
    --text: var(--tx1);
    --text-muted: var(--tx2);
    --text-faint: var(--tx3);
    --text-code: var(--tx4);
    --border: var(--ui1);
    --border-strong: var(--ui2);
    --border-focus: var(--ui3);
    --accent: var(--ax1);
    --accent-hover: var(--ax2);

    /* Typography */
    --font-text: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, Ubuntu, sans-serif;
    --font-mono: Menlo, SFMono-Regular, Consolas, "Roboto Mono", monospace;
    --line-height: 1.5;
    --line-width: 640px;

    /* Spacing */
    --p-spacing: 1.75rem;
    --heading-spacing: 2em;

    /* Radius */
    --radius-s: 2px;
    --radius-m: 5px;
    --radius-l: 12px;
}

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

/* ---- Base ---- */
html {
    scroll-snap-type: y mandatory;
    overflow-y: scroll;
    height: 100%;
    scroll-padding-top: 45px;
}

body {
    font-family: var(--font-text);
    background: var(--bg);
    color: var(--text);
    line-height: var(--line-height);
    height: 100%;
    padding-top: 45px;
    transition: background 0.2s, color 0.2s;
}

/* ---- Nav ---- */
nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    scroll-snap-align: none;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 12px clamp(16px, 4vw, 40px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    transition: background 0.2s, border-color 0.2s;
}

.nav-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text);
    flex: 1;
}

.nav-links {
    display: flex;
    gap: 0;
    align-items: center;
    font-size: 0.875rem;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
}

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

.nav-links .divider {
    color: var(--border);
    margin: 0 10px;
}

.nav-right {
    flex: 1;
    display: flex;
    justify-content: flex-end;
}

#theme-toggle {
    font-size: 0.8rem;
    padding: 3px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-m);
    background: var(--bg-secondary);
    color: var(--text);
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}

/* ---- Sections (scroll-snap slides) ---- */
section {
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    border-bottom: 1px solid var(--border);
    scroll-snap-align: start;
    scroll-snap-stop: always;
    transition: border-color 0.2s;
}

.section-inner {
    width: 100%;
    max-width: var(--line-width);
    padding: clamp(40px, 8vh, 80px) clamp(16px, 4vw, 40px);
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.section-inner.visible {
    opacity: 1;
    transform: translateY(0);
}

.section-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 28px;
}

/* ---- Hero ---- */
#hero {
    align-items: center;
    text-align: center;
}

#hero .section-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.profile-pic {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border);
    background: var(--bg-secondary);
}

.hero-name {
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.2;
}

.hero-sub {
    font-size: 0.95rem;
    color: var(--text-muted);
}

.slash-links {
    display: flex;
    gap: 0;
    align-items: center;
    font-size: 0.875rem;
}

.slash-links a {
    color: var(--text-muted);
    text-decoration: none;
}

.slash-links a:hover {
    color: var(--accent);
}

.slash-links .divider {
    color: var(--border);
    margin: 0 10px;
}

/* ---- Projects ---- */
.project-item {
    padding: 20px 0;
    border-bottom: 1px solid var(--border);
}

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

.project-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.project-title a {
    color: var(--text);
    text-decoration: none;
}

.project-title a:hover {
    color: var(--accent);
}

.project-meta {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.project-desc {
    font-size: 0.92rem;
    color: var(--text);
}

.project-try {
    margin-top: 8px;
    font-size: 0.85rem;
}

.project-try a {
    color: var(--accent);
    text-decoration: none;
}

.project-try a:hover {
    text-decoration: underline;
}

/* ---- About ---- */
.about-body {
    font-size: 0.95rem;
    color: var(--text);
    margin-bottom: 32px;
    line-height: 1.7;
}

.contact-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 0.9rem;
}

.contact-list a {
    color: var(--accent);
    text-decoration: none;
}

.contact-list a:hover {
    text-decoration: underline;
}

.contact-label {
    color: var(--text-muted);
    margin-right: 6px;
}

/* ---- Skills ---- */
.skills-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.92rem;
    color: var(--text-muted);
}

.skills-row strong {
    color: var(--text);
    font-weight: 500;
    margin-right: 6px;
}

/* ---- Reading list ---- */
.reading-list {
    display: flex;
    flex-direction: column;
}

.reading-item {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.92rem;
}

.reading-item:last-child {
    border-bottom: none;
}

.reading-title {
    font-weight: 500;
    color: var(--text);
    flex-shrink: 0;
}

.reading-author {
    color: var(--text-muted);
    font-size: 0.85rem;
    flex: 1;
}

.reading-status {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.reading-status.in-progress {
    color: var(--accent);
}

/* ---- Blog list ---- */
.blog-list {
    display: flex;
    flex-direction: column;
}

.blog-item {
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
}

.blog-item:last-child {
    border-bottom: none;
}

.blog-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.blog-title a {
    color: var(--text);
    text-decoration: none;
}

.blog-title a:hover {
    color: var(--accent);
}

.blog-meta {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.blog-desc {
    font-size: 0.92rem;
    color: var(--text-muted);
}

/* ---- Page titles ---- */
.page-title {
    font-size: 1.125em;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-bottom: var(--heading-spacing);
}

/* ---- Article page layout ---- */
.content {
    max-width: var(--line-width);
    width: 88%;
    margin: 0 auto;
    padding: clamp(40px, 8vh, 80px) 0;
}

/* ---- Blog post (article pages) ---- */
.post-back {
    display: inline-block;
    font-size: 0.85rem;
    color: var(--accent);
    text-decoration: none;
    margin-bottom: 1.5em;
}

.post-back:hover {
    text-decoration: underline;
}

.post-header {
    margin-bottom: var(--heading-spacing);
}

.post-title {
    font-size: 1.125em;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-bottom: 0.5em;
}

.post-meta {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.content h2 {
    font-size: 1.05em;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-top: var(--heading-spacing);
    margin-bottom: 0.75em;
}

.content h3 {
    font-size: 1em;
    font-weight: 500;
    letter-spacing: -0.02em;
    margin-top: 1.75em;
    margin-bottom: 0.5em;
}

.content h4 {
    font-size: 0.90em;
    font-weight: 500;
    letter-spacing: -0.02em;
    margin-top: 1.5em;
    margin-bottom: 0.5em;
}

.content p {
    margin-bottom: var(--p-spacing);
    font-size: 0.95rem;
}

.content strong {
    font-weight: 600;
}

.content hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: var(--heading-spacing) 0;
}

.content code {
    font-family: var(--font-mono);
    font-size: 0.9em;
    color: var(--text-code);
    background: var(--bg-secondary);
    padding: 2px 5px;
    border-radius: var(--radius-s);
}

/* KaTeX overrides */
.katex-display {
    margin: 1.25em 0;
    overflow-x: auto;
    overflow-y: hidden;
}

/* ---- Responsive ---- */
@media (max-width: 480px) {
    .nav-name { display: none; }
    .nav-links { font-size: 0.8rem; }
    .nav-links .divider { margin: 0 6px; }
    .hero-name { font-size: 1.25rem; }
}
