:root {
    --text: #333;
    --heading: #222;
    --muted: #666;
    --copy: #555;
    --link: #0066cc;
    --accent: #10b981;
    --accent-hover: #059669;
    --surface: #f9f9f9;
    --surface-hover: #f0f0f0;
    --border: #d9d9d9;
    --radius: 8px;
}

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

body {
    background: #fff;
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
}

header { padding: 2rem 1rem 0.5rem; text-align: center; }
main { max-width: 1200px; margin: 0 auto; padding: 1rem; }
section { margin: 0.5rem 0; }

h1 { font-size: clamp(2rem, 5vw, 3rem); font-weight: 300; }

h2 {
    max-width: 800px;
    margin: 0 auto 1rem;
    color: var(--heading);
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 500;
    text-align: center;
}

h1 .qualification { color: var(--muted); font-size: 0.6em; font-weight: 300; }
h2, .subtitle, .location { text-transform: uppercase; }
h2, .subtitle { letter-spacing: 3px; }

.subtitle {
    margin-top: 0.5rem;
    color: var(--heading);
    font-size: clamp(1.1rem, 2.5vw, 1.5rem);
    font-weight: 500;
}

.social-links,
.location,
.tech-stack,
.tech-item,
.certifications,
.projects-grid,
.project-card h3,
.project-preview,
.project-tags,
.architecture-dialog__body {
    display: flex;
}

.social-links,
.location,
.tech-item,
.project-card h3,
.project-link {
    align-items: center;
}

.social-links,
.tech-stack,
.certifications,
.project-tags {
    flex-wrap: wrap;
}

.social-links,
.location,
.tech-stack,
.certifications,
.project-preview,
.architecture-dialog__body {
    justify-content: center;
}

.social-links { gap: 1.5rem; margin-top: 1rem; }

.social-links a {
    display: flex;
    align-items: center;
    color: var(--text);
    text-decoration: none;
    transition: transform 0.3s ease;
}

.social-links a:hover { transform: translateY(-2px); }
.social-links i { font-size: 36px; }

.location {
    gap: 0.4rem;
    margin-top: 0.75rem;
    color: var(--muted);
    font-size: 0.95rem;
    letter-spacing: 1px;
}

.location i, .project-link { color: var(--link); }
.cta-contact { display: flex; align-items: center; }

