/* === CSS Variables & Theme === */
:root {
    --bg-primary: #161618;
    --bg-secondary: #1e1e20;
    --bg-tertiary: #2a2a2d;
    --text-primary: #d8d8d8;
    --text-secondary: #a0a0a0;
    --text-muted: #6a6a6a;
    --accent: #e2b384;
    --accent-hover: #d4a06e;
    --border: #333336;
    --radius: 8px;
    --radius-lg: 12px;
    --transition: 200ms ease;
    --nav-height: 48px;
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--nav-height) + 24px);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* === Grid Background + Cursor Glow === */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.25) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.25) 1px, transparent 1px);
    background-size: 48px 48px;
    -webkit-mask-image: radial-gradient(
        900px circle at var(--pointer-fixed, -1000px -1000px),
        rgba(0, 0, 0, 1) 0%,
        rgba(0, 0, 0, 0.6) 40%,
        rgba(0, 0, 0, 0.1) 100%
    );
    mask-image: radial-gradient(
        900px circle at var(--pointer-fixed, -1000px -1000px),
        rgba(0, 0, 0, 1) 0%,
        rgba(0, 0, 0, 0.6) 40%,
        rgba(0, 0, 0, 0.1) 100%
    );
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: radial-gradient(
        600px circle at var(--pointer-fixed, -1000px -1000px),
        rgba(226, 179, 132, 0.04) 0%,
        rgba(196, 160, 255, 0.02) 40%,
        transparent 70%
    );
    transition: opacity 0.3s;
}

body.pointer-none::after {
    opacity: 0;
}

body > *, body > main, body > nav, body > footer {
    position: relative;
    z-index: 1;
}

::selection {
    background: var(--accent);
    color: var(--bg-primary);
}

/* === Custom Scrollbar === */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* === Typography === */
h1, h2, h3, h4 {
    color: var(--text-primary);
    font-weight: 600;
    line-height: 1.3;
}

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

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

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* === Navigation (matches Fydar DefaultLayout) === */
.site-nav {
    margin: 0;
    padding: 0;
    border: 0;
    position: sticky;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.site-nav::before {
    content: "";
    position: absolute;
    top: 0;
    height: calc(100% - 1px);
    width: 100%;
    background-color: #16161833;
    pointer-events: none;
}

.site-nav::after {
    content: "";
    border-bottom: 1px solid #ffffff15;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
}

.nav-inner {
    position: relative;
    display: flex;
    align-items: center;
    height: var(--nav-height);
    padding: 0 24px;
    margin: 0 auto;
}

.nav-left {
    display: flex;
    align-items: center;
    height: 100%;
    gap: 4px;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}

.nav-logo {
    display: flex;
    align-items: center;
    height: 100%;
    padding: 0 10px;
    gap: 10px;
    font-size: 1rem;
    font-weight: 500;
    color: #ffffffdd;
    letter-spacing: 2px;
    filter: drop-shadow(0px 2px 4px black);
}

.nav-logo-icon {
    height: 70%;                /* scales WITH header */
    width: auto;                /* keep aspect ratio */
    max-height: 40px;           /* safety limit */
    object-fit: contain;
    flex-shrink: 0;
}

.nav-logo:hover {
    color: #ffffff;
}

.nav-links {
    display: flex;
    list-style: none;
    height: 100%;
    gap: 4px;
}

.nav-links li {
    display: flex;
    position: relative;
    height: 100%;
    align-items: center;
}

.nav-link {
    display: flex;
    height: 100%;
    min-width: 48px;
    align-items: center;
    justify-content: center;
    padding: 0 0.5em;
    color: #ffffff9b;
    font-size: 0.85rem;
    font-weight: 400;
    letter-spacing: 1px;
    transition: color 0.05s;
    filter: drop-shadow(0px 2px 4px black);
}

.nav-link:hover {
    color: #ffffffdd;
}

.nav-links li:has(.nav-link:hover),
.nav-links li:has(.nav-link:focus-visible) {
    border-bottom: 1px solid #ffffff33;
}

.nav-links li:has(.nav-link.active) {
    border-bottom: 1px solid #ffffffdd;
}

.nav-link.active {
    color: #ffffffdd;
}

.nav-social {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    height: var(--nav-height);
    color: white;
    transition: opacity 0.1s;
    opacity: 0.35;
    filter: drop-shadow(0px 2px 4px black);
}

.nav-social svg {
    transition: filter 0.1s;
}

.nav-social:hover,
.nav-social:focus-visible {
    opacity: 1;
    color: white;
}

.nav-social:hover svg,
.nav-social:focus-visible svg {
    filter: drop-shadow(0px 2px 4px black) drop-shadow(0 0 6px var(--accent));
}

/* === Layout === */
main {
    min-height: calc(100vh - var(--nav-height));
}

.section {
    padding: 48px 0;
}

/* === Two-Column Portfolio Layout === */
.portfolio-layout {
    display: grid;
    grid-template-columns: 1fr;
    min-height: calc(100vh - var(--nav-height));
}

/* === Sidebar (matches Fydar landing-aside + toc-aside) === */
.sidebar {
    display: flex;
    flex-direction: column;
    padding: 0 24px;
}

.sidebar-inner {
    padding: 32px 0;
}

.sidebar-profile {
    margin-bottom: 48px;
}

.sidebar-slug {
    color: #ffffff80;
    font-size: 1.625rem;
    letter-spacing: 8px;
    font-weight: 400;
    margin-bottom: 0;
}

.sidebar-name {
    font-size: 4rem;
    font-weight: 600;
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-top: 0.5rem;
    margin-bottom: 1.5rem;
}

.sidebar-title {
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 2rem;
}

.sidebar-title b {
    font-weight: 600;
}

.sidebar-bio {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 20px;
}

.sidebar-socials {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-left: -10px;
}

.sidebar-social {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    min-height: 48px;
    color: white;
    transition: filter 0.125s, opacity 0.125s;
    opacity: 0.45;
}

.sidebar-social:hover,
.sidebar-social:focus-visible {
    opacity: 1;
    color: white;
    filter: drop-shadow(0 0 1px #ffffff60) drop-shadow(0 0 6px var(--accent));
}

/* === Sidebar Navigation === */
.sidebar-nav {
    display: none;
    flex-direction: column;
    gap: 2px;
}

.sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    text-decoration: none;
    transition: color 0.2s, background 0.2s;
}

.sidebar-nav-item:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
}

