/* ——— Design tokens ——— */
:root {
    --color-bg: #faf8f5;
    --color-bg-alt: #f0ebe4;
    --color-surface: #ffffff;
    --color-text: #2c2a28;
    --color-text-muted: #5c5854;
    --color-text-light: #8a8580;
    --color-accent: #a67c52;
    --color-accent-hover: #8f6842;
    --color-border: #e5dfd6;
    --color-header-bg: rgba(250, 248, 245, 0.92);
    --shadow-sm: 0 2px 12px rgba(44, 42, 40, 0.06);
    --shadow-md: 0 8px 30px rgba(44, 42, 40, 0.1);
    --radius: 10px;
    --radius-lg: 14px;
    --header-h: 72px;
    --font: 'LuxB', Georgia, 'Times New Roman', serif;
    --transition: 0.3s ease;
}

@font-face {
    font-family: 'LuxB';
    src: url('fonts/Luxia-Semi-Bold.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    line-height: 1.65;
    color: var(--color-text);
    background: var(--color-bg);
    overflow-x: hidden;
    padding-top: var(--header-h);
}

.container {
    width: 90%;
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 20px;
}

.section-title {
    text-align: center;
    font-size: clamp(1.75rem, 4vw, 2.25rem);
    font-weight: normal;
    color: var(--color-text);
    margin-bottom: 0.5rem;
}

.section-subtitle {
    text-align: center;
    color: var(--color-text-muted);
    margin-bottom: 2.5rem;
    font-size: 1.05rem;
}

/* ——— Loader ——— */
.loader {
    position: fixed;
    inset: 0;
    background: var(--color-bg);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.4s;
    pointer-events: all;
}

.loader.hidden {
    opacity: 0;
    pointer-events: none;
}

.spinner {
    border: 3px solid var(--color-border);
    border-top-color: var(--color-accent);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ——— Header ——— */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-h);
    z-index: 1000;
    background: var(--color-header-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid transparent;
    transition: border-color var(--transition), box-shadow var(--transition);
}

header.scrolled {
    border-bottom-color: var(--color-border);
    box-shadow: var(--shadow-sm);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-h);
    width: 100%;
    max-width: 1140px;
}

.logo {
    font-size: 1.15rem;
    color: var(--color-text);
    text-decoration: none;
    letter-spacing: 0.02em;
    z-index: 1002;
    white-space: nowrap;
}

.logo:hover {
    color: var(--color-accent);
}

nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
}

nav a {
    text-decoration: none;
    color: var(--color-text-muted);
    font-size: 1rem;
    padding: 0.35rem 0;
    border-bottom: 2px solid transparent;
    transition: color var(--transition), border-color var(--transition);
}

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

.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 28px;
    height: 20px;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 1002;
    padding: 0;
}

.menu-toggle span {
    height: 2px;
    width: 100%;
    background: var(--color-text);
    border-radius: 2px;
    transition: all 0.3s ease;
    transform-origin: center;
}

.overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(44, 42, 40, 0.45);
    z-index: 998;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.overlay.active {
    display: block;
    opacity: 1;
}

/* ——— Buttons ——— */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.85rem 1.75rem;
    border-radius: var(--radius);
    text-decoration: none;
    font-size: 0.95rem;
    border: 2px solid transparent;
    cursor: pointer;
    transition: background var(--transition), color var(--transition), border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}

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

.btn-primary:hover {
    background: var(--color-accent-hover);
    border-color: var(--color-accent-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    color: #fff;
}

.btn-outline {
    background: transparent;
    color: #fff;
    border-color: rgba(255, 255, 255, 0.65);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: #fff;
    color: #fff;
}

.contact .btn-outline {
    color: var(--color-text);
    border-color: var(--color-accent);
}

.contact .btn-outline:hover {
    background: var(--color-accent);
    color: #fff;
}

/* ——— Hero ——— */
.hero {
    min-height: calc(100vh - var(--header-h));
    background:
        linear-gradient(105deg, rgba(44, 42, 40, 0.72) 0%, rgba(44, 42, 40, 0.45) 55%, rgba(44, 42, 40, 0.25) 100%),
        url('./images/3.jpg') center / cover no-repeat;
    display: flex;
    align-items: center;
    color: #fff;
    padding: 3rem 0 4rem;
}

.hero-content {
    display: flex;
    align-items: center;
    gap: clamp(2rem, 5vw, 4rem);
}

.hero-image {
    flex: 0 0 auto;
}

.hero-image img {
    width: clamp(220px, 28vw, 320px);
    height: clamp(220px, 28vw, 320px);
    object-fit: cover;
    border-radius: 50%;
    border: 4px solid rgba(255, 255, 255, 0.35);
    box-shadow: var(--shadow-md);
}

.hero-text {
    flex: 1;
    max-width: 560px;
}

.hero-label {
    font-size: 0.9rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.75);
    margin-bottom: 0.75rem;
}

.hero-text h1 {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: normal;
    line-height: 1.15;
    margin-bottom: 1rem;
}

