/* Liquid-glass inspired web UI */

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

:root {
    --text: #1c1c1e;
    --text-secondary: #3c3c43;
    --text-muted: rgba(60, 60, 67, 0.72);
    --accent: #007aff;
    --accent-hover: #0056b3;
    --glass-bg: rgba(255, 255, 255, 0.62);
    --glass-bg-solid: rgba(255, 255, 255, 0.92);
    --glass-border: rgba(255, 255, 255, 0.75);
    --glass-highlight: rgba(255, 255, 255, 0.9);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    --radius-sm: 14px;
    --radius-md: 20px;
    --radius-lg: 28px;
    --radius-pill: 999px;
    --blur: 20px;
    --max-width: 920px;
    --space: 1.25rem;
}

html {
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
    }
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.55;
    color: var(--text);
    min-height: 100vh;
    background: #e8ecf4;
    -webkit-font-smoothing: antialiased;
}

.bg-canvas {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    background: linear-gradient(145deg, #dce8f8 0%, #e8e4f4 35%, #eef2f8 70%, #e4edf6 100%);
}

.bg-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.55;
}

.bg-orb--1 {
    width: 420px;
    height: 420px;
    top: -80px;
    right: -60px;
    background: #7eb8ff;
}

.bg-orb--2 {
    width: 360px;
    height: 360px;
    bottom: 10%;
    left: -80px;
    background: #b8a8f0;
}

.bg-orb--3 {
    width: 280px;
    height: 280px;
    top: 40%;
    right: 15%;
    background: #8ed4c8;
}

.glass {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    position: relative;
}

@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
    .glass {
        -webkit-backdrop-filter: blur(var(--blur)) saturate(1.35);
        backdrop-filter: blur(var(--blur)) saturate(1.35);
    }
}

.glass::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    box-shadow: inset 0 1px 0 var(--glass-highlight);
}

@media (prefers-reduced-transparency: reduce) {
    .glass {
        background: var(--glass-bg-solid);
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
    }
}

.skip-link {
    position: absolute;
    top: -100%;
    left: var(--space);
    z-index: 200;
    padding: 0.5rem 1rem;
    background: var(--text);
    color: #fff;
    border-radius: var(--radius-pill);
    font-weight: 600;
    font-size: 0.875rem;
}

.skip-link:focus-visible {
    top: 0.75rem;
}

/* Layout */
.page {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: var(--space);
    padding-top: 0.5rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    gap: var(--space);
}

/* Top nav — single glass chrome cluster */
.glass-nav {
    position: sticky;
    top: 0.75rem;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.65rem 1rem;
    border-radius: var(--radius-pill);
    margin-bottom: 0.25rem;
}

.nav-brand {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text);
    letter-spacing: -0.02em;
}

.nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    list-style: none;
    justify-content: center;
}

.nav-links a {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius-pill);
    transition: background-color 0.15s ease, color 0.15s ease;
}

.nav-links a:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text);
}

.nav-links a:focus-visible,
.nav-brand:focus-visible,
.btn:focus-visible,
a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.nav-cta {
    font-size: 0.875rem;
    font-weight: 600;
    color: #fff;
    background: var(--accent);
    padding: 0.45rem 1rem;
    border-radius: var(--radius-pill);
    white-space: nowrap;
    transition: background-color 0.15s ease;
}

.nav-cta:hover {
    background: var(--accent-hover);
}

main {
    display: flex;
    flex-direction: column;
    gap: var(--space);
    flex: 1;
}

/* Panels */
.glass-panel {
    border-radius: var(--radius-lg);
    padding: 1.5rem 1.35rem;
}

.glass-panel--hero {
    text-align: center;
    padding: 2rem 1.5rem 1.75rem;
}

.hero-title {
    font-size: clamp(1.75rem, 4vw, 2.25rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 0.35rem;
    text-wrap: balance;
}

.hero-subtitle {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.hero-tagline {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
}

.section-title {
    font-size: 1.15rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-bottom: 1rem;
    color: var(--text);
}

.glass-panel p {
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    font-size: 0.9375rem;
}

.glass-panel p:last-child {
    margin-bottom: 0;
}

/* Buttons */
.btn-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 0.5rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0.55rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: var(--radius-pill);
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.15s ease, transform 0.15s ease;
}

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

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

.btn-glass {
    background: rgba(255, 255, 255, 0.55);
    color: var(--accent);
    border: 1px solid rgba(255, 255, 255, 0.8);
}

.btn-glass:hover {
    background: rgba(255, 255, 255, 0.75);
}

.btn:active {
    transform: scale(0.98);
}

/* Skills grid */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
}

.glass-chip {
    border-radius: var(--radius-md);
    padding: 1rem 1.1rem;
}

.glass-chip h3 {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 0.65rem;
}

.glass-chip ul {
    list-style: none;
}

.glass-chip li {
    font-size: 0.875rem;
    color: var(--text-secondary);
    padding: 0.35rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.glass-chip li:last-child {
    border-bottom: none;
}

/* Project cards */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 0.75rem;
}

.project-card {
    border-radius: var(--radius-md);
    padding: 1.15rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.project-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.project-logo-wrap {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.project-logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.project-card h3 {
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.project-description {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.5;
    flex: 1;
}

.project-card .btn {
    align-self: flex-start;
    min-height: 38px;
    padding: 0.45rem 1rem;
    font-size: 0.8125rem;
}

/* Contact */
.contact-email {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--accent);
    text-decoration: none;
}

.contact-email:hover {
    text-decoration: underline;
}

/* Footer */
.glass-footer {
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    text-align: center;
    margin-top: 0.25rem;
}

.glass-footer p {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.footer-note {
    margin-top: 0.35rem;
    font-size: 0.75rem;
    opacity: 0.85;
}

/* Legacy container (error pages) */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: var(--space);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    gap: var(--space);
}

.error-page {
    padding: 1rem 0;
    text-align: center;
}

.error-content {
    border-radius: var(--radius-lg);
    padding: 2.5rem 1.5rem;
}

.error-code {
    font-size: clamp(4rem, 12vw, 6rem);
    font-weight: 700;
    color: var(--accent);
    line-height: 1;
    margin-bottom: 0.75rem;
}

.error-content h3 {
    font-size: 1.35rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.error-content p {
    color: var(--text-secondary);
    max-width: 32rem;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 1rem;
}

.error-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 1.25rem;
}

.home-button,
.contact-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0.55rem 1.25rem;
    border-radius: var(--radius-pill);
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    transition: background-color 0.15s ease, transform 0.15s ease;
}

.home-button {
    background: var(--accent);
    color: #fff;
}

.home-button:hover {
    background: var(--accent-hover);
}

.contact-button {
    background: rgba(255, 255, 255, 0.55);
    color: var(--accent);
    border: 1px solid rgba(255, 255, 255, 0.8);
}

.contact-button:hover {
    background: rgba(255, 255, 255, 0.75);
}

.helpful-links {
    border-radius: var(--radius-md);
    padding: 1.25rem;
}

.helpful-links h2 {
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 0.75rem;
}

.helpful-links ul {
    list-style: none;
    max-width: 22rem;
    margin: 0 auto;
}

.helpful-links li {
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.helpful-links a {
    display: block;
    padding: 0.65rem 0;
    font-weight: 500;
    color: var(--accent);
}

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

@media (max-width: 640px) {
    .glass-nav {
        flex-wrap: wrap;
        justify-content: center;
        border-radius: var(--radius-md);
    }

    .nav-links {
        order: 3;
        width: 100%;
        justify-content: center;
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }

    .skills-grid {
        grid-template-columns: 1fr;
    }
}