.sidebar-nav-item.active {
    color: #c4a0ff;
    background: rgba(196, 160, 255, 0.08);
}

.sidebar-nav-icon {
    flex-shrink: 0;
    opacity: 0.7;
}

.sidebar-nav-item.active .sidebar-nav-icon {
    opacity: 1;
    color: #c4a0ff;
}

/* === Section Labels & Large Headings === */
.section-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.section-label-dash {
    display: inline-block;
    width: 20px;
    height: 2px;
    background: var(--accent);
}

.section-heading-large {
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    margin-bottom: 24px;
}

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

/* === Portfolio Content (right column) === */
.portfolio-content {
    min-width: 0;
    padding: 0 24px;
}

/* === Buttons === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 28px;
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    border: none;
    font-family: inherit;
}

.btn-primary {
    background: var(--accent);
    color: var(--bg-primary);
}

.btn-primary:hover {
    background: var(--accent-hover);
    color: var(--bg-primary);
}

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

.btn-secondary:hover {
    border-color: var(--text-secondary);
    background: var(--bg-secondary);
}

/* === Footer (matches Fydar DefaultLayout) === */
.site-footer {
    background-color: #00000010;
    margin-top: 5rem;
    padding: 2rem 24px 3rem;
    text-align: center;
    border-top: 1px solid #ffffff15;
    color: #888;
}

.footer-inner {
    margin: 0 auto;
}

.site-footer p {
    color: #888;
    font-size: 0.85rem;
}

.footer-links {
    margin-top: 8px;
}

.footer-links a {
    color: #888;
    font-size: 0.85rem;
}

.footer-links a:hover {
    color: var(--text-primary);
}

.footer-sep {
    margin: 0 8px;
}

/* === Contact Page Layout === */
.contact-section {
    max-width: 1100px;
    margin: 0 auto;
    padding: 48px 24px;
}

.contact-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: start;
}

.contact-left {
    display: flex;
    flex-direction: column;
}

.contact-intro {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 32px;
}

.contact-submit {
    gap: 8px;
}

