/* =========================================================
   INTRO ANIMATION
========================================================= */

#intro {
    position: fixed;
    inset: 0; 
    display: flex;
    justify-content: center;
    align-items: center;
    background: #000000;
    z-index: 9999;
    pointer-events: none;
}

#intro-name {
    text-align: center;
    font-family: var(--font-header);
    font-size: var(--fs-xl);
    font-weight: var(--w-medium);
    letter-spacing: var(--tracking-tight);
    color: #ffffff;
    line-height: var(--lh-tight);
}

.intro-name-word {
    display: inline-flex;
    white-space: nowrap;
}

.intro-name-word > span {
    display: inline-block;
    opacity: 0;
    animation: introLetterReveal 1ms steps(1, end) forwards;
    animation-delay: calc(var(--letter-index) * 55ms);
}

html.play-intro #intro {
    animation: intro-background-fade 950ms ease forwards 1.65s;
}

html.play-intro #intro-name {
    animation: intro-name-exit 950ms cubic-bezier(0.16, 1, 0.3, 1) both 1.65s;
}

html.play-intro .hero-title,
html.play-intro .hero-tag {
    animation: project-title-enter 800ms cubic-bezier(0.16, 1, 0.3, 1) both 2.45s;
}

html.play-intro .hero .site-header {
    animation: project-header-enter 750ms cubic-bezier(0.16, 1, 0.3, 1) both 2.45s;
}

@keyframes introLetterReveal {
    to { opacity: 1; }
}

@keyframes intro-background-fade {
    to { background-color: transparent; }
}

@keyframes intro-name-exit {
    to { transform: translateY(-100vh); }
}

@keyframes project-title-enter {
    from {
        opacity: 0;
        transform: translateY(1.1em);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes project-header-enter {
    from { opacity: 0; }
    to { opacity: 1; }
}

html.skip-intro #intro {
    display: none;
}

@media (max-width: 480px) {
    #intro-name {
        font-size: var(--fs-xl);
    }
}

@media (prefers-reduced-motion: reduce) {
    html.play-intro .intro-name-word > span {
        animation: none;
        opacity: 1;
    }

    html.play-intro #intro {
        animation-duration: 1ms;
        animation-delay: 0ms;
    }

    html.play-intro #intro-name,
    html.play-intro .hero-title,
    html.play-intro .hero-tag,
    html.play-intro .hero .site-header {
        animation-duration: 1ms;
        animation-delay: 0ms;
    }
}


/* =========================================================
   HERO 1 (GPU TRANSFORM PAN - CLEAN & FLASH-FREE)
========================================================= */

.hero {
    position: relative;
    width: 100%;
    height: 100lvh;
    overflow: hidden;
    background: #000000;
    cursor: grab;
    user-select: none;
    touch-action: pan-y;
}

.hero:active,
.hero.is-dragging {
    cursor: grabbing;
}

/* Dark Glass Overlay */
.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    z-index: 3;
    transition: opacity 0.4s ease;
    opacity: 1;
}

.hero .viewport-wrapper {
    width: 100%;
    height: 100%; /* Fills the 100lvh hero container */
    position: relative;
    overflow: hidden;
}

/* Horizontal Track Hardware-Accelerated */
.hero-track {
    display: flex;
    height: 100%;
    width: max-content;
    will-change: transform;
    z-index: 1;
}

.hero-tile {
    height: 100%;
    flex: 0 0 auto;
}

.hero-tile img,
.hero-tile svg {
    height: 100%;
    width: auto;
    object-fit: cover;
    display: block;
    user-select: none;
    -webkit-user-drag: none;
}
/* HERO CONTENT & INDICATORS LAYERED ON TOP */
.hero .site-header {
    width: min(100% - (var(--site-margin) * 2), var(--site-max-width));
}

.hero-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    width: min(100% - (var(--site-margin) * 2), var(--site-max-width));
    margin-inline: auto;
    padding-bottom: var(--hero-content-padding);
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

@media (max-width: 700px) {
    .hero-content {
        bottom: calc(100lvh - 100svh);
    }
}

