/* ==============================
   RESET & VARIABLES
   ============================== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --color-bg: #1c1c1e;
    --color-bg-alt: #2c2c30;
    --color-text: #f0eeeb;
    --color-text-secondary: #918e88;
    --color-text-tertiary: #666;
    --color-border: rgba(255, 255, 255, 0.07);
    --font-serif: 'Playfair Display', 'Georgia', serif;
    --font-sans: 'Outfit', 'Helvetica Neue', sans-serif;
    --container: 1400px;
    --gutter: clamp(24px, 8vw, 160px);
}

/* ==============================
   BASE
   ============================== */
html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    font-weight: 300;
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* Subtle grain overlay */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 256px 256px;
}

::selection {
    background: rgba(240, 238, 235, 0.12);
}

/* Scroll progress */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 2px;
    background: var(--color-text);
    width: 0%;
    z-index: 1001;
}

/* Container */
.container {
    max-width: var(--container);
    margin: 0 auto;
    padding-left: var(--gutter);
    padding-right: var(--gutter);
}

/* ==============================
   NAVIGATION
   ============================== */
nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 28px 0;
    opacity: 0;
    transform: translateY(-16px);
    transition:
        opacity 0.6s ease 0.05s,
        transform 0.6s ease 0.05s,
        background-color 0.4s ease,
        backdrop-filter 0.4s ease,
        -webkit-backdrop-filter 0.4s ease,
        padding 0.4s ease;
}

body.loaded nav {
    opacity: 1;
    transform: translateY(0);
}

nav.scrolled {
    background-color: rgba(28, 28, 30, 0.88);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    padding: 18px 0;
}

.nav-inner {
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.nav-name {
    font-family: var(--font-serif);
    font-size: 18px;
    font-weight: 500;
    letter-spacing: -0.02em;
    text-decoration: none;
    color: var(--color-text);
}

.nav-links {
    display: flex;
    gap: 36px;
    list-style: none;
}

.nav-links a {
    font-size: 14px;
    font-weight: 400;
    letter-spacing: 0.02em;
    text-decoration: none;
    color: var(--color-text-secondary);
    position: relative;
    transition: color 0.3s ease;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--color-text);
    transition: width 0.4s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.nav-links a:hover {
    color: var(--color-text);
}

.nav-links a:hover::after {
    width: 100%;
}

/* ==============================
   HERO
   ============================== */
.hero {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-top: 120px;
    padding-bottom: 100px;
    position: relative;
}

.hero-headline {
    font-family: var(--font-serif);
    font-size: clamp(44px, 5.5vw, 72px);
    font-weight: 800;
    line-height: 1.08;
    letter-spacing: -0.025em;
    margin-bottom: 36px;
    color: var(--color-text);
}

.hero-headline em {
    font-style: italic;
    font-weight: 400;
}

/* Text reveal animation */
.reveal-wrap {
    display: block;
}

.reveal-inner {
    display: block;
}

/* Word-by-word blur reveal */
.word {
    display: inline-block;
    opacity: 0;
    filter: blur(14px);
    transform: translateY(14px);
    transition:
        opacity 0.85s cubic-bezier(0.25, 0.46, 0.45, 0.94),
        filter 0.85s cubic-bezier(0.25, 0.46, 0.45, 0.94),
        transform 0.85s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: opacity, filter, transform;
}

body.loaded .word {
    opacity: 1;
    filter: blur(0px);
    transform: translateY(0);
}

.hero-subtext {
    font-size: clamp(20px, 2.2vw, 24px);
    line-height: 1.65;
    color: var(--color-text-secondary);
    font-weight: 300;
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.85s cubic-bezier(0.25, 0.46, 0.45, 0.94), transform 0.85s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    transition-delay: 0.55s;
}

body.loaded .hero-subtext {
    opacity: 1;
    transform: translateY(0);
}

/* Scroll indicator */
.scroll-indicator {
    position: absolute;
    bottom: 48px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    opacity: 0;
    transition: opacity 0.6s ease;
    transition-delay: 1.3s;
}

body.loaded .scroll-indicator {
    opacity: 1;
}

.scroll-indicator span {
    font-size: 10px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--color-text-tertiary);
    font-weight: 400;
}

.scroll-line {
    width: 1px;
    height: 40px;
    position: relative;
    overflow: hidden;
}

.scroll-line::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--color-border);
}