.contact-right {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.contact-image-wrapper {
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.contact-photo {
    width: 100%;
    aspect-ratio: 5 / 7;
    object-fit: cover;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 20px;
    background: #1e1e20;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
}

.contact-info-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.contact-info-item svg {
    flex-shrink: 0;
    color: var(--accent);
    opacity: 0.7;
}

.contact-info-item a {
    color: var(--text-secondary);
    transition: color 0.2s;
}

.contact-info-item a:hover {
    color: var(--accent);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 768px) {
    .contact-layout {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .contact-right {
        order: -1;
    }

    .form-row {
        grid-template-columns: 1fr;
    }
}

/* === Forms === */
.contact-form {
    max-width: none;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color var(--transition);
}

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

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

/* === Toast Notifications === */
#form-result {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 9999;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-width: 320px;
    max-width: 440px;
    padding: 16px 18px;
    border-radius: 10px;
    font-size: 0.9rem;
    backdrop-filter: blur(12px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    pointer-events: auto;
    animation: toast-in 0.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.toast--success {
    background: rgba(22, 22, 24, 0.92);
    border: 1px solid rgba(74, 222, 128, 0.35);
}

.toast--error {
    background: rgba(22, 22, 24, 0.92);
    border: 1px solid rgba(248, 113, 113, 0.35);
}

.toast-icon {
    flex-shrink: 0;
    margin-top: 1px;
}

.toast--success .toast-icon { color: #4ade80; }
.toast--error .toast-icon { color: #f87171; }

.toast-body {
    flex: 1;
    min-width: 0;
}

.toast-title {
    font-weight: 600;
    font-size: 0.9rem;
    margin: 0 0 2px;
    color: #f0f0f0;
}

.toast-text {
    margin: 0;
    font-size: 0.82rem;
    line-height: 1.5;
    color: #a0a0a0;
}

.toast-close {
    flex-shrink: 0;
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 2px;
    margin: -2px -2px 0 0;
    transition: color 0.2s;
}

.toast-close:hover {
    color: #d8d8d8;
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateX(40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.toast--hiding {
    animation: toast-out 0.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes toast-out {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(40px);
    }
}

@media (max-width: 480px) {
    #form-result {
        top: 12px;
        right: 12px;
        left: 12px;
    }

    .toast {
        min-width: 0;
        max-width: none;
    }
}

/* === Back Link === */
.back-link {
    display: inline-block;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 32px;
}

.back-link:hover {
    color: var(--text-primary);
}

/* === Responsive (matches Fydar breakpoints) === */

/* Mobile >= 576px */
@media (min-width: 576px) {
    .sidebar { padding: 0 32px; }
    .portfolio-content { padding: 0 32px; }
    .nav-links { gap: 11px; }
}

/* Tablet >= 768px */
@media (min-width: 768px) {
    .sidebar { padding: 0 40px; }
    .portfolio-content { padding: 0 40px; }
    .nav-links { gap: 14px; }
}

/* Low-Resolution Desktop >= 992px: Two-column centered layout */
@media (min-width: 992px) {
    .nav-inner {
        max-width: 896px;
        margin: 0 auto;
        padding: 0;
    }

    .portfolio-layout {
        max-width: 896px;
        margin: 0 auto;
        grid-template-columns: 300px 32px 1fr;
    }

    .sidebar {
        grid-column: 1;
        position: sticky;
        top: var(--nav-height);
        height: calc(100vh - var(--nav-height));
        overflow-y: auto;
        padding: 0;
    }

    .sidebar-inner {
        padding-top: 3em;
    }

    .portfolio-content {
        grid-column: 3;
        padding: 0;
        overflow-x: clip;
    }

    .sidebar-nav {
        display: flex;
    }

    .section {
        padding: 32px 0;
    }
}

/* Desktop >= 1200px */
@media (min-width: 1200px) {
    .nav-inner {
        max-width: 1104px;
    }

    .portfolio-layout {
        max-width: 1104px;
        grid-template-columns: 350px 32px 1fr;
    }
}

/* Full-screen Desktop >= 1400px */
@media (min-width: 1400px) {
    .nav-inner {
        max-width: 1304px;
    }

    .portfolio-layout {
        max-width: 1304px;
        grid-template-columns: 410px 32px 1fr;
    }
}

/* Small screen adjustments */
@media (max-width: 991px) {
    .sidebar-name {
        font-size: 2.5rem;
    }

    .sidebar-slug {
        font-size: 1.25rem;
    }
}

@media (max-width: 480px) {
    .sidebar { padding: 0 16px; }
    .portfolio-content { padding: 0 16px; }
    .nav-inner { padding: 0 16px; }
    .sidebar-name { font-size: 2rem; }
    .nav-logo-text { display: none; }
}