@media (min-width: 900px) {
    .hero-content {
        padding-bottom: var(--hero-content-padding);
    }
}

.hero-title {
    font-weight: var(--w-semibold);
    letter-spacing: var(--tracking-tight);
    color: #ffffff;
    margin: 0;
    pointer-events: auto;
}

.hero-tag {
    padding: var(--space-2) var(--space-4);
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    position: relative;
    z-index: 11;
    pointer-events: auto;
}

.hero-tag:hover {
    background: #ffffff;
    color: #111111;
    border-color: #ffffff;
}

/* =========================================================
   HERO 2 (STATEMENT NARRATIVE)
========================================================= */

.hero-2 {
    width: 100%;
    background: #ffffff;
    padding-block: var(--section-padding);
}

.hero-2-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--grid-gap);
    align-items: start;
}

.hero-2-intro,
.hero-2-main {
    display: flex;
    flex-direction: column;
    gap: var(--grid-gap);
}

.hero-2-intro {
    gap: var(--space-6);
}

.hero-2-text {
    max-width: none;
}

.hero-2-text a {
    display: inline-block;
    padding: 0.08em 0.42em;
    border: 1px solid transparent;
    border-radius: 12px;
    background: #f2f2f2;
    color: inherit;
    line-height: var(--lh-compact);
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

.hero-2-text a:hover {
    background: var(--color-text);
    border-color: var(--color-text);
    color: #ffffff;
}

@media (min-width: 850px) {
    .hero-2-grid {
        grid-template-columns: 2fr 3fr;
    }

    .hero-2-main {
        grid-column: 2 / -1;
    }
}

.hero-pan-indicator {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    width: min(100% - (var(--site-margin) * 2), var(--site-max-width));
    margin-inline: auto;
    padding-bottom: var(--hero-content-padding);
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-family: var(--font-mono);
    font-size: var(--fs-xs);
    letter-spacing: var(--mono-spacing);
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.65);
    pointer-events: none;
    
    transition: opacity 0.3s ease, visibility 0.3s ease;
    opacity: 0;
    visibility: hidden;
}

.hero.focus-mode.pan-indicator-visible .hero-pan-indicator {
    opacity: 1;
    visibility: visible;
}

.hero-pan-indicator__icon {
    width: 14px;
    height: 14px;
    opacity: 0.7;
}

.hero-pan-indicator__label--mobile { display: none; }
.hero-pan-indicator__label--desktop { display: inline-block; }

/* FOCUS MODE STYLES */
.hero.focus-mode::before {
    opacity: 0;
}

.hero.focus-mode .hero-content {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

@media (min-width: 900px) {
    .hero-pan-indicator {
        padding-bottom: var(--hero-content-padding);
    }
}

/* MOBILE RESPONSIVE ADJUSTMENTS */
@media (max-width: 700px) {
    .hero-pan-indicator {
        bottom: calc(100lvh - 100svh);
    }

    .hero-pan-indicator__label--desktop { display: none; }
    .hero-pan-indicator__label--mobile { display: inline-block; }
}

/* =========================================================
   PROJECTS SECTION
========================================================= */

#projects {
    background: #ffffff;
    width: 100%;
    padding-block: var(--section-padding);
    position: relative; 
}

.projects-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-6);
    margin-bottom: var(--space-8);
}

.projects-header .section-title {
    margin: 0;
}

.projects-paddles {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: var(--space-2);
}

.projects-gallery-container {
    position: relative;
    width: 100%;
    container-type: inline-size;
}

.projects-track-wrapper {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    scroll-padding-inline-start: max(var(--site-margin), calc((100cqi - var(--site-max-width)) / 2));
    scroll-behavior: smooth;
    padding-block: 1rem;
    scrollbar-width: none;
    -ms-overflow-style: none;
    touch-action: pan-x pan-y;
}

.projects-track-wrapper::-webkit-scrollbar {
    display: none;
}

.projects-track-wrapper.is-dragging {
    scroll-snap-type: none;
    scroll-behavior: auto;
}