.hero-text > p {
    color: rgba(255, 255, 255, 0.88);
    font-size: 1.05rem;
    margin-bottom: 1.75rem;
    line-height: 1.75;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

/* ——— Portfolio ——— */
.portfolio {
    padding: 5rem 0;
    background: var(--color-bg-alt);
}

.portfolio-filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.6rem;
    margin-bottom: 2.5rem;
}

.filter-btn {
    padding: 0.5rem 1.1rem;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    background: var(--color-surface);
    color: var(--color-text-muted);
    font-family: var(--font);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all var(--transition);
}

.filter-btn:hover {
    border-color: var(--color-accent);
    color: var(--color-accent);
}

.filter-btn.active {
    background: var(--color-accent);
    border-color: var(--color-accent);
    color: #fff;
}

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.gallery-error,
.gallery-empty {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--color-text-muted);
    padding: 2rem;
}

.portfolio-item {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.5s ease, transform 0.5s ease, box-shadow var(--transition);
}

.portfolio-item.animate {
    opacity: 1;
    transform: translateY(0);
}

.portfolio-item:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-4px);
}

.portfolio-item.animate:hover {
    transform: translateY(-4px);
}

.portfolio-thumb {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
}

.portfolio-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.45s ease;
    background: var(--color-border);
}

.portfolio-item:hover .portfolio-thumb img {
    transform: scale(1.06);
}

.portfolio-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 1.25rem;
    background: linear-gradient(to top, rgba(44, 42, 40, 0.82) 0%, transparent 55%);
    color: #fff;
    opacity: 0;
    transition: opacity var(--transition);
}

.portfolio-item:hover .portfolio-overlay,
.portfolio-item:focus-visible .portfolio-overlay {
    opacity: 1;
}

.portfolio-overlay h3 {
    font-size: 1.2rem;
    font-weight: normal;
    margin-bottom: 0.25rem;
}

.photo-count {
    font-size: 0.85rem;
    opacity: 0.85;
}

/* ——— Lightbox ——— */
.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(20, 18, 16, 0.94);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 1rem 1.5rem;
    gap: 0.75rem;
}

.lightbox[hidden] {
    display: none !important;
}

.lightbox.is-open {
    display: flex;
}

.lightbox-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(0.5rem, 2vw, 1.5rem);
    width: 100%;
    max-width: 1200px;
    flex: 1 1 auto;
    min-height: 0;
}

.lightbox-content {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 100%;
    max-height: calc(100vh - 10rem);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.lightbox-image {
    max-width: 100%;
    max-height: calc(100vh - 12rem);
    width: auto;
    height: auto;
    display: block;
    border-radius: 4px;
    transition: opacity 0.2s;
    pointer-events: auto;
}

.close-btn {
    position: absolute;
    top: 1rem;
    right: 1.25rem;
    background: none;
    border: none;
    color: #fff;
    font-size: 2.5rem;
    line-height: 1;
    cursor: pointer;
    z-index: 2010;
    opacity: 0.8;
    transition: opacity var(--transition);
}

.close-btn:hover {
    opacity: 1;
}

#caption {
    color: rgba(255, 255, 255, 0.9);
    padding: 0.75rem 0.5rem 0;
    font-size: 1.05rem;
    pointer-events: auto;
}

.lightbox-footer {
    flex-shrink: 0;
    position: relative;
    z-index: 2010;
    padding-bottom: 0.5rem;
}

.lightbox-nav {
    flex-shrink: 0;
    position: relative;
    z-index: 2010;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #fff;
    font-size: 1.35rem;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    cursor: pointer;
    transition: background var(--transition), opacity var(--transition), transform var(--transition);
}

.lightbox-nav:hover:not(:disabled) {
    background: var(--color-accent);
    border-color: var(--color-accent);
    transform: scale(1.05);
}

.lightbox-nav:disabled {
    opacity: 0.25;
    cursor: not-allowed;
}

.pagination {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.95rem;
    text-align: center;
}

/* ——— About ——— */
.about {
    padding: 5rem 0;
    background: var(--color-bg);
}

.about-content {
    max-width: 880px;
    margin: 0 auto;
}

.about-intro {
    text-align: center;
    margin-bottom: 3rem;
}

.about-intro h3 {
    font-size: 1.5rem;
    font-weight: normal;
    margin-bottom: 1rem;
    color: var(--color-text);
}

.lead {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--color-text-muted);
    text-align: center;
}

.approach-section {
    margin: 3rem 0;
}

.approach-section h4 {
    font-size: 1.15rem;
    font-weight: normal;
    text-align: center;
    margin-bottom: 1.75rem;
    color: var(--color-text);
}

.approach-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.25rem;
}

.approach-item {
    display: flex;
    gap: 1rem;
    padding: 1.25rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease, box-shadow var(--transition);
}

.approach-item.animate {
    opacity: 1;
    transform: translateY(0);
}

.approach-item:hover {
    box-shadow: var(--shadow-sm);
}

.approach-icon {
    flex-shrink: 0;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-bg-alt);
    border-radius: 50%;
    color: var(--color-accent);
    font-size: 1rem;
}

