@import url('https://api.fontshare.com/v2/css?f[]=gambetta@400,500,600,700&f[]=satoshi@400,500,700&display=swap');

:root {
    --paper: #F5F1E8;
    --ink: #2C2C2C;
    --accent: #8B4513;
    --soft-accent: rgba(139, 69, 19, 0.16);
    --marquee-speed: 20s;
    --grain-opacity: 0.04;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--paper);
    color: var(--ink);
    font-family: 'Satoshi', sans-serif;
    overflow-x: clip;
}

.serif {
    font-family: 'Gambetta', serif;
}

/* Paper Grain Texture */
.grain {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 50;
    opacity: var(--grain-opacity);
    transition: opacity 0.45s cubic-bezier(0.4, 0, 0.2, 1);
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    will-change: transform, opacity;
}

.hero-parallax-bg {
    position: absolute;
    inset: -8% -6% auto auto;
    width: 34rem;
    height: 34rem;
    border: 1px solid rgba(44, 44, 44, 0.08);
    border-radius: 9999px;
    background: radial-gradient(circle, rgba(139, 69, 19, 0.10), rgba(245, 241, 232, 0) 64%);
    transform: translate3d(0, var(--hero-y, 0px), 0);
    will-change: transform;
    pointer-events: none;
    z-index: -1;
}

/* Editorial Lines */
.border-ink {
    border-color: var(--ink);
}

.double-border {
    border-top: 4px double var(--ink);
    border-bottom: 4px double var(--ink);
}

.animated-rule {
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 1s cubic-bezier(0.2, 1, 0.3, 1);
}

.animated-rule.active {
    transform: scaleX(1);
}

/* Page Load Animation Sequence */
.load-sequence {
    opacity: 0;
    transform: translateY(18px);
    animation: editorialLoad 0.85s cubic-bezier(0.2, 1, 0.3, 1) forwards;
}

.load-delay-1 {
    animation-delay: 0.1s;
}

.load-delay-2 {
    animation-delay: 0.32s;
}

.load-delay-3 {
    animation-delay: 0.56s;
}

@keyframes editorialLoad {
    from {
        opacity: 0;
        transform: translateY(18px);
        filter: blur(3px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0);
    }
}

.headline-word {
    display: inline-block;
    overflow: hidden;
    vertical-align: bottom;
}

.headline-word span {
    display: inline-block;
    transform: translateY(105%) rotate(2deg);
    opacity: 0;
    animation: wordRise 0.9s cubic-bezier(0.2, 1, 0.3, 1) forwards;
}

.headline-word:nth-child(1) span {
    animation-delay: 0.72s;
}

.headline-word:nth-child(2) span {
    animation-delay: 0.80s;
}

.headline-word:nth-child(3) span {
    animation-delay: 0.88s;
}

.headline-word:nth-child(4) span {
    animation-delay: 0.96s;
}

.headline-word:nth-child(5) span {
    animation-delay: 1.04s;
}

.headline-word:nth-child(6) span {
    animation-delay: 1.12s;
}

@keyframes wordRise {
    from {
        transform: translateY(105%) rotate(2deg);
        opacity: 0;
    }

    to {
        transform: translateY(0) rotate(0);
        opacity: 1;
    }
}

.edition-item {
    opacity: 0;
    transform: translateX(18px);
    animation: editionCascade 0.72s cubic-bezier(0.2, 1, 0.3, 1) forwards;
}

.edition-item:nth-child(1) {
    animation-delay: 1.05s;
}

.edition-item:nth-child(2) {
    animation-delay: 1.20s;
}

.edition-item:nth-child(3) {
    animation-delay: 1.35s;
}

