/* Layout — Apple-esque containers and sections */

/* ——— Fixed 3D Tile Mosaic Background (generated by JS) ——— */
.tile-bg {
    position: fixed;
    inset: -20px;
    z-index: 0;
    pointer-events: none;
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    grid-template-rows: repeat(6, 1fr);
    gap: 10px;
    padding: 20px;
    transform: perspective(1000px) rotateX(2deg);
    transform-origin: 50% 100%;
}

/* Individual tiles — raised ceramic look */
.tile-bg__tile {
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--tile-color, var(--sage-light));
    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.06),
        0 3px 8px rgba(0, 0, 0, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.35),
        inset 0 -1px 0 rgba(0, 0, 0, 0.04);
    transition:
        transform 0.6s var(--ease-expo),
        box-shadow 0.6s var(--ease-expo);
}

.tile-bg__tile i {
    font-size: var(--tile-icon, 1.8rem);
    color: rgba(0, 0, 0, 0.09);
    transition: color 0.6s var(--ease-expo);
    transition-delay: inherit;
}

/* Active — tile pops forward out of the surface */
.tile-bg__tile--active {
    transform: translateZ(6px) scale(1.03);
    box-shadow:
        0 2px 4px rgba(0, 0, 0, 0.08),
        0 6px 20px rgba(122, 155, 109, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.5),
        inset 0 -1px 0 rgba(0, 0, 0, 0.03);
}

.tile-bg__tile--active i {
    color: rgba(0, 0, 0, 0.18);
}

/* Dark mode — deeper shadows, lighter icon imprints */
[data-theme="dark"] .tile-bg__tile {
    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.2),
        0 3px 8px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.06),
        inset 0 -1px 0 rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .tile-bg__tile i {
    color: rgba(255, 255, 255, 0.07);
}

[data-theme="dark"] .tile-bg__tile--active {
    box-shadow:
        0 2px 4px rgba(0, 0, 0, 0.25),
        0 6px 20px rgba(143, 181, 131, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        inset 0 -1px 0 rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .tile-bg__tile--active i {
    color: rgba(255, 255, 255, 0.15);
}

/* ——— Page content sits above the fixed mosaic ——— */
main {
    position: relative;
    z-index: 1;
}

.container {
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 24px;
}

.container--tight {
    max-width: 680px;
}

.container--wide {
    max-width: 1280px;
}

.text-center {
    text-align: center;
}

/* Sections — float above the tile mosaic */
section {
    position: relative;
    padding: var(--section-gap) 0;
}

.section--light {
    background: var(--surface-1-bg);
    box-shadow: 0 -1px 0 rgba(0, 0, 0, 0.04), 0 20px 60px -20px rgba(0, 0, 0, 0.06);
}

.section--alt {
    background: var(--surface-2-bg);
    box-shadow: 0 -1px 0 rgba(0, 0, 0, 0.04), 0 20px 60px -20px rgba(0, 0, 0, 0.06);
}

.section--dark {
    background: var(--surface-dark-bg);
    color: #F5F0E8;
    box-shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.15);
}

.section--dark h2,
.section--dark h3 {
    color: #F5F0E8;
}

.section--dark p,
.section--dark .subhead {
    color: #A09890;
}

.section--dark .section-label {
    color: var(--sage);
}

/* ——— Glassmorphism Header ——— */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 16px 24px;
    transition: all 0.4s var(--ease-apple);
}

.site-header--scrolled {
    background: rgba(251, 250, 248, 0.8);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 0.5px solid rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .site-header--scrolled {
    background: rgba(17, 17, 16, 0.8);
    border-bottom-color: rgba(255, 255, 255, 0.06);
}

.site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1120px;
    margin: 0 auto;
}

.site-header__brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
    text-decoration: none;
}

.site-header__brand:hover {
    opacity: 0.7;
}

.site-header__logo {
    color: var(--terracotta);
}

.site-header__wordmark {
    font-family: 'Fraunces', serif;
    font-size: 1.3rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.site-header__nav {
    display: flex;
    align-items: center;
    gap: 20px;
}

.theme-toggle {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--text-secondary);
    font-size: 1.15rem;
    transition: all 0.2s var(--ease-apple);
}

.theme-toggle:hover {
    color: var(--text-primary);
    background: var(--surface-3);
}

/* ——— Footer ——— */
.site-footer {
    position: relative;
    z-index: 1;
    background: var(--surface-2);
    border-top: 0.5px solid rgba(0, 0, 0, 0.06);
    padding: 48px 0;
}

[data-theme="dark"] .site-footer {
    border-top-color: rgba(255, 255, 255, 0.04);
}

.site-footer__inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
}

.site-footer__brand {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
    font-family: 'Fraunces', serif;
    font-weight: 600;
    font-size: 1.1rem;
}

.site-footer__brand svg {
    color: var(--terracotta);
}

.site-footer__tagline {
    color: var(--text-tertiary);
    font-size: 0.85rem;
}

.site-footer__copyright {
    color: var(--text-tertiary);
    font-size: 0.78rem;
    margin-top: 8px;
}
