/* Só a home:
.hero
.hero-overlay
.hero-content
*/



/* HEADER */

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;

    background:
        radial-gradient(circle at 70% 40%, rgba(212, 175, 55, 0.10), transparent 35%),
        linear-gradient(180deg, #070707 0%, #090807 100%);

    border-bottom: 1px solid rgba(212, 175, 55, 0.15);
    box-shadow:
        0 2px 18px rgba(212, 175, 55, 0.08),
        0 0 40px rgba(212, 175, 55, 0.04);

    backdrop-filter: blur(18px);
}

.site-header-container {
    width: min(1650px, calc(100% - 48px));
    height: 70px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.site-logo {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    color: #ffffff;
    text-decoration: none;
}

.site-logo-icon {
    color: #d4af37;
    font-size: 1.7rem;
    font-weight: 800;
}

.site-logo strong {
    display: block;
    font-size: 1rem;
}

.site-logo small {
    display: block;
    margin-top: 0.15rem;
    color: #a8a8a8;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 9rem;
}

.site-nav a {
    color: #ffffff;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 600;
    transition: 0.25s ease;
}

.site-nav a:hover,
.site-nav a.active {
    color: #d4af37;
}

.admin-area-btn {
    padding: 0.75rem 1rem;
    border: 1px solid rgba(212, 175, 55, 0.45);
    border-radius: 8px;
    color: #ffffff;
    text-decoration: none;
    font-size: 1rem;
    transition: 0.25s ease;
}

.admin-area-btn:hover {
    transform: translateY(-1px);
    background: #e0bc4a;
    color: #111111;
    box-shadow: 0 0 36px rgba(212, 175, 55, 0.35);
}

/* HERO */

.portfolio-hero {
    position: relative;
    min-height: calc(100svh - 70px);
    display: flex;
    align-items: center;
    padding: 2.5rem 3rem 3.5rem;
    overflow: hidden;
    box-sizing: border-box;
    isolation: isolate;
}

.portfolio-hero::after {
    position: absolute;
    z-index: 1;
    right: 0;
    bottom: 0;
    left: 0;
    height: clamp(20rem, 42svh, 32rem);
    background: linear-gradient(
        to bottom,
        rgba(245, 240, 231, 0),
        rgba(245, 240, 231, 0.16) 22%,
        rgba(245, 240, 231, 0.48) 52%,
        rgba(245, 240, 231, 0.82) 78%,
        #f5f0e7
    );
    content: "";
    pointer-events: none;
}

.portfolio-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 78% 18%, rgba(212, 175, 55, 0.18), transparent 28%),
        radial-gradient(circle at 20% 80%, rgba(212, 175, 55, 0.08), transparent 24%),
        linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
        #070707;
    background-size: auto, auto, 48px 48px, 48px 48px, auto;
}

.portfolio-bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(120deg, transparent 15%, rgba(212, 175, 55, 0.08), transparent 70%);
    opacity: 0.85;
}

.hero-grid {
    position: relative;
    z-index: 2;
    width: min(1120px, calc(100% - 48px));
    min-height: auto;
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(440px, 0.92fr);
    gap: clamp(3rem, 5vw, 5rem);
    align-items: center;
}

.hero-label,
.section-label {
    display: inline-block;
    margin-top: 3rem;
    margin-bottom: 1rem;
    color: #d4af37;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.10rem;
    text-transform: uppercase;
}

.hero-label {
    padding: 0.45rem 0.8rem;
    border: 1px solid rgba(212, 175, 55, 0.45);
    border-radius: 999px;
}

.hero-left h1 {
    max-width: 760px;
    margin-top: 0;
    margin-right: 0;
    font-size: clamp(3.2rem, 3.6vw, 3.9rem);
    line-height: 1.05;
    letter-spacing: -0.05em;
}

.hero-left h1 span {
    color: #d4af37;
    max-width: 700px;
}

.hero-left p {
    width: auto;
    max-width: 520px;
    color: #d4d4d4;
    font-size: 1rem;
    line-height: 1.8;
    margin-top: 2.5rem;
}

.tech-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 1.8rem;
    margin-top: 2rem;
    margin-right: 0;
}

.tech-list span {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    border-radius: 8px;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.075);
    border: 1px solid rgba(255, 255, 255, 0.13);
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

.tech-list img {
    width: 28px;
    height: 28px;
}

.hero-buttons {
    width: auto;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 2.25rem;
    margin-bottom: 0;

    position: static;
    transform: none;
}

/* CODE AREA */

.hero-right {
    position: relative;
    min-height: 200px;
    top: 0;
    transform: none;
}

.hero-right::before {
    content: '';
    position: absolute;

    top: 30px;
    left: 2rem;
    right: -1rem;
    bottom: -30px;

    border: 2px solid rgba(212, 175, 55, 0.12);
    border-radius: 18px;

    z-index: 0;
    transform: none;
}

.code-window {
    position: relative;
    z-index: 2;
    width: min(470px, 100%);
    margin-left: auto;
    margin-right: 0;
    overflow: hidden;
    border-radius: 18px;
    background: rgba(14, 14, 14, 0.9);
    border: 1.9px solid rgba(212, 175, 55, 0.22);
    box-shadow: 0 35px 85px rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(16px);
    animation: floatCard 5s ease-in-out infinite;
}