.cta-contact a,
.cta-section .cta-button {
    display: inline-block;
    color: white;
    background: var(--accent);
    border-radius: 4px;
    font-weight: 500;
    letter-spacing: 0.3px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.cta-contact a { padding: 0.5rem 1.25rem; font-size: 0.9rem; }
.cta-section .cta-button { padding: 0.875rem 2.5rem; font-size: 1.1rem; }
.cta-contact a:hover, .cta-section .cta-button:hover { background: var(--accent-hover); }
.cta-contact a:hover { transform: translateY(-1px); }
.cta-section .cta-button:hover { transform: translateY(-2px); }

.about p,
.tech-stack,
.cta-section {
    max-width: 800px;
}

.about p,
.tech-stack {
    margin-right: auto;
    margin-left: auto;
}

.about p { color: var(--copy); font-size: 1.1rem; line-height: 1.8; }
.tech-stack { gap: 1rem; margin-top: 1.5rem; }

.tech-item {
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    color: var(--text);
    background: #f5f5f5;
    border-radius: var(--radius);
    font-size: 1rem;
    transition: background 0.3s ease;
}

.tech-item:hover { background: #e0e0e0; }
.tech-item i { flex-shrink: 0; font-size: 18px; }

.certs { padding-top: 10px; }
.certifications { gap: 2rem; margin-top: 0.75rem; }

.cert-badge,
.project-card {
    background: var(--surface);
    border-radius: var(--radius);
    transition: background 0.3s ease;
}

.cert-badge:hover,
.project-card:hover {
    background: var(--surface-hover);
}

.cert-badge { max-width: 150px; padding: 1rem; text-align: center; }
.cert-badge i { display: block; margin-bottom: 0.75rem; font-size: 48px; }
.cert-badge p { color: var(--copy); font-size: 0.9rem; }

.projects-grid {
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    margin-top: 0.75rem;
}

.project-card {
    width: 100%;
    max-width: 900px;
    padding: 1.5rem;
}

.project-card h3 {
    gap: 0.6rem;
    margin-bottom: 0.75rem;
    color: var(--heading);
    font-size: 1.25rem;
}

.project-card p { margin-bottom: 1rem; color: var(--copy); font-size: 1rem; }

.project-preview {
    position: relative;
    align-items: flex-start;
    width: 100%;
    height: 220px;
    margin-bottom: 1rem;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.project-preview iframe {
    width: 1280px;
    height: 820px;
    border: 0;
    pointer-events: none;
    transform: scale(0.37);
    transform-origin: top center;
}

.project-preview--map {
    height: 260px;
    background: #0b1020;
}

.project-preview--map iframe {
    height: 720px;
    transform: scale(0.66);
}

.project-preview--architecture {
    align-items: center;
    height: auto;
    padding: 1rem;
    background: #fff;
}

.project-preview--screenshots {
    height: auto;
    padding: 0.75rem;
    background: #fff;
}

.project-screenshots {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    width: 100%;
}

.project-screenshots img {
    width: 100%;
    height: auto;
    border: 1px solid var(--border);
    border-radius: 4px;
}

.screenshot-trigger {
    display: block;
    width: 100%;
    padding: 0;
    background: transparent;
    border: 0;
    cursor: zoom-in;
    line-height: 0;
}

.screenshot-trigger:focus-visible {
    outline: 2px solid var(--link);
    outline-offset: 3px;
}

.diagram-trigger {
    width: 50%;
    max-width: 450px;
    padding: 0;
    background: transparent;
    border: 0;
    cursor: zoom-in;
}

.diagram-trigger img,
.architecture-dialog__body img,
.image-dialog__body img {
    display: block;
    height: auto;
}

.diagram-trigger img { width: 100%; }

.architecture-dialog,
.image-dialog {
    width: min(92vw, 1883px);
    max-width: none;
    max-height: 92vh;
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: var(--radius);
    box-shadow: 0 24px 80px rgba(15, 23, 42, 0.35);
}

.image-dialog { width: min(94vw, 1661px); }

.architecture-dialog::backdrop,
.image-dialog::backdrop {
    background: rgba(15, 23, 42, 0.72);
}

.architecture-dialog__close,
.image-dialog__close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    z-index: 1;
    width: 2.25rem;
    height: 2.25rem;
    color: var(--text);
    cursor: pointer;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(15, 23, 42, 0.16);
    border-radius: 4px;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.18);
    font-size: 1.4rem;
    line-height: 1;
}

.architecture-dialog__body,
.image-dialog__body {
    max-height: 92vh;
    overflow: auto;
    background: #f8fafc;
}

.architecture-dialog__body img { width: 1800px; max-width: 100%; }
.image-dialog__body img { max-width: none; }

.project-tags { gap: 0.5rem; margin-bottom: 1rem; }

.project-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.65rem;
    color: #444;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 500;
    line-height: 1;
}

.project-link {
    display: inline-flex;
    gap: 0.5rem;
    padding: 0;
    background: transparent;
    border: 0;
    cursor: pointer;
    font: inherit;
    font-weight: 600;
    text-decoration: none;
}

.project-link:hover { text-decoration: underline; }

.cta-section {
    margin: 2rem auto;
    padding: 10px 1rem 1rem;
    text-align: center;
}

.cta-section p { margin-bottom: 1.5rem; color: var(--text); font-size: 1.2rem; }

footer {
    margin-top: 1rem;
    padding: 1rem 0.5rem;
    color: var(--muted);
    border-top: 1px solid #e0e0e0;
    font-size: 0.9rem;
    text-align: center;
}

footer p { margin: 0.5rem 0; }

@media (max-width: 640px) {
    .project-card { padding: 1rem; }
    .project-preview { height: 180px; }
    .project-preview iframe { transform: scale(0.3); }
    .project-preview--map { height: 220px; }
    .project-preview--map iframe { transform: scale(0.3); }
    .project-preview--architecture,
    .project-preview--screenshots {
        height: auto;
    }
    .project-screenshots { grid-template-columns: 1fr; }
    .diagram-trigger { width: 100%; max-width: none; }
}