/* Dynamically aligns starting card padding to site container margin */
.projects-track {
    display: flex;
    gap: var(--space-8);
    width: max-content;
    padding-inline: max(var(--site-margin), calc((100cqi - var(--site-max-width)) / 2));
}

/* =========================================================
    PROJECT CARD
========================================================== */

.project-card {
    scroll-snap-align: start;
    scroll-snap-stop: always;
    position: relative;
    overflow: visible;
    cursor: grab;
    user-select: none;
    -webkit-user-drag: none;

    flex: 0 0 min(calc((100cqi - (var(--site-margin) * 2)) * 0.9), var(--site-max-width));
}

@media (min-width: 600px) {
    .project-card {
        flex-basis: calc((min(calc(100cqi - (var(--site-margin) * 2)), var(--site-max-width)) - var(--space-8)) / 2);
    }
}

@media (min-width: 900px) {
    .project-card {
        flex-basis: calc((min(calc(100cqi - (var(--site-margin) * 2)), var(--site-max-width)) - (var(--space-8) * 2)) / 3);
    }
}

@media (min-width: 1200px) {
    .project-card {
        flex-basis: calc((min(calc(100cqi - (var(--site-margin) * 2)), var(--site-max-width)) - (var(--space-8) * 3)) / 4);
    }
}

.projects-track-wrapper.is-dragging .project-card {
    cursor: grabbing;
}

.project-card-inner {
    aspect-ratio: 1 / 2;
    width: 100%;
    position: relative;
    transform-origin: center;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.project-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 28px;
    transition: transform 0.35s ease;
}

/* Gradient strictly sits at z-index: 1 */
.project-card-inner::after {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0) 35%,
        rgba(0, 0, 0, 0.18) 58%,
        rgba(0, 0, 0, 0.78) 100%
    );
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
    z-index: 1;
    border-radius: 28px;
}

/* Text sits safely above the gradient at z-index: 2 */
.project-card-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: var(--space-6);
    color: #ffffff;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    display: flex;
    flex-direction: column;
    z-index: 2;
    gap: var(--space-1);
}

.project-card-title {
    font-family: var(--font-mono);
    font-size: var(--fs-sm);
    font-weight: var(--w-semibold);
    letter-spacing: var(--mono-spacing);
    text-transform: uppercase;
    color: #ffffff;
    margin: 0;
    line-height: var(--lh-normal);
}

.project-card-details {
    font-family: var(--font-mono);
    font-size: var(--fs-xs);
    font-weight: var(--w-regular);
    letter-spacing: var(--mono-spacing);
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.82);
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: var(--space-1) var(--space-2);
    line-height: var(--lh-tight);
}

.project-card-details span:nth-child(3) {
    flex-basis: 100%;
    color: rgba(255, 255, 255, 0.72);
}

/* Desktop: Only scale and show info on actual mouse hover */
@media (hover: hover) and (pointer: fine) {
    .project-card:hover .project-card-inner,
    .project-card:has(.project-card-media:focus-visible) .project-card-inner {
        transform: scale(1.02);
    }
    .project-card:hover .project-card-media img,
    .project-card:has(.project-card-media:focus-visible) .project-card-media img {
        filter: brightness(0.82);
    }
    .project-card:hover .project-card-inner::after,
    .project-card:hover .project-card-info,
    .project-card:has(.project-card-media:focus-visible) .project-card-inner::after,
    .project-card:has(.project-card-media:focus-visible) .project-card-info {
        opacity: 1;
    }
}

/* Touch layouts keep the card nearest the gallery center highlighted. */
@media (max-width: 700px), (hover: none) {
    .project-card.project-card--active .project-card-inner {
        transform: scale(1.02);
    }
    .project-card.project-card--active .project-card-media img {
        filter: brightness(0.82);
    }
    .project-card.project-card--active .project-card-inner::after,
    .project-card.project-card--active .project-card-info {
        opacity: 1;
    }
}

/* =========================================================
    PROJECT STATUS BADGE
========================================================== */