@keyframes editionCascade {
    from {
        opacity: 0;
        transform: translateX(18px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Scroll Reveal Enhancements */
.reveal,
.reveal-up,
.reveal-left,
.reveal-right,
.reveal-scale,
.line-reveal {
    opacity: 0;
    transition-property: opacity, transform, filter;
    transition-duration: 0.9s;
    transition-timing-function: cubic-bezier(0.2, 1, 0.3, 1);
    will-change: opacity, transform;
}

.reveal,
.reveal-up {
    transform: translateY(34px);
}

.reveal-left {
    transform: translateX(-34px);
}

.reveal-right {
    transform: translateX(34px);
}

.reveal-scale {
    transform: translateY(22px) scale(0.96);
    filter: blur(2px);
}

.line-reveal {
    transform: translateY(18px);
}

.reveal.active,
.reveal-up.active,
.reveal-left.active,
.reveal-right.active,
.reveal-scale.active,
.line-reveal.active {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
    filter: blur(0);
}

.cascade-project:nth-child(1) {
    transition-delay: 0ms;
}

.cascade-project:nth-child(2) {
    transition-delay: 120ms;
}

.cascade-project:nth-child(3) {
    transition-delay: 240ms;
}

.skill-block:nth-child(1) {
    transition-delay: 80ms;
}

.skill-block:nth-child(2) {
    transition-delay: 190ms;
}

.skill-block:nth-child(3) {
    transition-delay: 300ms;
}

.column-rule {
    border-right: 1px solid rgba(44, 44, 44, 0.2);
}

@media (max-width: 768px) {
    .column-rule {
        border-right: none;
        border-bottom: 1px solid rgba(44, 44, 44, 0.2);
        padding-bottom: 2rem;
    }
}

.drop-cap::first-letter {
    float: left;
    font-size: 4.5rem;
    line-height: 1;
    font-family: 'Gambetta';
    font-weight: 700;
    margin-right: 0.5rem;
    color: var(--accent);
    animation: accentPulse 4.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.pulse-accent {
    animation: accentPulse 3.8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes accentPulse {

    0%,
    100% {
        color: var(--accent);
        text-shadow: 0 0 0 rgba(139, 69, 19, 0);
    }

    50% {
        color: #6f3510;
        text-shadow: 0 0 18px rgba(139, 69, 19, 0.18);
    }
}

.marquee-container {
    overflow: hidden;
    white-space: nowrap;
    border-top: 1px solid var(--ink);
    border-bottom: 1px solid var(--ink);
    width: 100%;
    max-width: 100vw;
}

.marquee {
    display: inline-block;
    animation: marquee var(--marquee-speed) linear infinite;
    will-change: transform;
}

@keyframes marquee {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

/* Interactive Hover States */
.nav-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    min-height: 44px;
}

.nav-link::after,
.text-highlight::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 9px;
    width: 100%;
    height: 2px;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.45s cubic-bezier(0.2, 1, 0.3, 1);
}

.nav-link:hover::after,
.text-highlight:hover::after {
    transform: scaleX(1);
}

.text-highlight {
    position: relative;
}

.text-highlight::after {
    bottom: -2px;
    height: 1px;
}

.editorial-btn {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    box-shadow: 0 0 0 rgba(139, 69, 19, 0);
    transform: translateZ(0);
}

.editorial-btn::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, transparent, rgba(245, 241, 232, 0.24), transparent);
    transform: translateX(-120%);
    transition: transform 0.7s cubic-bezier(0.2, 1, 0.3, 1);
    z-index: -1;
}

.editorial-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(44, 44, 44, 0.16), 0 0 22px rgba(139, 69, 19, 0.16);
}

.editorial-btn:hover::before {
    transform: translateX(120%);
}

.project-card {
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.55s cubic-bezier(0.2, 1, 0.3, 1), box-shadow 0.55s cubic-bezier(0.2, 1, 0.3, 1), background-color 0.55s cubic-bezier(0.2, 1, 0.3, 1);
    padding: 0.75rem;
    margin: 0;
}

@media (min-width: 768px) {
    .project-card {
        margin: -0.75rem;
    }
}

.project-card:hover {
    transform: translate3d(0, -10px, 0) rotateX(1.5deg) rotateY(-1.5deg);
    box-shadow: 14px 14px 0 rgba(44, 44, 44, 0.16);
    background-color: rgba(255, 255, 255, 0.18);
}

.project-card::before {
    content: "";
    position: absolute;
    inset: 0;
    border: 1px solid rgba(44, 44, 44, 0);
    transition: border-color 0.45s cubic-bezier(0.2, 1, 0.3, 1);
    pointer-events: none;
}

.project-card:hover::before {
    border-color: rgba(44, 44, 44, 0.22);
}

.project-image {
    --parallax-y: 0px;
    --hover-scale: 1.08;
    transform: translate3d(0, var(--parallax-y), 0) scale(var(--hover-scale));
    transition: transform 0.75s cubic-bezier(0.2, 1, 0.3, 1), filter 0.5s cubic-bezier(0.2, 1, 0.3, 1);
    will-change: transform;
}

.project-card:hover .project-image {
    --hover-scale: 1.16;
}

.link-icon iconify-icon,
.social-icon iconify-icon {
    transition: transform 0.45s cubic-bezier(0.2, 1, 0.3, 1), color 0.45s cubic-bezier(0.2, 1, 0.3, 1);
    transform-origin: center;
}

.link-icon:hover iconify-icon {
    transform: rotate(18deg) translateX(2px);
    color: var(--accent);
}

.social-icon:hover iconify-icon {
    transform: rotate(-10deg) scale(1.22);
    color: var(--accent);
}

.skill-pill {
    display: inline-block;
    transition: color 0.35s cubic-bezier(0.2, 1, 0.3, 1), transform 0.35s cubic-bezier(0.2, 1, 0.3, 1), letter-spacing 0.35s cubic-bezier(0.2, 1, 0.3, 1);
    transform-origin: left center;
}

.skill-pill:hover {
    color: var(--accent);
    transform: translateX(4px) scale(1.035);
    letter-spacing: 0.01em;
}

.contact-parallax {
    transform: translate3d(0, var(--contact-y, 0px), 0);
    will-change: transform;
}

.contact-pulse {
    position: relative;
    animation: borderPulse 5s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes borderPulse {

    0%,
    100% {
        box-shadow: inset 0 0 0 rgba(139, 69, 19, 0), 0 0 0 rgba(139, 69, 19, 0);
    }

    50% {
        box-shadow: inset 0 0 0 1px rgba(139, 69, 19, 0.22), 0 0 34px rgba(139, 69, 19, 0.12);
    }
}

.contact-box {
    transition: transform 0.45s cubic-bezier(0.2, 1, 0.3, 1), box-shadow 0.45s cubic-bezier(0.2, 1, 0.3, 1), border-color 0.45s cubic-bezier(0.2, 1, 0.3, 1), background-color 0.45s cubic-bezier(0.2, 1, 0.3, 1);
}

.contact-box:hover {
    transform: translateY(-6px);
    border-color: var(--accent);
    background-color: rgba(255, 255, 255, 0.25);
    box-shadow: 8px 8px 0 #2C2C2C, 0 0 28px rgba(139, 69, 19, 0.18);
}

.footer-link {
    position: relative;
    display: inline-flex;
    transform: translateY(0);
    transition: transform 0.35s cubic-bezier(0.2, 1, 0.3, 1), color 0.35s cubic-bezier(0.2, 1, 0.3, 1);
}

.footer-link::before {
    content: "•";
    position: absolute;
    left: -12px;
    opacity: 0;
    transform: translateX(-4px);
    transition: opacity 0.35s cubic-bezier(0.2, 1, 0.3, 1), transform 0.35s cubic-bezier(0.2, 1, 0.3, 1);
    color: var(--accent);
}

.footer-link:hover {
    color: var(--accent);
    transform: translateY(-3px);
}

.footer-link:hover::before {
    opacity: 1;
    transform: translateX(0);
}

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}
