/* CSS Variables */
:root {
    --color-bg: #ffffff;
    --color-text: #1a1a1a;
    --color-border: #e0e0e0;
    --color-gallery-border: #ffffff;
    --color-primary: #000;
    --color-subtitle: #666;
    --color-body-text: #333;
    --color-hover-bg: #f5f5f5;
    --shadow-color: rgba(0, 0, 0, 0.2);
    --shadow-color-light: rgba(0, 0, 0, 0.15);
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    --radius: 8px;
}

/* Dark theme */
@media (prefers-color-scheme: dark) {
    :root {
        --color-bg: #121212;
        --color-text: #e0e0e0;
        --color-border: #333333;
        --color-gallery-border: #444444;
        --color-primary: #ffffff;
        --color-subtitle: #a0a0a0;
        --color-body-text: #b0b0b0;
        --color-hover-bg: #2a2a2a;
        --shadow-color: rgba(0, 0, 0, 0.5);
        --shadow-color-light: rgba(0, 0, 0, 0.3);
    }
}

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

html {
    scroll-behavior: smooth;
}

[id] {
    scroll-margin-top: 70px;
}

#top, #photos {
    scroll-margin-top: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--color-text);
    background-color: var(--color-bg);
    line-height: 1.6;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

/* Menu toggle (hidden) */
.menu-toggle {
    display: none;
}

/* Header - compact by default */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    z-index: 100;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 50px;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.35rem var(--spacing-sm);
    padding-left: max(var(--spacing-sm), env(safe-area-inset-left));
    padding-right: max(var(--spacing-sm), env(safe-area-inset-right));
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    height: 100%;
}

.header-title {
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: -0.5px;
    text-decoration: none;
    color: var(--color-text);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    opacity: 1;
}

.header-title:link,
.header-title:visited,
.header-title:active,
.header-title:focus,
.header-title:focus-visible {
    color: var(--color-text);
    text-decoration: none;
    outline: none;
    opacity: 1;
}

@media (hover: hover) {
    .header-title:hover {
        opacity: 0.7;
        transition: opacity 0.2s ease;
    }
}

/* Hamburger menu - visible by default */
.hamburger {
    display: flex;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0.5rem;
    margin-right: -0.5rem;
}