.code-top {
    height: 30px;
    padding: 0 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.055);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.window-dots {
    display: flex;
    gap: 0.5rem;
}

.window-dots span {
    width: 11px;
    height: 11px;
    border-radius: 50%;
}

.dot-red {
    background: #ff5f57;
}

.dot-yellow {
    background: #ffbd2e;
}

.dot-green {
    background: #28c840;
}

.code-top small {
    color: #bdbdbd;
    font-size: 0.7rem;
}

.code-window pre {
    margin: 0;
    padding: 0.9rem;
    overflow-x: auto;
}

.code-window code {
    color: #eeeeee;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: 0.65rem;
    line-height: 1.8;
}

.code-purple {
    color: #c792ea;
}

.code-green {
    color: #7ee787;
}

.code-blue {
    color: #7dd3fc;
}

.code-yellow {
    color: #facc15;
}

.code-orange {
    color: #fb923c;
}

.code-floating {
    position: absolute;
    z-index: 3;
    padding: 0.5rem 0.7rem;
    border-radius: 13px;
    background: rgba(15, 15, 15, 0.9);
    border: 1px solid rgba(212, 175, 55, 0.42);
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(12px);
}

.code-floating strong {
    display: block;
    color: #d4af37;
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
}

.code-floating span {
    color: #eeeeee;
    font-size: 0.75rem;
}

.card-crud {
    top: 5rem;
    right: -1rem;
    animation: floatSmallOne 3.8s ease-in-out infinite;
}

.card-mvc {
    left: 7rem;
    top: 47%;
    animation: floatSmallTwo 4.2s ease-in-out infinite;
}

.card-db {
    right: -1rem;
    bottom: -1.4rem;
    animation: floatSmallThree 4s ease-in-out infinite;
}

/* SECTIONS */

.portfolio-section,
.building-section {
    padding: 4.8rem 8rem 4rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(180deg, #111111 0%, #090909 100%);
}

.about-grid {
    display: grid;
    grid-template-columns: 0.85fr 1.35fr;
    gap: 3rem;
    align-items: start;
}

.about-grid h2,
.project-grid h2,
.building-grid h2 {
    margin: 0 0 1rem;
    font-size: clamp(2rem, 3vw, 2.8rem);
    line-height: 1.1;
    letter-spacing: -0.03em;
}

.about-grid p,
.project-grid p,
.building-grid p {
    color: #c9c9c9;
    line-height: 1.75;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.feature-grid article {
    min-height: 210px;
    padding: 1.4rem;
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.055);
    border: 1px solid rgba(255, 255, 255, 0.11);
}

.feature-grid article > span {
    display: block;
    margin-bottom: 1rem;
    color: #d4af37;
    font-size: 1.7rem;
}

.feature-grid h3 {
    margin: 0 0 0.8rem;
    font-size: 1.05rem;
}

.feature-grid p {
    color: #bfbfbf;
    line-height: 1.65;
    font-size: 0.9rem;
}

/* FEATURED PROJECT */

.project-grid {
    display: grid;
    grid-template-columns: 0.8fr 1.2fr;
    gap: 3rem;
    align-items: center;
}

.project-list {
    margin: 1.4rem 0 1.7rem;
    padding: 0;
    list-style: none;
}

.project-list li {
    margin-bottom: 0.72rem;
    color: #dddddd;
}

.project-list li::before {
    content: "●";
    color: #d4af37;
    margin-right: 0.6rem;
}

.admin-preview {
    min-height: 320px;
    display: grid;
    grid-template-columns: 175px 1fr;
    overflow: hidden;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.065);
    border: 1px solid rgba(212, 175, 55, 0.2);
    box-shadow: 0 28px 75px rgba(0, 0, 0, 0.4);
}

.admin-preview aside {
    padding: 1.3rem;
    background: rgba(0, 0, 0, 0.38);
}

.admin-preview aside strong {
    display: block;
    margin-bottom: 1rem;
    color: #ffffff;
}

.admin-preview aside span {
    display: block;
    margin-bottom: 0.8rem;
    color: #aaaaaa;
    font-size: 0.85rem;
}

.admin-preview > div {
    padding: 1.5rem;
}

.admin-preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.admin-preview-header h3 {
    margin: 0;
}

.admin-preview-header button {
    border: 0;
    border-radius: 8px;
    padding: 0.55rem 0.8rem;
    background: #d4af37;
    color: #111111;
    font-weight: 800;
}

.admin-table {
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 12px;
}