.approach-content h5 {
    font-size: 1rem;
    font-weight: normal;
    margin-bottom: 0.35rem;
    color: var(--color-text);
}

.approach-content p {
    font-size: 0.92rem;
    color: var(--color-text-muted);
    line-height: 1.6;
    margin: 0;
    text-align: left;
}

.tools-section {
    margin: 3rem 0;
    padding: 2rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
}

.tools-section h4 {
    text-align: center;
    font-weight: normal;
    margin-bottom: 1.5rem;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.tool-category {
    text-align: center;
}

.tool-category h5 {
    font-size: 0.9rem;
    color: var(--color-text-light);
    margin-bottom: 0.75rem;
    font-weight: normal;
}

.tool-items {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
}

.tool-item {
    background: var(--color-bg-alt);
    color: var(--color-text);
    padding: 0.4rem 0.9rem;
    border-radius: 999px;
    font-size: 0.88rem;
    border: 1px solid var(--color-border);
}

.tool-level {
    display: block;
    width: 100%;
    color: var(--color-text-light);
    font-size: 0.8rem;
    font-style: italic;
    margin-top: 0.35rem;
}

.passion-section {
    margin: 3rem 0;
    text-align: center;
}

.passion-section h4 {
    font-weight: normal;
    margin-bottom: 1rem;
}

.passion-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.6rem;
    margin: 1.25rem 0;
    padding: 0;
}

.passion-list li {
    padding: 0.45rem 1rem;
    background: var(--color-surface);
    border: 1px solid var(--color-accent);
    border-radius: 999px;
    color: var(--color-text);
    font-size: 0.9rem;
}

.passion-section p {
    color: var(--color-text-muted);
    max-width: 640px;
    margin: 0 auto;
    line-height: 1.75;
}

.education-note {
    padding: 1.75rem;
    background: var(--color-bg-alt);
    border-radius: var(--radius-lg);
    border-left: 4px solid var(--color-accent);
    margin-top: 2rem;
}

.education-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.education-header i {
    color: var(--color-accent);
    font-size: 1.25rem;
}

.education-header h4 {
    font-weight: normal;
    font-size: 1.05rem;
    margin: 0;
}

.education-note p {
    color: var(--color-text-muted);
    line-height: 1.75;
    text-align: left;
    margin: 0;
}

/* ——— Contact ——— */
.contact {
    padding: 5rem 0;
    background: var(--color-bg-alt);
    text-align: center;
}

.contact-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.contact-btn {
    min-width: 180px;
}

/* ——— Footer ——— */
footer {
    background: var(--color-text);
    color: rgba(255, 255, 255, 0.75);
    padding: 2rem 0;
    text-align: center;
}

.footer-name {
    color: #fff;
    margin-bottom: 0.35rem;
    font-size: 1rem;
}

.footer-copy {
    font-size: 0.85rem;
}

/* ——— Back to top ——— */
.back-to-top {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: var(--color-accent);
    color: #fff;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition), transform var(--transition);
    z-index: 999;
    box-shadow: var(--shadow-md);
}

.back-to-top.visible {
    opacity: 1;
    pointer-events: auto;
}

.back-to-top:hover {
    transform: translateY(-3px);
    background: var(--color-accent-hover);
}

/* ——— Mobile ——— */
@media (max-width: 968px) {
    :root {
        --header-h: 64px;
    }

    .menu-toggle {
        display: flex;
    }

    nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: min(300px, 85vw);
        height: 100vh;
        background: var(--color-surface);
        box-shadow: -8px 0 24px rgba(0, 0, 0, 0.08);
        transition: right 0.3s ease;
        z-index: 1001;
        padding-top: calc(var(--header-h) + 1rem);
    }

    nav.active {
        right: 0;
    }

    nav ul {
        flex-direction: column;
        gap: 0;
        padding: 0 1.5rem;
    }

    nav li {
        border-bottom: 1px solid var(--color-border);
    }

    nav a {
        display: block;
        padding: 1rem 0;
        border-bottom: none;
    }

    .menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px);
    }

    .hero-content {
        flex-direction: column;
        text-align: center;
    }

    .hero-text {
        max-width: none;
    }

    .hero-actions {
        justify-content: center;
    }

    .portfolio-overlay {
        opacity: 1;
        background: linear-gradient(to top, rgba(44, 42, 40, 0.7) 0%, transparent 40%);
    }
}

@media (max-width: 600px) {
    .gallery {
        grid-template-columns: 1fr;
    }

    .approach-item {
        flex-direction: column;
        text-align: center;
    }

    .approach-content p {
        text-align: center;
    }

    .passion-list li {
        width: 100%;
    }

    .lightbox {
        padding: 3.5rem 0.5rem 1rem;
    }

    .lightbox-inner {
        gap: 0.35rem;
    }

    .lightbox-nav {
        width: 44px;
        height: 44px;
        font-size: 1.1rem;
    }

    .lightbox-image {
        max-height: calc(100vh - 11rem);
    }
}

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

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