.project-badge {
    position: absolute;
    top: var(--space-4);
    left: var(--space-4);
    z-index: 3;
    
    font-family: var(--font-mono);
    font-size: var(--fs-xs);
    font-weight: var(--w-regular);
    letter-spacing: var(--tracking-wide);
    text-transform: uppercase;
    
    padding: var(--space-1) var(--space-3);
    border-radius: 12px; /* True pill shape */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
}

/* Variant: New (Pure white, subtle architectural contrast) */
.project-badge.new {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.25);
}

/* Variant: Under Construction (Quiet, muted tone) */
.project-badge.construction {
    color: color-mix(in srgb, var(--subtitle-quiet-color) 70%, #ffffff 30%);
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid color-mix(in srgb, var(--subtitle-quiet-color) 30%, transparent);
}

/* Reveal badge smoothly alongside card info on hover/active */
@media (hover: hover) and (pointer: fine) {
    .project-card:hover .project-badge,
    .project-card:has(.project-card-media:focus-visible) .project-badge {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 700px), (hover: none) {
    .project-card.project-card--active .project-badge {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Ensure construction cards without an anchor tag behave safely */
.project-card-media div.project-card-media {
    display: block;
    width: 100%;
    height: 100%;
    cursor: default;
}

/* Disables the link entirely while preserving structural styles and hover animations */
.project-card-media.is-disabled {
    pointer-events: none;
    cursor: default;
}

/* =========================================================
    PROJECT PADDLES
========================================================== */

.projects-paddle {
    width: 2.75rem;
    height: 2.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: #f2f2f2;
    color: var(--color-text);
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.projects-paddle:hover {
    background: var(--color-text);
    color: #ffffff;
}

.projects-paddle:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 3px;
}

.projects-paddle:disabled {
    opacity: 0.35;
    cursor: default;
}

.projects-paddle svg {
    width: 24px;
    height: 24px;
    pointer-events: none;
    transition: transform 0.2s ease;
}

.projects-paddle-left:not(:disabled):hover svg {
    transform: translateX(-2px);
}

.projects-paddle-right:not(:disabled):hover svg {
    transform: translateX(2px);
}

@media (max-width: 480px) {
    .projects-header {
        gap: var(--space-3);
    }

    .projects-paddles {
        gap: var(--space-1);
    }

    .projects-paddle {
        width: 2.5rem;
        height: 2.5rem;
    }
}

/* =========================================================
   PROFILE SECTION
========================================================= */

#profile {
    padding-block: var(--section-padding);
}

.profile-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--grid-gap);
    align-items: start;
    padding-block: var(--space-4);
}

@media (min-width: 900px) {
    .profile-grid {
        grid-template-columns: 2fr 3fr;
    }
}

.profile-contact-block {
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
}

.profile-portrait {
    width: min(100%, 24rem);
    aspect-ratio: 3 / 4;
    object-fit: cover;
    border-radius: 28px;
}

.profile-identity {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    padding-left: 1rem;
}

.identity-name {
    font-family: var(--font-mono);
    font-size: var(--fs-sm);
    font-weight: var(--w-semibold);
    letter-spacing: var(--mono-spacing);
    text-transform: uppercase;
    color: var(--color-text);
    margin: 0;
    line-height: var(--lh-normal);
}

.identity-meta {
    font-family: var(--font-mono);
    font-size: var(--fs-xs);
    font-weight: var(--w-regular);
    letter-spacing: var(--mono-spacing);
    text-transform: uppercase;
    color: var(--color-muted);
    display: flex;
    gap: 0.5rem;
    line-height: var(--lh-tight);
}


/* ACTION BUTTON STRIP */
.profile-actions {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding-left: var(--space-2);
    margin-top: calc(-1 * var(--space-2));
}

.profile-info-block {
    display: flex;
    flex-direction: column;
    gap: var(--space-10);
}

.profile-awards-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-8) var(--grid-gap);
}

@media (min-width: 900px) {
    .profile-awards-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.profile-award-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--space-3);
}