.admin-row {
    display: grid;
    grid-template-columns: 1fr 1.2fr 0.8fr;
    gap: 1rem;
    padding: 0.9rem;
    color: #d8d8d8;
    font-size: 0.85rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.admin-row:last-child {
    border-bottom: 0;
}

.admin-row.head {
    color: #aaaaaa;
    background: rgba(255, 255, 255, 0.045);
}

.published {
    color: #7ee787;
}

/* CURRENTLY BUILDING */

.building-section {
    background: #101010;
}

.building-grid {
    display: grid;
    grid-template-columns: auto 1fr 0.9fr;
    gap: 2rem;
    align-items: center;
}

.rocket-icon {
    width: 90px;
    height: 90px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    font-size: 2rem;
    border: 1px solid rgba(212, 175, 55, 0.38);
    box-shadow: 0 0 35px rgba(212, 175, 55, 0.13);
}

.next-card {
    padding: 1.4rem;
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.055);
    border: 1px solid rgba(255, 255, 255, 0.11);
}

.next-card h3 {
    margin: 0 0 1rem;
}

.next-card ul {
    margin: 0;
    padding-left: 1.2rem;
    color: #cfcfcf;
    line-height: 1.8;
}

.next-card li::marker {
    color: #d4af37;
}

/* ANIMATION */

@keyframes floatCard {
    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-16px);
    }
}

@keyframes floatSmallOne {
    0%,
    100% {
        transform: translateY(0) translateX(0);
    }

    50% {
        transform: translateY(-14px) translateX(8px);
    }
}

@keyframes floatSmallTwo {
    0%,
    100% {
        transform: translateY(0) translateX(0);
    }

    50% {
        transform: translateY(12px) translateX(-8px);
    }
}

@keyframes floatSmallThree {
    0%,
    100% {
        transform: translateY(0) translateX(0);
    }

    50% {
        transform: translateY(-10px) translateX(-10px);
    }
}

/* INTERACTIVE STORY */

.story-experience {
    --story-bg: #172838;
    --story-ink: #f7f2e9;
    --story-muted: rgba(247, 242, 233, 0.72);
    --story-line: rgba(220, 230, 242, 0.25);
    --story-accent: #9bb9e0;
    position: relative;
    overflow: clip;
    color: var(--story-ink);
    background-color: var(--story-bg);
    transition:
        color 1000ms ease,
        background-color 1000ms ease;
}

.story-transition {
    position: absolute;
    z-index: 2;
    top: 0;
    right: 0;
    left: 0;
    height: 106svh;
    min-height: 0;
    overflow: hidden;
    background:
        radial-gradient(
            90% 48% at 12% 10%,
            rgba(245, 240, 231, 0.92) 0%,
            rgba(245, 240, 231, 0.42) 46%,
            transparent 78%
        ),
        radial-gradient(
            72% 42% at 88% 28%,
            rgba(220, 230, 242, 0.72) 0%,
            rgba(220, 230, 242, 0.2) 48%,
            transparent 78%
        ),
        linear-gradient(
            to bottom,
            #f5f0e7 0%,
            #f1efeb 10svh,
            #e2e7e9 20svh,
            #bcc8d3 31svh,
            #899eb2 40svh,
            #60788f 49svh,
            #455e75 56svh,
            #30495f 66svh,
            #20374a 76svh,
            #192c3d 84svh,
            #172838 90svh,
            #172838 100%
        );
    -webkit-mask-image: linear-gradient(
        to bottom,
        #000 0%,
        #000 60svh,
        rgba(0, 0, 0, 0.88) 70svh,
        transparent 100%
    );
    mask-image: linear-gradient(
        to bottom,
        #000 0%,
        #000 60svh,
        rgba(0, 0, 0, 0.88) 70svh,
        transparent 100%
    );
    pointer-events: none;
}

.story-transition::before {
    content: none;
}

.story-transition-star {
    position: absolute;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    opacity: 0;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 0 0.75rem rgba(255, 255, 255, 0.45);
    transform: scale(0.3);
}

.story-transition-star:nth-child(1) {
    top: 43svh;
    left: 19%;
}

.story-transition-star:nth-child(2) {
    top: 51svh;
    left: 52%;
}

.story-transition-star:nth-child(3) {
    top: 59svh;
    left: 81%;
}

.story-transition.is-visible .story-transition-star {
    animation: storyStarArrive 1.4s ease-out forwards;
}

.story-transition.is-visible .story-transition-star:nth-child(2) {
    animation-delay: 180ms;
}

.story-transition.is-visible .story-transition-star:nth-child(3) {
    animation-delay: 360ms;
}

@keyframes storyStarArrive {
    to {
        opacity: 0.68;
        transform: scale(1);
    }
}

.story-experience[data-active="run"] {
    --story-bg: #20384d;
    --story-ink: #f7f2e9;
    --story-muted: rgba(247, 242, 233, 0.72);
    --story-line: rgba(220, 230, 242, 0.25);
    --story-accent: #a8c3e4;
}

.story-experience[data-active="run"].is-run-complete {
    --story-bg: #dce6ef;
    --story-ink: #263746;
    --story-muted: rgba(38, 55, 70, 0.72);
    --story-line: rgba(82, 119, 166, 0.25);
    --story-accent: #5277a6;
}

.story-experience[data-active="path"] {
    --story-bg: #e5eaeb;
    --story-ink: #263746;
    --story-muted: rgba(38, 55, 70, 0.72);
    --story-line: rgba(82, 119, 166, 0.22);
    --story-accent: #5277a6;
}

