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

:root {
    --navy: #1e293b;
    --navy-light: #334155;
    --navy-dark: #0f172a;
    --accent: #3b82f6;
    --accent-dim: #1d4ed8;
    --surface: #f8fafc;
    --surface-alt: #f1f5f9;
    --border: #e2e8f0;
    --text: #1e293b;
    --text-secondary: #64748b;
    --white: #ffffff;
    --green: #22c55e;
    --green-dim: rgba(34, 197, 94, 0.1);
}

html { scroll-behavior: smooth; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--text);
    background: var(--surface);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* === Top Bar === */
.topbar {
    background: var(--navy-dark);
    color: var(--white);
    padding: 0 2rem;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.topbar-brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-weight: 600;
    font-size: 1.05rem;
    letter-spacing: 0.03em;
    text-decoration: none;
    color: var(--white);
}

.topbar-brand svg { flex-shrink: 0; }

.topbar-nav { display: flex; gap: 0.25rem; }

.topbar-nav a {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-size: 0.875rem;
    padding: 0.4rem 0.85rem;
    border-radius: 6px;
    transition: color 0.2s, background 0.2s;
}

.topbar-nav a:hover,
.topbar-nav a.active {
    color: var(--white);
    background: rgba(255,255,255,0.08);
}

/* === Layout === */
.page-wrapper {
    display: flex;
    min-height: calc(100vh - 56px);
}

/* === Sidebar === */
.sidebar {
    width: 220px;
    background: var(--white);
    border-right: 1px solid var(--border);
    padding: 1.5rem 0;
    flex-shrink: 0;
}

.sidebar-section {
    padding: 0 1rem;
    margin-bottom: 1.75rem;
}

.sidebar-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
    padding: 0 0.75rem;
    margin-bottom: 0.5rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.75rem;
    color: var(--text);
    text-decoration: none;
    font-size: 0.875rem;
    border-radius: 6px;
    transition: background 0.15s, color 0.15s;
}

.sidebar-link:hover,
.sidebar-link.active {
    background: var(--surface-alt);
    color: var(--accent-dim);
}

.sidebar-link svg {
    width: 18px;
    height: 18px;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.sidebar-link:hover svg,
.sidebar-link.active svg { color: var(--accent-dim); }

/* === Main Content === */
.main {
    flex: 1;
    padding: 3rem 3.5rem;
    max-width: 860px;
}

/* === Hero === */
.hero {
    text-align: center;
    padding: 2rem 0 3rem;
}

.hero-shield {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    border: 2px solid var(--navy);
    border-radius: 14px;
    margin-bottom: 1.25rem;
}

.hero-shield svg { color: var(--navy); }

.hero h1 {
    font-size: 1.85rem;
    font-weight: 600;
    color: var(--navy-dark);
    margin-bottom: 0.5rem;
}

.hero h1 .nick {
    color: var(--accent);
    font-style: italic;
}

.hero p {
    color: var(--text-secondary);
    font-size: 1.05rem;
    max-width: 520px;
    margin: 0 auto;
}

.hero-status {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 1rem;
    padding: 0.3rem 0.85rem;
    background: var(--green-dim);
    color: #16a34a;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 500;
}

.hero-status .dot {
    width: 7px;
    height: 7px;
    background: var(--green);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* === Section === */
.section { margin-bottom: 2.75rem; }

.section-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.5rem;
    margin-bottom: 1.25rem;
}

/* === Page Header (for subpages) === */
.page-header {
    margin-bottom: 2.5rem;
}

.page-header h1 {
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--navy-dark);
    margin-bottom: 0.4rem;
}

.page-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* === Prose (for about, amiga, blog posts) === */
.prose { max-width: 680px; }

.prose p {
    margin-bottom: 1.15rem;
    font-size: 0.925rem;
    line-height: 1.75;
    color: var(--text);
}

.prose h2 {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--navy-dark);
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

.prose h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--navy);
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.prose ul, .prose ol {
    margin-bottom: 1.15rem;
    padding-left: 1.5rem;
}

.prose li {
    font-size: 0.925rem;
    line-height: 1.75;
    margin-bottom: 0.35rem;
}

.prose a {
    color: var(--accent-dim);
    text-decoration: underline;
    text-underline-offset: 2px;
}

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