.profile-award-heading-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-1);
}

.journal-entry {
    padding-block: var(--space-6);
    border-top: 1px solid var(--border-soft);
}

.journal-entry:last-child {
    border-bottom: 1px solid var(--border-soft);
}

.profile-award .profile-award-rank {
    color: var(--color-muted);
    font-weight: var(--w-semibold);
}

.profile-award-title {
    margin: 0;
}

.profile-award-year {
    flex-shrink: 0;
    padding-top: var(--space-1);
}

.profile-award-detail {
    margin-bottom: 0;
}

/* Base State: Clean, flat, calm */
.profile-action-btn {
    width: 2rem;
    height: 2rem;
    color: var(--subtitle-quiet-color);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow: none;
    transition: color 0.25s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
}

.profile-action-btn svg {
    transition: color 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Hover State: Pure Scandinavian restraint — subtle tint shift, zero heavy scaling or engraving */
.profile-action-btn:hover {
    color: var(--color-text);
    background: rgba(255, 255, 255, 0.06);
    border-color: transparent;
    box-shadow: none;
    transform: none;
}

.profile-action-btn:hover svg {
    transform: none;
}


.profile-section {
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
}

.profile-entry {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

/* ENTRY TITLES (OUTFIT) */
.entry-title {
    font-family: var(--font-body);
    font-size: var(--fs-md);
    font-weight: var(--w-semibold);
    color: var(--color-text);
    line-height: var(--lh-tight);
    letter-spacing: var(--tracking-heading);
}

/* SUBTITLES & DESCRIPTIONS (INTER) */
.entry-sub {
    font-family: var(--font-body);
    font-size: var(--fs-sm);
    color: var(--subtitle-quiet-color);
    line-height: var(--lh-normal);
}

.entry-desc {
    font-family: var(--font-body);
    font-size: var(--fs-sm);
    color: var(--color-muted);
    line-height: var(--lh-normal);
    margin-top: var(--space-1);
}

/* RESPONSIVE OVERRIDES */
@media (max-width: 700px) {
    .profile-portrait {
        width: 100%;
    }
}

/* =========================================================
JOURNAL
   ========================================================= */

.project-problem {
    padding-block: var(--section-padding);
}

.problem-header {
    margin-bottom: var(--space-8);
}

.journal-entry {
    border-top: 1px solid var(--border-soft);
}

.journal-entry:last-child {
    border-bottom: 1px solid var(--border-soft);
}

.journal-entry-link {
    display: grid;
    grid-template-columns: minmax(8rem, 1fr) minmax(0, 3fr) minmax(7rem, 1fr);
    gap: var(--grid-gap);
    align-items: start;
    padding-block: var(--space-6);
    color: inherit;
    text-decoration: none;
}

.journal-entry-link:focus-visible {
    outline: 2px solid var(--color-text);
    outline-offset: 4px;
}

.journal-entry-date,
.journal-entry-category {
    font-family: var(--font-mono);
    font-size: var(--fs-xs);
    letter-spacing: var(--mono-spacing);
    text-transform: uppercase;
    color: var(--color-muted);
}

.journal-entry-title {
    margin: 0;
    font-family: var(--font-header);
    font-size: var(--fs-lg);
    font-weight: var(--w-medium);
    line-height: var(--lh-tight);
    transition: color 0.2s ease;
}

.journal-entry-link:hover .journal-entry-title,
.journal-entry-link:focus-visible .journal-entry-title {
    color: var(--color-muted);
}

.journal-entry-subtitle {
    margin: var(--space-2) 0 0;
    color: var(--color-muted);
    font-size: var(--fs-sm);
    line-height: var(--lh-normal);
}

@media (max-width: 700px) {
    .journal-entry-link {
        grid-template-columns: 1fr auto;
        gap: var(--space-3) var(--space-4);
    }

    .journal-entry-link .journal-entry-content {
        grid-column: 1 / -1;
        grid-row: 2;
    }

    .journal-entry-category {
        text-align: right;
    }
}