.story-experience[data-active="proud"] {
    --story-bg: #f1ece3;
    --story-ink: #263746;
    --story-muted: rgba(38, 55, 70, 0.72);
    --story-line: rgba(82, 119, 166, 0.22);
    --story-accent: #5277a6;
}

.story-experience[data-active="ocean"] {
    --story-bg: var(--public-cream, #f5f0e7);
    --story-ink: #263746;
    --story-muted: rgba(38, 55, 70, 0.72);
    --story-line: rgba(82, 119, 166, 0.22);
    --story-accent: #5277a6;
}

.story-experience::before {
    content: none;
}

.story-intro,
.story-shell {
    position: relative;
    z-index: 3;
    width: min(1120px, calc(100% - 48px));
    margin: 0 auto;
}

.story-intro {
    min-height: 64svh;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    flex-direction: column;
    padding: clamp(6.5rem, 13svh, 9rem) 0 3.5rem;
}

.story-kicker,
.story-chapter-kicker {
    margin: 0;
    color: var(--story-accent);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.story-intro .story-kicker {
    color: #5277a6;
}

.story-intro h2 {
    max-width: 50rem;
    margin: 1rem 0 1.4rem;
    color: #263746;
    font-size: clamp(3.4rem, 7vw, 7rem);
    line-height: 0.9;
    letter-spacing: -0.065em;
}

.story-intro > p:not(.story-kicker) {
    max-width: 36rem;
    margin: 0;
    color: rgba(38, 55, 70, 0.76);
    font-size: 1.05rem;
    line-height: 1.7;
}

.story-start {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    margin-top: 2rem;
    color: #263746;
    font-size: 0.88rem;
    font-weight: 750;
    text-decoration: none;
}

.story-start span {
    color: #5277a6;
    transition: transform 180ms ease;
}

.story-start:hover span,
.story-start:focus-visible span {
    transform: translateY(0.25rem);
}

.story-shell {
    display: grid;
    grid-template-columns: minmax(26rem, 1.05fr) minmax(20rem, 0.95fr);
    gap: clamp(3rem, 7vw, 7rem);
    align-items: start;
    padding-bottom: 8rem;
}

.story-stage-wrap {
    min-width: 0;
    height: 100%;
}

.story-stage {
    position: sticky;
    top: 6rem;
    height: min(72svh, 650px);
    min-height: 520px;
    overflow: hidden;
    border: 1px solid var(--story-line);
    border-radius: 2rem;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 2rem 5rem rgba(10, 25, 40, 0.2);
    isolation: isolate;
}

.story-stage-top {
    position: absolute;
    z-index: 10;
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.1rem 1.35rem;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    pointer-events: none;
}

.story-scenes,
.story-scene {
    position: absolute;
    inset: 0;
}

.story-scene {
    display: grid;
    place-items: center;
    overflow: hidden;
    opacity: 0;
    transform: scale(1.035);
    transition:
        opacity 600ms ease,
        transform 900ms ease,
        filter 900ms ease;
    pointer-events: none;
}

.story-scene.is-active {
    z-index: 2;
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}

.story-scene-hint {
    position: absolute;
    right: 1.35rem;
    bottom: 4.5rem;
    margin: 0;
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.story-scene-night {
    background:
        radial-gradient(circle at 48% 110%, rgba(82, 119, 166, 0.4), transparent 45%),
        linear-gradient(165deg, #101d2a, #1f3952 72%, #2e4d67);
    transition:
        opacity 600ms ease,
        transform 900ms ease,
        filter 900ms ease;
}

.story-scene-night::after {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(
            90% 42% at 18% 105%,
            rgba(211, 154, 111, 0.35),
            transparent 66%
        );
    content: "";
    opacity: 0;
    pointer-events: none;
    transition: opacity 900ms ease;
}

.story-stage[data-night-step="3"] .story-scene-night::after {
    opacity: 1;
}

.story-stars::before,
.story-stars::after {
    position: absolute;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    content: "";
}

.story-stars::before {
    top: 18%;
    left: 16%;
    box-shadow:
        72px 54px 0 rgba(255, 255, 255, 0.6),
        168px -8px 0 rgba(255, 255, 255, 0.75),
        242px 82px 0 rgba(255, 255, 255, 0.5),
        348px 18px 0 rgba(255, 255, 255, 0.8),
        394px 128px 0 rgba(255, 255, 255, 0.55);
}

.story-stars::after {
    top: 54%;
    left: 10%;
    box-shadow:
        94px 80px 0 rgba(255, 255, 255, 0.5),
        190px 12px 0 rgba(255, 255, 255, 0.72),
        292px 110px 0 rgba(255, 255, 255, 0.45),
        408px 48px 0 rgba(255, 255, 255, 0.65);
}

.story-orb {
    --orb-surface: #f1ead8;
    --orb-glow: rgba(245, 240, 231, 0.42);
    --orb-craters: 1;
    position: absolute;
    z-index: 7;
    top: 34%;
    left: 68%;
    width: clamp(4.5rem, 8vw, 6.5rem);
    aspect-ratio: 1;
    border: 0;
    border-radius: 50%;
    opacity: 1;
    background: var(--orb-surface);
    box-shadow:
        0 0 0 1rem rgba(245, 240, 231, 0.07),
        0 0 4rem var(--orb-glow);
    cursor: default;
    pointer-events: none;
    transform:
        translate(
            calc(-50% + var(--story-parallax-x, 0px)),
            calc(-50% + var(--story-parallax-y, 0px))
        );
    transition:
        top 1100ms cubic-bezier(0.2, 0.8, 0.2, 1),
        left 1100ms cubic-bezier(0.2, 0.8, 0.2, 1),
        width 900ms ease,
        opacity 650ms ease,
        background-color 900ms ease,
        box-shadow 900ms ease,
        transform 180ms ease;
}

.story-orb::before,
.story-orb::after {
    position: absolute;
    border-radius: 50%;
    content: "";
    opacity: var(--orb-craters);
    transition: opacity 700ms ease;
}

.story-orb::before {
    top: 18%;
    left: 22%;
    width: 28%;
    height: 28%;
    background: #fffdf3;
}

.story-orb::after {
    right: 18%;
    bottom: 20%;
    width: 19%;
    height: 19%;
    background: rgba(101, 126, 147, 0.22);
}

.story-experience[data-active="night"] .story-orb {
    top: var(--night-orb-y, 34%);
    left: var(--night-orb-x, 68%);
    cursor: grab;
    pointer-events: auto;
}

.story-experience[data-active="run"] .story-orb {
    top: 22%;
    left: 78%;
}

.story-experience[data-active="run"].is-run-complete .story-orb {
    --orb-surface: #ffe7ad;
    --orb-glow: rgba(255, 196, 112, 0.62);
    --orb-craters: 0;
    top: 68%;
    left: 18%;
    width: clamp(3.8rem, 7vw, 5.5rem);
}

.story-experience[data-active="path"] .story-orb {
    --orb-craters: 0;
    top: 82%;
    left: 50%;
    opacity: 0;
}

.story-experience[data-active="proud"] .story-orb {
    --orb-surface: #fff0bf;
    --orb-glow: rgba(255, 218, 138, 0.5);
    --orb-craters: 0;
    top: 18%;
    left: 78%;
    width: clamp(4rem, 7vw, 5.75rem);
}

.story-experience[data-active="ocean"] .story-orb {
    --orb-surface: #fff1c7;
    --orb-glow: rgba(255, 190, 125, 0.65);
    --orb-craters: 0;
    top: var(--ocean-orb-y, 34%);
    left: var(--ocean-orb-x, 68%);
    cursor: grab;
    pointer-events: auto;
    touch-action: none;
}

.story-orb:hover,
.story-orb:focus-visible {
    box-shadow:
        0 0 0 1.4rem rgba(245, 240, 231, 0.1),
        0 0 5rem var(--orb-glow);
}

.story-scene-run {
    color: #263746;
    background:
        radial-gradient(circle at 78% 18%, rgba(245, 240, 231, 0.12), transparent 22%),
        linear-gradient(155deg, #132536, #29465f 70%, #47657e);
}

.story-scene-run::before {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 18% 72%, rgba(255, 222, 168, 0.88), transparent 25%),
        linear-gradient(145deg, #eaf0f5, #aac1de);
    content: "";
    opacity: 0;
    pointer-events: none;
    transition: opacity 1200ms ease;
}

.story-scene-run.is-clear::before {
    opacity: 1;
}

.story-run-map {
    position: relative;
    z-index: 2;
    width: 88%;
    height: auto;
    overflow: visible;
}

.story-run-path,
.story-run-clear {
    fill: none;
    stroke-linecap: round;
    stroke-width: 5;
    transition:
        opacity 500ms ease,
        stroke-dashoffset 900ms ease;
}

.story-run-path {
    stroke: rgba(247, 242, 233, 0.48);
    stroke-dasharray: 9 14;
}

.story-run-clear {
    opacity: 0;
    stroke: #5277a6;
    stroke-dasharray: 520;
    stroke-dashoffset: 520;
}

.story-runner {
    fill: #f28d5e;
    stroke: #fff;
    stroke-width: 4;
    filter: drop-shadow(0 8px 12px rgba(38, 55, 70, 0.25));
}

.story-scene-run.is-clear .story-run-path {
    opacity: 0.16;
    stroke: rgba(38, 55, 70, 0.42);
}

.story-scene-run.is-clear .story-run-clear {
    opacity: 1;
    stroke-dashoffset: 0;
}

.story-scene-run .story-scene-hint {
    z-index: 3;
    color: rgba(247, 242, 233, 0.74);
    transition: color 800ms ease;
}

.story-scene-run.is-clear .story-scene-hint,
.story-scene-path .story-scene-hint {
    color: rgba(38, 55, 70, 0.7);
}

.story-scene-path {
    color: #263746;
    background:
        radial-gradient(
            90% 46% at 14% 100%,
            rgba(255, 198, 130, 0.5),
            transparent 58%
        ),
        linear-gradient(155deg, #c9d8e6 0%, #e8e9e4 64%, #f5e7d3 100%);
}

.story-path-map {
    position: relative;
    z-index: 4;
    width: min(82%, 27rem);
    display: grid;
    gap: 1.2rem;
    padding-left: 1.25rem;
}

.story-path-map::before {
    position: absolute;
    top: 2.3rem;
    bottom: 2.3rem;
    left: 2.35rem;
    width: 2px;
    background: linear-gradient(
        to bottom,
        rgba(82, 119, 166, 0.22),
        rgba(82, 119, 166, 0.68)
    );
    content: "";
}

.story-path-node {
    position: relative;
    width: 100%;
    display: grid;
    grid-template-columns: 2.2rem minmax(0, 1fr);
    gap: 1rem;
    align-items: center;
    padding: 1rem 1.15rem;
    border: 1px solid rgba(82, 119, 166, 0.3);
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.66);
    box-shadow: 0 0.8rem 2rem rgba(38, 55, 70, 0.08);
    transition:
        transform 350ms ease,
        border-color 350ms ease,
        background-color 350ms ease,
        box-shadow 350ms ease;
}

.story-path-node span {
    position: relative;
    z-index: 2;
    width: 2.2rem;
    height: 2.2rem;
    display: grid;
    place-items: center;
    margin: 0;
    border: 1px solid rgba(82, 119, 166, 0.38);
    border-radius: 50%;
    color: #5277a6;
    background: #f6f3ed;
    font-size: 0.7rem;
    font-weight: 800;
}

.story-path-node small {
    display: block;
    margin-bottom: 0.3rem;
    color: rgba(38, 55, 70, 0.58);
    font-size: 0.66rem;
    font-weight: 750;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.story-path-node strong {
    display: block;
    font-size: 0.82rem;
    line-height: 1.45;
}

.story-scene-path.is-ai .story-path-node-ai,
.story-scene-path.is-design .story-path-node-design {
    border-color: #5277a6;
    background: #fff;
    box-shadow: 0 1rem 2.4rem rgba(38, 55, 70, 0.13);
    transform: translateX(0.45rem);
}

.story-scene-path.is-ai .story-path-node-ai span,
.story-scene-path.is-design .story-path-node-design span {
    color: #fff;
    border-color: #5277a6;
    background: #5277a6;
}

.story-path-result {
    position: absolute;
    z-index: 4;
    right: 1.35rem;
    bottom: 4.3rem;
    margin: 0;
    color: rgba(38, 55, 70, 0.7);
    font-size: 0.75rem;
    font-weight: 700;
}

.story-scene-proud {
    background:
        radial-gradient(circle at 78% 18%, rgba(255, 231, 173, 0.7), transparent 30%),
        linear-gradient(150deg, #f7f2e9, #dce6ef);
}

.story-code-question {
    position: relative;
    z-index: 4;
    width: min(80%, 28rem);
    padding: clamp(1.5rem, 4vw, 2.5rem);
    border: 1px solid rgba(168, 195, 228, 0.38);
    border-radius: 1.25rem;
    color: #f7f2e9;
    background: rgba(23, 40, 56, 0.92);
    box-shadow: 0 1.5rem 3rem rgba(5, 15, 25, 0.28);
    cursor: pointer;
    text-align: left;
    transition:
        border-color 250ms ease,
        transform 350ms ease,
        background-color 350ms ease;
}

.story-code-question:hover,
.story-code-question:focus-visible,
.story-code-question.is-revealed {
    border-color: #a8c3e4;
    background: rgba(17, 32, 46, 0.98);
    transform: translateY(-0.35rem);
}

.story-code-question > span {
    display: block;
    margin-bottom: 1.5rem;
    color: #a8c3e4;
    font-family: monospace;
    font-size: 0.8rem;
}

.story-code-question strong {
    display: block;
    font-size: clamp(1.7rem, 4vw, 3rem);
    line-height: 1.15;
    letter-spacing: -0.045em;
}

.story-code-question small {
    display: block;
    margin-top: 1.5rem;
    color: rgba(247, 242, 233, 0.58);
    font-size: 0.72rem;
}

.story-scene-ocean {
    background:
        linear-gradient(
            to bottom,
            #a8c3e4 0%,
            #dce6f2 52%,
            #f5f0e7 78%,
            #efd4c0 100%
        );
}

.story-experience[data-active="ocean"] .story-orb:active {
    cursor: grabbing;
}

.story-experience[data-active="ocean"].is-cycle-complete .story-orb {
    --orb-surface: #f3ad82;
    --orb-glow: rgba(239, 127, 91, 0.52);
}

.story-experience[data-active="ocean"].is-cycle-complete .story-scene-ocean {
    filter: saturate(1.08) brightness(0.9);
}

.story-ocean {
    position: absolute;
    z-index: 3;
    right: -5%;
    bottom: -7%;
    left: -5%;
    height: 40%;
    overflow: hidden;
}

.story-ocean span {
    position: absolute;
    right: -8%;
    left: -8%;
    height: 62%;
    border-radius: 50% 50% 0 0;
    background: #5277a6;
}

.story-ocean span:nth-child(1) {
    top: 0;
    opacity: 0.72;
    transform: rotate(2deg);
}

.story-ocean span:nth-child(2) {
    top: 25%;
    opacity: 0.9;
    background: #466b9d;
    transform: rotate(-2deg);
}

.story-ocean span:nth-child(3) {
    top: 52%;
    background: #315778;
}

.story-progress {
    position: absolute;
    z-index: 12;
    right: 1.25rem;
    bottom: 1.1rem;
    left: 1.25rem;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.45rem;
}

.story-progress button {
    position: relative;
    height: 2rem;
    padding: 0;
    border: 0;
    color: rgba(255, 255, 255, 0.55);
    background: transparent;
    cursor: pointer;
    font: inherit;
    font-size: 0.65rem;
}

.story-progress button::before {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 2px;
    background: rgba(255, 255, 255, 0.22);
    content: "";
    transition: background-color 250ms ease;
}

.story-progress button.is-active {
    color: #fff;
}

.story-progress button.is-active::before {
    background: #fff;
}

.story-experience[data-active="run"].is-run-complete .story-stage-top,
.story-experience[data-active="path"] .story-stage-top,
.story-experience[data-active="proud"] .story-stage-top,
.story-experience[data-active="ocean"] .story-stage-top {
    color: rgba(38, 55, 70, 0.72);
}

.story-experience[data-active="run"].is-run-complete .story-progress button,
.story-experience[data-active="path"] .story-progress button,
.story-experience[data-active="proud"] .story-progress button,
.story-experience[data-active="ocean"] .story-progress button {
    color: rgba(38, 55, 70, 0.52);
}

.story-experience[data-active="run"].is-run-complete .story-progress button::before,
.story-experience[data-active="path"] .story-progress button::before,
.story-experience[data-active="proud"] .story-progress button::before,
.story-experience[data-active="ocean"] .story-progress button::before {
    background: rgba(38, 55, 70, 0.22);
}

.story-experience[data-active="run"].is-run-complete .story-progress button.is-active,
.story-experience[data-active="path"] .story-progress button.is-active,
.story-experience[data-active="proud"] .story-progress button.is-active,
.story-experience[data-active="ocean"] .story-progress button.is-active {
    color: #263746;
}

.story-experience[data-active="run"].is-run-complete .story-progress button.is-active::before,
.story-experience[data-active="path"] .story-progress button.is-active::before,
.story-experience[data-active="proud"] .story-progress button.is-active::before,
.story-experience[data-active="ocean"] .story-progress button.is-active::before {
    background: #263746;
}

.story-chapter {
    min-height: 78svh;
    display: flex;
    align-items: center;
    opacity: 0.38;
    transform: translateY(1.5rem);
    transition:
        opacity 450ms ease,
        transform 600ms ease;
    scroll-margin-top: 10vh;
}

.story-chapter.is-active {
    opacity: 1;
    transform: translateY(0);
}

.story-chapter-inner {
    width: 100%;
    padding-left: clamp(1.5rem, 4vw, 3rem);
    border-left: 1px solid var(--story-line);
}

.story-chapter-number {
    display: block;
    margin-bottom: 2.5rem;
    color: var(--story-accent);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.15em;
}

.story-chapter h3 {
    margin: 0.8rem 0 1.4rem;
    color: var(--story-ink);
    font-size: clamp(2.8rem, 5vw, 5rem);
    line-height: 0.95;
    letter-spacing: -0.06em;
}

.story-chapter blockquote {
    margin: 0;
}

.story-chapter blockquote p,
.story-proud-answer {
    max-width: 34rem;
    margin: 0;
    color: var(--story-muted);
    font-size: clamp(1rem, 1.5vw, 1.22rem);
    line-height: 1.75;
}

.story-proud-answer {
    color: var(--story-ink);
    font-size: clamp(1.25rem, 2.1vw, 1.75rem);
    font-weight: 700;
    line-height: 1.5;
    transition:
        opacity 400ms ease,
        filter 400ms ease,
        transform 400ms ease;
}

.story-experience.is-enhanced .story-proud-answer {
    opacity: 0.24;
    filter: blur(3px);
    transform: translateY(0.5rem);
}

.story-experience.is-enhanced .story-chapter.is-revealed .story-proud-answer {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0);
}

.story-action,
.story-path-choices button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    min-height: 2.8rem;
    margin-top: 1.8rem;
    padding: 0.65rem 1rem;
    border: 1px solid var(--story-line);
    border-radius: 999px;
    color: var(--story-ink);
    background: transparent;
    cursor: pointer;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 750;
    text-decoration: none;
    transition:
        color 200ms ease,
        background-color 200ms ease,
        transform 200ms ease;
}

.story-action:hover,
.story-action:focus-visible,
.story-path-choices button:hover,
.story-path-choices button:focus-visible,
.story-path-choices button.is-active {
    color: var(--story-bg);
    background: var(--story-ink);
    transform: translateY(-0.15rem);
}

.story-action:disabled {
    cursor: wait;
    opacity: 0.58;
    transform: none;
}

.story-path-choices {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
}

.story-path-choices button + button {
    margin-left: 0;
}

.story-drag-note {
    margin: 1.2rem 0 0;
    color: var(--story-muted);
    font-size: 0.78rem;
}

.story-action-link {
    width: fit-content;
}

.story-experience button:focus-visible,
.story-experience a:focus-visible {
    outline: 3px solid var(--story-accent);
    outline-offset: 4px;
}

/* RESPONSIVE */

@media (max-width: 1050px) {
    .site-nav {
        display: none;
    }

    .hero-left {
        min-width: 0;
    }

    .hero-left h1,
    .hero-left p,
    .tech-list {
        width: 100%;
        max-width: 100%;
        margin-right: 0;
    }

    .hero-grid,
    .about-grid,
    .project-grid,
    .building-grid {
        grid-template-columns: 1fr;
    }

    .hero-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .hero-right {
        min-height: auto;
    }

    .code-window {
        margin: 0;
    }

    .hero-right::before {
        display: none;
    }

    .code-floating {
        position: static;
        display: inline-block;
        margin: 1rem 0.5rem 0 0;
    }

    .feature-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .admin-preview {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 960px) {
    .story-intro,
    .story-shell {
        width: min(100% - 40px, 44rem);
    }

    .story-intro {
        min-height: 64svh;
    }

    .story-shell {
        grid-template-columns: 1fr;
        gap: 0;
        padding-bottom: 4rem;
    }

    .story-stage-wrap {
        position: sticky;
        z-index: 4;
        top: 5.25rem;
        height: 46svh;
        min-height: 360px;
    }

    .story-stage {
        position: relative;
        top: auto;
        height: 100%;
        min-height: 0;
        border-radius: 1.5rem;
    }

    .story-chapters {
        position: relative;
        z-index: 3;
    }

    .story-chapter {
        min-height: 70svh;
        padding: 4rem 0;
    }

    .story-chapter-inner {
        width: min(100%, 36rem);
        margin: 0 auto;
        padding-left: 1.5rem;
    }
}

@media (max-width: 640px) {
    .site-header-container,
    .portfolio-container {
        width: min(100% - 2rem, 1180px);
    }

    .admin-area-btn {
        display: none;
    }

    .portfolio-hero {
        min-height: auto;
        padding: 3rem 0 4rem;
    }

    .hero-left h1 {
        font-size: clamp(2.15rem, 11vw, 3rem);
    }

    .hero-buttons {
        flex-direction: column;
    }

    .btn-primary,
    .btn-secondary {
        width: 100%;
    }

    .code-window code {
        font-size: 0.78rem;
    }

    .feature-grid {
        grid-template-columns: 1fr;
    }

    .admin-row {
        grid-template-columns: 1fr;
    }

    .story-intro,
    .story-shell {
        width: calc(100% - 32px);
    }

    .story-intro {
        min-height: 64svh;
        padding: 12svh 0 3.5rem;
    }

    .story-intro h2 {
        font-size: clamp(3rem, 17vw, 4.5rem);
    }

    .story-stage-wrap {
        height: 36svh;
        min-height: 240px;
    }

    .story-stage {
        border-radius: 1.2rem;
    }

    .story-stage-top {
        padding: 0.9rem 1rem;
    }

    .story-progress {
        right: 0.9rem;
        bottom: 0.75rem;
        left: 0.9rem;
    }

    .story-scene-hint,
    .story-path-result {
        right: 1rem;
        bottom: 3.7rem;
    }

    .story-path-map {
        width: 86%;
        gap: 0.65rem;
        padding-left: 0.65rem;
    }

    .story-path-map::before {
        top: 1.8rem;
        bottom: 1.8rem;
        left: 1.65rem;
    }

    .story-path-node {
        width: 100%;
        grid-template-columns: 1.75rem minmax(0, 1fr);
        gap: 0.65rem;
        padding: 0.6rem 0.7rem;
    }

    .story-path-node span {
        width: 1.75rem;
        height: 1.75rem;
        font-size: 0.62rem;
    }

    .story-path-node small {
        margin-bottom: 0.18rem;
        font-size: 0.54rem;
    }

    .story-path-node strong {
        font-size: 0.66rem;
    }

    .story-code-question {
        width: 84%;
        padding: 1.35rem;
    }

    .story-chapter {
        min-height: 88svh;
        align-items: flex-end;
        padding: 3.5rem 0;
    }

    .story-chapter-inner {
        padding-left: 1.1rem;
    }

    .story-chapter-number {
        margin-bottom: 1.75rem;
    }

    .story-chapter h3 {
        font-size: clamp(2.6rem, 14vw, 4rem);
    }

    .story-chapter blockquote p,
    .story-proud-answer {
        font-size: 1rem;
        line-height: 1.65;
    }
}

@media (prefers-reduced-motion: reduce) {
    .story-experience,
    .story-experience *,
    .story-experience *::before,
    .story-experience *::after {
        scroll-behavior: auto !important;
        animation: none !important;
        transition-duration: 0.01ms !important;
    }

    .story-transition.is-visible .story-transition-star {
        opacity: 0.72;
        transform: none;
    }

}