.scroll-line::after {
    content: '';
    position: absolute;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--color-text-secondary);
    animation: scrollFlow 2.2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes scrollFlow {
    0% { top: -100%; }
    45% { top: 0%; }
    55% { top: 0%; }
    100% { top: 100%; }
}

/* ==============================
   SELECTED WORK
   ============================== */
.work-section {
    padding-top: clamp(60px, 10vw, 120px);
    padding-bottom: clamp(80px, 12vw, 160px);
}

.section-label {
    font-size: 12px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--color-text-tertiary);
    font-weight: 400;
    margin-bottom: clamp(48px, 7vw, 88px);
}

.project-list {
    display: flex;
    flex-direction: column;
    gap: clamp(72px, 11vw, 140px);
}

.project-card {
    opacity: 0;
    transform: translateY(60px);
    transition: opacity 0.9s ease, transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}

.project-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.project-card-image {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    border-radius: 10px;
    overflow: hidden;
    cursor: default;
}

.project-card-image::before {
    content: '';
    position: absolute;
    inset: 0;
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 10px;
    z-index: 3;
    pointer-events: none;
}

/* Subtle specular highlight */
.project-card-image::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 25% 25%, rgba(255, 255, 255, 0.05), transparent 55%);
    pointer-events: none;
    z-index: 2;
}

.project-card-image-inner {
    position: absolute;
    inset: -10%;
    display: flex;
    align-items: center;
    justify-content: center;
    scale: 1;
    transition: scale 0.65s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: translate, scale;
}
.project-card:hover .project-card-image-inner {
    scale: 1.03;
}

.project-overlay-title {
    font-family: var(--font-serif);
    font-size: clamp(26px, 3.2vw, 44px);
    font-weight: 400;
    font-style: italic;
    color: rgba(255, 255, 255, 0.7);
    letter-spacing: -0.01em;
    text-align: center;
    padding: 0 48px;
    line-height: 1.25;
    position: relative;
    z-index: 2;
}

/* Project screenshot image */
.project-screenshot {
    width: 68%;
    height: auto;
    object-fit: cover;
    object-position: top center;
    border-radius: 8px;
    box-shadow:
        0 2px 0 rgba(255,255,255,0.06) inset,
        0 20px 60px rgba(0, 0, 0, 0.55),
        0 0 0 1px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 2;
    display: block;
    max-height: 88%;
}

/* Side-by-side screenshot + video */
.project-card-image-inner.project-bg-2 {
    justify-content: center;
    gap: 3%;
}

.project-screenshot-left {
    width: 48% !important;
    max-height: 85%;
}

video.project-screenshot-right {
    width: 17%;
    height: auto;
    object-fit: cover;
    border-radius: 20px;
    box-shadow:
        0 2px 0 rgba(255,255,255,0.06) inset,
        0 20px 60px rgba(0, 0, 0, 0.55),
        0 0 0 1px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 2;
    display: block;
    max-height: 85%;
}

/* Phone screenshots row */
.project-phones-row {
    gap: 2%;
}

.project-phone-screenshot {
    width: 18%;
    height: auto;
    object-fit: cover;
    border-radius: 12px;
    box-shadow:
        0 2px 0 rgba(255,255,255,0.06) inset,
        0 20px 60px rgba(0, 0, 0, 0.55),
        0 0 0 1px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 2;
    display: block;
    max-height: 88%;
}