.prose blockquote {
    border-left: 3px solid var(--accent);
    padding: 0.75rem 1.25rem;
    margin: 1.5rem 0;
    background: var(--surface-alt);
    border-radius: 0 6px 6px 0;
}

.prose blockquote p {
    margin-bottom: 0;
    color: var(--text-secondary);
    font-style: italic;
}

.prose code {
    background: var(--surface-alt);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
}

.prose img {
    max-width: 100%;
    border-radius: 8px;
    border: 1px solid var(--border);
    margin: 1.25rem 0;
}

/* === Cards === */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
}

.card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.25rem;
    transition: box-shadow 0.2s, border-color 0.2s;
    text-decoration: none;
    color: inherit;
}

.card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.card-header svg {
    width: 18px;
    height: 18px;
    color: var(--accent);
    flex-shrink: 0;
}

.card-header h3 {
    font-size: 0.95rem;
    font-weight: 600;
}

.card p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.55;
}

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.75rem;
}

.tag {
    font-size: 0.72rem;
    padding: 0.2rem 0.55rem;
    background: var(--surface-alt);
    color: var(--text-secondary);
    border-radius: 4px;
    font-weight: 500;
}

/* === Blog Post List === */
.blog-list { display: flex; flex-direction: column; gap: 0; }

.blog-item {
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
    padding: 1.25rem 0;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
    color: inherit;
    transition: background 0.15s;
}

.blog-item:first-child { padding-top: 0; }
.blog-item:last-child { border-bottom: none; }

.blog-item:hover { }

.blog-date {
    flex-shrink: 0;
    width: 52px;
    text-align: center;
}

.blog-date .day {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--navy);
    line-height: 1;
}

.blog-date .month {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
    font-weight: 600;
}

.blog-content h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--navy-dark);
    margin-bottom: 0.25rem;
    line-height: 1.4;
}

.blog-content h3:hover { color: var(--accent-dim); }

.blog-content p {
    font-size: 0.83rem;
    color: var(--text-secondary);
    line-height: 1.55;
}

.blog-content .blog-tags {
    display: flex;
    gap: 0.3rem;
    margin-top: 0.45rem;
}

/* === Skill Bars === */
.skill-list { display: flex; flex-direction: column; gap: 0.85rem; }

.skill-item label {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 0.3rem;
}

.skill-bar {
    height: 6px;
    background: var(--surface-alt);
    border-radius: 3px;
    overflow: hidden;
}

.skill-bar-fill {
    height: 100%;
    background: var(--navy);
    border-radius: 3px;
    transition: width 0.8s ease;
}

/* === Social Links === */
.social-row {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.social-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 1rem;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: border-color 0.2s, box-shadow 0.2s, color 0.2s;
}

.social-link:hover {
    border-color: var(--accent);
    color: var(--accent-dim);
    box-shadow: 0 2px 8px rgba(59,130,246,0.1);
}

.social-link svg {
    width: 18px;
    height: 18px;
}

/* === Amiga-specific === */
.amiga-model {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.amiga-model h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--navy-dark);
    margin-bottom: 0.3rem;
}

.amiga-model .amiga-year {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.amiga-model p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.55;
}

.amiga-ascii {
    background: var(--navy-dark);
    color: #22d3ee;
    padding: 1.5rem;
    border-radius: 8px;
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 0.72rem;
    line-height: 1.35;
    overflow-x: auto;
    margin-bottom: 2rem;
    white-space: pre;
}

/* === Footer === */
.footer {
    border-top: 1px solid var(--border);
    padding: 1.5rem 3.5rem;
    font-size: 0.78rem;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer a {
    color: var(--text-secondary);
    text-decoration: none;
}

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

/* === Responsive === */
@media (max-width: 768px) {
    .sidebar { display: none; }
    .main { padding: 2rem 1.25rem; }
    .footer { padding: 1.25rem; flex-direction: column; gap: 0.5rem; }
    .topbar-nav { display: none; }
    .blog-item { flex-direction: column; gap: 0.5rem; }
    .blog-date { width: auto; text-align: left; display: flex; gap: 0.4rem; align-items: baseline; }
    .blog-date .day { font-size: 1rem; }
}