.hamburger__line {
    width: 24px;
    height: 2px;
    background-color: var(--color-text);
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* Desktop navigation - hidden by default */
.nav--desktop {
    display: none;
    gap: var(--spacing-md);
}

.nav__link {
    text-decoration: none;
    color: var(--color-text);
    font-size: 1rem;
    transition: opacity 0.2s ease;
}

.nav__link:hover {
    opacity: 0.7;
}

/* Mobile navigation - hidden by default */
.nav--mobile {
    display: none;
    position: fixed;
    top: 50px;
    left: 0;
    right: 0;
    background-color: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    flex-direction: column;
    z-index: 99;
    max-height: calc(100vh - 50px);
    overflow-y: auto;
}

.nav--mobile .nav__link {
    display: block;
    padding: var(--spacing-sm);
    border-bottom: 1px solid var(--color-border);
    color: var(--color-text);
    text-decoration: none;
}

/* Menu toggle animation */
.menu-toggle:checked ~ .header .nav--mobile {
    display: flex;
}

.menu-toggle:checked ~ .header .hamburger__line:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.menu-toggle:checked ~ .header .hamburger__line:nth-child(2) {
    transform: scaleX(0);
    opacity: 0;
}

.menu-toggle:checked ~ .header .hamburger__line:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Tablet and wider: show desktop menu, hide hamburger */
@media (min-width: 768px) {
    .nav--desktop {
        display: flex;
    }

    .hamburger {
        display: none;
    }

    .nav--mobile {
        display: none !important;
    }
}

/* Tablet+ with sufficient height: expand header */
@media (min-width: 768px) and (min-height: 700px) {
    .header {
        height: 60px;
    }

    .header-content {
        padding: var(--spacing-xs) var(--spacing-sm);
    }

    .header-title {
        font-size: 1.5rem;
    }

    .nav--desktop {
        gap: var(--spacing-lg);
    }

    [id] {
        scroll-margin-top: 80px;
    }
}

/* Main content */
.main {
    padding-top: 50px;
    padding-left: max(var(--spacing-sm), env(safe-area-inset-left));
    padding-right: max(var(--spacing-sm), env(safe-area-inset-right));
    padding-bottom: calc(90px + env(safe-area-inset-bottom));
    max-width: 1200px;
    margin: 0 auto;
}

@media (min-width: 768px) and (min-height: 700px) {
    .main {
        padding-top: 60px;
    }
}

/* Sections */
.section {
    padding: 0;
    scroll-margin-top: 50px;
}

.section__title {
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
    letter-spacing: -0.5px;
    padding: var(--spacing-lg) 0 0;
    color: var(--color-text);
}

.section__subtitle {
    font-size: 1rem;
    color: var(--color-subtitle);
    margin-bottom: var(--spacing-lg);
    padding: 0;
}

.section__text {
    font-size: 1rem;
    line-height: 1.8;
    color: var(--color-body-text);
    padding: 0;
    margin-bottom: var(--spacing-sm);
}

.section__text:last-child {
    margin-bottom: 0;
}

/* Gallery */
.gallery {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
    min-height: 200px;
    padding: 0;
    margin-left: calc(-1 * max(var(--spacing-sm), env(safe-area-inset-left)));
    margin-right: calc(-1 * max(var(--spacing-sm), env(safe-area-inset-right)));
}

/* Contact button - floating */
.contact-button-container {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 150;
    pointer-events: none;
}

.contact-button-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--spacing-sm);
    padding-left: max(var(--spacing-sm), env(safe-area-inset-left));
    padding-right: max(var(--spacing-sm), env(safe-area-inset-right));
    padding-bottom: calc(var(--spacing-sm) + env(safe-area-inset-bottom));
    display: flex;
    justify-content: flex-end;
}

.contact-button {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background-color: var(--color-primary);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px var(--shadow-color);
    transition: all 0.3s ease;
    color: var(--color-bg);
    pointer-events: auto;
    position: relative;
}

.contact-button:active {
    transform: scale(0.95);
}

.contact-button__icon {
    width: 28px;
    height: 28px;
}

/* Contact menu */
.contact-menu {
    position: absolute;
    bottom: 70px;
    right: 0;
    background-color: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: 0 4px 12px var(--shadow-color-light);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.2s ease;
    min-width: 140px;
    overflow: hidden;
    pointer-events: auto;
}

.contact-menu--active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.contact-menu__item {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-xs) var(--spacing-md);
    border-bottom: 1px solid var(--color-border);
    text-decoration: none;
    color: var(--color-text);
    font-size: 0.95rem;
    transition: background-color 0.2s ease;
}

.contact-menu__item:last-child {
    border-bottom: none;
}

.contact-menu__item:hover {
    background-color: var(--color-hover-bg);
}

/* Section info block */
.section__info {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    margin: var(--spacing-sm) 0;
}

.section__stat {
    font-size: 1rem;
    font-weight: 500;
    color: var(--color-text);
    line-height: 1.6;
}

.section__features {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    font-size: 0.85rem;
    color: var(--color-body-text);
}

.section__features li {
    padding: 0.1rem 0;
}

.section__features li:not(:last-child)::after {
    content: "•";
    margin: 0 0.5rem;
    color: var(--color-border);
}

/* About photo circle */
.about__photo-circle {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: var(--spacing-lg) 0;
}

.about__photo {
    width: clamp(160px, 50vw, 320px);
    height: clamp(160px, 50vw, 320px);
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 4px 16px var(--shadow-color);
}

/* Tablet & Desktop */
@media (min-width: 768px) {
    .section__stat {
        font-size: 1.1rem;
        line-height: 1.7;
    }

    .section__features {
        font-size: 0.9rem;
    }

    .gallery {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-lg);
    }
}

@media (min-width: 1024px) {
    .gallery {
        grid-template-columns: repeat(3, 1fr);
    }
}