/* CSS Variables and Root */
:root {
    --primary-navy: #0f172a;
    --secondary-navy: #1e293b;
    --steel-blue: #475569;
    --metallic-silver: #94a3b8;
    --burnished-gold: #b8860b;
    --watercolor-teal: #5f9ea0;
    --watercolor-sage: #8fbc8f;
    --parchment-white: #faf8f5;
    --blush-pink: #e8c4b8;
    
    --wght: 200;
}

/* Typography Fundamentals */
html {
    font-size: 16px;
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--parchment-white);
    font-family: 'Inter', sans-serif;
    font-size: clamp(0.875rem, 1.1vw, 1.05rem);
    line-height: 1.65;
    letter-spacing: 0.01em;
    color: #64748b;
}

/* Headings and Display */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Epilogue', sans-serif;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 0.92;
    color: var(--primary-navy);
    margin: 0;
}

/* Header Styling */
.header {
    position: sticky;
    top: 0;
    height: 80px;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    padding: 0 clamp(2rem, 5vw, 6rem);
    z-index: 1000;
    border-bottom: 1px solid rgba(71, 85, 105, 0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
}

.domain {
    font-family: 'Epilogue', sans-serif;
    font-size: clamp(0.9rem, 2vw, 1.1rem);
    font-weight: 600;
    color: var(--parchment-white);
    letter-spacing: 0.05em;
    text-transform: lowercase;
}

.nav-primary {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--parchment-white);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    position: relative;
    transition: color 0.3s ease;
}

.nav-link.active {
    color: var(--parchment-white);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(135deg, #b8860b 0%, #d4a853 40%, #b8860b 60%, #8b6914 100%);
    -webkit-background-clip: text;
}

/* Hero Section */
.hero {
    position: relative;
    width: 100%;
    height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: var(--parchment-white);
}

.watercolor-hero {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.particle-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
}

.hero-content {
    position: relative;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    pointer-events: none;
}

.hero-title {
    font-family: 'Epilogue', sans-serif;
    font-size: clamp(3rem, 8vw, 7rem);
    font-weight: 200;
    font-variation-settings: 'wght' var(--wght);
    line-height: 0.92;
    letter-spacing: -0.03em;
    color: var(--primary-navy);
    margin: 0;
    white-space: nowrap;
    text-transform: lowercase;
    animation: bounceIn 1.2s cubic-bezier(0.36, 0.07, 0.19, 0.97) forwards 0.4s;
    opacity: 0;
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.fern-drawing {
    margin-top: 3rem;
    animation: fernDraw 3s ease-out forwards 2s;
    opacity: 0;
}

@keyframes fernDraw {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Portfolio Section */
.portfolio-section {
    padding: clamp(4rem, 8vw, 8rem) clamp(2rem, 5vw, 6rem);
    max-width: 1400px;
    margin: 0 auto;
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: clamp(2.5rem, 5vw, 3.5rem) clamp(1.5rem, 3vw, 2.5rem);
}

.rhythm-break {
    grid-column: 1 / -1;
    width: 100%;
    height: 40px;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.brushstroke {
    width: 100%;
    height: 40px;
    opacity: 0;
    animation: strokeDraw 1.5s ease-out forwards;
}

@keyframes strokeDraw {
    from {
        stroke-dashoffset: 1000;
        opacity: 0;
    }
    to {
        stroke-dashoffset: 0;
        opacity: 0.3;
    }
}

/* Portfolio Cell */
.portfolio-cell {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    opacity: 0;
    transform: translateY(40px) scale(0.85);
    animation: cellBounceIn 0.8s cubic-bezier(0.36, 0.07, 0.19, 0.97) forwards;
}

@keyframes cellBounceIn {
    0% {
        opacity: 0;
        transform: translateY(40px) scale(0.85);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: translateY(0) scale(0.9);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.portfolio-cell:nth-child(1) {
    animation-delay: 0s;
}

.portfolio-cell:nth-child(2) {
    animation-delay: 0.12s;
}

.portfolio-cell:nth-child(3) {
    animation-delay: 0.24s;
}

.portfolio-cell:nth-child(5) {
    animation-delay: 0s;
}

.portfolio-cell:nth-child(6) {
    animation-delay: 0.12s;
}

.portfolio-cell:nth-child(7) {
    animation-delay: 0.24s;
}

.portfolio-cell:nth-child(8) {
    animation-delay: 0s;
}

.portfolio-cell:nth-child(9) {
    animation-delay: 0.12s;
}

.portfolio-cell:nth-child(10) {
    animation-delay: 0.24s;
}

.cell-image {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: var(--parchment-white);
}

.cell-image svg {
    width: 100%;
    height: 100%;
}

.portfolio-cell:hover .cell-image {
    filter: hue-rotate(15deg);
    transition: filter 0.5s ease;
}

.portfolio-cell:hover .cell-image g[opacity="0.2"],
.portfolio-cell:hover .cell-image g[opacity="0.15"],
.portfolio-cell:hover .cell-image g[opacity="0.18"],
.portfolio-cell:hover .cell-image g[opacity="0.17"] {
    opacity: 0.5 !important;
    transition: opacity 0.5s ease;
}

.cell-caption {
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(71, 85, 105, 0.15);
}

.caption-text {
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #334155;
    margin: 0;
    font-feature-settings: 'ss01', 'cv05';
}

/* Footer */
.footer {
    background: var(--primary-navy);
    color: var(--parchment-white);
    padding: 3rem clamp(2rem, 5vw, 6rem);
    text-align: center;
    margin-top: clamp(4rem, 8vw, 8rem);
}

.footer p {
    font-family: 'DM Mono', monospace;
    font-size: 0.6875rem;
    font-weight: 400;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin: 0;
    color: var(--metallic-silver);
}

.footer p::before {
    content: '\00a9';
    margin-right: 0.5em;
    background: linear-gradient(135deg, #b8860b 0%, #d4a853 40%, #b8860b 60%, #8b6914 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .portfolio-grid {
        grid-template-columns: 1fr;
    }
    
    .hero-title {
        font-size: clamp(2rem, 6vw, 4rem);
    }
    
    .header {
        padding: 0 1.5rem;
    }
    
    .nav-primary {
        gap: 1rem;
    }
}

/* Scroll-driven animations for section headings */
@supports (animation-timeline: view()) {
    .section-heading {
        animation: headingCondense linear;
        animation-timeline: view();
        animation-range: entry 0% cover 50%;
    }
}

@keyframes headingCondense {
    from {
        font-variation-settings: 'wght' 300;
        letter-spacing: 0.05em;
    }
    to {
        font-variation-settings: 'wght' 700;
        letter-spacing: -0.02em;
    }
}

/* Metallic text effects */
.metallic-text {
    background: linear-gradient(135deg, #b8860b 0%, #d4a853 40%, #b8860b 60%, #8b6914 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.text-uppercase {
    text-transform: uppercase;
}

.text-small-caps {
    font-feature-settings: 'c2sc', 'smcp';
}

.opacity-low {
    opacity: 0.3;
}

.opacity-medium {
    opacity: 0.6;
}

/* Print Styles */
@media print {
    .header {
        position: static;
    }
    
    .portfolio-cell {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
}
