/* ======================================================
    Design tokens
    ==================================================== */

:root {
    --bg: #14181C;
    --surface: #1C2229;
    --surface-hover: #232A32;
    --border: #2A323B;
    --text: #E8EAED;
    --text-muted: #8B95A1;
    --accent: #E8A33D;
    --accent-dim: #B8802E;
    --status-green: #4F9D69;

    --font-display: 'IBM Plex Sans', sans-serif;
    --font-mono: 'IBM Plex Mono', monospace;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-display);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: inherit;
    text-decoration: none;
}

/* ==============================================
   Header / nav
   ============================================ */
header {
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}

nav {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 2rem;
}

.brand {
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    letter-spacing: 0.02em;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--status-green);
    box-shadow: 0 0 0 0 rgba(79, 157, 105, 0.6);
    animation: pulse 2.5s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(79, 157, 105, 0.5); }
    70% { box-shadow: 0 0 0 6px rgba(79, 157, 105, 0); }
    100% { box-shadow: 0 0 0 0 rgba(79, 157, 105, 0); }
}

@media (prefers-reduced-motion: reduce) {
    .status-dot { animation: none; }
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    flex: 1;
}

.nav-links a {
    font-size: 0.9rem;
    color: var(--text-muted);
    transition: color 0.15s ease;
}

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

.nav-status {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--status-green);
    letter-spacing: 0.05em;
    display: none;
}

@media (min-width: 640px) {
    .nav-status { display: inline; }
}

/* ================================================
   Main / layout
   ============================================= */
main {
    flex: 1;
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
    padding: 3rem 1.5rem;
}

h1 {
    font-size: 2.25rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin-bottom: 1rem;
}

h2 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

p {
    color: var(--text-muted);
    margin-bottom: 1rem;
}

/* ==========================================================
   Hero (home page)
   ======================================================= */
.hero {
    padding: 4rem 0;
}

.hero p {
    font-size: 1.15rem;
    max-width: 42ch;
}

.hero-links {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

/* ============================================
   Buttons
   ========================================= */
.btn {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.75rem 1.5rem;
    background: var(--accent);
    color: var(--bg);
    border: 1px solid var(--accent);
    border-radius: 2px;
    transition: background 0.15s ease, transform 0.1s ease;
}

.btn:hover,
.btn:focus-visible {
    background: var(--accent-dim);
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-outline:hover,
.btn-outline:focus-visible {
    border-color: var(--accent);
    background: transparent;
    color: var(--accent);
}

/* =====================================================
   Project grid - signature schematic-frame cards
   ================================================== */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.project-card {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 1.5rem;
    transition: border-color 0.15s ease, transform 0.15s ease;
}

.project-card:hover {
    border-color: var(--accent-dim);
    transform: translateY(-2px);
}

/* Corner-bracket schematic framing - the signature element */
.project-card::before,
.project-card::after {
    content: '';
    position: absolute;
    width: 10px;
    height: 10px;
    border-color: var(--accent);
    opacity: 0.7;
}

.project-card::before {
    top: -1px;
    left: -1px;
    border-top: 2px solid var(--accent);
    border-left: 2px solid var(--accent);
}

.project-card::after {
    bottom: -1px;
    right: -1px;
    border-bottom: 2px solid var(--accent);
    border-right: 2px solid var(--accent);
}

.tagline {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--accent);
    margin-bottom: 0.75rem;
    letter-spacing: 0.02em;
}

.tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 1rem 0;
}

.tag {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text-muted);
}

.project-card a {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text);
}

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

/* ====================================
   Blog
   ================================= */
.post-list {
    list-style: none;
    margin-top: 2rem;
}

.post-list li {
    border-bottom: 1px solid var(--border)
}

.post-list a {
    display: block;
    padding: 1rem 0;
    font-size: 1.1rem;
    transition: color 0.15s ease;
}

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

.post-date {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    float: right;
}

.blog-post .post-date {
    float: none;
    margin-bottom: 1.5rem;
}

.blog-post {
    max-width: 68ch;
}

.post-content {
    color: var(--text);
    margin-top: 2rem;
}

.post-content p {
    color: var(--text);
}

.post-content a {
    color: var(--accent);
    text-decoration: underline;
}

.post-content a:hover {
    color: var(--accent-dim);
}

.post-content code {
    font-family: var(--font-mono);
    background: var(--surface);
    padding: 0.15rem 0.4rem;
    border-radius: 2px;
    font-size: 0.9rem;
}

.post-content pre {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 1rem;
    overflow-x: auto;
    margin: 1.5rem;
}

/* ======================================
   Contact form
   =================================== */
.form-error {
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    margin-bottom: 1rem;
}   

form {
    max-width: 480px;
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

label {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-muted);
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

input,
textarea {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.75rem;
    font-family: var(--font-display);
    font-size: 0.95rem;
    margin-top: 0.4rem;
}

input:focus-visible,
textarea:focus-visible {
    outline: none;
    border-color: var(--accent);
}

/* ================================
   Footer
   ============================= */
footer {
    border-top: 1px solid var(--border);
    padding: 1.5rem;
    text-align: center;
}

footer p {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    margin: 0;
}

/* ================================
   Responsive
   ============================= */
@media (max-width: 640px) {
    nav {
        flex-wrap: wrap;
        gap: 1rem;
    }
    .nav-links {
        gap: 1rem;
        flex-wrap: wrap;
    }
    h1 {
        font-size: 1.75rem;
    }
}