<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title><?php echo htmlspecialchars($title); ?></title>
    <meta name="description" content="<?php echo htmlspecialchars($description); ?>">
    <link rel="preconnect" href="https://fonts.googleapis.com">
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
    <link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;700;900&family=DM+Sans:wght@400;500&family=Archivo+Black&display=swap" rel="stylesheet">
    <link rel="stylesheet" href="/css/style.css">
    <?php if (!empty($extra_css)): ?>
        <link rel="stylesheet" href="<?php echo htmlspecialchars($extra_css); ?>">
    <?php endif; ?>
</head>
<body>

    <?php $current = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH); ?>
    <nav class="nav">
        <div class="nav-left">
            <a href="/" class="nav-logo">OU</a>
            <?php if (str_starts_with($current, '/portfolio/')): ?>
                <a href="/portfolio" class="nav-back">←(back)</a>
            <?php endif; ?>
        </div>
        <div class="nav-links">
            <a href="/#about">About</a>
            <a href="/#services">Services</a>
            <a href="/portfolio"<?php echo (str_starts_with($current, '/portfolio')) ? ' class="active"' : ''; ?>>Work</a>
            <a href="/#contact">Contact</a>
        </div>
    </nav>