/* Project gradients */
.project-bg-1 {
    background: linear-gradient(145deg, #28283a 0%, #3d3d60 40%, #2e2e4a 100%);
}
.project-bg-2 {
    background: linear-gradient(145deg, #253038 0%, #3a4e5c 40%, #2a3840 100%);
}
.project-bg-3 {
    background: linear-gradient(145deg, #222e28 0%, #344840 40%, #283430 100%);
}
.project-bg-4 {
    background: linear-gradient(145deg, #302430 0%, #4a3848 40%, #382c38 100%);
}
.project-bg-5 {
    background: linear-gradient(145deg, #2a2830 0%, #3e3a50 40%, #302c3a 100%);
}
.project-bg-6 {
    background: linear-gradient(145deg, #2e2a24 0%, #4a4030 40%, #38322a 100%);
}

.project-card-info {
    padding-bottom: 28px;
}

.project-card-title {
    font-family: var(--font-serif);
    font-size: clamp(21px, 2.2vw, 28px);
    font-weight: 500;
    letter-spacing: -0.015em;
    margin-bottom: 8px;
}

.project-card-meta {
    font-size: 14px;
    color: var(--color-text-tertiary);
    letter-spacing: 0.005em;
    margin-bottom: 14px;
}

.project-card-desc {
    font-size: 20px;
    color: var(--color-text-secondary);
    line-height: 1.65;
}

/* ==============================
   ABOUT
   ============================== */
.about-section {
    padding-top: clamp(80px, 12vw, 160px);
    padding-bottom: clamp(80px, 12vw, 160px);
    border-top: 1px solid var(--color-border);
}

.about-page {
    padding-top: clamp(140px, 16vw, 220px);
    border-top: none;
}

.about-page .section-label {
    margin-bottom: 32px;
}

.about-headline {
    font-family: var(--font-serif);
    font-size: clamp(36px, 4.5vw, 60px);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.025em;
    color: var(--color-text);
    margin-bottom: 24px;
    white-space: nowrap;
}

.rotating-words {
    display: inline-block;
    position: relative;
    vertical-align: baseline;
    overflow: hidden;
    height: 1.2em;
    top: 0.22em;
}

.rotating-words::after {
    content: 'triathlete';
    display: block;
    height: 0;
    overflow: hidden;
    visibility: hidden;
    font-style: italic;
    font-weight: 400;
}

.rotating-word {
    display: block;
    position: absolute;
    left: 0;
    top: 0;
    font-style: italic;
    font-weight: 400;
    opacity: 0;
    filter: blur(6px);
    transform: translateY(60%);
    transition: opacity 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                filter 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.rotating-word.active {
    position: absolute;
    opacity: 1;
    filter: blur(0px);
    transform: translateY(0);
}

.rotating-word.exit {
    opacity: 0;
    filter: blur(6px);
    transform: translateY(-60%);
}

.nav-active {
    color: var(--color-text) !important;
}

.about-quote {
    font-family: var(--font-serif);
    font-size: clamp(26px, 3.2vw, 42px);
    font-weight: 400;
    font-style: italic;
    line-height: 1.32;
    color: var(--color-text);
    margin-bottom: clamp(36px, 5vw, 60px);
    border: none;
    padding: 0;
}

.about-intro {
    display: flex;
    align-items: center;
    gap: clamp(40px, 5vw, 72px);
}

.about-photo {
    flex-shrink: 0;
    width: clamp(200px, 22vw, 320px);
}

.about-photo img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    object-fit: cover;
}

.about-body {
    font-size: 18px;
    color: var(--color-text-secondary);
    line-height: 1.72;
}

.about-body p + p {
    margin-top: 20px;
}

.about-body strong {
    color: inherit;
    font-weight: 500;
}

/* Sticker Canvas */
.sticker-canvas {
    position: relative;
    width: 100%;
    height: 400px;
    margin-top: 90px;
}

.sticker {
    position: absolute;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    transition: left 0.9s cubic-bezier(0.16, 1, 0.3, 1),
                top 0.9s cubic-bezier(0.16, 1, 0.3, 1),
                rotate 0.9s cubic-bezier(0.16, 1, 0.3, 1),
                opacity 0.6s ease,
                filter 0.3s ease;
    opacity: 0;
}

.sticker.scattered {
    opacity: 1;
}

.sticker:active {
    cursor: grabbing;
}

.sticker img {
    width: 120px;
    height: 120px;
    object-fit: contain;
    pointer-events: none;
}

.sticker::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%) translateY(6px);
    white-space: nowrap;
    font-size: 14px;
    font-weight: 400;
    color: var(--color-text);
    background: var(--color-bg-alt);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 8px 16px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.sticker:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.sticker.dragging {
    z-index: 10;
    filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.4));
}

.sticker.dragging::after {
    opacity: 0;
}

.about-detail {
    margin-top: 44px;
    font-size: 14px;
    color: var(--color-text-tertiary);
    letter-spacing: 0.005em;
}

/* Shared scroll-reveal animation */
.animate-in {
    opacity: 0;
    transform: translateY(44px);
    transition: opacity 0.85s ease, transform 0.85s cubic-bezier(0.16, 1, 0.3, 1);
}

.animate-in.visible {
    opacity: 1;
    transform: translateY(0);
}

.animate-in:nth-child(2) {
    transition-delay: 0.12s;
}

.animate-in:nth-child(3) {
    transition-delay: 0.2s;
}

.animate-in:nth-child(4) {
    transition-delay: 0.28s;
}

/* ==============================
   VIBE CODING
   ============================== */
.vibe-section {
    padding-top: clamp(60px, 10vw, 120px);
    padding-bottom: clamp(80px, 12vw, 160px);
    border-top: 1px solid var(--color-border);
}

.vibe-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.vibe-card {
    aspect-ratio: 16 / 10;
    border-radius: 10px;
    background: var(--color-bg-alt);
    border: 1px solid var(--color-border);
    position: relative;
    overflow: hidden;
    text-decoration: none;
    color: var(--color-text);
    display: block;
}

.vibe-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.vibe-card-overlay {
    position: absolute;
    inset: 0;
    background: rgba(28, 28, 30, 0.85);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 24px;
    opacity: 0;
    transition: opacity 0.35s ease;
}

.vibe-card:hover .vibe-card-overlay {
    opacity: 1;
}

.vibe-card-title {
    font-family: var(--font-serif);
    font-size: clamp(18px, 2vw, 24px);
    font-weight: 500;
    margin-bottom: 8px;
}

.vibe-card-desc {
    font-size: 14px;
    color: var(--color-text-secondary);
    line-height: 1.5;
    max-width: 280px;
}

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

/* ==============================
   TALKS & WRITING
   ============================== */
.talks-section {
    padding-top: clamp(60px, 10vw, 120px);
    padding-bottom: clamp(80px, 12vw, 160px);
    border-top: 1px solid var(--color-border);
}

.talks-list {
    display: flex;
    flex-direction: column;
    gap: clamp(40px, 6vw, 72px);
}

.talk-item {
    display: flex;
    align-items: flex-start;
    gap: clamp(24px, 3vw, 40px);
}

.talk-thumbnail {
    flex-shrink: 0;
    width: clamp(200px, 28vw, 380px);
    aspect-ratio: 16 / 10;
    border-radius: 8px;
    background: var(--color-bg-alt);
    border: 1px solid var(--color-border);
    overflow: hidden;
}

.talk-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.talk-info {
    padding-top: 4px;
}

.talk-meta {
    font-size: 14px;
    color: var(--color-text-tertiary);
    margin-bottom: 12px;
}

.talk-title {
    font-family: var(--font-serif);
    font-size: clamp(18px, 2vw, 24px);
    font-weight: 500;
    color: var(--color-text);
}

.talk-desc {
    font-size: 16px;
    color: var(--color-text-secondary);
    line-height: 1.65;
}

@media (max-width: 768px) {
    .talk-item {
        flex-direction: column;
    }

    .talk-thumbnail {
        width: 100%;
    }
}

/* ==============================
   FOOTER
   ============================== */
footer {
    border-top: 1px solid var(--color-border);
    padding: clamp(52px, 7vw, 88px) 0;
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 36px;
}

.footer-cta {
    font-family: var(--font-serif);
    font-size: clamp(26px, 3vw, 38px);
    font-weight: 400;
    font-style: italic;
    letter-spacing: -0.015em;
    color: var(--color-text);
}

.footer-links {
    display: flex;
    gap: 32px;
    list-style: none;
    align-items: center;
    padding-top: 8px;
}

.footer-links a {
    font-size: 14px;
    font-weight: 400;
    color: var(--color-text-secondary);
    text-decoration: none;
    position: relative;
    transition: color 0.3s ease;
}

.footer-links a::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--color-text);
    transition: width 0.4s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.footer-links a:hover {
    color: var(--color-text);
}

.footer-links a:hover::after {
    width: 100%;
}

.footer-copy {
    width: 100%;
    padding-top: 52px;
    font-size: 13px;
    color: var(--color-text-tertiary);
}

/* ==============================
   RESPONSIVE
   ============================== */
@media (max-width: 768px) {
    .nav-links {
        gap: 24px;
    }

    .hero {
        padding-top: 100px;
        min-height: 92vh;
    }

    .project-card-image {
        aspect-ratio: 3 / 2;
        border-radius: 8px;
    }


    .project-overlay-title {
        padding: 0 24px;
    }

    .footer-inner {
        flex-direction: column;
        gap: 24px;
    }

    .footer-links {
        padding-top: 0;
    }

    .scroll-indicator {
        display: none;
    }

    .about-intro {
        flex-direction: column;
    }

    .about-photo {
        width: 60%;
    }
}

@media (max-width: 480px) {
    .nav-links {
        gap: 18px;
    }

    .nav-links a {
        font-size: 13px;
    }

    .project-card-image {
        aspect-ratio: 4 / 3;
    }

    .footer-links {
        gap: 24px;
    }
}
